mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 20:52:36 +00:00
Auction Fixes + Auction API Hookup
This commit is contained in:
1 parent
64c29377c4
commit
3577701edf
29 files changed
+1897
-1013
No files matched your search
@@ -5,6 +5,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.PlayerTradeData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -19,7 +20,10 @@ public class CNPCData implements IProfileData {
|
||||
@Override
|
||||
public NBTTagCompound getCurrentNBT(EntityPlayer player) {
|
||||
PlayerData customNPCData = PlayerData.get(player);
|
||||
return customNPCData.getNBT();
|
||||
NBTTagCompound compound = customNPCData.getNBT();
|
||||
compound.removeTag(PlayerTradeData.NBT_KEY);
|
||||
|
||||
return compound;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -32,6 +36,10 @@ public class CNPCData implements IProfileData {
|
||||
@Override
|
||||
public void setNBT(EntityPlayer player, NBTTagCompound replace) {
|
||||
PlayerData customNPCData = PlayerData.get(player);
|
||||
|
||||
NBTTagCompound sharedData = new NBTTagCompound();
|
||||
customNPCData.tradeData.writeToNBT(sharedData);
|
||||
|
||||
if (replace.hasNoTags()) {
|
||||
PlayerData newData = new PlayerData();
|
||||
newData.player = player;
|
||||
@@ -39,6 +47,8 @@ public class CNPCData implements IProfileData {
|
||||
} else {
|
||||
customNPCData.setNBT(replace);
|
||||
}
|
||||
|
||||
customNPCData.tradeData.readFromNBT(sharedData);
|
||||
customNPCData.updateClient = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user