aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/gameevent/GameEventDispatcher.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/gameevent/GameEventDispatcher.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/gameevent/GameEventDispatcher.java.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/gameevent/GameEventDispatcher.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/gameevent/GameEventDispatcher.java.patch
new file mode 100644
index 0000000000..65e8eb295c
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/gameevent/GameEventDispatcher.java.patch
@@ -0,0 +1,48 @@
+--- a/net/minecraft/world/level/gameevent/GameEventDispatcher.java
++++ b/net/minecraft/world/level/gameevent/GameEventDispatcher.java
+@@ -10,6 +10,12 @@
+ import net.minecraft.server.level.ServerLevel;
+ import net.minecraft.world.level.chunk.LevelChunk;
+ import net.minecraft.world.phys.Vec3;
++// CraftBukkit start
++import org.bukkit.Bukkit;
++import org.bukkit.craftbukkit.CraftGameEvent;
++import org.bukkit.craftbukkit.util.CraftLocation;
++import org.bukkit.event.world.GenericGameEvent;
++// CraftBukkit end
+
+ public class GameEventDispatcher {
+
+@@ -19,15 +25,23 @@
+ this.level = serverlevel;
+ }
+
+- public void post(GameEvent gameevent, Vec3 vec3, GameEvent.Context gameevent_context) {
+- int i = gameevent.getNotificationRadius();
+- BlockPos blockpos = BlockPos.containing(vec3);
+- int j = SectionPos.blockToSectionCoord(blockpos.getX() - i);
+- int k = SectionPos.blockToSectionCoord(blockpos.getY() - i);
+- int l = SectionPos.blockToSectionCoord(blockpos.getZ() - i);
+- int i1 = SectionPos.blockToSectionCoord(blockpos.getX() + i);
+- int j1 = SectionPos.blockToSectionCoord(blockpos.getY() + i);
+- int k1 = SectionPos.blockToSectionCoord(blockpos.getZ() + i);
++ public void post(GameEvent event, Vec3 pos, GameEvent.Context context) {
++ int i = event.getNotificationRadius();
++ BlockPos blockposition = BlockPos.containing(pos);
++ // CraftBukkit start
++ GenericGameEvent event1 = new GenericGameEvent(CraftGameEvent.minecraftToBukkit(event), CraftLocation.toBukkit(blockposition, level.getWorld()), (context.sourceEntity() == null) ? null : context.sourceEntity().getBukkitEntity(), i, !Bukkit.isPrimaryThread());
++ level.getCraftServer().getPluginManager().callEvent(event1);
++ if (event1.isCancelled()) {
++ return;
++ }
++ i = event1.getRadius();
++ // CraftBukkit end
++ int j = SectionPos.blockToSectionCoord(blockposition.getX() - i);
++ int k = SectionPos.blockToSectionCoord(blockposition.getY() - i);
++ int l = SectionPos.blockToSectionCoord(blockposition.getZ() - i);
++ int i1 = SectionPos.blockToSectionCoord(blockposition.getX() + i);
++ int j1 = SectionPos.blockToSectionCoord(blockposition.getY() + i);
++ int k1 = SectionPos.blockToSectionCoord(blockposition.getZ() + i);
+ List<GameEvent.ListenerInfo> list = new ArrayList();
+ GameEventListenerRegistry.ListenerVisitor gameeventlistenerregistry_listenervisitor = (gameeventlistener, vec31) -> {
+ if (gameeventlistener.getDeliveryMode() == GameEventListener.DeliveryMode.BY_DISTANCE) {