Java 类net.minecraft.entity.item.EntityMinecartCommandBlock 实例源码

项目:Backmemed    文件:BlockRailDetector.java   
public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
{
    if (((Boolean)blockState.getValue(POWERED)).booleanValue())
    {
        List<EntityMinecartCommandBlock> list = this.<EntityMinecartCommandBlock>findMinecarts(worldIn, pos, EntityMinecartCommandBlock.class, new Predicate[0]);

        if (!list.isEmpty())
        {
            return ((EntityMinecartCommandBlock)list.get(0)).getCommandBlockLogic().getSuccessCount();
        }

        List<EntityMinecart> list1 = this.<EntityMinecart>findMinecarts(worldIn, pos, EntityMinecart.class, new Predicate[] {EntitySelectors.HAS_INVENTORY});

        if (!list1.isEmpty())
        {
            return Container.calcRedstoneFromInventory((IInventory)list1.get(0));
        }
    }

    return 0;
}
项目:CustomWorldGen    文件:BlockRailDetector.java   
public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
{
    if (((Boolean)blockState.getValue(POWERED)).booleanValue())
    {
        List<EntityMinecart> carts = this.findMinecarts(worldIn, pos, EntityMinecart.class);
        if (!carts.isEmpty() && carts.get(0).getComparatorLevel() > -1) return carts.get(0).getComparatorLevel();
        List<EntityMinecartCommandBlock> list = this.<EntityMinecartCommandBlock>findMinecarts(worldIn, pos, EntityMinecartCommandBlock.class, new Predicate[0]);

        if (!list.isEmpty())
        {
            return ((EntityMinecartCommandBlock)list.get(0)).getCommandBlockLogic().getSuccessCount();
        }

        List<EntityMinecart> list1 = this.<EntityMinecart>findMinecarts(worldIn, pos, EntityMinecart.class, new Predicate[] {EntitySelectors.HAS_INVENTORY});

        if (!list1.isEmpty())
        {
            return Container.calcRedstoneFromInventory((IInventory)list1.get(0));
        }
    }

    return 0;
}
项目:ExpandedRailsMod    文件:BlockRailDetector.java   
public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
{
    if (((Boolean)blockState.getValue(POWERED)).booleanValue())
    {
        List<EntityMinecart> carts = this.findMinecarts(worldIn, pos, EntityMinecart.class);
        if (!carts.isEmpty() && carts.get(0).getComparatorLevel() > -1) return carts.get(0).getComparatorLevel();
        List<EntityMinecartCommandBlock> list = this.<EntityMinecartCommandBlock>findMinecarts(worldIn, pos, EntityMinecartCommandBlock.class, new Predicate[0]);

        if (!list.isEmpty())
        {
            return ((EntityMinecartCommandBlock)list.get(0)).getCommandBlockLogic().getSuccessCount();
        }

        List<EntityMinecart> list1 = this.<EntityMinecart>findMinecarts(worldIn, pos, EntityMinecart.class, new Predicate[] {EntitySelectors.HAS_INVENTORY});

        if (!list1.isEmpty())
        {
            return Container.calcRedstoneFromInventory((IInventory)list1.get(0));
        }
    }

    return 0;
}
项目:CrystalMod    文件:ItemMinecartRender.java   
@Override
public void render(ItemStack stack) {
    String id = "empty";
    Class<? extends EntityMinecart> clazz = EntityMinecartEmpty.class;

    if(stack.getItem() == Items.CHEST_MINECART){
        id = "chest";
        clazz = EntityMinecartChest.class;
    }

    if(stack.getItem() == Items.FURNACE_MINECART){
        id = "furnace";
        clazz = EntityMinecartFurnace.class;
    }

    if(stack.getItem() == Items.TNT_MINECART){
        id = "tnt";
        clazz = EntityMinecartTNT.class;
    }

    if(stack.getItem() == Items.HOPPER_MINECART){
        id = "hopper";
        clazz = EntityMinecartHopper.class;
    }

    if(stack.getItem() == Items.COMMAND_BLOCK_MINECART){
        id = "commandblock";
        clazz = EntityMinecartCommandBlock.class;
    }

    EntityMinecart minecart = getMinecart(id, clazz);
    if(minecart == null){
        return;
    }
    renderMinecart(minecart, lastTransform, true);
}
项目:CustomWorldGen    文件:DataFixesManager.java   
public static DataFixer createFixer()
{
    DataFixer datafixer = new DataFixer(512);
    WorldInfo.registerFixes(datafixer);
    EntityPlayer.registerFixesPlayer(datafixer);
    AnvilChunkLoader.registerFixes(datafixer);
    ItemStack.registerFixes(datafixer);
    EntityArmorStand.registerFixesArmorStand(datafixer);
    EntityArrow.registerFixesArrow(datafixer);
    EntityBat.registerFixesBat(datafixer);
    EntityBlaze.registerFixesBlaze(datafixer);
    EntityCaveSpider.registerFixesCaveSpider(datafixer);
    EntityChicken.registerFixesChicken(datafixer);
    EntityCow.registerFixesCow(datafixer);
    EntityCreeper.registerFixesCreeper(datafixer);
    EntityDragonFireball.registerFixesDragonFireball(datafixer);
    EntityDragon.registerFixesDragon(datafixer);
    EntityEnderman.registerFixesEnderman(datafixer);
    EntityEndermite.registerFixesEndermite(datafixer);
    EntityFallingBlock.registerFixesFallingBlock(datafixer);
    EntityLargeFireball.registerFixesLargeFireball(datafixer);
    EntityFireworkRocket.registerFixesFireworkRocket(datafixer);
    EntityGhast.registerFixesGhast(datafixer);
    EntityGiantZombie.registerFixesGiantZombie(datafixer);
    EntityGuardian.registerFixesGuardian(datafixer);
    EntityHorse.registerFixesHorse(datafixer);
    EntityItem.registerFixesItem(datafixer);
    EntityItemFrame.registerFixesItemFrame(datafixer);
    EntityMagmaCube.registerFixesMagmaCube(datafixer);
    EntityMinecartChest.registerFixesMinecartChest(datafixer);
    EntityMinecartCommandBlock.registerFixesMinecartCommand(datafixer);
    EntityMinecartFurnace.registerFixesMinecartFurnace(datafixer);
    EntityMinecartHopper.registerFixesMinecartHopper(datafixer);
    EntityMinecartEmpty.registerFixesMinecartEmpty(datafixer);
    EntityMinecartMobSpawner.registerFixesMinecartMobSpawner(datafixer);
    EntityMinecartTNT.registerFixesMinecartTNT(datafixer);
    EntityLiving.registerFixesMob(datafixer);
    EntityMob.registerFixesMonster(datafixer);
    EntityMooshroom.registerFixesMooshroom(datafixer);
    EntityOcelot.registerFixesOcelot(datafixer);
    EntityPig.registerFixesPig(datafixer);
    EntityPigZombie.registerFixesPigZombie(datafixer);
    EntityRabbit.registerFixesRabbit(datafixer);
    EntitySheep.registerFixesSheep(datafixer);
    EntityShulker.registerFixesShulker(datafixer);
    EntitySilverfish.registerFixesSilverfish(datafixer);
    EntitySkeleton.registerFixesSkeleton(datafixer);
    EntitySlime.registerFixesSlime(datafixer);
    EntitySmallFireball.registerFixesSmallFireball(datafixer);
    EntitySnowman.registerFixesSnowman(datafixer);
    EntitySnowball.registerFixesSnowball(datafixer);
    EntitySpectralArrow.registerFixesSpectralArrow(datafixer);
    EntitySpider.registerFixesSpider(datafixer);
    EntitySquid.registerFixesSquid(datafixer);
    EntityEgg.registerFixesEgg(datafixer);
    EntityEnderPearl.registerFixesEnderPearl(datafixer);
    EntityExpBottle.registerFixesExpBottle(datafixer);
    EntityPotion.registerFixesPotion(datafixer);
    EntityTippedArrow.registerFixesTippedArrow(datafixer);
    EntityVillager.registerFixesVillager(datafixer);
    EntityIronGolem.registerFixesIronGolem(datafixer);
    EntityWitch.registerFixesWitch(datafixer);
    EntityWither.registerFixesWither(datafixer);
    EntityWitherSkull.registerFixesWitherSkull(datafixer);
    EntityWolf.registerFixesWolf(datafixer);
    EntityZombie.registerFixesZombie(datafixer);
    TileEntityPiston.registerFixesPiston(datafixer);
    TileEntityFlowerPot.registerFixesFlowerPot(datafixer);
    TileEntityFurnace.registerFixesFurnace(datafixer);
    TileEntityChest.registerFixesChest(datafixer);
    TileEntityDispenser.registerFixes(datafixer);
    TileEntityDropper.registerFixesDropper(datafixer);
    TileEntityBrewingStand.registerFixesBrewingStand(datafixer);
    TileEntityHopper.registerFixesHopper(datafixer);
    BlockJukebox.registerFixesJukebox(datafixer);
    TileEntityMobSpawner.registerFixesMobSpawner(datafixer);
    registerFixes(datafixer);
    return datafixer;
}