Dateien nach "MAIN/nms-patches/1.12.2" hochladen
This commit is contained in:
31
MAIN/nms-patches/1.12.2/BlockObserver.patch
Normal file
31
MAIN/nms-patches/1.12.2/BlockObserver.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
--- a/minecraft/server/BlockObserver.java
|
||||
+++ b/minecraft/server/BlockObserver.java
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+
|
||||
public class BlockObserver extends BlockDirectional {
|
||||
|
||||
public static final BlockStateBoolean a = BlockStateBoolean.of("powered");
|
||||
@@ -26,8 +28,18 @@
|
||||
|
||||
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
|
||||
if (((Boolean) iblockdata.get(BlockObserver.a)).booleanValue()) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 15, 0).getNewCurrent() != 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.setTypeAndData(blockposition, iblockdata.set(BlockObserver.a, Boolean.valueOf(false)), 2);
|
||||
} else {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 0, 15).getNewCurrent() != 15) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.setTypeAndData(blockposition, iblockdata.set(BlockObserver.a, Boolean.valueOf(true)), 2);
|
||||
world.a(blockposition, (Block) this, 2);
|
||||
}
|
||||
|
31
MAIN/nms-patches/1.12.2/BlockRedstoneComparator.patch
Normal file
31
MAIN/nms-patches/1.12.2/BlockRedstoneComparator.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
--- a/minecraft/server/BlockRedstoneComparator.java
|
||||
+++ b/minecraft/server/BlockRedstoneComparator.java
|
||||
@@ -5,6 +5,8 @@
|
||||
import java.util.Random;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
+
|
||||
public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITileEntity {
|
||||
|
||||
public static final BlockStateBoolean POWERED = BlockStateBoolean.of("powered");
|
||||
@@ -164,8 +166,18 @@
|
||||
boolean flag1 = this.A(iblockdata);
|
||||
|
||||
if (flag1 && !flag) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 15, 0).getNewCurrent() != 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.setTypeAndData(blockposition, iblockdata.set(BlockRedstoneComparator.POWERED, Boolean.valueOf(false)), 2);
|
||||
} else if (!flag1 && flag) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 0, 15).getNewCurrent() != 15) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.setTypeAndData(blockposition, iblockdata.set(BlockRedstoneComparator.POWERED, Boolean.valueOf(true)), 2);
|
||||
}
|
||||
|
||||
|
11
MAIN/nms-patches/1.12.2/README.md
Normal file
11
MAIN/nms-patches/1.12.2/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
**Add Observer and Comparator support for spigot 1.12.2**
|
||||
1. Download [BuildTools](https://hub.spigotmc.org/jenkins/job/BuildTools)
|
||||
2. run ``java -jar BuildTools.jar --rev 1.12.2``
|
||||
3. Download this two patches : [BlockObserver](./BlockObserver.patch) , [BlockRedstoneComparator](./BlockRedstoneComparator.patch)
|
||||
4. go into ``CraftBukkit/nms-patches`` and place both ``.patch`` file into it
|
||||
5. go back on the BuildTools.jar folder and run ``java -jar BuildTools.jar --dont-update``
|
||||
6. You spigot is now patched to support Observer and Comparator
|
||||
|
||||
More info about BuildTools and Spigot installation:
|
||||
https://www.spigotmc.org/wiki/spigot-installation
|
||||
https://www.spigotmc.org/wiki/buildtools
|
Reference in New Issue
Block a user