BlockBaseGenerator.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:Machines-and-Stuff 作者:
public static void setState(boolean active, World worldIn, BlockPos pos) {
    IBlockState iblockstate = worldIn.getBlockState(pos);
    TileEntity tileentity = worldIn.getTileEntity(pos);
    worldIn.setBlockState(pos, iblockstate.getBlock().getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)).withProperty(isActive, active), 3);

    if(tileentity != null) {
        tileentity.validate();
        worldIn.setTileEntity(pos, tileentity);
        PacketHandler.INSTANCE.sendToAllAround(new MessageGenerator(tileentity), new NetworkRegistry.TargetPoint(worldIn.provider.getDimension(), tileentity.getPos().getX(), tileentity.getPos().getY(), tileentity.getPos().getZ(), 128d));
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号