mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-20 14:53:49 -07:00
@@ -9,8 +9,15 @@
|
|||||||
public class BlockRedstoneLamp extends Block {
|
public class BlockRedstoneLamp extends Block {
|
||||||
|
|
||||||
private final boolean a;
|
private final boolean a;
|
||||||
@@ -20,6 +22,11 @@
|
@@ -18,8 +20,18 @@
|
||||||
|
public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||||
|
if (!world.isClientSide) {
|
||||||
if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {
|
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, Blocks.REDSTONE_LAMP.getBlockData(), 2);
|
||||||
} else if (!this.a && world.isBlockIndirectlyPowered(blockposition)) {
|
} else if (!this.a && world.isBlockIndirectlyPowered(blockposition)) {
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
@@ -21,7 +28,7 @@
|
|||||||
world.setTypeAndData(blockposition, Blocks.LIT_REDSTONE_LAMP.getBlockData(), 2);
|
world.setTypeAndData(blockposition, Blocks.LIT_REDSTONE_LAMP.getBlockData(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,6 +38,11 @@
|
@@ -31,6 +43,11 @@
|
||||||
if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {
|
if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {
|
||||||
world.a(blockposition, (Block) this, 4);
|
world.a(blockposition, (Block) this, 4);
|
||||||
} else if (!this.a && world.isBlockIndirectlyPowered(blockposition)) {
|
} else if (!this.a && world.isBlockIndirectlyPowered(blockposition)) {
|
||||||
@@ -33,7 +40,7 @@
|
|||||||
world.setTypeAndData(blockposition, Blocks.LIT_REDSTONE_LAMP.getBlockData(), 2);
|
world.setTypeAndData(blockposition, Blocks.LIT_REDSTONE_LAMP.getBlockData(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,6 +52,11 @@
|
@@ -40,6 +57,11 @@
|
||||||
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
|
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {
|
if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {
|
||||||
|
Reference in New Issue
Block a user