mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 05:19:41 +00:00
Merge pull request #54 from 1whohears/dev
Some Extra Soul Stone Options
This commit is contained in:
14 files changed
+177
-36
No files matched your search
@@ -1,21 +1,29 @@
|
||||
package noppes.npcs.scripted.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.constants.*;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
import noppes.npcs.constants.EnumJobType;
|
||||
import noppes.npcs.constants.EnumNavType;
|
||||
import noppes.npcs.constants.EnumRoleType;
|
||||
import noppes.npcs.constants.EnumStandingType;
|
||||
import noppes.npcs.controllers.data.Line;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.ScriptFaction;
|
||||
import noppes.npcs.scripted.constants.AnimationType;
|
||||
import noppes.npcs.scripted.constants.EntityType;
|
||||
import noppes.npcs.scripted.interfaces.ITimers;
|
||||
import noppes.npcs.scripted.interfaces.entity.ICustomNpc;
|
||||
import noppes.npcs.scripted.interfaces.entity.IEntityLivingBase;
|
||||
import noppes.npcs.scripted.interfaces.entity.IPlayer;
|
||||
import noppes.npcs.scripted.interfaces.handler.IOverlayHandler;
|
||||
import noppes.npcs.scripted.interfaces.item.IItemStack;
|
||||
import noppes.npcs.scripted.constants.AnimationType;
|
||||
import noppes.npcs.scripted.constants.EntityType;
|
||||
import noppes.npcs.scripted.interfaces.entity.ICustomNpc;
|
||||
import noppes.npcs.scripted.interfaces.ITimers;
|
||||
import noppes.npcs.scripted.roles.ScriptJobBard;
|
||||
import noppes.npcs.scripted.roles.ScriptJobConversation;
|
||||
import noppes.npcs.scripted.roles.ScriptJobFollower;
|
||||
@@ -31,12 +39,8 @@ 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.NpcAPI;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
|
||||
public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> implements ICustomNpc {
|
||||
public EntityNPCInterface npc;
|
||||
|
||||
@@ -862,6 +866,34 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
npc.stats.canDespawn = canDespawn;
|
||||
npc.stats.playerSetCanDespawn = canDespawn;
|
||||
}
|
||||
|
||||
public boolean spawnedFromSoulStone() {
|
||||
return !npc.advanced.soulStonePlayerName.equals("");
|
||||
}
|
||||
|
||||
public String getSoulStonePlayerName() {
|
||||
return npc.advanced.soulStonePlayerName;
|
||||
}
|
||||
|
||||
public boolean getRefuseSoulStone() {
|
||||
return npc.advanced.refuseSoulStone;
|
||||
}
|
||||
|
||||
public void setRefuseSoulStone(boolean refuse) {
|
||||
npc.advanced.refuseSoulStone = refuse;
|
||||
}
|
||||
|
||||
public boolean isSoulStoneInit() {
|
||||
return npc.advanced.soulStoneInit;
|
||||
}
|
||||
|
||||
public int getMinPointsToSoulStone() {
|
||||
return npc.advanced.minFactionPointsToSoulStone;
|
||||
}
|
||||
|
||||
public void setMinPointsToSoulStone(int points) {
|
||||
npc.advanced.minFactionPointsToSoulStone = points;
|
||||
}
|
||||
|
||||
public void giveItem(IPlayer player, IItemStack item){
|
||||
npc.givePlayerItem((EntityPlayer) player.getMCEntity(), item.getMCItemStack());
|
||||
|
||||
@@ -277,6 +277,40 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
|
||||
chat.setChatStyle(style);
|
||||
player.addChatMessage(chat);
|
||||
}
|
||||
|
||||
public void sendMessage(String message, String color, boolean bold, boolean italic, boolean underlined) {
|
||||
EnumChatFormatting c = getColor(color);
|
||||
if (c == null) return;
|
||||
sendMessage(message, c, bold, italic, underlined);
|
||||
}
|
||||
|
||||
public void sendMessage(String message, String color, boolean bold, boolean italic, boolean obfuscated, boolean strikethrough, boolean underlined) {
|
||||
EnumChatFormatting c = getColor(color);
|
||||
if (c == null) return;
|
||||
sendMessage(message, c, bold, italic, obfuscated, strikethrough, underlined);
|
||||
}
|
||||
|
||||
private EnumChatFormatting getColor(String color) {
|
||||
switch (color) {
|
||||
case "black": return EnumChatFormatting.BLACK;
|
||||
case "dark_blue": return EnumChatFormatting.DARK_BLUE;
|
||||
case "dark_green": return EnumChatFormatting.DARK_GREEN;
|
||||
case "dark_aqua": return EnumChatFormatting.DARK_AQUA;
|
||||
case "dark_red": return EnumChatFormatting.DARK_RED;
|
||||
case "dark_purple": return EnumChatFormatting.DARK_PURPLE;
|
||||
case "gold": return EnumChatFormatting.GOLD;
|
||||
case "gray": return EnumChatFormatting.GRAY;
|
||||
case "dark_gray": return EnumChatFormatting.DARK_GRAY;
|
||||
case "blue": return EnumChatFormatting.BLUE;
|
||||
case "green": return EnumChatFormatting.GREEN;
|
||||
case "aqua": return EnumChatFormatting.AQUA;
|
||||
case "red": return EnumChatFormatting.RED;
|
||||
case "light_purple": return EnumChatFormatting.LIGHT_PURPLE;
|
||||
case "yellow": return EnumChatFormatting.YELLOW;
|
||||
case "white": return EnumChatFormatting.WHITE;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Return gamemode. 0: Survival, 1: Creative, 2: Adventure
|
||||
|
||||
Reference in new issue
Block a user