• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java SlimefunItems类的典型用法和代码示例

java 1次浏览

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

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

示例1: registerDefaultRecipes

点赞 3

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public void registerDefaultRecipes()
{
    registerRecipe(2, new ItemStack[] {
        new ItemStack(Material.WATER_BUCKET)
    }, new ItemStack[] {
        new ItemStack(Material.BUCKET), new ItemStack(Material.ICE)
    });
    registerRecipe(8, new ItemStack[] {
        new ItemStack(Material.LAVA_BUCKET)
    }, new ItemStack[] {
        new ItemStack(Material.BUCKET), new ItemStack(Material.OBSIDIAN)
    });
    registerRecipe(4, new ItemStack[] {
        new ItemStack(Material.ICE)
    }, new ItemStack[] {
        new ItemStack(Material.PACKED_ICE)
    });
    registerRecipe(6, new ItemStack[] {
        new ItemStack(Material.PACKED_ICE)
    }, new ItemStack[] {
        SlimefunItems.REACTOR_COOLANT_CELL
    });
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:24,
代码来源:Freezer.java

示例2: getRecipeOutput

点赞 3

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public static ItemStack getRecipeOutput(ItemStack catalyst, List input)
{
    if(input.size() != 8)
        return null;
    if(SlimefunManager.isItemSimiliar(catalyst, SlimefunItems.BROKEN_SPAWNER, false))
    {
        if(checkRecipe(SlimefunItems.BROKEN_SPAWNER, input) == null)
        {
            return null;
        } else
        {
            ItemStack spawner = SlimefunItems.REPAIRED_SPAWNER.clone();
            ItemMeta im = spawner.getItemMeta();
            im.setLore(Arrays.asList(new String[] {
                (String)catalyst.getItemMeta().getLore().get(0)
            }));
            spawner.setItemMeta(im);
            return spawner;
        }
    } else
    {
        return checkRecipe(catalyst, input);
    }
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:25,
代码来源:Pedestals.java

示例3: tick

点赞 3

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
protected void tick(Block b) throws Exception {
	for (Entity n: me.mrCookieSlime.Slimefun.holograms.AutoBreeder.getArmorStand(b).getNearbyEntities(4D, 2D, 4D)) {
		if (Animals.isFeedable(n)) {
			for (int slot: getInputSlots()) {
				if (SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), SlimefunItems.ORGANIC_FOOD, false)) {
					if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return;
					ChargableBlock.addCharge(b, -getEnergyConsumption());
					BlockStorage.getInventory(b).replaceExistingItem(slot, InvUtils.decreaseItem(BlockStorage.getInventory(b).getItemInSlot(slot), 1));
					Animals.feed(n);
					ParticleEffect.HEART.display(((LivingEntity) n).getEyeLocation(), 0.2F, 0.2F, 0.2F, 0, 8);
					return;
				}
			}
		}
	}
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:17,
代码来源:AutoBreeder.java

示例4: tick

点赞 3

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
protected void tick(Block b) throws Exception {
	for (Entity n: me.mrCookieSlime.Slimefun.holograms.AnimalGrowthAccelerator.getArmorStand(b).getNearbyEntities(3D, 3D, 3D)) {
		if (n instanceof Ageable && !((Ageable) n).isAdult()) {
			for (int slot: getInputSlots()) {
				if (SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), SlimefunItems.ORGANIC_FOOD, false)) {
					if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return;
					ChargableBlock.addCharge(b, -getEnergyConsumption());
					BlockStorage.getInventory(b).replaceExistingItem(slot, InvUtils.decreaseItem(BlockStorage.getInventory(b).getItemInSlot(slot), 1));
					((Ageable) n).setAge(((Ageable) n).getAge() + 2000);
					if (((Ageable) n).getAge() > 0) ((Ageable) n).setAge(0);
					ParticleEffect.VILLAGER_HAPPY.display(((LivingEntity) n).getEyeLocation(), 0.2F, 0.2F, 0.2F, 0, 8);
					return;
				}
			}
		}
	}
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:18,
代码来源:AnimalGrowthAccelerator.java

示例5: registerDefaultRecipes

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public void registerDefaultRecipes()
{
    registerRecipe(30, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD2
    }, new ItemStack[] {
        SlimefunItems.FERTILIZER2
    });
    registerRecipe(30, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD3
    }, new ItemStack[] {
        SlimefunItems.FERTILIZER3
    });
    registerRecipe(30, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD4
    }, new ItemStack[] {
        SlimefunItems.FERTILIZER4
    });
    registerRecipe(30, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD5
    }, new ItemStack[] {
        SlimefunItems.FERTILIZER5
    });
    registerRecipe(30, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD6
    }, new ItemStack[] {
        SlimefunItems.FERTILIZER6
    });
    registerRecipe(30, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD7
    }, new ItemStack[] {
        SlimefunItems.FERTILIZER7
    });
    registerRecipe(30, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD8
    }, new ItemStack[] {
        SlimefunItems.FERTILIZER8
    });
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:39,
代码来源:FoodComposter.java

示例6: registerDefaultRecipes

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public void registerDefaultRecipes()
{
    registerRecipe(15, new ItemStack[] {
        new CustomItem((new MaterialData(Material.COAL, (byte)1)).toItemStack(1), 4)
    }, new ItemStack[] {
        new ItemStack(Material.COAL)
    });
    registerRecipe(20, new ItemStack[] {
        new CustomItem(new ItemStack(Material.COAL), 8)
    }, new ItemStack[] {
        SlimefunItems.CARBON
    });
    registerRecipe(30, new ItemStack[] {
        new CustomItem(SlimefunItems.CARBON, 4)
    }, new ItemStack[] {
        SlimefunItems.COMPRESSED_CARBON
    });
    registerRecipe(60, new ItemStack[] {
        SlimefunItems.CARBON_CHUNK, SlimefunItems.SYNTHETIC_DIAMOND
    }, new ItemStack[] {
        SlimefunItems.RAW_CARBONADO
    });
    registerRecipe(60, new ItemStack[] {
        SlimefunItems.CARBON_CHUNK
    }, new ItemStack[] {
        SlimefunItems.SYNTHETIC_DIAMOND
    });
    registerRecipe(90, new ItemStack[] {
        SlimefunItems.RAW_CARBONADO
    }, new ItemStack[] {
        SlimefunItems.CARBONADO
    });
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:34,
代码来源:CarbonPress.java

示例7: tick

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
protected void tick(Block b)
    throws Exception
{
    for(Iterator iterator = me.mrCookieSlime.Slimefun.holograms.AutoBreeder.getArmorStand(b).getNearbyEntities(4D, 2D, 4D).iterator(); iterator.hasNext();)
    {
        Entity n = (Entity)iterator.next();
        if(Animals.isFeedable(n))
        {
            int ai[];
            int j = (ai = getInputSlots()).length;
            for(int i = 0; i < j; i++)
            {
                int slot = ai[i];
                if(SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), SlimefunItems.ORGANIC_FOOD, false))
                    if(ChargableBlock.getCharge(b) < getEnergyConsumption())
                    {
                        return;
                    } else
                    {
                        ChargableBlock.addCharge(b, -getEnergyConsumption());
                        BlockStorage.getInventory(b).replaceExistingItem(slot, InvUtils.decreaseItem(BlockStorage.getInventory(b).getItemInSlot(slot), 1));
                        Animals.feed(n);
                        ParticleEffect.HEART.display(((LivingEntity)n).getEyeLocation(), 0.2F, 0.2F, 0.2F, 0.0F, 8);
                        return;
                    }
            }

        }
    }

}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:32,
代码来源:AutoBreeder.java

