mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2026-06-24 21:41:57 +00:00
2.11.1
Nether Worlds are forced minimum y > 0 Vault permission support
This commit is contained in:
@@ -4,7 +4,7 @@ import me.SuperRonanCraft.BetterRTP.player.PlayerInfo;
|
|||||||
import me.SuperRonanCraft.BetterRTP.player.RTP;
|
import me.SuperRonanCraft.BetterRTP.player.RTP;
|
||||||
import me.SuperRonanCraft.BetterRTP.player.commands.Commands;
|
import me.SuperRonanCraft.BetterRTP.player.commands.Commands;
|
||||||
import me.SuperRonanCraft.BetterRTP.player.events.Listener;
|
import me.SuperRonanCraft.BetterRTP.player.events.Listener;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.Econ;
|
import me.SuperRonanCraft.BetterRTP.references.depends.DepEconomy;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.Permissions;
|
import me.SuperRonanCraft.BetterRTP.references.Permissions;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.Updater;
|
import me.SuperRonanCraft.BetterRTP.references.Updater;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.file.Files;
|
import me.SuperRonanCraft.BetterRTP.references.file.Files;
|
||||||
@@ -21,7 +21,7 @@ import java.util.List;
|
|||||||
public class Main extends JavaPlugin {
|
public class Main extends JavaPlugin {
|
||||||
private Permissions perms = new Permissions();
|
private Permissions perms = new Permissions();
|
||||||
private Messages text = new Messages(this);
|
private Messages text = new Messages(this);
|
||||||
private Econ eco = new Econ();
|
private DepEconomy eco = new DepEconomy();
|
||||||
private Commands cmd = new Commands(this);
|
private Commands cmd = new Commands(this);
|
||||||
private RTP rtp = new RTP(this);
|
private RTP rtp = new RTP(this);
|
||||||
private Listener listener = new Listener();
|
private Listener listener = new Listener();
|
||||||
@@ -75,7 +75,7 @@ public class Main extends JavaPlugin {
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Econ getEco() {
|
public DepEconomy getEco() {
|
||||||
return eco;
|
return eco;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,5 +114,6 @@ public class Main extends JavaPlugin {
|
|||||||
cmd.load();
|
cmd.load();
|
||||||
listener.load();
|
listener.load();
|
||||||
eco.load();
|
eco.load();
|
||||||
|
perms.register();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import me.SuperRonanCraft.BetterRTP.references.file.FileBasics;
|
|||||||
import me.SuperRonanCraft.BetterRTP.references.worlds.*;
|
import me.SuperRonanCraft.BetterRTP.references.worlds.*;
|
||||||
import me.ryanhamshire.GriefPrevention.GriefPrevention;
|
import me.ryanhamshire.GriefPrevention.GriefPrevention;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.block.Biome;
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -21,7 +20,7 @@ import java.util.Random;
|
|||||||
|
|
||||||
public class RTP {
|
public class RTP {
|
||||||
|
|
||||||
private Main pl;
|
private final Main pl;
|
||||||
//Cache
|
//Cache
|
||||||
public HashMap<String, RTPWorld> customWorlds = new HashMap<>();
|
public HashMap<String, RTPWorld> customWorlds = new HashMap<>();
|
||||||
public HashMap<String, String> overriden = new HashMap<>();
|
public HashMap<String, String> overriden = new HashMap<>();
|
||||||
@@ -359,7 +358,7 @@ public class RTP {
|
|||||||
|
|
||||||
private Location getLocAtNether(int x, int z, World world, Float yaw, Float pitch, PlayerWorld pWorld) {
|
private Location getLocAtNether(int x, int z, World world, Float yaw, Float pitch, PlayerWorld pWorld) {
|
||||||
//System.out.println("-----------");
|
//System.out.println("-----------");
|
||||||
for (int y = 0; y < world.getMaxHeight(); y++) {
|
for (int y = 1; y < world.getMaxHeight(); y++) {
|
||||||
// System.out.println("--");
|
// System.out.println("--");
|
||||||
Block block_current = world.getBlockAt(x, y, z);
|
Block block_current = world.getBlockAt(x, y, z);
|
||||||
//System.out.println(block_current.getType().name());
|
//System.out.println(block_current.getType().name());
|
||||||
|
|||||||
@@ -1,18 +1,25 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP.references;
|
package me.SuperRonanCraft.BetterRTP.references;
|
||||||
|
|
||||||
|
import me.SuperRonanCraft.BetterRTP.references.depends.DepPerms;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
public class Permissions {
|
public class Permissions {
|
||||||
|
|
||||||
private String pre = "betterrtp.";
|
private DepPerms depPerms = new DepPerms();
|
||||||
|
|
||||||
|
public void register() {
|
||||||
|
depPerms.register();
|
||||||
|
}
|
||||||
|
|
||||||
|
private final String pre = "betterrtp.";
|
||||||
|
|
||||||
public boolean getUse(CommandSender sendi) {
|
public boolean getUse(CommandSender sendi) {
|
||||||
return perm(pre + "use", sendi);
|
return perm(pre + "use", sendi);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean getEconomy(CommandSender sendi) {
|
public boolean getEconomy(CommandSender sendi) {
|
||||||
return perm(pre + "bypass.economy", sendi);
|
return perm(pre + "bypass.economy", sendi);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,6 +76,6 @@ public class Permissions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean perm(String str, CommandSender sendi) {
|
private boolean perm(String str, CommandSender sendi) {
|
||||||
return sendi.hasPermission(str);
|
return depPerms.hasPerm(str, sendi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP.references;
|
package me.SuperRonanCraft.BetterRTP.references.depends;
|
||||||
|
|
||||||
import me.SuperRonanCraft.BetterRTP.references.file.FileBasics;
|
import me.SuperRonanCraft.BetterRTP.references.file.FileBasics;
|
||||||
import me.SuperRonanCraft.BetterRTP.Main;
|
import me.SuperRonanCraft.BetterRTP.Main;
|
||||||
@@ -7,7 +7,7 @@ import net.milkbowl.vault.economy.EconomyResponse;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||||
|
|
||||||
public class Econ {
|
public class DepEconomy {
|
||||||
private Economy e;
|
private Economy e;
|
||||||
private boolean checked = false;
|
private boolean checked = false;
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package me.SuperRonanCraft.BetterRTP.references.depends;
|
||||||
|
|
||||||
|
import me.SuperRonanCraft.BetterRTP.Main;
|
||||||
|
import net.milkbowl.vault.permission.Permission;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||||
|
|
||||||
|
public class DepPerms {
|
||||||
|
public Permission p = null;
|
||||||
|
|
||||||
|
public boolean hasPerm(String perm, CommandSender sendi) {
|
||||||
|
//sendi.sendMessage(perm);
|
||||||
|
if (p != null)
|
||||||
|
return p.has(sendi, perm);
|
||||||
|
return sendi.hasPermission(perm);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void register() {
|
||||||
|
try {
|
||||||
|
if (Main.getInstance().getServer().getPluginManager().isPluginEnabled("Vault")) {
|
||||||
|
RegisteredServiceProvider<Permission> permissionProvider = Main.getInstance().getServer()
|
||||||
|
.getServicesManager().getRegistration(Permission.class);
|
||||||
|
p = permissionProvider.getProvider();
|
||||||
|
} else
|
||||||
|
p = null;
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
//Vault but no Perms
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
main: me.SuperRonanCraft.BetterRTP.Main
|
main: me.SuperRonanCraft.BetterRTP.Main
|
||||||
version: 2.11.0
|
version: 2.11.1
|
||||||
name: BetterRTP
|
name: BetterRTP
|
||||||
author: SuperRonanCraft
|
author: SuperRonanCraft
|
||||||
softdepend: [Vault, WorldGuard, GriefPrevention, Factions]
|
softdepend: [Vault, WorldGuard, GriefPrevention, Factions]
|
||||||
|
|||||||
Reference in New Issue
Block a user