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

项目:PeripheralsPlusPlus    文件:TileRailReader.java   
@Override
public Map<Object, Object> getMinecartData(EntityMinecart cart) {
    Map<Object, Object> ret = new HashMap<Object, Object>();

    if (cart.getClass() == EntityMinecartEmpty.class) {
        ret.put("__CART_TYPE__", "basic");
        ret.put("occupied", cart.riddenByEntity != null);
        if (cart.riddenByEntity != null) ret.put("username", cart.riddenByEntity.getEntityName());
    } else if (cart.getClass() == EntityMinecartChest.class) {
        ret.put("__CART_TYPE__", "storage");
    } else if (cart.getClass() == EntityMinecartFurnace.class) {
        ret.put("__CART_TYPE__", "furnace");
        NBTTagCompound workaround = new NBTTagCompound();
        cart.writeToNBT(workaround);
        ret.put("fuel", workaround.getInteger("Fuel"));
    } else if (cart.getClass() == EntityMinecartHopper.class) {
        ret.put("__CART_TYPE__", "hopper");
    } else if (cart.getClass() == EntityMinecartTNT.class) {
        ret.put("__CART_TYPE__", "tnt");
    } else if (cart.getClass() == EntityMinecartMobSpawner.class) {
        ret.put("__CART_TYPE__", "spawner");
    }

    return ret.containsKey("__CART_TYPE__") ? ret : null;
}
项目:Cauldron    文件:EntityPlayerMP.java   
public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_)
{
    // CraftBukkit start - Inventory open hook
    Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerHopper(this.inventory, p_96125_1_));

    if (container == null)
    {
        p_96125_1_.closeInventory(); // Cauldron - prevent chest from being stuck in open state on clients
        return;
    }

    // CraftBukkit end
    this.getNextWindowId();
    this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 9, p_96125_1_.getInventoryName(), p_96125_1_.getSizeInventory(), p_96125_1_.hasCustomInventoryName()));
    this.openContainer = container; // CraftBukkit - Use container we passed to event
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.addCraftingToCrafters(this);
}
项目:RuneCraftery    文件:EntityMinecart.java   
public static EntityMinecart func_94090_a(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_);
   default:
      return new EntityMinecartEmpty(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_);
   }
}
项目: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);
}
项目:Resilience-Client-Source    文件:EntityPlayerMP.java   
public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper)
{
    this.getNextWindowId();
    this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 9, par1EntityMinecartHopper.getInventoryName(), par1EntityMinecartHopper.getSizeInventory(), par1EntityMinecartHopper.isInventoryNameLocalized()));
    this.openContainer = new ContainerHopper(this.inventory, par1EntityMinecartHopper);
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.addCraftingToCrafters(this);
}
项目:Cauldron    文件:EntityPlayerMP.java   
public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_)
{
    this.getNextWindowId();
    this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 9, p_96125_1_.getInventoryName(), p_96125_1_.getSizeInventory(), p_96125_1_.hasCustomInventoryName()));
    this.openContainer = new ContainerHopper(this.inventory, p_96125_1_);
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.addCraftingToCrafters(this);
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void func_96125_a(EntityMinecartHopper p_96125_1_) {
   this.func_71117_bO();
   this.field_71135_a.func_72567_b(new Packet100OpenWindow(this.field_71139_cq, 9, p_96125_1_.func_70303_b(), p_96125_1_.func_70302_i_(), p_96125_1_.func_94042_c()));
   this.field_71070_bA = new ContainerHopper(this.field_71071_by, p_96125_1_);
   this.field_71070_bA.field_75152_c = this.field_71139_cq;
   this.field_71070_bA.func_75132_a(this);
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper)
{
    this.incrementWindowID();
    this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 9, par1EntityMinecartHopper.getInvName(), par1EntityMinecartHopper.getSizeInventory(), par1EntityMinecartHopper.isInvNameLocalized()));
    this.openContainer = new ContainerHopper(this.inventory, par1EntityMinecartHopper);
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.addCraftingToCrafters(this);
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper)
{
    this.incrementWindowID();
    this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 9, par1EntityMinecartHopper.getInvName(), par1EntityMinecartHopper.getSizeInventory(), par1EntityMinecartHopper.isInvNameLocalized()));
    this.openContainer = new ContainerHopper(this.inventory, par1EntityMinecartHopper);
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.addCraftingToCrafters(this);
}
项目:Backmemed    文件:StorageESP.java   
@Override
public void onRender() {
    if(isEnabled()) {
        for (Object o : Wrapper.getWorld().loadedTileEntityList) {
            if (o instanceof TileEntityChest) {
                TileEntityChest chest = (TileEntityChest) o;
                this.drawChestESP(chest, chest.getPos().getX(), chest.getPos().getY(), chest.getPos().getZ());
            }
            if (o instanceof TileEntityEnderChest) {
                TileEntityEnderChest enderChest = (TileEntityEnderChest) o;
                this.drawEnderChestESP(enderChest, enderChest.getPos().getX(), enderChest.getPos().getY(), enderChest.getPos().getZ());
            }
            if (o instanceof TileEntityFurnace) {
                TileEntityFurnace furnace = (TileEntityFurnace) o;
                RenderUtils.blockESP(furnace.getPos(), Color.white, 1.0, 1.0);
            }
            if (o instanceof TileEntityDispenser) {
                TileEntityDispenser dispenser = (TileEntityDispenser) o;
                RenderUtils.blockESP(dispenser.getPos(), Color.white, 1.0, 1.0);
            }
            if (o instanceof TileEntityDropper) {
                TileEntityDropper dropper = (TileEntityDropper) o;
                RenderUtils.blockESP(dropper.getPos(), Color.white, 1.0, 1.0);
            }
            if (o instanceof TileEntityHopper) {
                TileEntityHopper hopper = (TileEntityHopper) o;
                RenderUtils.blockESP(hopper.getPos(), Color.white, 1.0, 1.0);
            }
            if (o instanceof TileEntityShulkerBox) {
                TileEntityShulkerBox shulker = (TileEntityShulkerBox) o;
                RenderUtils.blockESP(shulker.getPos(), Color.yellow, 1.0, 1.0);
            }

        }
        for (Entity e: Wrapper.getWorld().loadedEntityList) {
            if (e instanceof EntityMinecartChest) {
                RenderUtils.blockESP(e.getPosition(), Color.green, 1.0, 1.0);
            }
            if (e instanceof EntityMinecartFurnace || e instanceof EntityMinecartHopper) {
                RenderUtils.blockESP(e.getPosition(), Color.white, 1.0, 1.0);
            }
        }
    }
}
项目: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;
}
项目:Resilience-Client-Source    文件:EntityPlayerSP.java   
public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper)
{
    this.mc.displayGuiScreen(new GuiHopper(this.inventory, par1EntityMinecartHopper));
}
项目:PeripheralsPlusPlus    文件:FakeTurtlePlayer.java   
@Override
public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_){}
项目:Corundum    文件:HopperMinecart.java   
public HopperMinecart() {
    super(new EntityMinecartHopper(null));
}
项目:Corundum    文件:HopperMinecart.java   
protected HopperMinecart(EntityMinecartHopper entityMC) {
    super(entityMC);
}
项目:Cauldron    文件:EntityPlayerSP.java   
public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_)
{
    this.mc.displayGuiScreen(new GuiHopper(this.inventory, p_96125_1_));
}
项目:Cauldron    文件:TileEntityHopper.java   
private static boolean func_145892_a(IHopper p_145892_0_, IInventory p_145892_1_, int p_145892_2_, int p_145892_3_)
{
    ItemStack itemstack = p_145892_1_.getStackInSlot(p_145892_2_);

    if (itemstack != null && func_145890_b(p_145892_1_, itemstack, p_145892_2_, p_145892_3_))
    {
        ItemStack itemstack1 = itemstack.copy();
        // CraftBukkit start - Call event on collection of items from inventories into the hopper
        CraftItemStack oitemstack = CraftItemStack.asCraftMirror(p_145892_1_.decrStackSize(p_145892_2_, 1));
        Inventory sourceInventory;

        // Have to special case large chests as they work oddly
        if (p_145892_1_ instanceof InventoryLargeChest)
        {
            sourceInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((InventoryLargeChest) p_145892_1_);
        }
        else
        {
            // Cauldron start - support mod inventories, with no owners
            try
            {
                if (p_145892_1_.getOwner() != null)
                {
                    sourceInventory = p_145892_1_.getOwner().getInventory();
                } 
                else
                {
                    // TODO: create a mod inventory for passing to the event, instead of null
                    sourceInventory = null;
                }
            }
            catch (AbstractMethodError e)
            {
                sourceInventory = null;
            }
            // Cauldron end
        }

        InventoryMoveItemEvent event = new InventoryMoveItemEvent(sourceInventory, oitemstack.clone(), p_145892_0_.getOwner().getInventory(), false);
        p_145892_0_.getWorldObj().getServer().getPluginManager().callEvent(event);

        if (event.isCancelled())
        {
            p_145892_1_.setInventorySlotContents(p_145892_2_, itemstack1);

            if (p_145892_0_ instanceof TileEntityHopper)
            {
                ((TileEntityHopper) p_145892_0_).func_145896_c(p_145892_0_.getWorldObj().spigotConfig.hopperTransfer); // Spigot
            }
            else if (p_145892_0_ instanceof EntityMinecartHopper)
            {
                ((EntityMinecartHopper) p_145892_0_).setDisplayTileData(p_145892_0_.getWorldObj().spigotConfig.hopperTransfer / 2); // Spigot
            }

            return false;
        }

        ItemStack itemstack2 = func_145889_a(p_145892_0_, CraftItemStack.asNMSCopy(event.getItem()), -1);

        if (itemstack2 == null || itemstack2.stackSize == 0)
        {
            if (event.getItem().equals(oitemstack))
            {
                p_145892_1_.markDirty();
            }
            else
            {
                p_145892_1_.setInventorySlotContents(p_145892_2_, itemstack1);
            }

            // CraftBukkit end
            return true;
        }

        p_145892_1_.setInventorySlotContents(p_145892_2_, itemstack1);
    }

    return false;
}
项目:Cauldron    文件:EntityPlayerSP.java   
public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_)
{
    this.mc.displayGuiScreen(new GuiHopper(this.inventory, p_96125_1_));
}
项目:RuneCraftery    文件:EntityPlayerSP.java   
public void func_96125_a(EntityMinecartHopper p_96125_1_) {
   this.field_71159_c.func_71373_a(new GuiHopper(this.field_71071_by, p_96125_1_));
}
项目:RuneCraftery    文件:EntityPlayerSP.java   
public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper)
{
    this.mc.displayGuiScreen(new GuiHopper(this.inventory, par1EntityMinecartHopper));
}
项目:BetterNutritionMod    文件:EntityPlayerSP.java   
public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper)
{
    this.mc.displayGuiScreen(new GuiHopper(this.inventory, par1EntityMinecartHopper));
}
项目:Corundum    文件:HopperMinecart.java   
/** 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 HopperMinecart fromMC(EntityMinecartHopper entityMC) {
    return new HopperMinecart(entityMC);
}
项目:4Space-5    文件:EntityPlayer.java   
public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_) {}
项目:Resilience-Client-Source    文件:EntityPlayer.java   
public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) {}
项目:4Space-1.7    文件:EntityPlayer.java   
public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_) {}
项目:Cauldron    文件:EntityPlayer.java   
public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_) {}
项目:Cauldron    文件:EntityPlayer.java   
public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_) {}
项目:RuneCraftery    文件:EntityPlayer.java   
public void func_96125_a(EntityMinecartHopper p_96125_1_) {}
项目:RuneCraftery    文件:EntityPlayer.java   
public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) {}
项目:BetterNutritionMod    文件:EntityPlayer.java   
public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) {}