Package vazkii.botania.common.helper
Class EntityHelper
java.lang.Object
vazkii.botania.common.helper.EntityHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidshrinkItem(net.minecraft.world.entity.item.ItemEntity entity) Shrinks the itemstack in an entity and ensures that the new size is sent to clientsstatic voidsyncItem(net.minecraft.world.entity.item.ItemEntity entity) Forces an item entity to resync its item to the client.
-
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.
-