本文整理汇总了Java中net.minecraft.entity.item.EntityMinecartHopper类的典型用法代码示例。如果您正苦于以下问题:Java EntityMinecartHopper类的具体用法?Java EntityMinecartHopper怎么用?Java EntityMinecartHopper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityMinecartHopper类属于net.minecraft.entity.item包,在下文中一共展示了EntityMinecartHopper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMinecartData
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
@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;
}
示例2: displayGUIHopperMinecart
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
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);
}
示例3: func_94090_a
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
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_);
}
}
示例4: render
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
@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);
}
示例5: displayGUIHopperMinecart
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
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);
}
示例6: displayGUIHopperMinecart
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
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);
}
示例7: func_96125_a
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
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);
}
示例8: displayGUIHopperMinecart
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
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);
}
示例9: onRender
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
@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);
}
}
}
}
示例10: createFixer
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
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;
}
示例11: displayGUIHopperMinecart
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper)
{
this.mc.displayGuiScreen(new GuiHopper(this.inventory, par1EntityMinecartHopper));
}
示例12: displayGUIHopperMinecart
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
@Override
public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_){}
示例13: HopperMinecart
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
public HopperMinecart() {
super(new EntityMinecartHopper(null));
}
示例14: displayGUIHopperMinecart
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_)
{
this.mc.displayGuiScreen(new GuiHopper(this.inventory, p_96125_1_));
}
示例15: func_145892_a
import net.minecraft.entity.item.EntityMinecartHopper; //导入依赖的package包/类
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;
}