mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 14:14:46 +00:00
Scripted player tick events are functional, GUI for player events is complete. Global player events run as they should now, just need to start implementing more of them.
This commit is contained in:
1 parent
6aa98aecf3
commit
1ee14920ff
26 files changed
+1223
-1091
No files matched your search
@@ -3,14 +3,14 @@ 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.controllers.data.PlayerDataScript;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.entity.data.DataTimers;
|
||||
import noppes.npcs.roles.RoleCompanion;
|
||||
|
||||
public class PlayerData implements IExtendedEntityProperties{
|
||||
@@ -21,7 +21,9 @@ public class PlayerData implements IExtendedEntityProperties{
|
||||
public PlayerFactionData factionData = new PlayerFactionData();
|
||||
public PlayerItemGiverData itemgiverData = new PlayerItemGiverData();
|
||||
public PlayerMailData mailData = new PlayerMailData();
|
||||
public PlayerScriptData scriptData;
|
||||
public PlayerDataScript scriptData;
|
||||
public int playerLevel = 0;
|
||||
public DataTimers timers = new DataTimers(this);
|
||||
|
||||
public EntityNPCInterface editingNpc;
|
||||
public NBTTagCompound cloned;
|
||||
@@ -55,8 +57,8 @@ public class PlayerData implements IExtendedEntityProperties{
|
||||
transportData.loadNBTData(data);
|
||||
factionData.loadNBTData(data);
|
||||
itemgiverData.loadNBTData(data);
|
||||
mailData.loadNBTData(data);
|
||||
|
||||
mailData.loadNBTData(data);
|
||||
timers.readFromNBT(data);
|
||||
|
||||
if(player != null){
|
||||
playername = player.getCommandSenderName();
|
||||
@@ -91,7 +93,8 @@ public class PlayerData implements IExtendedEntityProperties{
|
||||
factionData.saveNBTData(compound);
|
||||
itemgiverData.saveNBTData(compound);
|
||||
mailData.saveNBTData(compound);
|
||||
|
||||
timers.writeToNBT(compound);
|
||||
|
||||
compound.setString("PlayerName", playername);
|
||||
compound.setString("UUID", uuid);
|
||||
compound.setInteger("PlayerCompanionId", companionID);
|
||||
@@ -149,7 +152,7 @@ public class PlayerData implements IExtendedEntityProperties{
|
||||
PlayerData data = new PlayerData();
|
||||
if(data.player == null) {
|
||||
data.player = player;
|
||||
data.scriptData = new PlayerScriptData(player);
|
||||
data.scriptData = new PlayerDataScript(player);
|
||||
NBTTagCompound compound = PlayerDataController.instance.loadPlayerDataOld(player.getCommandSenderName());
|
||||
|
||||
data.setNBT(compound);
|
||||
|
||||
Reference in new issue
Block a user