Jump to content

Michael K

Members
  • Posts

    3
  • Joined

  • Last visited

Michael K's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thanks! I created a StorageUpdatePacket using IMessages. Works just fine now. Thanks a lot
  2. What I've just found out is really intresting... Yeah you're right! Through the magic of packets. Using CPacketCreativeInventoryAction to be exact. But there's one little problem... The NetHandlerPlayServer. public void processCreativeInventoryAction(CPacketCreativeInventoryAction packetIn){ PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.player.getServerWorld()); if (this.player.interactionManager.isCreative()){ That's the problem... In order to controll the inventory, I need to be in creative... Any other ideas?
  3. Hi! Currently I'm trying to make a Jetpack. But I ran into a quite tricky problem when I decided to make the Jetpack store Energy. Problem: If you want to detect if the player who wears the Jetpack is jumping, you need to do all of the velocity and energy reducing stuff on the client because there's no way the server can access the client's gamesettings. Now, I store the data used to determinate how much energy the Jetpack has left by writing a float with the key "storageValue" to the ItemStacks tagCompound. if (stack.getTagCompound() != null) { if (stack.getTagCompound().hasKey("storageVoltage") && stack.getTagCompound().hasKey("storageValue")) { stack.getTagCompound().setFloat("storageVoltage", storage.getVoltage()); stack.getTagCompound().setFloat("storageValue", storage.getCurrentlyStored().getAmount()); } } But because the NBT stuff is done by the Client, the Server does not know if the damage of the item, which is the indicator for how much energy is stored, or if the tagcompound has changed. So, after I click on the Item, the energy jumps back to full, what is completely logical. I do have a few guesses how I could fix this. If I set myself to gamemode creative, the serverside storage-value somehow gets updated after the inventory is opened. So, if I adjust the player's capabilities to match creative (excluding flying), but leave the client's gamemode at survival, there should be a way of controlling your inventory fully even though you're in survival... But how? The values don't get updated even with the adjusted capabilities! I just wan't to know if there's any way of sending the server the inventory-changes. Thanks for your help, Michael
×
×
  • Create New...

Important Information

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