Jump to content

Dispellz

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by Dispellz

  1. Because WorldEvent.Load fires when the world is being loaded (which happens every time you get into the game). I don't need to add items when the world loads, I need to add them when the player first joins a new world.
  2. I figured out how to give player certain items when they respawn after death. The problem I'm having is when I generate a new world - the inventory is empty. Is that a different kind of event I have to handle?
  3. diesieben07, You were right. I'm sending packets to the server that tells it to increase or decrease and it all works Thanks a lot for the help!
  4. The weird thing is EVERYTHING works correctly, except the fact that anytime i want to save to NBTs, the value of any variable is zero. The loading from NBTs works perfectly. If I assign the value of trashAmount to be lets say 10 INSIDE the NBT Save, then the value will save correctly. However when I dont assign it and just try to pull it, the int is always zero. No idea why this is happening and supposedly it works in the tutorial. Anyhow, Yes, I need this to persist through players death. This will be a singleplayer mod ONLY if that makes any difference. TLHPoE, if you could link me to a tutorial or give me a general idea how players NBT works, I'd be grateful. Thanks guys!
  5. The values are changed by the method setTrash and that is also when i sync it. The only other place with sync is in my event handler. package org.theya.sustain.gui; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; public class PollutionHandler { @ForgeSubscribe public void onEntityConstructing(EntityConstructing event) { if(event.entity instanceof EntityPlayer && PollutionBarData.get((EntityPlayer)event.entity) == null) { PollutionBarData.register((EntityPlayer)event.entity); } if(event.entity instanceof EntityPlayer && event.entity.getExtendedProperties(PollutionBarData.POLLUTION_DATA_NAME) == null) { event.entity.registerExtendedProperties(PollutionBarData.POLLUTION_DATA_NAME, new PollutionBarData((EntityPlayer)event.entity)); } } @ForgeSubscribe public void onEntityJoinWorld(EntityJoinWorldEvent event) { if(!event.entity.worldObj.isRemote && event.entity instanceof EntityPlayer) { PollutionBarData.get((EntityPlayer)event.entity).sync(); } } } I call set Trash in my CustomGui class and I do it like this: PollutionBarData props = PollutionBarData.get((EntityPlayer)this.mc.getNetHandler().getPlayer()); props.setTrash(props.getTrash() + 1);
  6. I've been figuring out the IExtendedEntityProperties and have a problem with them. I found coolAlias tutorial on that stuff and pretty much followed it (http://www.minecraftforum.net/topic/1952901-172164-eventhandler-and-iextendedentityproperties/). This is pretty much what my class looks like: package org.theya.sustain.gui; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.packet.Packet250CustomPayload; import net.minecraft.world.World; import net.minecraftforge.common.IExtendedEntityProperties; import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.network.Player; public class PollutionBarData implements IExtendedEntityProperties{ public static final String POLLUTION_DATA_NAME = "PollutionBarData"; private final EntityPlayer player; private int trashAmount; public PollutionBarData(EntityPlayer player) { this.player = player; this.trashAmount = 0; } public static final void register(EntityPlayer player) { player.registerExtendedProperties(PollutionBarData.POLLUTION_DATA_NAME, new PollutionBarData(player)); } public static final PollutionBarData get(EntityPlayer player) { return (PollutionBarData)player.getExtendedProperties(POLLUTION_DATA_NAME); } @Override public void saveNBTData(NBTTagCompound compound) { NBTTagCompound properties = new NBTTagCompound(); System.out.println("[NBT-SAVE] Trash amount saved: " + this.trashAmount); properties.setInteger("CurrentTrash", this.trashAmount); System.out.println("[NBT-SAVE][PROPS] Trash amount: " + properties.getInteger("CurrentTrash")); compound.setTag(POLLUTION_DATA_NAME, properties); } @Override public void loadNBTData(NBTTagCompound compound) { NBTTagCompound properties = (NBTTagCompound)compound.getTag(POLLUTION_DATA_NAME); this.trashAmount = properties.getInteger("CurrentTrash"); System.out.println("[NBT-READ] Trash amount: " + this.trashAmount); } public final void sync() { ByteArrayOutputStream bos = new ByteArrayOutputStream(; DataOutputStream outputStream = new DataOutputStream(bos); try { outputStream.writeInt(this.trashAmount); System.out.println("[sYNC] Writing amount: " + this.trashAmount); } catch(IOException e) { e.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload("SustainPollution", bos.toByteArray()); if(!player.worldObj.isRemote) { EntityPlayerMP player1 = (EntityPlayerMP) player; PacketDispatcher.sendPacketToPlayer(packet, (Player)player1); System.out.println("packet sent to player: " + this.trashAmount); } } @Override public void init(Entity entity, World world) { } public void setTrash(int amount) { this.trashAmount = amount; this.sync(); } public int getTrash() { return trashAmount; } } And here is the output: 2014-03-29 12:54:59 [iNFO] [ForgeModLoader] Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@68689d26) 2014-03-29 12:54:59 [iNFO] [ForgeModLoader] Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@68689d26) 2014-03-29 12:54:59 [iNFO] [ForgeModLoader] Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@68689d26) 2014-03-29 12:54:59 [iNFO] [Minecraft-Server] Preparing start region for level 0 2014-03-29 12:55:00 [iNFO] [sTDOUT] [NBT-READ] Trash amount: 9 2014-03-29 12:55:00 [iNFO] [sTDOUT] loading single player 2014-03-29 12:55:00 [iNFO] [Minecraft-Server] Player106[/127.0.0.1:0] logged in with entity id 282 at (168.69339168635545, 64.0, -100.73887055738551) 2014-03-29 12:55:00 [iNFO] [Minecraft-Server] Player106 joined the game 2014-03-29 12:55:00 [iNFO] [sTDOUT] [sYNC] Writing amount: 9 2014-03-29 12:55:00 [iNFO] [sTDOUT] packet sent to player: 9 2014-03-29 12:55:00 [iNFO] [sTDOUT] Setting up custom skins 2014-03-29 12:55:00 [iNFO] [sTDOUT] [sYNC] Writing amount: 9 2014-03-29 12:55:00 [iNFO] [sTDOUT] [PACKET] Trash from packet: 9 2014-03-29 12:55:00 [iNFO] [Minecraft-Client] [CHAT] Welcome Player106 to this world 2014-03-29 12:55:02 [iNFO] [sTDOUT] [sYNC] Writing amount: 10 2014-03-29 12:55:02 [iNFO] [sTDOUT] XYZ: 158, 63, -135 2014-03-29 12:55:17 [iNFO] [Minecraft-Server] Saving and pausing game... 2014-03-29 12:55:17 [iNFO] [sTDOUT] [NBT-SAVE] Trash amount saved: 9 2014-03-29 12:55:17 [iNFO] [sTDOUT] [NBT-SAVE][PROPS] Trash amount: 9 2014-03-29 12:55:17 [iNFO] [sTDOUT] [NBT-SAVE] Trash amount saved: 9 2014-03-29 12:55:17 [iNFO] [sTDOUT] [NBT-SAVE][PROPS] Trash amount: 9 2014-03-29 12:55:17 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld 2014-03-29 12:55:17 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether 2014-03-29 12:55:17 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/The End 2014-03-29 12:55:23 [iNFO] [Minecraft-Server] Stopping server 2014-03-29 12:55:23 [iNFO] [Minecraft-Server] Saving players 2014-03-29 12:55:23 [iNFO] [sTDOUT] [NBT-SAVE] Trash amount saved: 9 2014-03-29 12:55:23 [iNFO] [sTDOUT] [NBT-SAVE][PROPS] Trash amount: 9 2014-03-29 12:55:23 [iNFO] [sTDOUT] [NBT-SAVE] Trash amount saved: 9 2014-03-29 12:55:23 [iNFO] [sTDOUT] [NBT-SAVE][PROPS] Trash amount: 9 2014-03-29 12:55:23 [iNFO] [Minecraft-Server] Player106 left the game 2014-03-29 12:55:23 [iNFO] [sTDOUT] [NBT-SAVE] Trash amount saved: 9 2014-03-29 12:55:23 [iNFO] [sTDOUT] [NBT-SAVE][PROPS] Trash amount: 9 2014-03-29 12:55:23 [iNFO] [sTDOUT] [NBT-SAVE] Trash amount saved: 9 2014-03-29 12:55:23 [iNFO] [sTDOUT] [NBT-SAVE][PROPS] Trash amount: 9 2014-03-29 12:55:23 [iNFO] [Minecraft-Server] Saving worlds 2014-03-29 12:55:23 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld 2014-03-29 12:55:23 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether 2014-03-29 12:55:23 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/The End 2014-03-29 12:55:23 [iNFO] [ForgeModLoader] Unloading dimension 0 2014-03-29 12:55:23 [iNFO] [ForgeModLoader] Unloading dimension -1 2014-03-29 12:55:23 [iNFO] [ForgeModLoader] Unloading dimension 1 2014-03-29 12:55:23 [iNFO] [Minecraft-Client] Stopping! 2014-03-29 12:55:23 [iNFO] [sTDOUT] 2014-03-29 12:55:23 [iNFO] [sTDOUT] SoundSystem shutting down... 2014-03-29 12:55:24 [iNFO] [sTDOUT] Author: Paul Lamb, www.paulscode.com 2014-03-29 12:55:24 [iNFO] [sTDOUT] Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release The problem that I have is NBT load happens correctly and the trash amount is 9. Then it changes to 10 and the sync function tells that its 10. However, when I press ESC and the NBTs are saving, it tells me it saved it as 9. I've been trying to figure out what am I doing wrong here...
  7. So i create a dummy entity and use it to read and write NBTs?
  8. I have a custom gui bar that renders on the screen at the same time xp bar does. Its a little mana indicator. The problem is I have to save it somehow when the player exits. My question is, do I need TileEntity to save NBTs? If yes, can you please point me to an example? Maybe there is a better way to do it? Thanks for the help!
  9. I'm beating myself with a stick right now. Turns out I had 2 of them placed and for some reason didn't realize that could be the issue. Thanks a lot for help and sorry for the trouble!
  10. Minecraft Forge Wiki: http://www.minecraftforge.net/wiki/Create_a_Fluid
  11. That is what I thought, so I decided to do this: if(!this.worldObj.isRemote) { System.out.println(this.worldObj.getBlockId(xCoord + 1, yCoord, zCoord)); } Unfortunately same thing.
  12. I'm trying to get a block that is next to my custom furnace. In TileEntityBrickFurnace class I simply wrote: System.out.println(this.worldObj.getBlockId(xCoord + 1, yCoord, zCoord)); The results look like this: 2014-03-08 13:02:00 [iNFO] [sTDOUT] 9 2014-03-08 13:02:00 [iNFO] [sTDOUT] 0 2014-03-08 13:02:00 [iNFO] [sTDOUT] 9 2014-03-08 13:02:00 [iNFO] [sTDOUT] 0 2014-03-08 13:02:00 [iNFO] [sTDOUT] 9 2014-03-08 13:02:00 [iNFO] [sTDOUT] 0 2014-03-08 13:02:00 [iNFO] [sTDOUT] 9 2014-03-08 13:02:00 [iNFO] [sTDOUT] 0 2014-03-08 13:02:00 [iNFO] [sTDOUT] 9 2014-03-08 13:02:00 [iNFO] [sTDOUT] 0 2014-03-08 13:02:00 [iNFO] [sTDOUT] 9 2014-03-08 13:02:00 [iNFO] [sTDOUT] 0 2014-03-08 13:02:00 [iNFO] [sTDOUT] 9 2014-03-08 13:02:00 [iNFO] [sTDOUT] 0 2014-03-08 13:02:00 [iNFO] [sTDOUT] 9 2014-03-08 13:02:00 [iNFO] [sTDOUT] 0 Instead of just telling me its 9 or 0, it alternates for some reason.
  13. Of course it can! How did I not see this... This seems to fix my issue, thanks a lot for help!
  14. This is for 1.6.4, but most of this stuff should be easy to covert to 1.7.2
  15. 2014-03-07 11:45:29 [iNFO] [sTDERR] net.minecraft.util.ReportedException: Ticking memory connection 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:63) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:691) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:587) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2014-03-07 11:45:29 [iNFO] [sTDERR] Caused by: java.lang.NullPointerException 2014-03-07 11:45:29 [iNFO] [sTDERR] at org.theya.sustain.gui.PollutionBar.onPlayerPlaceFurnace(PollutionBar.java:172) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraftforge.event.ASMEventHandler_4_PollutionBar_onPlayerPlaceFurnace_PlayerInteractEvent.invoke(.dynamic) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraftforge.event.ASMEventHandler.invoke(ASMEventHandler.java:39) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraftforge.event.EventBus.post(EventBus.java:108) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(ForgeEventFactory.java:48) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:399) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:556) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:141) 2014-03-07 11:45:29 [iNFO] [sTDERR] at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:54) 2014-03-07 11:45:29 [iNFO] [sTDERR] ... 6 more 2014-03-07 11:45:29 [sEVERE] [Minecraft-Server] Encountered an unexpected exception ReportedException net.minecraft.util.ReportedException: Ticking memory connection at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:63) at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:691) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:587) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) Caused by: java.lang.NullPointerException at org.theya.sustain.gui.PollutionBar.onPlayerPlaceFurnace(PollutionBar.java:172) at net.minecraftforge.event.ASMEventHandler_4_PollutionBar_onPlayerPlaceFurnace_PlayerInteractEvent.invoke(.dynamic) at net.minecraftforge.event.ASMEventHandler.invoke(ASMEventHandler.java:39) at net.minecraftforge.event.EventBus.post(EventBus.java:108) at net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(ForgeEventFactory.java:48) at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:399) at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:556) at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79) at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:141) at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:54) ... 6 more 2014-03-07 11:45:29 [sEVERE] [Minecraft-Server] This crash report has been saved to: /home/chell/Dropbox/MINECRAFT_FORGE_1-6-4/mcp/jars/./crash-reports/crash-2014-03-07_11.45.29-server.txt 2014-03-07 11:45:29 [iNFO] [Minecraft-Server] Stopping server 2014-03-07 11:45:29 [iNFO] [Minecraft-Server] Saving players 2014-03-07 11:45:29 [iNFO] [Minecraft-Server] Player384 left the game 2014-03-07 11:45:29 [iNFO] [sTDOUT] ---- Minecraft Crash Report ---- 2014-03-07 11:45:29 [iNFO] [sTDOUT] // I blame Dinnerbone. 2014-03-07 11:45:29 [iNFO] [sTDOUT] 2014-03-07 11:45:29 [iNFO] [sTDOUT] Time: 3/7/14 11:45 AM 2014-03-07 11:45:29 [iNFO] [sTDOUT] Description: Ticking memory connection 2014-03-07 11:45:29 [iNFO] [sTDOUT] 2014-03-07 11:45:29 [iNFO] [sTDOUT] java.lang.NullPointerException 2014-03-07 11:45:29 [iNFO] [sTDOUT] at org.theya.sustain.gui.PollutionBar.onPlayerPlaceFurnace(PollutionBar.java:172) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraftforge.event.ASMEventHandler_4_PollutionBar_onPlayerPlaceFurnace_PlayerInteractEvent.invoke(.dynamic) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraftforge.event.ASMEventHandler.invoke(ASMEventHandler.java:39) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraftforge.event.EventBus.post(EventBus.java:108) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(ForgeEventFactory.java:48) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:399) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:556) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:141) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:54) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:691) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:587) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2014-03-07 11:45:29 [iNFO] [sTDOUT] 2014-03-07 11:45:29 [iNFO] [Minecraft-Server] Saving worlds 2014-03-07 11:45:29 [iNFO] [sTDOUT] 2014-03-07 11:45:29 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld 2014-03-07 11:45:29 [iNFO] [sTDOUT] A detailed walkthrough of the error, its code path and all known details is as follows: 2014-03-07 11:45:29 [iNFO] [sTDOUT] --------------------------------------------------------------------------------------- 2014-03-07 11:45:29 [iNFO] [sTDOUT] 2014-03-07 11:45:29 [iNFO] [sTDOUT] -- Head -- 2014-03-07 11:45:29 [iNFO] [sTDOUT] Stacktrace: 2014-03-07 11:45:29 [iNFO] [sTDOUT] at org.theya.sustain.gui.PollutionBar.onPlayerPlaceFurnace(PollutionBar.java:172) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraftforge.event.ASMEventHandler_4_PollutionBar_onPlayerPlaceFurnace_PlayerInteractEvent.invoke(.dynamic) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraftforge.event.ASMEventHandler.invoke(ASMEventHandler.java:39) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraftforge.event.EventBus.post(EventBus.java:108) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(ForgeEventFactory.java:48) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:399) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:556) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:141) 2014-03-07 11:45:29 [iNFO] [sTDOUT] 2014-03-07 11:45:29 [iNFO] [sTDOUT] -- Ticking connection -- 2014-03-07 11:45:29 [iNFO] [sTDOUT] Details: 2014-03-07 11:45:29 [iNFO] [sTDOUT] Connection: net.minecraft.network.NetServerHandler@14cbcd25 2014-03-07 11:45:29 [iNFO] [sTDOUT] Stacktrace: 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:54) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:691) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:587) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) 2014-03-07 11:45:29 [iNFO] [sTDOUT] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2014-03-07 11:45:29 [iNFO] [sTDOUT] 2014-03-07 11:45:29 [iNFO] [sTDOUT] -- System Details -- 2014-03-07 11:45:29 [iNFO] [sTDOUT] Details: 2014-03-07 11:45:29 [iNFO] [sTDOUT] Minecraft Version: 1.6.4 2014-03-07 11:45:29 [iNFO] [sTDOUT] Operating System: Linux (amd64) version 3.11.0-12-generic 2014-03-07 11:45:29 [iNFO] [sTDOUT] Java Version: 1.7.0_51, Oracle Corporation 2014-03-07 11:45:29 [iNFO] [sTDOUT] Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation 2014-03-07 11:45:29 [iNFO] [sTDOUT] Memory: 745720752 bytes (711 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) 2014-03-07 11:45:29 [iNFO] [sTDOUT] JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M 2014-03-07 11:45:29 [iNFO] [sTDOUT] AABB Pool Size: 2419 (135464 bytes; 0 MB) allocated, 2288 (128128 bytes; 0 MB) used 2014-03-07 11:45:29 [iNFO] [sTDOUT] Suspicious classes: FML and Forge are installed 2014-03-07 11:45:29 [iNFO] [sTDOUT] IntCache: cache: 0, tcache: 0, allocated: 3, tallocated: 63 2014-03-07 11:45:29 [iNFO] [sTDOUT] FML: MCP v8.11 FML v6.4.49.965 Minecraft Forge 9.11.1.965 4 mods loaded, 4 mods active 2014-03-07 11:45:29 [iNFO] [sTDOUT] mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available 2014-03-07 11:45:29 [iNFO] [sTDOUT] FML{6.4.49.965} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available 2014-03-07 11:45:29 [iNFO] [sTDOUT] Forge{9.11.1.965} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available 2014-03-07 11:45:29 [iNFO] [sTDOUT] sustain{0.0.1} [sustain] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available 2014-03-07 11:45:29 [iNFO] [sTDOUT] Profiler Position: N/A (disabled) 2014-03-07 11:45:29 [iNFO] [sTDOUT] Vec3 Pool Size: 1035 (57960 bytes; 0 MB) allocated, 874 (48944 bytes; 0 MB) used 2014-03-07 11:45:29 [iNFO] [sTDOUT] Player Count: 1 / 8; [EntityPlayerMP['Player384'/14022, l='New World', x=176.85, y=63.00, z=-105.42]] 2014-03-07 11:45:29 [iNFO] [sTDOUT] Type: Integrated Server (map_client.txt) 2014-03-07 11:45:29 [iNFO] [sTDOUT] Is Modded: Definitely; Client brand changed to 'fml,forge' 2014-03-07 11:45:29 [iNFO] [sTDOUT] #@!@# Game crashed! Crash report saved to: #@!@# ./crash-reports/crash-2014-03-07_11.45.29-server.txt 2014-03-07 11:45:29 [iNFO] [Minecraft-Server] Stopping server 2014-03-07 11:45:29 [iNFO] [Minecraft-Server] Saving players 2014-03-07 11:45:29 [iNFO] [Minecraft-Server] Saving worlds AL lib: (EE) alc_cleanup: 1 device not closed I've noticed it's having problems with my PollutionBar class and onPlayerPlaceFurnace, so here is the code for that function: @ForgeSubscribe public void onPlayerPlaceFurnace(PlayerInteractEvent event) { MovingObjectPosition m = this.mc.objectMouseOver; if(m != null) { EntityPlayer p = event.entityPlayer; if(event.action == Action.RIGHT_CLICK_BLOCK) { ItemStack s = p.inventory.getCurrentItem(); //if(!p.worldObj.isRemote && (p.worldObj.getBlockId(m.blockX, m.blockY, m.blockZ) == Block.furnaceIdle.blockID || p.worldObj.getBlockId(m.blockX, m.blockY, m.blockZ) == Block.furnaceBurning.blockID)) { // // PLACING FURNACE // if(!p.worldObj.isRemote && s.itemID == Block.furnaceIdle.blockID) { p.addChatMessage(EnumChatFormatting.RED.toString() + EnumChatFormatting.BOLD.toString() + "Furnace Placed"); Position temp = new Position(m.blockX, m.blockY, m.blockZ); if(hasDuplicates(temp)) { System.out.println("DUPLICATE ENTRY"); } else { furnaces.add(temp); } for(int i=0; i<furnaces.size(); i++) { System.out.println("FURNACE AT >> Mx: " + furnaces.get(i).getX() + ", My: " + furnaces.get(i).getY() + ", Mz: " + furnaces.get(i).getZ()); } } } } } Error points at this line: if(!p.worldObj.isRemote && s.itemID == Block.furnaceIdle.blockID) {
  16. I've been having those issues where the game throws Ticking memory connection, when I try to open a GUI on a custom furnace. However, this only happens after I place the furnace and exit the game. When I come back into the world and try to open it, it will sometimes throw this error. It seems to be random. Sometimes it crashes, sometimes it works fine. I guess my question is, what is Ticking memory connection for? When is it usually thrown? I'm trying to pin point the problem, but Minecraft doesn't tell me which class has the issue. I can post some code, just let me know what you need to see.
  17. Thank you for all the help. You are awesome! I realize this is a simple mistake, but I just started to figure forge out a few days ago. I didn't know that calling addChatMessage would call it on both sides. How do I know when to check for isRemote?
  18. That last piece of code doesn't seem to be working, "m" returns 0 on x, y and z.
  19. Thank you a lot for the help guys! This last piece works perfectly! One more thing. Is there a way to restrict this, so it only works when user places the block? At this moment it also shows "Block Placed" when I use the furnace.
  20. @ForgeSubscribe public void onPlayerPlaceFurnaceOld(PlayerInteractEvent event) { EntityPlayer p = event.entityPlayer; if(event.action == Action.RIGHT_CLICK_BLOCK) { ItemStack s = p.inventory.getCurrentItem(); if(s.itemID == Block.furnaceIdle.blockID) { if(!this.mc.theWorld.isRemote) { this.mc.getNetHandler().getPlayer().addChatMessage("Furnace Placed"); } } } } In this case, I don't get any chat messages. if I change it to: if(this.mc.theWorld.isRemote) { this.mc.getNetHandler().getPlayer().addChatMessage("Furnace Placed"); } I get the double message again. I don't know if this is worth noting, but I have another event that checks if player breaks a furnace. @ForgeSubscribe public void onPlayerDestroyFurnace(BreakEvent event) { Block b = event.block; if(b == Block.furnaceIdle || b == Block.furnaceBurning) { this.mc.getNetHandler().getPlayer().addChatMessage("Furnace Destroyed"); } } And this displays correctly, single message.
  21. I've added isRemote, however that did not help. I've noticed something different in the console. Whenever the event fires this happens: 2014-02-11 21:20:06 [iNFO] [Minecraft-Server] Saving and pausing game... 2014-02-11 21:20:06 [iNFO] [Minecraft-Server] Saving chunks for level 'TestCreative'/Overworld 2014-02-11 21:20:06 [iNFO] [Minecraft-Server] Saving chunks for level 'TestCreative'/Nether 2014-02-11 21:20:06 [iNFO] [Minecraft-Server] Saving chunks for level 'TestCreative'/The End 2014-02-11 21:20:11 [iNFO] [Minecraft-Client] [CHAT] Furnace Placed 2014-02-11 21:20:11 [iNFO] [Minecraft-Client] [CHAT] Furnace Placed 2014-02-11 21:20:12 [iNFO] [Minecraft-Server] Saving and pausing game... So it looks like it's actually the client that fires twice.
  22. I'm trying to simply show a message when a custom event fires. @ForgeSubscribe public void onPlayerPlaceFurnace(PlayerInteractEvent event) { EntityPlayer p = event.entityPlayer; if(event.action == Action.RIGHT_CLICK_BLOCK) { ItemStack s = p.inventory.getCurrentItem(); if(s.itemID == Block.furnaceIdle.blockID) { this.mc.getNetHandler().getPlayer().addChatMessage("Furnace Placed"); } } } The problem I'm running into is whenever I actually place a furnace, I see "Furnace Placed" twice in chat. I can't figure out why this fires twice. Is there something else I should be doing?
  23. Since 1.7.2 is mostly obfuscated, I'm having a lot of trouble figuring out which method in Block.java is "setUnlocalizedName". I've tried all the ones that have one String argument, but none of them work so far. Did something change in 1.7.2? ---- Nevermind. I found the problem and it turns out I was just stupid. To anyone still looking for those functions, I'll save you some time: setUnlocalizedName is func_149663_c
×
×
  • Create New...

Important Information

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