@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/gameevent/GameEventDispatcher.java
|
||||
+++ b/net/minecraft/world/level/gameevent/GameEventDispatcher.java
|
||||
@@ -11,6 +11,13 @@
|
||||
@@ -12,6 +12,13 @@
|
||||
import net.minecraft.world.level.chunk.Chunk;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
public class GameEventDispatcher {
|
||||
|
||||
private final WorldServer level;
|
||||
@@ -22,6 +29,14 @@
|
||||
public void post(GameEvent gameevent, Vec3D vec3d, GameEvent.a gameevent_a) {
|
||||
int i = gameevent.getNotificationRadius();
|
||||
@@ -23,6 +30,14 @@
|
||||
public void post(Holder<GameEvent> holder, Vec3D vec3d, GameEvent.a gameevent_a) {
|
||||
int i = ((GameEvent) holder.value()).notificationRadius();
|
||||
BlockPosition blockposition = BlockPosition.containing(vec3d);
|
||||
+ // CraftBukkit start
|
||||
+ GenericGameEvent event = new GenericGameEvent(CraftGameEvent.minecraftToBukkit(gameevent), CraftLocation.toBukkit(blockposition, level.getWorld()), (gameevent_a.sourceEntity() == null) ? null : gameevent_a.sourceEntity().getBukkitEntity(), i, !Bukkit.isPrimaryThread());
|
||||
+ GenericGameEvent event = new GenericGameEvent(CraftGameEvent.minecraftToBukkit(holder.value()), CraftLocation.toBukkit(blockposition, level.getWorld()), (gameevent_a.sourceEntity() == null) ? null : gameevent_a.sourceEntity().getBukkitEntity(), i, !Bukkit.isPrimaryThread());
|
||||
+ level.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled()) {
|
||||
+ return;
|
||||
|
||||
Reference in New Issue
Block a user