• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Right. Can you please explain to me the things he does wrong in an easy to understand manner? If I shouldn't use Harry Talks, who should I use then? He's seems to have one of the only 1.14 tutorials. Thanks!
    • Hello,    Check out the latest video on AdieCraft   A working Redstone Christmas Tree, with all redstone included in the tree itself.   Check out the video and make sure to subscribe for more!   Flashing Redstone Christmas Tree
    • addButton(new Button(relX + 18, relY + 15, 5, 20, "PURGE", button -> PacketHandler.sendToServer(new PacketButtonClicked(tileEntity.getPos()))));  ????   if that's not right, im gonna snap
    • Was confused at first but I got that figured out! For those that find this thread in the future, parameters are as follows: blit(screenX, screenY, textureX, textureY, width, height)   Certainly. You'll have to excuse the non-cached reflection, I'm trying to at least have it work properly first private static final ResourceLocation HORSE_GUI_TEXTURES = new ResourceLocation("textures/gui/container/horse.png"); private static final Function<IInventory, Slot> SLOT_CREATOR = i -> new Slot(i, 2, 8, 54); @SubscribeEvent public static void addSlotServerSide(PlayerContainerEvent.Open event) { Container container = event.getContainer(); if (container instanceof HorseInventoryContainer) { addSlotToHorseContainer((HorseInventoryContainer) container, SLOT_CREATOR); } } @SubscribeEvent public static void addSlotClientSide(GuiOpenEvent event) { Screen screen = event.getGui(); if (screen instanceof HorseInventoryScreen) { addSlotToHorseContainer(((HorseInventoryScreen) screen).getContainer(), SLOT_CREATOR); } } private static void addSlotToHorseContainer(HorseInventoryContainer container, Function<IInventory, Slot> slotCreator) { try { Field fieldHorseInventory = HorseInventoryContainer.class.getDeclaredField("horseInventory"); IInventory horseInventory = (IInventory) ReflectionUtil.getFieldValue(fieldHorseInventory, container); addSlotReflectively(container, slotCreator.apply(horseInventory)); } catch (ReflectiveOperationException e) { e.printStackTrace(); } } private static void addSlotReflectively(Container container, Slot slot) { try { Method methodAddSlot = Container.class.getDeclaredMethod("addSlot", Slot.class); methodAddSlot.setAccessible(true); methodAddSlot.invoke(container, slot); } catch (ReflectiveOperationException e) { e.printStackTrace(); } } // Some rendering code... this works fine, irrelevant to the slot adding, figured I'd include it anyways @SubscribeEvent public static void renderExtraSlot(GuiContainerEvent.DrawBackground event) { ContainerScreen<?> screen = event.getGuiContainer(); if (screen instanceof HorseInventoryScreen) { GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); Minecraft.getInstance().getTextureManager().bindTexture(HORSE_GUI_TEXTURES); int ySize = screen.getYSize(); int i = (screen.width - screen.getXSize()) / 2; int j = (screen.height - ySize) / 2; // screen x, screen y, texture x, texture y, width, height screen.blit(i + 7, j + 53, 0, ySize, 18, 18); } }   Relevant stacktrace(s): java.lang.ArrayIndexOutOfBoundsException: 2 at java.util.Arrays$ArrayList.set(Arrays.java:3846) ~[?:1.8.0_221] {} at net.minecraft.util.NonNullList.set(NonNullList.java:50) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at net.minecraft.inventory.Inventory.setInventorySlotContents(Inventory.java:114) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at net.minecraft.inventory.container.Slot.putStack(Slot.java:84) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at net.minecraft.inventory.container.Container.slotClick(Container.java:273) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading} at net.minecraft.client.multiplayer.PlayerController.windowClick(PlayerController.java:397) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screen.inventory.ContainerScreen.handleMouseClick(ContainerScreen.java:534) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screen.inventory.ContainerScreen.mouseReleased(ContainerScreen.java:501) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.MouseHelper.lambda$mouseButtonCallback$1(MouseHelper.java:93) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:441) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.MouseHelper.mouseButtonCallback(MouseHelper.java:91) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) ~[lwjgl-glfw-3.2.2.jar:build 10] {} at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.2.jar:build 10] {} at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) ~[lwjgl-glfw-3.2.2.jar:build 10] {} at net.minecraft.client.MainWindow.poll(MainWindow.java:403) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.MainWindow.update(MainWindow.java:273) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.updateDisplay(Minecraft.java:982) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:946) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:384) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:128) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_221] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_221] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_221] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-4.1.0.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-4.1.0.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:101) [forge-1.14.4-28.1.96_mapped_snapshot_20190719-1.14.3-recomp.jar:?] {} -- Head -- Thread: Client thread Stacktrace: at java.util.Arrays$ArrayList.set(Arrays.java:3846) at net.minecraft.util.NonNullList.set(NonNullList.java:50) at net.minecraft.inventory.Inventory.setInventorySlotContents(Inventory.java:114) at net.minecraft.inventory.container.Slot.putStack(Slot.java:84) at net.minecraft.inventory.container.Container.slotClick(Container.java:273) at net.minecraft.client.multiplayer.PlayerController.windowClick(PlayerController.java:397) at net.minecraft.client.gui.screen.inventory.ContainerScreen.handleMouseClick(ContainerScreen.java:534) at net.minecraft.client.gui.screen.inventory.ContainerScreen.mouseReleased(ContainerScreen.java:501) at net.minecraft.client.MouseHelper.lambda$mouseButtonCallback$1(MouseHelper.java:93) -- Affected screen -- Details: Screen name: net.minecraft.client.gui.screen.inventory.HorseInventoryScreen Stacktrace: at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:441) at net.minecraft.client.MouseHelper.mouseButtonCallback(MouseHelper.java:91) at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) at org.lwjgl.system.JNI.invokeV(Native Method) at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) at net.minecraft.client.MainWindow.poll(MainWindow.java:403) at net.minecraft.client.MainWindow.update(MainWindow.java:273)   Worth noting that the listener class is annotated with @EventBusSubscriber(modid = MY_MOD_ID)
    • This does absolutely nothing. Nobody will ever call this method. Use @Override when you intend to override a method. If it gives you an error, you are not actually overriding.
  • Topics

  • Who's Online (See full list)