mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 02:39:05 +00:00
Backported GUI features and necessary classes from 1.12.
This commit is contained in:
1 parent
8b6e84a8d4
commit
95d2814651
46 files changed
+3675
-520
No files matched your search
@@ -3,9 +3,12 @@ package noppes.npcs.controllers;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IExtendedEntityProperties;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.constants.EnumRoleType;
|
||||
import noppes.npcs.controllers.data.PlayerScriptData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleCompanion;
|
||||
@@ -18,7 +21,8 @@ public class PlayerData implements IExtendedEntityProperties{
|
||||
public PlayerFactionData factionData = new PlayerFactionData();
|
||||
public PlayerItemGiverData itemgiverData = new PlayerItemGiverData();
|
||||
public PlayerMailData mailData = new PlayerMailData();
|
||||
|
||||
public PlayerScriptData scriptData;
|
||||
|
||||
public EntityNPCInterface editingNpc;
|
||||
public NBTTagCompound cloned;
|
||||
|
||||
@@ -138,4 +142,20 @@ public class PlayerData implements IExtendedEntityProperties{
|
||||
world.spawnEntityInWorld(npc);
|
||||
}
|
||||
|
||||
public static PlayerData get(EntityPlayer player) {
|
||||
if(player.worldObj.isRemote) {
|
||||
return CustomNpcs.proxy.getPlayerData(player);
|
||||
} else {
|
||||
PlayerData data = new PlayerData();
|
||||
if(data.player == null) {
|
||||
data.player = player;
|
||||
data.scriptData = new PlayerScriptData(player);
|
||||
NBTTagCompound compound = PlayerDataController.instance.loadPlayerDataOld(player.getCommandSenderName());
|
||||
|
||||
data.setNBT(compound);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user