示例8: tick

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
protected void tick(Block b)
    throws Exception
{
    for(Iterator iterator = me.mrCookieSlime.Slimefun.holograms.AnimalGrowthAccelerator.getArmorStand(b).getNearbyEntities(3D, 3D, 3D).iterator(); iterator.hasNext();)
    {
        Entity n = (Entity)iterator.next();
        if((n instanceof Ageable) && !((Ageable)n).isAdult())
        {
            int ai[];
            int j = (ai = getInputSlots()).length;
            for(int i = 0; i < j; i++)
            {
                int slot = ai[i];
                if(SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), SlimefunItems.ORGANIC_FOOD, false))
                {
                    if(ChargableBlock.getCharge(b) < getEnergyConsumption())
                        return;
                    ChargableBlock.addCharge(b, -getEnergyConsumption());
                    BlockStorage.getInventory(b).replaceExistingItem(slot, InvUtils.decreaseItem(BlockStorage.getInventory(b).getItemInSlot(slot), 1));
                    ((Ageable)n).setAge(((Ageable)n).getAge() + 2000);
                    if(((Ageable)n).getAge() > 0)
                        ((Ageable)n).setAge(0);
                    ParticleEffect.VILLAGER_HAPPY.display(((LivingEntity)n).getEyeLocation(), 0.2F, 0.2F, 0.2F, 0.0F, 8);
                    return;
                }
            }

        }
    }

}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:32,
代码来源:AnimalGrowthAccelerator.java

示例9: registerDefaultRecipes

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public void registerDefaultRecipes()
{
    registerRecipe(45, new ItemStack[] {
        SlimefunItems.BUCKET_OF_OIL
    }, new ItemStack[] {
        new CustomItem(SlimefunItems.PLASTIC_SHEET, 8)
    });
    registerRecipe(30, new ItemStack[] {
        SlimefunItems.GOLD_24K, SlimefunItems.URANIUM
    }, new ItemStack[] {
        SlimefunItems.BLISTERING_INGOT
    });
    registerRecipe(30, new ItemStack[] {
        SlimefunItems.BLISTERING_INGOT, SlimefunItems.CARBONADO
    }, new ItemStack[] {
        SlimefunItems.BLISTERING_INGOT_2
    });
    registerRecipe(60, new ItemStack[] {
        SlimefunItems.BLISTERING_INGOT_2, new ItemStack(Material.NETHER_STAR)
    }, new ItemStack[] {
        SlimefunItems.BLISTERING_INGOT_3
    });
    registerRecipe(90, new ItemStack[] {
        SlimefunItems.PLUTONIUM, SlimefunItems.URANIUM
    }, new ItemStack[] {
        SlimefunItems.BOOSTED_URANIUM
    });
    registerRecipe(60, new ItemStack[] {
        SlimefunItems.NETHER_ICE, SlimefunItems.PLUTONIUM
    }, new ItemStack[] {
        new CustomItem(SlimefunItems.ENRICHED_NETHER_ICE, 4)
    });
    registerRecipe(45, new ItemStack[] {
        SlimefunItems.ENRICHED_NETHER_ICE
    }, new ItemStack[] {
        new CustomItem(SlimefunItems.NETHER_ICE_COOLANT_CELL, 8)
    });
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:39,
代码来源:HeatedPressureChamber.java

示例10: registerDefaultRecipes

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public void registerDefaultRecipes()
{
    registerRecipe(12, new ItemStack[] {
        SlimefunItems.CAN, new ItemStack(Material.WHEAT)
    }, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD2
    });
    registerRecipe(12, new ItemStack[] {
        SlimefunItems.CAN, new ItemStack(Material.CARROT_ITEM)
    }, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD3
    });
    registerRecipe(12, new ItemStack[] {
        SlimefunItems.CAN, new ItemStack(Material.POTATO_ITEM)
    }, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD4
    });
    registerRecipe(12, new ItemStack[] {
        SlimefunItems.CAN, new ItemStack(Material.SEEDS)
    }, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD5
    });
    registerRecipe(12, new ItemStack[] {
        SlimefunItems.CAN, new ItemStack(Material.BEETROOT)
    }, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD6
    });
    registerRecipe(12, new ItemStack[] {
        SlimefunItems.CAN, new ItemStack(Material.MELON)
    }, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD7
    });
    registerRecipe(12, new ItemStack[] {
        SlimefunItems.CAN, new ItemStack(Material.APPLE)
    }, new ItemStack[] {
        SlimefunItems.ORGANIC_FOOD8
    });
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:39,
代码来源:FoodFabricator.java

