Skip to content

Commit 3c38f5c

Browse files
committed
#35 Early ME Output Bus implementations (Fluid Bus is WIP); changed the default color of machinery; some bug fixes.
1 parent f9f16d6 commit 3c38f5c

File tree

21 files changed

+568
-164
lines changed

21 files changed

+568
-164
lines changed

build.gradle

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,18 @@ dependencies {
9696
implementation fg.deobf("curse.maven:brandonscore-231382:3051539")
9797
implementation fg.deobf("curse.maven:draconicevolution-223565:3051542")
9898
implementation fg.deobf("curse.maven:the-one-probe-245211:2667280")
99-
100-
implementation fg.deobf("curse.maven:gregtech-293327:3266351")
101-
//Because GTCEu 2.4 and above and NCo crashed, this is to use GTCEu 2.3.4 for testing
102-
//Rendering errors occur when the GTCEu version is tested running, so just compileOnly
103-
compileOnly fg.deobf("curse.maven:gregtech-ce-unofficial-557242:3859788")
104-
10599
implementation fg.deobf("curse.maven:Mekanism-268560:2835175")
106100
implementation fg.deobf("curse.maven:industrialcraft-2-242638:3078604")
107101
implementation fg.deobf("curse.maven:nuclearcraft-overhauled-336895:3862197")
108102
implementation fg.deobf("curse.maven:flux-networks-248020:3178199")
109103
implementation fg.deobf("curse.maven:tinkers-construct-74072:2902483")
110104
implementation fg.deobf("curse.maven:mantle-74924:2713386")
111105
implementation fg.deobf("curse.maven:tx-loader-706505:4515357")
112-
implementation fg.deobf("curse.maven:ae2-extended-life-570458:4646658")
106+
implementation fg.deobf("curse.maven:applied-energistics-2-223794:2747063")
107+
implementation fg.deobf("curse.maven:gregtech-293327:3266351")
108+
//Because GTCEu 2.4 and above and NCo crashed, this is to use GTCEu 2.3.4 for testing
109+
//Rendering errors occur when the GTCEu version is tested running, so just compileOnly
110+
compileOnly fg.deobf("curse.maven:gregtech-ce-unofficial-557242:3859788")
113111
}
114112

