- 586
- 32
- 136
Сделал что-то похожее на бассейн маны из Botania, вроде бы нечего, но есть проблема(смотрите видео)
Функция которая отвечает за работу:
Вызываю у onEntityCollidedWithBlock:
Java:
public static void reincarnation(World worldIn, Entity in, BlockPos pos, Item equals, ItemStack out, int energy) {
if(worldIn.getBlockState(pos).getBlock() == ModBlock.DARK_ALTAR_LVL0){
if(worldIn.getTileEntity(pos).getTileData().getInteger("DE")> energy){
if(in instanceof EntityItem){
if(((EntityItem) in).getItem().getItem() == equals){
in.getEntityWorld().spawnEntity(new EntityItem(in.getEntityWorld(),in.posX,in.posY,in.posZ,out));
in.setDead();
}
}
}
}
}
Java:
@Override
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
DkCrafting.reincarnation(worldIn,entityIn,pos, ModItem.DIAMOND_GOLD,new ItemStack(ModItem.DARK_DIAMOND_GOLD),3200);
DkCrafting.reincarnation(worldIn,entityIn,pos, ModItem.DARK_DUST,new ItemStack(Items.DIAMOND),1500);
}