summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authorgjmcferrin@gmail.com <gjmcferrin@gmail.com>2013-03-29 16:54:10 -0400
committerTravis Watkins <amaranth@ubuntu.com>2013-04-03 02:48:47 -0500
commit1d6ff3461d8cb1d90928cba52d973f9e4025ace8 (patch)
treebd1cafc2b269d3e1d02a373bef4747bf76e30d43 /src/main/java/net
parent743d0fb603356ee9473784576b571b30637a4baa (diff)
downloadcraftbukkit-1d6ff3461d8cb1d90928cba52d973f9e4025ace8.tar
craftbukkit-1d6ff3461d8cb1d90928cba52d973f9e4025ace8.tar.gz
craftbukkit-1d6ff3461d8cb1d90928cba52d973f9e4025ace8.tar.lz
craftbukkit-1d6ff3461d8cb1d90928cba52d973f9e4025ace8.tar.xz
craftbukkit-1d6ff3461d8cb1d90928cba52d973f9e4025ace8.zip
Add BlockDaylightDetector from mc-dev for diff visibility
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/BlockDaylightDetector.java71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockDaylightDetector.java b/src/main/java/net/minecraft/server/BlockDaylightDetector.java
new file mode 100644
index 00000000..84e93f41
--- /dev/null
+++ b/src/main/java/net/minecraft/server/BlockDaylightDetector.java
@@ -0,0 +1,71 @@
+package net.minecraft.server;
+
+import java.util.Random;
+
+public class BlockDaylightDetector extends BlockContainer {
+
+ private IIcon[] a = new IIcon[2];
+
+ public BlockDaylightDetector(int i) {
+ super(i, Material.WOOD);
+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F);
+ this.a(CreativeModeTab.d);
+ }
+
+ public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F);
+ }
+
+ public int b(IBlockAccess iblockaccess, int i, int j, int k, int l) {
+ return iblockaccess.getData(i, j, k);
+ }
+
+ public void a(World world, int i, int j, int k, Random random) {}
+
+ public void doPhysics(World world, int i, int j, int k, int l) {}
+
+ public void onPlace(World world, int i, int j, int k) {}
+
+ public void i_(World world, int i, int j, int k) {
+ if (!world.worldProvider.f) {
+ int l = world.getData(i, j, k);
+ int i1 = world.b(EnumSkyBlock.SKY, i, j, k) - world.j;
+ float f = world.d(1.0F);
+
+ if (f < 3.1415927F) {
+ f += (0.0F - f) * 0.2F;
+ } else {
+ f += (6.2831855F - f) * 0.2F;
+ }
+
+ i1 = Math.round((float) i1 * MathHelper.cos(f));
+ if (i1 < 0) {
+ i1 = 0;
+ }
+
+ if (i1 > 15) {
+ i1 = 15;
+ }
+
+ if (l != i1) {
+ world.setData(i, j, k, i1, 3);
+ }
+ }
+ }
+
+ public boolean b() {
+ return false;
+ }
+
+ public boolean c() {
+ return false;
+ }
+
+ public boolean isPowerSource() {
+ return true;
+ }
+
+ public TileEntity b(World world) {
+ return new TileEntityLightDetector();
+ }
+}