diff --git a/plugin.yml b/plugin.yml
index ae9a03b3f..4c48ad166 100644
--- a/plugin.yml
+++ b/plugin.yml
@@ -1,5 +1,6 @@
main: ${project.groupId}.${project.name}
name: ${project.name}
+api-version: 1.13
version: ${project.version}
website: ${project.url}
description: ${project.description}
diff --git a/pom.xml b/pom.xml
index 628e1e052..f6ac39fbb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
com.massivecraft.massivesuper
MassiveSuper
- 2.14.1-SNAPSHOT
+ 2.15.1-SNAPSHOT
../MassiveSuper
@@ -21,6 +21,12 @@
+
+
+ com.googlecode.json-simple
+ json-simple
+ 1.1
+
com.massivecraft.massivecore
diff --git a/src/com/massivecraft/massivecore/command/type/TypeEnchantment.java b/src/com/massivecraft/massivecore/command/type/TypeEnchantment.java
index 789cff5ae..a3f44d37f 100644
--- a/src/com/massivecraft/massivecore/command/type/TypeEnchantment.java
+++ b/src/com/massivecraft/massivecore/command/type/TypeEnchantment.java
@@ -17,47 +17,164 @@ public class TypeEnchantment extends TypeAbstractChoice
// DATA
// -------------------------------------------- //
// http://minecraft.gamepedia.com/Enchanting#Enchantments
-
+
// The first name is taken from the wiki. Those names are those people think of.
// The second name is the Bukkit enum name.
// Thereafter comes assorted extras
+ public static Enchantment[] getEnchantment = new Enchantment[]
+ {
+ Enchantment.PROTECTION_ENVIRONMENTAL,
+ Enchantment.PROTECTION_FIRE,
+ Enchantment.PROTECTION_FALL,
+ Enchantment.PROTECTION_EXPLOSIONS,
+ Enchantment.PROTECTION_PROJECTILE,
+ Enchantment.OXYGEN,
+ Enchantment.WATER_WORKER,
+ Enchantment.THORNS,
+ Enchantment.DEPTH_STRIDER,
+ Enchantment.FROST_WALKER,
+ Enchantment.BINDING_CURSE,
+ null,
+ null,
+ null,
+ null,
+ null,
+ Enchantment.DAMAGE_ALL,
+ Enchantment.DAMAGE_UNDEAD,
+ Enchantment.DAMAGE_ARTHROPODS,
+ Enchantment.KNOCKBACK,
+ Enchantment.FIRE_ASPECT,
+ Enchantment.LOOT_BONUS_MOBS,
+ Enchantment.SWEEPING_EDGE,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ Enchantment.DIG_SPEED,
+ Enchantment.SILK_TOUCH,
+ Enchantment.DURABILITY,
+ Enchantment.LOOT_BONUS_BLOCKS,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ Enchantment.ARROW_DAMAGE,
+ Enchantment.ARROW_KNOCKBACK,
+ Enchantment.ARROW_FIRE,
+ Enchantment.ARROW_INFINITE,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ Enchantment.LUCK,
+ Enchantment.LURE,
+ null,
+ null,
+ Enchantment.LOYALTY,
+ Enchantment.IMPALING,
+ Enchantment.RIPTIDE,
+ Enchantment.CHANNELING,
+ null,
+ Enchantment.MENDING,
+ Enchantment.VANISHING_CURSE
+ };
+
+ public static Map KEY_TO_ID = new MassiveMap(
+ Enchantment.PROTECTION_ENVIRONMENTAL.getKey().getKey(), 0,
+ Enchantment.PROTECTION_FIRE.getKey().getKey(), 1,
+ Enchantment.PROTECTION_FALL.getKey().getKey(), 2,
+ Enchantment.PROTECTION_EXPLOSIONS.getKey().getKey(), 3,
+ Enchantment.PROTECTION_PROJECTILE.getKey().getKey(), 4,
+ Enchantment.OXYGEN.getKey().getKey(), 5,
+ Enchantment.WATER_WORKER.getKey().getKey(), 6,
+ Enchantment.THORNS.getKey().getKey(), 7,
+ Enchantment.DEPTH_STRIDER.getKey().getKey(), 8,
+ Enchantment.FROST_WALKER.getKey().getKey(), 9,
+ Enchantment.BINDING_CURSE.getKey().getKey(), 10,
+ Enchantment.DAMAGE_ALL.getKey().getKey(), 16,
+ Enchantment.DAMAGE_UNDEAD.getKey().getKey(), 17,
+ Enchantment.DAMAGE_ARTHROPODS.getKey().getKey(), 18,
+ Enchantment.KNOCKBACK.getKey().getKey(), 19,
+ Enchantment.FIRE_ASPECT.getKey().getKey(), 20,
+ Enchantment.LOOT_BONUS_MOBS.getKey().getKey(), 21,
+ Enchantment.SWEEPING_EDGE.getKey().getKey(), 22,
+ Enchantment.DIG_SPEED.getKey().getKey(), 32,
+ Enchantment.SILK_TOUCH.getKey().getKey(), 33,
+ Enchantment.DURABILITY.getKey().getKey(), 34,
+ Enchantment.LOOT_BONUS_BLOCKS.getKey().getKey(), 35,
+ Enchantment.ARROW_DAMAGE.getKey().getKey(), 48,
+ Enchantment.ARROW_KNOCKBACK.getKey().getKey(), 49,
+ Enchantment.ARROW_FIRE.getKey().getKey(), 50,
+ Enchantment.ARROW_INFINITE.getKey().getKey(), 51,
+ Enchantment.LUCK.getKey().getKey(), 61,
+ Enchantment.LURE.getKey().getKey(), 62,
+ Enchantment.LOYALTY.getKey().getKey(), 65,
+ Enchantment.IMPALING.getKey().getKey(), 66,
+ Enchantment.RIPTIDE.getKey().getKey(), 67,
+ Enchantment.CHANNELING.getKey().getKey(), 68,
+ Enchantment.MENDING.getKey().getKey(), 70,
+ Enchantment.VANISHING_CURSE.getKey().getKey(), 71
+ );
+
public static Map> ID_TO_RAWNAMES = new MassiveMap>(
- 0, new MassiveList<>("Protection", "PROTECTION_ENVIRONMENTAL"),
- 1, new MassiveList<>("Fire Protection", "PROTECTION_FIRE"),
- 2, new MassiveList<>("Feather Falling", "PROTECTION_FALL", "FallProtection"),
- 3, new MassiveList<>("Blast Protection", "PROTECTION_EXPLOSIONS", "ExplosionProtection"),
- 4, new MassiveList<>("Projectile Protection", "PROTECTION_PROJECTILE", "ProjectileProtection"),
- 5, new MassiveList<>("Respiration", "OXYGEN", "Breathing"),
- 6, new MassiveList<>("Aqua Affinity", "WATER_WORKER"),
- 7, new MassiveList<>("Thorns", "THORNS"),
- 8, new MassiveList<>("Depth Strider", "DEPTH_STRIDER"),
- 9, new MassiveList<>("Frost Walker", "FROST_WALKER"),
- 10, new MassiveList<>("Curse of Binding", "BINDING_CURSE"),
- 16, new MassiveList<>("Sharpness", "DAMAGE_ALL"),
- 17, new MassiveList<>("Smite", "DAMAGE_UNDEAD"),
- 18, new MassiveList<>("Bane of Arthropods", "DAMAGE_ARTHROPODS", "BaneArthropods", "Arthropods"),
- 19, new MassiveList<>("Knockback", "KNOCKBACK"),
- 20, new MassiveList<>("Fire Aspect", "FIRE_ASPECT"),
- 21, new MassiveList<>("Looting", "LOOT_BONUS_MOBS"),
- 22, new MassiveList<>("Sweeping Edge", "SWEEPING_EDGE"),
- 32, new MassiveList<>("Efficiency", "DIG_SPEED"),
- 33, new MassiveList<>("Silk Touch", "SILK_TOUCH"),
- 34, new MassiveList<>("Unbreaking", "DURABILITY"),
- 35, new MassiveList<>("Fortune", "LOOT_BONUS_BLOCKS"),
- 48, new MassiveList<>("Power", "ARROW_DAMAGE"),
- 49, new MassiveList<>("Punch", "ARROW_KNOCKBACK"),
- 50, new MassiveList<>("Flame", "ARROW_FIRE"),
- 51, new MassiveList<>("Infinity", "ARROW_INFINITE", "ArrowInfinity"),
- 61, new MassiveList<>("Luck of the Sea", "LUCK", "LuckOfSea", "LuckTheSea", "LuckSea"),
- 62, new MassiveList<>("Lure", "LURE"),
- 70, new MassiveList<>("Mending", "MENDING"),
- 71, new MassiveList<>("Curse of Vanishing", "VANISHING_CURSE")
+ 0, new MassiveList<>("Protection", "PROTECTION_ENVIRONMENTAL"),
+ 1, new MassiveList<>("Fire Protection", "PROTECTION_FIRE"),
+ 2, new MassiveList<>("Feather Falling", "PROTECTION_FALL", "FallProtection"),
+ 3, new MassiveList<>("Blast Protection", "PROTECTION_EXPLOSIONS", "ExplosionProtection"),
+ 4, new MassiveList<>("Projectile Protection", "PROTECTION_PROJECTILE", "ProjectileProtection"),
+ 5, new MassiveList<>("Respiration", "OXYGEN", "Breathing"),
+ 6, new MassiveList<>("Aqua Affinity", "WATER_WORKER"),
+ 7, new MassiveList<>("Thorns", "THORNS"),
+ 8, new MassiveList<>("Depth Strider", "DEPTH_STRIDER"),
+ 9, new MassiveList<>("Frost Walker", "FROST_WALKER"),
+ 10, new MassiveList<>("Curse of Binding", "BINDING_CURSE"),
+ 16, new MassiveList<>("Sharpness", "DAMAGE_ALL"),
+ 17, new MassiveList<>("Smite", "DAMAGE_UNDEAD"),
+ 18, new MassiveList<>("Bane of Arthropods", "DAMAGE_ARTHROPODS", "BaneArthropods", "Arthropods"),
+ 19, new MassiveList<>("Knockback", "KNOCKBACK"),
+ 20, new MassiveList<>("Fire Aspect", "FIRE_ASPECT"),
+ 21, new MassiveList<>("Looting", "LOOT_BONUS_MOBS"),
+ 22, new MassiveList<>("Sweeping Edge", "SWEEPING_EDGE"),
+ 32, new MassiveList<>("Efficiency", "DIG_SPEED"),
+ 33, new MassiveList<>("Silk Touch", "SILK_TOUCH"),
+ 34, new MassiveList<>("Unbreaking", "DURABILITY"),
+ 35, new MassiveList<>("Fortune", "LOOT_BONUS_BLOCKS"),
+ 48, new MassiveList<>("Power", "ARROW_DAMAGE"),
+ 49, new MassiveList<>("Punch", "ARROW_KNOCKBACK"),
+ 50, new MassiveList<>("Flame", "ARROW_FIRE"),
+ 51, new MassiveList<>("Infinity", "ARROW_INFINITE", "ArrowInfinity"),
+ 61, new MassiveList<>("Luck of the Sea", "LUCK", "LuckOfSea", "LuckTheSea", "LuckSea"),
+ 62, new MassiveList<>("Lure", "LURE"),
+ 65, new MassiveList<>("Loyalty", "LOYALTY"),
+ 66, new MassiveList<>("Impaling", "IMPALING"),
+ 67, new MassiveList<>("Riptide", "RIPTIDE"),
+ 68, new MassiveList<>("Channeling", "CHANNELING"),
+ 70, new MassiveList<>("Mending", "MENDING"),
+ 71, new MassiveList<>("Curse of Vanishing", "VANISHING_CURSE")
);
-
+
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
-
+
private static TypeEnchantment i = new TypeEnchantment();
public static TypeEnchantment get() { return i; }
public TypeEnchantment()
@@ -66,47 +183,44 @@ public TypeEnchantment()
this.setVisualColor(ChatColor.AQUA);
this.setAll(Enchantment.values());
}
-
+
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
-
- @SuppressWarnings("deprecation")
+
@Override
public String getNameInner(Enchantment enchantment)
{
- String rawname = enchantment.getName();
- List rawnames = ID_TO_RAWNAMES.get(enchantment.getId());
+ String rawname = enchantment.getKey().getKey();
+ List rawnames = ID_TO_RAWNAMES.get(KEY_TO_ID.get(enchantment.getKey().getKey()));
if (rawnames != null) rawname = rawnames.get(0);
return Txt.getNicedEnumString(rawname);
}
-
- @SuppressWarnings("deprecation")
+
@Override
public Set getNamesInner(Enchantment enchantment)
{
// Create
Set ret = new MassiveSet<>();
-
+
// Fill
List raws = new MassiveList<>();
- List rawnames = ID_TO_RAWNAMES.get(enchantment.getId());
+ List rawnames = ID_TO_RAWNAMES.get(KEY_TO_ID.get(enchantment.getKey().getKey()));
if (rawnames != null) raws.addAll(rawnames);
- raws.add(enchantment.getName());
+ raws.add(enchantment.getKey().getKey());
for (String raw : raws)
{
ret.add(Txt.getNicedEnumString(raw));
}
-
+
// Return
return ret;
}
-
- @SuppressWarnings("deprecation")
+
@Override
public String getIdInner(Enchantment enchantment)
{
- return String.valueOf(enchantment.getId());
+ return String.valueOf(KEY_TO_ID.get(enchantment.getKey().getKey()));
}
}
diff --git a/src/com/massivecraft/massivecore/command/type/TypeMaterialId.java b/src/com/massivecraft/massivecore/command/type/TypeMaterialId.java
index a3d86f420..3be0997f4 100644
--- a/src/com/massivecraft/massivecore/command/type/TypeMaterialId.java
+++ b/src/com/massivecraft/massivecore/command/type/TypeMaterialId.java
@@ -1,12 +1,12 @@
package com.massivecraft.massivecore.command.type;
import com.massivecraft.massivecore.command.type.enumeration.TypeMaterial;
-import com.massivecraft.massivecore.command.type.primitive.TypeInteger;
+import com.massivecraft.massivecore.command.type.primitive.TypeString;
import org.bukkit.Material;
import org.bukkit.command.CommandSender;
@SuppressWarnings("deprecation")
-public class TypeMaterialId extends TypeTransformer
+public class TypeMaterialId extends TypeTransformer
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
@@ -17,7 +17,7 @@ public class TypeMaterialId extends TypeTransformer
public TypeMaterialId()
{
- super(TypeMaterial.get(), TypeInteger.get());
+ super(TypeMaterial.get(), TypeString.get());
}
// -------------------------------------------- //
@@ -26,14 +26,14 @@ public TypeMaterialId()
@Override
- public Integer innerToOuter(Material inner, CommandSender sender)
+ public String innerToOuter(Material inner, CommandSender sender)
{
if (inner == null) return null;
- return inner.getId();
+ return inner.toString();
}
@Override
- public Material outerToInner(Integer outer)
+ public Material outerToInner(String outer)
{
if (outer == null) return null;
return Material.getMaterial(outer);
diff --git a/src/com/massivecraft/massivecore/item/ConverterFromEnchant.java b/src/com/massivecraft/massivecore/item/ConverterFromEnchant.java
index ff0ae0a98..43fd0ea3a 100644
--- a/src/com/massivecraft/massivecore/item/ConverterFromEnchant.java
+++ b/src/com/massivecraft/massivecore/item/ConverterFromEnchant.java
@@ -1,6 +1,7 @@
package com.massivecraft.massivecore.item;
import org.bukkit.enchantments.Enchantment;
+import com.massivecraft.massivecore.command.type.TypeEnchantment;
public class ConverterFromEnchant extends Converter
{
@@ -20,7 +21,7 @@ public class ConverterFromEnchant extends Converter
public Integer convert(Enchantment x)
{
if (x == null) return null;
- return x.getId();
+ return TypeEnchantment.KEY_TO_ID.get(x.getKey().getKey());
}
}
diff --git a/src/com/massivecraft/massivecore/item/ConverterToEnchant.java b/src/com/massivecraft/massivecore/item/ConverterToEnchant.java
index 152517794..95e778850 100644
--- a/src/com/massivecraft/massivecore/item/ConverterToEnchant.java
+++ b/src/com/massivecraft/massivecore/item/ConverterToEnchant.java
@@ -1,6 +1,7 @@
package com.massivecraft.massivecore.item;
import org.bukkit.enchantments.Enchantment;
+import com.massivecraft.massivecore.command.type.TypeEnchantment;
public class ConverterToEnchant extends Converter
{
@@ -20,7 +21,7 @@ public class ConverterToEnchant extends Converter
public Enchantment convert(Integer x)
{
if (x == null) return null;
- return Enchantment.getById(x);
+ return TypeEnchantment.getEnchantment[x];
}
}
diff --git a/src/com/massivecraft/massivecore/item/WriterItemStackMetaBannerBase.java b/src/com/massivecraft/massivecore/item/WriterItemStackMetaBannerBase.java
index 20893e9db..42e3a65ea 100644
--- a/src/com/massivecraft/massivecore/item/WriterItemStackMetaBannerBase.java
+++ b/src/com/massivecraft/massivecore/item/WriterItemStackMetaBannerBase.java
@@ -16,7 +16,7 @@ public class WriterItemStackMetaBannerBase extends WriterAbstractItemStackMetaFi
public WriterItemStackMetaBannerBase()
{
super(BannerMeta.class);
- this.setMaterial(Material.BANNER);
+ this.setMaterial(Material.WHITE_BANNER);
this.setConverterTo(ConverterToDyeColor.get());
this.setConverterFrom(ConverterFromDyeColor.get());
}
diff --git a/src/com/massivecraft/massivecore/item/WriterItemStackMetaBannerPatterns.java b/src/com/massivecraft/massivecore/item/WriterItemStackMetaBannerPatterns.java
index 803fb49f2..f87562053 100644
--- a/src/com/massivecraft/massivecore/item/WriterItemStackMetaBannerPatterns.java
+++ b/src/com/massivecraft/massivecore/item/WriterItemStackMetaBannerPatterns.java
@@ -18,7 +18,7 @@ public class WriterItemStackMetaBannerPatterns extends WriterAbstractItemStackMe
public WriterItemStackMetaBannerPatterns()
{
super(BannerMeta.class);
- this.setMaterial(Material.BANNER);
+ this.setMaterial(Material.WHITE_BANNER);
this.setConverterTo(ConverterToBannerPatterns.get());
this.setConverterFrom(ConverterFromBannerPatterns.get());
this.addDependencyClasses(
diff --git a/src/com/massivecraft/massivecore/item/WriterItemStackMetaFireworkEffect.java b/src/com/massivecraft/massivecore/item/WriterItemStackMetaFireworkEffect.java
index 358c49f92..043088281 100644
--- a/src/com/massivecraft/massivecore/item/WriterItemStackMetaFireworkEffect.java
+++ b/src/com/massivecraft/massivecore/item/WriterItemStackMetaFireworkEffect.java
@@ -16,7 +16,7 @@ public class WriterItemStackMetaFireworkEffect extends WriterAbstractItemStackMe
public WriterItemStackMetaFireworkEffect()
{
super(FireworkEffectMeta.class);
- this.setMaterial(Material.FIREWORK_CHARGE);
+ this.setMaterial(Material.FIREWORK_STAR);
this.setConverterTo(ConverterToFireworkEffect.get());
this.setConverterFrom(ConverterFromFireworkEffect.get());
this.addDependencyClasses(
diff --git a/src/com/massivecraft/massivecore/item/WriterItemStackMetaFireworkEffects.java b/src/com/massivecraft/massivecore/item/WriterItemStackMetaFireworkEffects.java
index 94229a2c2..0b6a26273 100644
--- a/src/com/massivecraft/massivecore/item/WriterItemStackMetaFireworkEffects.java
+++ b/src/com/massivecraft/massivecore/item/WriterItemStackMetaFireworkEffects.java
@@ -18,7 +18,7 @@ public class WriterItemStackMetaFireworkEffects extends WriterAbstractItemStackM
public WriterItemStackMetaFireworkEffects()
{
super(FireworkMeta.class);
- this.setMaterial(Material.FIREWORK);
+ this.setMaterial(Material.FIREWORK_ROCKET);
this.setConverterTo(ConverterToFireworkEffects.get());
this.setConverterFrom(ConverterFromFireworkEffects.get());
this.addDependencyClasses(
diff --git a/src/com/massivecraft/massivecore/item/WriterItemStackMetaFireworkFlight.java b/src/com/massivecraft/massivecore/item/WriterItemStackMetaFireworkFlight.java
index 24cae3ba1..f0dd2cf3a 100644
--- a/src/com/massivecraft/massivecore/item/WriterItemStackMetaFireworkFlight.java
+++ b/src/com/massivecraft/massivecore/item/WriterItemStackMetaFireworkFlight.java
@@ -15,7 +15,7 @@ public class WriterItemStackMetaFireworkFlight extends WriterAbstractItemStackMe
public WriterItemStackMetaFireworkFlight()
{
super(FireworkMeta.class);
- this.setMaterial(Material.FIREWORK);
+ this.setMaterial(Material.FIREWORK_ROCKET);
}
// -------------------------------------------- //
diff --git a/src/com/massivecraft/massivecore/item/WriterItemStackMetaSkull.java b/src/com/massivecraft/massivecore/item/WriterItemStackMetaSkull.java
index 484912503..663031681 100644
--- a/src/com/massivecraft/massivecore/item/WriterItemStackMetaSkull.java
+++ b/src/com/massivecraft/massivecore/item/WriterItemStackMetaSkull.java
@@ -19,7 +19,7 @@ public class WriterItemStackMetaSkull extends WriterAbstractItemStackMetaField iterator = enchantments.iterator(); iterator.hasNext();)
{
Enchantment enchantment = iterator.next();
- if (TypeEnchantment.ID_TO_RAWNAMES.containsKey(enchantment.getId()))
+ if (TypeEnchantment.ID_TO_RAWNAMES.containsKey(TypeEnchantment.KEY_TO_ID.get(enchantment.getKey().getKey())))
{
iterator.remove();
}
@@ -38,7 +38,7 @@ public void test()
for (Enchantment enchantment : enchantments)
{
- String issue = Txt.parse("The enchantment %s (%d) lacks nicename in TypeEnchantment.", enchantment.getName(), enchantment.getId());
+ String issue = Txt.parse("The enchantment %s (%d) lacks nicename in TypeEnchantment.", enchantment.getKey().getKey(), TypeEnchantment.KEY_TO_ID.get(enchantment.getKey().getKey()));
this.addIssue(issue);
}
diff --git a/src/com/massivecraft/massivecore/util/InventoryUtil.java b/src/com/massivecraft/massivecore/util/InventoryUtil.java
index fce7272e9..bd76c1996 100644
--- a/src/com/massivecraft/massivecore/util/InventoryUtil.java
+++ b/src/com/massivecraft/massivecore/util/InventoryUtil.java
@@ -24,7 +24,7 @@
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.meta.ItemMeta;
-import org.bukkit.material.MaterialData;
+import org.bukkit.block.data.BlockData;
import java.util.AbstractMap.SimpleEntry;
import java.util.Arrays;
@@ -932,17 +932,21 @@ public static boolean isRepairable(Material material)
// http://minecraft.gamepedia.com/Data_values
if (material == Material.COAL) return false;
if (material == Material.GOLDEN_APPLE) return false;
- if (material == Material.RAW_FISH) return false;
- if (material == Material.COOKED_FISH) return false;
- if (material == Material.INK_SACK) return false;
+ if (material == Material.COD) return false;
+ if (material == Material.COOKED_COD) return false;
+ if (material == Material.SALMON) return false;
+ if (material == Material.COOKED_SALMON) return false;
+ if (material == Material.PUFFERFISH) return false;
+ if (material == Material.INK_SAC) return false;
if (material == Material.MAP) return false;
if (material == Material.POTION) return false;
- if (material == Material.MONSTER_EGG) return false;
- if (material == Material.SKULL_ITEM) return false;
+ if (material == Material.LEGACY_MONSTER_EGG) return false;
+ if (material == Material.SKELETON_SKULL) return false;
+ if (material == Material.WITHER_SKELETON_SKULL) return false;
// This lines actually catches most of the specific lines above.
// However we add this in anyways for future compatibility.
- if ( ! material.getData().equals(MaterialData.class)) return false;
+ if ( ! material.getData().equals(BlockData.class)) return false;
// We may also not repair things that can not take any damage.
// NOTE: MaxDurability should be renamed to MaxDamage.
@@ -1003,8 +1007,8 @@ public static Inventory clone(Inventory inventory, boolean playerSupport)
InventoryHolder holder = inventory.getHolder();
int size = inventory.getSize();
if (inventory instanceof PlayerInventory) size = SIZE_PLAYER_STORAGE;
- String title = inventory.getTitle();
- ret = MixinInventory.get().createInventory(holder, size, title);
+ InventoryType type = inventory.getType();
+ ret = MixinInventory.get().createInventory(holder, type);
}
// Fill
diff --git a/src/com/massivecraft/massivecore/util/MUtil.java b/src/com/massivecraft/massivecore/util/MUtil.java
index d6a471e43..a5f802ad9 100644
--- a/src/com/massivecraft/massivecore/util/MUtil.java
+++ b/src/com/massivecraft/massivecore/util/MUtil.java
@@ -1101,20 +1101,37 @@ public static Float getYaw(BlockFace face)
public final static Set FOOD_MATERIALS = new HashSet<>(MUtil.list(
Material.APPLE,
+ Material.BAKED_POTATO,
+ Material.BEEF,
+ Material.BEETROOT,
+ Material.BEETROOT_SOUP,
Material.BREAD,
+ Material.CARROT,
+ Material.CHICKEN,
+ Material.CHORUS_FRUIT,
+ Material.COD,
Material.COOKED_BEEF,
Material.COOKED_CHICKEN,
- Material.COOKED_FISH,
+ Material.COOKED_COD,
+ Material.COOKED_MUTTON,
+ Material.COOKED_PORKCHOP,
+ Material.COOKED_SALMON,
Material.COOKIE,
- Material.GRILLED_PORK,
+ Material.TROPICAL_FISH,
+ Material.DRIED_KELP,
Material.GOLDEN_APPLE,
+ Material.GOLDEN_CARROT,
Material.MELON,
- Material.MUSHROOM_SOUP,
- Material.PORK,
- Material.RAW_BEEF,
- Material.RAW_CHICKEN,
- Material.RAW_FISH,
+ Material.MUSHROOM_STEW,
+ Material.MUTTON,
+ Material.POISONOUS_POTATO,
+ Material.POTATO,
+ Material.PUFFERFISH,
+ Material.PUMPKIN_PIE,
+ Material.RABBIT,
+ Material.RABBIT_STEW,
Material.ROTTEN_FLESH,
+ Material.SALMON,
Material.SPIDER_EYE
));
@@ -1140,10 +1157,10 @@ public static boolean isArchery(EntityDamageEvent event)
// Sword
public static Set SWORD_MATERIALS = EnumSet.of(
- Material.WOOD_SWORD,
+ Material.WOODEN_SWORD,
Material.STONE_SWORD,
Material.IRON_SWORD,
- Material.GOLD_SWORD,
+ Material.GOLDEN_SWORD,
Material.DIAMOND_SWORD
);
@@ -1180,10 +1197,10 @@ public static boolean isSword(EntityDamageEvent event)
// Axe
public static Set AXE_MATERIALS = EnumSet.of(
- Material.WOOD_AXE,
+ Material.WOODEN_AXE,
Material.STONE_AXE,
Material.IRON_AXE,
- Material.GOLD_AXE,
+ Material.GOLDEN_AXE,
Material.DIAMOND_AXE
);
@@ -1252,10 +1269,10 @@ public static boolean isAxe(BlockBreakEvent event)
// Pickaxe
public static Set PICKAXE_MATERIALS = EnumSet.of(
- Material.WOOD_PICKAXE,
+ Material.WOODEN_PICKAXE,
Material.STONE_PICKAXE,
Material.IRON_PICKAXE,
- Material.GOLD_PICKAXE,
+ Material.GOLDEN_PICKAXE,
Material.DIAMOND_PICKAXE
);
@@ -1286,11 +1303,11 @@ public static boolean isPickaxe(BlockBreakEvent event)
// Spade
public static Set SPADE_MATERIALS = EnumSet.of(
- Material.WOOD_SPADE,
- Material.STONE_SPADE,
- Material.IRON_SPADE,
- Material.GOLD_SPADE,
- Material.DIAMOND_SPADE
+ Material.WOODEN_SHOVEL,
+ Material.STONE_SHOVEL,
+ Material.IRON_SHOVEL,
+ Material.GOLDEN_SHOVEL,
+ Material.DIAMOND_SHOVEL
);
public static boolean isSpade(Material material)
@@ -1329,9 +1346,9 @@ public static Material getEatenMaterial(PlayerInteractEvent event)
Material ret = null;
- if (action == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.CAKE_BLOCK)
+ if (action == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.CAKE)
{
- ret = Material.CAKE_BLOCK;
+ ret = Material.CAKE;
}
else if (FOOD_MATERIALS.contains(event.getMaterial()))
{
diff --git a/src/com/massivecraft/massivecore/util/SignUtil.java b/src/com/massivecraft/massivecore/util/SignUtil.java
index 2ffce8373..3abf94b7c 100644
--- a/src/com/massivecraft/massivecore/util/SignUtil.java
+++ b/src/com/massivecraft/massivecore/util/SignUtil.java
@@ -243,9 +243,18 @@ public static boolean isSign(Material material)
{
if (material == null) throw new NullPointerException("material");
- if (material == Material.SIGN) return true;
- if (material == Material.SIGN_POST) return true;
- if (material == Material.WALL_SIGN) return true;
+ if (material == Material.SPRUCE_SIGN) return true;
+ if (material == Material.SPRUCE_WALL_SIGN) return true;
+ if (material == Material.ACACIA_SIGN) return true;
+ if (material == Material.ACACIA_WALL_SIGN) return true;
+ if (material == Material.BIRCH_SIGN) return true;
+ if (material == Material.BIRCH_WALL_SIGN) return true;
+ if (material == Material.DARK_OAK_SIGN) return true;
+ if (material == Material.DARK_OAK_WALL_SIGN) return true;
+ if (material == Material.JUNGLE_SIGN) return true;
+ if (material == Material.JUNGLE_WALL_SIGN) return true;
+ if (material == Material.OAK_SIGN) return true;
+ if (material == Material.OAK_WALL_SIGN) return true;
return false;
}