public void setState(boolean active, World worldIn, BlockPos pos) {
IBlockState iblockstate = worldIn.getBlockState(pos);
TileEntity tileentity = worldIn.getTileEntity(pos);
worldIn.setBlockState(pos, getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)).withProperty(isActive, active), 3);
worldIn.setBlockState(pos, getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)).withProperty(isActive, active), 3);
if(tileentity != null) {
tileentity.validate();
worldIn.setTileEntity(pos, tileentity);
PacketHandler.INSTANCE.sendToAllAround(new MessageMachineBase((TileEntityMachineBase) tileentity), new NetworkRegistry.TargetPoint(worldIn.provider.getDimension(), (double) tileentity.getPos().getX(), (double) tileentity.getPos().getY(), (double) tileentity.getPos().getZ(), 128d));
}
}
BlockMachine.java 文件源码
java
阅读 17
收藏 0
点赞 0
评论 0
项目:Machines-and-Stuff
作者:
评论列表
文章目录