示例11: setupMisc

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public static void setupMisc()
{
    if(SlimefunItem.getByName("COMMON_TALISMAN") != null && ((Boolean)Slimefun.getItemValue("COMMON_TALISMAN", "recipe-requires-nether-stars")).booleanValue())
        SlimefunItem.getByName("COMMON_TALISMAN").setRecipe(new ItemStack[] {
            SlimefunItems.MAGIC_LUMP_2, SlimefunItems.GOLD_8K, SlimefunItems.MAGIC_LUMP_2, 0, new ItemStack(Material.NETHER_STAR), 0, SlimefunItems.MAGIC_LUMP_2, SlimefunItems.GOLD_8K, SlimefunItems.MAGIC_LUMP_2
        });
    SlimefunItem.setRadioactive(SlimefunItems.URANIUM);
    SlimefunItem.setRadioactive(SlimefunItems.SMALL_URANIUM);
    SlimefunItem.setRadioactive(SlimefunItems.BLISTERING_INGOT);
    SlimefunItem.setRadioactive(SlimefunItems.BLISTERING_INGOT_2);
    SlimefunItem.setRadioactive(SlimefunItems.BLISTERING_INGOT_3);
    SlimefunItem.setRadioactive(SlimefunItems.NETHER_ICE);
    SlimefunItem.setRadioactive(SlimefunItems.ENRICHED_NETHER_ICE);
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:15,
代码来源:MiscSetup.java

示例12: onAnvil

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@EventHandler
  public void onAnvil(InventoryClickEvent e) {
      if (e.getRawSlot() == 2 && e.getWhoClicked() instanceof Player && e.getInventory().getType() == InventoryType.ANVIL) {
if (SlimefunManager.isItemSimiliar(e.getInventory().getContents()[0], SlimefunItems.ELYTRA, true)) return;

      	if (SlimefunItem.getByItem(e.getInventory().getContents()[0]) != null && !SlimefunItem.isDisabled(e.getInventory().getContents()[0])) {
          	e.setCancelled(true);
              Messages.local.sendTranslation((Player) e.getWhoClicked(), "anvil.not-working", true);
          }
      }
  }
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:12,
代码来源:ItemListener.java

示例13: registerBerry

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public void registerBerry(String name, String color, int potion, PlantType type, PlantData data) {
	Berry berry = new Berry(name.toUpperCase(), type, data);
	berries.add(berry);
	
	items.put(name.toUpperCase() + "_BUSH", new CustomItem(Material.SAPLING, color + name + " Bush", 0));
	
	new SlimefunItem(category_main, new CustomItem(Material.SAPLING, color + name + " Bush", 0), name.toUpperCase() + "_BUSH", new RecipeType(new CustomItem(Material.LONG_GRASS, "&7Breaking Grass", 1)),
	new ItemStack[] {null, null, null, null, new CustomItem(Material.LONG_GRASS, 1), null, null, null, null})
	.register();
	
	new EGPlant(category_main, new CustomItem(getSkull(Material.NETHER_STALK, data.getTexture()), color + name), name.toUpperCase(), new RecipeType(new CustomItem(Material.LEAVES, "&7Obtained by harvesting the specific Bush", 0)), true,
	new ItemStack[] {null, null, null, null, getItem(name.toUpperCase() + "_BUSH"), null, null, null, null})
	.register();

	new Juice(category_drinks, new CustomPotion(color + name + " Juice", potion, new String[] {"", "�7�oRestores �b�o" + "3.0" + " �7�oHunger"}, new PotionEffect(PotionEffectType.SATURATION, 6, 0)), name.toUpperCase() + "_JUICE", RecipeType.JUICER,
	new ItemStack[] {getItem(name.toUpperCase()), null, null, null, null, null, null, null, null})
	.register();
	
	new Juice(category_drinks, new CustomPotion(color + name + " Smoothie", potion, new String[] {"", "�7�oRestores �b�o" + "5.0" + " �7�oHunger"}, new PotionEffect(PotionEffectType.SATURATION, 10, 0)), name.toUpperCase() + "_SMOOTHIE", RecipeType.ENHANCED_CRAFTING_TABLE,
	new ItemStack[] {getItem(name.toUpperCase() + "_JUICE"), getItem("ICE_CUBE"), null, null, null, null, null, null, null})
	.register();
	
	try {
		new CustomFood(category_food, new CustomItem(getSkull(Material.BREAD, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGM4YTkzOTA5M2FiMWNkZTY2NzdmYWY3NDgxZjMxMWU1ZjE3ZjYzZDU4ODI1ZjBlMGMxNzQ2MzFmYjA0MzkifX19"), color + name + " Jelly Sandwich", "", "�7�oRestores �b�o" + "8.0" + " �7�oHunger"), name.toUpperCase() + "_JELLY_SANDWICH",
		new ItemStack[] {null, new ItemStack(Material.BREAD), null, null, getItem(name.toUpperCase() + "_JUICE"), null, null, new ItemStack(Material.BREAD), null},
		16)
		.register();
		
		new CustomFood(category_food, new CustomItem(getSkull(Material.PUMPKIN_PIE, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzQxOGM2YjBhMjlmYzFmZTc5MWM4OTc3NGQ4MjhmZjYzZDJhOWZhNmM4MzM3M2VmM2FhNDdiZjNlYjc5In19fQ=="), color + name + " Pie", "", "�7�oRestores �b�o" + "6.5" + " �7�oHunger"), name.toUpperCase() + "_PIE",
		new ItemStack[] {getItem(name.toUpperCase()), new ItemStack(Material.EGG), new ItemStack(Material.SUGAR), new ItemStack(Material.MILK_BUCKET), SlimefunItems.WHEAT_FLOUR, null, null, null, null},
		13)
		.register();
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 

开发者ID:TheBusyBiscuit,
项目名称:ExoticGarden,
代码行数:37,
代码来源:ExoticGarden.java

示例14: registerDefaultRecipes

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@Override
public void registerDefaultRecipes() {
	registerRecipe(new MachineRecipe(8, new ItemStack[] {SlimefunItems.ALUMINUM_DUST}, new ItemStack[] {SlimefunItems.ALUMINUM_INGOT}));
	registerRecipe(new MachineRecipe(8, new ItemStack[] {SlimefunItems.COPPER_DUST}, new ItemStack[] {SlimefunItems.COPPER_INGOT}));
	registerRecipe(new MachineRecipe(8, new ItemStack[] {SlimefunItems.GOLD_DUST}, new ItemStack[] {SlimefunItems.GOLD_4K}));
	registerRecipe(new MachineRecipe(8, new ItemStack[] {SlimefunItems.IRON_DUST}, new ItemStack[] {new ItemStack(Material.IRON_INGOT)}));
	registerRecipe(new MachineRecipe(8, new ItemStack[] {SlimefunItems.LEAD_DUST}, new ItemStack[] {SlimefunItems.LEAD_INGOT}));
	registerRecipe(new MachineRecipe(8, new ItemStack[] {SlimefunItems.MAGNESIUM_DUST}, new ItemStack[] {SlimefunItems.MAGNESIUM_INGOT}));
	registerRecipe(new MachineRecipe(8, new ItemStack[] {SlimefunItems.SILVER_DUST}, new ItemStack[] {SlimefunItems.SILVER_INGOT}));
	registerRecipe(new MachineRecipe(8, new ItemStack[] {SlimefunItems.TIN_DUST}, new ItemStack[] {SlimefunItems.TIN_INGOT}));
	registerRecipe(new MachineRecipe(8, new ItemStack[] {SlimefunItems.ZINC_DUST}, new ItemStack[] {SlimefunItems.ZINC_INGOT}));
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:13,
代码来源:ElectricIngotFactory.java

示例15: registerDefaultRecipes

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@Override
public void registerDefaultRecipes() {
	registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD2}, new ItemStack[] {SlimefunItems.FERTILIZER2});
	registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD3}, new ItemStack[] {SlimefunItems.FERTILIZER3});
	registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD4}, new ItemStack[] {SlimefunItems.FERTILIZER4});
	registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD5}, new ItemStack[] {SlimefunItems.FERTILIZER5});
	registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD6}, new ItemStack[] {SlimefunItems.FERTILIZER6});
	registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD7}, new ItemStack[] {SlimefunItems.FERTILIZER7});
	registerRecipe(30, new ItemStack[] {SlimefunItems.ORGANIC_FOOD8}, new ItemStack[] {SlimefunItems.FERTILIZER8});
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:11,
代码来源:FoodComposter.java

