public static EntityMinecart func_180458_a(World worldIn, double p_180458_1_, double p_180458_3_, double p_180458_5_, EntityMinecart.EnumMinecartType p_180458_7_) { switch (p_180458_7_) { case CHEST: return new EntityMinecartChest(worldIn, p_180458_1_, p_180458_3_, p_180458_5_); case FURNACE: return new EntityMinecartFurnace(worldIn, p_180458_1_, p_180458_3_, p_180458_5_); case TNT: return new EntityMinecartTNT(worldIn, p_180458_1_, p_180458_3_, p_180458_5_); case SPAWNER: return new EntityMinecartMobSpawner(worldIn, p_180458_1_, p_180458_3_, p_180458_5_); case HOPPER: return new EntityMinecartHopper(worldIn, p_180458_1_, p_180458_3_, p_180458_5_); case COMMAND_BLOCK: return new EntityMinecartCommandBlock(worldIn, p_180458_1_, p_180458_3_, p_180458_5_); default: return new EntityMinecartEmpty(worldIn, p_180458_1_, p_180458_3_, p_180458_5_); } }
public int getComparatorInputOverride(World worldIn, BlockPos pos) { if (((Boolean)worldIn.getBlockState(pos).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.selectInventories}); if (!list1.isEmpty()) { return Container.calcRedstoneFromInventory((IInventory)list1.get(0)); } } return 0; }
@Override public int getComparatorInputOverride(World world, int x, int y, int z, int i) { if ((world.getBlockMetadata(x, y, z) & 8) > 0) { float f = 0.125F; List list = world.getEntitiesWithinAABB(EntityMinecartCommandBlock.class, AxisAlignedBB.getBoundingBox((double)((float)x + f), (double)y, (double)((float)z + f), (double)((float)(x + 1) - f), (double)((float)(y + 1) - f), (double)((float)(z + 1) - f))); if (list.size() > 0) { return ((EntityMinecartCommandBlock)list.get(0)).func_145822_e().func_145760_g(); } List list1 = world.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getBoundingBox((double)((float)x + f), (double)y, (double)((float)z + f), (double)((float)(x + 1) - f), (double)((float)(y + 1) - f), (double)((float)(z + 1) - f)), IEntitySelector.selectInventories); if (list1.size() > 0) { return Container.calcRedstoneFromInventory((IInventory)list1.get(0)); } } return 0; }
public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { if ((p_149736_1_.getBlockMetadata(p_149736_2_, p_149736_3_, p_149736_4_) & 8) > 0) { float var6 = 0.125F; List var7 = p_149736_1_.getEntitiesWithinAABB(EntityMinecartCommandBlock.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)p_149736_2_ + var6), (double)p_149736_3_, (double)((float)p_149736_4_ + var6), (double)((float)(p_149736_2_ + 1) - var6), (double)((float)(p_149736_3_ + 1) - var6), (double)((float)(p_149736_4_ + 1) - var6))); if (var7.size() > 0) { return ((EntityMinecartCommandBlock)var7.get(0)).func_145822_e().func_145760_g(); } List var8 = p_149736_1_.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)p_149736_2_ + var6), (double)p_149736_3_, (double)((float)p_149736_4_ + var6), (double)((float)(p_149736_2_ + 1) - var6), (double)((float)(p_149736_3_ + 1) - var6), (double)((float)(p_149736_4_ + 1) - var6)), IEntitySelector.selectInventories); if (var8.size() > 0) { return Container.calcRedstoneFromInventory((IInventory)var8.get(0)); } } return 0; }
public static EntityMinecart createMinecart(World p_94090_0_, double p_94090_1_, double p_94090_3_, double p_94090_5_, int p_94090_7_) { switch (p_94090_7_) { case 1: return new EntityMinecartChest(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); case 2: return new EntityMinecartFurnace(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); case 3: return new EntityMinecartTNT(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); case 4: return new EntityMinecartMobSpawner(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); case 5: return new EntityMinecartHopper(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); case 6: return new EntityMinecartCommandBlock(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); default: return new EntityMinecartEmpty(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); } }
public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { if ((p_149736_1_.getBlockMetadata(p_149736_2_, p_149736_3_, p_149736_4_) & 8) > 0) { float f = 0.125F; List list = p_149736_1_.getEntitiesWithinAABB(EntityMinecartCommandBlock.class, AxisAlignedBB.getBoundingBox((double)((float)p_149736_2_ + f), (double)p_149736_3_, (double)((float)p_149736_4_ + f), (double)((float)(p_149736_2_ + 1) - f), (double)((float)(p_149736_3_ + 1) - f), (double)((float)(p_149736_4_ + 1) - f))); if (list.size() > 0) { return ((EntityMinecartCommandBlock)list.get(0)).func_145822_e().func_145760_g(); } List list1 = p_149736_1_.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getBoundingBox((double)((float)p_149736_2_ + f), (double)p_149736_3_, (double)((float)p_149736_4_ + f), (double)((float)(p_149736_2_ + 1) - f), (double)((float)(p_149736_3_ + 1) - f), (double)((float)(p_149736_4_ + 1) - f)), IEntitySelector.selectInventories); if (list1.size() > 0) { return Container.calcRedstoneFromInventory((IInventory)list1.get(0)); } } return 0; }
/** * Creates a new minecart of the specified type in the specified location in the given world. par0World - world to * create the minecart in, double par1,par3,par5 represent x,y,z respectively. int par7 specifies the type: 1 for * MinecartChest, 2 for MinecartFurnace, 3 for MinecartTNT, 4 for MinecartMobSpawner, 5 for MinecartHopper and 0 for * a standard empty minecart */ public static EntityMinecart createMinecart(World par0World, double par1, double par3, double par5, int par7) { switch (par7) { case 1: return new EntityMinecartChest(par0World, par1, par3, par5); case 2: return new EntityMinecartFurnace(par0World, par1, par3, par5); case 3: return new EntityMinecartTNT(par0World, par1, par3, par5); case 4: return new EntityMinecartMobSpawner(par0World, par1, par3, par5); case 5: return new EntityMinecartHopper(par0World, par1, par3, par5); case 6: return new EntityMinecartCommandBlock(par0World, par1, par3, par5); default: return new EntityMinecartEmpty(par0World, par1, par3, par5); } }
public CommandMinecart() { super(new EntityMinecartCommandBlock(null)); }
protected CommandMinecart(EntityMinecartCommandBlock entityMC) { super(entityMC); }
/** This method is used to create a new instance of {@link Entity Corundum Entity} to wrap around the given {@link Minecraft net.minecraft.entity.Entity}. * * @param entityMC * is the Minecraft Entity that will wrapped with a new {@link Entity Corundum Entity} <tt>Object</tt>. * @return a new Entity created using the given {@link net.minecraft.entity.Entity Minecraft Entity}. */ @Override public CommandMinecart fromMC(EntityMinecartCommandBlock entityMC) { return new CommandMinecart(entityMC); }