
TeNNoX
Members-
Posts
68 -
Joined
-
Last visited
Everything posted by TeNNoX
-
I already thought of that, but that would kill backwards compatiblity. I think of doing in either way though.
-
I saw that for Forge 10.12.0.1052 ForgeGradle v1.2 is needed. What files to I need to delete/replace with the new ones?
-
So should I split my data into 3000 packets?! It's not that much, just an array with 10-50 entries
-
Here it is: public void readFromNBT(NBTTagCompound nbttagcompound) { if (nbttagcompound == null) { Assembly.logger.warn("AssemblyCounter should read from null NBT ?!"); return; } super.readFromNBT(nbttagcompound); NBTTagCompound nbt = nbttagcompound.getCompoundTag("counterdata"); int countersize = nbt.getInteger("countersize"); for (int i = 0; i < countersize; i++) { int id = nbt.getInteger("counter" + i + "_id"); int damage = nbt.getInteger("counter" + i + "_damage"); int count = nbt.getInteger("counter" + i + "_count"); counter.put(new int[] { id, damage }, Integer.valueOf(count)); } } public void writeToNBT(NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); NBTTagCompound nbt = new NBTTagCompound(); nbt.setInteger("countersize", counter.size()); Iterator<Entry<int[], Integer>> it = counter.entrySet().iterator(); int i = 0; while (it.hasNext()) { Entry<int[], Integer> entry = (Entry<int[], Integer>) it.next(); nbt.setInteger("counter" + i + "_id", ((int[]) entry.getKey())[0]); nbt.setInteger("counter" + i + "_damage", ((int[]) entry.getKey())[1]); nbt.setInteger("counter" + i + "_count", ((Integer) entry.getValue()).intValue()); i++; } nbttagcompound.setTag("counterdata", nbt); }
-
But one TileEntityDescriptionPacket is still causing trouble: (not handled via my packethandler) http://pastebin.com/CqAjbuxj Is there some sort of maximum size? How can I avoid that? Code:
-
To clarify: I used 1.6.4 and the error came and I found no solultion so I tried with 1.7.2... My packet system is now updated to Netty with this: http://www.minecraftforge.net/wiki/Tutorials/Packet_Handling => Working perfectly fine
-
What do I need it for? I was sending packets like this: ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream outputStream = new DataOutputStream(bos); try { outputStream.writeInt(tile.xCoord); outputStream.writeInt(tile.yCoord); outputStream.writeInt(tile.zCoord); outputStream.writeBoolean(active); } catch (Exception ex) { ex.printStackTrace(); } C17PacketCustomPayload packet = new C17PacketCustomPayload("Sorter", bos.toByteArray()); mc.getNetHandler().addToSendQueue(packet); Edit: Is this tutorial up-to-date now? (http://www.minecraftforge.net/wiki/Tutorials/Packet_Handling) Then I will just try that one seems I didn't know that I had to change the sending too... Do you still have some kind of solution for 1.6.4? (Want to make my mod compatible with 1.6.4 because many are still using that version)
-
What do I need it for? I was sending packets like this: ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream outputStream = new DataOutputStream(bos); try { outputStream.writeInt(tile.xCoord); outputStream.writeInt(tile.yCoord); outputStream.writeInt(tile.zCoord); outputStream.writeBoolean(active); } catch (Exception ex) { ex.printStackTrace(); } C17PacketCustomPayload packet = new C17PacketCustomPayload("Sorter", bos.toByteArray()); mc.getNetHandler().addToSendQueue(packet);
-
I used 1 and got some errors so squituri told me this: I'm using 7 now. I'm using AssemblyPacketHandler packethandler = new AssemblyPacketHandler(); NetworkRegistry.INSTANCE.newEventDrivenChannel("Sorter").register(packethandler); NetworkRegistry.INSTANCE.newEventDrivenChannel("Counter").register(packethandler); AssemblyPacketHandler: Is this wrong?
-
I get this error with Forge 1.7.2-10.12.0.1047 (I got a similar one in 1.6.4 too, I thought it would be fixed with the new packet system, but it isn't): http://pastebin.com/gus7Rcwq I don't know what packet the error is related to, so I don't know what code I could post here... (not gonna post my whole project, 100.000+ lines) Do you maybe know how an error like this is caused and how to fix it?
-
Too complicated for what I want, just using Reflection now Thanks!
-
The wiki (http://www.minecraftforge.net/wiki/Using_Access_Transformers) says nothing about IFMLLoadingPlugin in 1.7/1.6 ?! And if I understood right, Access Transformers are senseless for compiled minecraft, or aren't they?
-
DecoderException: Packet was larger than I expected [1.7.2]
TeNNoX replied to TeNNoX's topic in Modder Support
Okay, so it wasn't really fixed but I removed the list with entityIds that was getting bigger (found a better solution) and now I don't get the error even after counting 100.000 items.. But after some time I got this error: (Bad packet id stuff) http://pastebin.com/gus7Rcwq What is this now? -.- PS: Should I open a new Thread() for the new topic? -
DecoderException: Packet was larger than I expected [1.7.2]
TeNNoX replied to TeNNoX's topic in Modder Support
I now get even weirder errors: http://pastebin.com/rjTWazEn -.- -
DecoderException: Packet was larger than I expected [1.7.2]
TeNNoX replied to TeNNoX's topic in Modder Support
Okay, and where should I register my TileEntity DesciptionPacket id? Can I just take 7? -
DecoderException: Packet was larger than I expected [1.7.2]
TeNNoX replied to TeNNoX's topic in Modder Support
Thank you for trying to work with me The error log: My code (the important stuff, hope that's all you need) http://pastebin.com/RL5WeXc7 -
I have to admit I did forget that... (Will try with that, but if Access Transformers aren't better, I would like to try with reflection) But to the reflection stuff: It works fine in the decompiled environment, but when build I get this error: [17:46:06 INFO]: Client> java.lang.NoSuchFieldException: buttonList [17:46:06 INFO]: Client> at java.lang.Class.getDeclaredField(Unknown Source) My Code: Field field = guioptions.getClass().getSuperclass().getDeclaredField("buttonList"); field.setAccessible(true); List buttons = field.get(guioptions) I thought Minecraft is decompiled at runtime? Also it said in the Wiki (http://www.minecraftforge.net/wiki/Using_Access_Transformers): What did I understand wrong here?
-
I tried to update my mod from 1.6.4 where I used Java Reflection to access the protected field GuiScreen.buttonList to 1.7.2 where I decided to switch to access transformers for performance (and compatibility) I added a *_at.cfg to ressources folder and re-setup the gradlew stuff and now in the eclipse environment everything works fine and everything is public But when I built the jar and tried running it in a not-dev-environment (normal minecraft) I get this error: java.lang.IllegalAccessError: tried to access field net.minecraft.client.gui.GuiScreen.field_146292_n from class tennox.customselectionbox.CSBClientProxy at tennox.customselectionbox.CSBClientProxy.onTick(CSBClientProxy.java:31) Edit: tennox_customselectionbox_at.cfg: public net.minecraft.client.gui.GuiScreen *
-
NoClassDefFoundError: net/minecraft/world/World$2
TeNNoX replied to TeNNoX's topic in Modder Support
It seems to be fixed with this code: Block oldMaster = master; int oldMeta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); master = worldObj.getBlock(i, j, k); if (master == Chameleon.chameleon) { TileEntityChameleon tile2 = (TileEntityChameleon) worldObj.getTileEntity(i, j, k); master = tile2.master; } int meta = worldObj.getBlockMetadata(i, j, k); if (meta != oldMeta) { worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, meta, 3); } else if (master != oldMaster) { worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); // markDirty(); worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, master, side.ordinal()); } But still, can someone explain me what I did do so wrong that it would cause a NoClassDefFoundError??? -
1.6.4 Instance in GuiHandler not registering
TeNNoX replied to Spartanboy56's topic in Modder Support
Have you tried creating a SpartsextrasGuiHandler class NetworkRegistry.instance().registerGuiHandler(this, new SpartsextrasGuiHandler()); Also where is your "ModInformation.ID" defined? -
Would be nice if you post your solution here, for others to see (including me)
-
NoClassDefFoundError: net/minecraft/world/World$2
TeNNoX replied to TeNNoX's topic in Modder Support
side and master: public Block master = Blocks.air; ForgeDirection side = ForgeDirection.DOWN; And the lines would be unnecessary, if I wouldn't set metadata to 0 sometimes (block was air before -> meta=0 -> no blockUpdate called because no metadata changed) I tried without. And no, I didn't override markDirty() -
Sorry didn't see that renderGlobal.renderBlocksRg is a private field... I am really not sure how you SHOULD do this but maybe hook a RenderTickEvent or RenderWorldLastEvent and then make renderBlocksRg public via reflection or something I definitely think there's a different way...
-
For the rendering I would try RenderBlocks.renderBlockByRenderType(...) Access to the RenderBlocks instance you could get either via a CustomBlockRenderer (you would have to place a block where you would like to render stuff) RenderingRegistry.registerBlockHandler(...); Or you could try it with the RenderWorldLastEvent (access to RenderBlocks) Or try this: http://www.minecraftforge.net/forum/index.php?topic=1882.0