From 58a5d9961bc2d02d040fde6c1cebca82407a6766 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 23 Aug 2018 20:15:31 +1000 Subject: [PATCH] Minor formatting and neatness changes. --- .../com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java | 9 ++++++++- .../sk89q/worldedit/bukkit/BukkitEntityProperties.java | 7 ++----- .../com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java | 1 - 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java index e347f2593..88e4784d4 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java @@ -62,7 +62,14 @@ public class BukkitBlockRegistry extends BundledBlockRegistry { @Override public boolean isAir() { - return material == Material.AIR || material == Material.CAVE_AIR || material == Material.VOID_AIR; + switch (material) { + case AIR: + case CAVE_AIR: + case VOID_AIR: + return true; + default: + return false; + } } @Override diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java index 86618f62f..fd40f0203 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java @@ -22,9 +22,9 @@ package com.sk89q.worldedit.bukkit; import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.entity.metadata.EntityProperties; -import com.sk89q.worldedit.util.Enums; import org.bukkit.entity.Ambient; import org.bukkit.entity.Animals; +import org.bukkit.entity.ArmorStand; import org.bukkit.entity.Boat; import org.bukkit.entity.ComplexEntityPart; import org.bukkit.entity.Entity; @@ -46,9 +46,6 @@ import org.bukkit.entity.minecart.ExplosiveMinecart; class BukkitEntityProperties implements EntityProperties { - private static final org.bukkit.entity.EntityType armorStandType = - Enums.findByValue(org.bukkit.entity.EntityType.class, "ARMOR_STAND"); - private final Entity entity; BukkitEntityProperties(Entity entity) { @@ -143,7 +140,7 @@ class BukkitEntityProperties implements EntityProperties { @Override public boolean isArmorStand() { - return entity.getType() == armorStandType; + return entity instanceof ArmorStand; } @Override diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index d4ec870bc..4fe00edb8 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -26,7 +26,6 @@ import com.sk89q.worldedit.extent.inventory.OutOfBlocksException; import com.sk89q.worldedit.extent.inventory.OutOfSpaceException; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockTypes; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack;