mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-02-28 02:01:36 +01:00
Fix issues with MC 1.7 compatibility.
This commit is contained in:
parent
5bfb348354
commit
dfe536a2d2
@ -834,11 +834,9 @@ private static <T extends Event & Cancellable> void handleBlockRightClick(T even
|
||||
}
|
||||
|
||||
// Handle created armor stands
|
||||
try { // backwards compat for 1.7
|
||||
if (item != null && item.getType() == Material.ARMOR_STAND) {
|
||||
Events.fireToCancel(event, new SpawnEntityEvent(event, cause, placed.getLocation().add(0.5, 0, 0.5), EntityType.ARMOR_STAND));
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
if (item != null && item.getType() == Materials.ARMOR_STAND) {
|
||||
Events.fireToCancel(event, new SpawnEntityEvent(event, cause, placed.getLocation().add(0.5, 0, 0.5), EntityType.ARMOR_STAND));
|
||||
}
|
||||
|
||||
// Handle created spawn eggs
|
||||
if (item != null && item.getType() == Material.MONSTER_EGG) {
|
||||
|
@ -46,7 +46,15 @@ public final class Materials {
|
||||
private static final Map<Material, Integer> MATERIAL_FLAGS = new HashMap<Material, Integer>();
|
||||
private static final Set<PotionEffectType> DAMAGE_EFFECTS = new HashSet<PotionEffectType>();
|
||||
|
||||
public static Material ARMOR_STAND;
|
||||
|
||||
static {
|
||||
try {
|
||||
ARMOR_STAND = Material.ARMOR_STAND;
|
||||
} catch (NoSuchFieldError ignored) {
|
||||
ARMOR_STAND = null;
|
||||
}
|
||||
|
||||
ENTITY_ITEMS.put(EntityType.PAINTING, Material.PAINTING);
|
||||
ENTITY_ITEMS.put(EntityType.ARROW, Material.ARROW);
|
||||
ENTITY_ITEMS.put(EntityType.SNOWBALL, Material.SNOW_BALL);
|
||||
@ -68,7 +76,7 @@ public final class Materials {
|
||||
ENTITY_ITEMS.put(EntityType.EGG, Material.EGG);
|
||||
try {
|
||||
ENTITY_ITEMS.put(EntityType.ARMOR_STAND, Material.ARMOR_STAND);
|
||||
} catch (Exception ignored) {}
|
||||
} catch (NoSuchFieldError ignored) {}
|
||||
|
||||
MATERIAL_FLAGS.put(Material.AIR, 0);
|
||||
MATERIAL_FLAGS.put(Material.STONE, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user