mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 21:54:08 +00:00
Merge branch 'master' into dev
This commit is contained in:
commit
27842e68ea
5 files changed
+50
-17
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;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.client.gui.player.GuiFaction;
|
||||
import noppes.npcs.client.gui.player.GuiQuestLog;
|
||||
import noppes.npcs.util.CustomNPCsScheduler;
|
||||
|
||||
public class InventoryTabFactions extends AbstractTab {
|
||||
@@ -16,10 +17,19 @@ public class InventoryTabFactions extends AbstractTab {
|
||||
|
||||
@Override
|
||||
public void onTabClicked() {
|
||||
CustomNPCsScheduler.runTack(() -> {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.displayGuiScreen(new GuiFaction());
|
||||
}, 100);
|
||||
Thread t = new Thread(){
|
||||
@Override
|
||||
public void run(){
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.displayGuiScreen(new GuiFaction());
|
||||
}
|
||||
};
|
||||
t.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,10 +19,19 @@ public class InventoryTabQuests extends AbstractTab {
|
||||
|
||||
@Override
|
||||
public void onTabClicked() {
|
||||
CustomNPCsScheduler.runTack(() -> {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.displayGuiScreen(new GuiQuestLog(mc.thePlayer));
|
||||
}, 100);
|
||||
Thread t = new Thread(){
|
||||
@Override
|
||||
public void run(){
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.displayGuiScreen(new GuiQuestLog(mc.thePlayer));
|
||||
}
|
||||
};
|
||||
t.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user