mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 21:20:04 +00:00
IDBCPlayer:
-Items can be set in vanity or armor slots, based on a "vanity" boolean value in setItem(). ISkinOverlay: -Renamed setScale to setTextureScale.
This commit is contained in:
1 parent
3f8910f5bd
commit
1ca5a306fc
5 files changed
+20
-18
No files matched your search
@@ -428,14 +428,16 @@ public class ScriptDBCPlayer<T extends EntityPlayerMP> extends ScriptPlayer<T> i
|
||||
return compound.getCompoundTag("JRMCEP").getString("extracode");
|
||||
}
|
||||
|
||||
public void setItem(byte slot, IItemStack itemStack) {
|
||||
public void setItem(IItemStack itemStack, byte slot, boolean vanity) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
this.player.writeToNBT(compound);
|
||||
|
||||
byte offset = (byte) (vanity ? 10 : 2);
|
||||
|
||||
NBTTagList newList = new NBTTagList();
|
||||
NBTTagList list = compound.getCompoundTag("JRMCEP").getTagList("dbcExtraInvTag",10);
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
if (list.getCompoundTagAt(i).getByte("Slot") != slot) {
|
||||
if (offset - list.getCompoundTagAt(i).getByte("Slot") != slot) {
|
||||
newList.appendTag(list.getCompoundTagAt(i));
|
||||
}
|
||||
}
|
||||
@@ -444,20 +446,22 @@ public class ScriptDBCPlayer<T extends EntityPlayerMP> extends ScriptPlayer<T> i
|
||||
if (itemStack != null) {
|
||||
itemStack.getMCItemStack().writeToNBT(compoundItem);
|
||||
}
|
||||
compoundItem.setByte("Slot", slot);
|
||||
compoundItem.setByte("Slot", (byte) (offset - slot));
|
||||
newList.appendTag(compoundItem);
|
||||
|
||||
compound.getCompoundTag("JRMCEP").setTag("dbcExtraInvTag", newList);
|
||||
this.player.readFromNBT(compound);
|
||||
}
|
||||
|
||||
public IItemStack getItem(byte slot) {
|
||||
public IItemStack getItem(byte slot, boolean vanity) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
this.player.writeToNBT(compound);
|
||||
|
||||
byte offset = (byte) (vanity ? 10 : 2);
|
||||
|
||||
NBTTagList list = compound.getCompoundTag("JRMCEP").getTagList("dbcExtraInvTag",10);
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
if (list.getCompoundTagAt(i).getByte("Slot") == slot) {
|
||||
if (offset - list.getCompoundTagAt(i).getByte("Slot") == slot) {
|
||||
return NpcAPI.Instance().getIItemStack(ItemStack.loadItemStackFromNBT(list.getCompoundTagAt(i)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,9 +43,9 @@ public interface ISkinOverlay {
|
||||
/**
|
||||
* Sets the texture scale of the overlay. Higher values will "zoom in" to the texture more.
|
||||
*/
|
||||
void setScale(float scaleX, float scaleY);
|
||||
float getScaleX();
|
||||
float getScaleY();
|
||||
void setTextureScale(float scaleX, float scaleY);
|
||||
float getTextureScaleX();
|
||||
float getTextureScaleY();
|
||||
|
||||
/**
|
||||
* Sets the "texture speed" by which the texture shifts on each render tick. Used to create a powered creeper effect!
|
||||
|
||||
@@ -60,8 +60,8 @@ public interface IDBCPlayer extends IPlayer {
|
||||
* 10 - 1st Vanity Slot Down to the right
|
||||
* @param itemStack The item stack to be set into the slot. Set to null to remove the stack in that slot.
|
||||
*/
|
||||
void setItem(byte slot, IItemStack itemStack);
|
||||
IItemStack getItem(byte slot);
|
||||
void setItem(IItemStack itemStack, byte slot, boolean vanity);
|
||||
IItemStack getItem(byte slot, boolean vanity);
|
||||
IItemStack[] getInventory();
|
||||
|
||||
void setForm(byte form);
|
||||
|
||||
Reference in new issue
Block a user