本文整理汇总了Java中ethanjones.cubes.entity.ItemEntity类的典型用法代码示例。如果您正苦于以下问题:Java ItemEntity类的具体用法?Java ItemEntity怎么用?Java ItemEntity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ItemEntity类属于ethanjones.cubes.entity包,在下文中一共展示了ItemEntity类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handlePacket
import ethanjones.cubes.entity.ItemEntity; //导入依赖的package包/类
@Override
public void handlePacket() {
ClientIdentifier client = Cubes.getServer().getClient(getSocketMonitor());
PlayerInventory inventory = client.getPlayer().getInventory();
ItemStack itemStack = InventoryHelper.reduceCount(inventory, inventory.hotbarSelected);
if (itemStack != null) {
ItemEntity itemEntity = new ItemEntity();
itemEntity.itemStack = itemStack;
itemEntity.position.set(client.getPlayer().position);
itemEntity.motion.set(client.getPlayer().angle);
itemEntity.age = -3000 / Cubes.tickMS;
Cubes.getServer().world.addEntity(itemEntity);
}
}
示例2: dropItems
import ethanjones.cubes.entity.ItemEntity; //导入依赖的package包/类
public void dropItems(World world, int x, int y, int z, int meta) {
if (Side.isClient()) return;
ItemStack[] drops = drops(world, x, y, z, meta);
for (ItemStack drop : drops) {
ItemEntity itemEntity = new ItemEntity();
itemEntity.itemStack = drop;
itemEntity.position.set(x + 0.5f, y, z + 0.5f);
world.addEntity(itemEntity);
}
}
示例3: ItemEntityRenderer
import ethanjones.cubes.entity.ItemEntity; //导入依赖的package包/类
public ItemEntityRenderer(ItemEntity itemEntity) {
this.itemEntity = itemEntity;
}