示例16: registerDefaultRecipes

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void registerDefaultRecipes() {
	registerRecipe(15, new ItemStack[] {new CustomItem(new MaterialData(Material.COAL,  (byte) 1).toItemStack(1), 4)}, new ItemStack[] {new ItemStack(Material.COAL)});
	registerRecipe(20, new ItemStack[] {new CustomItem(new ItemStack(Material.COAL), 8)}, new ItemStack[] {SlimefunItems.CARBON});
	registerRecipe(30, new ItemStack[] {new CustomItem(SlimefunItems.CARBON, 4)}, new ItemStack[] {SlimefunItems.COMPRESSED_CARBON});
	registerRecipe(60, new ItemStack[] {SlimefunItems.CARBON_CHUNK, SlimefunItems.SYNTHETIC_DIAMOND}, new ItemStack[] {SlimefunItems.RAW_CARBONADO});
	registerRecipe(60, new ItemStack[] {SlimefunItems.CARBON_CHUNK}, new ItemStack[] {SlimefunItems.SYNTHETIC_DIAMOND});
	registerRecipe(90, new ItemStack[] {SlimefunItems.RAW_CARBONADO}, new ItemStack[] {SlimefunItems.CARBONADO});
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:11,
代码来源:CarbonPress.java

示例17: registerDefaultRecipes

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@Override
public void registerDefaultRecipes() {
	registerRecipe(45, new ItemStack[] {SlimefunItems.BUCKET_OF_OIL}, new ItemStack[] {new CustomItem(SlimefunItems.PLASTIC_SHEET, 8)});
	registerRecipe(30, new ItemStack[] {SlimefunItems.GOLD_24K, SlimefunItems.URANIUM}, new ItemStack[] {SlimefunItems.BLISTERING_INGOT});
	registerRecipe(30, new ItemStack[] {SlimefunItems.BLISTERING_INGOT, SlimefunItems.CARBONADO}, new ItemStack[] {SlimefunItems.BLISTERING_INGOT_2});
	registerRecipe(60, new ItemStack[] {SlimefunItems.BLISTERING_INGOT_2, new ItemStack(Material.NETHER_STAR)}, new ItemStack[] {SlimefunItems.BLISTERING_INGOT_3});
	registerRecipe(90, new ItemStack[] {SlimefunItems.PLUTONIUM, SlimefunItems.URANIUM}, new ItemStack[] {SlimefunItems.BOOSTED_URANIUM});
	registerRecipe(60, new ItemStack[]{SlimefunItems.NETHER_ICE, SlimefunItems.PLUTONIUM}, new ItemStack[]{new CustomItem(SlimefunItems.ENRICHED_NETHER_ICE, 4)});
	registerRecipe(45, new ItemStack[]{SlimefunItems.ENRICHED_NETHER_ICE}, new ItemStack[]{new CustomItem(SlimefunItems.NETHER_ICE_COOLANT_CELL, 8)});
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:11,
代码来源:HeatedPressureChamber.java

示例18: registerDefaultRecipes

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@Override
public void registerDefaultRecipes() {
	registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.WHEAT)}, new ItemStack[] {SlimefunItems.ORGANIC_FOOD2});
	registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.CARROT_ITEM)}, new ItemStack[] {SlimefunItems.ORGANIC_FOOD3});
	registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.POTATO_ITEM)}, new ItemStack[] {SlimefunItems.ORGANIC_FOOD4});
	registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.SEEDS)}, new ItemStack[] {SlimefunItems.ORGANIC_FOOD5});
	registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.BEETROOT)}, new ItemStack[] {SlimefunItems.ORGANIC_FOOD6});
	registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.MELON)}, new ItemStack[] {SlimefunItems.ORGANIC_FOOD7});
	registerRecipe(12, new ItemStack[] {SlimefunItems.CAN, new ItemStack(Material.APPLE)}, new ItemStack[] {SlimefunItems.ORGANIC_FOOD8});
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:11,
代码来源:FoodFabricator.java

