mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 02:20:01 +03:00
48 lines
1.9 KiB
Diff
48 lines
1.9 KiB
Diff
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneLight.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneLight.java
|
|
@@ -8,6 +8,7 @@
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.util.math.BlockPos;
|
|
import net.minecraft.world.World;
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
|
|
public class BlockRedstoneLight extends Block
|
|
{
|
|
@@ -30,10 +31,16 @@
|
|
{
|
|
if (this.isOn && !worldIn.isBlockPowered(pos))
|
|
{
|
|
+ if (CraftEventFactory.callRedstoneChange(worldIn, pos.getX(), pos.getY(), pos.getZ(), 15, 0).getNewCurrent() != 0) {
|
|
+ return;
|
|
+ }
|
|
worldIn.setBlockState(pos, Blocks.REDSTONE_LAMP.getDefaultState(), 2);
|
|
}
|
|
else if (!this.isOn && worldIn.isBlockPowered(pos))
|
|
{
|
|
+ if (CraftEventFactory.callRedstoneChange(worldIn, pos.getX(), pos.getY(), pos.getZ(), 0, 15).getNewCurrent() != 15) {
|
|
+ return;
|
|
+ }
|
|
worldIn.setBlockState(pos, Blocks.LIT_REDSTONE_LAMP.getDefaultState(), 2);
|
|
}
|
|
}
|
|
@@ -49,6 +56,9 @@
|
|
}
|
|
else if (!this.isOn && worldIn.isBlockPowered(pos))
|
|
{
|
|
+ if (CraftEventFactory.callRedstoneChange(worldIn, pos.getX(), pos.getY(), pos.getZ(), 0, 15).getNewCurrent() != 15) {
|
|
+ return;
|
|
+ }
|
|
worldIn.setBlockState(pos, Blocks.LIT_REDSTONE_LAMP.getDefaultState(), 2);
|
|
}
|
|
}
|
|
@@ -60,6 +70,9 @@
|
|
{
|
|
if (this.isOn && !worldIn.isBlockPowered(pos))
|
|
{
|
|
+ if (CraftEventFactory.callRedstoneChange(worldIn, pos.getX(), pos.getY(), pos.getZ(), 15, 0).getNewCurrent() != 0) {
|
|
+ return;
|
|
+ }
|
|
worldIn.setBlockState(pos, Blocks.REDSTONE_LAMP.getDefaultState(), 2);
|
|
}
|
|
}
|