Item Info displays original item name for named items. Some names

updated.
dev
sigonasr2 9 years ago
parent 101084e875
commit 4335ee2eba
  1. BIN
      TwosideKeeper.jar
  2. 141
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java
  3. 4
      src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java
  4. 8
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java

Binary file not shown.

@ -1264,6 +1264,147 @@ public class GenericFunctions {
}
}
}
case THIN_GLASS:{
return "Glass Pane";
}
case STAINED_GLASS:{
switch (type.getDurability()) {
case 0:{
return "White Stained Glass";
}
case 1:{
return "Orange Stained Glass";
}
case 2:{
return "Magenta Stained Glass";
}
case 3:{
return "Light Blue Stained Glass";
}
case 4:{
return "Yellow Stained Glass";
}
case 5:{
return "Lime Stained Glass";
}
case 6:{
return "Pink Stained Glass";
}
case 7:{
return "Gray Stained Glass";
}
case 8:{
return "Light Gray Stained Glass";
}
case 9:{
return "Cyan Stained Glass";
}
case 10:{
return "Purple Stained Glass";
}
case 11:{
return "Blue Stained Glass";
}
case 12:{
return "Brown Stained Glass";
}
case 13:{
return "Green Stained Glass";
}
case 14:{
return "Red Stained Glass";
}
case 15:{
return "Black Stained Glass";
}
}
}
case STAINED_GLASS_PANE:{
switch (type.getDurability()) {
case 0:{
return "White Stained Glass Pane";
}
case 1:{
return "Orange Stained Glass Pane";
}
case 2:{
return "Magenta Stained Glass Pane";
}
case 3:{
return "Light Blue Stained Glass Pane";
}
case 4:{
return "Yellow Stained Glass Pane";
}
case 5:{
return "Lime Stained Glass Pane";
}
case 6:{
return "Pink Stained Glass Pane";
}
case 7:{
return "Gray Stained Glass Pane";
}
case 8:{
return "Light Gray Stained Glass Pane";
}
case 9:{
return "Cyan Stained Glass Pane";
}
case 10:{
return "Purple Stained Glass Pane";
}
case 11:{
return "Blue Stained Glass Pane";
}
case 12:{
return "Brown Stained Glass Pane";
}
case 13:{
return "Green Stained Glass Pane";
}
case 14:{
return "Red Stained Glass Pane";
}
case 15:{
return "Black Stained Glass Pane";
}
}
}
case YELLOW_FLOWER:{
return "Dandelion";
}
case RED_ROSE:{
switch (type.getDurability()) {
case 0:{
return "Poppy";
}
case 1:{
return "Blue Orchid";
}
case 2:{
return "Allium";
}
case 3:{
return "Azure Bluet";
}
case 4:{
return "Red Tulip";
}
case 5:{
return "Orange Tulip";
}
case 6:{
return "White Tulip";
}
case 7:{
return "Pink Tulip";
}
case 8:{
return "Oxeye Daisy";
}
}
}
default:{
return GenericFunctions.CapitalizeFirstLetters(type.getType().toString().replace("_", " "));
}

@ -108,6 +108,10 @@ public class WorldShop {
public static String GetItemInfo(ItemStack item) {
//Gets all the info about this item in one gigantic string. (Separated by new lines. Useful for tellraw()).
String message = "";
if (item.hasItemMeta() &&
item.getItemMeta().hasDisplayName()) {
message+="\n"+ChatColor.DARK_GRAY+"Item Type: "+ChatColor.ITALIC+ChatColor.GRAY+GenericFunctions.UserFriendlyMaterialName(item)+"\n";
}
for (int i=0;i<Enchantment.values().length;i++) {
if (item.containsEnchantment(Enchantment.values()[i])) {
message+="\n"+ChatColor.GRAY+getRealName(Enchantment.values()[i])+" "+toRomanNumeral(item.getEnchantmentLevel(Enchantment.getByName(Enchantment.values()[i].getName()))); //This is an enchantment we have.

@ -3231,7 +3231,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
if (ev.getEntity() instanceof Monster) {
List<ItemStack> droplist = ev.getDrops();
log("Drop list contains "+droplist.size()+" elements.",4);
for (int i=0;i<droplist.size();i++) {
log(" Drop ["+i+"]: "+droplist.toString(),3);
}
Monster m = (Monster)ev.getEntity();
double dropmult = 0.0d;
@ -3301,7 +3304,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
final List<ItemStack> drop = new ArrayList<ItemStack>();
drop.addAll(droplist);
droplist.clear(); //Clear the drop list. We are going to delay the drops.
int totalexp = 0;
@ -3317,6 +3319,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
ev.setDroppedExp((int)(totalexp*0.75));
final Monster mer = m;
final int expdrop = totalexp;
droplist.clear(); //Clear the drop list. We are going to delay the drops.
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
if (mer.getLocation().getBlockY()<48) {
@ -3342,6 +3345,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
ev.setDroppedExp((int)(totalexp*0.75));
final Monster mer1 = m;
final int expdrop1 = totalexp;
droplist.clear(); //Clear the drop list. We are going to delay the drops.
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
if (mer1.getLocation().getBlockY()<48) {

Loading…
Cancel
Save