示例19: registerDefaultRecipes

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@Override
public void registerDefaultRecipes() {
	registerRecipe(2, new ItemStack[] {new ItemStack(Material.WATER_BUCKET)}, new ItemStack[] {new ItemStack(Material.BUCKET), new ItemStack(Material.ICE)});
	registerRecipe(8, new ItemStack[] {new ItemStack(Material.LAVA_BUCKET)}, new ItemStack[] {new ItemStack(Material.BUCKET), new ItemStack(Material.OBSIDIAN)});
	registerRecipe(4, new ItemStack[] {new ItemStack(Material.ICE)}, new ItemStack[] {new ItemStack(Material.PACKED_ICE)});
	registerRecipe(6, new ItemStack[] {new ItemStack(Material.PACKED_ICE)}, new ItemStack[] {SlimefunItems.REACTOR_COOLANT_CELL});
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:8,
代码来源:Freezer.java

示例20: setupMisc

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public static void setupMisc() {
	if (SlimefunItem.getByID("COMMON_TALISMAN") != null && (Boolean) Slimefun.getItemValue("COMMON_TALISMAN", "recipe-requires-nether-stars")) {
		SlimefunItem.getByID("COMMON_TALISMAN").setRecipe(new ItemStack[] {SlimefunItems.MAGIC_LUMP_2, SlimefunItems.GOLD_8K, SlimefunItems.MAGIC_LUMP_2, null, new ItemStack(Material.NETHER_STAR), null, SlimefunItems.MAGIC_LUMP_2, SlimefunItems.GOLD_8K, SlimefunItems.MAGIC_LUMP_2});
	}
	SlimefunItem.setRadioactive(SlimefunItems.URANIUM);
	SlimefunItem.setRadioactive(SlimefunItems.SMALL_URANIUM);
	SlimefunItem.setRadioactive(SlimefunItems.BLISTERING_INGOT);
	SlimefunItem.setRadioactive(SlimefunItems.BLISTERING_INGOT_2);
	SlimefunItem.setRadioactive(SlimefunItems.BLISTERING_INGOT_3);
	SlimefunItem.setRadioactive(SlimefunItems.NETHER_ICE);
	SlimefunItem.setRadioactive(SlimefunItems.ENRICHED_NETHER_ICE);
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:13,
代码来源:MiscSetup.java

示例21: getRecipeOutput

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public static ItemStack getRecipeOutput(ItemStack catalyst, List<ItemStack> input) {
	if (input.size() != 8) return null;
	if (SlimefunManager.isItemSimiliar(catalyst, SlimefunItems.BROKEN_SPAWNER, false)) {
           if (checkRecipe(SlimefunItems.BROKEN_SPAWNER, input) == null) return null;
		final ItemStack spawner = SlimefunItems.REPAIRED_SPAWNER.clone();
		ItemMeta im = spawner.getItemMeta();
		im.setLore(Arrays.asList(catalyst.getItemMeta().getLore().get(0)));
		spawner.setItemMeta(im);
		return spawner;
	}

	return checkRecipe(catalyst, input);
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:14,
代码来源:Pedestals.java

示例22: registerDefaultRecipes

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public void registerDefaultRecipes()
{
    registerRecipe(new MachineRecipe(8, new ItemStack[] {
        SlimefunItems.ALUMINUM_DUST
    }, new ItemStack[] {
        SlimefunItems.ALUMINUM_INGOT
    }));
    registerRecipe(new MachineRecipe(8, new ItemStack[] {
        SlimefunItems.COPPER_DUST
    }, new ItemStack[] {
        SlimefunItems.COPPER_INGOT
    }));
    registerRecipe(new MachineRecipe(8, new ItemStack[] {
        SlimefunItems.GOLD_DUST
    }, new ItemStack[] {
        SlimefunItems.GOLD_4K
    }));
    registerRecipe(new MachineRecipe(8, new ItemStack[] {
        SlimefunItems.IRON_DUST
    }, new ItemStack[] {
        new ItemStack(Material.IRON_INGOT)
    }));
    registerRecipe(new MachineRecipe(8, new ItemStack[] {
        SlimefunItems.LEAD_DUST
    }, new ItemStack[] {
        SlimefunItems.LEAD_INGOT
    }));
    registerRecipe(new MachineRecipe(8, new ItemStack[] {
        SlimefunItems.MAGNESIUM_DUST
    }, new ItemStack[] {
        SlimefunItems.MAGNESIUM_INGOT
    }));
    registerRecipe(new MachineRecipe(8, new ItemStack[] {
        SlimefunItems.SILVER_DUST
    }, new ItemStack[] {
        SlimefunItems.SILVER_INGOT
    }));
    registerRecipe(new MachineRecipe(8, new ItemStack[] {
        SlimefunItems.TIN_DUST
    }, new ItemStack[] {
        SlimefunItems.TIN_INGOT
    }));
    registerRecipe(new MachineRecipe(8, new ItemStack[] {
        SlimefunItems.ZINC_DUST
    }, new ItemStack[] {
        SlimefunItems.ZINC_INGOT
    }));
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:49,
代码来源:ElectricIngotFactory.java

示例23: getOutputItems

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public ItemStack[] getOutputItems()
{
    return (new ItemStack[] {
        SlimefunItems.NETHER_ICE
    });
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:7,
代码来源:NetherDrill.java

示例24: tick

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
protected void tick(Block b)
{
    if(isProcessing(b))
    {
        int timeleft = ((Integer)progress.get(b)).intValue();
        if(timeleft > 0)
        {
            ItemStack item = getProgressBar().clone();
            item.setDurability(MachineHelper.getDurability(item, timeleft, ((MachineRecipe)processing.get(b)).getTicks()));
            ItemMeta im = item.getItemMeta();
            im.setDisplayName(" ");
            List lore = new ArrayList();
            lore.add(MachineHelper.getProgress(timeleft, ((MachineRecipe)processing.get(b)).getTicks()));
            lore.add("");
            lore.add(MachineHelper.getTimeLeft(timeleft / 2));
            im.setLore(lore);
            item.setItemMeta(im);
            BlockStorage.getInventory(b).replaceExistingItem(22, item);
            if(ChargableBlock.getCharge(b) < getEnergyConsumption())
                return;
            ChargableBlock.addCharge(b, -getEnergyConsumption());
            progress.put(b, Integer.valueOf(timeleft - 1));
        } else
        {
            BlockStorage.getInventory(b).replaceExistingItem(22, new CustomItem(new MaterialData(Material.STAINED_GLASS_PANE, (byte)15), " ", new String[0]));
            pushItems(b, ((MachineRecipe)processing.get(b)).getOutput());
            progress.remove(b);
            processing.remove(b);
        }
    } else
    if(OreGenSystem.getSupplies(OreGenSystem.getResource("Oil"), b.getChunk(), false) > 0)
    {
        int ai[];
        int j = (ai = getInputSlots()).length;
        for(int i = 0; i < j; i++)
        {
            int slot = ai[i];
            if(!SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), new ItemStack(Material.BUCKET), true))
                continue;
            MachineRecipe r = new MachineRecipe(26, new ItemStack[0], new ItemStack[] {
                SlimefunItems.BUCKET_OF_OIL
            });
            if(!fits(b, r.getOutput()))
                return;
            BlockStorage.getInventory(b).replaceExistingItem(slot, InvUtils.decreaseItem(BlockStorage.getInventory(b).getItemInSlot(slot), 1));
            processing.put(b, r);
            progress.put(b, Integer.valueOf(r.getTicks()));
            OreGenSystem.setSupplies(OreGenSystem.getResource("Oil"), b.getChunk(), OreGenSystem.getSupplies(OreGenSystem.getResource("Oil"), b.getChunk(), false) - 1);
            break;
        }

    }
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:54,
代码来源:OilPump.java

示例25: tick

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
protected void tick(Block b)
{
    if(isProcessing(b))
    {
        int timeleft = ((Integer)progress.get(b)).intValue();
        if(timeleft > 0)
        {
            ItemStack item = getProgressBar().clone();
            item.setDurability(MachineHelper.getDurability(item, timeleft, ((MachineRecipe)processing.get(b)).getTicks()));
            ItemMeta im = item.getItemMeta();
            im.setDisplayName(" ");
            List lore = new ArrayList();
            lore.add(MachineHelper.getProgress(timeleft, ((MachineRecipe)processing.get(b)).getTicks()));
            lore.add("");
            lore.add(MachineHelper.getTimeLeft(timeleft / 2));
            im.setLore(lore);
            item.setItemMeta(im);
            BlockStorage.getInventory(b).replaceExistingItem(22, item);
            if(ChargableBlock.isChargable(b))
            {
                if(ChargableBlock.getCharge(b) < getEnergyConsumption())
                    return;
                ChargableBlock.addCharge(b, -getEnergyConsumption());
                progress.put(b, Integer.valueOf(timeleft - 1));
            } else
            {
                progress.put(b, Integer.valueOf(timeleft - 1));
            }
        } else
        {
            BlockStorage.getInventory(b).replaceExistingItem(22, new CustomItem(new MaterialData(Material.STAINED_GLASS_PANE, (byte)15), " ", new String[0]));
            pushItems(b, ((MachineRecipe)processing.get(b)).getOutput());
            progress.remove(b);
            processing.remove(b);
        }
    } else
    {
        int ai[];
        int j = (ai = getInputSlots()).length;
        for(int i = 0; i < j; i++)
        {
            int slot = ai[i];
            if(!SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), SlimefunItems.BUCKET_OF_OIL, true))
                continue;
            MachineRecipe r = new MachineRecipe(40, new ItemStack[0], new ItemStack[] {
                SlimefunItems.BUCKET_OF_FUEL
            });
            if(!fits(b, r.getOutput()))
                return;
            BlockStorage.getInventory(b).replaceExistingItem(slot, InvUtils.decreaseItem(BlockStorage.getInventory(b).getItemInSlot(slot), 1));
            processing.put(b, r);
            progress.put(b, Integer.valueOf(r.getTicks()));
            break;
        }

    }
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:58,
代码来源:Refinery.java

示例26: getIcon

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public ItemStack getIcon()
{
    return SlimefunItems.NETHER_ICE.clone();
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:5,
代码来源:NetherIceResource.java

示例27: getIcon

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
public ItemStack getIcon()
{
    return SlimefunItems.BUCKET_OF_OIL.clone();
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:5,
代码来源:OilResource.java

示例28: debug

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler
public void debug(PlayerInteractEvent e) {
	if (e.getAction().equals(Action.PHYSICAL) || !e.getHand().equals(EquipmentSlot.HAND)) return;
	Player p = e.getPlayer();
	if (SlimefunManager.isItemSimiliar(e.getPlayer().getInventory().getItemInMainHand(), SlimefunItems.DEBUG_FISH, true) || SlimefunManager.isItemSimiliar(e.getPlayer().getInventory().getItemInOffHand(), SlimefunItems.DEBUG_FISH, true)) {
		e.setCancelled(true);
		if (p.isOp()) {
			switch (e.getAction()) {
			case LEFT_CLICK_BLOCK: {
				if (p.isSneaking()) {
					if (BlockStorage.hasBlockInfo(e.getClickedBlock())) {
						BlockStorage.clearBlockInfo(e.getClickedBlock());
					}
				}
				else e.setCancelled(false);
				break;
			}
			case RIGHT_CLICK_BLOCK: {
				if (p.isSneaking()) {
					Block b = e.getClickedBlock().getRelative(e.getBlockFace());
					b.setType(Material.SKULL);
					try {
						CustomSkull.setSkull(b, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTllYjlkYTI2Y2YyZDMzNDEzOTdhN2Y0OTEzYmEzZDM3ZDFhZDEwZWFlMzBhYjI1ZmEzOWNlYjg0YmMifX19");
					} catch (Exception e1) {
						e1.printStackTrace();
					}
				}
				else if (BlockStorage.hasBlockInfo(e.getClickedBlock())) {
					p.sendMessage(" ");
					p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&d" + e.getClickedBlock().getType() + ":" + e.getClickedBlock().getData() + " &[email protected] X: " + e.getClickedBlock().getX() + " Y: " + e.getClickedBlock().getY() + " Z: " + e.getClickedBlock().getZ()));
					p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dID: " + "&e" + BlockStorage.checkID(e.getClickedBlock())));
					if (e.getClickedBlock().getState() instanceof Skull) {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dSkull: " + "&2\u2714"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dRotation: &e" + ((Skull) e.getClickedBlock().getState()).getRotation().toString()));
					}
					if (BlockStorage.getStorage(e.getClickedBlock().getWorld()).hasInventory(e.getClickedBlock().getLocation())) {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dInventory: " + "&2\u2714"));
					}
					else {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dInventory: " + "&4\u2718"));
					}
					if (BlockStorage.check(e.getClickedBlock()).isTicking()) {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + "&2\u2714"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dAsync: &e" + (BlockStorage.check(e.getClickedBlock()).getTicker().isSynchronized() ? "&4\u2718": "&2\u2714")));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dTimings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock()) + "ms"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dTotal Timings: &e" + SlimefunStartup.ticker.getTimings(BlockStorage.checkID(e.getClickedBlock())) + "ms"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dChunk Timings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock().getChunk()) + "ms"));
					}
					else if (BlockStorage.check(e.getClickedBlock()).getEnergyTicker() != null) {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + "&b~ &3(Indirect)"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dTimings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock()) + "ms"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dChunk Timings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock().getChunk()) + "ms"));
					}
					else {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + "&4\u2718"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&',"&dTicking: " + "&4\u2718"));
					}
					if (ChargableBlock.isChargable(e.getClickedBlock())) {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dChargable: " + "&2\u2714"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dEnergy: &e" + ChargableBlock.getCharge(e.getClickedBlock()) + " / " + ChargableBlock.getMaxCharge(e.getClickedBlock())));
					}
					else {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dChargable: " + "&4\u2718"));
					}
					p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&6" + BlockStorage.getBlockInfoAsJson(e.getClickedBlock())));
					p.sendMessage(" ");
				}
				break;
			}
			default:
				break;
				
			}
		}
	}
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:78,
代码来源:ItemListener.java

