mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 13:52:23 +00:00
Glow can be disabled/enabled on skin overlays
This commit is contained in:
1 parent
dbfbab7be2
commit
6f9358c1ca
9 files changed
+91
-20
No files matched your search
@@ -316,16 +316,14 @@ public class NpcAPI extends AbstractNpcAPI {
|
||||
return MinecraftServer.getServer().getTickCounter();
|
||||
}
|
||||
|
||||
public ICustomGui createCustomGui(int id, int width, int height, boolean pauseGame) {
|
||||
return new ScriptGui(id, width, height, pauseGame);
|
||||
}
|
||||
|
||||
public boolean arePlayerScriptsEnabled() {
|
||||
return CustomNpcs.GlobalPlayerScripts;
|
||||
}
|
||||
|
||||
public boolean areForgeScriptsEnabled() {
|
||||
return CustomNpcs.GlobalForgeScripts;
|
||||
}
|
||||
|
||||
public boolean areGlobalNPCScriptsEnabled() {
|
||||
return CustomNpcs.GlobalNPCScripts;
|
||||
}
|
||||
@@ -333,14 +331,24 @@ public class NpcAPI extends AbstractNpcAPI {
|
||||
public void enablePlayerScripts(boolean enable) {
|
||||
CustomNpcs.GlobalPlayerScripts = enable;
|
||||
}
|
||||
|
||||
public void enableForgeScripts(boolean enable) {
|
||||
CustomNpcs.GlobalForgeScripts = enable;
|
||||
}
|
||||
|
||||
public void enableGlobalNPCScripts(boolean enable) {
|
||||
CustomNpcs.GlobalNPCScripts = enable;
|
||||
}
|
||||
|
||||
public ICustomGui createCustomGui(int id, int width, int height, boolean pauseGame) {
|
||||
return new ScriptGui(id, width, height, pauseGame);
|
||||
}
|
||||
|
||||
public ICustomOverlay createCustomOverlay(int id) {
|
||||
return new ScriptOverlay(id);
|
||||
}
|
||||
|
||||
public ISkinOverlay createSkinOverlay(String texture) {
|
||||
return new ScriptSkinOverlay(texture);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package noppes.npcs.scripted;
|
||||
|
||||
import noppes.npcs.scripted.interfaces.ISkinOverlay;
|
||||
|
||||
public class ScriptSkinOverlay implements ISkinOverlay {
|
||||
public String texture;
|
||||
public boolean glow;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -527,13 +527,14 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
|
||||
Server.sendData((EntityPlayerMP)this.entity, EnumPacketClient.OVERLAY_CLOSE, id, new NBTTagCompound());
|
||||
}
|
||||
|
||||
public void addSkinOverlay(int id, String overlayString) {
|
||||
if (overlayString != null) {
|
||||
public void setSkinOverlay(int id, ScriptSkinOverlay overlay) {
|
||||
if (overlay != null) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
compound.setString("SkinOverlayTexture", overlayString);
|
||||
compound.setInteger("SkinOverlayID", id);
|
||||
compound.setString("SkinOverlayTexture", overlay.getTexture());
|
||||
compound.setBoolean("SkinOverlayGlow", overlay.getGlow());
|
||||
|
||||
if (!player.getEntityData().hasKey("SkinOverlayData")) {
|
||||
NBTTagList tagList = new NBTTagList();
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.controllers.*;
|
||||
import noppes.npcs.scripted.gui.ScriptGui;
|
||||
import noppes.npcs.scripted.interfaces.entity.ICustomNpc;
|
||||
@@ -122,7 +123,21 @@ public abstract class AbstractNpcAPI {
|
||||
|
||||
public abstract int getServerTime();
|
||||
|
||||
public abstract boolean arePlayerScriptsEnabled();
|
||||
|
||||
public abstract boolean areForgeScriptsEnabled();
|
||||
|
||||
public abstract boolean areGlobalNPCScriptsEnabled();
|
||||
|
||||
public abstract void enablePlayerScripts(boolean enable);
|
||||
|
||||
public abstract void enableForgeScripts(boolean enable);
|
||||
|
||||
public abstract void enableGlobalNPCScripts(boolean enable);
|
||||
|
||||
public abstract ICustomGui createCustomGui(int id, int width, int height, boolean pauseGame);
|
||||
|
||||
public abstract ICustomOverlay createCustomOverlay(int id);
|
||||
|
||||
public abstract ISkinOverlay createSkinOverlay(String texture);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package noppes.npcs.scripted.interfaces;
|
||||
|
||||
public interface ISkinOverlay {
|
||||
void setTexture(String texture);
|
||||
|
||||
String getTexture();
|
||||
|
||||
void setGlow(boolean glow);
|
||||
|
||||
boolean getGlow();
|
||||
}
|
||||
Reference in new issue
Block a user