mirror of
https://github.com/GTNewHorizons/Baubles-Expanded.git
synced 2026-11-22 12:59:46 +00:00
Some bugfixes and improvements
This commit is contained in:
1 parent
ff405853bf
commit
f975878a32
20 files changed
+68
-51
No files matched your search
@@ -7,9 +7,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
|
||||
public class PlayerHandler {
|
||||
private HashMap<String,InventoryBaubles> playerBaubles = new HashMap<String,InventoryBaubles>();
|
||||
private static HashMap<String,InventoryBaubles> playerBaubles = new HashMap<String,InventoryBaubles>();
|
||||
|
||||
public InventoryBaubles getPlayerBaubles(EntityPlayer player) {
|
||||
public static InventoryBaubles getPlayerBaubles(EntityPlayer player) {
|
||||
if (!playerBaubles.containsKey(player.getCommandSenderName())) {
|
||||
InventoryBaubles inventory = new InventoryBaubles(player);
|
||||
playerBaubles.put(player.getCommandSenderName(), inventory);
|
||||
@@ -17,16 +17,16 @@ public class PlayerHandler {
|
||||
return playerBaubles.get(player.getCommandSenderName());
|
||||
}
|
||||
|
||||
public void setPlayerBaubles(EntityPlayer player, InventoryBaubles inventory) {
|
||||
public static void setPlayerBaubles(EntityPlayer player, InventoryBaubles inventory) {
|
||||
playerBaubles.put(player.getCommandSenderName(), inventory);
|
||||
}
|
||||
|
||||
public void updatePlayerBaubles(EntityPlayer player) {
|
||||
public static void updatePlayerBaubles(EntityPlayer player) {
|
||||
InventoryBaubles inventory = getPlayerBaubles(player);
|
||||
inventory.saveNBT(player);
|
||||
}
|
||||
|
||||
public void loadPlayerBaubles(EntityPlayer player) {
|
||||
public static void loadPlayerBaubles(EntityPlayer player) {
|
||||
NBTTagCompound data = player.getEntityData();
|
||||
if (!data.hasKey("Baubles")) {
|
||||
data.setTag("Baubles", new NBTTagCompound());
|
||||
|
||||
Reference in new issue
Block a user