示例29: onEat

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@EventHandler
public void onEat(PlayerItemConsumeEvent e) {
	if (e.getItem() != null) {
		final Player p = e.getPlayer();
		ItemStack item = e.getItem();
		if (Slimefun.hasUnlocked(p, item, true)) {
			if (SlimefunManager.isItemSimiliar(item, SlimefunItems.MONSTER_JERKY, true)) {
				e.setCancelled(true);
				if (SlimefunManager.isItemSimiliar(p.getInventory().getItemInOffHand(), SlimefunItems.MONSTER_JERKY, true)) {
					p.getInventory().setItemInOffHand(InvUtils.decreaseItem(p.getInventory().getItemInOffHand(), 1));
				}
				else{
					p.getInventory().setItemInMainHand(InvUtils.decreaseItem(p.getInventory().getItemInMainHand(), 1));
				}
				PlayerInventory.update(p);
				p.addPotionEffect(new PotionEffect(PotionEffectType.SATURATION, 5, 0));
			}
			else if (SlimefunManager.isItemSimiliar(item, SlimefunItems.FORTUNE_COOKIE, true)) p.sendMessage(ChatColor.translateAlternateColorCodes('&', Messages.local.getTranslation("messages.fortune-cookie").get(CSCoreLib.randomizer().nextInt(Messages.local.getTranslation("messages.fortune-cookie").size()))));
			else if (SlimefunManager.isItemSimiliar(item, SlimefunItems.BEEF_JERKY, true)) p.setSaturation((Integer) Slimefun.getItemValue("BEEF_JERKY", "Saturation"));
			else if (SlimefunManager.isItemSimiliar(item, SlimefunItems.MEDICINE, true)) {
				if (p.hasPotionEffect(PotionEffectType.POISON)) p.removePotionEffect(PotionEffectType.POISON);
				if (p.hasPotionEffect(PotionEffectType.WITHER)) p.removePotionEffect(PotionEffectType.WITHER);
				if (p.hasPotionEffect(PotionEffectType.SLOW)) p.removePotionEffect(PotionEffectType.SLOW);
				if (p.hasPotionEffect(PotionEffectType.SLOW_DIGGING)) p.removePotionEffect(PotionEffectType.SLOW_DIGGING);
				if (p.hasPotionEffect(PotionEffectType.WEAKNESS)) p.removePotionEffect(PotionEffectType.WEAKNESS);
				if (p.hasPotionEffect(PotionEffectType.CONFUSION)) p.removePotionEffect(PotionEffectType.CONFUSION);
				if (p.hasPotionEffect(PotionEffectType.BLINDNESS)) p.removePotionEffect(PotionEffectType.BLINDNESS);
				p.setFireTicks(0);
			}
			else if (item.getType() == Material.POTION) {
				SlimefunItem sfItem = SlimefunItem.getByItem(item);
				if (sfItem != null && sfItem instanceof Juice) {
					int mode = 0;
					
					if (SlimefunManager.isItemSimiliar(item, p.getInventory().getItemInMainHand(), true)) {
						if (p.getInventory().getItemInMainHand().getAmount() == 1) {
							mode = 0;
						}
						else {
							mode = 2;
						}
					}
					else if (SlimefunManager.isItemSimiliar(item, p.getInventory().getItemInOffHand(), true)) {
						if (p.getInventory().getItemInOffHand().getAmount() == 1) {
							mode = 1;
						}
						else {
							mode = 2;
						}
					}
					
					final int m = mode;
					
					Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunStartup.instance, new Runnable() {
						
						
		                @Override
		                public void run() {
		                    if (m == 0) {
		                    	p.getInventory().setItemInMainHand(null);
		                    }
		                    else if (m == 1) {
		                    	p.getInventory().setItemInOffHand(null);
		                    }
		                    else if (m == 2) {
		                    	p.getInventory().removeItem(new ItemStack(Material.GLASS_BOTTLE, 1));
		                    }
		                }
		                
		            }, 1L);
				}
			}
		}
		else e.setCancelled(true);
	}
}
 

