Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Insane96MCP

Members
  • Joined

  • Last visited

Everything posted by Insane96MCP

  1. Yeah but I need to update data during the use of the tile entity
  2. Tileentity data to the client
  3. Should I send a reply to a packet manually since I can't return a packet from the Runnable?
  4. Just had to send a response packet, get the gui and set the value But now I'm having another problem. I get a classCastException when trying to open the gui at https://github.com/Insane-96/XpHolder/blob/master/common/net/insane96mcp/xpholder/block/BlockXpHolder.java#L43 java.util.concurrent.ExecutionException: java.lang.ClassCastException: net.insane96mcp.xpholder.tileentity.TileEntityXpHolder cannot be cast to net.minecraft.inventory.Container at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_161] at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_161] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:796) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:741) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192) [IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:590) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161] Caused by: java.lang.ClassCastException: net.insane96mcp.xpholder.tileentity.TileEntityXpHolder cannot be cast to net.minecraft.inventory.Container at net.minecraftforge.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:254) ~[NetworkRegistry.class:?] at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:87) ~[FMLNetworkHandler.class:?] at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2809) ~[EntityPlayer.class:?] at net.insane96mcp.xpholder.block.BlockXpHolder.onBlockActivated(BlockXpHolder.java:45) ~[BlockXpHolder.class:?] at net.minecraft.server.management.PlayerInteractionManager.processRightClickBlock(PlayerInteractionManager.java:472) ~[PlayerInteractionManager.class:?] at net.minecraft.network.NetHandlerPlayServer.processTryUseItemOnBlock(NetHandlerPlayServer.java:767) ~[NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:68) ~[CPacketPlayerTryUseItemOnBlock.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:13) ~[CPacketPlayerTryUseItemOnBlock.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_161] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_161] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 5 more I don't need a container that's why I've extended a TileEntity and not a Container
  5. But how can I set a field in the TestGui from the packet handler? https://github.com/Insane-96/XpHolder/blob/master/common/net/insane96mcp/xpholder/network/GetXpHeldMessageHandler.java#L29
  6. I'm trying to get data from tileentity for the gui, but I can't figure out how to get the tileentity (or the position) from the gui. I'm using network to get data, but I really don't know how to receive those. GuiCode: https://github.com/Insane-96/XpHolder/blob/master/common/net/insane96mcp/xpholder/gui/TestGui.java#L108 Packet Used: https://github.com/Insane-96/XpHolder/blob/master/common/net/insane96mcp/xpholder/network/DepositMessage.java And handler: https://github.com/Insane-96/XpHolder/blob/master/common/net/insane96mcp/xpholder/network/DepositMessageHandler.java I'm stuck because I don't know how to get the pos from the gui.
  7. I have this simple test GUI I'm using to learn GUIs, but I'm stuck. When the gui is opened it shows only 1/4th of the texture The texture is this one (128x128): I get this in-game I really don't know if I'm missing something.
  8. I'm trying to do something like what poison and wither do. They change hearths appearance. I really can't find how minecraft does that.
  9. I'm trying to replace the Poison effect by doing IForgeRegistryModifiable modRegistry = (IForgeRegistryModifiable) event.getRegistry(); ResourceLocation potionName = new ResourceLocation("minecraft", "poison"); AlteredPoison alteredPoison = new AlteredPoison(true, Potion.getPotionFromResourceLocation("minecraft:poison").getLiquidColor()); alteredPoison.setRegistryName(potionName); alteredPoison.setPotionName("effect.poison"); alteredPoison.setIconIndex(6, 0); modRegistry.register(alteredPoison); The effect works when using the /effect command, but as soon as I use a Potion (splash, drinkable, ...) of Poison the effect seems to be applied but is not. Particles spawn but nothing happens. Edit: Even tried using ForgeRegistries.POTIONS.register(alteredPoison) but with no luck.
  10. And how I can add compatbility then?
  11. What if there's a method that returns an object of other mod's class type?
  12. "betterwithmods.module.hardcore.world.HCStumping" in my case? I mean. The mod's package I'm trying to add compatibility for?
  13. So, here: ActiveModInteropProxy i need to use reflection to get the other mod's method and call it? And here: your.package.ActiveModInteropProxy the mod I'm trying to call?
  14. E.g. I want to add compatibility with BetterWithMods (exactly need to call this: https://github.com/BetterWithMods/BetterWithMods/blob/1.12/src/main/java/betterwithmods/module/hardcore/world/HCStumping.java#L71). How I can do this without the need of begin a dependency?
  15. How do I handle messages from server to client? I can use ctx.getServerHandler().player to get the PlayerMP, but how do I get the client one?
  16. As I try to send a test packet (PacketHandler.SendToServer(new TestMessage(10))) to server I get this huge exception: PacketHandler IMessage implementation IMessageHandler implementation The Packet handler has been registered in the PreInit of the CommonProxy with PacketHandler.Init() I really don't know what I'm doing wrong since I've followed the docs of SimpleImpl
  17. What "type" should I use in getTagList(String key, int type)? Edit: by reading Furnace's Tile entity seems like I have to use 10. But where is this type determined?
  18. If I want to get a list of items in a shulker box that lies in player's inventory, how I can do it?
  19. Seems like there are two mods that are conflicting Send the whole crashlog
  20. I had to register the loot table and add the "name" field to the loot table (but I don't know which one of those fix resolved my problem)
  21. Actually you can't. The LivingExperienceDropEvent is not called for the ender dragon :c
  22. As title says, after subscribing the LivingExperienceDropEvent it is not called when the ender dragon drops experience. Tested with Forge 14.23.1.2599
  23. I did it, but minecraft seem to not like my loot tables I've placed a file in assets/progressivebosses/loot_tables/dragon_minion.json. The json is valid (copy paste of squid loot table). Then used deathLootTable.set(shulker, new ResourceLocation("progressivebosses:dragon_minion")); But the shulker drops nothing ...
  24. I have a class thats exactly like WorldGenMinable but with one more check to prevent ores spawning not near air. The problem is that here: if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D) it always fails since the value is always between 1 and 2 for some reasons and the ore is not spawning. I really don't know why. For some reasons if you set ore count to 2, nothing spawns

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.