summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/ItemBlock.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemBlock.java')
-rw-r--r--src/main/java/net/minecraft/server/ItemBlock.java32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java
index 5545c011..c2b9d54f 100644
--- a/src/main/java/net/minecraft/server/ItemBlock.java
+++ b/src/main/java/net/minecraft/server/ItemBlock.java
@@ -9,14 +9,14 @@ public class ItemBlock extends Item {
public ItemBlock(int i) {
super(i);
this.id = i + 256;
- this.d(Block.byId[i + 256].a(2));
+ this.c(Block.byId[i + 256].a(2));
}
- public int a() {
+ public int f() {
return this.id;
}
- public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l) {
+ public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l, float f, float f1, float f2) {
int clickedX = i, clickedY = j, clickedZ = k; // CraftBukkit
int i1 = world.getTypeId(i, j, k);
@@ -50,14 +50,23 @@ public class ItemBlock extends Item {
if (itemstack.count == 0) {
return false;
- } else if (!entityhuman.d(i, j, k)) {
+ } else if (!entityhuman.e(i, j, k)) {
return false;
} else if (j == 255 && Block.byId[this.id].material.isBuildable()) {
return false;
+ // CraftBukkit start
}
- // CraftBukkit start
- int id = (l == -1 && itemstack.getItem() instanceof ItemStep) ? Block.DOUBLE_STEP.id : this.id;
- if (id != this.id || world.mayPlace(this.id, i, j, k, false, l)) {
+
+ int id = this.id;
+ if (l == -1 && itemstack.getItem() instanceof ItemStep) {
+ if (this.id == Block.STEP.id) {
+ id = Block.DOUBLE_STEP.id;
+ } else if (this.id == Block.WOOD_STEP.id) {
+ id = Block.WOOD_DOUBLE_STEP.id;
+ }
+ }
+
+ if (id != this.id || world.mayPlace(this.id, i, j, k, false, l, entityhuman)) {
Block block = Block.byId[id];
CraftBlockState replacedBlockState = CraftBlockState.getBlockState(world, i, j, k);
@@ -73,10 +82,9 @@ public class ItemBlock extends Item {
if (event.isCancelled() || !event.canBuild()) {
return true;
}
-
if (world.setTypeIdAndData(i, j, k, id, data)) {
if (world.getTypeId(i, j, k) == id && Block.byId[id] != null) {
- Block.byId[id].postPlace(world, i, j, k, l);
+ Block.byId[id].postPlace(world, i, j, k, l, f, f1, f2);
Block.byId[id].postPlace(world, i, j, k, entityhuman);
// CraftBukkit end
}
@@ -91,11 +99,11 @@ public class ItemBlock extends Item {
}
}
- public String a(ItemStack itemstack) {
- return Block.byId[this.id].q();
+ public String c(ItemStack itemstack) {
+ return Block.byId[this.id].a();
}
public String getName() {
- return Block.byId[this.id].q();
+ return Block.byId[this.id].a();
}
}