本文整理汇总了Java中tv.mineinthebox.manco.enums.CrateType.NORMAL属性的典型用法代码示例。如果您正苦于以下问题:Java CrateType.NORMAL属性的具体用法?Java CrateType.NORMAL怎么用?Java CrateType.NORMAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类tv.mineinthebox.manco.enums.CrateType
的用法示例。
在下文中一共展示了CrateType.NORMAL属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: spawnCrate
@Override
@SuppressWarnings("deprecation")
public Crate spawnCrate(CratePlayer p, Crate crate, Location loc) {
if(p.hasCrate()) {
return crate;
}
if(canFall(loc)) {
if(getConfiguration().isCrateMessagesEnabled()) {
if(crate.getType() == CrateType.RARE) {
Bukkit.broadcastMessage(getConfiguration().getRareCrateDropMessage().replaceAll("%p", p.getPlayer().getName()).replaceAll("%crate", crate.getCrateName()));
} else if(crate.getType() == CrateType.NORMAL) {
Bukkit.broadcastMessage(getConfiguration().getNormalCrateDropMessage().replaceAll("%p", p.getPlayer().getName()).replaceAll("%crate", crate.getCrateName()));
}
}
FallingBlock fall = p.getPlayer().getWorld().spawnFallingBlock(loc.add(0, 1, 0), Material.CHEST, (byte)0);
fall.setMetadata("crate_serie", new FixedMetadataValue(this, crate.getCrateName()));
fall.setMetadata("crate_owner", new FixedMetadataValue(this, p.getPlayer().getName()));
getCrateOwners().add(p.getPlayer().getName());
}
return crate;
}
示例2: getKeyItem
@Override
@SuppressWarnings("deprecation")
public ItemStack getKeyItem() {
try {
ItemStack stack = null;
if(con.get("crates.crate."+getCrateName()+".keyItem") instanceof Integer) {
stack = new ItemStack(Material.getMaterial(con.getInt("crates.crate."+getCrateName()+".keyItem")), 1);
} else if(con.get("crates.crate."+getCrateName()+".keyItem") instanceof String) {
stack = new ItemStack(Material.getMaterial(con.getString("crates.crate."+getCrateName()+".keyItem").toUpperCase()), 1);
}
ItemMeta meta = stack.getItemMeta();
if(getType() == CrateType.NORMAL) {
meta.setDisplayName(ChatColor.GOLD + "[ManCo key]" + ChatColor.GRAY + " type: " + getCrateName());
meta.setLore(Arrays.asList(new String[] {
ChatColor.GRAY + "for type: " + crate,
"",
ChatColor.GRAY + "description: " + "this key is hand crafted by one of our best engineers!",
"",
ChatColor.GRAY + "possible chance on contents: ",
ChatColor.GREEN + getPossibleList()
}));
} else {
meta.setDisplayName(ChatColor.GOLD + "[ManCo key]" + ChatColor.GRAY + " type: " + ChatColor.DARK_PURPLE + getCrateName());
meta.setLore(Arrays.asList(new String[] {
ChatColor.GRAY + "for type: " + ChatColor.DARK_PURPLE + crate,
"",
ChatColor.GRAY + "description: " + "this key is hand crafted by one of our finest engineers!",
"",
ChatColor.GRAY + "possible chance on contents: ",
ChatColor.GREEN + getPossibleList()
}));
}
stack.setItemMeta(meta);
return stack;
} catch(Exception e) {
ManCo.log(LogType.SEVERE, "one of the items in crate " + getCrateName() + " has a invalid item id as key set.");
}
return null;
}
示例3: getType
@Override
public CrateType getType() {
if(con.getBoolean("crates.crate." + crate + ".isRare")) {
return CrateType.RARE;
}
return CrateType.NORMAL;
}
示例4: onPrepare
@EventHandler
public void onPrepare(PrepareItemCraftEvent e) {
CraftingInventory inv = e.getInventory();
if(inv.getRecipe().getResult().hasItemMeta()) {
if(inv.getRecipe().getResult().getItemMeta().hasDisplayName()) {
if(inv.getRecipe().getResult().getItemMeta().getDisplayName().equalsIgnoreCase("crate")) {
if(inv.getItem(5) != null) {
if(inv.getItem(5).hasItemMeta()) {
if(inv.getItem(5).getItemMeta().hasDisplayName()) {
if(pl.isCrate(inv.getItem(5).getItemMeta().getDisplayName())) {
Crate crate = pl.getCrate(inv.getItem(5).getItemMeta().getDisplayName());
if(crate.needsKey()) {
if(inv.getItem(5).getType() == (crate.getType() == CrateType.NORMAL ? Material.GOLD_INGOT : Material.DIAMOND)) {
inv.setResult(crate.getKeyItem());
} else {
inv.setResult(null);
}
} else {
inv.setResult(null);
}
} else {
inv.setResult(null);
}
} else {
inv.setResult(null);
}
} else {
inv.setResult(null);
}
}
}
}
}
}