mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-23 21:49:53 +00:00
Removed redundant ScriptSkinOverlay, using SkinOverlayData in place of it, which now implements ISkinOverlay.
This commit is contained in:
1 parent
8bc3190295
commit
41401d0521
10 files changed
+128
-149
No files matched your search
@@ -31,6 +31,7 @@ import net.minecraft.world.WorldServer;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.controllers.*;
|
||||
import noppes.npcs.controllers.data.SkinOverlayData;
|
||||
import noppes.npcs.items.ItemScripted;
|
||||
import noppes.npcs.containers.ContainerNpcInterface;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
@@ -349,6 +350,6 @@ public class NpcAPI extends AbstractNpcAPI {
|
||||
}
|
||||
|
||||
public ISkinOverlay createSkinOverlay(String texture) {
|
||||
return new ScriptSkinOverlay(texture);
|
||||
return new SkinOverlayData(texture);
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package noppes.npcs.scripted;
|
||||
|
||||
import noppes.npcs.scripted.interfaces.ISkinOverlay;
|
||||
|
||||
public class ScriptSkinOverlay implements ISkinOverlay {
|
||||
public String texture;
|
||||
public boolean glow;
|
||||
public float alpha = 1.0F;
|
||||
public float size = 1.0F;
|
||||
|
||||
public float speedX = 0.0F;
|
||||
public float speedY = 0.0F;
|
||||
|
||||
public float scaleX = 1.0F;
|
||||
public float scaleY = 1.0F;
|
||||
|
||||
public float offsetX = 0.0F;
|
||||
public float offsetY = 0.0F;
|
||||
public float offsetZ = 0.0F;
|
||||
|
||||
public ScriptSkinOverlay(String texture) {
|
||||
this.texture = texture;
|
||||
}
|
||||
|
||||
public void setTexture(String texture) {
|
||||
this.texture = texture;
|
||||
}
|
||||
public String getTexture() {
|
||||
return texture;
|
||||
}
|
||||
|
||||
public void setGlow(boolean glow) {
|
||||
this.glow = glow;
|
||||
}
|
||||
public boolean getGlow() {
|
||||
return glow;
|
||||
}
|
||||
|
||||
public void setAlpha(float alpha) {
|
||||
this.alpha = alpha;
|
||||
}
|
||||
public float getAlpha() {
|
||||
return alpha;
|
||||
}
|
||||
|
||||
public void setSize(float size) {
|
||||
this.size = size;
|
||||
}
|
||||
public float getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setScale(float scaleX, float scaleY) {
|
||||
this.scaleX = scaleX;
|
||||
this.scaleY = scaleY;
|
||||
}
|
||||
public float getScaleX() {
|
||||
return scaleX;
|
||||
}
|
||||
public float getScaleY() {
|
||||
return scaleY;
|
||||
}
|
||||
|
||||
public void setSpeed(float speedX, float speedY) {
|
||||
this.speedX = speedX;
|
||||
this.speedY = speedY;
|
||||
}
|
||||
public float getSpeedX() {
|
||||
return speedX;
|
||||
}
|
||||
public float getSpeedY() {
|
||||
return speedY;
|
||||
}
|
||||
|
||||
public void setOffset(float offsetX, float offsetY, float offsetZ) {
|
||||
this.offsetX = offsetX;
|
||||
this.offsetY = offsetY;
|
||||
this.offsetZ = offsetZ;
|
||||
}
|
||||
public float getOffsetX() {
|
||||
return offsetX;
|
||||
}
|
||||
public float getOffsetY() {
|
||||
return offsetY;
|
||||
}
|
||||
public float getOffsetZ() {
|
||||
return offsetZ;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,14 @@
|
||||
package noppes.npcs.scripted.entity;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.Server;
|
||||
import noppes.npcs.constants.*;
|
||||
import noppes.npcs.controllers.Line;
|
||||
import noppes.npcs.controllers.data.SkinOverlayData;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.ScriptFaction;
|
||||
import noppes.npcs.scripted.ScriptSkinOverlay;
|
||||
import noppes.npcs.scripted.interfaces.ISkinOverlay;
|
||||
import noppes.npcs.scripted.interfaces.entity.IEntityLivingBase;
|
||||
import noppes.npcs.scripted.interfaces.entity.IPlayer;
|
||||
@@ -41,7 +36,6 @@ import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> implements ICustomNpc {
|
||||
@@ -1109,16 +1103,12 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
if (!npc.display.skinOverlays.containsKey(0))
|
||||
return "";
|
||||
|
||||
return npc.display.skinOverlays.get(0).directory;
|
||||
return npc.display.skinOverlays.get(0).getTexture();
|
||||
}
|
||||
|
||||
public void setSkinOverlay(int id, ISkinOverlay overlay) {
|
||||
if (overlay != null) {
|
||||
npc.display.skinOverlays.put(id, new SkinOverlayData(
|
||||
overlay.getTexture(),overlay.getGlow(),overlay.getAlpha(),overlay.getSize(),
|
||||
overlay.getSpeedX(),overlay.getSpeedY(),overlay.getScaleX(),overlay.getScaleY(),
|
||||
overlay.getOffsetX(),overlay.getOffsetY(),overlay.getOffsetZ()
|
||||
));
|
||||
npc.display.skinOverlays.put(id, overlay);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package noppes.npcs.scripted.interfaces;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public interface ISkinOverlay {
|
||||
void setTexture(String texture);
|
||||
|
||||
@@ -27,4 +29,7 @@ public interface ISkinOverlay {
|
||||
float getOffsetX();
|
||||
float getOffsetY();
|
||||
float getOffsetZ();
|
||||
|
||||
ResourceLocation getLocation();
|
||||
void setLocation(ResourceLocation location);
|
||||
}
|
||||
Reference in new issue
Block a user