summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/BlockMinecartDetector.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockMinecartDetector.java')
-rw-r--r--src/main/java/net/minecraft/server/BlockMinecartDetector.java44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/main/java/net/minecraft/server/BlockMinecartDetector.java b/src/main/java/net/minecraft/server/BlockMinecartDetector.java
index 3469207e..12782855 100644
--- a/src/main/java/net/minecraft/server/BlockMinecartDetector.java
+++ b/src/main/java/net/minecraft/server/BlockMinecartDetector.java
@@ -7,9 +7,9 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
- public BlockMinecartDetector(int i) {
- super(i, true);
- this.b(true);
+ public BlockMinecartDetector() {
+ super(true);
+ this.a(true);
}
public int a(World world) {
@@ -25,7 +25,7 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
int l = world.getData(i, j, k);
if ((l & 8) == 0) {
- this.d(world, i, j, k, l);
+ this.a(world, i, j, k, l);
}
}
}
@@ -35,7 +35,7 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
int l = world.getData(i, j, k);
if ((l & 8) != 0) {
- this.d(world, i, j, k, l);
+ this.a(world, i, j, k, l);
}
}
}
@@ -48,7 +48,7 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
return (iblockaccess.getData(i, j, k) & 8) == 0 ? 0 : (l == 1 ? 15 : 0);
}
- private void d(World world, int i, int j, int k, int l) {
+ private void a(World world, int i, int j, int k, int l) {
boolean flag = (l & 8) != 0;
boolean flag1 = false;
float f = 0.125F;
@@ -71,41 +71,47 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
if (flag1 && !flag) {
world.setData(i, j, k, l | 8, 3);
- world.applyPhysics(i, j, k, this.id);
- world.applyPhysics(i, j - 1, k, this.id);
- world.g(i, j, k, i, j, k);
+ world.applyPhysics(i, j, k, this);
+ world.applyPhysics(i, j - 1, k, this);
+ world.c(i, j, k, i, j, k);
}
if (!flag1 && flag) {
world.setData(i, j, k, l & 7, 3);
- world.applyPhysics(i, j, k, this.id);
- world.applyPhysics(i, j - 1, k, this.id);
- world.g(i, j, k, i, j, k);
+ world.applyPhysics(i, j, k, this);
+ world.applyPhysics(i, j - 1, k, this);
+ world.c(i, j, k, i, j, k);
}
if (flag1) {
- world.a(i, j, k, this.id, this.a(world));
+ world.a(i, j, k, this, this.a(world));
}
- world.m(i, j, k, this.id);
+ world.f(i, j, k, this);
}
public void onPlace(World world, int i, int j, int k) {
super.onPlace(world, i, j, k);
- this.d(world, i, j, k, world.getData(i, j, k));
+ this.a(world, i, j, k, world.getData(i, j, k));
}
- public boolean q_() {
+ public boolean M() {
return true;
}
- public int b_(World world, int i, int j, int k, int l) {
+ public int g(World world, int i, int j, int k, int l) {
if ((world.getData(i, j, k) & 8) > 0) {
float f = 0.125F;
- List list = world.a(EntityMinecartAbstract.class, AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)), IEntitySelector.b);
+ List list = world.a(EntityMinecartCommandBlock.class, AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)));
if (list.size() > 0) {
- return Container.b((IInventory) list.get(0));
+ return ((EntityMinecartCommandBlock) list.get(0)).e().g();
+ }
+
+ List list1 = world.a(EntityMinecartAbstract.class, AxisAlignedBB.a().a((double) ((float) i + f), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) (j + 1) - f), (double) ((float) (k + 1) - f)), IEntitySelector.b);
+
+ if (list1.size() > 0) {
+ return Container.b((IInventory) list1.get(0));
}
}