From 536256d6fffe3a03087321f3ebdc3efa67e460b3 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 11 Jun 2021 21:33:49 +1000 Subject: [PATCH] SPIGOT-6508: Rename conflicted getServer By: md_5 --- .../commands/CommandDispatcher.patch | 2 +- .../commands/CommandListenerWrapper.patch | 2 +- .../core/dispenser/DispenseBehaviorBoat.patch | 2 +- .../core/dispenser/DispenseBehaviorItem.patch | 2 +- .../DispenseBehaviorProjectile.patch | 2 +- .../dispenser/DispenseBehaviorShears.patch | 2 +- .../DispenseBehaviorShulkerBox.patch | 2 +- .../core/dispenser/IDispenseBehavior.patch | 24 +++++----- .../server/AdvancementDataPlayer.patch | 2 +- .../server/commands/CommandTeleport.patch | 2 +- .../minecraft/server/level/EntityPlayer.patch | 24 +++++----- .../server/level/EntityTrackerEntry.patch | 2 +- .../server/level/PlayerChunkMap.patch | 2 +- .../server/level/PlayerInteractManager.patch | 2 +- .../minecraft/server/level/WorldServer.patch | 8 ++-- .../net/minecraft/world/entity/Entity.patch | 14 +++--- .../world/entity/EntityCreature.patch | 4 +- .../world/entity/EntityInsentient.patch | 10 ++-- .../minecraft/world/entity/EntityLiving.patch | 8 ++-- .../ai/behavior/BehaviorInteractDoor.patch | 4 +- .../entity/ai/behavior/BehaviorUtil.patch | 2 +- .../ai/goal/PathfinderGoalFollowOwner.patch | 2 +- .../ai/goal/PathfinderGoalRemoveBlock.patch | 2 +- .../world/entity/animal/EntityCat.patch | 2 +- .../world/entity/animal/EntitySheep.patch | 2 +- .../boss/enderdragon/EntityEnderCrystal.patch | 2 +- .../boss/enderdragon/EntityEnderDragon.patch | 2 +- .../phases/DragonControllerManager.patch | 2 +- .../entity/boss/wither/EntityWither.patch | 4 +- .../entity/decoration/EntityArmorStand.patch | 2 +- .../entity/decoration/EntityHanging.patch | 6 +-- .../world/entity/item/EntityItem.patch | 4 +- .../world/entity/item/EntityTNTPrimed.patch | 2 +- .../world/entity/monster/EntityCreeper.patch | 2 +- .../entity/monster/EntityPigZombie.patch | 2 +- .../world/entity/monster/EntityShulker.patch | 2 +- .../world/entity/monster/EntitySlime.patch | 2 +- .../world/entity/monster/EntityZombie.patch | 2 +- .../world/entity/player/EntityHuman.patch | 10 ++-- .../world/entity/projectile/EntityArrow.patch | 4 +- .../world/entity/projectile/EntityEgg.patch | 2 +- .../entity/projectile/EntityFishingHook.patch | 12 ++--- .../projectile/EntityLargeFireball.patch | 2 +- .../projectile/EntitySmallFireball.patch | 2 +- .../entity/projectile/EntityWitherSkull.patch | 2 +- .../world/entity/vehicle/EntityBoat.patch | 12 ++--- .../vehicle/EntityMinecartAbstract.patch | 16 +++---- .../minecraft/world/inventory/Container.patch | 2 +- .../inventory/ContainerEnchantTable.patch | 4 +- .../net/minecraft/world/item/ItemArmor.patch | 2 +- .../net/minecraft/world/item/ItemBlock.patch | 2 +- .../net/minecraft/world/item/ItemDye.patch | 2 +- .../minecraft/world/item/ItemFishingRod.patch | 2 +- .../minecraft/world/item/ItemHanging.patch | 2 +- .../net/minecraft/world/item/ItemLeash.patch | 2 +- .../minecraft/world/item/ItemMinecart.patch | 2 +- .../net/minecraft/world/level/Explosion.patch | 4 +- .../net/minecraft/world/level/World.patch | 30 ++++++------ .../level/block/BlockButtonAbstract.patch | 8 ++-- .../world/level/block/BlockCommand.patch | 2 +- .../level/block/BlockConcretePowder.patch | 2 +- .../world/level/block/BlockDoor.patch | 2 +- .../world/level/block/BlockDropper.patch | 2 +- .../world/level/block/BlockEnderPortal.patch | 2 +- .../world/level/block/BlockFenceGate.patch | 2 +- .../world/level/block/BlockFire.patch | 4 +- .../world/level/block/BlockFireAbstract.patch | 2 +- .../world/level/block/BlockLeaves.patch | 2 +- .../world/level/block/BlockLever.patch | 2 +- .../level/block/BlockMinecartDetector.patch | 2 +- .../world/level/block/BlockPortal.patch | 2 +- .../block/BlockPressurePlateAbstract.patch | 2 +- .../block/BlockPressurePlateBinary.patch | 2 +- .../block/BlockPressurePlateWeighted.patch | 2 +- .../world/level/block/BlockRedstoneOre.patch | 2 +- .../level/block/BlockRedstoneTorch.patch | 2 +- .../world/level/block/BlockRedstoneWire.patch | 2 +- .../world/level/block/BlockSoil.patch | 2 +- .../world/level/block/BlockSponge.patch | 2 +- .../world/level/block/BlockTrapdoor.patch | 2 +- .../world/level/block/BlockTripwire.patch | 2 +- .../world/level/block/BlockTripwireHook.patch | 2 +- .../world/level/block/BlockTurtleEgg.patch | 2 +- .../level/block/LayeredCauldronBlock.patch | 2 +- .../world/level/block/LightningRodBlock.patch | 2 +- .../world/level/block/SculkSensorBlock.patch | 4 +- .../block/entity/TileEntityBrewingStand.patch | 2 +- .../block/entity/TileEntityCampfire.patch | 2 +- .../block/entity/TileEntityFurnace.patch | 6 +-- .../level/block/entity/TileEntityHopper.patch | 4 +- .../level/block/piston/BlockPiston.patch | 4 +- .../minecraft/world/level/chunk/Chunk.patch | 4 +- .../level/material/FluidTypeFlowing.patch | 4 +- .../level/portal/PortalTravelAgent.patch | 2 +- .../craftbukkit/event/CraftEventFactory.java | 48 +++++++++---------- 95 files changed, 211 insertions(+), 211 deletions(-) diff --git a/paper-server/nms-patches/net/minecraft/commands/CommandDispatcher.patch b/paper-server/nms-patches/net/minecraft/commands/CommandDispatcher.patch index 0f62a9a3e6..0bbff55734 100644 --- a/paper-server/nms-patches/net/minecraft/commands/CommandDispatcher.patch +++ b/paper-server/nms-patches/net/minecraft/commands/CommandDispatcher.patch @@ -68,7 +68,7 @@ + } + + // Handle vanilla commands; -+ if (sender.getWorld().getServer().getCommandBlockOverride(args[0])) { ++ if (sender.getWorld().getCraftServer().getCommandBlockOverride(args[0])) { + args[0] = "minecraft:" + args[0]; + } + diff --git a/paper-server/nms-patches/net/minecraft/commands/CommandListenerWrapper.patch b/paper-server/nms-patches/net/minecraft/commands/CommandListenerWrapper.patch index f430b14102..061120e6ce 100644 --- a/paper-server/nms-patches/net/minecraft/commands/CommandListenerWrapper.patch +++ b/paper-server/nms-patches/net/minecraft/commands/CommandListenerWrapper.patch @@ -34,7 +34,7 @@ + // CraftBukkit start + public boolean hasPermission(int i, String bukkitPermission) { + // World is null when loading functions -+ return ((getWorld() == null || !getWorld().getServer().ignoreVanillaPermissions) && this.permissionLevel >= i) || getBukkitSender().hasPermission(bukkitPermission); ++ return ((getWorld() == null || !getWorld().getCraftServer().ignoreVanillaPermissions) && this.permissionLevel >= i) || getBukkitSender().hasPermission(bukkitPermission); + } + // CraftBukkit end + diff --git a/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorBoat.patch b/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorBoat.patch index 7376fe8ff7..9803fc11b8 100644 --- a/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorBoat.patch +++ b/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorBoat.patch @@ -25,7 +25,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(d0, d1 + d3, d2)); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { diff --git a/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorItem.patch b/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorItem.patch index b8fd895dc9..e71a36c402 100644 --- a/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorItem.patch +++ b/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorItem.patch @@ -46,7 +46,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), CraftVector.toBukkit(entityitem.getMot())); + if (!BlockDispenser.eventFired) { -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { diff --git a/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorProjectile.patch b/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorProjectile.patch index ad9d7c96c4..8658bd8498 100644 --- a/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorProjectile.patch +++ b/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorProjectile.patch @@ -27,7 +27,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) enumdirection.getAdjacentX(), (double) ((float) enumdirection.getAdjacentY() + 0.1F), (double) enumdirection.getAdjacentZ())); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { diff --git a/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShears.patch b/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShears.patch index d2b3420f37..953a248c70 100644 --- a/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShears.patch +++ b/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShears.patch @@ -23,7 +23,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { diff --git a/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.patch b/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.patch index b1cc565a58..649fc14eed 100644 --- a/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.patch +++ b/paper-server/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.patch @@ -22,7 +22,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); + if (!BlockDispenser.eventFired) { -+ isourceblock.getWorld().getServer().getPluginManager().callEvent(event); ++ isourceblock.getWorld().getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { diff --git a/paper-server/nms-patches/net/minecraft/core/dispenser/IDispenseBehavior.patch b/paper-server/nms-patches/net/minecraft/core/dispenser/IDispenseBehavior.patch index f4c623c7a6..a9ce975e68 100644 --- a/paper-server/nms-patches/net/minecraft/core/dispenser/IDispenseBehavior.patch +++ b/paper-server/nms-patches/net/minecraft/core/dispenser/IDispenseBehavior.patch @@ -78,7 +78,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { @@ -123,7 +123,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { @@ -165,7 +165,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(enumdirection.getAdjacentX(), enumdirection.getAdjacentY(), enumdirection.getAdjacentZ())); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { @@ -213,7 +213,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(d3, d4, d5)); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { @@ -258,7 +258,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(x, y, z)); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { @@ -315,7 +315,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { @@ -348,7 +348,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { @@ -393,7 +393,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { @@ -460,7 +460,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D)); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { @@ -500,7 +500,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { @@ -531,7 +531,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { @@ -562,7 +562,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { diff --git a/paper-server/nms-patches/net/minecraft/server/AdvancementDataPlayer.patch b/paper-server/nms-patches/net/minecraft/server/AdvancementDataPlayer.patch index c3b8bdfd66..45c0c1181b 100644 --- a/paper-server/nms-patches/net/minecraft/server/AdvancementDataPlayer.patch +++ b/paper-server/nms-patches/net/minecraft/server/AdvancementDataPlayer.patch @@ -17,7 +17,7 @@ this.progressChanged.add(advancement); flag = true; if (!flag1 && advancementprogress.isDone()) { -+ this.player.level.getServer().getPluginManager().callEvent(new org.bukkit.event.player.PlayerAdvancementDoneEvent(this.player.getBukkitEntity(), advancement.bukkit)); // CraftBukkit ++ this.player.level.getCraftServer().getPluginManager().callEvent(new org.bukkit.event.player.PlayerAdvancementDoneEvent(this.player.getBukkitEntity(), advancement.bukkit)); // CraftBukkit advancement.d().a(this.player); if (advancement.c() != null && advancement.c().i() && this.player.level.getGameRules().getBoolean(GameRules.RULE_ANNOUNCE_ADVANCEMENTS)) { this.playerList.sendMessage(new ChatMessage("chat.type.advancement." + advancement.c().e().a(), new Object[]{this.player.getScoreboardDisplayName(), advancement.j()}), ChatMessageType.SYSTEM, SystemUtils.NIL_UUID); diff --git a/paper-server/nms-patches/net/minecraft/server/commands/CommandTeleport.patch b/paper-server/nms-patches/net/minecraft/server/commands/CommandTeleport.patch index 950103f014..e70b31fbba 100644 --- a/paper-server/nms-patches/net/minecraft/server/commands/CommandTeleport.patch +++ b/paper-server/nms-patches/net/minecraft/server/commands/CommandTeleport.patch @@ -30,7 +30,7 @@ + // CraftBukkit start - Teleport event + Location to = new Location(worldserver.getWorld(), d0, d1, d2, f2, f4); + EntityTeleportEvent event = new EntityTeleportEvent(entity.getBukkitEntity(), entity.getBukkitEntity().getLocation(), to); -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return; + } diff --git a/paper-server/nms-patches/net/minecraft/server/level/EntityPlayer.patch b/paper-server/nms-patches/net/minecraft/server/level/EntityPlayer.patch index 7604396369..f95ef83183 100644 --- a/paper-server/nms-patches/net/minecraft/server/level/EntityPlayer.patch +++ b/paper-server/nms-patches/net/minecraft/server/level/EntityPlayer.patch @@ -183,7 +183,7 @@ + this.unsetRemoved(); + Vec3D position = null; + if (this.respawnDimension != null) { -+ world = this.getWorldServer().getServer().getHandle().getServer().getWorldServer(this.respawnDimension); ++ world = this.getWorldServer().getCraftServer().getHandle().getServer().getWorldServer(this.respawnDimension); + if (world != null && this.getSpawn() != null) { + position = EntityHuman.getBed((WorldServer) world, this.getSpawn(), this.getSpawnAngle(), false, false).orElse(null); + } @@ -246,7 +246,7 @@ + } + + if (this.oldLevel != this.experienceLevel) { -+ CraftEventFactory.callPlayerLevelChangeEvent(this.level.getServer().getPlayer((EntityPlayer) this), this.oldLevel, this.experienceLevel); ++ CraftEventFactory.callPlayerLevelChangeEvent(this.level.getCraftServer().getPlayer((EntityPlayer) this), this.oldLevel, this.experienceLevel); + this.oldLevel = this.experienceLevel; + } + // CraftBukkit end @@ -259,7 +259,7 @@ private void a(IScoreboardCriteria iscoreboardcriteria, int i) { - this.getScoreboard().getObjectivesForCriteria(iscoreboardcriteria, this.getName(), (scoreboardscore) -> { + // CraftBukkit - Use our scores instead -+ this.level.getServer().getScoreboardManager().getScoreboardScores(iscoreboardcriteria, this.getName(), (scoreboardscore) -> { ++ this.level.getCraftServer().getScoreboardManager().getScoreboardScores(iscoreboardcriteria, this.getName(), (scoreboardscore) -> { scoreboardscore.setScore(i); }); } @@ -331,7 +331,7 @@ + // CraftBukkit end + + // CraftBukkit - Get our scores instead -+ this.level.getServer().getScoreboardManager().getScoreboardScores(IScoreboardCriteria.DEATH_COUNT, this.getName(), ScoreboardScore::incrementScore); ++ this.level.getCraftServer().getScoreboardManager().getScoreboardScores(IScoreboardCriteria.DEATH_COUNT, this.getName(), ScoreboardScore::incrementScore); EntityLiving entityliving = this.getKillingEntity(); if (entityliving != null) { @@ -341,12 +341,12 @@ - this.getScoreboard().getObjectivesForCriteria(IScoreboardCriteria.KILL_COUNT_ALL, s, ScoreboardScore::incrementScore); + // CraftBukkit - Get our scores instead -+ this.level.getServer().getScoreboardManager().getScoreboardScores(IScoreboardCriteria.KILL_COUNT_ALL, s, ScoreboardScore::incrementScore); ++ this.level.getCraftServer().getScoreboardManager().getScoreboardScores(IScoreboardCriteria.KILL_COUNT_ALL, s, ScoreboardScore::incrementScore); if (entity instanceof EntityHuman) { this.a(StatisticList.PLAYER_KILLS); - this.getScoreboard().getObjectivesForCriteria(IScoreboardCriteria.KILL_COUNT_PLAYERS, s, ScoreboardScore::incrementScore); + // CraftBukkit - Get our scores instead -+ this.level.getServer().getScoreboardManager().getScoreboardScores(IScoreboardCriteria.KILL_COUNT_PLAYERS, s, ScoreboardScore::incrementScore); ++ this.level.getCraftServer().getScoreboardManager().getScoreboardScores(IScoreboardCriteria.KILL_COUNT_PLAYERS, s, ScoreboardScore::incrementScore); } else { this.a(StatisticList.MOB_KILLS); } @@ -356,7 +356,7 @@ if (i >= 0 && i < aiscoreboardcriteria.length) { - this.getScoreboard().getObjectivesForCriteria(aiscoreboardcriteria[i], s, ScoreboardScore::incrementScore); + // CraftBukkit - Get our scores instead -+ this.level.getServer().getScoreboardManager().getScoreboardScores(aiscoreboardcriteria[i], s, ScoreboardScore::incrementScore); ++ this.level.getCraftServer().getScoreboardManager().getScoreboardScores(aiscoreboardcriteria[i], s, ScoreboardScore::incrementScore); } } @@ -483,7 +483,7 @@ + + // CraftBukkit start + PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld()); -+ this.level.getServer().getPluginManager().callEvent(changeEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(changeEvent); + // CraftBukkit end } @@ -635,7 +635,7 @@ + } + + PlayerBedLeaveEvent event = new PlayerBedLeaveEvent(player, bed, true); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return; + } @@ -733,7 +733,7 @@ public void a(Statistic statistic, int i) { this.stats.b(this, statistic, i); - this.getScoreboard().getObjectivesForCriteria(statistic, this.getName(), (scoreboardscore) -> { -+ this.level.getServer().getScoreboardManager().getScoreboardScores(statistic, this.getName(), (scoreboardscore) -> { // CraftBukkit - Get our scores instead ++ this.level.getCraftServer().getScoreboardManager().getScoreboardScores(statistic, this.getName(), (scoreboardscore) -> { // CraftBukkit - Get our scores instead scoreboardscore.addScore(i); }); } @@ -742,7 +742,7 @@ public void a(Statistic statistic) { this.stats.setStatistic(this, statistic, 0); - this.getScoreboard().getObjectivesForCriteria(statistic, this.getName(), ScoreboardScore::c); -+ this.level.getServer().getScoreboardManager().getScoreboardScores(statistic, this.getName(), ScoreboardScore::c); // CraftBukkit - Get our scores instead ++ this.level.getCraftServer().getScoreboardManager().getScoreboardScores(statistic, this.getName(), ScoreboardScore::c); // CraftBukkit - Get our scores instead } @Override @@ -792,7 +792,7 @@ } else { + // CraftBukkit start + PlayerGameModeChangeEvent event = new PlayerGameModeChangeEvent(getBukkitEntity(), GameMode.getByValue(enumgamemode.getId())); -+ level.getServer().getPluginManager().callEvent(event); ++ level.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return false; + } diff --git a/paper-server/nms-patches/net/minecraft/server/level/EntityTrackerEntry.patch b/paper-server/nms-patches/net/minecraft/server/level/EntityTrackerEntry.patch index 27520b40a7..9685ed04f5 100644 --- a/paper-server/nms-patches/net/minecraft/server/level/EntityTrackerEntry.patch +++ b/paper-server/nms-patches/net/minecraft/server/level/EntityTrackerEntry.patch @@ -102,7 +102,7 @@ + org.bukkit.util.Vector velocity = player.getVelocity(); + + PlayerVelocityEvent event = new PlayerVelocityEvent(player, velocity.clone()); -+ this.entity.level.getServer().getPluginManager().callEvent(event); ++ this.entity.level.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + cancelled = true; diff --git a/paper-server/nms-patches/net/minecraft/server/level/PlayerChunkMap.patch b/paper-server/nms-patches/net/minecraft/server/level/PlayerChunkMap.patch index d2229d45d8..95b7b21c21 100644 --- a/paper-server/nms-patches/net/minecraft/server/level/PlayerChunkMap.patch +++ b/paper-server/nms-patches/net/minecraft/server/level/PlayerChunkMap.patch @@ -86,7 +86,7 @@ + // CraftBukkit start - these are spawned serialized (DefinedStructure) and we don't call an add event below at the moment due to ordering complexities + worldserver.b(EntityTypes.a(list, (World) worldserver).filter((entity) -> { + boolean needsRemoval = false; -+ net.minecraft.server.dedicated.DedicatedServer server = worldserver.getServer().getServer(); ++ net.minecraft.server.dedicated.DedicatedServer server = worldserver.getCraftServer().getServer(); + if (!server.getSpawnNPCs() && entity instanceof net.minecraft.world.entity.npc.NPC) { + entity.die(); + needsRemoval = true; diff --git a/paper-server/nms-patches/net/minecraft/server/level/PlayerInteractManager.patch b/paper-server/nms-patches/net/minecraft/server/level/PlayerInteractManager.patch index c1b39170d9..fe23e212ae 100644 --- a/paper-server/nms-patches/net/minecraft/server/level/PlayerInteractManager.patch +++ b/paper-server/nms-patches/net/minecraft/server/level/PlayerInteractManager.patch @@ -173,7 +173,7 @@ + } - if (!this.player.getItemInMainHand().getItem().a(iblockdata, (World) this.level, blockposition, (EntityHuman) this.player)) { -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + if (isSwordNoBreak) { diff --git a/paper-server/nms-patches/net/minecraft/server/level/WorldServer.patch b/paper-server/nms-patches/net/minecraft/server/level/WorldServer.patch index 20ee793dbd..df2e0b2c27 100644 --- a/paper-server/nms-patches/net/minecraft/server/level/WorldServer.patch +++ b/paper-server/nms-patches/net/minecraft/server/level/WorldServer.patch @@ -107,7 +107,7 @@ } this.sleepStatus = new SleepStatus(); -+ this.getServer().addWorld(this.getWorld()); // CraftBukkit ++ this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit + } + + // CraftBukkit start @@ -130,7 +130,7 @@ + } + + private TileEntity fixTileEntity(BlockPosition pos, IBlockData type, TileEntity found) { -+ this.getServer().getLogger().log(Level.SEVERE, "Block at {0}, {1}, {2} is {3} but has {4}" + ". " ++ this.getCraftServer().getLogger().log(Level.SEVERE, "Block at {0}, {1}, {2} is {3} but has {4}" + ". " + + "Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.", new Object[]{pos.getX(), pos.getY(), pos.getZ(), type, found}); + + if (type instanceof ITileEntity) { @@ -188,7 +188,7 @@ + TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (l - l % 24000L) - this.getDayTime()); if (this.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) { - long l = this.levelData.getDayTime() + 24000L; -+ getServer().getPluginManager().callEvent(event); ++ getCraftServer().getPluginManager().callEvent(event); + if (!event.isCancelled()) { + this.setDayTime(this.getDayTime() + event.getSkipAmount()); + } @@ -632,7 +632,7 @@ + org.bukkit.World bworld = worldserver.getWorld(); + org.bukkit.event.world.PortalCreateEvent portalEvent = new org.bukkit.event.world.PortalCreateEvent((List) (List) blockList.getList(), bworld, (entity == null) ? null : entity.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM); + -+ worldserver.getServer().getPluginManager().callEvent(portalEvent); ++ worldserver.getCraftServer().getPluginManager().callEvent(portalEvent); + if (!portalEvent.isCancelled()) { + blockList.updateList(); + } diff --git a/paper-server/nms-patches/net/minecraft/world/entity/Entity.patch b/paper-server/nms-patches/net/minecraft/world/entity/Entity.patch index 00dcae2363..daed97996d 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/Entity.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/Entity.patch @@ -45,7 +45,7 @@ + + public CraftEntity getBukkitEntity() { + if (bukkitEntity == null) { -+ bukkitEntity = CraftEntity.getEntity(level.getServer(), this); ++ bukkitEntity = CraftEntity.getEntity(level.getCraftServer(), this); + } + return bukkitEntity; + } @@ -89,7 +89,7 @@ + if (entitypose == this.getPose()) { + return; + } -+ this.level.getServer().getPluginManager().callEvent(new EntityPoseChangeEvent(this.getBukkitEntity(), Pose.values()[entitypose.ordinal()])); ++ this.level.getCraftServer().getPluginManager().callEvent(new EntityPoseChangeEvent(this.getBukkitEntity(), Pose.values()[entitypose.ordinal()])); + // CraftBukkit end this.entityData.set(Entity.DATA_POSE, entitypose); } @@ -105,7 +105,7 @@ + + if (f == Float.POSITIVE_INFINITY || f == Float.NEGATIVE_INFINITY) { + if (this instanceof EntityPlayer) { -+ this.level.getServer().getLogger().warning(this.getName() + " was caught trying to crash the server with an invalid yaw"); ++ this.level.getCraftServer().getLogger().warning(this.getName() + " was caught trying to crash the server with an invalid yaw"); + ((CraftPlayer) this.getBukkitEntity()).kickPlayer("Infinite yaw (Hacking?)"); + } + f = 0; @@ -118,7 +118,7 @@ + + if (f1 == Float.POSITIVE_INFINITY || f1 == Float.NEGATIVE_INFINITY) { + if (this instanceof EntityPlayer) { -+ this.level.getServer().getLogger().warning(this.getName() + " was caught trying to crash the server with an invalid pitch"); ++ this.level.getCraftServer().getLogger().warning(this.getName() + " was caught trying to crash the server with an invalid pitch"); + ((CraftPlayer) this.getBukkitEntity()).kickPlayer("Infinite pitch (Hacking?)"); + } + f1 = 0; @@ -165,7 +165,7 @@ + org.bukkit.block.Block damager = null; // ((WorldServer) this.l).getWorld().getBlockAt(i, j, k); + org.bukkit.entity.Entity damagee = this.getBukkitEntity(); + EntityCombustEvent combustEvent = new org.bukkit.event.entity.EntityCombustByBlockEvent(damager, damagee, 15); -+ this.level.getServer().getPluginManager().callEvent(combustEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(combustEvent); + + if (!combustEvent.isCancelled()) { + this.setOnFire(combustEvent.getDuration(), false); @@ -189,7 +189,7 @@ + public void setOnFire(int i, boolean callEvent) { + if (callEvent) { + EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), i); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return; @@ -222,7 +222,7 @@ + + if (!bl.getType().isAir()) { + VehicleBlockCollisionEvent event = new VehicleBlockCollisionEvent(vehicle, bl); -+ level.getServer().getPluginManager().callEvent(event); ++ level.getCraftServer().getPluginManager().callEvent(event); + } + } + // CraftBukkit end diff --git a/paper-server/nms-patches/net/minecraft/world/entity/EntityCreature.patch b/paper-server/nms-patches/net/minecraft/world/entity/EntityCreature.patch index a9cd9147d6..277b257a92 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/EntityCreature.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/EntityCreature.patch @@ -15,7 +15,7 @@ if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) { if (f > 10.0F) { -+ this.level.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit ++ this.level.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit this.unleash(true, true); } @@ -23,7 +23,7 @@ this.y(f); if (f > 10.0F) { -+ this.level.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit ++ this.level.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit this.unleash(true, true); this.goalSelector.a(PathfinderGoal.Type.MOVE); } else if (f > 6.0F) { diff --git a/paper-server/nms-patches/net/minecraft/world/entity/EntityInsentient.patch b/paper-server/nms-patches/net/minecraft/world/entity/EntityInsentient.patch index cf57e96acd..f1be01090a 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/EntityInsentient.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/EntityInsentient.patch @@ -54,14 +54,14 @@ + reason = getGoalTarget().isAlive() ? EntityTargetEvent.TargetReason.FORGOT_TARGET : EntityTargetEvent.TargetReason.TARGET_DIED; + } + if (reason == EntityTargetEvent.TargetReason.UNKNOWN) { -+ level.getServer().getLogger().log(java.util.logging.Level.WARNING, "Unknown target reason, please report on the issue tracker", new Exception()); ++ level.getCraftServer().getLogger().log(java.util.logging.Level.WARNING, "Unknown target reason, please report on the issue tracker", new Exception()); + } + CraftLivingEntity ctarget = null; + if (entityliving != null) { + ctarget = (CraftLivingEntity) entityliving.getBukkitEntity(); + } + EntityTargetLivingEntityEvent event = new EntityTargetLivingEntityEvent(this.getBukkitEntity(), ctarget, reason); -+ level.getServer().getPluginManager().callEvent(event); ++ level.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return false; + } @@ -263,7 +263,7 @@ if (this.leashHolder != null) { if (!this.isAlive() || !this.leashHolder.isAlive()) { -+ this.level.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), (!this.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE)); // CraftBukkit ++ this.level.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), (!this.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE)); // CraftBukkit this.unleash(true, true); } @@ -281,7 +281,7 @@ boolean flag1 = super.a(entity, flag); if (flag1 && this.isLeashed()) { -+ this.level.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit ++ this.level.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit this.unleash(true, true); } @@ -305,7 +305,7 @@ @Override protected void cc() { super.cc(); -+ this.level.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit ++ this.level.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit this.unleash(true, false); this.by().forEach((itemstack) -> { - itemstack.setCount(0); diff --git a/paper-server/nms-patches/net/minecraft/world/entity/EntityLiving.patch b/paper-server/nms-patches/net/minecraft/world/entity/EntityLiving.patch index 8362a4deed..0f30a3173b 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/EntityLiving.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/EntityLiving.patch @@ -325,7 +325,7 @@ + EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), f, regainReason); + // Suppress during worldgen + if (this.valid) { -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + } + + if (!event.isCancelled()) { @@ -464,7 +464,7 @@ - if (this instanceof EntityPlayer) { + EntityResurrectEvent event = new EntityResurrectEvent((LivingEntity) this.getBukkitEntity()); + event.setCancelled(itemstack == null); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + if (!itemstack1.isEmpty()) { @@ -856,7 +856,7 @@ + if (this instanceof EntityPlayer) { + org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.useItem); + PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem); -+ level.getServer().getPluginManager().callEvent(event); ++ level.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + // Update client @@ -905,7 +905,7 @@ + if (flag1) { + if (!(this instanceof EntityPlayer)) { + EntityTeleportEvent teleport = new EntityTeleportEvent(this.getBukkitEntity(), new Location(this.level.getWorld(), d3, d4, d5), new Location(this.level.getWorld(), d0, d6, d2)); -+ this.level.getServer().getPluginManager().callEvent(teleport); ++ this.level.getCraftServer().getPluginManager().callEvent(teleport); + if (!teleport.isCancelled()) { + Location to = teleport.getTo(); + this.enderTeleportTo(to.getX(), to.getY(), to.getZ()); diff --git a/paper-server/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorInteractDoor.patch b/paper-server/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorInteractDoor.patch index e59bb6bf1a..8e2915b1ee 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorInteractDoor.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorInteractDoor.patch @@ -6,7 +6,7 @@ if (!blockdoor.h(iblockdata)) { + // CraftBukkit start - entities opening doors + org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(entityliving.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(entityliving.level, blockposition)); -+ entityliving.level.getServer().getPluginManager().callEvent(event); ++ entityliving.level.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return; + } @@ -20,7 +20,7 @@ if (!blockdoor1.h(iblockdata1)) { + // CraftBukkit start - entities opening doors + org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(entityliving.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(entityliving.level, blockposition)); -+ entityliving.level.getServer().getPluginManager().callEvent(event); ++ entityliving.level.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return; + } diff --git a/paper-server/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorUtil.patch b/paper-server/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorUtil.patch index 8b9c9cd8e0..c303647806 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorUtil.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorUtil.patch @@ -39,7 +39,7 @@ entityitem.defaultPickupDelay(); + // CraftBukkit start + org.bukkit.event.entity.EntityDropItemEvent event = new org.bukkit.event.entity.EntityDropItemEvent(entityliving.getBukkitEntity(), (org.bukkit.entity.Item) entityitem.getBukkitEntity()); -+ entityitem.level.getServer().getPluginManager().callEvent(event); ++ entityitem.level.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return; + } diff --git a/paper-server/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.patch b/paper-server/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.patch index 0502515836..76cc491334 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.patch @@ -22,7 +22,7 @@ + CraftEntity entity = this.tamable.getBukkitEntity(); + Location to = new Location(entity.getWorld(), (double) i + 0.5D, (double) j, (double) k + 0.5D, this.tamable.getYRot(), this.tamable.getXRot()); + EntityTeleportEvent event = new EntityTeleportEvent(entity, entity.getLocation(), to); -+ this.tamable.level.getServer().getPluginManager().callEvent(event); ++ this.tamable.level.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return false; + } diff --git a/paper-server/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.patch b/paper-server/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.patch index 1e0d76012a..a4c3237d34 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.patch @@ -18,7 +18,7 @@ if (this.ticksSinceReachedGoal > 60) { + // CraftBukkit start - Step on eggs + EntityInteractEvent event = new EntityInteractEvent(this.removerMob.getBukkitEntity(), CraftBlock.at(world, blockposition1)); -+ world.getServer().getPluginManager().callEvent((EntityInteractEvent) event); ++ world.getCraftServer().getPluginManager().callEvent((EntityInteractEvent) event); + + if (event.isCancelled()) { + return; diff --git a/paper-server/nms-patches/net/minecraft/world/entity/animal/EntityCat.patch b/paper-server/nms-patches/net/minecraft/world/entity/animal/EntityCat.patch index fb67bcb198..10907ebef7 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/animal/EntityCat.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/animal/EntityCat.patch @@ -35,7 +35,7 @@ + // CraftBukkit start + EntityItem entityitem = new EntityItem(this.cat.level, (double) blockposition_mutableblockposition.getX() - (double) MathHelper.sin(this.cat.yBodyRot * 0.017453292F), (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + (double) MathHelper.cos(this.cat.yBodyRot * 0.017453292F), itemstack); + org.bukkit.event.entity.EntityDropItemEvent event = new org.bukkit.event.entity.EntityDropItemEvent(this.cat.getBukkitEntity(), (org.bukkit.entity.Item) entityitem.getBukkitEntity()); -+ entityitem.level.getServer().getPluginManager().callEvent(event); ++ entityitem.level.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + continue; + } diff --git a/paper-server/nms-patches/net/minecraft/world/entity/animal/EntitySheep.patch b/paper-server/nms-patches/net/minecraft/world/entity/animal/EntitySheep.patch index e16295296c..0de3ebfb5c 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/animal/EntitySheep.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/animal/EntitySheep.patch @@ -49,7 +49,7 @@ public void blockEaten() { + // CraftBukkit start + SheepRegrowWoolEvent event = new SheepRegrowWoolEvent((org.bukkit.entity.Sheep) this.getBukkitEntity()); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) return; + // CraftBukkit end diff --git a/paper-server/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.patch b/paper-server/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.patch index 122873c4be..c2a4098cd9 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.patch @@ -39,7 +39,7 @@ - this.level.explode((Entity) null, this.locX(), this.locY(), this.locZ(), 6.0F, Explosion.Effect.DESTROY); + // CraftBukkit start + ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 6.0F, false); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + this.unsetRemoved(); + return false; diff --git a/paper-server/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.patch b/paper-server/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.patch index cebdb294ad..0cae384613 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.patch @@ -43,7 +43,7 @@ - this.setHealth(this.getHealth() + 1.0F); + // CraftBukkit start + EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), 1.0F, EntityRegainHealthEvent.RegainReason.ENDER_CRYSTAL); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + this.setHealth((float) (this.getHealth() + event.getAmount())); diff --git a/paper-server/nms-patches/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.patch b/paper-server/nms-patches/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.patch index 6a7ed61186..199384d14e 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.patch @@ -22,7 +22,7 @@ + (this.currentPhase == null) ? null : CraftEnderDragon.getBukkitPhase(this.currentPhase.getControllerPhase()), + CraftEnderDragon.getBukkitPhase(dragoncontrollerphase) + ); -+ this.dragon.level.getServer().getPluginManager().callEvent(event); ++ this.dragon.level.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return; + } diff --git a/paper-server/nms-patches/net/minecraft/world/entity/boss/wither/EntityWither.patch b/paper-server/nms-patches/net/minecraft/world/entity/boss/wither/EntityWither.patch index 686e365d92..b4d16f87fa 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/boss/wither/EntityWither.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/boss/wither/EntityWither.patch @@ -25,7 +25,7 @@ + // CraftBukkit start + // this.world.createExplosion(this, this.locX(), this.getHeadY(), this.locZ(), 7.0F, false, explosion_effect); + ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 7.0F, false); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + this.level.createExplosion(this, this.locX(), this.getHeadY(), this.locZ(), event.getRadius(), event.getFire(), explosion_effect); @@ -37,7 +37,7 @@ - this.level.b(1023, this.getChunkCoordinates(), 0); + // CraftBukkit start - Use relative location for far away sounds + // this.world.b(1023, new BlockPosition(this), 0); -+ int viewDistance = ((WorldServer) this.level).getServer().getViewDistance() * 16; ++ int viewDistance = ((WorldServer) this.level).getCraftServer().getViewDistance() * 16; + for (EntityPlayer player : (List) MinecraftServer.getServer().getPlayerList().players) { + double deltaX = this.locX() - player.locX(); + double deltaZ = this.locZ() - player.locZ(); diff --git a/paper-server/nms-patches/net/minecraft/world/entity/decoration/EntityArmorStand.patch b/paper-server/nms-patches/net/minecraft/world/entity/decoration/EntityArmorStand.patch index df030058ea..872c6f828a 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/decoration/EntityArmorStand.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/decoration/EntityArmorStand.patch @@ -67,7 +67,7 @@ + + EquipmentSlot slot = CraftEquipmentSlot.getSlot(enumitemslot); + PlayerArmorStandManipulateEvent armorStandManipulateEvent = new PlayerArmorStandManipulateEvent(player,self,playerHeldItem,armorStandItem,slot); -+ this.level.getServer().getPluginManager().callEvent(armorStandManipulateEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(armorStandManipulateEvent); + + if (armorStandManipulateEvent.isCancelled()) { + return true; diff --git a/paper-server/nms-patches/net/minecraft/world/entity/decoration/EntityHanging.patch b/paper-server/nms-patches/net/minecraft/world/entity/decoration/EntityHanging.patch index 19ec28608e..54dae2d9ad 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/decoration/EntityHanging.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/decoration/EntityHanging.patch @@ -97,7 +97,7 @@ + } + + HangingBreakEvent event = new HangingBreakEvent((Hanging) this.getBukkitEntity(), cause); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (this.isRemoved() || event.isCancelled()) { + return; @@ -119,7 +119,7 @@ + event = new HangingBreakEvent((Hanging) this.getBukkitEntity(), damagesource.isExplosion() ? HangingBreakEvent.RemoveCause.EXPLOSION : HangingBreakEvent.RemoveCause.DEFAULT); + } + -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (this.isRemoved() || event.isCancelled()) { + return true; @@ -138,7 +138,7 @@ + // CraftBukkit start - fire break events + // TODO - Does this need its own cause? Seems to only be triggered by pistons + HangingBreakEvent event = new HangingBreakEvent((Hanging) this.getBukkitEntity(), HangingBreakEvent.RemoveCause.PHYSICS); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (this.isRemoved() || event.isCancelled()) { + return; diff --git a/paper-server/nms-patches/net/minecraft/world/entity/item/EntityItem.patch b/paper-server/nms-patches/net/minecraft/world/entity/item/EntityItem.patch index a2c5db7061..c08ed4d058 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/item/EntityItem.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/item/EntityItem.patch @@ -100,7 +100,7 @@ + // Call legacy event + PlayerPickupItemEvent playerEvent = new PlayerPickupItemEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining); + playerEvent.setCancelled(!playerEvent.getPlayer().getCanPickupItems()); -+ this.level.getServer().getPluginManager().callEvent(playerEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(playerEvent); + if (playerEvent.isCancelled()) { + itemstack.setCount(i); // SPIGOT-5294 - restore count + return; @@ -109,7 +109,7 @@ + // Call newer event afterwards + EntityPickupItemEvent entityEvent = new EntityPickupItemEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining); + entityEvent.setCancelled(!entityEvent.getEntity().getCanPickupItems()); -+ this.level.getServer().getPluginManager().callEvent(entityEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(entityEvent); + if (entityEvent.isCancelled()) { + itemstack.setCount(i); // SPIGOT-5294 - restore count + return; diff --git a/paper-server/nms-patches/net/minecraft/world/entity/item/EntityTNTPrimed.patch b/paper-server/nms-patches/net/minecraft/world/entity/item/EntityTNTPrimed.patch index 470492d4da..2abacbb6ce 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/item/EntityTNTPrimed.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/item/EntityTNTPrimed.patch @@ -42,7 +42,7 @@ - this.level.explode(this, this.locX(), this.e(0.0625D), this.locZ(), 4.0F, Explosion.Effect.BREAK); + ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity()); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + this.level.createExplosion(this, this.locX(), this.e(0.0625D), this.locZ(), event.getRadius(), event.getFire(), Explosion.Effect.BREAK); diff --git a/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityCreeper.patch b/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityCreeper.patch index 1e0d83f609..450df87b48 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityCreeper.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityCreeper.patch @@ -44,7 +44,7 @@ - this.createEffectCloud(); + // CraftBukkit start + ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), this.explosionRadius * f, false); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + if (!event.isCancelled()) { + this.dead = true; + this.level.createExplosion(this, this.locX(), this.locY(), this.locZ(), event.getRadius(), event.getFire(), explosion_effect); diff --git a/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityPigZombie.patch b/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityPigZombie.patch index 740250679f..0957d3bccd 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityPigZombie.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityPigZombie.patch @@ -41,7 +41,7 @@ + // CraftBukkit start + Entity entity = ((WorldServer) this.level).getEntity(getAngerTarget()); + org.bukkit.event.entity.PigZombieAngerEvent event = new org.bukkit.event.entity.PigZombieAngerEvent((org.bukkit.entity.PigZombie) this.getBukkitEntity(), (entity == null) ? null : entity.getBukkitEntity(), EntityPigZombie.PERSISTENT_ANGER_TIME.a(this.random)); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + this.setAngerTarget(null); + return; diff --git a/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityShulker.patch b/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityShulker.patch index fe762bbcf9..b0961e633d 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityShulker.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityShulker.patch @@ -28,7 +28,7 @@ if (enumdirection != null) { + // CraftBukkit start + EntityTeleportEvent teleport = new EntityTeleportEvent(this.getBukkitEntity(), this.getBukkitEntity().getLocation(), new Location(this.level.getWorld(), blockposition1.getX(), blockposition1.getY(), blockposition1.getZ())); -+ this.level.getServer().getPluginManager().callEvent(teleport); ++ this.level.getCraftServer().getPluginManager().callEvent(teleport); + if (!teleport.isCancelled()) { + Location to = teleport.getTo(); + blockposition1 = new BlockPosition(to.getX(), to.getY(), to.getZ()); diff --git a/paper-server/nms-patches/net/minecraft/world/entity/monster/EntitySlime.patch b/paper-server/nms-patches/net/minecraft/world/entity/monster/EntitySlime.patch index fcce696b94..9430244cda 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/monster/EntitySlime.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/monster/EntitySlime.patch @@ -30,7 +30,7 @@ + // CraftBukkit start + SlimeSplitEvent event = new SlimeSplitEvent((org.bukkit.entity.Slime) this.getBukkitEntity(), k); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (!event.isCancelled() && event.getCount() > 0) { + k = event.getCount(); diff --git a/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityZombie.patch b/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityZombie.patch index b83c24f9e4..81890ff8e1 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityZombie.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/monster/EntityZombie.patch @@ -88,7 +88,7 @@ - entity.setOnFire(2 * (int) f); + // CraftBukkit start + EntityCombustByEntityEvent event = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 2 * (int) f); // PAIL: fixme -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + entity.setOnFire(event.getDuration(), false); diff --git a/paper-server/nms-patches/net/minecraft/world/entity/player/EntityHuman.patch b/paper-server/nms-patches/net/minecraft/world/entity/player/EntityHuman.patch index 3c8b1c4241..9d0c56f598 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/player/EntityHuman.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/player/EntityHuman.patch @@ -97,7 +97,7 @@ + Item drop = (Item) entityitem.getBukkitEntity(); + + PlayerDropItemEvent event = new PlayerDropItemEvent(player, drop); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + org.bukkit.inventory.ItemStack cur = player.getInventory().getItemInHand(); @@ -171,8 +171,8 @@ + } + } else { + // This should never be called, but is implemented anyway -+ org.bukkit.OfflinePlayer thisPlayer = entityhuman.level.getServer().getOfflinePlayer(entityhuman.getName()); -+ team = entityhuman.level.getServer().getScoreboardManager().getMainScoreboard().getPlayerTeam(thisPlayer); ++ org.bukkit.OfflinePlayer thisPlayer = entityhuman.level.getCraftServer().getOfflinePlayer(entityhuman.getName()); ++ team = entityhuman.level.getCraftServer().getScoreboardManager().getMainScoreboard().getPlayerTeam(thisPlayer); + if (team == null || team.allowFriendlyFire()) { + return true; + } @@ -182,7 +182,7 @@ + if (this instanceof EntityPlayer) { + return !team.hasPlayer(((EntityPlayer) this).getBukkitEntity()); + } -+ return !team.hasPlayer(this.level.getServer().getOfflinePlayer(this.getName())); ++ return !team.hasPlayer(this.level.getCraftServer().getOfflinePlayer(this.getName())); + // CraftBukkit end } @@ -269,7 +269,7 @@ + org.bukkit.util.Vector velocity = CraftVector.toBukkit(vec3d); + + PlayerVelocityEvent event = new PlayerVelocityEvent(player, velocity.clone()); -+ level.getServer().getPluginManager().callEvent(event); ++ level.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + cancelled = true; diff --git a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityArrow.patch b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityArrow.patch index c43cf0ff0d..03401f5b46 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityArrow.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityArrow.patch @@ -46,9 +46,9 @@ + ItemStack itemstack = this.getItemStack(); + if (this.pickup == PickupStatus.ALLOWED && !itemstack.isEmpty() && entityhuman.getInventory().canHold(itemstack) > 0) { + EntityItem item = new EntityItem(this.level, this.locX(), this.locY(), this.locZ(), itemstack); -+ PlayerPickupArrowEvent event = new PlayerPickupArrowEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), new org.bukkit.craftbukkit.entity.CraftItem(this.level.getServer(), this, item), (org.bukkit.entity.AbstractArrow) this.getBukkitEntity()); ++ PlayerPickupArrowEvent event = new PlayerPickupArrowEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), new org.bukkit.craftbukkit.entity.CraftItem(this.level.getCraftServer(), this, item), (org.bukkit.entity.AbstractArrow) this.getBukkitEntity()); + // event.setCancelled(!entityhuman.canPickUpLoot); TODO -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return; diff --git a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityEgg.patch b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityEgg.patch index 6c25e6bc65..2a6ea1b96f 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityEgg.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityEgg.patch @@ -40,7 +40,7 @@ + Entity shooter = this.getShooter(); + if (shooter instanceof EntityPlayer) { + PlayerEggThrowEvent event = new PlayerEggThrowEvent((Player) shooter.getBukkitEntity(), (org.bukkit.entity.Egg) this.getBukkitEntity(), hatching, b0, hatchingType); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + b0 = event.getNumHatches(); + hatching = event.isHatching(); diff --git a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityFishingHook.patch b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityFishingHook.patch index 94e5aad4ad..7323abaef8 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityFishingHook.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityFishingHook.patch @@ -41,7 +41,7 @@ this.getDataWatcher().set(EntityFishingHook.DATA_BITING, false); + // CraftBukkit start + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.getOwner().getBukkitEntity(), null, (FishHook) this.getBukkitEntity(), PlayerFishEvent.State.FAILED_ATTEMPT); -+ this.level.getServer().getPluginManager().callEvent(playerFishEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(playerFishEvent); + // CraftBukkit end } } else { @@ -52,7 +52,7 @@ } else { + // CraftBukkit start + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.getOwner().getBukkitEntity(), null, (FishHook) this.getBukkitEntity(), PlayerFishEvent.State.BITE); -+ this.level.getServer().getPluginManager().callEvent(playerFishEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(playerFishEvent); + if (playerFishEvent.isCancelled()) { + return; + } @@ -79,7 +79,7 @@ if (this.hookedIn != null) { + // CraftBukkit start + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) entityhuman.getBukkitEntity(), this.hookedIn.getBukkitEntity(), (FishHook) this.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_ENTITY); -+ this.level.getServer().getPluginManager().callEvent(playerFishEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(playerFishEvent); + + if (playerFishEvent.isCancelled()) { + return 0; @@ -95,7 +95,7 @@ + // CraftBukkit start + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) entityhuman.getBukkitEntity(), entityitem.getBukkitEntity(), (FishHook) this.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_FISH); + playerFishEvent.setExpToDrop(this.random.nextInt(6) + 1); -+ this.level.getServer().getPluginManager().callEvent(playerFishEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(playerFishEvent); + + if (playerFishEvent.isCancelled()) { + return 0; @@ -123,7 +123,7 @@ if (this.onGround) { + // CraftBukkit start + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) entityhuman.getBukkitEntity(), null, (FishHook) this.getBukkitEntity(), PlayerFishEvent.State.IN_GROUND); -+ this.level.getServer().getPluginManager().callEvent(playerFishEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(playerFishEvent); + + if (playerFishEvent.isCancelled()) { + return 0; @@ -134,7 +134,7 @@ + // CraftBukkit start + if (i == 0) { + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) entityhuman.getBukkitEntity(), null, (FishHook) this.getBukkitEntity(), PlayerFishEvent.State.REEL_IN); -+ this.level.getServer().getPluginManager().callEvent(playerFishEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(playerFishEvent); + if (playerFishEvent.isCancelled()) { + return 0; + } diff --git a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityLargeFireball.patch b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityLargeFireball.patch index b4df54d056..b55bc1c47b 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityLargeFireball.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityLargeFireball.patch @@ -29,7 +29,7 @@ - this.level.createExplosion((Entity) null, this.locX(), this.locY(), this.locZ(), (float) this.explosionPower, flag, flag ? Explosion.Effect.DESTROY : Explosion.Effect.NONE); + // CraftBukkit start - fire ExplosionPrimeEvent + ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity()); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + // give 'this' instead of (Entity) null so we know what causes the damage diff --git a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntitySmallFireball.patch b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntitySmallFireball.patch index 6a57b49f12..c74e8fdc4e 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntitySmallFireball.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntitySmallFireball.patch @@ -28,7 +28,7 @@ - entity.setOnFire(5); + // CraftBukkit start - Entity damage by entity event + combust event + EntityCombustByEntityEvent event = new EntityCombustByEntityEvent((org.bukkit.entity.Projectile) this.getBukkitEntity(), entity.getBukkitEntity(), 5); -+ entity.level.getServer().getPluginManager().callEvent(event); ++ entity.level.getCraftServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + entity.setOnFire(event.getDuration(), false); diff --git a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityWitherSkull.patch b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityWitherSkull.patch index 03a10418f4..b4d1a985f7 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityWitherSkull.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/projectile/EntityWitherSkull.patch @@ -35,7 +35,7 @@ + // CraftBukkit start + // this.level.createExplosion(this, this.locX(), this.locY(), this.locZ(), 1.0F, false, explosion_effect); + ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 1.0F, false); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + this.level.createExplosion(this, this.locX(), this.locY(), this.locZ(), event.getRadius(), event.getFire(), explosion_effect); diff --git a/paper-server/nms-patches/net/minecraft/world/entity/vehicle/EntityBoat.patch b/paper-server/nms-patches/net/minecraft/world/entity/vehicle/EntityBoat.patch index b4adf3eb34..07d2a88a13 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/vehicle/EntityBoat.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/vehicle/EntityBoat.patch @@ -40,7 +40,7 @@ + org.bukkit.entity.Entity attacker = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity(); + + VehicleDamageEvent event = new VehicleDamageEvent(vehicle, attacker, (double) f); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return false; @@ -57,7 +57,7 @@ if (flag || this.getDamage() > 40.0F) { + // CraftBukkit start + VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, attacker); -+ this.level.getServer().getPluginManager().callEvent(destroyEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(destroyEvent); + + if (destroyEvent.isCancelled()) { + this.setDamage(40F); // Maximize damage so this doesn't get triggered again right away @@ -74,7 +74,7 @@ + // CraftBukkit start + if (!this.isSameVehicle(entity)) { + VehicleEntityCollisionEvent event = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return; @@ -87,7 +87,7 @@ + // CraftBukkit start + if (!this.isSameVehicle(entity)) { + VehicleEntityCollisionEvent event = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return; @@ -110,7 +110,7 @@ } + // CraftBukkit start -+ org.bukkit.Server server = this.level.getServer(); ++ org.bukkit.Server server = this.level.getCraftServer(); + org.bukkit.World bworld = this.level.getWorld(); + + Location to = new Location(bworld, this.locX(), this.locY(), this.locZ(), this.getYRot(), this.getXRot()); @@ -135,7 +135,7 @@ + // CraftBukkit start + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, null); -+ this.level.getServer().getPluginManager().callEvent(destroyEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(destroyEvent); + if (!destroyEvent.isCancelled()) { this.killEntity(); if (this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) { diff --git a/paper-server/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.patch b/paper-server/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.patch index 948c02253a..9acabb85da 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.patch @@ -52,7 +52,7 @@ + org.bukkit.entity.Entity passenger = (damagesource.getEntity() == null) ? null : damagesource.getEntity().getBukkitEntity(); + + VehicleDamageEvent event = new VehicleDamageEvent(vehicle, passenger, f); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return false; @@ -69,7 +69,7 @@ if (flag || this.getDamage() > 40.0F) { + // CraftBukkit start + VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, passenger); -+ this.level.getServer().getPluginManager().callEvent(destroyEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(destroyEvent); + + if (destroyEvent.isCancelled()) { + this.setDamage(40); // Maximize damage so this doesn't get triggered again right away @@ -113,10 +113,10 @@ + Location to = new Location(bworld, this.locX(), this.locY(), this.locZ(), this.getYRot(), this.getXRot()); + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + -+ this.level.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleUpdateEvent(vehicle)); ++ this.level.getCraftServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleUpdateEvent(vehicle)); + + if (!from.equals(to)) { -+ this.level.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleMoveEvent(vehicle, from, to)); ++ this.level.getCraftServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleMoveEvent(vehicle, from, to)); + } + // CraftBukkit end if (this.getMinecartType() == EntityMinecartAbstract.EnumMinecartType.RIDEABLE && this.getMot().i() > 0.01D) { @@ -128,7 +128,7 @@ if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) { + // CraftBukkit start + VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent(vehicle, entity.getBukkitEntity()); -+ this.level.getServer().getPluginManager().callEvent(collisionEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(collisionEvent); + + if (collisionEvent.isCancelled()) { + continue; @@ -139,7 +139,7 @@ + // CraftBukkit start + if (!this.isSameVehicle(entity)) { + VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent(vehicle, entity.getBukkitEntity()); -+ this.level.getServer().getPluginManager().callEvent(collisionEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(collisionEvent); + + if (collisionEvent.isCancelled()) { + continue; @@ -155,7 +155,7 @@ if (!this.u(entity1) && entity1.isCollidable() && entity1 instanceof EntityMinecartAbstract) { + // CraftBukkit start + VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent(vehicle, entity1.getBukkitEntity()); -+ this.level.getServer().getPluginManager().callEvent(collisionEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(collisionEvent); + + if (collisionEvent.isCancelled()) { + continue; @@ -207,7 +207,7 @@ if (!this.u(entity)) { + // CraftBukkit start + VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); -+ this.level.getServer().getPluginManager().callEvent(collisionEvent); ++ this.level.getCraftServer().getPluginManager().callEvent(collisionEvent); + + if (collisionEvent.isCancelled()) { + return; diff --git a/paper-server/nms-patches/net/minecraft/world/inventory/Container.patch b/paper-server/nms-patches/net/minecraft/world/inventory/Container.patch index 609bf9a849..23abb214e2 100644 --- a/paper-server/nms-patches/net/minecraft/world/inventory/Container.patch +++ b/paper-server/nms-patches/net/minecraft/world/inventory/Container.patch @@ -106,7 +106,7 @@ + this.setCarried(CraftItemStack.asNMSCopy(newcursor)); + + InventoryDragEvent event = new InventoryDragEvent(view, (newcursor.getType() != org.bukkit.Material.AIR ? newcursor : null), CraftItemStack.asBukkitCopy(oldCursor), this.quickcraftType == 1, eventmap); -+ entityhuman.level.getServer().getPluginManager().callEvent(event); ++ entityhuman.level.getCraftServer().getPluginManager().callEvent(event); + + // Whether or not a change was made to the inventory that requires an update. + boolean needsUpdate = event.getResult() != Result.DEFAULT; diff --git a/paper-server/nms-patches/net/minecraft/world/inventory/ContainerEnchantTable.patch b/paper-server/nms-patches/net/minecraft/world/inventory/ContainerEnchantTable.patch index a0eaacce18..f82eae484e 100644 --- a/paper-server/nms-patches/net/minecraft/world/inventory/ContainerEnchantTable.patch +++ b/paper-server/nms-patches/net/minecraft/world/inventory/ContainerEnchantTable.patch @@ -80,7 +80,7 @@ + + PrepareItemEnchantEvent event = new PrepareItemEnchantEvent(player, this.getBukkitView(), access.getLocation().getBlock(), item, offers, i); + event.setCancelled(!itemstack.canEnchant()); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + for (j = 0; j < 3; ++j) { @@ -126,7 +126,7 @@ + CraftItemStack item = CraftItemStack.asCraftMirror(itemstack2); + + EnchantItemEvent event = new EnchantItemEvent((Player) entityhuman.getBukkitEntity(), this.getBukkitView(), access.getLocation().getBlock(), item, this.costs[i], enchants, i); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + + int level = event.getExpLevelCost(); + if (event.isCancelled() || (level > entityhuman.experienceLevel && !entityhuman.getAbilities().instabuild) || event.getEnchantsToAdd().isEmpty()) { diff --git a/paper-server/nms-patches/net/minecraft/world/item/ItemArmor.patch b/paper-server/nms-patches/net/minecraft/world/item/ItemArmor.patch index 29690e4865..4d663d9020 100644 --- a/paper-server/nms-patches/net/minecraft/world/item/ItemArmor.patch +++ b/paper-server/nms-patches/net/minecraft/world/item/ItemArmor.patch @@ -23,7 +23,7 @@ + + BlockDispenseArmorEvent event = new BlockDispenseArmorEvent(block, craftItem.clone(), (org.bukkit.craftbukkit.entity.CraftLivingEntity) entityliving.getBukkitEntity()); + if (!BlockDispenser.eventFired) { -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { diff --git a/paper-server/nms-patches/net/minecraft/world/item/ItemBlock.patch b/paper-server/nms-patches/net/minecraft/world/item/ItemBlock.patch index ff676d6fed..b94a55f00d 100644 --- a/paper-server/nms-patches/net/minecraft/world/item/ItemBlock.patch +++ b/paper-server/nms-patches/net/minecraft/world/item/ItemBlock.patch @@ -98,7 +98,7 @@ + org.bukkit.entity.Player player = (blockactioncontext.getEntity() instanceof EntityPlayer) ? (org.bukkit.entity.Player) blockactioncontext.getEntity().getBukkitEntity() : null; + + BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(blockactioncontext.getWorld(), blockactioncontext.getClickPosition()), player, CraftBlockData.fromData(iblockdata), defaultReturn); -+ blockactioncontext.getWorld().getServer().getPluginManager().callEvent(event); ++ blockactioncontext.getWorld().getCraftServer().getPluginManager().callEvent(event); - return (!this.isCheckCollisions() || iblockdata.canPlace(blockactioncontext.getWorld(), blockactioncontext.getClickPosition())) && blockactioncontext.getWorld().a(iblockdata, blockactioncontext.getClickPosition(), voxelshapecollision); + return event.isBuildable(); diff --git a/paper-server/nms-patches/net/minecraft/world/item/ItemDye.patch b/paper-server/nms-patches/net/minecraft/world/item/ItemDye.patch index 49078584ee..d8627c61a0 100644 --- a/paper-server/nms-patches/net/minecraft/world/item/ItemDye.patch +++ b/paper-server/nms-patches/net/minecraft/world/item/ItemDye.patch @@ -17,7 +17,7 @@ + // CraftBukkit start + byte bColor = (byte) this.dyeColor.getColorIndex(); + SheepDyeWoolEvent event = new SheepDyeWoolEvent((org.bukkit.entity.Sheep) entitysheep.getBukkitEntity(), org.bukkit.DyeColor.getByWoolData(bColor)); -+ entitysheep.level.getServer().getPluginManager().callEvent(event); ++ entitysheep.level.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return EnumInteractionResult.PASS; diff --git a/paper-server/nms-patches/net/minecraft/world/item/ItemFishingRod.patch b/paper-server/nms-patches/net/minecraft/world/item/ItemFishingRod.patch index 1ba65213c5..e9e890279d 100644 --- a/paper-server/nms-patches/net/minecraft/world/item/ItemFishingRod.patch +++ b/paper-server/nms-patches/net/minecraft/world/item/ItemFishingRod.patch @@ -23,7 +23,7 @@ + // CraftBukkit start + EntityFishingHook entityfishinghook = new EntityFishingHook(entityhuman, world, j, i); + PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), null, (org.bukkit.entity.FishHook) entityfishinghook.getBukkitEntity(), PlayerFishEvent.State.FISHING); -+ world.getServer().getPluginManager().callEvent(playerFishEvent); ++ world.getCraftServer().getPluginManager().callEvent(playerFishEvent); + + if (playerFishEvent.isCancelled()) { + entityhuman.fishing = null; diff --git a/paper-server/nms-patches/net/minecraft/world/item/ItemHanging.patch b/paper-server/nms-patches/net/minecraft/world/item/ItemHanging.patch index 27130fe5f8..8e55f444f0 100644 --- a/paper-server/nms-patches/net/minecraft/world/item/ItemHanging.patch +++ b/paper-server/nms-patches/net/minecraft/world/item/ItemHanging.patch @@ -22,7 +22,7 @@ + org.bukkit.block.BlockFace blockFace = org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(enumdirection); + + HangingPlaceEvent event = new HangingPlaceEvent((org.bukkit.entity.Hanging) ((EntityHanging) object).getBukkitEntity(), who, blockClicked, blockFace); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return EnumInteractionResult.FAIL; diff --git a/paper-server/nms-patches/net/minecraft/world/item/ItemLeash.patch b/paper-server/nms-patches/net/minecraft/world/item/ItemLeash.patch index b676058318..81a45928da 100644 --- a/paper-server/nms-patches/net/minecraft/world/item/ItemLeash.patch +++ b/paper-server/nms-patches/net/minecraft/world/item/ItemLeash.patch @@ -16,7 +16,7 @@ + + // CraftBukkit start - fire HangingPlaceEvent + HangingPlaceEvent event = new HangingPlaceEvent((org.bukkit.entity.Hanging) entityleash.getBukkitEntity(), entityhuman != null ? (org.bukkit.entity.Player) entityhuman.getBukkitEntity() : null, world.getWorld().getBlockAt(i, j, k), org.bukkit.block.BlockFace.SELF); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + entityleash.die(); diff --git a/paper-server/nms-patches/net/minecraft/world/item/ItemMinecart.patch b/paper-server/nms-patches/net/minecraft/world/item/ItemMinecart.patch index 6c2de38a7c..9a6b82a158 100644 --- a/paper-server/nms-patches/net/minecraft/world/item/ItemMinecart.patch +++ b/paper-server/nms-patches/net/minecraft/world/item/ItemMinecart.patch @@ -25,7 +25,7 @@ + + BlockDispenseEvent event = new BlockDispenseEvent(block2, craftItem.clone(), new org.bukkit.util.Vector(d0, d1 + d3, d2)); + if (!BlockDispenser.eventFired) { -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + } + + if (event.isCancelled()) { diff --git a/paper-server/nms-patches/net/minecraft/world/level/Explosion.patch b/paper-server/nms-patches/net/minecraft/world/level/Explosion.patch index 843583f2e3..d8539ef0f9 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/Explosion.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/Explosion.patch @@ -95,13 +95,13 @@ + + if (explode != null) { + EntityExplodeEvent event = new EntityExplodeEvent(explode, location, blockList, this.blockInteraction == Explosion.Effect.DESTROY ? 1.0F / this.radius : 1.0F); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + cancelled = event.isCancelled(); + bukkitBlocks = event.blockList(); + yield = event.getYield(); + } else { + BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.blockInteraction == Explosion.Effect.DESTROY ? 1.0F / this.radius : 1.0F); -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + cancelled = event.isCancelled(); + bukkitBlocks = event.blockList(); + yield = event.getYield(); diff --git a/paper-server/nms-patches/net/minecraft/world/level/World.patch b/paper-server/nms-patches/net/minecraft/world/level/World.patch index 34f7fcacfa..c14668587c 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/World.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/World.patch @@ -57,7 +57,7 @@ + return this.world; + } + -+ public CraftServer getServer() { ++ public CraftServer getCraftServer() { + return (CraftServer) Bukkit.getServer(); + } + @@ -68,12 +68,12 @@ + protected World(WorldDataMutable worlddatamutable, ResourceKey resourcekey, final DimensionManager dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) { + this.generator = gen; + this.world = new CraftWorld((WorldServer) this, gen, env); -+ this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit -+ this.ticksPerMonsterSpawns = this.getServer().getTicksPerMonsterSpawns(); // CraftBukkit -+ this.ticksPerWaterSpawns = this.getServer().getTicksPerWaterSpawns(); // CraftBukkit -+ this.ticksPerWaterAmbientSpawns = this.getServer().getTicksPerWaterAmbientSpawns(); // CraftBukkit -+ this.ticksPerAmbientSpawns = this.getServer().getTicksPerAmbientSpawns(); // CraftBukkit -+ this.typeKey = (ResourceKey) this.getServer().getHandle().getServer().registryHolder.d(IRegistry.DIMENSION_TYPE_REGISTRY).c(dimensionmanager).orElseThrow(() -> { ++ this.ticksPerAnimalSpawns = this.getCraftServer().getTicksPerAnimalSpawns(); // CraftBukkit ++ this.ticksPerMonsterSpawns = this.getCraftServer().getTicksPerMonsterSpawns(); // CraftBukkit ++ this.ticksPerWaterSpawns = this.getCraftServer().getTicksPerWaterSpawns(); // CraftBukkit ++ this.ticksPerWaterAmbientSpawns = this.getCraftServer().getTicksPerWaterAmbientSpawns(); // CraftBukkit ++ this.ticksPerAmbientSpawns = this.getCraftServer().getTicksPerAmbientSpawns(); // CraftBukkit ++ this.typeKey = (ResourceKey) this.getCraftServer().getHandle().getServer().registryHolder.d(IRegistry.DIMENSION_TYPE_REGISTRY).c(dimensionmanager).orElseThrow(() -> { + return new IllegalStateException("Unregistered dimension type: " + dimensionmanager); + }); + // CraftBukkit end @@ -104,23 +104,23 @@ + // From PlayerList.setPlayerFileData + getWorldBorder().a(new IWorldBorderListener() { + public void a(WorldBorder worldborder, double d0) { -+ getServer().getHandle().sendAll(new ClientboundSetBorderSizePacket(worldborder), worldborder.world); ++ getCraftServer().getHandle().sendAll(new ClientboundSetBorderSizePacket(worldborder), worldborder.world); + } + + public void a(WorldBorder worldborder, double d0, double d1, long i) { -+ getServer().getHandle().sendAll(new ClientboundSetBorderLerpSizePacket(worldborder), worldborder.world); ++ getCraftServer().getHandle().sendAll(new ClientboundSetBorderLerpSizePacket(worldborder), worldborder.world); + } + + public void a(WorldBorder worldborder, double d0, double d1) { -+ getServer().getHandle().sendAll(new ClientboundSetBorderCenterPacket(worldborder), worldborder.world); ++ getCraftServer().getHandle().sendAll(new ClientboundSetBorderCenterPacket(worldborder), worldborder.world); + } + + public void a(WorldBorder worldborder, int i) { -+ getServer().getHandle().sendAll(new ClientboundSetBorderWarningDelayPacket(worldborder), worldborder.world); ++ getCraftServer().getHandle().sendAll(new ClientboundSetBorderWarningDelayPacket(worldborder), worldborder.world); + } + + public void b(WorldBorder worldborder, int i) { -+ getServer().getHandle().sendAll(new ClientboundSetBorderWarningDistancePacket(worldborder), worldborder.world); ++ getCraftServer().getHandle().sendAll(new ClientboundSetBorderWarningDistancePacket(worldborder), worldborder.world); + } + + public void b(WorldBorder worldborder, double d0) {} @@ -230,7 +230,7 @@ + CraftWorld world = ((WorldServer) this).getWorld(); + if (world != null) { + BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata)); -+ this.getServer().getPluginManager().callEvent(event); ++ this.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return; @@ -257,7 +257,7 @@ + CraftWorld world = ((WorldServer) this).getWorld(); + if (world != null) { + BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata), world.getBlockAt(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ())); -+ this.getServer().getPluginManager().callEvent(event); ++ this.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return; @@ -328,7 +328,7 @@ protected void a(@Nullable Entity entity, GameEvent gameevent, BlockPosition blockposition, int i) { + // CraftBukkit start + GenericGameEvent event = new GenericGameEvent(org.bukkit.GameEvent.getByKey(CraftNamespacedKey.fromMinecraft(IRegistry.GAME_EVENT.getKey(gameevent))), new Location(this.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()), (entity == null) ? null : entity.getBukkitEntity(), i); -+ getServer().getPluginManager().callEvent(event); ++ getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return; + } diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockButtonAbstract.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockButtonAbstract.patch index 1465f16c0b..73e561b64c 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockButtonAbstract.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockButtonAbstract.patch @@ -23,7 +23,7 @@ + int current = (!powered) ? 15 : 0; + + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, old, current); -+ world.getServer().getPluginManager().callEvent(eventRedstone); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); + + if ((eventRedstone.getNewCurrent() > 0) != (!powered)) { + return EnumInteractionResult.SUCCESS; @@ -40,7 +40,7 @@ + org.bukkit.block.Block block = worldserver.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, 15, 0); -+ worldserver.getServer().getPluginManager().callEvent(eventRedstone); ++ worldserver.getCraftServer().getPluginManager().callEvent(eventRedstone); + + if (eventRedstone.getNewCurrent() > 0) { + return; @@ -62,7 +62,7 @@ + for (Object object : list) { + if (object != null) { + EntityInteractEvent event = new EntityInteractEvent(((Entity) object).getBukkitEntity(), block); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + allowed = true; @@ -85,7 +85,7 @@ + int current = (!powered) ? 15 : 0; + + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, old, current); -+ world.getServer().getPluginManager().callEvent(eventRedstone); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); + + if ((flag && eventRedstone.getNewCurrent() <= 0) || (!flag && eventRedstone.getNewCurrent() > 0)) { + return; diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockCommand.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockCommand.patch index 827f874f95..8b5d4cb66b 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockCommand.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockCommand.patch @@ -19,7 +19,7 @@ + int current = flag1 ? 15 : 0; + + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bukkitBlock, old, current); -+ world.getServer().getPluginManager().callEvent(eventRedstone); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); + flag1 = eventRedstone.getNewCurrent() > 0; + // CraftBukkit end diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockConcretePowder.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockConcretePowder.patch index d7485b2bcf..d52156f1c5 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockConcretePowder.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockConcretePowder.patch @@ -62,7 +62,7 @@ + blockState.setData(this.concrete); + + BlockFormEvent event = new BlockFormEvent(blockState.getBlock(), blockState); -+ ((World) generatoraccess).getServer().getPluginManager().callEvent(event); ++ ((World) generatoraccess).getCraftServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + return blockState.getHandle(); diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockDoor.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockDoor.patch index 1457f6dbcc..f9231b0950 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockDoor.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockDoor.patch @@ -28,7 +28,7 @@ + + if (oldPower == 0 ^ power == 0) { + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bukkitBlock, oldPower, power); -+ world.getServer().getPluginManager().callEvent(eventRedstone); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); - if (!this.getBlockData().a(block) && flag1 != (Boolean) iblockdata.get(BlockDoor.POWERED)) { + boolean flag1 = eventRedstone.getNewCurrent() > 0; diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockDropper.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockDropper.patch index 84a00f1f53..fb21d299aa 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockDropper.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockDropper.patch @@ -31,7 +31,7 @@ + } + + InventoryMoveItemEvent event = new InventoryMoveItemEvent(tileentitydispenser.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true); -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return; + } diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockEnderPortal.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockEnderPortal.patch index fdd6ec43bb..92d7ddd42f 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockEnderPortal.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockEnderPortal.patch @@ -29,7 +29,7 @@ + // CraftBukkit start - Entity in portal + EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ())); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + + if (entity instanceof EntityPlayer) { + ((EntityPlayer) entity).b(worldserver, PlayerTeleportEvent.TeleportCause.END_PORTAL); diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockFenceGate.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockFenceGate.patch index db7231ade9..0662326b74 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockFenceGate.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockFenceGate.patch @@ -11,7 +11,7 @@ + int oldPower = oldPowered ? 15 : 0; + org.bukkit.block.Block bukkitBlock = org.bukkit.craftbukkit.block.CraftBlock.at(world, blockposition); + org.bukkit.event.block.BlockRedstoneEvent eventRedstone = new org.bukkit.event.block.BlockRedstoneEvent(bukkitBlock, oldPower, newPower); -+ world.getServer().getPluginManager().callEvent(eventRedstone); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); + flag1 = eventRedstone.getNewCurrent() > 0; + } + // CraftBukkit end diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockFire.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockFire.patch index fd0297adc7..867afd04f6 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockFire.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockFire.patch @@ -29,7 +29,7 @@ + blockState.setData(Blocks.AIR.getBlockData()); + + BlockFadeEvent event = new BlockFadeEvent(blockState.getBlock(), blockState); -+ ((World) generatoraccess).getServer().getPluginManager().callEvent(event); ++ ((World) generatoraccess).getCraftServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + return blockState.getHandle(); @@ -129,7 +129,7 @@ + org.bukkit.block.Block sourceBlock = world.getWorld().getBlockAt(sourceposition.getX(), sourceposition.getY(), sourceposition.getZ()); + + BlockBurnEvent event = new BlockBurnEvent(theBlock, sourceBlock); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return; diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockFireAbstract.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockFireAbstract.patch index 4152a9f98d..8622ebaa9e 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockFireAbstract.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockFireAbstract.patch @@ -7,7 +7,7 @@ - entity.setOnFire(8); + // CraftBukkit start + org.bukkit.event.entity.EntityCombustEvent event = new org.bukkit.event.entity.EntityCombustByBlockEvent(org.bukkit.craftbukkit.block.CraftBlock.at(world, blockposition), entity.getBukkitEntity(), 8); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + entity.setOnFire(event.getDuration(), false); diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockLeaves.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockLeaves.patch index bf6879a931..4df27c4709 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockLeaves.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockLeaves.patch @@ -15,7 +15,7 @@ if (!(Boolean) iblockdata.get(BlockLeaves.PERSISTENT) && (Integer) iblockdata.get(BlockLeaves.DISTANCE) == 7) { + // CraftBukkit start + LeavesDecayEvent event = new LeavesDecayEvent(worldserver.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ())); -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled() || worldserver.getType(blockposition).getBlock() != this) { + return; diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockLever.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockLever.patch index 7b828bc893..27e4ec7038 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockLever.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockLever.patch @@ -20,7 +20,7 @@ + int current = (!powered) ? 15 : 0; + + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, old, current); -+ world.getServer().getPluginManager().callEvent(eventRedstone); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); + + if ((eventRedstone.getNewCurrent() > 0) != (!powered)) { + return EnumInteractionResult.SUCCESS; diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockMinecartDetector.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockMinecartDetector.patch index 46d2f1bfbd..5ab8ac0980 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockMinecartDetector.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockMinecartDetector.patch @@ -18,7 +18,7 @@ + org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, flag ? 15 : 0, flag1 ? 15 : 0); -+ world.getServer().getPluginManager().callEvent(eventRedstone); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); + + flag1 = eventRedstone.getNewCurrent() > 0; + } diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockPortal.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockPortal.patch index 0715794c3b..46412c9e7d 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockPortal.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockPortal.patch @@ -27,7 +27,7 @@ if (!entity.isPassenger() && !entity.isVehicle() && entity.canPortal()) { + // CraftBukkit start - Entity in portal + EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ())); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + // CraftBukkit end entity.d(blockposition); } diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch index fc30811421..177a5f6a03 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch @@ -15,7 +15,7 @@ + // CraftBukkit start - Interact Pressure Plate + org.bukkit.World bworld = world.getWorld(); -+ org.bukkit.plugin.PluginManager manager = world.getServer().getPluginManager(); ++ org.bukkit.plugin.PluginManager manager = world.getCraftServer().getPluginManager(); + + if (flag != flag1) { + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), i, j); diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockPressurePlateBinary.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockPressurePlateBinary.patch index 2161e591b6..16170cef0e 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockPressurePlateBinary.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockPressurePlateBinary.patch @@ -16,7 +16,7 @@ + // CraftBukkit start - Call interact event when turning on a pressure plate + if (this.getPower(world.getType(blockposition)) == 0) { + org.bukkit.World bworld = world.getWorld(); -+ org.bukkit.plugin.PluginManager manager = world.getServer().getPluginManager(); ++ org.bukkit.plugin.PluginManager manager = world.getCraftServer().getPluginManager(); + org.bukkit.event.Cancellable cancellable; + + if (entity instanceof EntityHuman) { diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockPressurePlateWeighted.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockPressurePlateWeighted.patch index fd9fa7545c..faf022cb06 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockPressurePlateWeighted.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockPressurePlateWeighted.patch @@ -28,7 +28,7 @@ + cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, blockposition, null, null, null); + } else { + cancellable = new EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ())); -+ world.getServer().getPluginManager().callEvent((EntityInteractEvent) cancellable); ++ world.getCraftServer().getPluginManager().callEvent((EntityInteractEvent) cancellable); + } + + // We only want to block turning the plate on if all events are cancelled diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockRedstoneOre.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockRedstoneOre.patch index b90f562a7d..348c7c96e7 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockRedstoneOre.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockRedstoneOre.patch @@ -36,7 +36,7 @@ + } + } else { + EntityInteractEvent event = new EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ())); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + if (!event.isCancelled()) { + interact(world.getType(blockposition), world, blockposition, entity); // add entity + super.stepOn(world, blockposition, iblockdata, entity); diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockRedstoneTorch.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockRedstoneTorch.patch index 0fbc2319c9..4d1e0a0099 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockRedstoneTorch.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockRedstoneTorch.patch @@ -14,7 +14,7 @@ } + // CraftBukkit start -+ org.bukkit.plugin.PluginManager manager = worldserver.getServer().getPluginManager(); ++ org.bukkit.plugin.PluginManager manager = worldserver.getCraftServer().getPluginManager(); + org.bukkit.block.Block block = worldserver.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + int oldCurrent = ((Boolean) iblockdata.get(BlockRedstoneTorch.LIT)).booleanValue() ? 15 : 0; + diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockRedstoneWire.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockRedstoneWire.patch index 27efcc694d..f2043996cf 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockRedstoneWire.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockRedstoneWire.patch @@ -27,7 +27,7 @@ + int oldPower = (Integer) iblockdata.get(BlockRedstoneWire.POWER); + if (oldPower != i) { + BlockRedstoneEvent event = new BlockRedstoneEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), oldPower, i); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + + i = event.getNewCurrent(); + } diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockSoil.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockSoil.patch index 47b004388e..2d8f45736b 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockSoil.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockSoil.patch @@ -38,7 +38,7 @@ + cancellable = CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, blockposition, null, null, null); + } else { + cancellable = new EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ())); -+ world.getServer().getPluginManager().callEvent((EntityInteractEvent) cancellable); ++ world.getCraftServer().getPluginManager().callEvent((EntityInteractEvent) cancellable); + } + + if (cancellable.isCancelled()) { diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockSponge.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockSponge.patch index 253979c14b..1c54acb6a3 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockSponge.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockSponge.patch @@ -71,7 +71,7 @@ + final org.bukkit.block.Block bblock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + + SpongeAbsorbEvent event = new SpongeAbsorbEvent(bblock, (List) (List) blocks); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return false; diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockTrapdoor.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockTrapdoor.patch index 0fa4ffc68b..57c378b1d2 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockTrapdoor.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockTrapdoor.patch @@ -22,7 +22,7 @@ + + if (oldPower == 0 ^ power == 0 || block.getBlockData().isPowerSource()) { + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bblock, oldPower, power); -+ world.getServer().getPluginManager().callEvent(eventRedstone); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); + flag1 = eventRedstone.getNewCurrent() > 0; + } + // CraftBukkit end diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockTripwire.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockTripwire.patch index 724fe5e41b..c4d20d38c2 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockTripwire.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockTripwire.patch @@ -16,7 +16,7 @@ + // CraftBukkit start - Call interact even when triggering connected tripwire + if (flag != flag1 && flag1 && (Boolean)iblockdata.get(ATTACHED)) { + org.bukkit.World bworld = world.getWorld(); -+ org.bukkit.plugin.PluginManager manager = world.getServer().getPluginManager(); ++ org.bukkit.plugin.PluginManager manager = world.getCraftServer().getPluginManager(); + org.bukkit.block.Block block = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + boolean allowed = false; + diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockTripwireHook.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockTripwireHook.patch index 136c5b875c..fb38f3f955 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockTripwireHook.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockTripwireHook.patch @@ -17,7 +17,7 @@ + org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, 15, 0); -+ world.getServer().getPluginManager().callEvent(eventRedstone); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); + + if (eventRedstone.getNewCurrent() > 0) { + return; diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/BlockTurtleEgg.patch b/paper-server/nms-patches/net/minecraft/world/level/block/BlockTurtleEgg.patch index b298e8a937..7e1e860229 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/BlockTurtleEgg.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/BlockTurtleEgg.patch @@ -23,7 +23,7 @@ + cancellable = CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, blockposition, null, null, null); + } else { + cancellable = new EntityInteractEvent(entity.getBukkitEntity(), CraftBlock.at(world, blockposition)); -+ world.getServer().getPluginManager().callEvent((EntityInteractEvent) cancellable); ++ world.getCraftServer().getPluginManager().callEvent((EntityInteractEvent) cancellable); + } + + if (cancellable.isCancelled()) { diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/LayeredCauldronBlock.patch b/paper-server/nms-patches/net/minecraft/world/level/block/LayeredCauldronBlock.patch index 88125eebaa..d4676a267f 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/LayeredCauldronBlock.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/LayeredCauldronBlock.patch @@ -53,7 +53,7 @@ + world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), + (entity == null) ? null : entity.getBukkitEntity(), reason, newState + ); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return false; + } diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/LightningRodBlock.patch b/paper-server/nms-patches/net/minecraft/world/level/block/LightningRodBlock.patch index cc2e2b1ec8..2fffa8ff76 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/LightningRodBlock.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/LightningRodBlock.patch @@ -22,7 +22,7 @@ + int current = (!powered) ? 15 : 0; + + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(CraftBlock.at(world, blockposition), old, current); -+ world.getServer().getPluginManager().callEvent(eventRedstone); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); + + if (eventRedstone.getNewCurrent() <= 0) { + return; diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/SculkSensorBlock.patch b/paper-server/nms-patches/net/minecraft/world/level/block/SculkSensorBlock.patch index 30ab4dbc8f..b394a906b8 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/SculkSensorBlock.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/SculkSensorBlock.patch @@ -24,7 +24,7 @@ public static void a(World world, BlockPosition blockposition, IBlockData iblockdata) { + // CraftBukkit start + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(CraftBlock.at(world, blockposition), iblockdata.get(SculkSensorBlock.POWER), 0); -+ world.getServer().getPluginManager().callEvent(eventRedstone); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); + + if (eventRedstone.getNewCurrent() > 0) { + world.setTypeAndData(blockposition, iblockdata.set(SculkSensorBlock.POWER, eventRedstone.getNewCurrent()), 3); @@ -40,7 +40,7 @@ public static void a(World world, BlockPosition blockposition, IBlockData iblockdata, int i) { + // CraftBukkit start + BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(CraftBlock.at(world, blockposition), iblockdata.get(SculkSensorBlock.POWER), i); -+ world.getServer().getPluginManager().callEvent(eventRedstone); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); + + if (eventRedstone.getNewCurrent() <= 0) { + return; diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityBrewingStand.patch b/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityBrewingStand.patch index 575c662fb0..cc65f096a6 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityBrewingStand.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityBrewingStand.patch @@ -64,7 +64,7 @@ - itemstack.subtract(1); + // CraftBukkit start + BrewingStandFuelEvent event = new BrewingStandFuelEvent(CraftBlock.at(world, blockposition), CraftItemStack.asCraftMirror(itemstack), 20); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return; diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityCampfire.patch b/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityCampfire.patch index ba68eb8233..fe9f6706f2 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityCampfire.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityCampfire.patch @@ -22,7 +22,7 @@ + org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1); + + BlockCookEvent blockCookEvent = new BlockCookEvent(CraftBlock.at(world, blockposition), source, result); -+ world.getServer().getPluginManager().callEvent(blockCookEvent); ++ world.getCraftServer().getPluginManager().callEvent(blockCookEvent); + + if (blockCookEvent.isCancelled()) { + return; diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityFurnace.patch b/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityFurnace.patch index 455a5bd4c5..2ee7a8471e 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityFurnace.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityFurnace.patch @@ -69,7 +69,7 @@ + CraftItemStack fuel = CraftItemStack.asCraftMirror(itemstack); + + FurnaceBurnEvent furnaceBurnEvent = new FurnaceBurnEvent(CraftBlock.at(world, blockposition), fuel, tileentityfurnace.fuelTime(itemstack)); -+ world.getServer().getPluginManager().callEvent(furnaceBurnEvent); ++ world.getCraftServer().getPluginManager().callEvent(furnaceBurnEvent); + + if (furnaceBurnEvent.isCancelled()) { + return; @@ -108,7 +108,7 @@ + org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1); + + FurnaceSmeltEvent furnaceSmeltEvent = new FurnaceSmeltEvent(CraftBlock.at(world, blockposition), source, result); -+ world.getServer().getPluginManager().callEvent(furnaceSmeltEvent); ++ world.getCraftServer().getPluginManager().callEvent(furnaceSmeltEvent); + + if (furnaceSmeltEvent.isCancelled()) { + return false; @@ -194,7 +194,7 @@ + // CraftBukkit start - fire FurnaceExtractEvent + if (amount != 0) { + FurnaceExtractEvent event = new FurnaceExtractEvent((Player) entityhuman.getBukkitEntity(), CraftBlock.at(worldserver, blockposition), org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(itemstack.getItem()), amount, j); -+ worldserver.getServer().getPluginManager().callEvent(event); ++ worldserver.getCraftServer().getPluginManager().callEvent(event); + j = event.getExpToDrop(); + } + // CraftBukkit end diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityHopper.patch b/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityHopper.patch index d48bd62b36..f17ab99cf2 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityHopper.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/entity/TileEntityHopper.patch @@ -93,7 +93,7 @@ + } + + InventoryMoveItemEvent event = new InventoryMoveItemEvent(iinventory.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + hopper.setItem(i, itemstack); + hopper.setCooldown(8); // Delay hopper checks @@ -146,7 +146,7 @@ boolean flag = false; + // CraftBukkit start + InventoryPickupItemEvent event = new InventoryPickupItemEvent(iinventory.getOwner().getInventory(), (org.bukkit.entity.Item) entityitem.getBukkitEntity()); -+ entityitem.level.getServer().getPluginManager().callEvent(event); ++ entityitem.level.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return false; + } diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/piston/BlockPiston.patch b/paper-server/nms-patches/net/minecraft/world/level/block/piston/BlockPiston.patch index abecbe0839..d1b32827d1 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/piston/BlockPiston.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/piston/BlockPiston.patch @@ -23,7 +23,7 @@ + if (!this.isSticky) { + org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + BlockPistonRetractEvent event = new BlockPistonRetractEvent(block, ImmutableList.of(), CraftBlock.notchToBlockFace(enumdirection)); -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return; @@ -66,7 +66,7 @@ + } else { + event = new BlockPistonRetractEvent(bblock, blocks, CraftBlock.notchToBlockFace(enumdirection1)); + } -+ world.getServer().getPluginManager().callEvent(event); ++ world.getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + for (BlockPosition b : broken) { diff --git a/paper-server/nms-patches/net/minecraft/world/level/chunk/Chunk.patch b/paper-server/nms-patches/net/minecraft/world/level/chunk/Chunk.patch index 2ef62924da..99062f1fe0 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/chunk/Chunk.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/chunk/Chunk.patch @@ -110,7 +110,7 @@ + // CraftBukkit start + public void loadCallback() { -+ org.bukkit.Server server = this.level.getServer(); ++ org.bukkit.Server server = this.level.getCraftServer(); + if (server != null) { + /* + * If it's a new world, the first few chunks are generated inside @@ -144,7 +144,7 @@ + } + + public void unloadCallback() { -+ org.bukkit.Server server = this.level.getServer(); ++ org.bukkit.Server server = this.level.getCraftServer(); + org.bukkit.event.world.ChunkUnloadEvent unloadEvent = new org.bukkit.event.world.ChunkUnloadEvent(this.bukkitChunk, this.isNeedsSaving()); + server.getPluginManager().callEvent(unloadEvent); + // note: saving can be prevented, but not forced if no saving is actually required diff --git a/paper-server/nms-patches/net/minecraft/world/level/material/FluidTypeFlowing.patch b/paper-server/nms-patches/net/minecraft/world/level/material/FluidTypeFlowing.patch index 6104a4a95f..5ebe336c3a 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/material/FluidTypeFlowing.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/material/FluidTypeFlowing.patch @@ -23,7 +23,7 @@ + // CraftBukkit start + org.bukkit.block.Block source = CraftBlock.at(generatoraccess, blockposition); + BlockFromToEvent event = new BlockFromToEvent(source, BlockFace.DOWN); -+ generatoraccess.getMinecraftWorld().getServer().getPluginManager().callEvent(event); ++ generatoraccess.getMinecraftWorld().getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return; @@ -39,7 +39,7 @@ + // CraftBukkit start + org.bukkit.block.Block source = CraftBlock.at(generatoraccess, blockposition); + BlockFromToEvent event = new BlockFromToEvent(source, org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(enumdirection)); -+ generatoraccess.getMinecraftWorld().getServer().getPluginManager().callEvent(event); ++ generatoraccess.getMinecraftWorld().getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + continue; diff --git a/paper-server/nms-patches/net/minecraft/world/level/portal/PortalTravelAgent.patch b/paper-server/nms-patches/net/minecraft/world/level/portal/PortalTravelAgent.patch index fc25c59b9e..3b2914fd55 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/portal/PortalTravelAgent.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/portal/PortalTravelAgent.patch @@ -83,7 +83,7 @@ + org.bukkit.World bworld = this.level.getWorld(); + org.bukkit.event.world.PortalCreateEvent event = new org.bukkit.event.world.PortalCreateEvent((java.util.List) (java.util.List) blockList.getList(), bworld, (entity == null) ? null : entity.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.NETHER_PAIR); + -+ this.level.getServer().getPluginManager().callEvent(event); ++ this.level.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return Optional.empty(); + } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 4e54c05d88..881bce072e 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -335,7 +335,7 @@ public class CraftEventFactory { */ public static BlockMultiPlaceEvent callBlockMultiPlaceEvent(WorldServer world, EntityHuman who, EnumHand hand, List blockStates, int clickedX, int clickedY, int clickedZ) { CraftWorld craftWorld = world.getWorld(); - CraftServer craftServer = world.getServer(); + CraftServer craftServer = world.getCraftServer(); Player player = (Player) who.getBukkitEntity(); Block blockClicked = craftWorld.getBlockAt(clickedX, clickedY, clickedZ); @@ -363,7 +363,7 @@ public class CraftEventFactory { public static BlockPlaceEvent callBlockPlaceEvent(WorldServer world, EntityHuman who, EnumHand hand, BlockState replacedBlockState, int clickedX, int clickedY, int clickedZ) { CraftWorld craftWorld = world.getWorld(); - CraftServer craftServer = world.getServer(); + CraftServer craftServer = world.getCraftServer(); Player player = (Player) who.getBukkitEntity(); @@ -409,7 +409,7 @@ public class CraftEventFactory { org.bukkit.block.BlockFace blockFace = org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(clickedFace); EntityPlaceEvent event = new EntityPlaceEvent(entity.getBukkitEntity(), who, blockClicked, blockFace); - entity.level.getServer().getPluginManager().callEvent(event); + entity.level.getCraftServer().getPluginManager().callEvent(event); return event; } @@ -579,7 +579,7 @@ public class CraftEventFactory { boolean isNpc = entity instanceof NPC; if (spawnReason != SpawnReason.CUSTOM) { - if (isAnimal && !world.getWorld().getAllowAnimals() || isMonster && !world.getWorld().getAllowMonsters() || isNpc && !world.getServer().getServer().getSpawnNPCs()) { + if (isAnimal && !world.getWorld().getAllowAnimals() || isMonster && !world.getWorld().getAllowMonsters() || isNpc && !world.getCraftServer().getServer().getSpawnNPCs()) { entity.die(); return false; } @@ -1072,7 +1072,7 @@ public class CraftEventFactory { public static FluidLevelChangeEvent callFluidLevelChangeEvent(World world, BlockPosition block, IBlockData newData) { FluidLevelChangeEvent event = new FluidLevelChangeEvent(CraftBlock.at(world, block), CraftBlockData.fromData(newData)); - world.getServer().getPluginManager().callEvent(event); + world.getCraftServer().getPluginManager().callEvent(event); return event; } @@ -1148,7 +1148,7 @@ public class CraftEventFactory { player.connection.a(new PacketPlayInCloseWindow(player.containerMenu.containerId)); } - CraftServer server = player.level.getServer(); + CraftServer server = player.level.getCraftServer(); CraftPlayer craftPlayer = player.getBukkitEntity(); player.containerMenu.transferTo(container, craftPlayer); @@ -1202,7 +1202,7 @@ public class CraftEventFactory { } ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity(), hitEntity, hitBlock, hitFace); - entity.level.getServer().getPluginManager().callEvent(event); + entity.level.getCraftServer().getPluginManager().callEvent(event); return event; } @@ -1215,13 +1215,13 @@ public class CraftEventFactory { public static BlockRedstoneEvent callRedstoneChange(World world, BlockPosition pos, int oldCurrent, int newCurrent) { BlockRedstoneEvent event = new BlockRedstoneEvent(world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()), oldCurrent, newCurrent); - world.getServer().getPluginManager().callEvent(event); + world.getCraftServer().getPluginManager().callEvent(event); return event; } public static NotePlayEvent callNotePlayEvent(World world, BlockPosition pos, BlockPropertyInstrument instrument, int note) { NotePlayEvent event = new NotePlayEvent(world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()), org.bukkit.Instrument.getByType((byte) instrument.ordinal()), new org.bukkit.Note(note)); - world.getServer().getPluginManager().callEvent(event); + world.getCraftServer().getPluginManager().callEvent(event); return event; } @@ -1248,7 +1248,7 @@ public class CraftEventFactory { } BlockIgniteEvent event = new BlockIgniteEvent(bukkitWorld.getBlockAt(block.getX(), block.getY(), block.getZ()), cause, igniter); - world.getServer().getPluginManager().callEvent(event); + world.getCraftServer().getPluginManager().callEvent(event); return event; } @@ -1282,7 +1282,7 @@ public class CraftEventFactory { } BlockIgniteEvent event = new BlockIgniteEvent(bukkitWorld.getBlockAt(pos.getX(), pos.getY(), pos.getZ()), cause, bukkitIgniter); - world.getServer().getPluginManager().callEvent(event); + world.getCraftServer().getPluginManager().callEvent(event); return event; } @@ -1291,25 +1291,25 @@ public class CraftEventFactory { org.bukkit.entity.Entity igniter = explosion.source == null ? null : explosion.source.getBukkitEntity(); BlockIgniteEvent event = new BlockIgniteEvent(bukkitWorld.getBlockAt(x, y, z), IgniteCause.EXPLOSION, igniter); - world.getServer().getPluginManager().callEvent(event); + world.getCraftServer().getPluginManager().callEvent(event); return event; } public static BlockIgniteEvent callBlockIgniteEvent(World world, BlockPosition pos, IgniteCause cause, Entity igniter) { BlockIgniteEvent event = new BlockIgniteEvent(world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()), cause, igniter.getBukkitEntity()); - world.getServer().getPluginManager().callEvent(event); + world.getCraftServer().getPluginManager().callEvent(event); return event; } public static void handleInventoryCloseEvent(EntityHuman human) { InventoryCloseEvent event = new InventoryCloseEvent(human.containerMenu.getBukkitView()); - human.level.getServer().getPluginManager().callEvent(event); + human.level.getCraftServer().getPluginManager().callEvent(event); human.containerMenu.transferTo(human.inventoryMenu, human.getBukkitEntity()); } public static ItemStack handleEditBookEvent(EntityPlayer player, int itemInHandIndex, ItemStack itemInHand, ItemStack newBookItem) { PlayerEditBookEvent editBookEvent = new PlayerEditBookEvent(player.getBukkitEntity(), (itemInHandIndex >= 0 && itemInHandIndex <= 8) ? itemInHandIndex : -1, (BookMeta) CraftItemStack.getItemMeta(itemInHand), (BookMeta) CraftItemStack.getItemMeta(newBookItem), newBookItem.getItem() == Items.WRITTEN_BOOK); - player.level.getServer().getPluginManager().callEvent(editBookEvent); + player.level.getCraftServer().getPluginManager().callEvent(editBookEvent); // If they've got the same item in their hand, it'll need to be updated. if (itemInHand != null && itemInHand.getItem() == Items.WRITABLE_BOOK) { @@ -1327,13 +1327,13 @@ public class CraftEventFactory { public static PlayerUnleashEntityEvent callPlayerUnleashEntityEvent(EntityInsentient entity, EntityHuman player) { PlayerUnleashEntityEvent event = new PlayerUnleashEntityEvent(entity.getBukkitEntity(), (Player) player.getBukkitEntity()); - entity.level.getServer().getPluginManager().callEvent(event); + entity.level.getCraftServer().getPluginManager().callEvent(event); return event; } public static PlayerLeashEntityEvent callPlayerLeashEntityEvent(EntityInsentient entity, Entity leashHolder, EntityHuman player) { PlayerLeashEntityEvent event = new PlayerLeashEntityEvent(entity.getBukkitEntity(), leashHolder.getBukkitEntity(), (Player) player.getBukkitEntity()); - entity.level.getServer().getPluginManager().callEvent(event); + entity.level.getCraftServer().getPluginManager().callEvent(event); return event; } @@ -1393,13 +1393,13 @@ public class CraftEventFactory { event = new PlayerStatisticIncrementEvent(player, stat, current, newValue, material); } } - entityHuman.level.getServer().getPluginManager().callEvent(event); + entityHuman.level.getCraftServer().getPluginManager().callEvent(event); return (Cancellable) event; } public static FireworkExplodeEvent callFireworkExplodeEvent(EntityFireworks firework) { FireworkExplodeEvent event = new FireworkExplodeEvent((Firework) firework.getBukkitEntity()); - firework.level.getServer().getPluginManager().callEvent(event); + firework.level.getCraftServer().getPluginManager().callEvent(event); return event; } @@ -1419,19 +1419,19 @@ public class CraftEventFactory { public static EntityToggleGlideEvent callToggleGlideEvent(EntityLiving entity, boolean gliding) { EntityToggleGlideEvent event = new EntityToggleGlideEvent((LivingEntity) entity.getBukkitEntity(), gliding); - entity.level.getServer().getPluginManager().callEvent(event); + entity.level.getCraftServer().getPluginManager().callEvent(event); return event; } public static EntityToggleSwimEvent callToggleSwimEvent(EntityLiving entity, boolean swimming) { EntityToggleSwimEvent event = new EntityToggleSwimEvent((LivingEntity) entity.getBukkitEntity(), swimming); - entity.level.getServer().getPluginManager().callEvent(event); + entity.level.getCraftServer().getPluginManager().callEvent(event); return event; } public static AreaEffectCloudApplyEvent callAreaEffectCloudApplyEvent(EntityAreaEffectCloud cloud, List entities) { AreaEffectCloudApplyEvent event = new AreaEffectCloudApplyEvent((AreaEffectCloud) cloud.getBukkitEntity(), entities); - cloud.level.getServer().getPluginManager().callEvent(event); + cloud.level.getCraftServer().getPluginManager().callEvent(event); return event; } @@ -1447,7 +1447,7 @@ public class CraftEventFactory { CraftItemStack bredWithStack = bredWith == null ? null : CraftItemStack.asCraftMirror(bredWith).clone(); EntityBreedEvent event = new EntityBreedEvent((LivingEntity) child.getBukkitEntity(), (LivingEntity) mother.getBukkitEntity(), (LivingEntity) father.getBukkitEntity(), breederEntity, bredWithStack, experience); - child.level.getServer().getPluginManager().callEvent(event); + child.level.getCraftServer().getPluginManager().callEvent(event); return event; } @@ -1511,7 +1511,7 @@ public class CraftEventFactory { blockState.setData(block); BlockFormEvent event = (entity == null) ? new BlockFormEvent(blockState.getBlock(), blockState) : new EntityBlockFormEvent(entity.getBukkitEntity(), blockState.getBlock(), blockState); - world.getServer().getPluginManager().callEvent(event); + world.getCraftServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { blockState.update(true);