Merge remote-tracking branch 'remotes/origin/1.10.2-v1' into 1.11 #betabuild
# Conflicts: # build.gradle # src/main/java/techreborn/client/container/ContainerAlloyFurnace.java # src/main/java/techreborn/items/tools/ItemWrench.java
This commit is contained in:
commit
3f8128d890
7 changed files with 73 additions and 23 deletions
|
@ -2,12 +2,23 @@ package techreborn.client.container;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.SlotFurnaceFuel;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.api.recipe.IBaseRecipeType;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||
import techreborn.api.recipe.recipeConfig.RecipeConfigManager;
|
||||
import techreborn.tiles.TileAlloyFurnace;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ContainerAlloyFurnace extends RebornContainer {
|
||||
|
||||
public int tickTime;
|
||||
|
@ -22,8 +33,8 @@ public class ContainerAlloyFurnace extends RebornContainer {
|
|||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tileAlloyfurnace.inventory, 0, 47, 17));
|
||||
this.addSlotToContainer(new BaseSlot(tileAlloyfurnace.inventory, 1, 65, 17));
|
||||
this.addSlotToContainer(new SlotInputCustom(tileAlloyfurnace.inventory, 0, 47, 17, 0));
|
||||
this.addSlotToContainer(new SlotInputCustom(tileAlloyfurnace.inventory, 1, 65, 17, 1));
|
||||
// outputs
|
||||
this.addSlotToContainer(new SlotOutput(tileAlloyfurnace.inventory, 2, 116, 35));
|
||||
// Fuel
|
||||
|
@ -42,6 +53,30 @@ public class ContainerAlloyFurnace extends RebornContainer {
|
|||
}
|
||||
}
|
||||
|
||||
public static class SlotInputCustom extends reborncore.client.gui.slots.BaseSlot {
|
||||
|
||||
int recipeSlot = 0;
|
||||
|
||||
public SlotInputCustom(IInventory inventoryIn, int index, int xPosition, int yPosition, int recipeSlot) {
|
||||
super(inventoryIn, index, xPosition, yPosition);
|
||||
this.recipeSlot = recipeSlot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(
|
||||
@Nullable
|
||||
ItemStack stack) {
|
||||
for(IBaseRecipeType recipe : RecipeHandler.recipeList){
|
||||
if(recipe instanceof AlloySmelterRecipe){
|
||||
if(ItemUtils.isItemEqual(recipe.getInputs().get(recipeSlot), stack, true, true, true)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
|
|
|
@ -36,8 +36,8 @@ public class ContainerAlloySmelter extends ContainerCrafting {
|
|||
public void addInventorySlots() {
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new SlotInput(tile.inventory, 0, 47, 17));
|
||||
this.addSlotToContainer(new SlotInput(tile.inventory, 1, 65, 17));
|
||||
this.addSlotToContainer(new ContainerAlloyFurnace.SlotInputCustom(tile.inventory, 0, 47, 17, 0));
|
||||
this.addSlotToContainer(new ContainerAlloyFurnace.SlotInputCustom(tile.inventory, 1, 65, 17, 1));
|
||||
// outputs
|
||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 2, 116, 35));
|
||||
// battery
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue