本文整理汇总了Java中me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem类的典型用法代码示例。如果您正苦于以下问题:Java CustomItem类的具体用法?Java CustomItem怎么用?Java CustomItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CustomItem类属于me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item包,在下文中一共展示了CustomItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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();
}
}
);
}
}
示例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();
}
}
);
}
}
示例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();
}
}
);
}
}
示例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;
}
示例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();
}
}
);
}
}
示例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();
}
}
);
}
}
示例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();
}
}
);
}
}
示例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;
}
示例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()));
}
}
示例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));
}
}
}
}
}
示例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();
}
示例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);
}
示例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;
}