diff options
| author | Alkalus <draknyte1@hotmail.com> | 2017-11-27 13:10:57 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-27 13:10:57 +1000 |
| commit | a42842e4e93525a64d0b2efc0d68115a59acb20c (patch) | |
| tree | 55f4c3c6635c1d94ff22abf90b486638661b930f /src/Java/gtPlusPlus/core/util/player | |
| parent | 5d4d3fb679c8af83ed5ee14430c6cde0b16cfcc6 (diff) | |
| parent | 066bd6475ce142f405d521975b1d4105ccaddf0d (diff) | |
| download | GT5-Unofficial-a42842e4e93525a64d0b2efc0d68115a59acb20c.tar.gz GT5-Unofficial-a42842e4e93525a64d0b2efc0d68115a59acb20c.tar.bz2 GT5-Unofficial-a42842e4e93525a64d0b2efc0d68115a59acb20c.zip | |
Merge pull request #156 from draknyte1/Multiblock-Fix
Multiblock fix for #141, other misc. fixes & a few new additions.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/player')
| -rw-r--r-- | src/Java/gtPlusPlus/core/util/player/PlayerUtils.java | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/Java/gtPlusPlus/core/util/player/PlayerUtils.java b/src/Java/gtPlusPlus/core/util/player/PlayerUtils.java index 543fd65b71..f1462ba51e 100644 --- a/src/Java/gtPlusPlus/core/util/player/PlayerUtils.java +++ b/src/Java/gtPlusPlus/core/util/player/PlayerUtils.java @@ -1,6 +1,9 @@ package gtPlusPlus.core.util.player; -import java.util.*; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -104,7 +107,7 @@ public class PlayerUtils { }catch(final NullPointerException e){ e.printStackTrace(); return null; - } + } if (heldItem != null){ return heldItem; } @@ -125,32 +128,32 @@ public class PlayerUtils { return null; } - - public static Item getItemInPlayersHand(EntityPlayer player){ + + public static Item getItemInPlayersHand(final EntityPlayer player){ Item heldItem = null; - try{heldItem = player.getHeldItem().getItem(); + try{ + heldItem = player.getHeldItem().getItem(); }catch(final NullPointerException e){return null;} if (heldItem != null){ return heldItem; } - return null; } - - public final static EntityPlayer getPlayerEntityByName(String aPlayerName){ - EntityPlayer player = PlayerUtils.getPlayer(aPlayerName); + + public final static EntityPlayer getPlayerEntityByName(final String aPlayerName){ + final EntityPlayer player = PlayerUtils.getPlayer(aPlayerName); if (player != null){ return player; - } + } return null; } - - public final static UUID getPlayersUUIDByName(String aPlayerName){ - EntityPlayer player = PlayerUtils.getPlayer(aPlayerName); + + public final static UUID getPlayersUUIDByName(final String aPlayerName){ + final EntityPlayer player = PlayerUtils.getPlayer(aPlayerName); if (player != null){ return player.getUniqueID(); - } + } return null; } |
