当前位置: 首页>>代码示例>>Java>>正文


Java EntityMinecartFurnace类代码示例

本文整理汇总了Java中net.minecraft.entity.item.EntityMinecartFurnace的典型用法代码示例。如果您正苦于以下问题:Java EntityMinecartFurnace类的具体用法?Java EntityMinecartFurnace怎么用?Java EntityMinecartFurnace使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EntityMinecartFurnace类属于net.minecraft.entity.item包,在下文中一共展示了EntityMinecartFurnace类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMinecartData

import net.minecraft.entity.item.EntityMinecartFurnace; //导入依赖的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;
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:26,代码来源:TileRailReader.java

示例2: func_94090_a

import net.minecraft.entity.item.EntityMinecartFurnace; //导入依赖的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_);
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:17,代码来源:EntityMinecart.java

示例3: onEntityJoinWorld

import net.minecraft.entity.item.EntityMinecartFurnace; //导入依赖的package包/类
@SubscribeEvent
   public void onEntityJoinWorld(EntityJoinWorldEvent e)
   {
//Replace Minecart with Furnace with Minecart with Kiln
if(BBConfig.moduleFurnaces && e.getEntity().getClass() == EntityMinecartFurnace.class && ((EntityMinecartFurnace) e.getEntity()).getDisplayTile() == Blocks.FURNACE.getDefaultState())
{
    if(!e.getWorld().isRemote)
    {
	e.getEntity().setDead();
	EntityMinecartKiln kilnCart = new EntityMinecartKiln(e.getWorld(), e.getEntity().posX, e.getEntity().posY, e.getEntity().posZ);
	e.getWorld().spawnEntity(kilnCart);
    }
}
   }
 
开发者ID:einsteinsci,项目名称:BetterBeginningsReborn,代码行数:15,代码来源:BBEventHandler.java

示例4: onItemUse

import net.minecraft.entity.item.EntityMinecartFurnace; //导入依赖的package包/类
@Override
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos,
    EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
    if(!world.isRemote)
    {
        EntityMinecartFurnace kilnCart = new EntityMinecartFurnace(world, pos.getX(), pos.getY() + 1.0F, pos.getZ());
        kilnCart.setDisplayTile(RegisterBlocks.kiln.getDefaultState());
        kilnCart.setEntityBoundingBox(kilnCart.getEntityBoundingBox().offset(0.0F, 2.0F, 0.0F));
        world.spawnEntity(kilnCart);
    }
 
    return EnumActionResult.SUCCESS;
}
 
开发者ID:einsteinsci,项目名称:BetterBeginningsReborn,代码行数:15,代码来源:ItemTestItem.java

示例5: render

import net.minecraft.entity.item.EntityMinecartFurnace; //导入依赖的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);
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:37,代码来源:ItemMinecartRender.java

示例6: onMinecartEvent

import net.minecraft.entity.item.EntityMinecartFurnace; //导入依赖的package包/类
@SubscribeEvent
public void onMinecartEvent(MinecartInteractEvent ev){
	if(!Properties.enableMinecartTweaks)return; //ignore if turned off
	EntityMinecart cart=ev.minecart;
	if(cart instanceof EntityMinecartFurnace){
		EntityPlayer player=ev.player;
        if(player.isSneaking()){ 
        	//invert motion if player is sneaking - allows making furnace cart come
        	EntityMinecartFurnace fc=(EntityMinecartFurnace) cart;
        	fc.pushX = -(fc.posX - player.posX);
        	fc.pushZ = -(fc.posZ - player.posZ);
        	ev.setCanceled(true); //stop normal handling - we took care of it
        }
	}
}
 
开发者ID:planetguy32,项目名称:Gizmos,代码行数:16,代码来源:ForgeEventHandler.java

示例7: onRender

import net.minecraft.entity.item.EntityMinecartFurnace; //导入依赖的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);
			}
		}
	}
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:45,代码来源:StorageESP.java

示例8: createFixer

import net.minecraft.entity.item.EntityMinecartFurnace; //导入依赖的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;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:80,代码来源:DataFixesManager.java

