diff options
author | feildmaster <admin@feildmaster.com> | 2012-04-02 07:43:59 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-04-02 14:08:11 -0500 |
commit | ed8cf5196e520ecf559db3512cec4269f18dae94 (patch) | |
tree | 185584a5a6741f40947dd7064cee5c4e417c9ccc /src/main/java/net/minecraft/server/BlockRedstoneLamp.java | |
parent | 058bd748b65b0d787e675ede74d948c787df532c (diff) | |
download | craftbukkit-ed8cf5196e520ecf559db3512cec4269f18dae94.tar craftbukkit-ed8cf5196e520ecf559db3512cec4269f18dae94.tar.gz craftbukkit-ed8cf5196e520ecf559db3512cec4269f18dae94.tar.lz craftbukkit-ed8cf5196e520ecf559db3512cec4269f18dae94.tar.xz craftbukkit-ed8cf5196e520ecf559db3512cec4269f18dae94.zip |
Add BlockRedstoneLamp for diff visibility.
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockRedstoneLamp.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockRedstoneLamp.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneLamp.java b/src/main/java/net/minecraft/server/BlockRedstoneLamp.java new file mode 100644 index 00000000..8ca090f3 --- /dev/null +++ b/src/main/java/net/minecraft/server/BlockRedstoneLamp.java @@ -0,0 +1,47 @@ +package net.minecraft.server; + +import java.util.Random; + +public class BlockRedstoneLamp extends Block { + + private final boolean a; + + public BlockRedstoneLamp(int i, boolean flag) { + super(i, 211, Material.BUILDABLE_GLASS); + this.a = flag; + if (flag) { + this.a(1.0F); + ++this.textureId; + } + } + + public void onPlace(World world, int i, int j, int k) { + if (!world.isStatic) { + if (this.a && !world.isBlockIndirectlyPowered(i, j, k)) { + world.c(i, j, k, this.id, 4); + } else if (!this.a && world.isBlockIndirectlyPowered(i, j, k)) { + world.setTypeId(i, j, k, Block.REDSTONE_LAMP_ON.id); + } + } + } + + public void doPhysics(World world, int i, int j, int k, int l) { + if (!world.isStatic) { + if (this.a && !world.isBlockIndirectlyPowered(i, j, k)) { + world.c(i, j, k, this.id, 4); + } else if (!this.a && world.isBlockIndirectlyPowered(i, j, k)) { + world.setTypeId(i, j, k, Block.REDSTONE_LAMP_ON.id); + } + } + } + + public void a(World world, int i, int j, int k, Random random) { + if (!world.isStatic && this.a && !world.isBlockIndirectlyPowered(i, j, k)) { + world.setTypeId(i, j, k, Block.REDSTONE_LAMP_OFF.id); + } + } + + public int getDropType(int i, Random random, int j) { + return Block.REDSTONE_LAMP_OFF.id; + } +} |