diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-11-26 08:32:16 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2014-11-28 17:16:30 +1100 |
commit | 24557bc2b37deb6a0edf497d547471832457b1dd (patch) | |
tree | c560572889a3b0b34964a0cddb35dc87fda3c914 /src/main/java/net/minecraft/server/BlockPressurePlateBinary.java | |
parent | a4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff) | |
download | craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip |
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockPressurePlateBinary.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockPressurePlateBinary.java | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java b/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java deleted file mode 100644 index 25ef883d..00000000 --- a/src/main/java/net/minecraft/server/BlockPressurePlateBinary.java +++ /dev/null @@ -1,74 +0,0 @@ -package net.minecraft.server; - -import java.util.Iterator; -import java.util.List; - -import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit - -public class BlockPressurePlateBinary extends BlockPressurePlateAbstract { - - private EnumMobType a; - - protected BlockPressurePlateBinary(String s, Material material, EnumMobType enummobtype) { - super(s, material); - this.a = enummobtype; - } - - protected int d(int i) { - return i > 0 ? 1 : 0; - } - - protected int c(int i) { - return i == 1 ? 15 : 0; - } - - protected int e(World world, int i, int j, int k) { - List list = null; - - if (this.a == EnumMobType.EVERYTHING) { - list = world.getEntities((Entity) null, this.a(i, j, k)); - } - - if (this.a == EnumMobType.MOBS) { - list = world.a(EntityLiving.class, this.a(i, j, k)); - } - - if (this.a == EnumMobType.PLAYERS) { - list = world.a(EntityHuman.class, this.a(i, j, k)); - } - - if (list != null && !list.isEmpty()) { - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) { - Entity entity = (Entity) iterator.next(); - - // CraftBukkit start - Call interact event when turning on a pressure plate - if (this.c(world.getData(i, j, k)) == 0) { - org.bukkit.World bworld = world.getWorld(); - org.bukkit.plugin.PluginManager manager = world.getServer().getPluginManager(); - org.bukkit.event.Cancellable cancellable; - - if (entity instanceof EntityHuman) { - cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, i, j, k, -1, null); - } else { - cancellable = new EntityInteractEvent(entity.getBukkitEntity(), bworld.getBlockAt(i, j, k)); - manager.callEvent((EntityInteractEvent) cancellable); - } - - // We only want to block turning the plate on if all events are cancelled - if (cancellable.isCancelled()) { - continue; - } - } - // CraftBukkit end - - if (!entity.az()) { - return 15; - } - } - } - - return 0; - } -} |