Wrapper Naming Improvement Scheme

This commit is contained in:
Kam committed 2026-03-13 21:26:54 -04:00
1 parent 3a8b75f152
commit 11a4d0b61d
94 files changed
+558 -370

No files matched your search

@@ -5,7 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import noppes.npcs.EventHooks;
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
import noppes.npcs.wrapper.nbt.NBTWrapper;
import noppes.npcs.api.handler.data.IAnimation;
import noppes.npcs.api.handler.data.IAnimationData;
import noppes.npcs.api.handler.data.IFrame;
@@ -226,7 +226,7 @@ public class Animation implements IAnimation {
Frame frame = new Frame();
frame.parentSpeed = this.speed;
frame.parentSmooth = this.smooth;
frame.readFromNBT(new MC1710NBTCompound(item));
frame.readFromNBT(new NBTWrapper(item));
frames.add(frame);
}
this.frames = frames;
@@ -249,7 +249,7 @@ public class Animation implements IAnimation {
NBTTagList list = new NBTTagList();
for (Frame frame : frames) {
NBTTagCompound item = ((MC1710NBTCompound) frame.writeToNBT()).getMCTag();
NBTTagCompound item = ((NBTWrapper) frame.writeToNBT()).getMCTag();
list.appendTag(item);
}
compound.setTag("Frames", list);
@@ -2,7 +2,7 @@ package noppes.npcs.controllers.data;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.api.handler.data.IAnimation;
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
import noppes.npcs.wrapper.nbt.NBTWrapper;
/**
* A read-only animation loaded from mod assets.
@@ -81,7 +81,7 @@ public class BuiltInAnimation extends Animation {
Frame frame = new Frame();
frame.parentSpeed = this.speed;
frame.parentSmooth = this.smooth;
frame.readFromNBT(new MC1710NBTCompound(item));
frame.readFromNBT(new NBTWrapper(item));
frames.add(frame);
}
@@ -13,7 +13,7 @@ import noppes.npcs.api.handler.data.IDialogOption;
import noppes.npcs.api.handler.data.IQuest;
import noppes.npcs.config.ConfigMain;
import noppes.npcs.constants.EnumOptionType;
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
import noppes.npcs.wrapper.nbt.NBTWrapper;
import noppes.npcs.controllers.DialogController;
import noppes.npcs.controllers.QuestController;
import noppes.npcs.scripted.CustomNPCsException;
@@ -126,7 +126,7 @@ public class Dialog implements ICompatibilty, IDialog {
NBTTagCompound imageCompound = images.getCompoundTagAt(i);
int id = imageCompound.getInteger("ID");
DialogImage image = new DialogImage(id);
image.readNBT(new MC1710NBTCompound(imageCompound));
image.readNBT(new NBTWrapper(imageCompound));
newImages.put(id, image);
}
this.dialogImages = newImages;
@@ -174,7 +174,7 @@ public class Dialog implements ICompatibilty, IDialog {
availability.readFromNBT(compound);
factionOptions.readFromNBT(compound);
colorData.readFromNBT(new MC1710NBTCompound(compound));
colorData.readFromNBT(new NBTWrapper(compound));
}
@@ -210,7 +210,7 @@ public class Dialog implements ICompatibilty, IDialog {
availability.writeToNBT(compound);
factionOptions.writeToNBT(compound);
colorData.writeToNBT(new MC1710NBTCompound(compound));
colorData.writeToNBT(new NBTWrapper(compound));
compound.setInteger("ModRev", version);
compound.setInteger("Color", color);
@@ -237,7 +237,7 @@ public class Dialog implements ICompatibilty, IDialog {
NBTTagList images = new NBTTagList();
for (IDialogImage dialogImage : dialogImages.values()) {
NBTTagCompound imageCompound = ((MC1710NBTCompound) ((DialogImage) dialogImage).writeToNBT(new MC1710NBTCompound(new NBTTagCompound()))).getMCTag();
NBTTagCompound imageCompound = ((NBTWrapper) ((DialogImage) dialogImage).writeToNBT(new NBTWrapper(new NBTTagCompound()))).getMCTag();
images.appendTag(imageCompound);
}
compound.setTag("Images", images);
@@ -10,7 +10,7 @@ import noppes.npcs.api.item.IItemStack;
import noppes.npcs.controllers.LinkedItemController;
import noppes.npcs.controllers.TagController;
import noppes.npcs.scripted.NpcAPI;
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
import noppes.npcs.wrapper.nbt.NBTWrapper;
import noppes.npcs.scripted.item.ScriptLinkedItem;
import java.util.HashSet;
@@ -58,7 +58,7 @@ public class LinkedItem implements ILinkedItem {
compound.setInteger("Version", this.version);
compound.setString("Name", this.name);
compound.setTag("Display", ((MC1710NBTCompound) this.display.writeToNBT()).getMCTag());
compound.setTag("Display", ((NBTWrapper) this.display.writeToNBT()).getMCTag());
compound.setDouble("DurabilityValue", this.durabilityValue);
compound.setInteger("MaxStackSize", this.stackSize);
@@ -91,7 +91,7 @@ public class LinkedItem implements ILinkedItem {
this.name = compound.getString("Name");
this.version = compound.getInteger("Version");
this.display.readFromNBT(new MC1710NBTCompound(compound.getCompoundTag("Display")));
this.display.readFromNBT(new NBTWrapper(compound.getCompoundTag("Display")));
this.durabilityValue = compound.getDouble("DurabilityValue");
this.stackSize = compound.getInteger("MaxStackSize");
@@ -7,7 +7,7 @@ import kamkeel.npcs.network.packets.data.ability.AbilityHotbarSyncPacket;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
import noppes.npcs.wrapper.nbt.NBTWrapper;
public class PlayerAbilityHotbarData {
public AbilityHotbarData[] slots = new AbilityHotbarData[AbilityHotbarData.TOTAL_SLOTS];
@@ -42,14 +42,14 @@ public class PlayerAbilityHotbarData {
public void writeToNBT(NBTTagCompound compound) {
for (int i = 0; i < slots.length; i++) {
slots[i].writeToNBT(new MC1710NBTCompound(compound));
slots[i].writeToNBT(new NBTWrapper(compound));
}
}
public void readFromNBT(NBTTagCompound compound) {
for (int i = 0; i < slots.length; i++) {
NBTTagCompound slotTag = compound.getCompoundTag("AbilityHotbar" + i);
slots[i].readFromNBT(new MC1710NBTCompound(slotTag));
slots[i].readFromNBT(new NBTWrapper(slotTag));
}
validateSlots();
}
@@ -27,7 +27,7 @@ import noppes.npcs.api.handler.IPlayerQuestData;
import noppes.npcs.api.handler.IPlayerTradeData;
import noppes.npcs.api.handler.IPlayerTransportData;
import noppes.npcs.config.ConfigMain;
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
import noppes.npcs.wrapper.nbt.NBTWrapper;
import noppes.npcs.constants.EnumRoleType;
import noppes.npcs.controllers.CustomEffectController;
import noppes.npcs.controllers.PartyController;
@@ -141,18 +141,18 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
}
public void setNBT(NBTTagCompound data) {
dialogData.loadNBTData(new MC1710NBTCompound(data));
dialogData.loadNBTData(new NBTWrapper(data));
bankData.loadNBTData(data);
questData.loadNBTData(data);
transportData.loadNBTData(new MC1710NBTCompound(data));
transportData.loadNBTData(new NBTWrapper(data));
factionData.loadNBTData(data);
itemgiverData.loadNBTData(data);
mailData.loadNBTData(data);
timers.readFromNBT(data);
skinOverlays.readFromNBT(data);
animationData.readFromNBT(data);
effectData.readFromNBT(new MC1710NBTCompound(data));
magicData.readToNBT(new MC1710NBTCompound(data));
effectData.readFromNBT(new NBTWrapper(data));
magicData.readToNBT(new NBTWrapper(data));
tradeData.readFromNBT(data);
abilityData.readFromNBT(data);
hotbarData.readFromNBT(data);
@@ -186,18 +186,18 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
uuid = player.getPersistentID().toString();
}
NBTTagCompound compound = new NBTTagCompound();
dialogData.saveNBTData(new MC1710NBTCompound(compound));
dialogData.saveNBTData(new NBTWrapper(compound));
bankData.saveNBTData(compound);
questData.saveNBTData(compound);
transportData.saveNBTData(new MC1710NBTCompound(compound));
transportData.saveNBTData(new NBTWrapper(compound));
factionData.saveNBTData(compound);
itemgiverData.saveNBTData(compound);
mailData.saveNBTData(compound);
timers.writeToNBT(compound);
skinOverlays.writeToNBT(compound);
animationData.writeToNBT(compound);
effectData.writeToNBT(new MC1710NBTCompound(compound));
magicData.writeToNBT(new MC1710NBTCompound(compound));
effectData.writeToNBT(new NBTWrapper(compound));
magicData.writeToNBT(new NBTWrapper(compound));
tradeData.writeToNBT(compound);
abilityData.writeToNBT(compound);
hotbarData.writeToNBT(compound);
@@ -219,26 +219,26 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
public NBTTagCompound getSyncNBT() {
NBTTagCompound compound = new NBTTagCompound();
dialogData.saveNBTData(new MC1710NBTCompound(compound));
dialogData.saveNBTData(new NBTWrapper(compound));
questData.saveNBTData(compound);
factionData.saveNBTData(compound);
return compound;
}
public void setSyncNBT(NBTTagCompound data) {
dialogData.loadNBTData(new MC1710NBTCompound(data));
dialogData.loadNBTData(new NBTWrapper(data));
questData.loadNBTData(data);
factionData.loadNBTData(data);
}
public NBTTagCompound getPlayerEffects() {
NBTTagCompound compound = new NBTTagCompound();
effectData.writeToNBT(new MC1710NBTCompound(compound));
effectData.writeToNBT(new NBTWrapper(compound));
return compound;
}
public void setPlayerEffects(NBTTagCompound data) {
effectData.readFromNBT(new MC1710NBTCompound(data));
effectData.readFromNBT(new NBTWrapper(data));
}
public NBTTagCompound getSyncNBTFull() {
@@ -247,10 +247,10 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
uuid = player.getPersistentID().toString();
}
NBTTagCompound compound = new NBTTagCompound();
dialogData.saveNBTData(new MC1710NBTCompound(compound));
dialogData.saveNBTData(new NBTWrapper(compound));
bankData.saveNBTData(compound);
questData.saveNBTData(compound);
transportData.saveNBTData(new MC1710NBTCompound(compound));
transportData.saveNBTData(new NBTWrapper(compound));
factionData.saveNBTData(compound);
mailData.saveNBTData(compound);
tradeData.writeToNBT(compound);
@@ -263,10 +263,10 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
}
public void setSyncNBTFull(NBTTagCompound data) {
dialogData.loadNBTData(new MC1710NBTCompound(data));
dialogData.loadNBTData(new NBTWrapper(data));
bankData.loadNBTData(data);
questData.loadNBTData(data);
transportData.loadNBTData(new MC1710NBTCompound(data));
transportData.loadNBTData(new NBTWrapper(data));
factionData.loadNBTData(data);
mailData.loadNBTData(data);
tradeData.readFromNBT(data);
@@ -22,7 +22,7 @@ import noppes.npcs.api.handler.data.IQuestInterface;
import noppes.npcs.api.handler.data.IQuestObjective;
import noppes.npcs.api.handler.data.ISlot;
import noppes.npcs.constants.EnumProfileSync;
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
import noppes.npcs.wrapper.nbt.NBTWrapper;
import noppes.npcs.constants.EnumQuestCompletion;
import noppes.npcs.constants.EnumQuestRepeat;
import noppes.npcs.constants.EnumQuestType;
@@ -93,8 +93,8 @@ public class Quest implements ICompatibilty, IQuest {
questInterface.readEntityFromNBT(compound);
factionOptions.readFromNBT(compound.getCompoundTag("QuestFactionPoints"));
partyOptions.readFromNBT(new MC1710NBTCompound(compound.getCompoundTag("PartyOptions")));
profileOptions.readFromNBT(new MC1710NBTCompound(compound.getCompoundTag("ProfileOptions")));
partyOptions.readFromNBT(new NBTWrapper(compound.getCompoundTag("PartyOptions")));
profileOptions.readFromNBT(new NBTWrapper(compound.getCompoundTag("ProfileOptions")));
mail.readNBT(compound.getCompoundTag("QuestMail"));
}
@@ -141,8 +141,8 @@ public class Quest implements ICompatibilty, IQuest {
this.questInterface.writeEntityToNBT(compound);
compound.setTag("QuestFactionPoints", factionOptions.writeToNBT(new NBTTagCompound()));
compound.setTag("PartyOptions", ((MC1710NBTCompound) partyOptions.writeToNBT()).getMCTag());
compound.setTag("ProfileOptions", ((MC1710NBTCompound) profileOptions.writeToNBT()).getMCTag());
compound.setTag("PartyOptions", ((NBTWrapper) partyOptions.writeToNBT()).getMCTag());
compound.setTag("ProfileOptions", ((NBTWrapper) profileOptions.writeToNBT()).getMCTag());
compound.setTag("QuestMail", mail.writeNBT());
return compound;