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


Java Items.FEATHER属性代码示例

本文整理汇总了Java中net.minecraft.init.Items.FEATHER属性的典型用法代码示例。如果您正苦于以下问题:Java Items.FEATHER属性的具体用法?Java Items.FEATHER怎么用?Java Items.FEATHER使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.minecraft.init.Items的用法示例。


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

示例1: matches

@Override
public boolean matches(InventoryCrafting inv, World worldIn) {
	int feather = 0;
	ItemStack stack2 = ItemStack.EMPTY;

	for (int x = 0; x < inv.getSizeInventory(); x++) {
		ItemStack stack = inv.getStackInSlot(x);
		if (!stack.isEmpty())
			if (stack.getItem() == Items.FEATHER) {
				if (feather < 8)
					feather++;
				else
					return false;
			} else if (stack2.isEmpty() && ItemFromData.isSameType(stack, nameBefore))
				stack2 = stack;
			else
				return false;
	}
	// System.out.println("matches "+(australium&&stack2!=null));
	return feather == 8 && !stack2.isEmpty();
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:21,代码来源:JumperRecipe.java

示例2: getCraftingResult

@Override
public ItemStack getCraftingResult(InventoryCrafting inv) {
	// TODO Auto-generated method stub
	ItemStack stack2 = ItemStack.EMPTY;

	for (int x = 0; x < inv.getSizeInventory(); x++) {
		ItemStack stack = inv.getStackInSlot(x);
		if (!stack.isEmpty())
			if (!(stack.getItem() == Items.FEATHER))
				stack2 = stack;
	}
	// System.out.println("OutPut: "+stack2);
	if (!stack2.isEmpty()) {
		if(ItemFromData.isSameType(stack2, nameBefore))
			stack2=ItemFromData.getNewStack(nameAfter);
	}
	return stack2;
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:18,代码来源:JumperRecipe.java

示例3: 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

示例4: 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

示例5: actionPerformed

@Override
@SuppressWarnings("unchecked")
protected void actionPerformed(GuiButton button) throws IOException {
	if (button.id < 12) {
		int currentRecipe = button.id + this.firstIndex;
		((ContainerTF2Workbench) this.inventorySlots).currentRecipe = currentRecipe;
		this.mc.playerController.sendEnchantPacket(this.inventorySlots.windowId, currentRecipe);
		setButtons();
		this.inventorySlots.onCraftMatrixChanged(null);
		itemsToRender = new ItemStack[9];
		if (currentRecipe >= 0 && currentRecipe < TF2CraftingManager.INSTANCE.getRecipeList().size()) {
			IRecipe recipe = TF2CraftingManager.INSTANCE.getRecipeList().get(currentRecipe);
			if (recipe instanceof AustraliumRecipe) {
				itemsToRender[0] = new ItemStack(TF2weapons.itemTF2, 1, 2);
				itemsToRender[1] = new ItemStack(TF2weapons.itemTF2, 1, 2);
				itemsToRender[2] = new ItemStack(TF2weapons.itemTF2, 1, 2);
				itemsToRender[3] = new ItemStack(TF2weapons.itemTF2, 1, 2);
				itemsToRender[5] = new ItemStack(TF2weapons.itemTF2, 1, 2);
				itemsToRender[6] = new ItemStack(TF2weapons.itemTF2, 1, 2);
				itemsToRender[7] = new ItemStack(TF2weapons.itemTF2, 1, 2);
				itemsToRender[8] = new ItemStack(TF2weapons.itemTF2, 1, 2);
				itemsToRender[4] = new ItemStack(TF2weapons.itemTF2, 1, 9);
			} else if (recipe instanceof JumperRecipe) {
				itemsToRender[0] = new ItemStack(Items.FEATHER);
				itemsToRender[1] = new ItemStack(Items.FEATHER);
				itemsToRender[2] = new ItemStack(Items.FEATHER);
				itemsToRender[3] = new ItemStack(Items.FEATHER);
				itemsToRender[5] = new ItemStack(Items.FEATHER);
				itemsToRender[6] = new ItemStack(Items.FEATHER);
				itemsToRender[7] = new ItemStack(Items.FEATHER);
				itemsToRender[8] = new ItemStack(Items.FEATHER);
				itemsToRender[4] = ItemFromData.getNewStack(((JumperRecipe)recipe).nameBefore);
			} else if (recipe instanceof RecipeToScrap) {
				itemsToRender[0] = new ItemStack(TF2weapons.itemTF2, 1, 9);
				itemsToRender[1] = new ItemStack(TF2weapons.itemTF2, 1, 9);
			} else if (recipe instanceof OpenCrateRecipe) {
				itemsToRender[0] = new ItemStack(TF2weapons.itemTF2, 1, 7);
				itemsToRender[1] = ItemFromData.getNewStack("crate1");
			}
			else{
				List<Ingredient> input = recipe.getIngredients();
				
				for (int i = 0; i < input.size(); i++) {
					int space = 0;
					if(recipe instanceof ShapedRecipes)
						space = (3-((ShapedRecipes)recipe).recipeWidth)*(i/((ShapedRecipes)recipe).recipeWidth);
					else if(recipe instanceof ShapedOreRecipe)
						space = (3-((ShapedOreRecipe)recipe).getWidth())*(i/((ShapedOreRecipe)recipe).getWidth());
						
					if(input.get(i).getMatchingStacks().length>0) {
						itemsToRender[i + space] = input.get(i).getMatchingStacks()[0];
						if(itemsToRender[i + space].getMetadata()==32767)
							itemsToRender[i + space].setItemDamage(0);
					}
				}
			}
		}
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:59,代码来源:GuiTF2Crafting.java


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