summaryrefslogtreecommitdiff
path: root/common/darkknight/jewelrycraft/util/PlayerUtils.java
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2014-04-14 11:58:43 +0300
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2014-04-14 11:58:43 +0300
commit1a692ab45df3d88a6cc247cc9f4c0a41c7715264 (patch)
tree1854960d78be20ef09c9f098f5e2eb92837019dd /common/darkknight/jewelrycraft/util/PlayerUtils.java
parentf965cf88704f1e5e674d98308cbe0f4451d7edeb (diff)
Updating to 1.7
Diffstat (limited to 'common/darkknight/jewelrycraft/util/PlayerUtils.java')
-rw-r--r--common/darkknight/jewelrycraft/util/PlayerUtils.java57
1 files changed, 0 insertions, 57 deletions
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