115113
jar {

docs/README.md

Lines changed: 2 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,3 @@
1-
# ModularMachinery: Community Edition
1+
# ModularMachinery: Community Edition Wiki
22

3-
Language Select
4-
5-
1. [简体中文](#简体中文)
6-
2. [English](#English)
7-
8-
## 简体中文
9-
10-
社区版皆在使模块化机械变得更加现代化,并提供更多的可自定义内容。
11-
12-
### 增强功能:
13-
14-
* 提供更多对能源输入仓和能源输出仓的能量核心的搜索配置
15-
* 更大的控制器 GUI,供魔改员提供更多的信息显示
16-
17-
### 扩展功能:
18-
19-
* 自定义配方失败操作(默认为 still,来自 [咕咕工具](https://github.com/ParaParty/gugu-utils)
20-
* TheOneProbe 兼容(目前支持配方进度 / 机械状态显示,支持配置)
21-
* 新的配方类型
22-
* 材料组输入
23-
* 催化剂输入
24-
* 每 Tick 流体输入输出
25-
* 基于 CraftTweaker 的高级事件系统和扩展 API
26-
* 5 个配方事件
27-
* 2 个机械事件
28-
* 在 JEI 配方界面添加自定义提示
29-
* 动态物品 NBT 判断与动态物品修改器
30-
* 动态生成、添加和删除的 RecipeModifier
31-
* 动态修改和添加控制器 GUI 状态信息
32-
* 内建可持久化(退出游戏保存数据)的自定义数据储存,支持读取和保存
33-
* 机械控制器 API
34-
* 智能数据接口
35-
* 智能数据接口可以使用 CraftTweaker 来添加自定义功能
36-
* 它可以实现诸如编程电路、速率控制等功能
37-
38-
### 实验性功能:
39-
40-
* 高性能异步实现
41-
* 原版模块化机械提供了很多强大的功能,但是它的运行性能令人堪忧,尤其是有大量机械的情况下。
42-
* 社区版添加了可异步接口,所有实现此接口的都可以安全的以异步形式完成大量工作。
43-
* 根据大量的整合包测试,最高性能提升可达近 **10** 倍。
44-
* 唯一的主线程消耗是检查结构,但是它是**不可能**异步的,因为它在一些第三方插件服务端是**不安全**的操作。
45-
46-
* 重绘 JEI 配方界面图标,支持塞入更多的配方元素
47-
48-
开发中的功能:
49-
50-
* 随机物品输出
51-
* 单方块机械实现
52-
* 并行配方处理
53-
* 工厂实现(类似 Mekanism 中的工厂)
54-
* 合并附属功能
55-
* 为 TheOneProbe 提供更多支持
56-
57-
## English
58-
59-
The Community Edition is all about modernizing the Modular Machinery and providing more customizable content.
60-
61-
### Enhancements:
62-
63-
* More searchable configurations for the DE Energy Core of the Energy Input Hatch and Energy Output Hatch
64-
* Larger controller GUI for more information display by the modpackers
65-
66-
### Expanded Features:
67-
68-
* Custom recipe failure operation (default is still, from [gugu-utils](https://github.com/ParaParty/gugu-utils))
69-
* TheOneProbe compatible (currently supports recipe progress / mechanical status display, supports configuration)
70-
* New recipe types
71-
* Material group input
72-
* Catalyst input
73-
* Per Tick fluid input and output
74-
* Advanced event system and extended API based on CraftTweaker
75-
* 5 recipe events
76-
* 2 mechanical events
77-
* Add custom hints to JEI recipe screen
78-
* Dynamic item NBT determination and dynamic item modifier
79-
* RecipeModifier for dynamic generation, addition and deletion
80-
* Dynamic modification and addition of controller GUI status information
81-
* Built-in customizable data storage with persistence (save data on exit from game), read and save support
82-
* Mechanical controller API
83-
* Smart Data Interface
84-
* Smart Data Interface can be used to add custom functionality using CraftTweaker
85-
* It enables features such as programming circuits, rate control, etc.
86-
87-
### Experimental features:
88-
89-
* High-performance asynchronous implementation
90-
* The original Modular Machinery offers a lot of powerful features, but it runs with worrisome performance, especially with a large number of controllers.
91-
* The community version adds an asynchronizable interface, and all implementations of this interface can safely do a lot of work in an asynchronous form.
92-
* Based on extensive modpack testing, the maximum performance improvement can be over **10** times.
93-
* The only main thread consumed is structure check, but it is **impossible** to do asynchronously because it is **unsafe** to operate on the side of some third-party plugin services.
94-
95-
* Redrawn JEI recipe interface icon to support stuffing more recipe elements
96-
97-
### Features under development.
98-
99-
* Random item output
100-
* Single cube mechanical implementation
101-
* Parallel recipe processing
102-
* Factory implementation (similar to the factory in Mekanism)
103-
* Merging of dependent functions
104-
* Additional support for TheOneProbe
3+
WIP ;P
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package github.kasuminova.mmce.client.gui;
2+
3+
import appeng.client.gui.AEBaseGui;
4+
import github.kasuminova.mmce.common.container.ContainerMEItemOutputBus;
5+
import github.kasuminova.mmce.common.tile.MEItemOutputBus;
6+
import net.minecraft.client.renderer.GlStateManager;
7+
import net.minecraft.client.resources.I18n;
8+
import net.minecraft.entity.player.EntityPlayer;
9+
import net.minecraft.util.ResourceLocation;
10+
11+
public class GuiMEItemOutputBus extends AEBaseGui {
12+
// For convenience, the Sky Chest resource was used :P
13+
private static final ResourceLocation TEXTURES_OUTPUT_BUS = new ResourceLocation("appliedenergistics2", "textures/guis/skychest.png");
14+
15+
public GuiMEItemOutputBus(final MEItemOutputBus te, final EntityPlayer player) {
16+
super(new ContainerMEItemOutputBus(te, player));
17+
this.ySize = 195;
18+
}
19+
20+
@Override
21+
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) {
22+
this.fontRenderer.drawString(I18n.format("gui.meitemoutputbus.title"), 8, 8, 0x404040);
23+
this.fontRenderer.drawString(I18n.format("gui.meitemoutputbus.inventory"), 8, this.ySize - 96 + 2, 0x404040);
24+
}
25+
26+
@Override
27+
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) {
28+
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
29+
this.mc.getTextureManager().bindTexture(TEXTURES_OUTPUT_BUS);
30+
this.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize);
31+
}
32+
33+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
package github.kasuminova.mmce.common.block.appeng;
2+
3+
import github.kasuminova.mmce.common.tile.MEItemOutputBus;
4+
import hellfirepvp.modularmachinery.ModularMachinery;
5+
import hellfirepvp.modularmachinery.common.CommonProxy;
6+
import hellfirepvp.modularmachinery.common.block.BlockMachineComponent;
7+
import hellfirepvp.modularmachinery.common.util.IOInventory;
8+
import hellfirepvp.modularmachinery.common.util.RedstoneHelper;
9+
import net.minecraft.block.SoundType;
10+
import net.minecraft.block.material.Material;
11+
import net.minecraft.block.state.IBlockState;
12+
import net.minecraft.entity.player.EntityPlayer;
13+
import net.minecraft.item.ItemStack;
14+
import net.minecraft.tileentity.TileEntity;
15+
import net.minecraft.util.BlockRenderLayer;
16+
import net.minecraft.util.EnumBlockRenderType;
17+
import net.minecraft.util.EnumFacing;
18+
import net.minecraft.util.EnumHand;
19+
import net.minecraft.util.math.BlockPos;
20+
import net.minecraft.world.World;
21+
import net.minecraftforge.fml.relauncher.Side;
22+
import net.minecraftforge.fml.relauncher.SideOnly;
23+
24+
import javax.annotation.Nonnull;
25+
import javax.annotation.Nullable;
26+
27+
@SuppressWarnings("deprecation")
28+
public class BlockMEItemOutputBus extends BlockMachineComponent {
29+
30+
public BlockMEItemOutputBus() {
31+
super(Material.IRON);
32+
setHardness(2F);
33+
setResistance(10F);
34+
setSoundType(SoundType.METAL);
35+
setHarvestLevel("pickaxe", 1);
36+
setCreativeTab(CommonProxy.creativeTabModularMachinery);
37+
}
38+
39+
@Override
40+
public boolean onBlockActivated(
41+
World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull EntityPlayer playerIn,
42+
@Nonnull EnumHand hand, @Nonnull EnumFacing facing,
43+
float hitX, float hitY, float hitZ) {
44+
if (!worldIn.isRemote) {
45+
TileEntity te = worldIn.getTileEntity(pos);
46+
if (te instanceof MEItemOutputBus) {
47+
playerIn.openGui(ModularMachinery.MODID, CommonProxy.GuiType.ME_ITEM_OUTPUT_BUS.ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ());
48+
}
49+
}
50+
return true;
51+
}
52+
53+
@Override
54+
public void breakBlock(World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
55+
TileEntity te = worldIn.getTileEntity(pos);
56+
if (te instanceof MEItemOutputBus) {
57+
IOInventory inv = ((MEItemOutputBus) te).getInternalInventory();
58+
for (int i = 0; i < inv.getSlots(); i++) {
59+
ItemStack stack = inv.getStackInSlot(i);
60+
if (!stack.isEmpty()) {
61+
spawnAsEntity(worldIn, pos, stack);
62+
inv.setStackInSlot(i, ItemStack.EMPTY);
63+
}
64+
}
65+
}
66+
super.breakBlock(worldIn, pos, state);
67+
}
68+
69+
@Nullable
70+
@Override
71+
public TileEntity createTileEntity(final World world, final IBlockState state) {
72+
return new MEItemOutputBus();
73+
}
74+
75+
@Nonnull
76+
@Override
77+
public EnumBlockRenderType getRenderType(@Nonnull IBlockState state) {
78+
return EnumBlockRenderType.MODEL;
79+
}
80+
81+
@Nonnull
82+
@Override
83+
@SideOnly(Side.CLIENT)
84+
public BlockRenderLayer getRenderLayer() {
85+
return BlockRenderLayer.CUTOUT;
86+
}
87+
88+
@Override
89+
public boolean hasComparatorInputOverride(@Nonnull IBlockState state) {
90+
return true;
91+
}
92+
93+
@Override
94+
public int getComparatorInputOverride(@Nonnull IBlockState blockState, World worldIn, @Nonnull BlockPos pos) {
95+
return RedstoneHelper.getRedstoneLevel(worldIn.getTileEntity(pos));
96+
}
97+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package github.kasuminova.mmce.common.container;
2+
3+
import appeng.container.AEBaseContainer;
4+
import appeng.container.slot.SlotNormal;
5+
import github.kasuminova.mmce.common.tile.MEItemOutputBus;
6+
import net.minecraft.entity.player.EntityPlayer;
7+
8+
public class ContainerMEItemOutputBus extends AEBaseContainer {
9+
private final MEItemOutputBus owner;
10+
11+
public ContainerMEItemOutputBus(final MEItemOutputBus owner, final EntityPlayer player) {
12+
super(player.inventory, owner);
13+
14+
this.owner = owner;
15+
16+
for (int y = 0; y < 4; y++) {
17+
for (int x = 0; x < 9; x++) {
18+
this.addSlotToContainer(new SlotNormal(this.owner.getInternalInventory().asGUIAccess(), y * 9 + x, 8 + 18 * x, 24 + 18 * y));
19+
}
20+
}
21+
22+
this.bindPlayerInventory(getInventoryPlayer(), 0, 195 - /* height of player inventory */ 82);
23+
}
24+
25+
public MEItemOutputBus getOwner() {
26+
return owner;
27+
}
28+
}

0 commit comments

Comments
 (0)