示例9: PoweredMinecart

import net.minecraft.entity.item.EntityMinecartFurnace; //导入依赖的package包/类
public PoweredMinecart() {
    super(new EntityMinecartFurnace(null));
}
 
开发者ID:asusoda,项目名称:Corundum,代码行数:4,代码来源:PoweredMinecart.java

示例10: collectEntityData

import net.minecraft.entity.item.EntityMinecartFurnace; //导入依赖的package包/类
public void collectEntityData(List<String> lines, RayTraceResult ray, Entity entity){
  	String nameLine = entity.getDisplayName().getFormattedText() + " (#"+entity.getEntityId()+")";
lines.add(nameLine);		

  	boolean handledRider = false;
if(entity instanceof EntityItemFrame){
	EntityItemFrame frame = (EntityItemFrame)entity;
	ItemStack item = frame.getDisplayedItem();
	if(ItemStackTools.isEmpty(item)){
		lines.add("Item: "+Lang.localize("gui.empty"));
	} else {
		lines.add("Item: "+item.getDisplayName());
	}
}

  	if(entity instanceof EntityLivingBase){
	EntityLivingBase living = (EntityLivingBase)entity;
	String health = "Health: "+(living.getHealth()+" / "+ living.getMaxHealth());
	lines.add(health);
}
  	
  	if(entity instanceof EntityBoat){
  		EntityBoat boat = (EntityBoat)entity;
  		
  		if(boat.getControllingPassenger() !=null){
  			lines.add("Driver: "+boat.getControllingPassenger().getDisplayName().getFormattedText());
  		} else {
  			lines.add("Driver: "+Lang.localize("gui.empty"));
  		}
  		
  		if(!boat.getPassengers().isEmpty() && boat.getPassengers().size() > 1 && boat.getPassengers().get(1) !=null){
  			lines.add("Passenger: "+boat.getPassengers().get(1).getDisplayName().getFormattedText());
  		} else {
  			lines.add("Passenger: "+Lang.localize("gui.empty"));
  		}
  		handledRider = true;
  	}
  	
  	if(entity instanceof EntityMinecart){
  		EntityMinecart cart = (EntityMinecart)entity;

  		if(cart instanceof EntityMinecartEmpty){
   		if(cart.getControllingPassenger() !=null){
   			lines.add("Rider: "+cart.getControllingPassenger().getDisplayName().getFormattedText());
   		} else {
   			lines.add("Rider: "+Lang.localize("gui.empty"));
   		}
  		}
  		if(cart instanceof EntityMinecartFurnace){
  			EntityMinecartFurnace furnace = (EntityMinecartFurnace)cart;
  			int fuel = ObfuscationReflectionHelper.getPrivateValue(EntityMinecartFurnace.class, furnace, 1);
   		lines.add("Fuel: "+TimeUtil.getTimeFromTicks(fuel));
  		}
  		handledRider = true;
  	}
  	
  	if(entity instanceof IEntityOwnable){
  		IEntityOwnable ownable = (IEntityOwnable)entity;
  		UUID owner = ownable.getOwnerId();
  		if(owner !=null){
  			String name = ProfileUtil.getUsername(owner);
  			if(name != ProfileUtil.ERROR){
  				lines.add("Owner: "+name);
  			}
  		}
  	}
  	
  	if(!handledRider && entity.getControllingPassenger() !=null){
  		lines.add("Rider: "+entity.getControllingPassenger().getDisplayName().getFormattedText());
  	}
  }
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:72,代码来源:ClientEventHandler.java

示例11: fromMC

import net.minecraft.entity.item.EntityMinecartFurnace; //导入依赖的package包/类
/** 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 PoweredMinecart fromMC(EntityMinecartFurnace entityMC) {
    return new PoweredMinecart(entityMC);
}
 
开发者ID:asusoda,项目名称:Corundum,代码行数:10,代码来源:PoweredMinecart.java


注:本文中的net.minecraft.entity.item.EntityMinecartFurnace类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。