本文整理汇总了Java中me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem类的典型用法代码示例。如果您正苦于以下问题:Java CustomItem类的具体用法?Java CustomItem怎么用?Java CustomItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CustomItem类属于me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item包,在下文中一共展示了CustomItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: inject
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
private Inventory inject(Location l)
{
int size = BlockStorage.getInventory(l).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for(int i = 0; i < size; i++)
inv.setItem(i, new CustomItem(Material.COMMAND, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
int ai[];
int k = (ai = getOutputSlots()).length;
for(int j = 0; j < k; j++)
{
int slot = ai[j];
inv.setItem(slot, BlockStorage.getInventory(l).getItemInSlot(slot));
}
return inv;
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:18,代码来源:AGenerator.java
示例2: inject
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
private Inventory inject(Block b)
{
int size = BlockStorage.getInventory(b).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for(int i = 0; i < size; i++)
inv.setItem(i, new CustomItem(Material.COMMAND, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
int ai[];
int k = (ai = getOutputSlots()).length;
for(int j = 0; j < k; j++)
{
int slot = ai[j];
inv.setItem(slot, BlockStorage.getInventory(b).getItemInSlot(slot));
}
return inv;
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:18,代码来源:AFarm.java
示例3: constructMenu
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
protected void constructMenu(BlockMenuPreset preset)
{
int ai[];
int k = (ai = border).length;
for(int j = 0; j < k; j++)
{
int i = ai[j];
preset.addItem(i, new CustomItem(new MaterialData(Material.STAINED_GLASS_PANE, (byte)10), " ", new String[0]), new me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler() {
final XPCollector this$0;
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction clickaction)
{
return false;
}
{
this$0 = XPCollector.this;
super();
}
}
);
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:27,代码来源:XPCollector.java
示例4: constructMenu
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
protected void constructMenu(BlockMenuPreset preset)
{
int ai[];
int k = (ai = border).length;
for(int j = 0; j < k; j++)
{
int i = ai[j];
preset.addItem(i, new CustomItem(new MaterialData(Material.STAINED_GLASS_PANE, (byte)9), " ", new String[0]), new me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler() {
final CropGrowthAccelerator this$0;
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction clickaction)
{
return false;
}
{
this$0 = CropGrowthAccelerator.this;
super();
}
}
);
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:27,代码来源:CropGrowthAccelerator.java
示例5: constructMenu
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
protected void constructMenu(BlockMenuPreset preset)
{
int ai[];
int k = (ai = border).length;
for(int j = 0; j < k; j++)
{
int i = ai[j];
preset.addItem(i, new CustomItem(new MaterialData(Material.STAINED_GLASS_PANE, (byte)9), " ", new String[0]), new me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler() {
final CargoOutputNode this$0;
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction clickaction)
{
return false;
}
{
this$0 = CargoOutputNode.this;
super();
}
}
);
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:27,代码来源:CargoOutputNode.java
示例6: inject
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
private static Inventory inject(Location l)
{
int size = BlockStorage.getInventory(l).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for(int i = 0; i < size; i++)
inv.setItem(i, new CustomItem(Material.COMMAND, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
int ai[];
int k = (ai = getOutputSlots()).length;
for(int j = 0; j < k; j++)
{
int slot = ai[j];
inv.setItem(slot, BlockStorage.getInventory(l).getItemInSlot(slot));
}
return inv;
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:18,代码来源:ReactorAccessPort.java
示例7: constructMenu
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
protected void constructMenu(BlockMenuPreset preset)
{
int ai[];
int k = (ai = border).length;
for(int j = 0; j < k; j++)
{
int i = ai[j];
preset.addItem(i, new CustomItem(new MaterialData(Material.STAINED_GLASS_PANE, (byte)9), " ", new String[0]), new me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler() {
final AutoBreeder this$0;
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction clickaction)
{
return false;
}
{
this$0 = AutoBreeder.this;
super();
}
}
);
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:27,代码来源:AutoBreeder.java
示例8: constructMenu
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
private void constructMenu(BlockMenuPreset preset)
{
int ai[];
int k = (ai = border).length;
for(int j = 0; j < k; j++)
{
int i = ai[j];
preset.addItem(i, new CustomItem(new MaterialData(Material.STAINED_GLASS_PANE, (byte)14), " ", new String[0]), new me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler() {
final TrashCan this$0;
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction clickaction)
{
return false;
}
{
this$0 = TrashCan.this;
super();
}
}
);
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:27,代码来源:TrashCan.java
示例9: constructMenu
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
protected void constructMenu(BlockMenuPreset preset)
{
int ai[];
int k = (ai = border).length;
for(int j = 0; j < k; j++)
{
int i = ai[j];
preset.addItem(i, new CustomItem(new MaterialData(Material.STAINED_GLASS_PANE, (byte)9), " ", new String[0]), new me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.MenuClickHandler() {
final AnimalGrowthAccelerator this$0;
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction clickaction)
{
return false;
}
{
this$0 = AnimalGrowthAccelerator.this;
super();
}
}
);
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:27,代码来源:AnimalGrowthAccelerator.java
示例10: inject
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
private Inventory inject(Block b)
{
int size = BlockStorage.getInventory(b).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for(int i = 0; i < size; i++)
inv.setItem(i, new CustomItem(Material.COMMAND, " &4你所有的占位符都是我们的了蛤蛤蛤!", 0));
int ai[];
int k = (ai = getOutputSlots()).length;
for(int j = 0; j < k; j++)
{
int slot = ai[j];
inv.setItem(slot, BlockStorage.getInventory(b).getItemInSlot(slot));
}
return inv;
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:18,代码来源:ProgrammableAndroid.java
示例11: onSmelt
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
public void onSmelt(FurnaceSmeltEvent e)
{
if(BlockStorage.check(e.getBlock()) != null && (BlockStorage.check(e.getBlock()) instanceof EnhancedFurnace))
{
EnhancedFurnace furnace = (EnhancedFurnace)BlockStorage.check(e.getBlock());
Furnace f = (Furnace)e.getBlock().getState();
int amount = f.getInventory().getSmelting().getType().toString().endsWith("_ORE") ? furnace.getOutput() : 1;
ItemStack output = RecipeCalculator.getSmeltedOutput(f.getInventory().getSmelting().getType());
ItemStack result = f.getInventory().getResult();
if(result != null)
result = result.clone();
f.getInventory().setResult(null);
if(result != null)
f.getInventory().setResult(new CustomItem(result, result.getAmount() + amount <= result.getMaxStackSize() ? result.getAmount() + amount : result.getMaxStackSize()));
else
f.getInventory().setResult(new CustomItem(output, output.getAmount() + amount <= output.getType().getMaxStackSize() ? output.getAmount() + amount : output.getType().getMaxStackSize()));
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:19,代码来源:FurnaceListener.java
示例12: onBlockBreak
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
/**
*
* @param e BlockBreakEvent
* @since 4.2.0
*/
@EventHandler
public void onBlockBreak(BlockBreakEvent e) {
List<ItemStack> drops = new ArrayList<ItemStack>();
ItemStack item = e.getPlayer().getInventory().getItemInMainHand();
int fortune = 1;
if (item != null) {
if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS) && !item.getEnchantments().containsKey(Enchantment.SILK_TOUCH)) {
fortune = SlimefunStartup.randomize(item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) + 2) - 1;
if (fortune <= 0) fortune = 1;
fortune = (e.getBlock().getType() == Material.LAPIS_ORE ? 4 + SlimefunStartup.randomize(5) : 1) * (fortune + 1);
}
if (!item.getEnchantments().containsKey(Enchantment.SILK_TOUCH) && e.getBlock().getType().toString().endsWith("_ORE")) {
if (Talisman.checkFor(e, SlimefunItem.getByID("MINER_TALISMAN"))) {
if (drops.isEmpty()) drops = (List<ItemStack>) e.getBlock().getDrops();
for (ItemStack drop : new ArrayList<ItemStack>(drops)) {
if (!drop.getType().isBlock()) drops.add(new CustomItem(drop, fortune * 2));
}
}
}
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:29,代码来源:TalismanListener.java
示例13: registerMagicalPlant
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
public void registerMagicalPlant(String name, ItemStack item, String skull, ItemStack[] recipe) {
ItemStack essence = new CustomItem(new MaterialData(Material.BLAZE_POWDER), "&rMagical Essence", "", "�7" + name);
Berry berry = new Berry(essence, name.toUpperCase() + "_ESSENCE", PlantType.ORE_PLANT, new PlantData(skull));
berries.add(berry);
new SlimefunItem(category_magic, new CustomItem(Material.SAPLING, "&r" + name + " Plant", 0), name.toUpperCase().replace(" ", "_") + "_PLANT", RecipeType.ENHANCED_CRAFTING_TABLE,
recipe)
.register();
HandledBlock plant = new HandledBlock(category_magic, essence, name.toUpperCase().replace(" ", "_") + "_ESSENCE", RecipeType.ENHANCED_CRAFTING_TABLE,
new ItemStack[] {essence, essence, essence, essence, null, essence, essence, essence, essence});
plant.setRecipeOutput(item.clone());
plant.register();
}
开发者ID:TheBusyBiscuit,项目名称:ExoticGarden,代码行数:17,代码来源:ExoticGarden.java
示例14: scanChunk
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
public void scanChunk(Player p, Chunk chunk) {
if (getNetworkComplexity(p.getUniqueId()) < 600) {
Messages.local.sendTranslation(p, "gps.insufficient-complexity", true, new Variable("%complexity%", String.valueOf(600)));
return;
}
ChestMenu menu = new ChestMenu("&4Scan Results");
int index = 0;
for (OreGenResource resource: OreGenSystem.listResources()) {
int supply = OreGenSystem.getSupplies(resource, chunk, true);
menu.addItem(index, new CustomItem(resource.getIcon(), "&7Resource: &e" + resource.getName(), "", "&7Scanned Chunk:", "&8\u21E8 &7X: " + chunk.getX() + " Z: " + chunk.getZ(), "", "&7Result: &e" + supply + " " + resource.getMeasurementUnit()),
new MenuClickHandler() {
@Override
public boolean onClick(Player arg0, int arg1, ItemStack arg2, ClickAction arg3) {
return false;
}
});
index++;
}
menu.open(p);
}
开发者ID:TheBusyBiscuit,项目名称:Slimefun4,代码行数:26,代码来源:GPSNetwork.java
示例15: Talisman
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
public Talisman(ItemStack item, String id, ItemStack[] recipe, boolean consumable, boolean cancelEvent, String messageSuffix, PotionEffect... effects) {
super(Categories.TALISMANS_1, item, id, RecipeType.MAGIC_WORKBENCH, recipe, new CustomItem(item, consumable ? 4: 1));
this.consumable = consumable;
this.cancel = cancelEvent;
this.suffix = messageSuffix;
this.effects = effects;
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:8,代码来源:Talisman.java
示例16: upgrade
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
public ItemStack upgrade() {
List<String> lore = new ArrayList<String>();
lore.add("&7&oEnder Infused");
lore.add("");
for (String line: getItem().getItemMeta().getLore()) {
lore.add(line);
}
ItemStack item = new CustomItem(getItem().getType(), "&5Ender " + ChatColor.stripColor(getItem().getItemMeta().getDisplayName()), getItem().getDurability(), lore.toArray(new String[lore.size()]));
return item;
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:11,代码来源:Talisman.java
示例17: tick
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的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(getOreGenResource(), b.getChunk(), false) > 0)
{
MachineRecipe r = new MachineRecipe(getProcessingTime() / getSpeed(), new ItemStack[0], getOutputItems());
if(!fits(b, r.getOutput()))
return;
processing.put(b, r);
progress.put(b, Integer.valueOf(r.getTicks()));
OreGenSystem.setSupplies(getOreGenResource(), b.getChunk(), OreGenSystem.getSupplies(getOreGenResource(), b.getChunk(), false) - 1);
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:41,代码来源:ADrill.java
示例18: inject
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
private Inventory inject(Block b) {
int size = BlockStorage.getInventory(b).toInventory().getSize();
Inventory inv = Bukkit.createInventory(null, size);
for (int i = 0; i < size; i++) {
inv.setItem(i, new CustomItem(Material.COMMAND, " &4ALL YOUR PLACEHOLDERS ARE BELONG TO US", 0));
}
for (int slot: getOutputSlots()) {
inv.setItem(slot, BlockStorage.getInventory(b).getItemInSlot(slot));
}
return inv;
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:12,代码来源:AContainer.java
示例19: tick
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的package包/类
protected void tick(Block b)
throws Exception
{
for(Iterator iterator = me.mrCookieSlime.Slimefun.holograms.XPCollector.getArmorStand(b).getNearbyEntities(4D, 4D, 4D).iterator(); iterator.hasNext();)
{
Entity n = (Entity)iterator.next();
if(n instanceof ExperienceOrb)
{
if(ChargableBlock.getCharge(b) < getEnergyConsumption())
return;
if(n.isValid())
{
int xp = getEXP(b) + ((ExperienceOrb)n).getExperience();
ChargableBlock.addCharge(b, -getEnergyConsumption());
n.remove();
int withdrawn = 0;
for(int level = 0; level < getEXP(b); level += 10)
if(fits(b, new ItemStack[] {
new CustomItem(Material.EXP_BOTTLE, "&a\u5B66\u8BC6\u4E4B\u74F6", 0)
}))
{
withdrawn += 10;
pushItems(b, new ItemStack[] {
new CustomItem(Material.EXP_BOTTLE, "&a\u5B66\u8BC6\u4E4B\u74F6", 0)
});
}
BlockStorage.addBlockInfo(b, "stored-exp", String.valueOf(xp - withdrawn));
return;
}
}
}
}
开发者ID:StarWishsama,项目名称:Slimefun4-Chinese-Version,代码行数:35,代码来源:XPCollector.java
示例20: registerDefaultRecipes
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem; //导入依赖的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
注:本文中的me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论