This commit is contained in:
biglyderv 2024-11-17 15:23:24 -05:00
parent cdec649609
commit a6f4195805
2 changed files with 12 additions and 0 deletions

View file

@ -2,6 +2,7 @@ package net.xuyezo.main;
import java.util.Random;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
@ -12,10 +13,21 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockExplodeEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityPortalEvent;
import org.bukkit.event.player.PlayerPortalEvent;
import org.bukkit.inventory.ItemStack;
public class Handler implements Listener {
@EventHandler
private void onPortalEvent(PlayerPortalEvent e) {
Random random = new Random();
Location t = e.getFrom();
t.multiply(-1);
t.add(0,256,0);
e.setTo(t);
}
@EventHandler
private void onBlockExplode(EntityExplodeEvent e) {
e.setCancelled(true);