mirror of
https://github.com/SparklyPower/SparklyPaper.git
synced 2025-12-21 07:59:31 +00:00
A bunch of new patches that we need for SparklyPower features
This commit is contained in:
84
patches/api/0001-Add-ClientboundPacketPreDispatchEvent.patch
Normal file
84
patches/api/0001-Add-ClientboundPacketPreDispatchEvent.patch
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||||
|
Date: Mon, 10 Jun 2024 12:27:08 -0300
|
||||||
|
Subject: [PATCH] Add ClientboundPacketPreDispatchEvent
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/sparklypower/sparklypaper/event/packet/ClientboundPacketPreDispatchEvent.java b/src/main/java/net/sparklypower/sparklypaper/event/packet/ClientboundPacketPreDispatchEvent.java
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000000000000000000000000000000..6d36dccdc08e7e523771fde4d8d1bb73e430114c
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/main/java/net/sparklypower/sparklypaper/event/packet/ClientboundPacketPreDispatchEvent.java
|
||||||
|
@@ -0,0 +1,72 @@
|
||||||
|
+package net.sparklypower.sparklypaper.event.packet;
|
||||||
|
+
|
||||||
|
+import org.bukkit.entity.Player;
|
||||||
|
+import org.bukkit.event.Cancellable;
|
||||||
|
+import org.bukkit.event.Event;
|
||||||
|
+import org.bukkit.event.HandlerList;
|
||||||
|
+import org.jetbrains.annotations.NotNull;
|
||||||
|
+import org.jetbrains.annotations.Nullable;
|
||||||
|
+
|
||||||
|
+/**
|
||||||
|
+ * Called before a packet is dispatched to a connection.
|
||||||
|
+ * <p>
|
||||||
|
+ * Compared to other solutions like ProtocolLib, this has the advantage that this is called eariler on the packet sending cycle, before the packet is added to the packet queue, allowing for
|
||||||
|
+ * main thread access of resources without worrying about race conditions.
|
||||||
|
+ * <p>
|
||||||
|
+ * The asynchronously state of this event is undefined, the event may be called on an async or on a sync thread, depending on where the packet was sent.
|
||||||
|
+ */
|
||||||
|
+public class ClientboundPacketPreDispatchEvent extends Event implements Cancellable {
|
||||||
|
+ private static final HandlerList handlers = new HandlerList();
|
||||||
|
+ private boolean isCancelled = false;
|
||||||
|
+ private final Player player;
|
||||||
|
+ private final Object packet;
|
||||||
|
+
|
||||||
|
+ public ClientboundPacketPreDispatchEvent(boolean isAsync, @Nullable Player player, @NotNull Object packet) {
|
||||||
|
+ super(isAsync);
|
||||||
|
+ this.player = player;
|
||||||
|
+ this.packet = packet;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Gets the player associated with this packet.
|
||||||
|
+ * <p>
|
||||||
|
+ * Depending on which phase the packet is from, the player may be null
|
||||||
|
+ *
|
||||||
|
+ * @return the player associated with this packet
|
||||||
|
+ */
|
||||||
|
+ @Nullable
|
||||||
|
+ public Player getPlayer() {
|
||||||
|
+ return player;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Gets the packet associated with this event.
|
||||||
|
+ *
|
||||||
|
+ * @return the packet associated with this event
|
||||||
|
+ */
|
||||||
|
+ @NotNull
|
||||||
|
+ public Object getPacket() {
|
||||||
|
+ return packet;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @NotNull
|
||||||
|
+ @Override
|
||||||
|
+ public HandlerList getHandlers() {
|
||||||
|
+ return handlers;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @NotNull
|
||||||
|
+ public static HandlerList getHandlerList() {
|
||||||
|
+ return handlers;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean isCancelled() {
|
||||||
|
+ return isCancelled;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void setCancelled(boolean cancel) {
|
||||||
|
+ this.isCancelled = cancel;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
76
patches/api/0002-Add-PlayerBlockDestroySpeedEvent.patch
Normal file
76
patches/api/0002-Add-PlayerBlockDestroySpeedEvent.patch
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||||
|
Date: Mon, 10 Jun 2024 14:38:59 -0300
|
||||||
|
Subject: [PATCH] Add PlayerBlockDestroySpeedEvent
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/sparklypower/sparklypaper/event/block/PlayerBlockDestroySpeedEvent.java b/src/main/java/net/sparklypower/sparklypaper/event/block/PlayerBlockDestroySpeedEvent.java
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000000000000000000000000000000..712868898e5e69dd0d4b9ad39f7e28a01b22de59
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/main/java/net/sparklypower/sparklypaper/event/block/PlayerBlockDestroySpeedEvent.java
|
||||||
|
@@ -0,0 +1,64 @@
|
||||||
|
+package net.sparklypower.sparklypaper.event.block;
|
||||||
|
+
|
||||||
|
+import org.bukkit.block.Block;
|
||||||
|
+import org.bukkit.entity.Player;
|
||||||
|
+import org.bukkit.event.Event;
|
||||||
|
+import org.bukkit.event.HandlerList;
|
||||||
|
+import org.bukkit.event.block.BlockEvent;
|
||||||
|
+import org.jetbrains.annotations.NotNull;
|
||||||
|
+
|
||||||
|
+/**
|
||||||
|
+ * Called when the block destroy speed is calculated for a block that a player is breaking.
|
||||||
|
+ * <p>
|
||||||
|
+ * Useful for custom blocks to override a server side block destroy speed to fix desynchronization issues between the server and the client. (Example: Chiseled bookshelves on the server side that are overriden by target blocks on the client side)
|
||||||
|
+ * <p>
|
||||||
|
+ * Keep in mind that you should use this event to synchronize the block destroy speed between the server and the client! Not keeping both destroy speeds in sync will cause desync issues!
|
||||||
|
+ */
|
||||||
|
+public class PlayerBlockDestroySpeedEvent extends BlockEvent {
|
||||||
|
+ private static final HandlerList handlers = new HandlerList();
|
||||||
|
+ private final Player player;
|
||||||
|
+ private float destroySpeed;
|
||||||
|
+
|
||||||
|
+ public PlayerBlockDestroySpeedEvent(Player player, Block block, float destroySpeed) {
|
||||||
|
+ super(block);
|
||||||
|
+ this.player = player;
|
||||||
|
+ this.destroySpeed = destroySpeed;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @NotNull
|
||||||
|
+ @Override
|
||||||
|
+ public HandlerList getHandlers() {
|
||||||
|
+ return handlers;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @NotNull
|
||||||
|
+ public static HandlerList getHandlerList() {
|
||||||
|
+ return handlers;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Gets the Player that is breaking the block involved in this event.
|
||||||
|
+ *
|
||||||
|
+ * @return The Player that is breaking the block involved in this event
|
||||||
|
+ */
|
||||||
|
+ @NotNull
|
||||||
|
+ public Player getPlayer() {
|
||||||
|
+ return player;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Gets the block destroy speed of the block involved in this event.
|
||||||
|
+ *
|
||||||
|
+ * @return the block destroy speed of the block involved in this event.
|
||||||
|
+ */
|
||||||
|
+ public float getDestroySpeed() {
|
||||||
|
+ return destroySpeed;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Sets the block destroy speed of the block involved in this event.
|
||||||
|
+ */
|
||||||
|
+ public void setDestroySpeed(float destroySpeed) {
|
||||||
|
+ this.destroySpeed = destroySpeed;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||||
|
Date: Mon, 10 Jun 2024 12:22:15 -0300
|
||||||
|
Subject: [PATCH] Add ClientboundPacketPreDispatchEvent
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||||
|
index f40420a6841f03983b0837e177ea2ae7c3a37ca1..18bfe8706209141ce2174588320e84e91f15c94e 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||||
|
@@ -442,6 +442,17 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // SparklyPaper start - Add ClientboundPacketPreDispatchEvent
|
||||||
|
+ net.minecraft.server.level.ServerPlayer serverPlayer = this.getPlayer();
|
||||||
|
+ org.bukkit.craftbukkit.entity.CraftPlayer craftPlayer = null;
|
||||||
|
+ if (serverPlayer != null)
|
||||||
|
+ craftPlayer = serverPlayer.getBukkitEntity();
|
||||||
|
+ net.sparklypower.sparklypaper.event.packet.ClientboundPacketPreDispatchEvent event = new net.sparklypower.sparklypaper.event.packet.ClientboundPacketPreDispatchEvent(!org.bukkit.Bukkit.isPrimaryThread(), craftPlayer, packet);
|
||||||
|
+ org.bukkit.Bukkit.getPluginManager().callEvent(event);
|
||||||
|
+ if (event.isCancelled())
|
||||||
|
+ return;
|
||||||
|
+ // SparklyPaper end
|
||||||
|
+
|
||||||
|
packet.onPacketDispatch(this.getPlayer());
|
||||||
|
if (connected && (InnerUtil.canSendImmediate(this, packet)
|
||||||
|
|| (io.papermc.paper.util.MCUtil.isMainThread() && packet.isReady() && this.pendingActions.isEmpty()
|
||||||
114
patches/server/0021-Helpful-NMS-packet-changes.patch
Normal file
114
patches/server/0021-Helpful-NMS-packet-changes.patch
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||||
|
Date: Mon, 10 Jun 2024 13:06:30 -0300
|
||||||
|
Subject: [PATCH] Helpful NMS packet changes
|
||||||
|
|
||||||
|
Some nice changes to the packet internals to make packet sending and manipulation easier for us to avoid Reflection and JVM internals (ooo theUnsafe spooky) usage
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundAddEntityPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundAddEntityPacket.java
|
||||||
|
index ee43eb8887835fbd016d28f91b2239dfeb25508e..e945e0752b41e10d16d8c766a2f919767b7b0b82 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundAddEntityPacket.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundAddEntityPacket.java
|
||||||
|
@@ -21,7 +21,7 @@ public class ClientboundAddEntityPacket implements Packet<ClientGamePacketListen
|
||||||
|
private static final double LIMIT = 3.9;
|
||||||
|
private final int id;
|
||||||
|
private final UUID uuid;
|
||||||
|
- private final EntityType<?> type;
|
||||||
|
+ public EntityType<?> type; // SparklyPaper - Helpful NMS packet changes: remove final and make public
|
||||||
|
private final double x;
|
||||||
|
private final double y;
|
||||||
|
private final double z;
|
||||||
|
@@ -177,6 +177,32 @@ public class ClientboundAddEntityPacket implements Packet<ClientGamePacketListen
|
||||||
|
return (float)(this.yHeadRot * 360) / 256.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // SparklyPaper - Helpful NMS packet changes: expose raw rotational fields
|
||||||
|
+ public int getXaRaw() {
|
||||||
|
+ return this.xa;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public int getYaRaw() {
|
||||||
|
+ return this.ya;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public int getZaRaw() {
|
||||||
|
+ return this.za;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public byte getXRotRaw() {
|
||||||
|
+ return this.xRot;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public byte getYRotRaw() {
|
||||||
|
+ return this.yRot;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public byte getYHeadRotRaw() {
|
||||||
|
+ return this.yHeadRot;
|
||||||
|
+ }
|
||||||
|
+ // SparklyPaper end
|
||||||
|
+
|
||||||
|
public int getData() {
|
||||||
|
return this.data;
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockUpdatePacket.java
|
||||||
|
index 1e8fad30c5f5be48501c7d8584caedcdc232f6c8..772848cf83a92a8ef8d734949b21f2f1d13e3fcb 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockUpdatePacket.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockUpdatePacket.java
|
||||||
|
@@ -19,7 +19,7 @@ public class ClientboundBlockUpdatePacket implements Packet<ClientGamePacketList
|
||||||
|
ClientboundBlockUpdatePacket::new
|
||||||
|
);
|
||||||
|
private final BlockPos pos;
|
||||||
|
- public final BlockState blockState;
|
||||||
|
+ public BlockState blockState; // SparklyPaper - Helpful NMS packet changes: remove final
|
||||||
|
|
||||||
|
public ClientboundBlockUpdatePacket(BlockPos pos, BlockState state) {
|
||||||
|
this.pos = pos;
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||||
|
index 0a8d07bf68b0ceabd13c70196d357fce79dcc2c3..0b5abaf11508fa6c6809b73f53d6854aa3b3247c 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||||
|
@@ -25,7 +25,7 @@ import net.minecraft.world.level.levelgen.Heightmap;
|
||||||
|
public class ClientboundLevelChunkPacketData {
|
||||||
|
private static final int TWO_MEGABYTES = 2097152;
|
||||||
|
private final CompoundTag heightmaps;
|
||||||
|
- private final byte[] buffer;
|
||||||
|
+ public byte[] buffer; // SparklyPaper - Helpful NMS packet changes: remove final and make public
|
||||||
|
private final List<ClientboundLevelChunkPacketData.BlockEntityInfo> blockEntitiesData;
|
||||||
|
// Paper start - Handle oversized block entities in chunks
|
||||||
|
private final java.util.List<net.minecraft.network.protocol.Packet<?>> extraPackets = new java.util.ArrayList<>();
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundRotateHeadPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundRotateHeadPacket.java
|
||||||
|
index 9a18277754fc1657e862b2ff4c077a54a4e24977..81bce96598dcfcc919e435ce47b9dc9c195c32fa 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundRotateHeadPacket.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundRotateHeadPacket.java
|
||||||
|
@@ -19,6 +19,13 @@ public class ClientboundRotateHeadPacket implements Packet<ClientGamePacketListe
|
||||||
|
this.yHeadRot = headYaw;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // SparklyPaper start - Helpful NMS packet changes: add entity ID constructor
|
||||||
|
+ public ClientboundRotateHeadPacket(int entityId, byte headYaw) {
|
||||||
|
+ this.entityId = entityId;
|
||||||
|
+ this.yHeadRot = headYaw;
|
||||||
|
+ }
|
||||||
|
+ // SparklyPaper end
|
||||||
|
+
|
||||||
|
private ClientboundRotateHeadPacket(FriendlyByteBuf buf) {
|
||||||
|
this.entityId = buf.readVarInt();
|
||||||
|
this.yHeadRot = buf.readByte();
|
||||||
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
||||||
|
index 1a37654aff9a9c86c9f7af10a1cf721371f0c5ec..e69ff4e6bb3919340a93ed4c68bdd6c4778669a9 100644
|
||||||
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
||||||
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
||||||
|
@@ -17,9 +17,9 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet<ClientGamePa
|
||||||
|
|
||||||
|
public static final StreamCodec<FriendlyByteBuf, ClientboundSectionBlocksUpdatePacket> STREAM_CODEC = Packet.codec(ClientboundSectionBlocksUpdatePacket::write, ClientboundSectionBlocksUpdatePacket::new);
|
||||||
|
private static final int POS_IN_SECTION_BITS = 12;
|
||||||
|
- private final SectionPos sectionPos;
|
||||||
|
- private final short[] positions;
|
||||||
|
- private final BlockState[] states;
|
||||||
|
+ public SectionPos sectionPos; // SparklyPaper - Helpful NMS packet changes: remove final and make public
|
||||||
|
+ public short[] positions; // SparklyPaper - Helpful NMS packet changes: remove final and make public
|
||||||
|
+ public BlockState[] states; // SparklyPaper - Helpful NMS packet changes: remove final and make public
|
||||||
|
|
||||||
|
public ClientboundSectionBlocksUpdatePacket(SectionPos sectionPos, ShortSet positions, LevelChunkSection section) {
|
||||||
|
this.sectionPos = sectionPos;
|
||||||
43
patches/server/0022-Add-PlayerBlockDestroySpeedEvent.patch
Normal file
43
patches/server/0022-Add-PlayerBlockDestroySpeedEvent.patch
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||||
|
Date: Mon, 10 Jun 2024 14:39:10 -0300
|
||||||
|
Subject: [PATCH] Add PlayerBlockDestroySpeedEvent
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||||
|
index 2034ca2edd3aff61d94416266e75402babd3e741..3809de95cab70dbbd5feffda64a5f14e209feff1 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||||
|
@@ -339,6 +339,14 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||||
|
protected float getDestroyProgress(BlockState state, Player player, BlockGetter world, BlockPos pos) {
|
||||||
|
float f = state.getDestroySpeed(world, pos);
|
||||||
|
|
||||||
|
+ // SparklyPaper start - Add PlayerBlockDestroySpeedEvent
|
||||||
|
+ // *Technically* it seems that all getDestroyProgress calls use a LevelAccessor, but anyway...
|
||||||
|
+ if (world instanceof LevelAccessor) {
|
||||||
|
+ net.sparklypower.sparklypaper.event.block.PlayerBlockDestroySpeedEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerBlockDestroySpeedEvent(player, (LevelAccessor) world, pos, f);
|
||||||
|
+ f = event.getDestroySpeed();
|
||||||
|
+ }
|
||||||
|
+ // SparklyPaper end
|
||||||
|
+
|
||||||
|
if (f == -1.0F) {
|
||||||
|
return 0.0F;
|
||||||
|
} else {
|
||||||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
|
index dfbe0914ab2771ac632fd064719878ac47559e9f..0cba343989d6d33026a8e94f2b58ca93571721a9 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
|
@@ -2196,4 +2196,13 @@ public class CraftEventFactory {
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
// Paper end - add EntityFertilizeEggEvent
|
||||||
|
+
|
||||||
|
+ // SparklyPaper start - add PlayerBlockDestroySpeedEvent
|
||||||
|
+ public static net.sparklypower.sparklypaper.event.block.PlayerBlockDestroySpeedEvent callPlayerBlockDestroySpeedEvent(net.minecraft.world.entity.player.Player player, LevelAccessor world, BlockPos blockPos, float destroySpeed) {
|
||||||
|
+ org.bukkit.block.Block block = CraftBlock.at(world, blockPos);
|
||||||
|
+ net.sparklypower.sparklypaper.event.block.PlayerBlockDestroySpeedEvent event = new net.sparklypower.sparklypaper.event.block.PlayerBlockDestroySpeedEvent((Player) player.getBukkitEntity(), block, destroySpeed);
|
||||||
|
+ event.callEvent();
|
||||||
|
+ return event;
|
||||||
|
+ }
|
||||||
|
+ // SparklyPaper end
|
||||||
|
}
|
||||||
@@ -1765,7 +1765,7 @@ index b7ff7af2513204b151340538d50a65c850bdb75f..45f9b2594e449926d7f00f64bf12fef2
|
|||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
index dfbe0914ab2771ac632fd064719878ac47559e9f..2f1d408bf19a55d8b4c874cca3c1f5a450cdf9b8 100644
|
index 0cba343989d6d33026a8e94f2b58ca93571721a9..779c235c1819a0ec5263c47ff217827d240acf0f 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||||
@@ -942,7 +942,7 @@ public class CraftEventFactory {
|
@@ -942,7 +942,7 @@ public class CraftEventFactory {
|
||||||
Reference in New Issue
Block a user