Skip to content

Commit

Permalink
Remove forge world load event hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Jan 26, 2024
1 parent 51b2ca2 commit 0a6af26
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,10 @@
import net.minecraftforge.eventbus.api.SubscribeEvent;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_16_R3.CraftServer;
import org.bukkit.craftbukkit.v1_16_R3.CraftWorld;
import org.bukkit.event.world.WorldInitEvent;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.event.world.WorldSaveEvent;

public class WorldEventDispatcher {

//For WorldLoadEvent
@SubscribeEvent(receiveCanceled = true)
public void onWorldLoadEvent(WorldEvent.Load event) {
if (event.getWorld() instanceof ServerWorld) {
ServerWorld handle = (ServerWorld) event.getWorld();
CraftWorld craftWorld = handle.getWorld();
Bukkit.getPluginManager().callEvent(new WorldLoadEvent(craftWorld));
Bukkit.getPluginManager().callEvent(new WorldInitEvent(craftWorld));
}
}

//For WorldSaveEvent
@SubscribeEvent(receiveCanceled = true)
public void onWorldSaveEvent(WorldEvent.Save event) {
Expand Down

0 comments on commit 0a6af26

Please sign in to comment.