mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 11:45:52 -07:00
Update to Minecraft 1.13-pre7
This commit is contained in:
@@ -1,54 +1,35 @@
|
||||
--- a/net/minecraft/server/BlockRedstoneLamp.java
|
||||
+++ b/net/minecraft/server/BlockRedstoneLamp.java
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import java.util.Random;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
+
|
||||
public class BlockRedstoneLamp extends Block {
|
||||
|
||||
private final boolean a;
|
||||
@@ -18,8 +20,18 @@
|
||||
public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
public static final BlockStateBoolean a = BlockRedstoneTorch.LIT;
|
||||
@@ -33,6 +35,11 @@
|
||||
if (flag) {
|
||||
world.I().a(blockposition, this, 4);
|
||||
} else {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callRedstoneChange(world, blockposition, 0, 15).getNewCurrent() != 15) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockRedstoneLamp.a), 2);
|
||||
}
|
||||
}
|
||||
@@ -43,6 +50,11 @@
|
||||
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
|
||||
if (!world.isClientSide) {
|
||||
if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {
|
||||
if (((Boolean) iblockdata.get(BlockRedstoneLamp.a)).booleanValue() && !world.isBlockIndirectlyPowered(blockposition)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 15, 0).getNewCurrent() != 0) {
|
||||
+ if (CraftEventFactory.callRedstoneChange(world, blockposition, 15, 0).getNewCurrent() != 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.setTypeAndData(blockposition, Blocks.REDSTONE_LAMP.getBlockData(), 2);
|
||||
} else if (!this.a && world.isBlockIndirectlyPowered(blockposition)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 0, 15).getNewCurrent() != 15) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.setTypeAndData(blockposition, Blocks.LIT_REDSTONE_LAMP.getBlockData(), 2);
|
||||
}
|
||||
|
||||
@@ -31,6 +43,11 @@
|
||||
if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {
|
||||
world.a(blockposition, (Block) this, 4);
|
||||
} else if (!this.a && world.isBlockIndirectlyPowered(blockposition)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 0, 15).getNewCurrent() != 15) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.setTypeAndData(blockposition, Blocks.LIT_REDSTONE_LAMP.getBlockData(), 2);
|
||||
}
|
||||
|
||||
@@ -40,6 +57,11 @@
|
||||
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
|
||||
if (!world.isClientSide) {
|
||||
if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 15, 0).getNewCurrent() != 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.setTypeAndData(blockposition, Blocks.REDSTONE_LAMP.getBlockData(), 2);
|
||||
world.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockRedstoneLamp.a), 2);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user