mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 04:35:03 +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
@@ -5,7 +5,6 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -23,7 +22,6 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.boss.BossStatus;
|
||||
import net.minecraft.util.ReportedException;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.client.ImageDownloadAlt;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
@@ -264,7 +262,7 @@ public class RenderNPCInterface extends RenderLiving{
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glTranslatef(npc.display.overlayRenderTicks * 0.001F * overlayData.getSpeedX(), npc.display.overlayRenderTicks * 0.001F * overlayData.getSpeedY(), 0.0F);
|
||||
GL11.glScalef(overlayData.getScaleX(), overlayData.getScaleY(), 1.0F);
|
||||
GL11.glScalef(overlayData.getTextureScaleX(), overlayData.getTextureScaleY(), 1.0F);
|
||||
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
float scale = 1.005f * overlayData.getSize();
|
||||
|
||||
@@ -71,15 +71,15 @@ public class SkinOverlay implements ISkinOverlay {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setScale(float scaleX, float scaleY) {
|
||||
public void setTextureScale(float scaleX, float scaleY) {
|
||||
this.scaleX = scaleX;
|
||||
this.scaleY = scaleY;
|
||||
this.updateClient();
|
||||
}
|
||||
public float getScaleX() {
|
||||
public float getTextureScaleX() {
|
||||
return scaleX;
|
||||
}
|
||||
public float getScaleY() {
|
||||
public float getTextureScaleY() {
|
||||
return scaleY;
|
||||
}
|
||||
|
||||
@@ -142,8 +142,8 @@ public class SkinOverlay implements ISkinOverlay {
|
||||
compound.setFloat("SkinOverlaySize", this.getSize());
|
||||
compound.setFloat("SkinOverlaySpeedX", this.getSpeedX());
|
||||
compound.setFloat("SkinOverlaySpeedY", this.getSpeedY());
|
||||
compound.setFloat("SkinOverlayScaleX", this.getScaleX());
|
||||
compound.setFloat("SkinOverlayScaleY", this.getScaleY());
|
||||
compound.setFloat("SkinOverlayScaleX", this.getTextureScaleX());
|
||||
compound.setFloat("SkinOverlayScaleY", this.getTextureScaleY());
|
||||
compound.setFloat("SkinOverlayOffsetX", this.getOffsetX());
|
||||
compound.setFloat("SkinOverlayOffsetY", this.getOffsetY());
|
||||
compound.setFloat("SkinOverlayOffsetZ", this.getOffsetZ());
|
||||
|
||||
@@ -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