mirror of
https://github.com/trainerlord/WorldSystem.git
synced 2024-12-02 13:23:21 +01:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
a34ceee74b
@ -10,6 +10,7 @@ import org.bukkit.event.block.BlockBurnEvent;
|
|||||||
import org.bukkit.event.block.BlockIgniteEvent;
|
import org.bukkit.event.block.BlockIgniteEvent;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
|
import org.bukkit.event.player.PlayerBucketEmptyEvent;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -41,6 +42,22 @@ public class BlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlaceLiquid(PlayerBucketEmptyEvent e) {
|
||||||
|
Player p = e.getPlayer();
|
||||||
|
if (p.hasPermission("ws.build"))
|
||||||
|
return;
|
||||||
|
String worldname = p.getWorld().getName();
|
||||||
|
WorldPlayer wp = new WorldPlayer(p, worldname);
|
||||||
|
if (!wp.isOnSystemWorld())
|
||||||
|
return;
|
||||||
|
if (!wp.isMember())
|
||||||
|
e.setCancelled(true);
|
||||||
|
if (!wp.isOwnerofWorld()) {
|
||||||
|
e.setCancelled(!wp.canBuild());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBreak(BlockBreakEvent e) {
|
public void onBreak(BlockBreakEvent e) {
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
|
Loading…
Reference in New Issue
Block a user