mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 23:39:50 +00:00
Every function in API classes that calls the main API class now calls the loaded API wrapper, renamed to NpcAPI, instead of the abstract class, renamed to AbstractNpcAPI.
This commit is contained in:
1 parent
6dea5a1cbc
commit
6896cec417
41 files changed
+252
-172
No files matched your search
@@ -6,7 +6,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.scripted.CustomNPCsException;
|
||||
import noppes.npcs.scripted.interfaces.item.IItemStack;
|
||||
import noppes.npcs.scripted.item.ScriptItemStack;
|
||||
import noppes.npcs.scripted.wrapper.NpcAPI;
|
||||
|
||||
public class ScriptDBCPlayer<T extends EntityPlayerMP> extends ScriptPlayer<T>{
|
||||
public T player;
|
||||
@@ -432,10 +432,10 @@ public class ScriptDBCPlayer<T extends EntityPlayerMP> extends ScriptPlayer<T>{
|
||||
this.player.writeToNBT(compound);
|
||||
|
||||
NBTTagList list = compound.getCompoundTag("JRMCEP").getTagList("dbcExtraInvTag",10);
|
||||
ScriptItemStack[] itemList = new ScriptItemStack[list.tagCount()];
|
||||
IItemStack[] itemList = new IItemStack[list.tagCount()];
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
ItemStack itemStack = ItemStack.loadItemStackFromNBT(list.getCompoundTagAt(i));
|
||||
itemList[i] = new ScriptItemStack(itemStack);
|
||||
itemList[i] = NpcAPI.Instance().getIItemStack(itemStack);
|
||||
}
|
||||
|
||||
return itemList;
|
||||
|
||||
@@ -29,6 +29,7 @@ import noppes.npcs.scripted.interfaces.entity.IEntity;
|
||||
import noppes.npcs.scripted.interfaces.INbt;
|
||||
import noppes.npcs.scripted.interfaces.IPos;
|
||||
import noppes.npcs.scripted.item.ScriptItemStack;
|
||||
import noppes.npcs.scripted.wrapper.NpcAPI;
|
||||
|
||||
public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
protected T entity;
|
||||
@@ -740,6 +741,6 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
}
|
||||
|
||||
public ScriptWorld getWorld() {
|
||||
return (ScriptWorld)NpcAPI.Instance().getIWorld((WorldServer) entity.worldObj);
|
||||
return (ScriptWorld) NpcAPI.Instance().getIWorld((WorldServer) entity.worldObj);
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,8 @@ import noppes.npcs.scripted.interfaces.item.IItemStack;
|
||||
import noppes.npcs.scripted.item.ScriptItemStack;
|
||||
import noppes.npcs.scripted.constants.EntityType;
|
||||
import noppes.npcs.scripted.interfaces.entity.IEntityLivingBase;
|
||||
import noppes.npcs.scripted.wrapper.NpcAPI;
|
||||
import noppes.npcs.scripted.wrapper.ScriptDamageSource;
|
||||
import noppes.npcs.scripted.wrapper.WrapperNpcAPI;
|
||||
|
||||
public class ScriptLivingBase<T extends EntityLivingBase> extends ScriptEntity<T> implements IEntityLivingBase {
|
||||
protected T entity;
|
||||
@@ -174,7 +174,7 @@ public class ScriptLivingBase<T extends EntityLivingBase> extends ScriptEntity<T
|
||||
* @return The item the entity is holding
|
||||
*/
|
||||
public IItemStack getHeldItem(){
|
||||
return WrapperNpcAPI.Instance().getIItemStack(entity.getHeldItem());
|
||||
return NpcAPI.Instance().getIItemStack(entity.getHeldItem());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -192,7 +192,7 @@ public class ScriptLivingBase<T extends EntityLivingBase> extends ScriptEntity<T
|
||||
* @return The item in the given slot
|
||||
*/
|
||||
public IItemStack getArmor(int slot){
|
||||
return WrapperNpcAPI.Instance().getIItemStack(entity.getEquipmentInSlot(slot + 1));
|
||||
return NpcAPI.Instance().getIItemStack(entity.getEquipmentInSlot(slot + 1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ import noppes.npcs.scripted.roles.ScriptRoleInterface;
|
||||
import noppes.npcs.scripted.roles.ScriptRoleMailman;
|
||||
import noppes.npcs.scripted.roles.ScriptRoleTrader;
|
||||
import noppes.npcs.scripted.roles.ScriptRoleTransporter;
|
||||
import noppes.npcs.scripted.wrapper.WrapperNpcAPI;
|
||||
import noppes.npcs.scripted.wrapper.NpcAPI;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -362,7 +362,7 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
* @return The item held in the right hand
|
||||
*/
|
||||
public IItemStack getRightItem(){
|
||||
return WrapperNpcAPI.Instance().getIItemStack(npc.inventory.getWeapon());
|
||||
return NpcAPI.Instance().getIItemStack(npc.inventory.getWeapon());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -380,7 +380,7 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
* @return The item held in the left hand
|
||||
*/
|
||||
public IItemStack getLefttItem(){
|
||||
return WrapperNpcAPI.Instance().getIItemStack(npc.getOffHand());
|
||||
return NpcAPI.Instance().getIItemStack(npc.getOffHand());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -398,7 +398,7 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
* @return Returns the projectile the npc uses
|
||||
*/
|
||||
public IItemStack getProjectileItem(){
|
||||
return WrapperNpcAPI.Instance().getIItemStack(npc.inventory.getProjectile());
|
||||
return NpcAPI.Instance().getIItemStack(npc.inventory.getProjectile());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -483,7 +483,7 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
*/
|
||||
@Override
|
||||
public IItemStack getArmor(int slot){
|
||||
return WrapperNpcAPI.Instance().getIItemStack(npc.inventory.armor.get(slot));
|
||||
return NpcAPI.Instance().getIItemStack(npc.inventory.armor.get(slot));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -506,7 +506,7 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
* @return
|
||||
*/
|
||||
public IItemStack getLootItem(int slot) {
|
||||
return WrapperNpcAPI.Instance().getIItemStack(npc.inventory.getStackInSlot(slot+7));
|
||||
return NpcAPI.Instance().getIItemStack(npc.inventory.getStackInSlot(slot+7));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ import noppes.npcs.scripted.interfaces.item.IItemStack;
|
||||
import noppes.npcs.scripted.interfaces.overlay.ICustomOverlay;
|
||||
import noppes.npcs.scripted.item.ScriptItemStack;
|
||||
import noppes.npcs.scripted.overlay.ScriptOverlay;
|
||||
import noppes.npcs.scripted.wrapper.WrapperNpcAPI;
|
||||
import noppes.npcs.scripted.wrapper.NpcAPI;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -247,7 +247,7 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
|
||||
for(int i = 0; i < player.inventory.mainInventory.length; i++){
|
||||
ItemStack item = player.inventory.mainInventory[i];
|
||||
if(item != null)
|
||||
items[i] = WrapperNpcAPI.Instance().getIItemStack(item);
|
||||
items[i] = NpcAPI.Instance().getIItemStack(item);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user