开发者ID:StarWishsama,
项目名称:Slimefun4-Chinese-Version,
代码行数:77,
代码来源:ItemListener.java

示例30: getOutputItems

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@Override
public ItemStack[] getOutputItems() {
	return new ItemStack[] {SlimefunItems.NETHER_ICE};
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:5,
代码来源:NetherDrill.java

示例31: tick

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@SuppressWarnings("deprecation")
protected void tick(Block b) {
	if (isProcessing(b)) {
		int timeleft = progress.get(b);
		if (timeleft > 0) {
			ItemStack item = getProgressBar().clone();
	        item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
			ItemMeta im = item.getItemMeta();
			im.setDisplayName(" ");
			List<String> lore = new ArrayList<String>();
			lore.add(MachineHelper.getProgress(timeleft, processing.get(b).getTicks()));
			lore.add("");
			lore.add(MachineHelper.getTimeLeft(timeleft / 2));
			im.setLore(lore);
			item.setItemMeta(im);
			
			BlockStorage.getInventory(b).replaceExistingItem(22, item);
			
			if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return;
			ChargableBlock.addCharge(b, -getEnergyConsumption());
			
			progress.put(b, timeleft - 1);
		}
		else {
			BlockStorage.getInventory(b).replaceExistingItem(22, new CustomItem(new MaterialData(Material.STAINED_GLASS_PANE, (byte) 15), " "));
			pushItems(b, processing.get(b).getOutput());
			
			progress.remove(b);
			processing.remove(b);
		}
	}
	else if (OreGenSystem.getSupplies(OreGenSystem.getResource("Oil"), b.getChunk(), false) > 0) {
		for (int slot: getInputSlots()) {
			if (SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), new ItemStack(Material.BUCKET), true)) {
				MachineRecipe r = new MachineRecipe(26, new ItemStack[0], new ItemStack[] {SlimefunItems.BUCKET_OF_OIL});
				if (!fits(b, r.getOutput())) return;
				BlockStorage.getInventory(b).replaceExistingItem(slot, InvUtils.decreaseItem(BlockStorage.getInventory(b).getItemInSlot(slot), 1));
				processing.put(b, r);
				progress.put(b, r.getTicks());
				OreGenSystem.setSupplies(OreGenSystem.getResource("Oil"), b.getChunk(), OreGenSystem.getSupplies(OreGenSystem.getResource("Oil"), b.getChunk(), false) - 1);
				break;
			}
		}
	}
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:46,
代码来源:OilPump.java

示例32: tick

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@SuppressWarnings("deprecation")
protected void tick(Block b) {
	if (isProcessing(b)) {
		int timeleft = progress.get(b);
		if (timeleft > 0) {
			ItemStack item = getProgressBar().clone();
	        item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
			ItemMeta im = item.getItemMeta();
			im.setDisplayName(" ");
			List<String> lore = new ArrayList<String>();
			lore.add(MachineHelper.getProgress(timeleft, processing.get(b).getTicks()));
			lore.add("");
			lore.add(MachineHelper.getTimeLeft(timeleft / 2));
			im.setLore(lore);
			item.setItemMeta(im);
			
			BlockStorage.getInventory(b).replaceExistingItem(22, item);
			
			if (ChargableBlock.isChargable(b)) {
				if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return;
				ChargableBlock.addCharge(b, -getEnergyConsumption());
				progress.put(b, timeleft - 1);
			}
			else progress.put(b, timeleft - 1);
		}
		else {
			BlockStorage.getInventory(b).replaceExistingItem(22, new CustomItem(new MaterialData(Material.STAINED_GLASS_PANE, (byte) 15), " "));
			pushItems(b, processing.get(b).getOutput());
			
			progress.remove(b);
			processing.remove(b);
		}
	}
	else {
		for (int slot: getInputSlots()) {
			if (SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), SlimefunItems.BUCKET_OF_OIL, true)) {
				MachineRecipe r = new MachineRecipe(40, new ItemStack[0], new ItemStack[] {SlimefunItems.BUCKET_OF_FUEL});
				if (!fits(b, r.getOutput())) return;
				BlockStorage.getInventory(b).replaceExistingItem(slot, InvUtils.decreaseItem(BlockStorage.getInventory(b).getItemInSlot(slot), 1));
				processing.put(b, r);
				progress.put(b, r.getTicks());
				break;
			}
		}
	}
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:47,
代码来源:Refinery.java

示例33: tick

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@SuppressWarnings("deprecation")
protected void tick(Block b) {
	if (isProcessing(b)) {
		int timeleft = progress.get(b);
		if (timeleft > 0 && getSpeed() < 10) {
			ItemStack item = getProgressBar().clone();
	        item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
			ItemMeta im = item.getItemMeta();
			im.setDisplayName(" ");
			List<String> lore = new ArrayList<String>();
			lore.add(MachineHelper.getProgress(timeleft, processing.get(b).getTicks()));
			lore.add("");
			lore.add(MachineHelper.getTimeLeft(timeleft / 2));
			im.setLore(lore);
			item.setItemMeta(im);
			
			BlockStorage.getInventory(b).replaceExistingItem(22, item);
			
			if (ChargableBlock.isChargable(b)) {
				if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return;
				ChargableBlock.addCharge(b, -getEnergyConsumption());
				progress.put(b, timeleft - 1);
			}
			else progress.put(b, timeleft - 1);
		}
		else if (ChargableBlock.isChargable(b)) {
			if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return;
			ChargableBlock.addCharge(b, -getEnergyConsumption());

			BlockStorage.getInventory(b).replaceExistingItem(22, new CustomItem(new MaterialData(Material.STAINED_GLASS_PANE, (byte) 15), " "));
			pushItems(b, processing.get(b).getOutput());
			
			progress.remove(b);
			processing.remove(b);
		}
	}
	else {
		for (int slot: getInputSlots()) {
			if (SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), new ItemStack(Material.GRAVEL), true)) {
				ItemStack output = SlimefunItems.SIFTED_ORE;
				if (CSCoreLib.randomizer().nextInt(100) < 16) output = new ItemStack(Material.FLINT);
				if (CSCoreLib.randomizer().nextInt(100) < 16) output = new ItemStack(Material.CLAY_BALL);
				
				MachineRecipe r = new MachineRecipe(3 / getSpeed(), new ItemStack[0], new ItemStack[] {output});
				if (!fits(b, r.getOutput())) return;
				BlockStorage.getInventory(b).replaceExistingItem(slot, InvUtils.decreaseItem(BlockStorage.getInventory(b).getItemInSlot(slot), 1));
				processing.put(b, r);
				progress.put(b, r.getTicks());
				break;
			}
		}
	}
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:54,
代码来源:ElectricGoldPan.java

