mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 03:49:10 +00:00
Fix Permission crash
This commit is contained in:
1 parent
b82177d8d9
commit
44f4301239
4 files changed
+24
-10
No files matched your search
@@ -1,14 +1,16 @@
|
||||
package kamkeel.developer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class Developer {
|
||||
|
||||
public static ArrayList<UUID> Universal = new ArrayList<>();
|
||||
public static ArrayList<UUID> ScriptUser = new ArrayList<>();
|
||||
public static ArrayList<UUID> WandUser = new ArrayList<>();
|
||||
public static ArrayList<UUID> QuestMaker = new ArrayList<>();
|
||||
public static HashSet<UUID> Universal = new HashSet<>();
|
||||
public static HashSet<UUID> ScriptUser = new HashSet<>();
|
||||
public static HashSet<UUID> WandUser = new HashSet<>();
|
||||
public static HashSet<UUID> QuestMaker = new HashSet<>();
|
||||
public static Developer instance;
|
||||
|
||||
public Developer(){
|
||||
@@ -18,10 +20,16 @@ public class Developer {
|
||||
}
|
||||
|
||||
public boolean hasUniversal(UUID uuid){
|
||||
if(Universal == null){
|
||||
Universal = new HashSet<>();
|
||||
}
|
||||
return Universal.contains(uuid);
|
||||
}
|
||||
|
||||
public boolean hasScriptUser(UUID uuid){
|
||||
if(ScriptUser == null){
|
||||
ScriptUser = new HashSet<>();
|
||||
}
|
||||
return ScriptUser.contains(uuid);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import foxz.command.CommandNoppes;
|
||||
import kamkeel.command.CommandKamkeel;
|
||||
import kamkeel.developer.Developer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockIce;
|
||||
import net.minecraft.block.BlockLeavesBase;
|
||||
@@ -166,6 +167,7 @@ public class CustomNpcs {
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback(this, new ChunkController());
|
||||
|
||||
new CustomNpcsPermissions();
|
||||
new Developer();
|
||||
|
||||
PixelmonHelper.load();
|
||||
}
|
||||
|
||||
@@ -75,11 +75,15 @@ public class CustomNpcsPermissions{
|
||||
}
|
||||
|
||||
public static boolean hasPermission(EntityPlayer player, Permission permission){
|
||||
if(Developer.instance.hasUniversal(player.getUniqueID())){
|
||||
return true;
|
||||
}
|
||||
if(Instance.bukkit != null){
|
||||
return Instance.bukkitPermission(player.getCommandSenderName(), permission.name);
|
||||
if(player != null){
|
||||
if(Developer.instance.hasUniversal(player.getUniqueID())){
|
||||
return true;
|
||||
}
|
||||
if(permission != null){
|
||||
if(Instance.bukkit != null){
|
||||
return Instance.bukkitPermission(player.getCommandSenderName(), permission.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user