當前位置: 首頁>>代碼示例>>Java>>正文


Java Items.SLIME_BALL屬性代碼示例

本文整理匯總了Java中net.minecraft.init.Items.SLIME_BALL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Items.SLIME_BALL屬性的具體用法?Java Items.SLIME_BALL怎麽用?Java Items.SLIME_BALL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在net.minecraft.init.Items的用法示例。


在下文中一共展示了Items.SLIME_BALL屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getDyeCraftingResult

private static ItemStack getDyeCraftingResult(int meta) {
	
	switch (meta) {
		default: return new ItemStack(Items.GHAST_TEAR);
		case 1: return new ItemStack(Items.FIRE_CHARGE, 8, 0);
		case 2: return new ItemStack(Items.DRAGON_BREATH);
		case 3: return new ItemStack(Items.DIAMOND);
		case 4: return new ItemStack(Items.GOLD_INGOT);
		case 5: return new ItemStack(Items.SLIME_BALL, 4, 0);
		case 6: return new ItemStack(Items.SADDLE);
		case 7: return new ItemStack(Blocks.CLAY, 8, 0);
		case 8: return new ItemStack(Items.IRON_INGOT, 2, 0);
		case 9: return new ItemStack(Blocks.STAINED_HARDENED_CLAY, 16, EnumDyeColor.CYAN.getMetadata());
		case 10: return new ItemStack(Items.CHORUS_FRUIT);
		case 11: return new ItemStack(Blocks.PRISMARINE, 8, 0);
		case 12: return new ItemStack(Blocks.DIRT, 3, 0);
		case 13: return new ItemStack(Items.EMERALD);
		case 14: return new ItemStack(Items.NETHER_WART);
		case 15: return new ItemStack(Items.SKULL, 1, 1);
	}
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:21,代碼來源:UCRecipes.java

示例2: init

public static void init() {

		slime = new SlimeRecipe(new ItemStack(Items.SLIME_BALL), 1200, 0);
		slime.setRegistryName(LibMod.MOD_ID, "slime");
		// potionDetonation = new PotionExplosion(ItemStack.EMPTY, ItemStack.EMPTY, 100, 200);
		// potionDetonation.setRegistryName(Reference.MID, "detonation");
		registerAll();
	}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:8,代碼來源:ModBarrelRecipes.java

示例3: performLegacyCurse

/**
 * Original KodaichiZero slime curse - fill the player's inventory with slime balls
 */
private void performLegacyCurse()
{
	EntityPlayer player = (EntityPlayer)this.victim;
	ItemStack stack = new ItemStack(Items.SLIME_BALL, 16 + this.rand.nextInt(17), 0);
	EntityItem entityItem = new EntityItem(this.world, this.posX, this.posY, this.posZ, stack);

	if (player.inventory.addItemStackToInventory(stack))
	{
		ForgeEventFactory.onItemPickup(entityItem, player);
		player.playSound(SoundEvents.ENTITY_SLIME_ATTACK, 0.75F, (this.rand.nextFloat() * 0.2F) + 0.9F);
	}
}
 
開發者ID:crazysnailboy,項目名稱:Halloween,代碼行數:15,代碼來源:EntitySlimeCurse.java

示例4: matches

@Override
public boolean matches(InventoryCrafting inventorycrafting, World world) {
	int launchers = 0;
	int slimeballs = 0;
	int feathers = 0;
	int ingots = 0;
	boolean activator = false;
	boolean shotblock = false;
	/*
	 * int bows=0; int flintandsteel=0; int powder=0; int redstone=0;
	 */
	for (int i = 0; i < inventorycrafting.getSizeInventory(); i++)
		if (inventorycrafting.getStackInSlot(i) != null && inventorycrafting.getStackInSlot(i).getCount() != 0)
			if (inventorycrafting.getStackInSlot(i).getItem() instanceof TNTCannon) {
				launchers++;
				activator = BlockLauncher.cannon.isActivator(inventorycrafting.getStackInSlot(i));
				shotblock = BlockLauncher.cannon.isSpreader(inventorycrafting.getStackInSlot(i));
			} else if (inventorycrafting.getStackInSlot(i).getItem() == Items.SLIME_BALL)
				slimeballs++;
			else if (inventorycrafting.getStackInSlot(i).getItem() == Items.FEATHER)
				feathers++;
			else if (inventorycrafting.getStackInSlot(i).getItem() == Items.IRON_INGOT)
				ingots++;
			else
				return false;
	if (launchers == 1 && (slimeballs == 0 || slimeballs == 4 || slimeballs == 8)
			&& (feathers == 0 || (feathers == 4 && activator)) && (ingots == 0 || ingots == 4 || (ingots == 8 && shotblock)))
		return true;
	return false;
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:30,代碼來源:RecipesBlockLauncher.java

示例5: getItemDropped

@Override
@SideOnly(Side.CLIENT)
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
	return Items.SLIME_BALL;
}
 
開發者ID:YoungGT,項目名稱:EasyCraft,代碼行數:5,代碼來源:BlockSlimeBlock.java

示例6: getDropItem

protected Item getDropItem()
{
    return this.getSlimeSize() == 1 ? Items.SLIME_BALL : null;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:4,代碼來源:EntitySlime.java

示例7: createParticle

public Particle createParticle(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
    return new ParticleBreaking(worldIn, xCoordIn, yCoordIn, zCoordIn, Items.SLIME_BALL);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:4,代碼來源:ParticleBreaking.java

示例8: getCraftingResult

@Override
public ItemStack getCraftingResult(InventoryCrafting inventorycrafting) {
	int launchers = 0;
	int launcherslot = -1;
	int slimeballs = 0;
	int feathers = 0;
	int ingots = 0;
	/*
	 * int bows=0; int flintandsteel=0; int powder=0; int redstone=0;
	 */
	for (int i = 0; i < inventorycrafting.getSizeInventory(); i++)
		if (inventorycrafting.getStackInSlot(i) != null && inventorycrafting.getStackInSlot(i).getCount() != 0)
			if (inventorycrafting.getStackInSlot(i).getItem() instanceof TNTCannon) {
				launchers++;
				launcherslot = i;
			} else if (inventorycrafting.getStackInSlot(i).getItem() == Items.SLIME_BALL)
				slimeballs++;
			else if (inventorycrafting.getStackInSlot(i).getItem() == Items.FEATHER)
				feathers++;
			else if (inventorycrafting.getStackInSlot(i).getItem() == Items.IRON_INGOT)
				ingots++;
			else
				return null;
	if (launchers == 1) {
		ItemStack stack = inventorycrafting.getStackInSlot(launcherslot).copy();
		if (stack.getTagCompound() == null)
			stack.setTagCompound(new NBTTagCompound());
		if (slimeballs == 4) {
			stack.getTagCompound().setBoolean("Sticky", true);
			stack.getTagCompound().removeTag("Bouncy");
		} else if (slimeballs == 8) {
			stack.getTagCompound().setBoolean("Bouncy", true);
			stack.getTagCompound().removeTag("Sticky");
		}
		if (feathers == 4)
			stack.getTagCompound().setBoolean("Harmless", true);
		if (ingots == 8)
			stack.getTagCompound().setBoolean("Stack", true);
		else if(ingots == 4)
			stack.getTagCompound().setBoolean("Crushing", true);
		/*
		 * if(bows==1){ stack.getTagCompound().setBoolean("BowLike",true); }
		 * if(flintandsteel==1){
		 * stack.getTagCompound().setBoolean("Activator",true); }
		 * if(powder==1){ stack.getTagCompound().setBoolean("Powder", true);
		 * } if(redstone==1){ stack.getTagCompound().setBoolean("Glowstone",
		 * true); }
		 */
		return stack;
	}
	return ItemStack.EMPTY;
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:52,代碼來源:RecipesBlockLauncher.java


注:本文中的net.minecraft.init.Items.SLIME_BALL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。