diff --git a/src/main/java/wayoftime/bloodmagic/client/screens/ScreenAlchemyTable.java b/src/main/java/wayoftime/bloodmagic/client/screens/ScreenAlchemyTable.java index 03ce861e..ccaa7574 100644 --- a/src/main/java/wayoftime/bloodmagic/client/screens/ScreenAlchemyTable.java +++ b/src/main/java/wayoftime/bloodmagic/client/screens/ScreenAlchemyTable.java @@ -1,22 +1,32 @@ package wayoftime.bloodmagic.client.screens; import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.platform.GlStateManager.DestFactor; +import com.mojang.blaze3d.platform.GlStateManager.SourceFactor; import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.widget.button.Button; import net.minecraft.entity.player.PlayerInventory; -import net.minecraft.inventory.IInventory; import net.minecraft.inventory.container.Slot; +import net.minecraft.util.Direction; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TranslationTextComponent; import wayoftime.bloodmagic.BloodMagic; +import wayoftime.bloodmagic.network.AlchemyTableButtonPacket; +import wayoftime.bloodmagic.network.BloodMagicPacketHandler; import wayoftime.bloodmagic.tile.TileAlchemyTable; import wayoftime.bloodmagic.tile.container.ContainerAlchemyTable; public class ScreenAlchemyTable extends ScreenBase { private static final ResourceLocation background = new ResourceLocation(BloodMagic.MODID, "textures/gui/alchemytable.png"); - public IInventory tileTable; + public TileAlchemyTable tileTable; + + private int left, top; public ScreenAlchemyTable(ContainerAlchemyTable container, PlayerInventory playerInventory, ITextComponent title) { @@ -39,6 +49,23 @@ public class ScreenAlchemyTable extends ScreenBase this.font.func_243248_b(stack, new TranslationTextComponent("container.inventory"), 8, 111, 4210752); } + @Override + public void init() + { + super.init(); + left = (this.width - this.xSize) / 2; + top = (this.height - this.ySize) / 2; + + this.buttons.clear(); +// this.buttons.add(); + this.addButton(new Button(left + 135, top + 52, 14, 14, new StringTextComponent("D"), new DirectionalPress(tileTable, Direction.DOWN))); + this.addButton(new Button(left + 153, top + 52, 14, 14, new StringTextComponent("U"), new DirectionalPress(tileTable, Direction.UP))); + this.addButton(new Button(left + 135, top + 70, 14, 14, new StringTextComponent("N"), new DirectionalPress(tileTable, Direction.NORTH))); + this.addButton(new Button(left + 153, top + 70, 14, 14, new StringTextComponent("S"), new DirectionalPress(tileTable, Direction.SOUTH))); + this.addButton(new Button(left + 135, top + 88, 14, 14, new StringTextComponent("W"), new DirectionalPress(tileTable, Direction.WEST))); + this.addButton(new Button(left + 153, top + 88, 14, 14, new StringTextComponent("E"), new DirectionalPress(tileTable, Direction.EAST))); + } + @Override protected void drawGuiContainerBackgroundLayer(MatrixStack stack, float partialTicks, int mouseX, int mouseY) { @@ -49,19 +76,54 @@ public class ScreenAlchemyTable extends ScreenBase this.blit(stack, i, j, 0, 0, this.xSize, this.ySize); int l = this.getCookProgressScaled(90); - this.blit(stack, i + 115, j + 14 + 90 - l, 176, 90 - l, 18, l); + this.blit(stack, i + 106, j + 14 + 90 - l, 176, 90 - l, 18, l); - for (int slotId = 0; slotId < 6; slotId++) + int slotId = tileTable.activeSlot; + if (slotId != -1) { - if (!((TileAlchemyTable) tileTable).isInputSlotAccessible(slotId)) - { - Slot slot = this.getContainer().getSlot(slotId); + Slot slot = this.getContainer().getSlot(slotId); - this.blit(stack, i + slot.xPos, j + slot.yPos, 195, 1, 16, 16); + if (slotId == TileAlchemyTable.outputSlot) + { + this.blit(stack, i + slot.xPos, j + slot.yPos, 195, 37, 16, 16); + } else + { + this.blit(stack, i + slot.xPos, j + slot.yPos, 195, 19, 16, 16); + } + + for (int buttonId = 0; buttonId < 6; buttonId++) + { + int xOffset = (buttonId % 2) * 18 + 133; + int yOffset = (buttonId / 2) * 18 + 50; + if (tileTable.isSlotEnabled(slotId, Direction.byIndex(buttonId))) + { + this.blit(stack, i + xOffset, j + yOffset, 212, 18, 18, 18); + } else + { + this.blit(stack, i + xOffset, j + yOffset, 212, 0, 18, 18); + } } } + +// for (int slotId = 0; slotId < 6; slotId++) +// { +// if (!((TileAlchemyTable) tileTable).isInputSlotAccessible(slotId)) +// { +// Slot slot = this.getContainer().getSlot(slotId); +// +// this.blit(stack, i + slot.xPos, j + slot.yPos, 195, 1, 16, 16); +// } +// } } +// @Override +// public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) +// { +// boolean superMouse = super.mouseClicked(mouseX, mouseY, mouseButton); +// System.out.println("Last button clicked: " + mouseButton); +// return superMouse; +// } + // public int getCookProgressScaled(int scale) { @@ -74,4 +136,93 @@ public class ScreenAlchemyTable extends ScreenBase // System.out.println(this.container.data.get(0)); return (int) (progress * scale); } + + public class DirectionalButton extends Button + { + private static final int BUTTON_TEX_X = 200, BUTTON_TEX_Y = 60; + + public DirectionalButton(int x, int y, int width, int height, ITextComponent title, IPressable pressedAction) + { + super(x, y, width, height, title, pressedAction); + } + + @Override + public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) + { + Minecraft minecraft = Minecraft.getInstance(); + FontRenderer fontrenderer = minecraft.fontRenderer; + minecraft.getTextureManager().bindTexture(WIDGETS_LOCATION); + + // Vanilla's method +// RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha); +// int i = this.getYImage(this.isHovered()); +// RenderSystem.enableBlend(); +// RenderSystem.defaultBlendFunc(); +// RenderSystem.enableDepthTest(); +// this.blit(matrixStack, this.x, this.y, 0, 46 + i * 20, this.width / 2, this.height); +// this.blit(matrixStack, this.x + this.width / 2, this.y, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height); +// this.renderBg(matrixStack, minecraft, mouseX, mouseY); +// int j = getFGColor(); +// drawCenteredString(matrixStack, fontrenderer, this.getMessage(), this.x + this.width / 2, this.y + (this.height - 8) / 2, j | MathHelper.ceil(this.alpha * 255.0F) << 24); + + // Mekanism's method + int i = this.getYImage(this.isHovered()); + RenderSystem.enableBlend(); + RenderSystem.blendFuncSeparate(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA, SourceFactor.ONE, DestFactor.ZERO); + RenderSystem.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA); + + int width = this.width; + int height = this.height; + int halfWidthLeft = width / 2; + int halfWidthRight = width % 2 == 0 ? halfWidthLeft : halfWidthLeft + 1; + int halfHeightTop = height / 2; + int halfHeightBottom = height % 2 == 0 ? halfHeightTop : halfHeightTop + 1; + int position = i * 20; + + // Left Top Corner + blit(matrixStack, x, y, 0, position, halfWidthLeft, halfHeightTop, BUTTON_TEX_X, BUTTON_TEX_Y); + // Left Bottom Corner + blit(matrixStack, x, y + halfHeightTop, 0, position + 20 - halfHeightBottom, halfWidthLeft, halfHeightBottom, BUTTON_TEX_X, BUTTON_TEX_Y); + // Right Top Corner + blit(matrixStack, x + halfWidthLeft, y, 200 - halfWidthRight, position, halfWidthRight, halfHeightTop, BUTTON_TEX_X, BUTTON_TEX_Y); + // Right Bottom Corner + blit(matrixStack, x + halfWidthLeft, y + halfHeightTop, 200 - halfWidthRight, position + 20 - halfHeightBottom, halfWidthRight, halfHeightBottom, BUTTON_TEX_X, BUTTON_TEX_Y); + renderBg(matrixStack, minecraft, mouseX, mouseY); + RenderSystem.disableBlend(); + + if (this.isHovered()) + { + this.renderToolTip(matrixStack, mouseX, mouseY); + } + } + } + + public class DirectionalPress implements Button.IPressable + { + private final TileAlchemyTable table; + private final Direction direction; + + public DirectionalPress(TileAlchemyTable table, Direction direction) + { + this.table = table; + this.direction = direction; + } + + @Override + public void onPress(Button button) + { +// System.out.println("Pressing le " + direction.toString() + " button, beign oui!"); + int activeSlot = table.activeSlot; + if (activeSlot != -1) + { + boolean enabled = table.isSlotEnabled(activeSlot, direction); + table.setSlotEnabled(!enabled, activeSlot, direction); + BloodMagicPacketHandler.INSTANCE.sendToServer(new AlchemyTableButtonPacket(table.getPos(), activeSlot, direction, !enabled)); + } +//// if (button.visible) +// { +// button.visible = !button.visible; +// } + } + } } \ No newline at end of file diff --git a/src/main/java/wayoftime/bloodmagic/impl/BloodMagicRecipeRegistrar.java b/src/main/java/wayoftime/bloodmagic/impl/BloodMagicRecipeRegistrar.java index 3fc055e1..ee31e7b1 100644 --- a/src/main/java/wayoftime/bloodmagic/impl/BloodMagicRecipeRegistrar.java +++ b/src/main/java/wayoftime/bloodmagic/impl/BloodMagicRecipeRegistrar.java @@ -1,6 +1,7 @@ package wayoftime.bloodmagic.impl; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Set; @@ -16,12 +17,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; +import wayoftime.bloodmagic.common.recipe.BloodMagicRecipeType; import wayoftime.bloodmagic.recipe.RecipeARC; import wayoftime.bloodmagic.recipe.RecipeAlchemyArray; import wayoftime.bloodmagic.recipe.RecipeAlchemyTable; import wayoftime.bloodmagic.recipe.RecipeBloodAltar; import wayoftime.bloodmagic.recipe.RecipeTartaricForge; -import wayoftime.bloodmagic.common.recipe.BloodMagicRecipeType; public class BloodMagicRecipeRegistrar { @@ -214,8 +215,9 @@ public class BloodMagicRecipeRegistrar public Set getCraftingAlchemyArrayRecipes(World world) { - Set recipes = Set.copyOf(world.getRecipeManager().getRecipesForType(BloodMagicRecipeType.ARRAY)); - Set copyRecipes = Set.of(); + Set recipes = new HashSet(world.getRecipeManager().getRecipesForType(BloodMagicRecipeType.ARRAY)); + + Set copyRecipes = new HashSet(); for (RecipeAlchemyArray recipe : recipes) { if (!recipe.getOutput().isEmpty()) diff --git a/src/main/java/wayoftime/bloodmagic/network/AlchemyTableButtonPacket.java b/src/main/java/wayoftime/bloodmagic/network/AlchemyTableButtonPacket.java new file mode 100644 index 00000000..4202043c --- /dev/null +++ b/src/main/java/wayoftime/bloodmagic/network/AlchemyTableButtonPacket.java @@ -0,0 +1,76 @@ +package wayoftime.bloodmagic.network; + +import java.util.function.Supplier; + +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.network.PacketBuffer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.fml.network.NetworkEvent.Context; +import wayoftime.bloodmagic.tile.TileAlchemyTable; + +public class AlchemyTableButtonPacket +{ + private BlockPos pos; + private int slot; + private Direction dir; + private boolean enable; + + public AlchemyTableButtonPacket() + { + this(BlockPos.ZERO, 0, Direction.DOWN, true); + } + + public AlchemyTableButtonPacket(BlockPos pos, int slot, Direction dir, boolean enable) + { + this.pos = pos; + this.slot = slot; + this.dir = dir; + this.enable = enable; + } + + public static void encode(AlchemyTableButtonPacket pkt, PacketBuffer buf) + { + buf.writeBlockPos(pkt.pos); + buf.writeInt(pkt.slot); + buf.writeInt(pkt.dir.ordinal()); + buf.writeBoolean(pkt.enable); + } + + public static AlchemyTableButtonPacket decode(PacketBuffer buf) + { + AlchemyTableButtonPacket pkt = new AlchemyTableButtonPacket(buf.readBlockPos(), buf.readInt(), Direction.byIndex(buf.readInt()), buf.readBoolean()); + + return pkt; + } + + public static void handle(AlchemyTableButtonPacket message, Supplier context) + { + context.get().enqueueWork(() -> { + PlayerEntity player = context.get().getSender(); + if (player == null) + { + return; + } + TileEntity tile = player.getEntityWorld().getTileEntity(message.pos); + if (tile instanceof TileAlchemyTable) + { + ((TileAlchemyTable) tile).setSlotEnabled(message.enable, message.slot, message.dir); + } + }); + context.get().setPacketHandled(true); + } + +// @OnlyIn(Dist.CLIENT) +// public static void updateTanks(BlockPos pos, CompoundNBT inputNBT, CompoundNBT outputNBT) +// { +// World world = Minecraft.getInstance().world; +// TileEntity tile = world.getTileEntity(pos); +// if (tile instanceof TileAlchemicalReactionChamber) +// { +// ((TileAlchemicalReactionChamber) tile).inputTank.readFromNBT(inputNBT); +// ((TileAlchemicalReactionChamber) tile).outputTank.readFromNBT(outputNBT); +// } +// } +} \ No newline at end of file diff --git a/src/main/java/wayoftime/bloodmagic/network/BloodMagicPacketHandler.java b/src/main/java/wayoftime/bloodmagic/network/BloodMagicPacketHandler.java index b6557df5..fd0d365c 100644 --- a/src/main/java/wayoftime/bloodmagic/network/BloodMagicPacketHandler.java +++ b/src/main/java/wayoftime/bloodmagic/network/BloodMagicPacketHandler.java @@ -20,6 +20,7 @@ public class BloodMagicPacketHandler extends BasePacketHandler registerClientToServer(KeyProcessorPacket.class, KeyProcessorPacket::encode, KeyProcessorPacket::decode, KeyProcessorPacket::handle); registerClientToServer(SigilHoldingPacket.class, SigilHoldingPacket::encode, SigilHoldingPacket::decode, SigilHoldingPacket::handle); + registerClientToServer(AlchemyTableButtonPacket.class, AlchemyTableButtonPacket::encode, AlchemyTableButtonPacket::decode, AlchemyTableButtonPacket::handle); // INSTANCE.registerMessage(id, messageType, encoder, decoder, messageConsumer); // INSTANCE.registerMessage(ChatUtil.PacketNoSpamChat.Handler.class, ChatUtil.PacketNoSpamChat.class, 0, Side.CLIENT); // INSTANCE.registerMessage(ItemRouterButtonPacketProcessor.class, ItemRouterButtonPacketProcessor.class, 1, Side.SERVER); diff --git a/src/main/java/wayoftime/bloodmagic/tile/TileAlchemyTable.java b/src/main/java/wayoftime/bloodmagic/tile/TileAlchemyTable.java index 85ad6b3f..02d9ec37 100644 --- a/src/main/java/wayoftime/bloodmagic/tile/TileAlchemyTable.java +++ b/src/main/java/wayoftime/bloodmagic/tile/TileAlchemyTable.java @@ -53,6 +53,16 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory, public BlockPos connectedPos = BlockPos.ZERO; public boolean[] blockedSlots = new boolean[] { false, false, false, false, false, false }; + public boolean[] allowedDirectionsSlot0 = new boolean[] { false, false, true, true, true, true }; + public boolean[] allowedDirectionsSlot1 = new boolean[] { false, false, true, true, true, true }; + public boolean[] allowedDirectionsSlot2 = new boolean[] { false, false, true, true, true, true }; + public boolean[] allowedDirectionsSlot3 = new boolean[] { false, false, true, true, true, true }; + public boolean[] allowedDirectionsSlot4 = new boolean[] { false, false, true, true, true, true }; + public boolean[] allowedDirectionsSlot5 = new boolean[] { false, false, true, true, true, true }; + public boolean[] allowedDirectionsOrb = new boolean[] { false, true, false, false, false, false }; + public boolean[] allowedDirectionsOutput = new boolean[] { true, false, false, false, false, false }; + + public int activeSlot = -1; public TileAlchemyTable(TileEntityType type) { @@ -91,6 +101,62 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory, blockedSlots[slot] = !blockedSlots[slot]; } + public boolean isSlotEnabled(int slot, Direction dir) + { + switch (slot) + { + case 0: + return allowedDirectionsSlot0[dir.ordinal()]; + case 1: + return allowedDirectionsSlot1[dir.ordinal()]; + case 2: + return allowedDirectionsSlot2[dir.ordinal()]; + case 3: + return allowedDirectionsSlot3[dir.ordinal()]; + case 4: + return allowedDirectionsSlot4[dir.ordinal()]; + case 5: + return allowedDirectionsSlot5[dir.ordinal()]; + case 6: + return allowedDirectionsOrb[dir.ordinal()]; + case 7: + return allowedDirectionsOutput[dir.ordinal()]; + } + + return false; + } + + public void setSlotEnabled(boolean enabled, int slot, Direction dir) + { + switch (slot) + { + case 0: + allowedDirectionsSlot0[dir.ordinal()] = enabled; + break; + case 1: + allowedDirectionsSlot1[dir.ordinal()] = enabled; + break; + case 2: + allowedDirectionsSlot2[dir.ordinal()] = enabled; + break; + case 3: + allowedDirectionsSlot3[dir.ordinal()] = enabled; + break; + case 4: + allowedDirectionsSlot4[dir.ordinal()] = enabled; + break; + case 5: + allowedDirectionsSlot5[dir.ordinal()] = enabled; + break; + case 6: + allowedDirectionsOrb[dir.ordinal()] = enabled; + break; + case 7: + allowedDirectionsOutput[dir.ordinal()] = enabled; + break; + } + } + @Override public void deserialize(CompoundNBT tag) { @@ -105,6 +171,16 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory, byte[] array = tag.getByteArray("blockedSlots"); for (int i = 0; i < array.length; i++) blockedSlots[i] = array[i] != 0; + + for (int i = 0; i <= outputSlot; i++) + { + byte[] allowedSlotArray = tag.getByteArray("allowedDirections" + i); + for (int j = 0; j < Math.min(allowedSlotArray.length, Direction.values().length); j++) + { + this.setSlotEnabled(allowedSlotArray[j] == 1 ? true : false, i, Direction.values()[j]); + } +// tag.putByteArray("allowedDirections" + i, allowedSlotArray); + } } @Override @@ -125,6 +201,17 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory, for (int i = 0; i < blockedSlots.length; i++) blockedSlotArray[i] = (byte) (blockedSlots[i] ? 1 : 0); tag.putByteArray("blockedSlots", blockedSlotArray); + + for (int i = 0; i <= outputSlot; i++) + { + byte[] allowedSlotArray = new byte[Direction.values().length]; + for (int j = 0; j < Direction.values().length; j++) + { + allowedSlotArray[j] = (byte) (this.isSlotEnabled(i, Direction.values()[j]) ? 1 : 0); + } + tag.putByteArray("allowedDirections" + i, allowedSlotArray); + } + return tag; } @@ -152,43 +239,68 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory, @Override public int[] getSlotsForFace(Direction side) { - switch (side) + List integerList = new ArrayList(); + for (int i = 0; i <= outputSlot; i++) { - case DOWN: - return new int[] { outputSlot }; - case UP: - return new int[] { orbSlot }; - default: - return new int[] { 0, 1, 2, 3, 4, 5 }; + if (this.isSlotEnabled(i, side)) + { + integerList.add(i); + } } + + int[] intArray = new int[integerList.size()]; + for (int i = 0; i < intArray.length; i++) + { + intArray[i] = integerList.get(i); + } + + return intArray; +// switch (side) +// { +// case DOWN: +// return new int[] { outputSlot }; +// case UP: +// return new int[] { orbSlot }; +// default: +// return new int[] { 0, 1, 2, 3, 4, 5 }; +// } } @Override public boolean canInsertItem(int index, ItemStack stack, Direction direction) { - switch (direction) + switch (index) { - case DOWN: - return index != outputSlot && index != orbSlot; - case UP: - if (index == orbSlot && !stack.isEmpty() && stack.getItem() instanceof IBloodOrb) - { - return true; - } else - { - return true; - } + case outputSlot: + return false; + case orbSlot: + return !stack.isEmpty() && stack.getItem() instanceof IBloodOrb; default: - if (this.isSlave) - { - TileEntity tile = getWorld().getTileEntity(connectedPos); - if (tile instanceof TileAlchemyTable && !((TileAlchemyTable) tile).isSlave) - { - return ((TileAlchemyTable) tile).canInsertItem(index, stack, direction); - } - } - return getAccessibleInputSlots(direction).contains(index); + return this.isSlotEnabled(index, direction); } +// switch (direction) +// { +// case DOWN: +// return index != outputSlot && index != orbSlot; +// case UP: +// if (index == orbSlot && !stack.isEmpty() && stack.getItem() instanceof IBloodOrb) +// { +// return true; +// } else +// { +// return true; +// } +// default: +// if (this.isSlave) +// { +// TileEntity tile = getWorld().getTileEntity(connectedPos); +// if (tile instanceof TileAlchemyTable && !((TileAlchemyTable) tile).isSlave) +// { +// return ((TileAlchemyTable) tile).canInsertItem(index, stack, direction); +// } +// } +// return getAccessibleInputSlots(direction).contains(index); +// } } @Override @@ -196,26 +308,8 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory, { switch (direction) { - case DOWN: - return index == outputSlot; - case UP: - if (index == orbSlot && !stack.isEmpty() && stack.getItem() instanceof IBloodOrb) - { - return true; - } else - { - return true; - } default: - if (this.isSlave) - { - TileEntity tile = getWorld().getTileEntity(connectedPos); - if (tile instanceof TileAlchemyTable && !((TileAlchemyTable) tile).isSlave) - { - return ((TileAlchemyTable) tile).canExtractItem(index, stack, direction); - } - } - return getAccessibleInputSlots(direction).contains(index); + return this.isSlotEnabled(index, direction); } } @@ -424,14 +518,15 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory, // // } + if (!inputStack.isDamageable()) + { + continue; + } if (inputStack.attemptDamageItem(1, world.rand, null)) { setInventorySlotContents(i, ItemStack.EMPTY); } continue; - } else if (!inputStack.isDamageable()) - { - continue; } inputStack.shrink(1); diff --git a/src/main/java/wayoftime/bloodmagic/tile/container/ContainerAlchemyTable.java b/src/main/java/wayoftime/bloodmagic/tile/container/ContainerAlchemyTable.java index c8fe9fa3..ab509370 100644 --- a/src/main/java/wayoftime/bloodmagic/tile/container/ContainerAlchemyTable.java +++ b/src/main/java/wayoftime/bloodmagic/tile/container/ContainerAlchemyTable.java @@ -44,7 +44,7 @@ public class ContainerAlchemyTable extends Container this.addSlot(new Slot(tileTable, 3, 26, 87)); this.addSlot(new Slot(tileTable, 4, 8, 51)); this.addSlot(new Slot(tileTable, 5, 26, 15)); - this.addSlot(new SlotOrb(tileTable, TileAlchemyTable.orbSlot, 152, 51)); + this.addSlot(new SlotOrb(tileTable, TileAlchemyTable.orbSlot, 143, 24)); this.addSlot(new SlotOutput(tileTable, TileAlchemyTable.outputSlot, 44, 51)); for (int i = 0; i < 3; i++) @@ -66,12 +66,19 @@ public class ContainerAlchemyTable extends Container { PlayerInventory inventoryPlayer = player.inventory; - if (slotId < 6 && slotId >= 0) + if (slotId <= TileAlchemyTable.outputSlot && slotId >= 0) { Slot slot = this.getSlot(slotId); if (!slot.getHasStack() && inventoryPlayer.getItemStack().isEmpty()) { - ((TileAlchemyTable) tileTable).toggleInputSlotAccessible(slotId); +// ((TileAlchemyTable) tileTable).toggleInputSlotAccessible(slotId); + if (tileTable.activeSlot == slotId) + { + tileTable.activeSlot = -1; + } else + { + tileTable.activeSlot = slotId; + } } } diff --git a/src/main/resources/assets/bloodmagic/textures/gui/alchemytable.png b/src/main/resources/assets/bloodmagic/textures/gui/alchemytable.png index 492416f9..a92eac01 100644 Binary files a/src/main/resources/assets/bloodmagic/textures/gui/alchemytable.png and b/src/main/resources/assets/bloodmagic/textures/gui/alchemytable.png differ