Class EntityHelper

java.lang.Object
vazkii.botania.common.helper.EntityHelper

public class EntityHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    shrinkItem(net.minecraft.world.entity.item.ItemEntity entity)
    Shrinks the itemstack in an entity and ensures that the new size is sent to clients
    static void
    syncItem(net.minecraft.world.entity.item.ItemEntity entity)
    Forces an item entity to resync its item to the client.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EntityHelper

      public EntityHelper()
  • Method Details

    • shrinkItem

      public static void shrinkItem(net.minecraft.world.entity.item.ItemEntity entity)
      Shrinks the itemstack in an entity and ensures that the new size is sent to clients
    • syncItem

      public static void syncItem(net.minecraft.world.entity.item.ItemEntity entity)
      Forces an item entity to resync its item to the client. Entity data only resyncs when the old/new values are not Object.equals(). Since stacks do not implement equals, and we're not changing the actual stack object, the old/new values are == and thus the game doesn't resync. We have to set a dummy value then set it back to tell the game to resync.