Skip to content

Commit

Permalink
Revert "Merge branch 'main' of https://github.com/RuiXuqi/MEK-1.12.2-v10
Browse files Browse the repository at this point in the history
"

This reverts commit 041ad8b, reversing
changes made to aa8b8d0.
  • Loading branch information
RuiXuqi committed Jan 25, 2023
1 parent c01df87 commit 1498f1e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 101 deletions.
6 changes: 1 addition & 5 deletions GroovyScript-examples/mekanism.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,4 @@ mods.Mekanism.CellExtractor.removeByInput(item('minecraft:iron_ore'))

//CellSeparator
mods.Mekanism.CellSeparator.add(item('minecraft:stone'),item('minecraft:stone:1'),item('minecraft:stone:2'),1)
mods.Mekanism.CellSeparator.removeByInput(item('minecraft:iron_ore'))

//Energized Smelter
//mods.mekanism.Smelter.removeByInput(item('minecraft:gold_ore'))
mods.mekanism.Smelter.add(item('minecraft:iron_ore'),item('minecraft:iron_ingot'))
mods.Mekanism.CellSeparator.removeByInput(item('minecraft:iron_ore'))
27 changes: 8 additions & 19 deletions src/main/java/mekanism/client/gui/GuiFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,47 +84,36 @@ public void initGui() {
this.buttonList.add(this.infuserDumpButton = new GuiButtonImage(1, this.guiLeft+148, this.guiTop+77, 21, 10, 147, 72, 0, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png")){
@Override
public void drawButton(@NotNull Minecraft mc, int mouseX, int mouseY, float partialTicks) {
if (GuiFactory.this.tileEntity.getRecipeType() == RecipeType.INFUSING
|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED
|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.FARM
) {
if (GuiFactory.this.tileEntity.getRecipeType() == RecipeType.INFUSING || GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.FARM) {
super.drawButton(mc, mouseX, mouseY, partialTicks);
}
}

@Override
public boolean mousePressed(@NotNull Minecraft mc, int mouseX, int mouseY) {
return (GuiFactory.this.tileEntity.getRecipeType() == RecipeType.INFUSING
|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED
|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.FARM
) && super.mousePressed(mc, mouseX, mouseY);
return GuiFactory.this.tileEntity.getRecipeType() == RecipeType.INFUSING || GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.FARM && super.mousePressed(mc, mouseX, mouseY);
}
});
}else if (tileEntity.tier == FactoryTier.ULTIMATE){
this.buttonList.add(this.infuserDumpButton = new GuiButtonImage(1, this.guiLeft+182, this.guiTop+77, 21, 10, 147, 72, 0, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png")){
@Override
public void drawButton(@NotNull Minecraft mc, int mouseX, int mouseY, float partialTicks) {
if (GuiFactory.this.tileEntity.getRecipeType() == RecipeType.INFUSING
|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED
|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.FARM) {
if (GuiFactory.this.tileEntity.getRecipeType() == RecipeType.INFUSING || GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.FARM) {
super.drawButton(mc, mouseX, mouseY, partialTicks);
}
}

@Override
public boolean mousePressed(@NotNull Minecraft mc, int mouseX, int mouseY) {
return (GuiFactory.this.tileEntity.getRecipeType() == RecipeType.INFUSING
|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED
|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.FARM
)&& super.mousePressed(mc, mouseX, mouseY);
return (GuiFactory.this.tileEntity.getRecipeType() == RecipeType.INFUSING || GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED || GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.FARM )&& super.mousePressed(mc, mouseX, mouseY);
}
});
}else {
this.buttonList.add(this.infuserDumpButton = new GuiButtonImage(1, this.guiLeft+220, this.guiTop+77, 21, 10, 147, 72, 0, MekanismUtils.getResource(ResourceType.GUI, "GuiMetallurgicInfuser.png")){
@Override
public void drawButton(@NotNull Minecraft mc, int mouseX, int mouseY, float partialTicks) {
if (GuiFactory.this.tileEntity.getRecipeType() == RecipeType.INFUSING
|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED
//|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED
|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.FARM
) {
super.drawButton(mc, mouseX, mouseY, partialTicks);
Expand All @@ -133,10 +122,10 @@ public void drawButton(@NotNull Minecraft mc, int mouseX, int mouseY, float part

@Override
public boolean mousePressed(@NotNull Minecraft mc, int mouseX, int mouseY) {
return (GuiFactory.this.tileEntity.getRecipeType() == RecipeType.INFUSING
|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED
return GuiFactory.this.tileEntity.getRecipeType() == RecipeType.INFUSING
//|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED
|| GuiFactory.this.tileEntity.getRecipeType().getFuelType() == MachineFuelType.FARM
)&& super.mousePressed(mc, mouseX, mouseY);
&& super.mousePressed(mc, mouseX, mouseY);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public class GrSMekanismAdd extends Mekanism {
public Alloy alloy = new Alloy();
public CellExtractor cellExtractor = new CellExtractor();
public CellSeparator cellSeparator = new CellSeparator();
public Smelter smelter = new Smelter();


public GrSMekanismAdd(){
addRegistry(nutritionalLiquifier);
Expand All @@ -37,7 +35,7 @@ public GrSMekanismAdd(){
addRegistry(alloy);
addRegistry(cellExtractor);
addRegistry(cellSeparator);
addRegistry(smelter);

}


Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,16 @@ public boolean isItemValid(ItemStack stack) {
});
addSlotToContainer(new SlotOutput(tileEntity, 3, 180 + 72, 112 ));
}

//如果是这些类型的工厂,则添加额外插槽 --可能会导致shift左键放不进第一个插槽
if(tileEntity.getRecipeType().getFuelType() == MachineFuelType.ADVANCED
|| tileEntity.getRecipeType().getFuelType() == MachineFuelType.FARM
|| tileEntity.getRecipeType() == RecipeType.INFUSING
|| tileEntity.getRecipeType().getFuelType() == MachineFuelType.CHANCE
|| tileEntity.getRecipeType().getFuelType() == MachineFuelType.DOUBLE
){
addSlotToContainer(new Slot(tileEntity, 4, 7, 57));
}
addSlotToContainer(new Slot(tileEntity, 4, 7, 57));
if (tileEntity.tier == FactoryTier.BASIC) {
for (int i = 0; i < tileEntity.tier.processes; i++) {
addSlotToContainer(new FactoryInputSlot(tileEntity, getInputSlotIndex(i), 55 + (i * 38), 13, i));
}
for (int i = 0; i < tileEntity.tier.processes; i++) {
addSlotToContainer(new SlotOutput(tileEntity, getOutputSlotIndex(i), 55 + (i * 38), 57));
// if (tileEntity.getRecipeType() == RecipeType.SAWING||tileEntity.getRecipeType() == RecipeType.FARM){
// addSlotToContainer(new SlotOutput(tileEntity,getsecondaryOutputSlotIndex(i),55+(i * 38), 57+18));
// }
}

} else if (tileEntity.tier == FactoryTier.ADVANCED) {
Expand Down Expand Up @@ -103,8 +97,6 @@ public boolean isItemValid(ItemStack stack) {
addSlotToContainer(new SlotOutput(tileEntity, getOutputSlotIndex(i), 27 + (i * 19), 57));
}
}


}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,7 @@ public boolean canReceiveGas(EnumFacing side, Gas type) {
@Override
public int receiveGas(EnumFacing side, GasStack stack, boolean doTransfer) {
if (canReceiveGas(side, stack.getGas())) {
if (stack == null) {
return 0;
}
int recipeAmount = Recipe.CHEMICAL_CRYSTALLIZER.get().get(new GasInput(stack)).recipeInput.ingredient.amount;
int receivable = inputTank.receive(stack, false);
int stored = inputTank.stored != null ? inputTank.stored.amount : 0;
int newStored = stored + receivable;

int amount = newStored - stored - newStored % recipeAmount;

return inputTank.receive(stack.copy().withAmount(amount), doTransfer);
return inputTank.receive(stack, doTransfer);
}
return 0;
}
Expand Down

0 comments on commit 1498f1e

Please sign in to comment.