mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 14:19:49 +00:00
Wrapper Naming Improvement Scheme
This commit is contained in:
1 parent
3a8b75f152
commit
11a4d0b61d
94 files changed
+558
-370
No files matched your search
@@ -0,0 +1,203 @@
|
||||
# Core Migration Status
|
||||
|
||||
**Last updated:** 2026-03-13
|
||||
**Total:** 140 core + 43 platform-api = **183 abstracted files**
|
||||
**Remaining in src/main/java:** ~1,627 files
|
||||
|
||||
---
|
||||
|
||||
## What's Done
|
||||
|
||||
### Controllers in Core (8 files)
|
||||
| Controller | Data Classes in Core | Notes |
|
||||
|---|---|---|
|
||||
| `GlobalDataController` | _(self-contained)_ | Async save via CustomNPCsThreader |
|
||||
| `ServerTagMapController` | `TagMap`, `Tag` | Clone tab/folder management |
|
||||
| `TransportController` | `TransportCategory`, `TransportLocation` | Full CRUD |
|
||||
| `FactionController` | `Faction` | SyncController calls stubbed |
|
||||
| `MagicController` | `Magic`, `MagicCycle`, `MagicAssociation`, `MagicEntry`, `MagicData` | `createDefaults()` overrideable for ItemStack setup |
|
||||
| `TagController` | `Tag` | UUID tag helpers migrated too |
|
||||
| `CategoryManager` | `Category` | Filesystem-based category management |
|
||||
| `APIRegistry` | _(self-contained)_ | Name→URL registry |
|
||||
|
||||
### Data Classes in Core (~60+ files)
|
||||
See `core/src/main/java/` for full listing. Key clusters:
|
||||
- Transport system (TransportCategory, TransportLocation)
|
||||
- Faction system (Faction)
|
||||
- Magic system (Magic, MagicCycle, MagicAssociation, MagicEntry, MagicData)
|
||||
- Tag system (Tag, TagMap)
|
||||
- Energy display/combat/anchor/homing/lifespan/lightning/panel/barrier/charging data
|
||||
- Ability enums + ConditionFilter
|
||||
- Attribute system (AttributeDefinition, PlayerAttribute, PlayerAttributeMap)
|
||||
- Profile system (Slot, ProfileOptions, ProfileInfoEntry, ProfileOperation)
|
||||
- Dialog display data (DialogImage, DialogColorData, Lines, Line)
|
||||
- Frame/animation data (Frame, FramePart, HitboxData, TintData)
|
||||
- Player data fragments (PlayerDialogData, PlayerTransportData, PlayerEffect, PlayerEffectData, AbilityHotbarData)
|
||||
- Auction (AuctionFilter)
|
||||
- Misc (SkinOverlay, InnDoorData, ItemDisplayData, PartyOptions, TraderStock, CloneFolder)
|
||||
|
||||
### Infrastructure in Core
|
||||
- `NBTTags.java` — All map/set/list NBT helpers using INBTCompound/INBTList
|
||||
- `NBT.java` — Factory: `NBT.compound()`, `NBT.list()`
|
||||
- `CustomNPCsThreader` — Thread pool for async saves
|
||||
- Network enums (EnumSyncType, EnumDataPacket, EnumRequestPacket, etc.)
|
||||
- Developer registry
|
||||
|
||||
---
|
||||
|
||||
## TODO Stubs in Core (mc1710 must override/add)
|
||||
|
||||
### Scripting API Interface Implementations
|
||||
These core classes do NOT implement their scripting API interfaces. The mc1710 split-package shadow must add `implements IXxx`:
|
||||
|
||||
| Core Class | mc1710 Must Add | Interface Location |
|
||||
|---|---|---|
|
||||
| `Faction` | `implements IFaction` | `src/api/java/.../IFaction.java` |
|
||||
| `FactionController` | `implements IFactionHandler` | `src/api/java/.../IFactionHandler.java` |
|
||||
| `Magic` | `implements IMagic` | `src/api/java/.../IMagic.java` |
|
||||
| `MagicController` | `implements IMagicHandler` | `src/api/java/.../IMagicHandler.java` |
|
||||
| `TagController` | `implements ITagHandler` | `src/api/java/.../ITagHandler.java` |
|
||||
| `TransportController` | `implements ITransportHandler` | (referenced in TODO) |
|
||||
|
||||
### SyncController Calls
|
||||
All core controllers stub out SyncController network sync. mc1710 must re-add these:
|
||||
|
||||
| Core File | Stubbed Method | SyncController Call |
|
||||
|---|---|---|
|
||||
| `FactionController` | `saveFaction()` | `SyncController.syncUpdate(EnumSyncType.FACTION, -1, compound)` |
|
||||
| `FactionController` | `delete()` | `SyncController.syncRemove(EnumSyncType.FACTION, id)` |
|
||||
| `MagicController` | `saveMagic()` | `SyncController.syncUpdate(EnumSyncType.MAGIC, -1, compound)` |
|
||||
| `MagicController` | `removeMagic()` | `SyncController.syncRemove(EnumSyncType.MAGIC, magicID)` |
|
||||
| `MagicController` | `saveCycle()` | `SyncController.syncUpdate(EnumSyncType.MAGIC_CYCLE, -1, compound)` |
|
||||
| `MagicController` | `removeCycle()` | `SyncController.syncRemove(EnumSyncType.MAGIC_CYCLE, categoryId)` |
|
||||
| `TagController` | _(not present — delete() doesn't sync in core)_ | `SyncController.syncRemove` if needed |
|
||||
|
||||
### EntityPlayer / Entity Methods
|
||||
Methods that require MC entity types, left out of core:
|
||||
|
||||
| Core Class | Stubbed Methods | Depends On |
|
||||
|---|---|---|
|
||||
| `Faction` | `isFriendlyToPlayer(EntityPlayer)`, `isAggressiveToPlayer(EntityPlayer)`, `isNeutralToPlayer(EntityPlayer)` | `PlayerData.get(player).factionData` |
|
||||
| `Faction` | `isAggressiveToNpc(EntityNPCInterface)` | `entity.faction.id` |
|
||||
| `Faction` | `playerStatus(IPlayer)`, `isAggressiveToNpc(ICustomNpc)` | Scripting API entity types |
|
||||
| `Faction` | `isFriendlyToPlayer(IPlayer)`, etc. | Delegates to EntityPlayer overloads |
|
||||
| `TagController` | `sendCategoryTagMap(EntityPlayerMP, ...)` | `GuiDataPacket` |
|
||||
| `TransportController` | `saveLocation(int, NBTTagCompound, EntityNPCInterface)` | `RoleTransporter`, `EnumRoleType` |
|
||||
| `PlayerEffect` | `getEffect()` | `CustomEffectController` (mc1710 only) |
|
||||
| `PlayerEffect` | `getAPI()` | `IPlayer` scripting API |
|
||||
|
||||
### ItemStack / GameRegistry
|
||||
Methods that require MC item types:
|
||||
|
||||
| Core Class | Stubbed Feature | Depends On |
|
||||
|---|---|---|
|
||||
| `Magic` | `ItemStack item` field | `net.minecraft.item.ItemStack` |
|
||||
| `Magic` | `setItem(ItemStack)` / `getItem()` | `GameRegistry.findUniqueIdentifierFor` |
|
||||
| `Magic` | Item resolution in `readNBT`/`writeNBT` | `GameRegistry.findItem(modID, itemName)` |
|
||||
| `MagicController` | Default magic ItemStack assignment in `createDefaults()` | `CustomItems.*` item references |
|
||||
|
||||
### NBTTags Omitted Methods
|
||||
Methods left out of core `NBTTags.java` (stay in mc1710 version):
|
||||
|
||||
| Method | Reason |
|
||||
|---|---|
|
||||
| `getItemStackList`, `getItemStackArray` | Uses `NoppesUtilServer.readItem()` + `ItemStack` |
|
||||
| `nbtItemStackList`, `nbtItemStackArray` | Uses `NoppesUtilServer.writeItem()` + `ItemStack` |
|
||||
| `nbtDoubleList` | Uses `NBTTagDouble` directly |
|
||||
| `GetScript`, `GetScriptOld`, `NBTScript` | Uses `IScriptHandler` / `IScriptUnit` |
|
||||
| `getIntAt` | Uses `NBTTagInt.func_150287_d()` |
|
||||
|
||||
---
|
||||
|
||||
## Blocked Migrations & What Unblocks Them
|
||||
|
||||
### Tier 1: Blocked by ItemStack/Inventory Abstraction
|
||||
**Unblock:** Add `IStack` wrapping to `PlatformService`, or create inventory abstraction
|
||||
|
||||
| File | Blocker |
|
||||
|---|---|
|
||||
| `Bank.java` | `NpcMiscInventory` (ItemStack-based currency/upgrade inventories) |
|
||||
| `BankController.java` | Depends on `Bank` |
|
||||
| `AuctionClaim.java` | `ItemStack.writeToNBT` / `readFromNBT` |
|
||||
| `AuctionListing.java` | `ItemStack` operations |
|
||||
| `AuctionBlacklist.java` | `GameRegistry`, `ItemStack` |
|
||||
| `LinkedItem.java` | `ItemStack`, `Constants.NBT` |
|
||||
| `RecipeAnvil.java` | `ItemStack`, `Constants.NBT` |
|
||||
| `PlayerItemGiverData.java` | `JobItemGiver` (roles package) |
|
||||
|
||||
### Tier 2: Blocked by EntityPlayer Abstraction
|
||||
**Unblock:** Implement Phase 0-1 `IUser` wrappers + use in core
|
||||
|
||||
| File | Blocker |
|
||||
|---|---|
|
||||
| `Availability.java` | `EntityPlayer` checks, `StatCollector`, `MathHelper` |
|
||||
| `FactionOptions.java` | `EntityPlayer`, `PlayerFactionData`, `ChatComponentTranslation` |
|
||||
| `DialogOption.java` | `EntityPlayer` via `dialog.availability.isAvailable(player)` |
|
||||
| `Dialog.java` | `EntityPlayer`, `ICompatibilty`, `VersionCompatibility`, scripting API |
|
||||
| `DialogCategory.java` | References `Dialog` (same-package) |
|
||||
| `Quest.java` | `EntityPlayer`, `Availability`, scripting API |
|
||||
| `QuestCategory.java` | References `Quest` (same-package) |
|
||||
| `QuestData.java` | References `Quest` (same-package) |
|
||||
| `CustomEffect.java` | `EntityPlayer`, `Constants.NBT` |
|
||||
| `Party.java` | `EntityPlayer`, `EntityPlayerMP`, FML imports |
|
||||
| `PlayerData.java` | `EntityPlayer` throughout |
|
||||
| `PlayerFactionData.java` | `EntityPlayer`, `PlayerData` |
|
||||
| `All Player*Data classes` | `EntityPlayer` / `EntityPlayerMP` coupling |
|
||||
| `IRequirementChecker.java` | `EntityPlayer` in `check()` method |
|
||||
|
||||
### Tier 3: Blocked by Entity/World Abstraction
|
||||
**Unblock:** `IMob`, `IGameWorld` wrappers
|
||||
|
||||
| File | Blocker |
|
||||
|---|---|
|
||||
| `SpawnData.java` | Extends `WeightedRandom.Item`, `DimensionManager`, `EntityList` |
|
||||
| `SpawnController.java` | `WeightedRandom.getRandomItem()` |
|
||||
| `Animation.java` | `@SideOnly`, `EntityNPCInterface`, `EventHooks` |
|
||||
| `AnimationData.java` | `EntityPlayer`, `AxisAlignedBB`, dimension access |
|
||||
| `DataTransform.java` | `EntityNPCInterface`, `EntityCustomNpc` throughout |
|
||||
| `MarkData.java` | `IExtendedEntityProperties`, `EntityLivingBase` |
|
||||
| `TelegraphInstance.java` | `Entity`, `World` |
|
||||
|
||||
### Tier 4: Blocked by Script System (DO NOT TOUCH YET)
|
||||
| File | Blocker |
|
||||
|---|---|
|
||||
| `All I*Script*.java` | Script handler/unit interfaces |
|
||||
| `ScriptHandler.java`, `SingleScriptHandler.java`, etc. | Script execution |
|
||||
| `AbilityScript.java`, `ChainedAbilityScript.java` | Script containers |
|
||||
| `EffectScript.java`, `LinkedItemScript.java` | Script containers |
|
||||
| `DataScript.java` | FML, World, entities + scripting |
|
||||
| `Action.java` + action framework | `ScriptContainer` dependency |
|
||||
|
||||
### Tier 5: Blocked by Heavy MC Coupling (Long-term)
|
||||
| File | Blocker |
|
||||
|---|---|
|
||||
| `RecipeCarpentry.java` | Extends `ShapedRecipes` |
|
||||
| `RecipeController.java` | `CraftingManager`, `InventoryCrafting` |
|
||||
| `Ability.java` (kamkeel) | 30+ MC imports (Block, Entity, DamageSource, Vec3, World) |
|
||||
| `All ability type/ classes` | Depend on `Ability.java` |
|
||||
| `ChunkController.java` | `ForgeChunkManager` |
|
||||
| `ProfileController.java` | EntityPlayer lifecycle, Mojang API, events |
|
||||
| `SyncController.java` | ByteBuf, packets, Minecraft server |
|
||||
|
||||
---
|
||||
|
||||
## Recommended Next Steps (in order)
|
||||
|
||||
### 1. mc1710 Shadow Files for Migrated Controllers
|
||||
The mc1710 versions (`src/main/java/`) of FactionController, MagicController, TagController need to be updated to:
|
||||
- Add `implements IFactionHandler` / `IMagicHandler` / `ITagHandler`
|
||||
- Re-add SyncController calls in save/delete methods
|
||||
- Re-add EntityPlayer/IPlayer methods that were stubbed
|
||||
- Override `createDefaults()` in MagicController to set ItemStack items
|
||||
|
||||
### 2. IUser Implementation (Phase 0-1 of plan)
|
||||
Creates the biggest unblock — enables migration of Availability, FactionOptions, Dialog system, Quest system, CustomEffect, all Player*Data classes.
|
||||
|
||||
### 3. IStack / Inventory Abstraction
|
||||
Unblocks Bank, AuctionClaim/Listing, LinkedItem — the ItemStack-dependent data classes.
|
||||
|
||||
### 4. Dialog + Quest Cluster Migration
|
||||
Once IUser exists: migrate Dialog → DialogOption → DialogCategory → DialogController as a cluster. Then Quest → QuestCategory → QuestData → QuestController.
|
||||
|
||||
### 5. NBTJsonUtil to Core
|
||||
Many controllers (Dialog, Quest, CustomEffect) use NBTJsonUtil for JSON file storage. Creating a core version would unblock those controllers.
|
||||
@@ -36,7 +36,7 @@ public class ProjectileData {
|
||||
}
|
||||
|
||||
public void writeNBT(INBTCompound nbt) {
|
||||
// OLD: anchor.writeNBT(new MC1710NBTCompound(nbt));
|
||||
// OLD: anchor.writeNBT(new NBTWrapper(nbt));
|
||||
anchor.writeNBT(nbt);
|
||||
nbt.setBoolean("colorOverride", colorOverride);
|
||||
if (colorOverride) {
|
||||
@@ -46,7 +46,7 @@ public class ProjectileData {
|
||||
}
|
||||
|
||||
public void readNBT(INBTCompound nbt) {
|
||||
// OLD: anchor.readNBT(new MC1710NBTCompound(nbt));
|
||||
// OLD: anchor.readNBT(new NBTWrapper(nbt));
|
||||
anchor.readNBT(nbt);
|
||||
colorOverride = nbt.getBoolean("colorOverride");
|
||||
if (colorOverride) {
|
||||
|
||||
@@ -207,7 +207,7 @@ public class MagicController {
|
||||
for (int i = 0; i < cycleList.size(); i++) {
|
||||
INBTCompound catCompound = cycleList.getCompound(i);
|
||||
MagicCycle cycle = new MagicCycle();
|
||||
// OLD: cycle.readNBT(new MC1710NBTCompound(catCompound));
|
||||
// OLD: cycle.readNBT(new NBTWrapper(catCompound));
|
||||
cycle.readNBT(catCompound);
|
||||
cycles.put(cycle.id, cycle);
|
||||
}
|
||||
@@ -223,7 +223,7 @@ public class MagicController {
|
||||
INBTList catList = NBT.list();
|
||||
for (MagicCycle cat : cycles.values()) {
|
||||
INBTCompound catCompound = NBT.compound();
|
||||
// OLD: cat.writeNBT(new MC1710NBTCompound(catCompound));
|
||||
// OLD: cat.writeNBT(new NBTWrapper(catCompound));
|
||||
cat.writeNBT(catCompound);
|
||||
catList.addCompound(catCompound);
|
||||
}
|
||||
@@ -341,7 +341,7 @@ public class MagicController {
|
||||
|
||||
// TODO: mc1710 version also calls:
|
||||
// OLD: NBTTagCompound cycleCompound = new NBTTagCompound();
|
||||
// OLD: cycle.writeNBT(new MC1710NBTCompound(cycleCompound));
|
||||
// OLD: cycle.writeNBT(new NBTWrapper(cycleCompound));
|
||||
// OLD: SyncController.syncUpdate(EnumSyncType.MAGIC_CYCLE, -1, cycleCompound);
|
||||
|
||||
saveMagicData();
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ServerTagMapController {
|
||||
private void loadTagMapFile(File file) throws Exception {
|
||||
// OLD: DataInputStream var1 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new FileInputStream(file))));
|
||||
// OLD: NBTTagCompound nbtCompound = CompressedStreamTools.read(var1);
|
||||
// OLD: this.tagMap.readNBT(new MC1710NBTCompound(nbtCompound));
|
||||
// OLD: this.tagMap.readNBT(new NBTWrapper(nbtCompound));
|
||||
// OLD: var1.close();
|
||||
INBTCompound nbtCompound = PlatformServiceHolder.get().readCompressedNBT(file);
|
||||
this.tagMap.readNBT(nbtCompound);
|
||||
@@ -92,7 +92,7 @@ public class ServerTagMapController {
|
||||
File file = new File(saveDir, "___tagmap.dat_new");
|
||||
File file1 = new File(saveDir, "___tagmap.dat_old");
|
||||
File file2 = new File(saveDir, "___tagmap.dat");
|
||||
// OLD: CompressedStreamTools.writeCompressed(((MC1710NBTCompound) tagMap.writeNBT()).getMCTag(), new FileOutputStream(file));
|
||||
// OLD: CompressedStreamTools.writeCompressed(((NBTWrapper) tagMap.writeNBT()).getMCTag(), new FileOutputStream(file));
|
||||
PlatformServiceHolder.get().writeCompressedNBT(tagMap.writeNBT(), file);
|
||||
if (file1.exists()) {
|
||||
file1.delete();
|
||||
|
||||
@@ -72,7 +72,7 @@ public class TagController {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
INBTCompound nbttagcompound = list.getCompound(i);
|
||||
Tag tag = new Tag();
|
||||
// OLD: tag.readNBT(new MC1710NBTCompound(nbttagcompound));
|
||||
// OLD: tag.readNBT(new NBTWrapper(nbttagcompound));
|
||||
tag.readNBT(nbttagcompound);
|
||||
tags.put(tag.id, tag);
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class TagController {
|
||||
for (int slot : tags.keySet()) {
|
||||
Tag tag = tags.get(slot);
|
||||
INBTCompound nbtfactions = NBT.compound();
|
||||
// OLD: tag.writeNBT(new MC1710NBTCompound(nbtfactions));
|
||||
// OLD: tag.writeNBT(new NBTWrapper(nbtfactions));
|
||||
tag.writeNBT(nbtfactions);
|
||||
list.addCompound(nbtfactions);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class TransportController {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
TransportCategory category = new TransportCategory();
|
||||
INBTCompound compound = list.getCompound(i);
|
||||
// OLD: category.readNBT(new MC1710NBTCompound(compound));
|
||||
// OLD: category.readNBT(new NBTWrapper(compound));
|
||||
category.readNBT(compound);
|
||||
|
||||
for (TransportLocation location : category.locations.values())
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ package kamkeel.npcs.platform.entity;
|
||||
/**
|
||||
* Platform-independent damage source abstraction.
|
||||
*/
|
||||
public interface IPlatformDamageSource {
|
||||
public interface IDamage {
|
||||
|
||||
/**
|
||||
* @return the damage type identifier (e.g., "player", "mob", "generic")
|
||||
@@ -13,7 +13,7 @@ public interface IPlatformDamageSource {
|
||||
/**
|
||||
* @return the entity that caused this damage, or null if none (e.g., fall damage)
|
||||
*/
|
||||
IPlatformEntity getSourceEntity();
|
||||
IMob getSourceEntity();
|
||||
|
||||
/**
|
||||
* Returns the underlying MC DamageSource object.
|
||||
+2
-2
@@ -3,7 +3,7 @@ package kamkeel.npcs.platform.entity;
|
||||
/**
|
||||
* Platform-independent world abstraction.
|
||||
*/
|
||||
public interface IPlatformWorld {
|
||||
public interface IGameWorld {
|
||||
|
||||
/**
|
||||
* @return the dimension ID (e.g., 0 for overworld, -1 for nether)
|
||||
@@ -21,7 +21,7 @@ public interface IPlatformWorld {
|
||||
* @param id the entity ID
|
||||
* @return the entity, or null if not found
|
||||
*/
|
||||
IPlatformEntity getEntityById(int id);
|
||||
IMob getEntityById(int id);
|
||||
|
||||
/**
|
||||
* Returns the underlying MC World object.
|
||||
+3
-3
@@ -2,9 +2,9 @@ package kamkeel.npcs.platform.entity;
|
||||
|
||||
/**
|
||||
* Platform-independent living entity abstraction.
|
||||
* Extends {@link IPlatformEntity} with health and damage operations.
|
||||
* Extends {@link IMob} with health and damage operations.
|
||||
*/
|
||||
public interface IPlatformLiving extends IPlatformEntity {
|
||||
public interface ILiving extends IMob {
|
||||
|
||||
float getHealth();
|
||||
|
||||
@@ -18,5 +18,5 @@ public interface IPlatformLiving extends IPlatformEntity {
|
||||
* @param amount the damage amount
|
||||
* @param source the damage source, or null for generic damage
|
||||
*/
|
||||
void damage(float amount, IPlatformDamageSource source);
|
||||
void damage(float amount, IDamage source);
|
||||
}
|
||||
+2
-2
@@ -7,7 +7,7 @@ package kamkeel.npcs.platform.entity;
|
||||
* Each MC version provides an implementation wrapping the native Entity class.
|
||||
* Use {@link #getHandle()} to retrieve the underlying MC object in platform code.
|
||||
*/
|
||||
public interface IPlatformEntity {
|
||||
public interface IMob {
|
||||
|
||||
/**
|
||||
* @return the entity's numeric ID in the world
|
||||
@@ -43,7 +43,7 @@ public interface IPlatformEntity {
|
||||
/**
|
||||
* @return the dimension/world the entity is in
|
||||
*/
|
||||
IPlatformWorld getWorld();
|
||||
IGameWorld getWorld();
|
||||
|
||||
// --- Escape hatch ---
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ import noppes.npcs.platform.nbt.INBTCompound;
|
||||
/**
|
||||
* Platform-independent item stack abstraction.
|
||||
*/
|
||||
public interface IPlatformStack {
|
||||
public interface IStack {
|
||||
|
||||
/**
|
||||
* @return the item's registry ID (e.g., "minecraft:stone")
|
||||
@@ -38,7 +38,7 @@ public interface IPlatformStack {
|
||||
/**
|
||||
* @return a deep copy of this stack
|
||||
*/
|
||||
IPlatformStack copy();
|
||||
IStack copy();
|
||||
|
||||
/**
|
||||
* Returns the underlying MC ItemStack object.
|
||||
+3
-3
@@ -2,9 +2,9 @@ package kamkeel.npcs.platform.entity;
|
||||
|
||||
/**
|
||||
* Platform-independent player abstraction.
|
||||
* Extends {@link IPlatformLiving} with player-specific operations.
|
||||
* Extends {@link ILiving} with player-specific operations.
|
||||
*/
|
||||
public interface IPlatformPlayer extends IPlatformLiving {
|
||||
public interface IUser extends ILiving {
|
||||
|
||||
/**
|
||||
* @return the player's username
|
||||
@@ -32,5 +32,5 @@ public interface IPlatformPlayer extends IPlatformLiving {
|
||||
/**
|
||||
* @return the item currently held in the player's main hand, or null if empty
|
||||
*/
|
||||
IPlatformStack getHeldItem();
|
||||
IStack getHeldItem();
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package noppes.npcs.platform;
|
||||
|
||||
import kamkeel.npcs.platform.entity.IPlatformDamageSource;
|
||||
import kamkeel.npcs.platform.entity.IPlatformEntity;
|
||||
import kamkeel.npcs.platform.entity.IPlatformLiving;
|
||||
import kamkeel.npcs.platform.entity.IPlatformPlayer;
|
||||
import kamkeel.npcs.platform.entity.IPlatformStack;
|
||||
import kamkeel.npcs.platform.entity.IPlatformWorld;
|
||||
import kamkeel.npcs.platform.entity.IDamage;
|
||||
import kamkeel.npcs.platform.entity.ILiving;
|
||||
import kamkeel.npcs.platform.entity.IMob;
|
||||
import kamkeel.npcs.platform.entity.IUser;
|
||||
import kamkeel.npcs.platform.entity.IStack;
|
||||
import kamkeel.npcs.platform.entity.IGameWorld;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.platform.nbt.NBTFactory;
|
||||
@@ -75,29 +75,14 @@ public interface PlatformService {
|
||||
|
||||
// --- Logging ---
|
||||
|
||||
/**
|
||||
* Logs at INFO level.
|
||||
*/
|
||||
void logInfo(String message);
|
||||
|
||||
/**
|
||||
* Logs at WARN level.
|
||||
*/
|
||||
void logWarn(String message);
|
||||
|
||||
/**
|
||||
* Logs at ERROR level.
|
||||
*/
|
||||
void logError(String message);
|
||||
|
||||
/**
|
||||
* Logs at ERROR level with a throwable.
|
||||
*/
|
||||
void logError(String message, Throwable t);
|
||||
|
||||
/**
|
||||
* Logs at DEBUG level.
|
||||
*/
|
||||
void logDebug(String message);
|
||||
|
||||
// --- Entity Wrapping ---
|
||||
@@ -108,7 +93,7 @@ public interface PlatformService {
|
||||
* @param mcPlayer the MC player object (e.g., EntityPlayerMP on 1.7.10)
|
||||
* @return a platform player wrapper
|
||||
*/
|
||||
IPlatformPlayer wrapPlayer(Object mcPlayer);
|
||||
IUser wrapPlayer(Object mcPlayer);
|
||||
|
||||
/**
|
||||
* Wraps a raw MC entity into a platform-independent entity.
|
||||
@@ -116,7 +101,7 @@ public interface PlatformService {
|
||||
* @param mcEntity the MC entity object
|
||||
* @return a platform entity wrapper
|
||||
*/
|
||||
IPlatformEntity wrapEntity(Object mcEntity);
|
||||
IMob wrapEntity(Object mcEntity);
|
||||
|
||||
/**
|
||||
* Wraps a raw MC living entity into a platform-independent living entity.
|
||||
@@ -124,7 +109,7 @@ public interface PlatformService {
|
||||
* @param mcLiving the MC living entity object (e.g., EntityLivingBase on 1.7.10)
|
||||
* @return a platform living wrapper
|
||||
*/
|
||||
IPlatformLiving wrapLiving(Object mcLiving);
|
||||
ILiving wrapLiving(Object mcLiving);
|
||||
|
||||
/**
|
||||
* Wraps a raw MC item stack into a platform-independent stack.
|
||||
@@ -132,7 +117,7 @@ public interface PlatformService {
|
||||
* @param mcStack the MC ItemStack object
|
||||
* @return a platform stack wrapper
|
||||
*/
|
||||
IPlatformStack wrapStack(Object mcStack);
|
||||
IStack wrapStack(Object mcStack);
|
||||
|
||||
/**
|
||||
* Wraps a raw MC world into a platform-independent world.
|
||||
@@ -140,7 +125,7 @@ public interface PlatformService {
|
||||
* @param mcWorld the MC World object
|
||||
* @return a platform world wrapper
|
||||
*/
|
||||
IPlatformWorld wrapWorld(Object mcWorld);
|
||||
IGameWorld wrapWorld(Object mcWorld);
|
||||
|
||||
/**
|
||||
* Wraps a raw MC damage source into a platform-independent damage source.
|
||||
@@ -148,7 +133,7 @@ public interface PlatformService {
|
||||
* @param mcSource the MC DamageSource object
|
||||
* @return a platform damage source wrapper
|
||||
*/
|
||||
IPlatformDamageSource wrapDamageSource(Object mcSource);
|
||||
IDamage wrapDamageSource(Object mcSource);
|
||||
|
||||
// --- Scheduling ---
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.controllers.data.QuestCategory;
|
||||
import noppes.npcs.controllers.data.RecipeAnvil;
|
||||
import noppes.npcs.controllers.data.RecipeCarpentry;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.EnumMap;
|
||||
@@ -337,7 +337,7 @@ public class SyncController {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
for (MagicCycle cycle : MagicController.getInstance().cycles.values()) {
|
||||
NBTTagCompound cycleCompound = new NBTTagCompound();
|
||||
cycle.writeNBT(new MC1710NBTCompound(cycleCompound));
|
||||
cycle.writeNBT(new NBTWrapper(cycleCompound));
|
||||
list.appendTag(cycleCompound);
|
||||
}
|
||||
compound.setTag("Data", list);
|
||||
@@ -586,7 +586,7 @@ public class SyncController {
|
||||
mc.cyclesSync.clear();
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
MagicCycle cycle = new MagicCycle();
|
||||
cycle.readNBT(new MC1710NBTCompound(list.getCompoundTagAt(i)));
|
||||
cycle.readNBT(new NBTWrapper(list.getCompoundTagAt(i)));
|
||||
mc.cyclesSync.put(cycle.id, cycle);
|
||||
}
|
||||
|
||||
@@ -758,7 +758,7 @@ public class SyncController {
|
||||
}
|
||||
case MAGIC_CYCLE: {
|
||||
MagicCycle cycle = new MagicCycle();
|
||||
cycle.readNBT(new MC1710NBTCompound(compound));
|
||||
cycle.readNBT(new NBTWrapper(compound));
|
||||
MagicController.getInstance().cycles.put(cycle.id, cycle);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import noppes.npcs.api.handler.ITelegraphHandler;
|
||||
import noppes.npcs.scripted.ScriptTelegraph;
|
||||
import noppes.npcs.scripted.ScriptTelegraphInstance;
|
||||
import noppes.npcs.util.NBTJsonUtil;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
@@ -253,7 +253,7 @@ public class TelegraphController implements ITelegraphHandler {
|
||||
if (!file.isFile() || !file.getName().endsWith(".json")) continue;
|
||||
try {
|
||||
Telegraph telegraph = new Telegraph();
|
||||
telegraph.readNBT(new MC1710NBTCompound(NBTJsonUtil.LoadFile(file)));
|
||||
telegraph.readNBT(new NBTWrapper(NBTJsonUtil.LoadFile(file)));
|
||||
String name = file.getName().substring(0, file.getName().length() - 5);
|
||||
telegraph.setId(name);
|
||||
savedTelegraphs.put(name, telegraph);
|
||||
@@ -275,7 +275,7 @@ public class TelegraphController implements ITelegraphHandler {
|
||||
File file = new File(dir, name + ".json_new");
|
||||
File file2 = new File(dir, name + ".json");
|
||||
|
||||
NBTJsonUtil.SaveFile(file, ((MC1710NBTCompound) telegraph.writeNBT()).getMCTag());
|
||||
NBTJsonUtil.SaveFile(file, ((NBTWrapper) telegraph.writeNBT()).getMCTag());
|
||||
if (file2.exists()) {
|
||||
file2.delete();
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.controllers.MagicController;
|
||||
import noppes.npcs.controllers.data.Magic;
|
||||
import noppes.npcs.controllers.data.MagicData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.controllers.data.MagicEntry;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityMagic;
|
||||
@@ -1534,7 +1534,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
nbt.setFloat("telegraphHeightOffset", telegraphHeightOffset);
|
||||
nbt.setTag("customData", (NBTTagCompound) customData.copy());
|
||||
TagController.writeTagUUIDs(nbt, "TagUUIDs", tagUUIDs);
|
||||
magicData.writeToNBT(new MC1710NBTCompound(nbt));
|
||||
magicData.writeToNBT(new NBTWrapper(nbt));
|
||||
nbt.setInteger("allowedBy", allowedBy.ordinal());
|
||||
nbt.setBoolean("ignoreCooldown", ignoreCooldown);
|
||||
nbt.setBoolean("perAbilityCooldown", perAbilityCooldown);
|
||||
@@ -1634,7 +1634,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
telegraphHeightOffset = nbt.getFloat("telegraphHeightOffset");
|
||||
customData = (NBTTagCompound) nbt.getCompoundTag("customData").copy();
|
||||
tagUUIDs = TagController.readTagUUIDs(nbt, "TagUUIDs");
|
||||
magicData.readToNBT(new MC1710NBTCompound(nbt));
|
||||
magicData.readToNBT(new NBTWrapper(nbt));
|
||||
allowedBy = UserType.fromOrdinal(nbt.getInteger("allowedBy"));
|
||||
ignoreCooldown = nbt.getBoolean("ignoreCooldown");
|
||||
perAbilityCooldown = nbt.getBoolean("perAbilityCooldown");
|
||||
|
||||
@@ -4,7 +4,7 @@ import kamkeel.npcs.controllers.data.ability.enums.AnchorPoint;
|
||||
import kamkeel.npcs.controllers.data.ability.data.energy.EnergyAnchorData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.energy.EnergyDisplayData;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
/**
|
||||
* Per-projectile data: anchor point + optional color override.
|
||||
@@ -37,7 +37,7 @@ public class ProjectileData {
|
||||
}
|
||||
|
||||
public void writeNBT(NBTTagCompound nbt) {
|
||||
anchor.writeNBT(new MC1710NBTCompound(nbt));
|
||||
anchor.writeNBT(new NBTWrapper(nbt));
|
||||
nbt.setBoolean("colorOverride", colorOverride);
|
||||
if (colorOverride) {
|
||||
nbt.setInteger("overrideInnerColor", innerColor);
|
||||
@@ -46,7 +46,7 @@ public class ProjectileData {
|
||||
}
|
||||
|
||||
public void readNBT(NBTTagCompound nbt) {
|
||||
anchor.readNBT(new MC1710NBTCompound(nbt));
|
||||
anchor.readNBT(new NBTWrapper(nbt));
|
||||
colorOverride = nbt.getBoolean("colorOverride");
|
||||
if (colorOverride) {
|
||||
innerColor = nbt.getInteger("overrideInnerColor");
|
||||
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import noppes.npcs.client.gui.SubGuiZonePresetSelector;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import noppes.npcs.constants.EnumPotionType;
|
||||
|
||||
@@ -382,7 +382,7 @@ public abstract class AbilityZone extends Ability {
|
||||
nbt.setFloat("particleScale", particleScale);
|
||||
nbt.setFloat("animSpeed", animSpeed);
|
||||
nbt.setFloat("lightningDensity", lightningDensity);
|
||||
colorData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
colorData.writeNBT(new NBTWrapper(nbt));
|
||||
|
||||
nbt.setBoolean("groundFill", groundFill);
|
||||
nbt.setFloat("groundAlpha", groundAlpha);
|
||||
@@ -414,7 +414,7 @@ public abstract class AbilityZone extends Ability {
|
||||
this.particleScale = nbt.getFloat("particleScale");
|
||||
this.animSpeed = nbt.getFloat("animSpeed");
|
||||
this.lightningDensity = nbt.getFloat("lightningDensity");
|
||||
colorData.readNBT(new MC1710NBTCompound(nbt));
|
||||
colorData.readNBT(new NBTWrapper(nbt));
|
||||
|
||||
this.groundFill = nbt.getBoolean("groundFill");
|
||||
this.groundAlpha = nbt.getFloat("groundAlpha");
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import noppes.npcs.controllers.data.MagicData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -177,7 +177,7 @@ public abstract class AbilityBarrier extends AbilityEnergy {
|
||||
public final void writeTypeNBT(NBTTagCompound nbt) {
|
||||
writeBarrierTypeNBT(nbt);
|
||||
writeEnergyNBT(nbt);
|
||||
barrierData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
barrierData.writeNBT(new NBTWrapper(nbt));
|
||||
nbt.setFloat("barrierOffsetX", offsetX);
|
||||
nbt.setFloat("barrierOffsetY", offsetY);
|
||||
nbt.setFloat("barrierOffsetZ", offsetZ);
|
||||
@@ -190,7 +190,7 @@ public abstract class AbilityBarrier extends AbilityEnergy {
|
||||
offsetZ = nbt.hasKey("barrierOffsetZ") ? nbt.getFloat("barrierOffsetZ") : 0.0f;
|
||||
readBarrierTypeNBT(nbt);
|
||||
readEnergyNBT(nbt);
|
||||
barrierData.readNBT(new MC1710NBTCompound(nbt));
|
||||
barrierData.readNBT(new NBTWrapper(nbt));
|
||||
}
|
||||
|
||||
// ==================== API GETTERS & SETTERS ====================
|
||||
|
||||
@@ -7,7 +7,7 @@ import kamkeel.npcs.controllers.data.ability.data.energy.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.energy.EnergyLightningData;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -120,13 +120,13 @@ public abstract class AbilityEnergy extends Ability {
|
||||
// ==================== NBT HELPERS ====================
|
||||
|
||||
protected void writeEnergyNBT(NBTTagCompound nbt) {
|
||||
displayData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
lightningData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
displayData.writeNBT(new NBTWrapper(nbt));
|
||||
lightningData.writeNBT(new NBTWrapper(nbt));
|
||||
}
|
||||
|
||||
protected void readEnergyNBT(NBTTagCompound nbt) {
|
||||
displayData.readNBT(new MC1710NBTCompound(nbt));
|
||||
lightningData.readNBT(new MC1710NBTCompound(nbt));
|
||||
displayData.readNBT(new NBTWrapper(nbt));
|
||||
lightningData.readNBT(new NBTWrapper(nbt));
|
||||
}
|
||||
|
||||
// ==================== GUI HELPERS ====================
|
||||
|
||||
+7
-7
@@ -26,7 +26,7 @@ import net.minecraft.util.Vec3;
|
||||
import noppes.npcs.api.ability.type.IAbilityEnergyProjectile;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import noppes.npcs.controllers.data.MagicData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -584,9 +584,9 @@ public abstract class AbilityEnergyProjectile<E extends EntityEnergyProjectile>
|
||||
|
||||
// Shared data classes
|
||||
writeEnergyNBT(nbt);
|
||||
combatData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
homingData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
lifespanData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
combatData.writeNBT(new NBTWrapper(nbt));
|
||||
homingData.writeNBT(new NBTWrapper(nbt));
|
||||
lifespanData.writeNBT(new NBTWrapper(nbt));
|
||||
|
||||
// Per-projectile data
|
||||
for (int i = 0; i < projectileCount; i++) {
|
||||
@@ -608,9 +608,9 @@ public abstract class AbilityEnergyProjectile<E extends EntityEnergyProjectile>
|
||||
|
||||
// Shared data classes
|
||||
readEnergyNBT(nbt);
|
||||
combatData.readNBT(new MC1710NBTCompound(nbt));
|
||||
homingData.readNBT(new MC1710NBTCompound(nbt));
|
||||
lifespanData.readNBT(new MC1710NBTCompound(nbt));
|
||||
combatData.readNBT(new NBTWrapper(nbt));
|
||||
homingData.readNBT(new NBTWrapper(nbt));
|
||||
lifespanData.readNBT(new NBTWrapper(nbt));
|
||||
|
||||
// Per-projectile data
|
||||
for (int i = 0; i < projectileCount; i++) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import kamkeel.npcs.entity.EntityEnergyPanel;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -142,12 +142,12 @@ public class AbilityWall extends AbilityBarrier {
|
||||
|
||||
@Override
|
||||
protected void writeBarrierTypeNBT(NBTTagCompound nbt) {
|
||||
panelData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
panelData.writeNBT(new NBTWrapper(nbt));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readBarrierTypeNBT(NBTTagCompound nbt) {
|
||||
panelData.readNBT(new MC1710NBTCompound(nbt));
|
||||
panelData.readNBT(new NBTWrapper(nbt));
|
||||
// Migrate legacy heightOffset → base class offsetY
|
||||
if (!nbt.hasKey("barrierOffsetY") && panelData.heightOffset != 0.0f) {
|
||||
offsetY = panelData.heightOffset;
|
||||
|
||||
@@ -4,7 +4,7 @@ import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -215,7 +215,7 @@ public class TelegraphInstance {
|
||||
nbt.setString("instanceId", instanceId);
|
||||
|
||||
if (telegraph != null) {
|
||||
nbt.setTag("telegraph", ((MC1710NBTCompound) telegraph.writeNBT()).getMCTag());
|
||||
nbt.setTag("telegraph", ((NBTWrapper) telegraph.writeNBT()).getMCTag());
|
||||
}
|
||||
|
||||
nbt.setDouble("x", x);
|
||||
@@ -241,7 +241,7 @@ public class TelegraphInstance {
|
||||
|
||||
if (nbt.hasKey("telegraph")) {
|
||||
this.telegraph = new Telegraph();
|
||||
this.telegraph.readNBT(new MC1710NBTCompound(nbt.getCompoundTag("telegraph")));
|
||||
this.telegraph.readNBT(new NBTWrapper(nbt.getCompoundTag("telegraph")));
|
||||
}
|
||||
|
||||
this.x = nbt.getDouble("x");
|
||||
|
||||
@@ -13,7 +13,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.controllers.data.MagicData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
/**
|
||||
* Universal base class for all energy ability entities (Projectiles, Barriers, Sweeper).
|
||||
@@ -354,12 +354,12 @@ public abstract class EntityEnergyAbility extends Entity implements IEntityAddit
|
||||
protected void writeEnergyBaseNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger("OwnerId", ownerEntityId);
|
||||
nbt.setBoolean("IgnoreIFrames", ignoreIFrames);
|
||||
displayData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
lightningData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
displayData.writeNBT(new NBTWrapper(nbt));
|
||||
lightningData.writeNBT(new NBTWrapper(nbt));
|
||||
if (customDamageData != null) {
|
||||
nbt.setTag("CustomDamageData", customDamageData);
|
||||
}
|
||||
magicData.writeToNBT(new MC1710NBTCompound(nbt));
|
||||
magicData.writeToNBT(new NBTWrapper(nbt));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -369,12 +369,12 @@ public abstract class EntityEnergyAbility extends Entity implements IEntityAddit
|
||||
protected void readEnergyBaseNBT(NBTTagCompound nbt) {
|
||||
this.ownerEntityId = nbt.getInteger("OwnerId");
|
||||
this.ignoreIFrames = nbt.getBoolean("IgnoreIFrames");
|
||||
displayData.readNBT(new MC1710NBTCompound(nbt));
|
||||
lightningData.readNBT(new MC1710NBTCompound(nbt));
|
||||
displayData.readNBT(new NBTWrapper(nbt));
|
||||
lightningData.readNBT(new NBTWrapper(nbt));
|
||||
if (nbt.hasKey("CustomDamageData")) {
|
||||
this.customDamageData = nbt.getCompoundTag("CustomDamageData");
|
||||
}
|
||||
magicData.readToNBT(new MC1710NBTCompound(nbt));
|
||||
magicData.readToNBT(new NBTWrapper(nbt));
|
||||
}
|
||||
|
||||
// ==================== WORLD NBT (INTENTIONALLY EMPTY) ====================
|
||||
|
||||
@@ -18,7 +18,7 @@ import noppes.npcs.EventHooks;
|
||||
import noppes.npcs.controllers.data.MagicData;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
@@ -870,7 +870,7 @@ public abstract class EntityEnergyBarrier extends EntityEnergyAbility {
|
||||
nbt.setBoolean("Charging", charging);
|
||||
nbt.setInteger("ChargeTick", chargeTick);
|
||||
nbt.setInteger("ChargeDuration", chargeDuration);
|
||||
barrierData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
barrierData.writeNBT(new NBTWrapper(nbt));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -886,7 +886,7 @@ public abstract class EntityEnergyBarrier extends EntityEnergyAbility {
|
||||
this.chargeTick = nbt.getInteger("ChargeTick");
|
||||
this.chargeDuration = nbt.getInteger("ChargeDuration");
|
||||
this.dataWatcher.updateObject(DW_CHARGING, (byte) (charging ? 1 : 0));
|
||||
barrierData.readNBT(new MC1710NBTCompound(nbt));
|
||||
barrierData.readNBT(new NBTWrapper(nbt));
|
||||
}
|
||||
|
||||
// ==================== DEBUG LOGGING ====================
|
||||
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.NpcDamageSource;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -739,7 +739,7 @@ public class EntityEnergyPanel extends EntityEnergyBarrier {
|
||||
nbt.setInteger("PanelMode", mode.ordinal());
|
||||
nbt.setFloat("TargetPanelWidth", targetPanelWidth);
|
||||
nbt.setFloat("TargetPanelHeight", targetPanelHeight);
|
||||
panelData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
panelData.writeNBT(new NBTWrapper(nbt));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -749,7 +749,7 @@ public class EntityEnergyPanel extends EntityEnergyBarrier {
|
||||
int modeOrdinal = nbt.getInteger("PanelMode");
|
||||
this.mode = (modeOrdinal >= 0 && modeOrdinal < PanelMode.values().length)
|
||||
? PanelMode.values()[modeOrdinal] : PanelMode.PLACED;
|
||||
panelData.readNBT(new MC1710NBTCompound(nbt));
|
||||
panelData.readNBT(new NBTWrapper(nbt));
|
||||
panelData.panelWidth = sanitize(panelData.panelWidth, 3.0f, MAX_ENTITY_SIZE);
|
||||
panelData.panelHeight = sanitize(panelData.panelHeight, 3.0f, MAX_ENTITY_SIZE);
|
||||
this.targetPanelWidth = sanitize(nbt.hasKey("TargetPanelWidth") ? nbt.getFloat("TargetPanelWidth") : panelData.panelWidth, 3.0f, MAX_ENTITY_SIZE);
|
||||
|
||||
@@ -47,7 +47,7 @@ import noppes.npcs.controllers.data.Party;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
@@ -2479,10 +2479,10 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
|
||||
this.renderCurrentSize = this.size;
|
||||
this.prevRenderSize = this.size;
|
||||
|
||||
anchorData.readNBT(new MC1710NBTCompound(nbt));
|
||||
combatData.readNBT(new MC1710NBTCompound(nbt));
|
||||
homingData.readNBT(new MC1710NBTCompound(nbt));
|
||||
lifespanData.readNBT(new MC1710NBTCompound(nbt));
|
||||
anchorData.readNBT(new NBTWrapper(nbt));
|
||||
combatData.readNBT(new NBTWrapper(nbt));
|
||||
homingData.readNBT(new NBTWrapper(nbt));
|
||||
lifespanData.readNBT(new NBTWrapper(nbt));
|
||||
syncProjectileColorWatchers();
|
||||
}
|
||||
|
||||
@@ -2514,10 +2514,10 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
|
||||
nbt.setDouble("MotionY", motionY);
|
||||
nbt.setDouble("MotionZ", motionZ);
|
||||
|
||||
anchorData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
combatData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
homingData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
lifespanData.writeNBT(new MC1710NBTCompound(nbt));
|
||||
anchorData.writeNBT(new NBTWrapper(nbt));
|
||||
combatData.writeNBT(new NBTWrapper(nbt));
|
||||
homingData.writeNBT(new NBTWrapper(nbt));
|
||||
lifespanData.writeNBT(new NBTWrapper(nbt));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.controllers.data.MagicData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
@@ -87,7 +87,7 @@ public final class PlayerDataInfoPacket extends LargeAbstractPacket {
|
||||
writeMap(buffer, factionData);
|
||||
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
playerMagicData.writeToNBT(new MC1710NBTCompound(compound));
|
||||
playerMagicData.writeToNBT(new NBTWrapper(compound));
|
||||
ByteBufUtils.writeNBT(buffer, compound);
|
||||
|
||||
byte[] bytes = new byte[buffer.readableBytes()];
|
||||
|
||||
@@ -24,7 +24,7 @@ import noppes.npcs.controllers.AuctionController;
|
||||
import noppes.npcs.controllers.data.AuctionClaim;
|
||||
import noppes.npcs.controllers.data.AuctionFilter;
|
||||
import noppes.npcs.controllers.data.AuctionListing;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
@@ -128,7 +128,7 @@ public class AuctionActionPacket extends AbstractPacket {
|
||||
public static void requestListings(AuctionFilter filter, int page) {
|
||||
AuctionActionPacket packet = new AuctionActionPacket(Action.RequestListings);
|
||||
packet.amount = page;
|
||||
packet.data = ((MC1710NBTCompound) filter.writeToNBT(new MC1710NBTCompound(new NBTTagCompound()))).getMCTag();
|
||||
packet.data = ((NBTWrapper) filter.writeToNBT(new NBTWrapper(new NBTTagCompound()))).getMCTag();
|
||||
PacketClient.sendClient(packet);
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ public class AuctionActionPacket extends AbstractPacket {
|
||||
|
||||
AuctionFilter filter = new AuctionFilter();
|
||||
if (filterNBT != null) {
|
||||
filter.readFromNBT(new MC1710NBTCompound(filterNBT));
|
||||
filter.readFromNBT(new NBTWrapper(filterNBT));
|
||||
}
|
||||
|
||||
// Get listings for this page
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.controllers.PlayerDataController;
|
||||
import noppes.npcs.controllers.data.AbilityHotbarData;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -62,7 +62,7 @@ public final class AbilityHotbarSavePacket extends AbstractPacket {
|
||||
AbilityHotbarData slotData = data.hotbarData.getSlot(slot);
|
||||
if (slotData == null) return;
|
||||
|
||||
slotData.readFromNBT(new MC1710NBTCompound(compound.getCompoundTag("AbilityHotbar" + slot)));
|
||||
slotData.readFromNBT(new NBTWrapper(compound.getCompoundTag("AbilityHotbar" + slot)));
|
||||
|
||||
// Validate the ability key
|
||||
boolean valid = true;
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.constants.EnumScrollData;
|
||||
import noppes.npcs.controllers.MagicController;
|
||||
import noppes.npcs.controllers.data.MagicCycle;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
@@ -72,7 +72,7 @@ public class MagicCyclesPacket extends AbstractPacket {
|
||||
return;
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
NBTTagCompound magicCompound = new NBTTagCompound();
|
||||
cycle.writeNBT(new MC1710NBTCompound(magicCompound));
|
||||
cycle.writeNBT(new NBTWrapper(magicCompound));
|
||||
compound.setTag("MagicCycle", magicCompound);
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, compound);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import kamkeel.npcs.controllers.ProfileController;
|
||||
import kamkeel.npcs.controllers.data.profile.Profile;
|
||||
import kamkeel.npcs.controllers.data.profile.ProfileInfoEntry;
|
||||
import kamkeel.npcs.network.AbstractPacket;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import kamkeel.npcs.network.PacketChannel;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
import kamkeel.npcs.network.enums.EnumPlayerPacket;
|
||||
@@ -73,7 +73,7 @@ public final class ProfileGetInfoPacket extends AbstractPacket {
|
||||
slotCompound.setInteger("ID", slot.getId());
|
||||
List<ProfileInfoEntry> profileInfo = ProfileController.Instance.getProfileInfo(player, slot.getId());
|
||||
for (ProfileInfoEntry profileInfoEntry : profileInfo) {
|
||||
infoList.appendTag(((MC1710NBTCompound) profileInfoEntry.writeToNBT()).getMCTag());
|
||||
infoList.appendTag(((NBTWrapper) profileInfoEntry.writeToNBT()).getMCTag());
|
||||
}
|
||||
slotCompound.setTag("INFO", infoList);
|
||||
slotList.appendTag(slotCompound);
|
||||
@@ -99,7 +99,7 @@ public final class ProfileGetInfoPacket extends AbstractPacket {
|
||||
List<ProfileInfoEntry> infoEntries = new ArrayList<>();
|
||||
for (int j = 0; j < infoList.tagCount(); j++) {
|
||||
NBTTagCompound infoTag = infoList.getCompoundTagAt(j);
|
||||
infoEntries.add(ProfileInfoEntry.readFromNBT(new MC1710NBTCompound(infoTag))); // Convert back to InfoEntry
|
||||
infoEntries.add(ProfileInfoEntry.readFromNBT(new NBTWrapper(infoTag))); // Convert back to InfoEntry
|
||||
}
|
||||
|
||||
slotInfoMap.put(slotId, infoEntries);
|
||||
|
||||
@@ -24,7 +24,7 @@ import noppes.npcs.controllers.AuctionController;
|
||||
import noppes.npcs.controllers.data.AuctionClaim;
|
||||
import noppes.npcs.controllers.data.AuctionFilter;
|
||||
import noppes.npcs.controllers.data.AuctionListing;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -80,7 +80,7 @@ public class ManageAuctionPacket extends AbstractPacket {
|
||||
public static void requestListings(AuctionFilter filter, int page) {
|
||||
ManageAuctionPacket packet = new ManageAuctionPacket(Action.REQUEST_LISTINGS);
|
||||
packet.page = page;
|
||||
packet.data = filter != null ? ((MC1710NBTCompound) filter.writeToNBT(new MC1710NBTCompound(new NBTTagCompound()))).getMCTag() : new NBTTagCompound();
|
||||
packet.data = filter != null ? ((NBTWrapper) filter.writeToNBT(new NBTWrapper(new NBTTagCompound()))).getMCTag() : new NBTTagCompound();
|
||||
PacketClient.sendClient(packet);
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ public class ManageAuctionPacket extends AbstractPacket {
|
||||
|
||||
AuctionFilter filter = new AuctionFilter();
|
||||
if (filterNbt != null) {
|
||||
filter.readFromNBT(new MC1710NBTCompound(filterNbt));
|
||||
filter.readFromNBT(new NBTWrapper(filterNbt));
|
||||
}
|
||||
|
||||
int totalListings = controller.getTotalActiveListings(filter);
|
||||
|
||||
@@ -22,7 +22,7 @@ import noppes.npcs.controllers.CategoryManager;
|
||||
import noppes.npcs.controllers.CustomEffectController;
|
||||
import noppes.npcs.controllers.LinkedItemController;
|
||||
import noppes.npcs.controllers.data.Category;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -73,7 +73,7 @@ public final class CategorySavePacket extends AbstractPacket {
|
||||
return;
|
||||
|
||||
Category cat = new Category();
|
||||
cat.readNBT(new MC1710NBTCompound(compound));
|
||||
cat.readNBT(new NBTWrapper(compound));
|
||||
|
||||
if (cat.id <= 0) {
|
||||
cm.createCategory(cat.title);
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.controllers.TagController;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
@@ -54,7 +54,7 @@ public final class CloneAllTagsPacket extends AbstractPacket {
|
||||
NBTTagList validTagList = new NBTTagList();
|
||||
for (Tag tag : validTags) {
|
||||
NBTTagCompound tagCompound = new NBTTagCompound();
|
||||
tag.writeNBT(new MC1710NBTCompound(tagCompound));
|
||||
tag.writeNBT(new NBTWrapper(tagCompound));
|
||||
validTagList.appendTag(tagCompound);
|
||||
}
|
||||
compound.setTag("AllTags", validTagList);
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.controllers.TagController;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
@@ -54,7 +54,7 @@ public final class CloneAllTagsShortPacket extends AbstractPacket {
|
||||
NBTTagList validTagList = new NBTTagList();
|
||||
for (Tag tag : validTags) {
|
||||
NBTTagCompound tagCompound = new NBTTagCompound();
|
||||
tag.writeShortNBT(new MC1710NBTCompound(tagCompound));
|
||||
tag.writeShortNBT(new NBTWrapper(tagCompound));
|
||||
validTagList.appendTag(tagCompound);
|
||||
}
|
||||
compound.setTag("ShortTags", validTagList);
|
||||
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.controllers.ServerCloneController;
|
||||
import noppes.npcs.controllers.data.CloneFolder;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -103,7 +103,7 @@ public final class CloneFolderCrudPacket extends AbstractPacket {
|
||||
compound.setBoolean("Success", success);
|
||||
NBTTagList folderList = new NBTTagList();
|
||||
for (CloneFolder folder : ServerCloneController.Instance.getFolderList()) {
|
||||
folderList.appendTag(((MC1710NBTCompound) folder.writeNBT(new MC1710NBTCompound(new NBTTagCompound()))).getMCTag());
|
||||
folderList.appendTag(((NBTWrapper) folder.writeNBT(new NBTWrapper(new NBTTagCompound()))).getMCTag());
|
||||
}
|
||||
compound.setTag("CloneFolders", folderList);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.controllers.ServerCloneController;
|
||||
import noppes.npcs.controllers.data.CloneFolder;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -51,7 +51,7 @@ public final class CloneFolderListPacket extends AbstractPacket {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
NBTTagList folderList = new NBTTagList();
|
||||
for (CloneFolder folder : ServerCloneController.Instance.getFolderList()) {
|
||||
folderList.appendTag(((MC1710NBTCompound) folder.writeNBT(new MC1710NBTCompound(new NBTTagCompound()))).getMCTag());
|
||||
folderList.appendTag(((NBTWrapper) folder.writeNBT(new NBTWrapper(new NBTTagCompound()))).getMCTag());
|
||||
}
|
||||
compound.setTag("CloneFolders", folderList);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.controllers.ServerTagMapController;
|
||||
import noppes.npcs.controllers.data.TagMap;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -74,7 +74,7 @@ public final class CloneTagListPacket extends AbstractPacket {
|
||||
tagMap = ServerTagMapController.Instance.getTagMap(tab);
|
||||
}
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setTag("CloneTags", ((MC1710NBTCompound) tagMap.writeNBT()).getMCTag());
|
||||
compound.setTag("CloneTags", ((NBTWrapper) tagMap.writeNBT()).getMCTag());
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, compound);
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.controllers.MagicController;
|
||||
import noppes.npcs.controllers.data.MagicCycle;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -59,7 +59,7 @@ public class MagicCycleSavePacket extends AbstractPacket {
|
||||
return;
|
||||
NBTTagCompound comp = ByteBufUtils.readNBT(in);
|
||||
MagicCycle cycle = new MagicCycle();
|
||||
cycle.readNBT(new MC1710NBTCompound(comp));
|
||||
cycle.readNBT(new NBTWrapper(comp));
|
||||
MagicController.getInstance().saveCycle(cycle);
|
||||
|
||||
NoppesUtilServer.sendMagicInfo((EntityPlayerMP) player, true);
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.controllers.MagicController;
|
||||
import noppes.npcs.controllers.data.Magic;
|
||||
import noppes.npcs.controllers.data.MagicCycle;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -73,7 +73,7 @@ public final class MagicGetPacket extends AbstractPacket {
|
||||
MagicCycle cycle = MagicController.getInstance().getCycle(id);
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
NBTTagCompound magicCompound = new NBTTagCompound();
|
||||
cycle.writeNBT(new MC1710NBTCompound(magicCompound));
|
||||
cycle.writeNBT(new NBTWrapper(magicCompound));
|
||||
compound.setTag("MagicCycle", magicCompound);
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, compound);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import kamkeel.npcs.network.packets.data.large.GuiDataPacket;
|
||||
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;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -49,7 +49,7 @@ public final class MagicNpcGetPacket extends AbstractPacket {
|
||||
return;
|
||||
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
npc.stats.magicData.writeToNBT(new MC1710NBTCompound(compound));
|
||||
npc.stats.magicData.writeToNBT(new NBTWrapper(compound));
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, compound);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.controllers.data.MagicData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -55,7 +55,7 @@ public final class MagicNpcSavePacket extends AbstractPacket {
|
||||
public void sendData(ByteBuf out) throws IOException {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if (magicData != null) {
|
||||
magicData.writeToNBT(new MC1710NBTCompound(compound));
|
||||
magicData.writeToNBT(new NBTWrapper(compound));
|
||||
}
|
||||
ByteBufUtils.writeNBT(out, compound);
|
||||
}
|
||||
@@ -66,6 +66,6 @@ public final class MagicNpcSavePacket extends AbstractPacket {
|
||||
return;
|
||||
|
||||
NBTTagCompound compound = ByteBufUtils.readNBT(in);
|
||||
npc.stats.magicData.readToNBT(new MC1710NBTCompound(compound));
|
||||
npc.stats.magicData.readToNBT(new NBTWrapper(compound));
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.controllers.TagController;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -54,7 +54,7 @@ public final class TagGetPacket extends AbstractPacket {
|
||||
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
Tag tag = TagController.getInstance().get(in.readInt());
|
||||
tag.writeNBT(new MC1710NBTCompound(compound));
|
||||
tag.writeNBT(new NBTWrapper(compound));
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, compound);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.controllers.TagController;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -66,7 +66,7 @@ public final class TagRemovePacket extends AbstractPacket {
|
||||
TagController.getInstance().delete(id);
|
||||
NoppesUtilServer.sendTagDataAll((EntityPlayerMP) player);
|
||||
NBTTagCompound comp = new NBTTagCompound();
|
||||
(new Tag()).writeNBT(new MC1710NBTCompound(comp));
|
||||
(new Tag()).writeNBT(new NBTWrapper(comp));
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, comp);
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.controllers.TagController;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -64,11 +64,11 @@ public final class TagSavePacket extends AbstractPacket {
|
||||
return;
|
||||
|
||||
Tag tag = new Tag();
|
||||
tag.readNBT(new MC1710NBTCompound(ByteBufUtils.readNBT(in)));
|
||||
tag.readNBT(new NBTWrapper(ByteBufUtils.readNBT(in)));
|
||||
TagController.getInstance().saveTag(tag);
|
||||
NoppesUtilServer.sendTagDataAll((EntityPlayerMP) player);
|
||||
NBTTagCompound comp = new NBTTagCompound();
|
||||
tag.writeNBT(new MC1710NBTCompound(comp));
|
||||
tag.writeNBT(new NBTWrapper(comp));
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, comp);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -15,7 +15,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import noppes.npcs.constants.EnumRoleType;
|
||||
import noppes.npcs.roles.RoleTransporter;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -58,7 +58,7 @@ public final class TransportGetLocationPacket extends AbstractPacket {
|
||||
|
||||
RoleTransporter role = (RoleTransporter) npc.roleInterface;
|
||||
if (role.hasTransport()) {
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, ((MC1710NBTCompound) role.getLocation().writeNBT()).getMCTag());
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, ((NBTWrapper) role.getLocation().writeNBT()).getMCTag());
|
||||
ScrollSelectedPacket.setSelectedList((EntityPlayerMP) player, role.getLocation().category.title);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -1,18 +1,18 @@
|
||||
package kamkeel.npcs.wrapper.platform;
|
||||
|
||||
import kamkeel.npcs.platform.entity.IPlatformDamageSource;
|
||||
import kamkeel.npcs.platform.entity.IPlatformEntity;
|
||||
import kamkeel.npcs.platform.entity.IDamage;
|
||||
import kamkeel.npcs.platform.entity.IMob;
|
||||
import net.minecraft.util.DamageSource;
|
||||
|
||||
/**
|
||||
* MC 1.7.10 implementation of {@link IPlatformDamageSource}.
|
||||
* MC 1.7.10 implementation of {@link IDamage}.
|
||||
* Wraps a raw {@link DamageSource} instance.
|
||||
*/
|
||||
public class MC1710PlatformDamageSource implements IPlatformDamageSource {
|
||||
public class DamageWrapper implements IDamage {
|
||||
|
||||
private final DamageSource source;
|
||||
|
||||
public MC1710PlatformDamageSource(DamageSource source) {
|
||||
public DamageWrapper(DamageSource source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ public class MC1710PlatformDamageSource implements IPlatformDamageSource {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformEntity getSourceEntity() {
|
||||
public IMob getSourceEntity() {
|
||||
if (source.getEntity() == null) return null;
|
||||
return new MC1710PlatformEntity(source.getEntity());
|
||||
return new EntityWrapper(source.getEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
+7
-7
@@ -1,18 +1,18 @@
|
||||
package kamkeel.npcs.wrapper.platform;
|
||||
|
||||
import kamkeel.npcs.platform.entity.IPlatformEntity;
|
||||
import kamkeel.npcs.platform.entity.IPlatformWorld;
|
||||
import kamkeel.npcs.platform.entity.IMob;
|
||||
import kamkeel.npcs.platform.entity.IGameWorld;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
/**
|
||||
* MC 1.7.10 implementation of {@link IPlatformEntity}.
|
||||
* MC 1.7.10 implementation of {@link IMob}.
|
||||
* Wraps a raw {@link Entity} instance.
|
||||
*/
|
||||
public class MC1710PlatformEntity implements IPlatformEntity {
|
||||
public class EntityWrapper implements IMob {
|
||||
|
||||
protected final Entity entity;
|
||||
|
||||
public MC1710PlatformEntity(Entity entity) {
|
||||
public EntityWrapper(Entity entity) {
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ public class MC1710PlatformEntity implements IPlatformEntity {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformWorld getWorld() {
|
||||
return new MC1710PlatformWorld(entity.worldObj);
|
||||
public IGameWorld getWorld() {
|
||||
return new WorldWrapper(entity.worldObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
+6
-6
@@ -1,19 +1,19 @@
|
||||
package kamkeel.npcs.wrapper.platform;
|
||||
|
||||
import kamkeel.npcs.platform.entity.IPlatformDamageSource;
|
||||
import kamkeel.npcs.platform.entity.IPlatformLiving;
|
||||
import kamkeel.npcs.platform.entity.IDamage;
|
||||
import kamkeel.npcs.platform.entity.ILiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.DamageSource;
|
||||
|
||||
/**
|
||||
* MC 1.7.10 implementation of {@link IPlatformLiving}.
|
||||
* MC 1.7.10 implementation of {@link ILiving}.
|
||||
* Wraps a raw {@link EntityLivingBase} instance.
|
||||
*/
|
||||
public class MC1710PlatformLiving extends MC1710PlatformEntity implements IPlatformLiving {
|
||||
public class LivingWrapper extends EntityWrapper implements ILiving {
|
||||
|
||||
protected final EntityLivingBase living;
|
||||
|
||||
public MC1710PlatformLiving(EntityLivingBase living) {
|
||||
public LivingWrapper(EntityLivingBase living) {
|
||||
super(living);
|
||||
this.living = living;
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class MC1710PlatformLiving extends MC1710PlatformEntity implements IPlatf
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damage(float amount, IPlatformDamageSource source) {
|
||||
public void damage(float amount, IDamage source) {
|
||||
DamageSource mcSource = source != null ? (DamageSource) source.getHandle() : DamageSource.generic;
|
||||
living.attackEntityFrom(mcSource, amount);
|
||||
}
|
||||
+7
-7
@@ -1,19 +1,19 @@
|
||||
package kamkeel.npcs.wrapper.platform;
|
||||
|
||||
import kamkeel.npcs.platform.entity.IPlatformPlayer;
|
||||
import kamkeel.npcs.platform.entity.IPlatformStack;
|
||||
import kamkeel.npcs.platform.entity.IUser;
|
||||
import kamkeel.npcs.platform.entity.IStack;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
/**
|
||||
* MC 1.7.10 implementation of {@link IPlatformPlayer}.
|
||||
* MC 1.7.10 implementation of {@link IUser}.
|
||||
* Wraps a raw {@link EntityPlayerMP} instance.
|
||||
*/
|
||||
public class MC1710PlatformPlayer extends MC1710PlatformLiving implements IPlatformPlayer {
|
||||
public class PlayerWrapper extends LivingWrapper implements IUser {
|
||||
|
||||
private final EntityPlayerMP player;
|
||||
|
||||
public MC1710PlatformPlayer(EntityPlayerMP player) {
|
||||
public PlayerWrapper(EntityPlayerMP player) {
|
||||
super(player);
|
||||
this.player = player;
|
||||
}
|
||||
@@ -40,8 +40,8 @@ public class MC1710PlatformPlayer extends MC1710PlatformLiving implements IPlatf
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformStack getHeldItem() {
|
||||
public IStack getHeldItem() {
|
||||
if (player.getHeldItem() == null) return null;
|
||||
return new MC1710PlatformStack(player.getHeldItem());
|
||||
return new StackWrapper(player.getHeldItem());
|
||||
}
|
||||
}
|
||||
+10
-10
@@ -1,20 +1,20 @@
|
||||
package kamkeel.npcs.wrapper.platform;
|
||||
|
||||
import kamkeel.npcs.platform.entity.IPlatformStack;
|
||||
import kamkeel.npcs.platform.entity.IStack;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
/**
|
||||
* MC 1.7.10 implementation of {@link IPlatformStack}.
|
||||
* MC 1.7.10 implementation of {@link IStack}.
|
||||
* Wraps a raw {@link ItemStack} instance.
|
||||
*/
|
||||
public class MC1710PlatformStack implements IPlatformStack {
|
||||
public class StackWrapper implements IStack {
|
||||
|
||||
private final ItemStack stack;
|
||||
|
||||
public MC1710PlatformStack(ItemStack stack) {
|
||||
public StackWrapper(ItemStack stack) {
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@@ -47,13 +47,13 @@ public class MC1710PlatformStack implements IPlatformStack {
|
||||
@Override
|
||||
public INBTCompound getTag() {
|
||||
if (stack == null || stack.stackTagCompound == null) return null;
|
||||
return new MC1710NBTCompound(stack.stackTagCompound);
|
||||
return new NBTWrapper(stack.stackTagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTag(INBTCompound tag) {
|
||||
if (stack != null) {
|
||||
stack.stackTagCompound = tag != null ? ((MC1710NBTCompound) tag).getMCTag() : null;
|
||||
stack.stackTagCompound = tag != null ? ((NBTWrapper) tag).getMCTag() : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,9 +63,9 @@ public class MC1710PlatformStack implements IPlatformStack {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformStack copy() {
|
||||
if (stack == null) return new MC1710PlatformStack(null);
|
||||
return new MC1710PlatformStack(stack.copy());
|
||||
public IStack copy() {
|
||||
if (stack == null) return new StackWrapper(null);
|
||||
return new StackWrapper(stack.copy());
|
||||
}
|
||||
|
||||
@Override
|
||||
+7
-7
@@ -1,19 +1,19 @@
|
||||
package kamkeel.npcs.wrapper.platform;
|
||||
|
||||
import kamkeel.npcs.platform.entity.IPlatformEntity;
|
||||
import kamkeel.npcs.platform.entity.IPlatformWorld;
|
||||
import kamkeel.npcs.platform.entity.IMob;
|
||||
import kamkeel.npcs.platform.entity.IGameWorld;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* MC 1.7.10 implementation of {@link IPlatformWorld}.
|
||||
* MC 1.7.10 implementation of {@link IGameWorld}.
|
||||
* Wraps a raw {@link World} instance.
|
||||
*/
|
||||
public class MC1710PlatformWorld implements IPlatformWorld {
|
||||
public class WorldWrapper implements IGameWorld {
|
||||
|
||||
private final World world;
|
||||
|
||||
public MC1710PlatformWorld(World world) {
|
||||
public WorldWrapper(World world) {
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@ public class MC1710PlatformWorld implements IPlatformWorld {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformEntity getEntityById(int id) {
|
||||
public IMob getEntityById(int id) {
|
||||
Entity entity = world.getEntityByID(id);
|
||||
if (entity == null) return null;
|
||||
return new MC1710PlatformEntity(entity);
|
||||
return new EntityWrapper(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -10,7 +10,7 @@ import noppes.npcs.controllers.data.FactionOptions;
|
||||
import noppes.npcs.controllers.data.Line;
|
||||
import noppes.npcs.controllers.data.Lines;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.roles.JobBard;
|
||||
import noppes.npcs.roles.JobChunkLoader;
|
||||
import noppes.npcs.roles.JobConversation;
|
||||
@@ -69,11 +69,11 @@ public class DataAdvanced {
|
||||
}
|
||||
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
|
||||
compound.setTag("NpcLines", ((MC1710NBTCompound) worldLines.writeToNBT()).getMCTag());
|
||||
compound.setTag("NpcKilledLines", ((MC1710NBTCompound) killedLines.writeToNBT()).getMCTag());
|
||||
compound.setTag("NpcInteractLines", ((MC1710NBTCompound) interactLines.writeToNBT()).getMCTag());
|
||||
compound.setTag("NpcAttackLines", ((MC1710NBTCompound) attackLines.writeToNBT()).getMCTag());
|
||||
compound.setTag("NpcKillLines", ((MC1710NBTCompound) killLines.writeToNBT()).getMCTag());
|
||||
compound.setTag("NpcLines", ((NBTWrapper) worldLines.writeToNBT()).getMCTag());
|
||||
compound.setTag("NpcKilledLines", ((NBTWrapper) killedLines.writeToNBT()).getMCTag());
|
||||
compound.setTag("NpcInteractLines", ((NBTWrapper) interactLines.writeToNBT()).getMCTag());
|
||||
compound.setTag("NpcAttackLines", ((NBTWrapper) attackLines.writeToNBT()).getMCTag());
|
||||
compound.setTag("NpcKillLines", ((NBTWrapper) killLines.writeToNBT()).getMCTag());
|
||||
|
||||
compound.setString("NpcIdleSound", idleSound);
|
||||
compound.setString("NpcAngrySound", angrySound);
|
||||
@@ -110,11 +110,11 @@ public class DataAdvanced {
|
||||
}
|
||||
|
||||
public void readToNBT(NBTTagCompound compound) {
|
||||
interactLines.readNBT(new MC1710NBTCompound(compound.getCompoundTag("NpcInteractLines")));
|
||||
worldLines.readNBT(new MC1710NBTCompound(compound.getCompoundTag("NpcLines")));
|
||||
attackLines.readNBT(new MC1710NBTCompound(compound.getCompoundTag("NpcAttackLines")));
|
||||
killedLines.readNBT(new MC1710NBTCompound(compound.getCompoundTag("NpcKilledLines")));
|
||||
killLines.readNBT(new MC1710NBTCompound(compound.getCompoundTag("NpcKillLines")));
|
||||
interactLines.readNBT(new NBTWrapper(compound.getCompoundTag("NpcInteractLines")));
|
||||
worldLines.readNBT(new NBTWrapper(compound.getCompoundTag("NpcLines")));
|
||||
attackLines.readNBT(new NBTWrapper(compound.getCompoundTag("NpcAttackLines")));
|
||||
killedLines.readNBT(new NBTWrapper(compound.getCompoundTag("NpcKilledLines")));
|
||||
killLines.readNBT(new NBTWrapper(compound.getCompoundTag("NpcKillLines")));
|
||||
|
||||
idleSound = compound.getString("NpcIdleSound");
|
||||
angrySound = compound.getString("NpcAngrySound");
|
||||
|
||||
@@ -21,7 +21,7 @@ import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.controllers.data.HitboxData;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
import noppes.npcs.controllers.data.TintData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.entity.data.DataSkinOverlays;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
@@ -102,8 +102,8 @@ public class DataDisplay {
|
||||
nbttagcompound = skinOverlayData.writeToNBT(nbttagcompound);
|
||||
|
||||
nbttagcompound = animationData.writeToNBT(nbttagcompound);
|
||||
nbttagcompound = ((MC1710NBTCompound) hitboxData.writeToNBT(new MC1710NBTCompound(nbttagcompound))).getMCTag();
|
||||
nbttagcompound = ((MC1710NBTCompound) tintData.writeToNBT(new MC1710NBTCompound(nbttagcompound))).getMCTag();
|
||||
nbttagcompound = ((NBTWrapper) hitboxData.writeToNBT(new NBTWrapper(nbttagcompound))).getMCTag();
|
||||
nbttagcompound = ((NBTWrapper) tintData.writeToNBT(new NBTWrapper(nbttagcompound))).getMCTag();
|
||||
|
||||
if (this.playerProfile != null) {
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
@@ -175,7 +175,7 @@ public class DataDisplay {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setInteger("SkinOverlayID", 0); //unique glow texture ID
|
||||
|
||||
(new SkinOverlay(glowTexture)).writeToNBT(new MC1710NBTCompound(compound));
|
||||
(new SkinOverlay(glowTexture)).writeToNBT(new NBTWrapper(compound));
|
||||
|
||||
if (!nbttagcompound.hasKey("SkinOverlayData")) {
|
||||
NBTTagList tagList = new NBTTagList();
|
||||
@@ -190,8 +190,8 @@ public class DataDisplay {
|
||||
skinOverlayData.readFromNBT(nbttagcompound);
|
||||
|
||||
animationData.readFromNBT(nbttagcompound);
|
||||
hitboxData.readFromNBT(new MC1710NBTCompound(nbttagcompound));
|
||||
tintData.readFromNBT(new MC1710NBTCompound(nbttagcompound));
|
||||
hitboxData.readFromNBT(new NBTWrapper(nbttagcompound));
|
||||
tintData.readFromNBT(new NBTWrapper(nbttagcompound));
|
||||
|
||||
modelSize = ValueUtil.clamp(nbttagcompound.getInteger("Size"), 1, Integer.MAX_VALUE);
|
||||
if (modelSize > ConfigMain.NpcSizeLimit)
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.constants.EnumParticleType;
|
||||
import noppes.npcs.constants.EnumPotionType;
|
||||
import noppes.npcs.controllers.data.MagicData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.ScriptParticle;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
@@ -140,7 +140,7 @@ public class DataStats {
|
||||
compound.setBoolean("PlayerSetCanDespawn", playerSetCanDespawn);
|
||||
compound.setInteger("CollidesWith", collidesWith);
|
||||
|
||||
magicData.writeToNBT(new MC1710NBTCompound(compound));
|
||||
magicData.writeToNBT(new NBTWrapper(compound));
|
||||
|
||||
return compound;
|
||||
}
|
||||
@@ -216,7 +216,7 @@ public class DataStats {
|
||||
attackInvisible = compound.getBoolean("AttackInvisible");
|
||||
canDespawn = compound.getBoolean("CanDespawn");
|
||||
playerSetCanDespawn = compound.getBoolean("PlayerSetCanDespawn");
|
||||
magicData.readToNBT(new MC1710NBTCompound(compound));
|
||||
magicData.readToNBT(new NBTWrapper(compound));
|
||||
|
||||
npc.setImmuneToFire(immuneToFire);
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ import noppes.npcs.controllers.data.LinkedItem;
|
||||
import noppes.npcs.controllers.data.Magic;
|
||||
import noppes.npcs.controllers.data.MagicCycle;
|
||||
import noppes.npcs.controllers.data.MagicData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.controllers.data.PlayerBankData;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.PlayerDialogData;
|
||||
@@ -1258,7 +1258,7 @@ public class NoppesUtilServer {
|
||||
playerdata = PlayerData.get(pl);
|
||||
|
||||
if (enumPlayerData == EnumPlayerData.Magic) { // Quest removal
|
||||
playerdata.magicData.readToNBT(new MC1710NBTCompound(compound));
|
||||
playerdata.magicData.readToNBT(new NBTWrapper(compound));
|
||||
}
|
||||
|
||||
playerdata.save();
|
||||
|
||||
@@ -8,7 +8,7 @@ import noppes.npcs.controllers.data.Line;
|
||||
import noppes.npcs.controllers.data.Lines;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.entity.data.ModelRotate;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -72,7 +72,7 @@ public class VersionCompatibility {
|
||||
line.text = (String) interactLines.toArray()[i];
|
||||
lines.lines.put(i, line);
|
||||
}
|
||||
compound.setTag("NpcInteractLines", ((MC1710NBTCompound) lines.writeToNBT()).getMCTag());
|
||||
compound.setTag("NpcInteractLines", ((NBTWrapper) lines.writeToNBT()).getMCTag());
|
||||
|
||||
List<String> worldLines = NBTTags.getStringList(compound.getTagList("NpcLines", 10));
|
||||
lines = new Lines();
|
||||
@@ -81,7 +81,7 @@ public class VersionCompatibility {
|
||||
line.text = (String) worldLines.toArray()[i];
|
||||
lines.lines.put(i, line);
|
||||
}
|
||||
compound.setTag("NpcLines", ((MC1710NBTCompound) lines.writeToNBT()).getMCTag());
|
||||
compound.setTag("NpcLines", ((NBTWrapper) lines.writeToNBT()).getMCTag());
|
||||
|
||||
List<String> attackLines = NBTTags.getStringList(compound.getTagList("NpcAttackLines", 10));
|
||||
lines = new Lines();
|
||||
@@ -90,7 +90,7 @@ public class VersionCompatibility {
|
||||
line.text = (String) attackLines.toArray()[i];
|
||||
lines.lines.put(i, line);
|
||||
}
|
||||
compound.setTag("NpcAttackLines", ((MC1710NBTCompound) lines.writeToNBT()).getMCTag());
|
||||
compound.setTag("NpcAttackLines", ((NBTWrapper) lines.writeToNBT()).getMCTag());
|
||||
|
||||
List<String> killedLines = NBTTags.getStringList(compound.getTagList("NpcKilledLines", 10));
|
||||
lines = new Lines();
|
||||
@@ -99,7 +99,7 @@ public class VersionCompatibility {
|
||||
line.text = (String) killedLines.toArray()[i];
|
||||
lines.lines.put(i, line);
|
||||
}
|
||||
compound.setTag("NpcKilledLines", ((MC1710NBTCompound) lines.writeToNBT()).getMCTag());
|
||||
compound.setTag("NpcKilledLines", ((NBTWrapper) lines.writeToNBT()).getMCTag());
|
||||
|
||||
}
|
||||
if (npc.npcVersion == 12) {
|
||||
|
||||
@@ -28,7 +28,7 @@ import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.constants.EnumScrollData;
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.controllers.data.MagicData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
@@ -62,7 +62,7 @@ public class NoppesUtil {
|
||||
for (int i = 0; i < skinOverlayList.tagCount(); i++) {
|
||||
int tagID = skinOverlayList.getCompoundTagAt(i).getInteger("SkinOverlayID");
|
||||
SkinOverlay overlay = new SkinOverlay();
|
||||
overlay.readFromNBT(new MC1710NBTCompound(skinOverlayList.getCompoundTagAt(i)));
|
||||
overlay.readFromNBT(new NBTWrapper(skinOverlayList.getCompoundTagAt(i)));
|
||||
if (oldOverlays.containsKey(tagID)) {
|
||||
overlay.ticks = oldOverlays.get(tagID).ticks;
|
||||
}
|
||||
@@ -262,7 +262,7 @@ public class NoppesUtil {
|
||||
Map<String, Integer> bankData = readMap(data);
|
||||
Map<String, Integer> factionData = readMap(data);
|
||||
MagicData magicData = new MagicData();
|
||||
magicData.readToNBT(new MC1710NBTCompound(ByteBufUtils.readNBT(data)));
|
||||
magicData.readToNBT(new NBTWrapper(ByteBufUtils.readNBT(data)));
|
||||
|
||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||
if (gui == null)
|
||||
|
||||
@@ -32,7 +32,7 @@ import noppes.npcs.client.gui.util.ICustomScrollListener;
|
||||
import noppes.npcs.client.gui.util.IGuiData;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.controllers.data.TagMap;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
@@ -597,7 +597,7 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData, ICust
|
||||
} else if (compound.hasKey("CloneTags")) {
|
||||
this.tagMap = new TagMap(activeTab);
|
||||
NBTTagCompound cloneTags = compound.getCompoundTag("CloneTags");
|
||||
this.tagMap.readNBT(new MC1710NBTCompound(cloneTags));
|
||||
this.tagMap.readNBT(new NBTWrapper(cloneTags));
|
||||
} else if (compound.hasKey("AllTags")) {
|
||||
NBTTagList validTags = compound.getTagList("AllTags", 10);
|
||||
if (validTags != null) {
|
||||
@@ -606,7 +606,7 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData, ICust
|
||||
for (int j = 0; j < validTags.tagCount(); j++) {
|
||||
NBTTagCompound tagStructure = validTags.getCompoundTagAt(j);
|
||||
Tag tag = new Tag();
|
||||
tag.readNBT(new MC1710NBTCompound(tagStructure));
|
||||
tag.readNBT(new NBTWrapper(tagStructure));
|
||||
tagsUpdate.put(tag.uuid, tag);
|
||||
tagNamesUpdate.put(tag.name, tag.uuid);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import noppes.npcs.client.gui.util.ISubGuiListener;
|
||||
import noppes.npcs.client.gui.util.SubGuiInterface;
|
||||
import noppes.npcs.controllers.data.CloneFolder;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -303,7 +303,7 @@ public class GuiNpcMobSpawnerAdd extends GuiNPCInterface implements GuiYesNoCall
|
||||
serverFolderNames.clear();
|
||||
for (int i = 0; i < folderList.tagCount(); i++) {
|
||||
CloneFolder f = new CloneFolder();
|
||||
f.readNBT(new MC1710NBTCompound(folderList.getCompoundTagAt(i)));
|
||||
f.readNBT(new NBTWrapper(folderList.getCompoundTagAt(i)));
|
||||
serverFolderNames.add(f.name);
|
||||
}
|
||||
validateFolder();
|
||||
@@ -317,7 +317,7 @@ public class GuiNpcMobSpawnerAdd extends GuiNPCInterface implements GuiYesNoCall
|
||||
for (int j = 0; j < validTags.tagCount(); j++) {
|
||||
NBTTagCompound tagStructure = validTags.getCompoundTagAt(j);
|
||||
Tag tag = new Tag();
|
||||
tag.readShortNBT(new MC1710NBTCompound(tagStructure));
|
||||
tag.readShortNBT(new NBTWrapper(tagStructure));
|
||||
tagMap.put(tag.name, tag.uuid);
|
||||
addTagUUIDs.add(tag.uuid);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import noppes.npcs.client.gui.util.SubGuiInterface;
|
||||
import noppes.npcs.controllers.data.CloneFolder;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.controllers.data.TagMap;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
@@ -993,7 +993,7 @@ public class GuiNpcMobSpawnerFullscreen extends GuiDirectory implements IGuiData
|
||||
folderNames.clear();
|
||||
for (int i = 0; i < folderList.tagCount(); i++) {
|
||||
CloneFolder folder = new CloneFolder();
|
||||
folder.readNBT(new MC1710NBTCompound(folderList.getCompoundTagAt(i)));
|
||||
folder.readNBT(new NBTWrapper(folderList.getCompoundTagAt(i)));
|
||||
folderNames.add(folder.name);
|
||||
}
|
||||
initGui();
|
||||
@@ -1006,7 +1006,7 @@ public class GuiNpcMobSpawnerFullscreen extends GuiDirectory implements IGuiData
|
||||
this.tagMap = new TagMap(GuiNpcMobSpawner.activeTab);
|
||||
}
|
||||
NBTTagCompound cloneTags = compound.getCompoundTag("CloneTags");
|
||||
this.tagMap.readNBT(new MC1710NBTCompound(cloneTags));
|
||||
this.tagMap.readNBT(new NBTWrapper(cloneTags));
|
||||
} else if (compound.hasKey("AllTags")) {
|
||||
NBTTagList validTags = compound.getTagList("AllTags", 10);
|
||||
if (validTags != null) {
|
||||
@@ -1015,7 +1015,7 @@ public class GuiNpcMobSpawnerFullscreen extends GuiDirectory implements IGuiData
|
||||
for (int j = 0; j < validTags.tagCount(); j++) {
|
||||
NBTTagCompound tagStructure = validTags.getCompoundTagAt(j);
|
||||
Tag tag = new Tag();
|
||||
tag.readNBT(new MC1710NBTCompound(tagStructure));
|
||||
tag.readNBT(new NBTWrapper(tagStructure));
|
||||
tagsUpdate.put(tag.uuid, tag);
|
||||
tagNamesUpdate.put(tag.name, tag.uuid);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import noppes.npcs.client.gui.util.SubGuiInterface;
|
||||
import noppes.npcs.constants.EnumDiagramLayout;
|
||||
import noppes.npcs.controllers.data.MagicAssociation;
|
||||
import noppes.npcs.controllers.data.MagicCycle;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -312,7 +312,7 @@ public class SubGuiMagicCycle extends SubGuiInterface implements ITextfieldListe
|
||||
cycle.associations.put(associationMap.get(name).magicId, associationMap.get(name));
|
||||
}
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
cycle.writeNBT(new MC1710NBTCompound(compound));
|
||||
cycle.writeNBT(new NBTWrapper(compound));
|
||||
PacketClient.sendClient(new MagicCycleSavePacket(compound));
|
||||
super.close();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import noppes.npcs.client.gui.util.SubGuiInterface;
|
||||
import noppes.npcs.constants.EnumPlayerData;
|
||||
import noppes.npcs.constants.EnumScrollData;
|
||||
import noppes.npcs.controllers.data.MagicData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -1034,7 +1034,7 @@ public class SubGuiPlayerData extends SubGuiInterface implements IPlayerDataInfo
|
||||
|
||||
private void saveMagicCompound() {
|
||||
NBTTagCompound magicCompound = new NBTTagCompound();
|
||||
magicData.writeToNBT(new MC1710NBTCompound(magicCompound));
|
||||
magicData.writeToNBT(new NBTWrapper(magicCompound));
|
||||
PacketClient.sendClient(new PlayerDataSaveInfoPacket(playerName, EnumPlayerData.Magic, magicCompound));
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import noppes.npcs.client.gui.util.IScrollData;
|
||||
import noppes.npcs.client.gui.util.ITextfieldListener;
|
||||
import noppes.npcs.constants.EnumScrollData;
|
||||
import noppes.npcs.controllers.data.MagicData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -175,7 +175,7 @@ public class GuiNPCMagic extends GuiNPCInterface2 implements IScrollData, ICusto
|
||||
|
||||
@Override
|
||||
public void setGuiData(NBTTagCompound compound) {
|
||||
npcMagicData.readToNBT(new MC1710NBTCompound(compound));
|
||||
npcMagicData.readToNBT(new NBTWrapper(compound));
|
||||
initGui();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.client.ClientEventHandler;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityTypeSelect;
|
||||
@@ -236,7 +236,7 @@ public class GuiAbilityDirectory extends GuiDirectoryCategorized
|
||||
|
||||
@Override
|
||||
protected void onSaveCategory(Category cat) {
|
||||
PacketClient.sendClient(new CategorySavePacket(getCategoryType(), ((MC1710NBTCompound) cat.writeNBT(new MC1710NBTCompound(new NBTTagCompound()))).getMCTag()));
|
||||
PacketClient.sendClient(new CategorySavePacket(getCategoryType(), ((NBTWrapper) cat.writeNBT(new NBTWrapper(new NBTTagCompound()))).getMCTag()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.util.GuiCustomScroll;
|
||||
import noppes.npcs.client.gui.util.GuiDirectoryCategorized;
|
||||
@@ -136,7 +136,7 @@ public class GuiAnimationDirectory extends GuiDirectoryCategorized {
|
||||
|
||||
@Override
|
||||
protected void onSaveCategory(Category cat) {
|
||||
PacketClient.sendClient(new CategorySavePacket(EnumCategoryType.ANIMATION, ((MC1710NBTCompound) cat.writeNBT(new MC1710NBTCompound(new NBTTagCompound()))).getMCTag()));
|
||||
PacketClient.sendClient(new CategorySavePacket(EnumCategoryType.ANIMATION, ((NBTWrapper) cat.writeNBT(new NBTWrapper(new NBTTagCompound()))).getMCTag()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.ClientCacheHandler;
|
||||
import noppes.npcs.client.gui.SubGuiEffectGeneral;
|
||||
@@ -59,7 +59,7 @@ public class GuiEffectDirectory extends GuiDirectoryCategorized {
|
||||
|
||||
@Override
|
||||
protected void onSaveCategory(Category cat) {
|
||||
PacketClient.sendClient(new CategorySavePacket(EnumCategoryType.EFFECT, ((MC1710NBTCompound) cat.writeNBT(new MC1710NBTCompound(new NBTTagCompound()))).getMCTag()));
|
||||
PacketClient.sendClient(new CategorySavePacket(EnumCategoryType.EFFECT, ((NBTWrapper) cat.writeNBT(new NBTWrapper(new NBTTagCompound()))).getMCTag()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,7 @@ import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.ClientCacheHandler;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -60,7 +60,7 @@ public class GuiLinkedItemDirectory extends GuiDirectoryCategorized {
|
||||
|
||||
@Override
|
||||
protected void onSaveCategory(Category cat) {
|
||||
PacketClient.sendClient(new CategorySavePacket(EnumCategoryType.LINKED_ITEM, ((MC1710NBTCompound) cat.writeNBT(new MC1710NBTCompound(new NBTTagCompound()))).getMCTag()));
|
||||
PacketClient.sendClient(new CategorySavePacket(EnumCategoryType.LINKED_ITEM, ((NBTWrapper) cat.writeNBT(new NBTWrapper(new NBTTagCompound()))).getMCTag()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,7 +22,7 @@ import noppes.npcs.client.gui.util.SubGuiInterface;
|
||||
import noppes.npcs.constants.EnumScrollData;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -114,7 +114,7 @@ public class GuiNPCManageTags extends GuiNPCInterface2 implements IScrollData, I
|
||||
Tag tag = new Tag(-1, name, 0x00FF00);
|
||||
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
tag.writeNBT(new MC1710NBTCompound(compound));
|
||||
tag.writeNBT(new NBTWrapper(compound));
|
||||
PacketClient.sendClient(new TagSavePacket(compound));
|
||||
}
|
||||
if (button.id == 1) {
|
||||
@@ -136,7 +136,7 @@ public class GuiNPCManageTags extends GuiNPCInterface2 implements IScrollData, I
|
||||
@Override
|
||||
public void setGuiData(NBTTagCompound compound) {
|
||||
this.tag = new Tag();
|
||||
tag.readNBT(new MC1710NBTCompound(compound));
|
||||
tag.readNBT(new NBTWrapper(compound));
|
||||
|
||||
setSelected(tag.name);
|
||||
initGui();
|
||||
@@ -171,7 +171,7 @@ public class GuiNPCManageTags extends GuiNPCInterface2 implements IScrollData, I
|
||||
public void save() {
|
||||
if (selected != null && data.containsKey(selected) && tag != null) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
tag.writeNBT(new MC1710NBTCompound(compound));
|
||||
tag.writeNBT(new NBTWrapper(compound));
|
||||
|
||||
PacketClient.sendClient(new TagSavePacket(compound));
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import noppes.npcs.client.gui.util.SubGuiInterface;
|
||||
import noppes.npcs.constants.EnumScrollData;
|
||||
import noppes.npcs.controllers.data.Magic;
|
||||
import noppes.npcs.controllers.data.MagicCycle;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -398,7 +398,7 @@ public class GuiNpcManageMagic extends GuiNPCInterface2 implements ISubGuiListen
|
||||
magicCycle.name = "New";
|
||||
magicCycle.displayName = "New";
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
magicCycle.writeNBT(new MC1710NBTCompound(compound));
|
||||
magicCycle.writeNBT(new NBTWrapper(compound));
|
||||
PacketClient.sendClient(new MagicCycleSavePacket(compound));
|
||||
}
|
||||
break;
|
||||
@@ -548,7 +548,7 @@ public class GuiNpcManageMagic extends GuiNPCInterface2 implements ISubGuiListen
|
||||
selectedMagic.readNBT(compound.getCompoundTag("Magic"));
|
||||
} else if (compound.hasKey("MagicCycle")) {
|
||||
selectedCycle = new MagicCycle();
|
||||
selectedCycle.readNBT(new MC1710NBTCompound(compound.getCompoundTag("MagicCycle")));
|
||||
selectedCycle.readNBT(new NBTWrapper(compound.getCompoundTag("MagicCycle")));
|
||||
// Refresh the magic list based on the new cycle.
|
||||
updateMagicList();
|
||||
selectedMagic = null;
|
||||
|
||||
@@ -13,7 +13,7 @@ import noppes.npcs.client.gui.util.IGuiData;
|
||||
import noppes.npcs.client.gui.util.IScrollData;
|
||||
import noppes.npcs.constants.EnumScrollData;
|
||||
import noppes.npcs.controllers.data.MagicCycle;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -170,7 +170,7 @@ public class GuiNpcMagicBook extends GuiNPCInterface implements ICustomScrollLis
|
||||
public void setGuiData(NBTTagCompound compound) {
|
||||
if (compound.hasKey("MagicCycle")) {
|
||||
magicCycle = new MagicCycle();
|
||||
magicCycle.readNBT(new MC1710NBTCompound(compound.getCompoundTag("MagicCycle")));
|
||||
magicCycle.readNBT(new NBTWrapper(compound.getCompoundTag("MagicCycle")));
|
||||
initGui();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import noppes.npcs.client.gui.util.IScrollData;
|
||||
import noppes.npcs.constants.EnumScrollData;
|
||||
import noppes.npcs.controllers.data.TransportLocation;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
@@ -71,7 +71,7 @@ public class GuiNpcTransporter extends GuiNPCInterface2 implements IScrollData,
|
||||
location.dimension = player.dimension;
|
||||
|
||||
int cat = data.get(scroll.getSelected());
|
||||
PacketClient.sendClient(new TransportSavePacket(cat, ((MC1710NBTCompound) location.writeNBT()).getMCTag()));
|
||||
PacketClient.sendClient(new TransportSavePacket(cat, ((NBTWrapper) location.writeNBT()).getMCTag()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,7 +88,7 @@ public class GuiNpcTransporter extends GuiNPCInterface2 implements IScrollData,
|
||||
@Override
|
||||
public void setGuiData(NBTTagCompound compound) {
|
||||
TransportLocation loc = new TransportLocation();
|
||||
loc.readNBT(new MC1710NBTCompound(compound));
|
||||
loc.readNBT(new NBTWrapper(compound));
|
||||
location = loc;
|
||||
initGui();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import noppes.npcs.constants.EnumDiagramLayout;
|
||||
import noppes.npcs.controllers.data.Magic;
|
||||
import noppes.npcs.controllers.data.MagicAssociation;
|
||||
import noppes.npcs.controllers.data.MagicCycle;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.DataInputStream;
|
||||
@@ -214,7 +214,7 @@ public class MagicController implements IMagicHandler {
|
||||
for (int i = 0; i < cycleList.tagCount(); i++) {
|
||||
NBTTagCompound catCompound = cycleList.getCompoundTagAt(i);
|
||||
MagicCycle cycle = new MagicCycle();
|
||||
cycle.readNBT(new MC1710NBTCompound(catCompound));
|
||||
cycle.readNBT(new NBTWrapper(catCompound));
|
||||
cycles.put(cycle.id, cycle);
|
||||
}
|
||||
}
|
||||
@@ -229,7 +229,7 @@ public class MagicController implements IMagicHandler {
|
||||
NBTTagList catList = new NBTTagList();
|
||||
for (MagicCycle cat : cycles.values()) {
|
||||
NBTTagCompound catCompound = new NBTTagCompound();
|
||||
cat.writeNBT(new MC1710NBTCompound(catCompound));
|
||||
cat.writeNBT(new NBTWrapper(catCompound));
|
||||
catList.appendTag(catCompound);
|
||||
}
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
@@ -345,7 +345,7 @@ public class MagicController implements IMagicHandler {
|
||||
cycles.put(cycle.id, cycle);
|
||||
|
||||
NBTTagCompound cycleCompound = new NBTTagCompound();
|
||||
cycle.writeNBT(new MC1710NBTCompound(cycleCompound));
|
||||
cycle.writeNBT(new NBTWrapper(cycleCompound));
|
||||
SyncController.syncUpdate(EnumSyncType.MAGIC_CYCLE, -1, cycleCompound);
|
||||
|
||||
saveMagicData();
|
||||
|
||||
@@ -4,7 +4,7 @@ import foxz.utils.Market;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.roles.RoleTrader;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
@@ -140,7 +140,7 @@ public class MarketRegistry {
|
||||
for (RoleTrader trader : traders) {
|
||||
// Update stock data from cache
|
||||
if (stockData != null && stockData.hasKey("EnableStock")) {
|
||||
trader.stock.readFromNBT(new MC1710NBTCompound(stockData));
|
||||
trader.stock.readFromNBT(new NBTWrapper(stockData));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.controllers.data.TagMap;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.DataInputStream;
|
||||
@@ -70,7 +70,7 @@ public class ServerTagMapController {
|
||||
|
||||
public void loadTagMaps(DataInputStream stream) throws IOException {
|
||||
NBTTagCompound nbtCompound = CompressedStreamTools.read(stream);
|
||||
this.tagMap.readNBT(new MC1710NBTCompound(nbtCompound));
|
||||
this.tagMap.readNBT(new NBTWrapper(nbtCompound));
|
||||
}
|
||||
|
||||
public TagMap getTagMap(String folderName) {
|
||||
@@ -103,7 +103,7 @@ public class ServerTagMapController {
|
||||
File file = new File(saveDir, "___tagmap.dat_new");
|
||||
File file1 = new File(saveDir, "___tagmap.dat_old");
|
||||
File file2 = new File(saveDir, "___tagmap.dat");
|
||||
CompressedStreamTools.writeCompressed(((MC1710NBTCompound) tagMap.writeNBT()).getMCTag(), new FileOutputStream(file));
|
||||
CompressedStreamTools.writeCompressed(((NBTWrapper) tagMap.writeNBT()).getMCTag(), new FileOutputStream(file));
|
||||
if (file1.exists()) {
|
||||
file1.delete();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.api.handler.ITagHandler;
|
||||
import noppes.npcs.api.handler.data.ITag;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
@@ -93,7 +93,7 @@ public class TagController implements ITagHandler {
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
NBTTagCompound nbttagcompound = list.getCompoundTagAt(i);
|
||||
Tag tag = new Tag();
|
||||
tag.readNBT(new MC1710NBTCompound(nbttagcompound));
|
||||
tag.readNBT(new NBTWrapper(nbttagcompound));
|
||||
tags.put(tag.id, tag);
|
||||
tagUUIDs.put(tag.uuid, tag.id);
|
||||
}
|
||||
@@ -106,7 +106,7 @@ public class TagController implements ITagHandler {
|
||||
for (int slot : tags.keySet()) {
|
||||
Tag tag = tags.get(slot);
|
||||
NBTTagCompound nbtfactions = new NBTTagCompound();
|
||||
tag.writeNBT(new MC1710NBTCompound(nbtfactions));
|
||||
tag.writeNBT(new NBTWrapper(nbtfactions));
|
||||
list.appendTag(nbtfactions);
|
||||
}
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
|
||||
@@ -12,7 +12,7 @@ import noppes.npcs.controllers.data.TransportCategory;
|
||||
import noppes.npcs.controllers.data.TransportLocation;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleTransporter;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -79,7 +79,7 @@ public class TransportController implements ITransportHandler {
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
TransportCategory category = new TransportCategory();
|
||||
NBTTagCompound compound = list.getCompoundTagAt(i);
|
||||
category.readNBT(new MC1710NBTCompound(compound));
|
||||
category.readNBT(new NBTWrapper(compound));
|
||||
|
||||
for (TransportLocation location : category.locations.values())
|
||||
locations.put(location.id, location);
|
||||
@@ -94,7 +94,7 @@ public class TransportController implements ITransportHandler {
|
||||
NBTTagList list = new NBTTagList();
|
||||
for (TransportCategory category : categories.values()) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
category.writeNBT(new MC1710NBTCompound(compound));
|
||||
category.writeNBT(new NBTWrapper(compound));
|
||||
list.appendTag(compound);
|
||||
}
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
@@ -260,7 +260,7 @@ public class TransportController implements ITransportHandler {
|
||||
return null;
|
||||
RoleTransporter role = (RoleTransporter) npc.roleInterface;
|
||||
TransportLocation location = new TransportLocation();
|
||||
location.readNBT(new MC1710NBTCompound(compound));
|
||||
location.readNBT(new NBTWrapper(compound));
|
||||
location.category = category;
|
||||
if (role.hasTransport())
|
||||
location.id = role.transportId;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -9,7 +9,7 @@ import noppes.npcs.api.handler.IOverlayHandler;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -29,7 +29,7 @@ public class DataSkinOverlays implements IOverlayHandler {
|
||||
for (int i = 0; i < skinOverlayList.tagCount(); i++) {
|
||||
int tagID = skinOverlayList.getCompoundTagAt(i).getInteger("SkinOverlayID");
|
||||
SkinOverlay skinOverlay = new SkinOverlay();
|
||||
skinOverlay.readFromNBT(new MC1710NBTCompound(skinOverlayList.getCompoundTagAt(i)));
|
||||
skinOverlay.readFromNBT(new NBTWrapper(skinOverlayList.getCompoundTagAt(i)));
|
||||
skinOverlay.setOnChanged(() -> { updateClient(); save(); });
|
||||
skinOverlays.put(tagID, skinOverlay);
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class DataSkinOverlays implements IOverlayHandler {
|
||||
for (Map.Entry<Integer, ISkinOverlay> overlayData : this.overlayList.entrySet()) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setInteger("SkinOverlayID", overlayData.getKey());
|
||||
((SkinOverlay) overlayData.getValue()).writeToNBT(new MC1710NBTCompound(compound));
|
||||
((SkinOverlay) overlayData.getValue()).writeToNBT(new NBTWrapper(compound));
|
||||
overlayList.appendTag(compound);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
import noppes.npcs.NBTTags;
|
||||
import noppes.npcs.NoppesUtilPlayer;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
@@ -79,7 +79,7 @@ public class RoleTrader extends RoleInterface {
|
||||
}
|
||||
|
||||
// Stock system
|
||||
nbttagcompound.setTag("Stock", ((MC1710NBTCompound) stock.writeToNBT(new MC1710NBTCompound(new NBTTagCompound()))).getMCTag());
|
||||
nbttagcompound.setTag("Stock", ((NBTWrapper) stock.writeToNBT(new NBTWrapper(new NBTTagCompound()))).getMCTag());
|
||||
|
||||
// Currency cost per slot (additive to item costs)
|
||||
NBTTagList currencyList = new NBTTagList();
|
||||
@@ -132,7 +132,7 @@ public class RoleTrader extends RoleInterface {
|
||||
|
||||
// Stock system
|
||||
if (nbttagcompound.hasKey("Stock")) {
|
||||
stock.readFromNBT(new MC1710NBTCompound(nbttagcompound.getCompoundTag("Stock")));
|
||||
stock.readFromNBT(new NBTWrapper(nbttagcompound.getCompoundTag("Stock")));
|
||||
}
|
||||
|
||||
// Currency cost per slot (additive to item costs)
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.api.item.IItemCustomizable;
|
||||
import noppes.npcs.controllers.data.ItemDisplayData;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
public abstract class ScriptCustomizableItem extends ScriptItemStack implements IItemCustomizable {
|
||||
public final ItemDisplayData itemDisplay = new ItemDisplayData();
|
||||
@@ -202,12 +202,12 @@ public abstract class ScriptCustomizableItem extends ScriptItemStack implements
|
||||
}
|
||||
|
||||
public NBTTagCompound getItemNBT(NBTTagCompound compound) {
|
||||
this.itemDisplay.writeToNBT(new MC1710NBTCompound(compound));
|
||||
this.itemDisplay.writeToNBT(new NBTWrapper(compound));
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void setItemNBT(NBTTagCompound compound) {
|
||||
this.itemDisplay.readFromNBT(new MC1710NBTCompound(compound));
|
||||
this.itemDisplay.readFromNBT(new NBTWrapper(compound));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import noppes.npcs.api.item.IItemLinked;
|
||||
import noppes.npcs.controllers.LinkedItemController;
|
||||
import noppes.npcs.controllers.data.IScriptHandler;
|
||||
import noppes.npcs.controllers.data.LinkedItem;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTCompound;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapper;
|
||||
|
||||
public class ScriptLinkedItem extends ScriptCustomizableItem implements IItemLinked {
|
||||
public LinkedItem linkedItem = new LinkedItem();
|
||||
@@ -220,7 +220,7 @@ public class ScriptLinkedItem extends ScriptCustomizableItem implements IItemLin
|
||||
}
|
||||
|
||||
public NBTTagCompound getItemNBT(NBTTagCompound compound) {
|
||||
this.itemDisplay.writeToNBT(new MC1710NBTCompound(compound));
|
||||
this.itemDisplay.writeToNBT(new NBTWrapper(compound));
|
||||
compound.setTag(LinkedItem.LINKED_DATA_NBT_TAG, this.linkedItem.writeToNBT(false));
|
||||
compound.setInteger(LinkedItem.LINKED_VERSION_VERSION_TAG, this.linkedVersion);
|
||||
compound.setDouble("DurabilityValue", this.durabilityValue);
|
||||
@@ -228,7 +228,7 @@ public class ScriptLinkedItem extends ScriptCustomizableItem implements IItemLin
|
||||
}
|
||||
|
||||
public void setItemNBT(NBTTagCompound compound) {
|
||||
this.itemDisplay.readFromNBT(new MC1710NBTCompound(compound));
|
||||
this.itemDisplay.readFromNBT(new NBTWrapper(compound));
|
||||
this.linkedItem.readFromNBT(compound.getCompoundTag(LinkedItem.LINKED_DATA_NBT_TAG));
|
||||
this.linkedVersion = compound.getInteger(LinkedItem.LINKED_VERSION_VERSION_TAG);
|
||||
if (compound.hasKey("DurabilityValue"))
|
||||
|
||||
@@ -13,8 +13,8 @@ import kamkeel.npcs.platform.entity.*;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.platform.nbt.NBTFactory;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTFactory;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTIO;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapperFactory;
|
||||
import noppes.npcs.wrapper.nbt.NBTWrapperIO;
|
||||
import kamkeel.npcs.wrapper.platform.*;
|
||||
|
||||
import java.io.File;
|
||||
@@ -26,8 +26,8 @@ import java.io.IOException;
|
||||
*/
|
||||
public class MC1710PlatformService implements PlatformService {
|
||||
|
||||
private final MC1710NBTFactory nbtFactory = new MC1710NBTFactory();
|
||||
private final MC1710NBTIO nbtIO = new MC1710NBTIO();
|
||||
private final NBTWrapperFactory nbtFactory = new NBTWrapperFactory();
|
||||
private final NBTWrapperIO nbtIO = new NBTWrapperIO();
|
||||
|
||||
@Override
|
||||
public NBTFactory nbt() {
|
||||
@@ -104,33 +104,33 @@ public class MC1710PlatformService implements PlatformService {
|
||||
// --- Entity Wrapping ---
|
||||
|
||||
@Override
|
||||
public IPlatformPlayer wrapPlayer(Object mcPlayer) {
|
||||
return new MC1710PlatformPlayer((EntityPlayerMP) mcPlayer);
|
||||
public IUser wrapPlayer(Object mcPlayer) {
|
||||
return new PlayerWrapper((EntityPlayerMP) mcPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformEntity wrapEntity(Object mcEntity) {
|
||||
return new MC1710PlatformEntity((Entity) mcEntity);
|
||||
public IMob wrapEntity(Object mcEntity) {
|
||||
return new EntityWrapper((Entity) mcEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformLiving wrapLiving(Object mcLiving) {
|
||||
return new MC1710PlatformLiving((EntityLivingBase) mcLiving);
|
||||
public ILiving wrapLiving(Object mcLiving) {
|
||||
return new LivingWrapper((EntityLivingBase) mcLiving);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformStack wrapStack(Object mcStack) {
|
||||
return new MC1710PlatformStack((ItemStack) mcStack);
|
||||
public IStack wrapStack(Object mcStack) {
|
||||
return new StackWrapper((ItemStack) mcStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformWorld wrapWorld(Object mcWorld) {
|
||||
return new MC1710PlatformWorld((World) mcWorld);
|
||||
public IGameWorld wrapWorld(Object mcWorld) {
|
||||
return new WorldWrapper((World) mcWorld);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformDamageSource wrapDamageSource(Object mcSource) {
|
||||
return new MC1710PlatformDamageSource((DamageSource) mcSource);
|
||||
public IDamage wrapDamageSource(Object mcSource) {
|
||||
return new DamageWrapper((DamageSource) mcSource);
|
||||
}
|
||||
|
||||
// --- Scheduling ---
|
||||
|
||||
+4
-4
@@ -12,11 +12,11 @@ import noppes.npcs.platform.nbt.INBTList;
|
||||
* 1.7.10 implementation of INBTList.
|
||||
* Thin wrapper that delegates to NBTTagList.
|
||||
*/
|
||||
public class MC1710NBTList implements INBTList {
|
||||
public class NBTListWrapper implements INBTList {
|
||||
|
||||
private final NBTTagList tag;
|
||||
|
||||
public MC1710NBTList(NBTTagList tag) {
|
||||
public NBTListWrapper(NBTTagList tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class MC1710NBTList implements INBTList {
|
||||
|
||||
@Override
|
||||
public INBTCompound getCompound(int index) {
|
||||
return new MC1710NBTCompound(tag.getCompoundTagAt(index));
|
||||
return new NBTWrapper(tag.getCompoundTagAt(index));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,7 +78,7 @@ public class MC1710NBTList implements INBTList {
|
||||
|
||||
@Override
|
||||
public void addCompound(INBTCompound compound) {
|
||||
tag.appendTag(((MC1710NBTCompound) compound).getMCTag());
|
||||
tag.appendTag(((NBTWrapper) compound).getMCTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
+9
-9
@@ -11,11 +11,11 @@ import java.util.Set;
|
||||
* 1.7.10 implementation of INBTCompound.
|
||||
* Thin wrapper that delegates to NBTTagCompound.
|
||||
*/
|
||||
public class MC1710NBTCompound implements INBTCompound {
|
||||
public class NBTWrapper implements INBTCompound {
|
||||
|
||||
private final NBTTagCompound tag;
|
||||
|
||||
public MC1710NBTCompound(NBTTagCompound tag) {
|
||||
public NBTWrapper(NBTTagCompound tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class MC1710NBTCompound implements INBTCompound {
|
||||
|
||||
@Override
|
||||
public void setCompound(String key, INBTCompound compound) {
|
||||
tag.setTag(key, ((MC1710NBTCompound) compound).getMCTag());
|
||||
tag.setTag(key, ((NBTWrapper) compound).getMCTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -148,12 +148,12 @@ public class MC1710NBTCompound implements INBTCompound {
|
||||
|
||||
@Override
|
||||
public INBTCompound getCompound(String key) {
|
||||
return new MC1710NBTCompound(tag.getCompoundTag(key));
|
||||
return new NBTWrapper(tag.getCompoundTag(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public INBTList getList(String key, int type) {
|
||||
return new MC1710NBTList(tag.getTagList(key, type));
|
||||
return new NBTListWrapper(tag.getTagList(key, type));
|
||||
}
|
||||
|
||||
// --- Query ---
|
||||
@@ -193,7 +193,7 @@ public class MC1710NBTCompound implements INBTCompound {
|
||||
|
||||
@Override
|
||||
public void merge(INBTCompound other) {
|
||||
NBTTagCompound otherTag = ((MC1710NBTCompound) other).getMCTag();
|
||||
NBTTagCompound otherTag = ((NBTWrapper) other).getMCTag();
|
||||
for (Object keyObj : otherTag.func_150296_c()) {
|
||||
String key = (String) keyObj;
|
||||
tag.setTag(key, otherTag.getTag(key).copy());
|
||||
@@ -202,7 +202,7 @@ public class MC1710NBTCompound implements INBTCompound {
|
||||
|
||||
@Override
|
||||
public INBTCompound copy() {
|
||||
return new MC1710NBTCompound((NBTTagCompound) tag.copy());
|
||||
return new NBTWrapper((NBTTagCompound) tag.copy());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -212,8 +212,8 @@ public class MC1710NBTCompound implements INBTCompound {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof MC1710NBTCompound) {
|
||||
return tag.equals(((MC1710NBTCompound) obj).tag);
|
||||
if (obj instanceof NBTWrapper) {
|
||||
return tag.equals(((NBTWrapper) obj).tag);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
+5
-5
@@ -9,16 +9,16 @@ import noppes.npcs.platform.nbt.NBTFactory;
|
||||
/**
|
||||
* 1.7.10 implementation of NBTFactory.
|
||||
*/
|
||||
public class MC1710NBTFactory implements NBTFactory {
|
||||
public class NBTWrapperFactory implements NBTFactory {
|
||||
|
||||
@Override
|
||||
public INBTCompound createCompound() {
|
||||
return new MC1710NBTCompound(new NBTTagCompound());
|
||||
return new NBTWrapper(new NBTTagCompound());
|
||||
}
|
||||
|
||||
@Override
|
||||
public INBTList createList() {
|
||||
return new MC1710NBTList(new NBTTagList());
|
||||
return new NBTListWrapper(new NBTTagList());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -28,7 +28,7 @@ public class MC1710NBTFactory implements NBTFactory {
|
||||
"Expected NBTTagCompound, got " + mcNBTTagCompound.getClass().getName()
|
||||
);
|
||||
}
|
||||
return new MC1710NBTCompound((NBTTagCompound) mcNBTTagCompound);
|
||||
return new NBTWrapper((NBTTagCompound) mcNBTTagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -38,6 +38,6 @@ public class MC1710NBTFactory implements NBTFactory {
|
||||
"Expected NBTTagList, got " + mcNBTTagList.getClass().getName()
|
||||
);
|
||||
}
|
||||
return new MC1710NBTList((NBTTagList) mcNBTTagList);
|
||||
return new NBTListWrapper((NBTTagList) mcNBTTagList);
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -14,14 +14,14 @@ import java.io.IOException;
|
||||
* 1.7.10 implementation of NBTIO.
|
||||
* Delegates to CompressedStreamTools.
|
||||
*/
|
||||
public class MC1710NBTIO implements NBTIO {
|
||||
public class NBTWrapperIO implements NBTIO {
|
||||
|
||||
@Override
|
||||
public INBTCompound readCompressed(File file) throws IOException {
|
||||
FileInputStream fis = new FileInputStream(file);
|
||||
try {
|
||||
NBTTagCompound tag = CompressedStreamTools.readCompressed(fis);
|
||||
return new MC1710NBTCompound(tag);
|
||||
return new NBTWrapper(tag);
|
||||
} finally {
|
||||
fis.close();
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public class MC1710NBTIO implements NBTIO {
|
||||
|
||||
@Override
|
||||
public void writeCompressed(INBTCompound compound, File file) throws IOException {
|
||||
NBTTagCompound tag = ((MC1710NBTCompound) compound).getMCTag();
|
||||
NBTTagCompound tag = ((NBTWrapper) compound).getMCTag();
|
||||
FileOutputStream fos = new FileOutputStream(file);
|
||||
try {
|
||||
CompressedStreamTools.writeCompressed(tag, fos);
|
||||
@@ -41,12 +41,12 @@ public class MC1710NBTIO implements NBTIO {
|
||||
@Override
|
||||
public INBTCompound read(File file) throws IOException {
|
||||
NBTTagCompound tag = CompressedStreamTools.read(file);
|
||||
return new MC1710NBTCompound(tag);
|
||||
return new NBTWrapper(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void safeWrite(INBTCompound compound, File file) throws IOException {
|
||||
NBTTagCompound tag = ((MC1710NBTCompound) compound).getMCTag();
|
||||
NBTTagCompound tag = ((NBTWrapper) compound).getMCTag();
|
||||
// 1.7.10 doesn't have safeWrite, implement with temp file
|
||||
File tempFile = new File(file.getAbsolutePath() + ".tmp");
|
||||
FileOutputStream fos = new FileOutputStream(tempFile);
|
||||
Reference in new issue
Block a user