use of br.net.fabiozumbi12.RedProtect.Sponge.listeners.RPEntityListener in project RedProtect by FabioZumbi12.
the class RPEntityListener method onPlayerFrostWalk.
@EventHandler
public void onPlayerFrostWalk(EntityBlockFormEvent e) {
if (e.getEntity() instanceof Player) {
return;
}
RedProtect.get().logger.debug("RPEntityListener - EntityBlockFormEvent canceled? " + e.isCancelled());
Region r = RedProtect.get().rm.getTopRegion(e.getBlock().getLocation());
if (r != null && !r.canIceForm()) {
e.setCancelled(true);
}
}
use of br.net.fabiozumbi12.RedProtect.Sponge.listeners.RPEntityListener in project RedProtect by FabioZumbi12.
the class RedProtect method onServerStart.
@Listener
public void onServerStart(GameStartedServerEvent event) {
try {
String v = Sponge.getGame().getPlatform().getContainer(Component.API).getVersion().get();
instance = this;
if (v.startsWith("5") || v.startsWith("6")) {
pvhelp = (RPVHelper) Class.forName("br.net.fabiozumbi12.RedProtect.Sponge.RPVHelper56").newInstance();
}
if (v.startsWith("7")) {
pvhelp = (RPVHelper) Class.forName("br.net.fabiozumbi12.RedProtect.Sponge.RPVHelper7").newInstance();
}
initVars();
OnlineMode = serv.getOnlineMode();
cmdService.register(container, new RPCommands(), Arrays.asList("redprotect", "rp", "regionp", "regp"));
game.getEventManager().registerListeners(container, new RPGlobalListener());
game.getEventManager().registerListeners(container, new RPBlockListener());
game.getEventManager().registerListeners(container, new RPPlayerListener());
game.getEventManager().registerListeners(container, new RPEntityListener());
game.getEventManager().registerListeners(container, new RPWorldListener());
game.getEventManager().registerListeners(container, new RPMine18());
game.getEventManager().registerListeners(container, new RPAddProtection());
loadRegions();
logger.info("Loading API...");
this.rpAPI = new RedProtectAPI();
logger.info("API Loaded!");
logger.clear("&4 _ _ _ &c _ _ _ _ _ _ _ _ _ __");
logger.clear("&4|_| |_ | \\ &c|_| |_| | | | |_ | | / ");
logger.clear("&4| \\ |_ |_/ &c| | \\ |_| | |_ |_ | /");
logger.clear("&a¯ Redprotect " + container.getVersion().get() + " enabled");
logger.clear("");
} catch (Exception e) {
e.printStackTrace();
logger.severe("Error enabling RedProtect, plugin will shut down.");
}
}
Aggregations