示例34: getIcon

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@Override
public ItemStack getIcon() {
	return SlimefunItems.NETHER_ICE.clone();
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:5,
代码来源:NetherIceResource.java

示例35: getIcon

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@Override
public ItemStack getIcon() {
	return SlimefunItems.BUCKET_OF_OIL.clone();
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:5,
代码来源:OilResource.java

示例36: debug

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler
public void debug(PlayerInteractEvent e) {
	if (e.getAction().equals(Action.PHYSICAL) || !e.getHand().equals(EquipmentSlot.HAND)) return;
	Player p = e.getPlayer();
	if (SlimefunManager.isItemSimiliar(e.getPlayer().getInventory().getItemInMainHand(), SlimefunItems.DEBUG_FISH, true) || SlimefunManager.isItemSimiliar(e.getPlayer().getInventory().getItemInOffHand(), SlimefunItems.DEBUG_FISH, true)) {
		e.setCancelled(true);
		if (p.isOp()) {
			switch (e.getAction()) {
			case LEFT_CLICK_BLOCK: {
				if (p.isSneaking()) {
					if (BlockStorage.hasBlockInfo(e.getClickedBlock())) {
						BlockStorage.clearBlockInfo(e.getClickedBlock());
					}
				}
				else e.setCancelled(false);
				break;
			}
			case RIGHT_CLICK_BLOCK: {
				if (p.isSneaking()) {
					Block b = e.getClickedBlock().getRelative(e.getBlockFace());
					b.setType(Material.SKULL);
					try {
						CustomSkull.setSkull(b, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTllYjlkYTI2Y2YyZDMzNDEzOTdhN2Y0OTEzYmEzZDM3ZDFhZDEwZWFlMzBhYjI1ZmEzOWNlYjg0YmMifX19");
					} catch (Exception e1) {
						e1.printStackTrace();
					}
				}
				else if (BlockStorage.hasBlockInfo(e.getClickedBlock())) {
					p.sendMessage(" ");
					p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&d" + e.getClickedBlock().getType() + ":" + e.getClickedBlock().getData() + " &[email protected] X: " + e.getClickedBlock().getX() + " Y: " + e.getClickedBlock().getY() + " Z: " + e.getClickedBlock().getZ()));
					p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dID: " + "&e" + BlockStorage.checkID(e.getClickedBlock())));
					if (e.getClickedBlock().getState() instanceof Skull) {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dSkull: " + "&2\u2714"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dRotation: &e" + ((Skull) e.getClickedBlock().getState()).getRotation().toString()));
					}
					if (BlockStorage.getStorage(e.getClickedBlock().getWorld()).hasInventory(e.getClickedBlock().getLocation())) {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dInventory: " + "&2\u2714"));
					}
					else {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dInventory: " + "&4\u2718"));
					}
					if (BlockStorage.check(e.getClickedBlock()).isTicking()) {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + "&2\u2714"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dAsync: &e" + (BlockStorage.check(e.getClickedBlock()).getTicker().isSynchronized() ? "&4\u2718": "&2\u2714")));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dTimings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock()) + "ms"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dTotal Timings: &e" + SlimefunStartup.ticker.getTimings(BlockStorage.checkID(e.getClickedBlock())) + "ms"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dChunk Timings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock().getChunk()) + "ms"));
					}
					else if (BlockStorage.check(e.getClickedBlock()).getEnergyTicker() != null) {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + "&b~ &3(Indirect)"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dTimings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock()) + "ms"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dChunk Timings: &e" + SlimefunStartup.ticker.getTimings(e.getClickedBlock().getChunk()) + "ms"));
					}
					else {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dTicking: " + "&4\u2718"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&',"&dTicking: " + "&4\u2718"));
					}
					if (ChargableBlock.isChargable(e.getClickedBlock())) {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dChargable: " + "&2\u2714"));
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "  &dEnergy: &e" + ChargableBlock.getCharge(e.getClickedBlock()) + " / " + ChargableBlock.getMaxCharge(e.getClickedBlock())));
					}
					else {
						p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&dChargable: " + "&4\u2718"));
					}
					p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&6" + BlockStorage.getBlockInfoAsJson(e.getClickedBlock())));
					p.sendMessage(" ");
				}
				break;
			}
			default:
				break;

			}
		}
	}
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:78,
代码来源:ItemListener.java

示例37: onDamage

点赞 2

import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler(priority=EventPriority.MONITOR)
public void onDamage(EntityDamageEvent e) {
	if (e.getEntity() instanceof Player && !e.isCancelled()) {
		Player p = (Player) e.getEntity();
		for (ItemStack armor: p.getInventory().getArmorContents()) {
			if (armor != null && SlimefunItem.getByItem(armor) != null) {
				if (SlimefunItem.getByItem(armor).isItem(SlimefunItems.ENDER_BOOTS) && Slimefun.hasUnlocked(p, SlimefunItems.ENDER_BOOTS, true)) {
					if (e instanceof EntityDamageByEntityEvent) {
						if (((EntityDamageByEntityEvent) e).getDamager() instanceof EnderPearl) e.setCancelled(true);
					}
				}
				else if (SlimefunItem.getByItem(armor).isItem(SlimefunItems.SLIME_BOOTS) && Slimefun.hasUnlocked(p, SlimefunItems.SLIME_BOOTS, true)) {
					if (e.getCause() == DamageCause.FALL) e.setCancelled(true);
				}
				else if (SlimefunItem.getByItem(armor).isItem(SlimefunItems.BOOTS_OF_THE_STOMPER) && Slimefun.hasUnlocked(p, SlimefunItems.BOOTS_OF_THE_STOMPER, true)) {
					if (e.getCause() == DamageCause.FALL) {
						e.setCancelled(true);
						p.getWorld().playSound(p.getLocation(), Sound.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, 2F, 2F);
						p.setVelocity(new Vector(0.0, 0.7, 0.0));
						for (Entity n: p.getNearbyEntities(4, 4, 4)) {
							if (n instanceof LivingEntity && !n.getUniqueId().toString().equalsIgnoreCase(p.getUniqueId().toString())) {
								n.setVelocity(n.getLocation().toVector().subtract(p.getLocation().toVector()).normalize().multiply(1.4));
								if (p.getWorld().getPVP()) {
									EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(p, n, DamageCause.ENTITY_ATTACK, e.getDamage() / 2);
									Bukkit.getPluginManager().callEvent(event);
									if (!event.isCancelled()) ((LivingEntity) n).damage(e.getDamage() / 2);
								}
							}
						}
						for (int i = 0; i < 2; i++) {
							for (BlockFace face: BlockFace.values()) {
								p.getWorld().playEffect(p.getLocation().getBlock().getRelative(BlockFace.DOWN).getRelative(face).getLocation(), Effect.STEP_SOUND, p.getLocation().getBlock().getRelative(BlockFace.DOWN).getRelative(face).getType());
							}
						}
					}
				}
				else if (SlimefunItem.getByItem(armor).isItem(SlimefunItems.SLIME_BOOTS_STEEL) && Slimefun.hasUnlocked(p, SlimefunItems.SLIME_BOOTS_STEEL, true)) {
					if (e.getCause() == DamageCause.FALL) e.setCancelled(true);
				}
			}
		}
	}
}
 

开发者ID:TheBusyBiscuit,
项目名称:Slimefun4,
代码行数:45,
代码来源:ArmorListener.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)