-
Posts
211 -
Joined
-
Last visited
Everything posted by Insane96MCP
-
Yeah but I need to update data during the use of the tile entity
-
Tileentity data to the client
-
Should I send a reply to a packet manually since I can't return a packet from the Runnable?
-
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
-
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
-
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.
-
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.
-
That seems hard
-
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.
-
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.
-
How to add compatibility with other mods
Insane96MCP replied to Insane96MCP's topic in Modder Support
And how I can add compatbility then? -
How to add compatibility with other mods
Insane96MCP replied to Insane96MCP's topic in Modder Support
What if there's a method that returns an object of other mod's class type? -
How to add compatibility with other mods
Insane96MCP replied to Insane96MCP's topic in Modder Support
"betterwithmods.module.hardcore.world.HCStumping" in my case? I mean. The mod's package I'm trying to add compatibility for? -
How to add compatibility with other mods
Insane96MCP replied to Insane96MCP's topic in Modder Support
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? -
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?
-
IndexArrayOutOfBoundsException on packet send
Insane96MCP replied to Insane96MCP's topic in Modder Support
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? -
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
-
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?
-
If I want to get a list of items in a shulker box that lies in player's inventory, how I can do it?
-
Seems like there are two mods that are conflicting Send the whole crashlog
-
Change mob loot table and experience on spawn
Insane96MCP replied to Insane96MCP's topic in Modder Support
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) -
Change mob loot table and experience on spawn
Insane96MCP replied to Insane96MCP's topic in Modder Support
Actually you can't. The LivingExperienceDropEvent is not called for the ender dragon :c -
Change mob loot table and experience on spawn
Insane96MCP replied to Insane96MCP's topic in Modder Support
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 ... -
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