From 1a692ab45df3d88a6cc247cc9f4c0a41c7715264 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Mon, 14 Apr 2014 11:58:43 +0300 Subject: Updating to 1.7 --- .../darkknight/jewelrycraft/util/PlayerUtils.java | 57 ---------------------- 1 file changed, 57 deletions(-) delete mode 100644 common/darkknight/jewelrycraft/util/PlayerUtils.java (limited to 'common/darkknight/jewelrycraft/util/PlayerUtils.java') diff --git a/common/darkknight/jewelrycraft/util/PlayerUtils.java b/common/darkknight/jewelrycraft/util/PlayerUtils.java deleted file mode 100644 index 65b8a17..0000000 --- a/common/darkknight/jewelrycraft/util/PlayerUtils.java +++ /dev/null @@ -1,57 +0,0 @@ -package darkknight.jewelrycraft.util; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.integrated.IntegratedServer; -import cpw.mods.fml.common.FMLCommonHandler; - -/** - * Code taken from OpenBlocks - */ -public class PlayerUtils -{ - public static boolean isPlayerOp(String username) - { - username = username.toLowerCase(); - - MinecraftServer server = FMLCommonHandler.instance().getSidedDelegate().getServer(); - - // SP and LAN - if (server.isSinglePlayer()) { - if (server instanceof IntegratedServer) return server.getServerOwner().equals(username); - return server.getConfigurationManager().getOps().contains(username); - } - - // SMP - return server.getConfigurationManager().getOps().contains(username); - } - - public static NBTTagCompound getModPlayerPersistTag(EntityPlayer player, String modName) - { - - NBTTagCompound tag = player.getEntityData(); - - NBTTagCompound persistTag = null; - if (tag.hasKey(EntityPlayer.PERSISTED_NBT_TAG)) - { - persistTag = tag.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG); - } else - { - persistTag = new NBTTagCompound(); - tag.setCompoundTag(EntityPlayer.PERSISTED_NBT_TAG, persistTag); - } - - NBTTagCompound modTag = null; - if (persistTag.hasKey(modName)) - { - modTag = persistTag.getCompoundTag(modName); - } else - { - modTag = new NBTTagCompound(); - persistTag.setCompoundTag(modName, modTag); - } - - return modTag; - } -} \ No newline at end of file -- cgit v1.2.3