Update to Minecraft 1.18-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-22 09:00:00 +11:00
parent a852b81a69
commit 43702a9e10
700 changed files with 10286 additions and 10098 deletions

View File

@@ -11,20 +11,20 @@
public static final BlockStateBoolean POWERED = BlockProperties.POWERED;
@@ -41,8 +43,18 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if ((Boolean) iblockdata.get(BlockObserver.POWERED)) {
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if ((Boolean) iblockdata.getValue(BlockObserver.POWERED)) {
+ // CraftBukkit start
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) {
+ return;
+ }
+ // CraftBukkit end
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockObserver.POWERED, false), 2);
worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockObserver.POWERED, false), 2);
} else {
+ // CraftBukkit start
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 0, 15).getNewCurrent() != 15) {
+ return;
+ }
+ // CraftBukkit end
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockObserver.POWERED, true), 2);
worldserver.getBlockTickList().a(blockposition, this, 2);
worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockObserver.POWERED, true), 2);
worldserver.scheduleTick(blockposition, (Block) this, 2);
}