Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/main/java/net/minecraft/server/BlockDoor.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ public void doPhysics(World world, int i, int j, int k, int l) {
boolean flag = false;

if (world.getTypeId(i, j + 1, k) != this.id) {
// Poseidon start
return;
// Poseidon end
world.setTypeId(i, j, k, 0);
flag = true;
}

if (!world.e(i, j - 1, k)) {
Expand All @@ -160,9 +159,7 @@ public void doPhysics(World world, int i, int j, int k, int l) {
}

if (flag) {
// Poseidon start
if (!world.isStatic && (i1 & 8) == 0) {
// Poseidon end
if (!world.isStatic) {
this.g(world, i, j, k, i1);
}
} else if (l > 0 && Block.byId[l].isPowerSource()) {
Expand Down
16 changes: 5 additions & 11 deletions src/main/java/net/minecraft/server/ItemDoor.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public boolean a(ItemStack itemstack, EntityHuman entityhuman, World world, int
if (l != 1) {
return false;
} else {
int clickedX = i, clickedY = j, clickedZ = k; // CraftBukkit

++j;
Block block;

Expand Down Expand Up @@ -72,26 +70,22 @@ public boolean a(ItemStack itemstack, EntityHuman entityhuman, World world, int
}

CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j, k); // CraftBukkit

world.suppressPhysics = true;
world.setTypeIdAndData(i, j, k, block.id, i1);

// CraftBukkit start - bed
world.suppressPhysics = false;
world.applyPhysics(i, j, k, Block.REDSTONE_WIRE.id);
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ, block);
// CraftBukkit start
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k, block);

if (event.isCancelled() || !event.canBuild()) {
event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false);
return false;
}

world.suppressPhysics = true;
// CraftBukkit end

world.setTypeIdAndData(i, j + 1, k, block.id, i1 + 8);
world.suppressPhysics = false;
// world.applyPhysics(i, j, k, block.id); // CraftBukkit - moved up
world.applyPhysics(i, j + 1, k, Block.REDSTONE_WIRE.id);
world.applyPhysics(i, j, k, block.id);
world.applyPhysics(i, j + 1, k, block.id);
--itemstack.count;
return true;
}
Expand Down
Loading