mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 13:04:46 +00:00
Optimize Imports
This commit is contained in:
1 parent
ec78673fa2
commit
e46b78ff71
149 files changed
+931
-1029
No files matched your search
@@ -1,7 +1,12 @@
|
||||
package foxz.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import foxz.commandhelper.ChMcLogger;
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.OpOnly;
|
||||
import foxz.commandhelper.permissions.ParamCheck;
|
||||
import foxz.commandhelper.permissions.PlayerOnly;
|
||||
import foxz.utils.Utils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -12,13 +17,8 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.controllers.ServerCloneController;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import foxz.commandhelper.ChMcLogger;
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.OpOnly;
|
||||
import foxz.commandhelper.permissions.ParamCheck;
|
||||
import foxz.commandhelper.permissions.PlayerOnly;
|
||||
import foxz.utils.Utils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Command(
|
||||
name = "clone",
|
||||
@@ -42,7 +42,7 @@ public class CmdClone extends ChMcLogger {
|
||||
tab = Integer.parseInt(args[1]);
|
||||
}
|
||||
catch(NumberFormatException ex){
|
||||
|
||||
|
||||
}
|
||||
List<EntityNPCInterface> list = Utils.getNearbeEntityFromPlayer(EntityNPCInterface.class, player, 80);
|
||||
for (EntityNPCInterface npc : list) {
|
||||
@@ -69,7 +69,7 @@ public class CmdClone extends ChMcLogger {
|
||||
tab = Integer.parseInt(args[0]);
|
||||
}
|
||||
catch(NumberFormatException ex){
|
||||
|
||||
|
||||
}
|
||||
for (String name : ServerCloneController.Instance.getClones(tab)) {
|
||||
sendmessage(name);
|
||||
@@ -78,15 +78,15 @@ public class CmdClone extends ChMcLogger {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SubCommand(desc = "Remove NPC from clone storage", usage = "<name> <tab>", permissions={OpOnly.class ,ParamCheck.class})
|
||||
public Boolean del(String[] args) {
|
||||
@SubCommand(desc = "Remove NPC from clone storage", usage = "<name> <tab>", permissions={OpOnly.class ,ParamCheck.class})
|
||||
public Boolean del(String[] args) {
|
||||
String nametodel = args[0];
|
||||
int tab = 0;
|
||||
try{
|
||||
tab = Integer.parseInt(args[1]);
|
||||
}
|
||||
catch(NumberFormatException ex){
|
||||
|
||||
|
||||
}
|
||||
boolean deleted = false;
|
||||
for(String name : ServerCloneController.Instance.getClones(tab)){
|
||||
@@ -95,7 +95,7 @@ public class CmdClone extends ChMcLogger {
|
||||
deleted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ServerCloneController.Instance.removeClone(nametodel, tab)) {
|
||||
sendmessage(String.format("Npc '%s' wasn't found", nametodel));
|
||||
return false;
|
||||
@@ -105,8 +105,8 @@ public class CmdClone extends ChMcLogger {
|
||||
}
|
||||
|
||||
@SubCommand(
|
||||
desc = "Spawn cloned NPC",
|
||||
usage = "<name> <tab> [[world:]x,y,z]] [newname]",
|
||||
desc = "Spawn cloned NPC",
|
||||
usage = "<name> <tab> [[world:]x,y,z]] [newname]",
|
||||
permissions={OpOnly.class ,ParamCheck.class})
|
||||
public boolean spawn(String[] args) {
|
||||
String name = args[0].replaceAll("%", " "); // if name of npc separed by space, user must use % in place of space
|
||||
@@ -115,8 +115,8 @@ public class CmdClone extends ChMcLogger {
|
||||
tab = Integer.parseInt(args[1]);
|
||||
}
|
||||
catch(NumberFormatException ex){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
String newname=null;
|
||||
NBTTagCompound compound = ServerCloneController.Instance.getCloneData(this.pcParam, name, tab);
|
||||
if(compound == null){
|
||||
@@ -127,10 +127,10 @@ public class CmdClone extends ChMcLogger {
|
||||
double posX = pcParam.getPlayerCoordinates().posX;
|
||||
double posY = pcParam.getPlayerCoordinates().posY;
|
||||
double posZ = pcParam.getPlayerCoordinates().posZ;
|
||||
|
||||
|
||||
if(args.length > 2){
|
||||
String location = args[2];
|
||||
String[] par;
|
||||
String[] par;
|
||||
if (location.contains(":")){
|
||||
par = location.split(":");
|
||||
location = par[1];
|
||||
@@ -139,7 +139,7 @@ public class CmdClone extends ChMcLogger {
|
||||
sendmessage (String.format("'%s' is an unknown world",par[0]));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (location.contains(",")){
|
||||
par = location.split(",");
|
||||
@@ -154,35 +154,35 @@ public class CmdClone extends ChMcLogger {
|
||||
} catch(NumberFormatException ex){
|
||||
sendmessage("Location should be in numbers");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (args.length > 3){
|
||||
newname = args[3];
|
||||
}
|
||||
} else {
|
||||
newname = location;
|
||||
newname = location;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (posX == 0 && posY == 0 && posZ == 0){//incase it was called from the console and not pos was given
|
||||
sendmessage ("Location needed");
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Entity entity = EntityList.createEntityFromNBT(compound, world);
|
||||
entity.setPosition(posX + 0.5, posY + 1, posZ + 0.5);
|
||||
if(entity instanceof EntityNPCInterface){
|
||||
EntityNPCInterface npc = (EntityNPCInterface) entity;
|
||||
npc.ai.startPos = new int[]{MathHelper.floor_double(posX), MathHelper.floor_double(posY), MathHelper.floor_double(posZ)};
|
||||
if(newname != null && !newname.isEmpty())
|
||||
npc.display.name = newname.replaceAll("%", " "); // like name, newname must use % in place of space to keep a logical way
|
||||
npc.display.name = newname.replaceAll("%", " "); // like name, newname must use % in place of space to keep a logical way
|
||||
}
|
||||
world.spawnEntityInWorld(entity);
|
||||
return true;
|
||||
}
|
||||
|
||||
@SubCommand(
|
||||
desc = "Spawn cloned NPC",
|
||||
usage = "<name> <tab> <lenght> <width> [[world:]x,y,z]] [newname]",
|
||||
desc = "Spawn cloned NPC",
|
||||
usage = "<name> <tab> <lenght> <width> [[world:]x,y,z]] [newname]",
|
||||
permissions={OpOnly.class ,ParamCheck.class})
|
||||
public boolean grid(String[] args) {
|
||||
String name = args[0].replaceAll("%", " "); // if name of npc separed by space, user must use % in place of space
|
||||
@@ -191,9 +191,9 @@ public class CmdClone extends ChMcLogger {
|
||||
tab = Integer.parseInt(args[1]);
|
||||
}
|
||||
catch(NumberFormatException ex){
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
int width, height;
|
||||
try{
|
||||
width = Integer.parseInt(args[2]);
|
||||
@@ -202,9 +202,9 @@ public class CmdClone extends ChMcLogger {
|
||||
catch(NumberFormatException ex){
|
||||
sendmessage("lenght or width wasnt a number");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
String newname=null;
|
||||
NBTTagCompound compound = ServerCloneController.Instance.getCloneData(this.pcParam, name, tab);
|
||||
if(compound == null){
|
||||
@@ -215,10 +215,10 @@ public class CmdClone extends ChMcLogger {
|
||||
double posX = pcParam.getPlayerCoordinates().posX;
|
||||
double posY = pcParam.getPlayerCoordinates().posY;
|
||||
double posZ = pcParam.getPlayerCoordinates().posZ;
|
||||
|
||||
|
||||
if(args.length > 4){
|
||||
String location = args[4];
|
||||
String[] par;
|
||||
String[] par;
|
||||
if (location.contains(":")){
|
||||
par = location.split(":");
|
||||
location = par[1];
|
||||
@@ -227,7 +227,7 @@ public class CmdClone extends ChMcLogger {
|
||||
sendmessage (String.format("'%s' is an unknown world",par[0]));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (location.contains(",")){
|
||||
par = location.split(",");
|
||||
@@ -242,27 +242,27 @@ public class CmdClone extends ChMcLogger {
|
||||
} catch(NumberFormatException ex){
|
||||
sendmessage("Location should be in numbers");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (args.length > 5){
|
||||
newname = args[5];
|
||||
}
|
||||
} else {
|
||||
newname = location;
|
||||
newname = location;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (posX == 0 && posY == 0 && posZ == 0){//incase it was called from the console and not pos was given
|
||||
sendmessage ("Location needed");
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
for(int x = 0; x < width; x++){
|
||||
for(int z = 0; z < height; z++){
|
||||
Entity entity = EntityList.createEntityFromNBT(compound, world);
|
||||
int xx = MathHelper.floor_double(posX) + x;
|
||||
int yy = Math.max(MathHelper.floor_double(posY) - 2, 1);
|
||||
int zz = MathHelper.floor_double(posZ) + z;
|
||||
|
||||
|
||||
for(int y = 0; y < 10; y++){
|
||||
Block b = world.getBlock(xx, yy + y, zz);
|
||||
Block b2 = world.getBlock(xx, yy + y + 1, zz);
|
||||
@@ -276,7 +276,7 @@ public class CmdClone extends ChMcLogger {
|
||||
EntityNPCInterface npc = (EntityNPCInterface) entity;
|
||||
npc.ai.startPos = new int[]{xx, yy, zz};
|
||||
if(newname != null && !newname.isEmpty())
|
||||
npc.display.name = newname.replaceAll("%", " "); // like name, newname must use % in place of space to keep a logical way
|
||||
npc.display.name = newname.replaceAll("%", " "); // like name, newname must use % in place of space to keep a logical way
|
||||
}
|
||||
world.spawnEntityInWorld(entity);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package foxz.command;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
import foxz.commandhelper.ChMcLogger;
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.OpOnly;
|
||||
import foxz.commandhelper.permissions.PlayerOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockIce;
|
||||
import net.minecraft.block.BlockLeavesBase;
|
||||
@@ -13,11 +15,9 @@ import noppes.npcs.Server;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.controllers.ChunkController;
|
||||
import foxz.commandhelper.ChMcLogger;
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.OpOnly;
|
||||
import foxz.commandhelper.permissions.PlayerOnly;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
@Command(
|
||||
name="config",
|
||||
@@ -28,8 +28,8 @@ public class CmdConfig extends ChMcLogger {
|
||||
|
||||
public CmdConfig(Object sender) {
|
||||
super (sender);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SubCommand(
|
||||
desc="Disable/Enable the natural leaves decay",
|
||||
usage="<true/false>",
|
||||
@@ -57,7 +57,7 @@ public class CmdConfig extends ChMcLogger {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="Disable/Enable the vines growing",
|
||||
usage="<true/false>",
|
||||
@@ -85,7 +85,7 @@ public class CmdConfig extends ChMcLogger {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="Disable/Enable the ice melting",
|
||||
usage="<true/false>",
|
||||
@@ -134,7 +134,7 @@ public class CmdConfig extends ChMcLogger {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="Freezes/Unfreezes npcs",
|
||||
usage="<true/false>",
|
||||
@@ -151,7 +151,7 @@ public class CmdConfig extends ChMcLogger {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="Set how many active chunkloaders you can have",
|
||||
usage="<number>",
|
||||
@@ -185,7 +185,7 @@ public class CmdConfig extends ChMcLogger {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="Get/Set font",
|
||||
usage="[type] [size]",
|
||||
@@ -200,7 +200,7 @@ public class CmdConfig extends ChMcLogger {
|
||||
args = Arrays.copyOfRange(args, 0, args.length - 1);
|
||||
}
|
||||
catch(Exception e){
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
String font = "";
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package foxz.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.client.EntityUtil;
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.controllers.DialogController;
|
||||
import noppes.npcs.controllers.data.DialogOption;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.entity.EntityDialogNpc;
|
||||
import foxz.commandhelper.ChMcLogger;
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.OpOnly;
|
||||
import foxz.commandhelper.permissions.ParamCheck;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.client.EntityUtil;
|
||||
import noppes.npcs.controllers.DialogController;
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.controllers.data.DialogOption;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.entity.EntityDialogNpc;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Command(
|
||||
name="dialog",
|
||||
@@ -27,8 +27,8 @@ public class CmdDialog extends ChMcLogger {
|
||||
public CmdDialog(Object sender) {
|
||||
super(sender);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="force read",
|
||||
usage="<player> <dialog>",
|
||||
@@ -48,18 +48,18 @@ public class CmdDialog extends ChMcLogger {
|
||||
sendmessage(String.format("Unknow player '%s'", playername));
|
||||
return false;
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
for(PlayerData playerdata : data){
|
||||
playerdata.dialogData.dialogsRead.add(diagid);
|
||||
playerdata.save();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="force unread dialog",
|
||||
usage="<player> <dialog>",
|
||||
permissions={OpOnly.class, ParamCheck.class}
|
||||
)
|
||||
)
|
||||
public boolean unread(String args[]){
|
||||
String playername=args[0];
|
||||
int diagid;
|
||||
@@ -74,7 +74,7 @@ public class CmdDialog extends ChMcLogger {
|
||||
sendmessage(String.format("Unknow player '%s'", playername));
|
||||
return false;
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
for(PlayerData playerdata : data){
|
||||
playerdata.dialogData.dialogsRead.remove(diagid);
|
||||
playerdata.save();
|
||||
}
|
||||
@@ -83,25 +83,25 @@ public class CmdDialog extends ChMcLogger {
|
||||
@SubCommand(
|
||||
desc="reload dialogs from disk",
|
||||
permissions={OpOnly.class}
|
||||
)
|
||||
)
|
||||
public boolean reload(String args[]){
|
||||
new DialogController();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="show dialog",
|
||||
usage="<player> <dialog> <name>",
|
||||
permissions={OpOnly.class}
|
||||
)
|
||||
)
|
||||
public void show(String args[]){
|
||||
EntityPlayer player = CommandBase.getPlayer(pcParam, args[0]);
|
||||
if(player == null){
|
||||
sendmessage(String.format("Unknow player '%s'", args[0]));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int diagid;
|
||||
try {
|
||||
diagid = Integer.parseInt(args[1]);
|
||||
@@ -114,7 +114,7 @@ public class CmdDialog extends ChMcLogger {
|
||||
sendmessage("Unknown dialog id: " + args[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
EntityDialogNpc npc = new EntityDialogNpc(this.pcParam.getEntityWorld());
|
||||
npc.display.name = args[2];
|
||||
EntityUtil.Copy(player, npc);
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package foxz.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import noppes.npcs.controllers.data.Faction;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.PlayerFactionData;
|
||||
import foxz.commandhelper.ChMcLogger;
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.OpOnly;
|
||||
import foxz.commandhelper.permissions.ParamCheck;
|
||||
import noppes.npcs.controllers.data.Faction;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.PlayerFactionData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Command(
|
||||
name = "faction",
|
||||
@@ -96,11 +96,11 @@ public class CmdFaction extends ChMcLogger {
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
PlayerFactionData playerfactiondata = playerdata.factionData;
|
||||
playerfactiondata.factionData.put(this.selectedFaction.id,points);
|
||||
playerfactiondata.factionData.put(this.selectedFaction.id,points);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="Drop relationship",
|
||||
usage="",
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package foxz.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import foxz.commandhelper.ChMcLogger;
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.OpOnly;
|
||||
import foxz.commandhelper.permissions.ParamCheck;
|
||||
import foxz.commandhelper.permissions.PlayerOnly;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -27,12 +26,8 @@ import net.minecraft.util.ChatComponentTranslation;
|
||||
import noppes.npcs.controllers.FactionController;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import foxz.commandhelper.ChMcLogger;
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.OpOnly;
|
||||
import foxz.commandhelper.permissions.ParamCheck;
|
||||
import foxz.commandhelper.permissions.PlayerOnly;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Command(
|
||||
name = "noppes",
|
||||
@@ -225,4 +220,4 @@ public class CmdNoppes extends ChMcLogger {
|
||||
}
|
||||
return super.addTabCompletion(par1, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package foxz.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import foxz.commandhelper.ChMcLogger;
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.OpOnly;
|
||||
import foxz.commandhelper.permissions.PlayerOnly;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -15,11 +18,8 @@ import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleCompanion;
|
||||
import noppes.npcs.roles.RoleFollower;
|
||||
import foxz.commandhelper.ChMcLogger;
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.OpOnly;
|
||||
import foxz.commandhelper.permissions.PlayerOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Command(
|
||||
name="npc",
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package foxz.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import noppes.npcs.Server;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.controllers.DialogController;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.controllers.QuestController;
|
||||
import noppes.npcs.controllers.data.QuestData;
|
||||
import foxz.commandhelper.ChMcLogger;
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.OpOnly;
|
||||
import foxz.commandhelper.permissions.ParamCheck;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import noppes.npcs.Server;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.controllers.DialogController;
|
||||
import noppes.npcs.controllers.QuestController;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.controllers.data.QuestData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Command(
|
||||
name = "quest",
|
||||
@@ -51,10 +51,10 @@ public class CmdQuest extends ChMcLogger{
|
||||
sendmessage("Unknown QuestID");
|
||||
return false;
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
for(PlayerData playerdata : data){
|
||||
if(playerdata.questData.activeQuests.containsKey(questid))
|
||||
continue;
|
||||
QuestData questdata = new QuestData(quest);
|
||||
QuestData questdata = new QuestData(quest);
|
||||
playerdata.questData.activeQuests.put(questid, questdata);
|
||||
playerdata.save();
|
||||
if(playerdata.player != null){
|
||||
@@ -64,7 +64,7 @@ public class CmdQuest extends ChMcLogger{
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc = "Finish a quest",
|
||||
usage = "<player> <quest>",
|
||||
@@ -75,7 +75,7 @@ public class CmdQuest extends ChMcLogger{
|
||||
int questid;
|
||||
try {
|
||||
questid = Integer.parseInt(args[1]);
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException ex) {
|
||||
sendmessage("QuestID must be an integer");
|
||||
return false;
|
||||
@@ -85,14 +85,14 @@ public class CmdQuest extends ChMcLogger{
|
||||
sendmessage(String.format("Unknow player '%s'", playername));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Quest quest = QuestController.Instance.quests.get(questid);
|
||||
if (quest == null){
|
||||
sendmessage("Unknown QuestID");
|
||||
return false;
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
playerdata.questData.finishedQuests.put(questid, System.currentTimeMillis());
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
playerdata.questData.finishedQuests.put(questid, System.currentTimeMillis());
|
||||
playerdata.save();
|
||||
}
|
||||
return true;
|
||||
@@ -121,14 +121,14 @@ public class CmdQuest extends ChMcLogger{
|
||||
if (quest == null){
|
||||
sendmessage("Unknown QuestID");
|
||||
return false;
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
playerdata.questData.activeQuests.remove(questid);
|
||||
playerdata.save();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc = "Removes a quest from finished and active quests",
|
||||
usage = "<player> <quest>",
|
||||
@@ -152,8 +152,8 @@ public class CmdQuest extends ChMcLogger{
|
||||
if (quest == null){
|
||||
sendmessage("Unknown QuestID");
|
||||
return false;
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
playerdata.questData.activeQuests.remove(questid);
|
||||
playerdata.questData.finishedQuests.remove(questid);
|
||||
playerdata.save();
|
||||
@@ -163,7 +163,7 @@ public class CmdQuest extends ChMcLogger{
|
||||
@SubCommand(
|
||||
desc="reload quests from disk",
|
||||
permissions={OpOnly.class}
|
||||
)
|
||||
)
|
||||
public boolean reload(String args[]){
|
||||
new DialogController();
|
||||
return true;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package foxz.command;
|
||||
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import foxz.commandhelper.ChMcLogger;
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.OpOnly;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
|
||||
@Command(
|
||||
name = "script",
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package foxz.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CommandNoppes extends CommandBase {
|
||||
|
||||
public CmdNoppes noppes = new CmdNoppes(this);
|
||||
|
||||
@@ -2,16 +2,9 @@
|
||||
// licence : cc-by-nc+no gov,mil usage
|
||||
package foxz.commandhelper;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.AbstractPermission;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.command.PlayerSelector;
|
||||
@@ -21,11 +14,14 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.PlayerDataController;
|
||||
import foxz.commandhelper.annotations.Command;
|
||||
import foxz.commandhelper.annotations.SubCommand;
|
||||
import foxz.commandhelper.permissions.AbstractPermission;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public abstract class AbstractCommandHelper extends CommandHelper {
|
||||
|
||||
@@ -111,7 +107,7 @@ public abstract class AbstractCommandHelper extends CommandHelper {
|
||||
String parameter = np[args.length - 1];
|
||||
if(parameter.equals("<player>"))
|
||||
return CommandBase.getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames());
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -183,7 +179,7 @@ public abstract class AbstractCommandHelper extends CommandHelper {
|
||||
cmdError(cmd);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private boolean doHelp(ICommandSender param, String[] args, String cmd){
|
||||
boolean isHelp = cmd.equals("HELP");
|
||||
if(args.length > 0){
|
||||
@@ -206,7 +202,7 @@ public abstract class AbstractCommandHelper extends CommandHelper {
|
||||
allHelp();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List addTabCompletion(ICommandSender par1, String[] args) {
|
||||
if(args.length <= 1){
|
||||
@@ -223,7 +219,7 @@ public abstract class AbstractCommandHelper extends CommandHelper {
|
||||
currentHelper = ch.commandHelper;
|
||||
return ch.addTabCompletion(par1, args);
|
||||
}
|
||||
|
||||
|
||||
public List<PlayerData> getPlayersData(String username){
|
||||
ArrayList<PlayerData> list = new ArrayList<PlayerData>();
|
||||
EntityPlayerMP[] players = PlayerSelector.matchPlayers(pcParam, username);
|
||||
@@ -237,7 +233,7 @@ public abstract class AbstractCommandHelper extends CommandHelper {
|
||||
list.add(PlayerDataController.Instance.getPlayerData(player));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package foxz.commandhelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.command.ICommandSender;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class CommandHelper {
|
||||
|
||||
public class Helper {
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package foxz.commandhelper.annotations;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Documented
|
||||
@Retention(value = RetentionPolicy.RUNTIME)
|
||||
@@ -14,7 +10,7 @@ public @interface SubCommand {
|
||||
String name() default "";
|
||||
|
||||
String usage() default "";
|
||||
|
||||
|
||||
boolean hasEmptyCall() default false;
|
||||
|
||||
String desc();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package foxz.commandhelper.permissions;
|
||||
|
||||
import foxz.commandhelper.AbstractCommandHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import foxz.commandhelper.AbstractCommandHelper;
|
||||
|
||||
public class OpOnly extends AbstractPermission {
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package foxz.utils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleTrader;
|
||||
import noppes.npcs.util.NBTJsonUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class Market {
|
||||
|
||||
static public void save(RoleTrader r, String name) {
|
||||
@@ -15,7 +15,7 @@ public class Market {
|
||||
return;
|
||||
File file = getFile(name + "_new");
|
||||
File file1 = getFile(name);
|
||||
|
||||
|
||||
try {
|
||||
NBTJsonUtil.SaveFile(file, r.writeNBT(new NBTTagCompound()));
|
||||
if(file1.exists()){
|
||||
@@ -23,8 +23,8 @@ public class Market {
|
||||
}
|
||||
file.renameTo(file1);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ public class Market {
|
||||
File file = getFile(name);
|
||||
if(!file.exists())
|
||||
return;
|
||||
|
||||
|
||||
try {
|
||||
role.readNBT(NBTJsonUtil.LoadFile(file));
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
private static File getFile(String name){
|
||||
File dir = new File(CustomNpcs.getWorldSaveDirectory(), "markets");
|
||||
@@ -52,7 +52,7 @@ public class Market {
|
||||
return;
|
||||
if(!getFile(marketName).exists())
|
||||
Market.save((RoleTrader) npc.roleInterface, marketName);
|
||||
|
||||
|
||||
Market.load((RoleTrader) npc.roleInterface, marketName);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
package foxz.utils;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Utils {
|
||||
|
||||
@@ -16,11 +16,11 @@ public class Utils {
|
||||
List<T> list = player.worldObj.getEntitiesWithinAABB(cls, range);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
static public EntityPlayer getOnlinePlayer(String playername){
|
||||
return MinecraftServer.getServer().getConfigurationManager().func_152612_a(playername);
|
||||
}
|
||||
|
||||
|
||||
static public World getWorld(String t){
|
||||
WorldServer[] ws=MinecraftServer.getServer().worldServers;
|
||||
for (WorldServer w:ws){
|
||||
@@ -32,13 +32,13 @@ public class Utils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
// <editor-fold desc="--- Foxz fork (pls keep it)">
|
||||
// static public void savePlayerAltInv(EntityPlayer p,String n){
|
||||
// static public void savePlayerAltInv(EntityPlayer p,String n){
|
||||
// NBTTagList tag=p.inventory.writeToNBT(new NBTTagList());
|
||||
// p.getEntityData().setTag("AltInv_"+n, tag);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// static public void loadPlayerAltInv(EntityPlayer p,String n){
|
||||
// p.inventory.readFromNBT((NBTTagList) p.getEntityData().getTag("AltInv_"+n));
|
||||
// }
|
||||
|
||||
@@ -2,12 +2,10 @@ package kamkeel.command;
|
||||
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import noppes.npcs.api.ISkinOverlay;
|
||||
import noppes.npcs.api.handler.data.IAnimation;
|
||||
import noppes.npcs.controllers.AnimationController;
|
||||
import noppes.npcs.controllers.PlayerDataController;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -22,7 +20,7 @@ public class AnimationCommand extends CommandKamkeelBase {
|
||||
public String getDescription() {
|
||||
return "Animation operations";
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc = "set an animation to a player",
|
||||
usage = "<player> <num>"
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package kamkeel.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import foxz.utils.Utils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.command.CommandBase;
|
||||
@@ -18,6 +16,8 @@ import net.minecraft.world.WorldServer;
|
||||
import noppes.npcs.controllers.ServerCloneController;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CloneCommand extends CommandKamkeelBase {
|
||||
|
||||
@Override
|
||||
@@ -69,8 +69,8 @@ public class CloneCommand extends CommandKamkeelBase {
|
||||
}
|
||||
|
||||
@SubCommand(
|
||||
desc = "List NPC from clone storage",
|
||||
usage = "<tab>",
|
||||
desc = "List NPC from clone storage",
|
||||
usage = "<tab>",
|
||||
permission = 2
|
||||
)
|
||||
public void list(ICommandSender sender, String[] args) {
|
||||
@@ -95,11 +95,11 @@ public class CloneCommand extends CommandKamkeelBase {
|
||||
}
|
||||
|
||||
@SubCommand(
|
||||
desc = "Remove NPC from clone storage",
|
||||
usage = "<name> <tab>",
|
||||
desc = "Remove NPC from clone storage",
|
||||
usage = "<name> <tab>",
|
||||
permission = 4
|
||||
)
|
||||
public void del(ICommandSender sender, String[] args) throws CommandException {
|
||||
)
|
||||
public void del(ICommandSender sender, String[] args) throws CommandException {
|
||||
String nametodel = args[0];
|
||||
int tab = 0;
|
||||
try{
|
||||
@@ -121,7 +121,7 @@ public class CloneCommand extends CommandKamkeelBase {
|
||||
deleted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ServerCloneController.Instance.removeClone(nametodel, tab)) {
|
||||
sendError(sender, String.format("NPC '%s' was not found", nametodel));
|
||||
} else {
|
||||
@@ -130,8 +130,8 @@ public class CloneCommand extends CommandKamkeelBase {
|
||||
}
|
||||
|
||||
@SubCommand(
|
||||
desc = "Spawn cloned NPC",
|
||||
usage = "<name> <tab> [[world:]x,y,z]] [newname]",
|
||||
desc = "Spawn cloned NPC",
|
||||
usage = "<name> <tab> [[world:]x,y,z]] [newname]",
|
||||
permission = 2
|
||||
)
|
||||
public void spawn(ICommandSender sender, String[] args) throws CommandException {
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package kamkeel.command;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.*;
|
||||
|
||||
import kamkeel.developer.Developer;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
@@ -12,12 +8,18 @@ import net.minecraft.server.MinecraftServer;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.scripted.CustomNPCsException;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class CommandKamkeel extends CommandBase{
|
||||
|
||||
|
||||
public Map<String, CommandKamkeelBase> map = new HashMap<String, CommandKamkeelBase>();
|
||||
public HelpCommand help = new HelpCommand(this);
|
||||
public String[] alias = {"kam"};
|
||||
|
||||
|
||||
public CommandKamkeel(){
|
||||
registerCommand(help);
|
||||
registerCommand(new ScriptCommand());
|
||||
@@ -34,14 +36,14 @@ public class CommandKamkeel extends CommandBase{
|
||||
registerCommand(new OverlayCommand());
|
||||
registerCommand(new CommandCommand());
|
||||
}
|
||||
|
||||
|
||||
public void registerCommand(CommandKamkeelBase command){
|
||||
String name = command.getCommandName().toLowerCase();
|
||||
if(map.containsKey(name))
|
||||
throw new CustomNPCsException("Already a subcommand with the name: " + name);
|
||||
map.put(name, command);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "kamkeel";
|
||||
@@ -64,11 +66,11 @@ public class CommandKamkeel extends CommandBase{
|
||||
help.processCommand(sender, args);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
CommandKamkeelBase command = getCommand(args);
|
||||
if(command == null)
|
||||
throw new CommandException("Unknown command " + args[0]);
|
||||
|
||||
|
||||
args = Arrays.copyOfRange(args, 1, args.length);
|
||||
if(command.subcommands.isEmpty() || !command.runSubCommands()){
|
||||
if(!canSendCommand(sender, command))
|
||||
@@ -77,12 +79,12 @@ public class CommandKamkeel extends CommandBase{
|
||||
command.processCommand(sender, args);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(args.length == 0){
|
||||
help.processCommand(sender, new String[]{command.getCommandName()});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
command.processSubCommand(sender, args[0], Arrays.copyOfRange(args, 1, args.length));
|
||||
}
|
||||
|
||||
@@ -112,7 +114,7 @@ public class CommandKamkeel extends CommandBase{
|
||||
}
|
||||
return command.addTabCompletionOptions(sender, Arrays.copyOfRange(args, 1, args.length));
|
||||
}
|
||||
|
||||
|
||||
public CommandKamkeelBase getCommand(String[] args){
|
||||
if(args.length == 0)
|
||||
return null;
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
package kamkeel.command;
|
||||
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -10,23 +17,15 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import kamkeel.developer.Developer;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
|
||||
public abstract class CommandKamkeelBase extends CommandBase{
|
||||
public Map<String, Method> subcommands = new HashMap<String, Method>();
|
||||
|
||||
|
||||
public CommandKamkeelBase(){
|
||||
for (Method m : this.getClass().getDeclaredMethods()) {
|
||||
SubCommand sc = m.getAnnotation(SubCommand.class);
|
||||
if (sc != null) {
|
||||
String name = sc.name();
|
||||
if (name.equals(""))
|
||||
if (name.equals(""))
|
||||
name = m.getName();
|
||||
subcommands.put(name.toLowerCase(), m);
|
||||
}
|
||||
@@ -42,7 +41,7 @@ public abstract class CommandKamkeelBase extends CommandBase{
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return getDescription();
|
||||
}
|
||||
|
||||
|
||||
public abstract String getDescription();
|
||||
|
||||
/**
|
||||
@@ -71,14 +70,14 @@ public abstract class CommandKamkeelBase extends CommandBase{
|
||||
@Retention(value = RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface SubCommand {
|
||||
|
||||
|
||||
String name() default "";
|
||||
|
||||
|
||||
/**
|
||||
* @return Should return a string in the format of <arg> <arg2> <arg3> [arg4] where <> is a required parameter and [] optional
|
||||
*/
|
||||
String usage() default "";
|
||||
|
||||
|
||||
String desc();
|
||||
|
||||
int permission() default 2;
|
||||
@@ -146,4 +145,4 @@ public abstract class CommandKamkeelBase extends CommandBase{
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,9 @@ import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import noppes.npcs.controllers.DialogController;
|
||||
import noppes.npcs.controllers.PlayerDataController;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.controllers.data.DialogCategory;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -45,7 +47,7 @@ public class DialogCategoryCommand extends CommandKamkeelBase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc = "Read a dialog category for a player",
|
||||
usage = "<player> <dialogcatid>"
|
||||
@@ -55,12 +57,12 @@ public class DialogCategoryCommand extends CommandKamkeelBase {
|
||||
int dialogCatId;
|
||||
try {
|
||||
dialogCatId = Integer.parseInt(args[1]);
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException ex) {
|
||||
sendError(sender, "DialogCatID must be an integer: " + args[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
List<PlayerData> data = PlayerDataController.Instance.getPlayersData(sender, playername);
|
||||
if (data.isEmpty()) {
|
||||
sendError(sender, String.format("Unknown player '%s'", playername));
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package kamkeel.command;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
@@ -11,14 +8,17 @@ import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.client.EntityUtil;
|
||||
import noppes.npcs.constants.EnumAvailabilityDialog;
|
||||
import noppes.npcs.constants.EnumAvailabilityQuest;
|
||||
import noppes.npcs.constants.EnumQuestCompletion;
|
||||
import noppes.npcs.controllers.DialogController;
|
||||
|
||||
import noppes.npcs.controllers.PlayerDataController;
|
||||
import noppes.npcs.controllers.QuestController;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
import noppes.npcs.controllers.data.Availability;
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.controllers.data.DialogOption;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.entity.EntityDialogNpc;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class DialogCommand extends CommandKamkeelBase {
|
||||
|
||||
@Override
|
||||
@@ -30,7 +30,7 @@ public class DialogCommand extends CommandKamkeelBase {
|
||||
public String getDescription() {
|
||||
return "Dialog operations";
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc = "force read",
|
||||
usage = "<player> <dialog>"
|
||||
@@ -49,17 +49,17 @@ public class DialogCommand extends CommandKamkeelBase {
|
||||
sendError(sender, "Unknown player: " + playername);
|
||||
return;
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
for(PlayerData playerdata : data){
|
||||
playerdata.dialogData.dialogsRead.add(diagid);
|
||||
playerdata.save();
|
||||
sendResult(sender, String.format("Forced Read for Dialog \u00A7e%d\u00A77 for Player '\u00A7b%s\u00A77'", diagid, playerdata.playername));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc = "force unread dialog",
|
||||
usage = "<player> <dialog>"
|
||||
)
|
||||
)
|
||||
public void unread(ICommandSender sender, String args[]) throws CommandException{
|
||||
String playername=args[0];
|
||||
int diagid;
|
||||
@@ -74,7 +74,7 @@ public class DialogCommand extends CommandKamkeelBase {
|
||||
sendError(sender, "Unknown player: " + playername);
|
||||
return;
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
for(PlayerData playerdata : data){
|
||||
playerdata.dialogData.dialogsRead.remove(diagid);
|
||||
playerdata.save();
|
||||
sendResult(sender, String.format("Forced Unread for Dialog \u00A7e%d\u00A77 for Player '\u00A7b%s\u00A77'", diagid, playerdata.playername));
|
||||
@@ -83,7 +83,7 @@ public class DialogCommand extends CommandKamkeelBase {
|
||||
@SubCommand(
|
||||
desc="reload dialogs from disk",
|
||||
permission = 4
|
||||
)
|
||||
)
|
||||
public void reload(ICommandSender sender, String args[]){
|
||||
new DialogController();
|
||||
sendResult(sender, "Dialogs Reloaded");
|
||||
@@ -92,14 +92,14 @@ public class DialogCommand extends CommandKamkeelBase {
|
||||
@SubCommand(
|
||||
desc="show dialog",
|
||||
usage="<player> <dialog> <name>"
|
||||
)
|
||||
)
|
||||
public void show(ICommandSender sender, String args[]) throws CommandException{
|
||||
EntityPlayer player = CommandBase.getPlayer(sender, args[0]);
|
||||
if(player == null){
|
||||
sendError(sender, "Unknown player: " + args[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int diagid;
|
||||
try {
|
||||
diagid = Integer.parseInt(args[1]);
|
||||
@@ -112,7 +112,7 @@ public class DialogCommand extends CommandKamkeelBase {
|
||||
sendError(sender, "Unknown dialog id: " + args[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
EntityDialogNpc npc = new EntityDialogNpc(sender.getEntityWorld());
|
||||
npc.display.setName(args[2]);
|
||||
EntityUtil.Copy(player, npc);
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package kamkeel.command;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
@@ -12,6 +9,9 @@ import noppes.npcs.controllers.data.Faction;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.PlayerFactionData;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class FactionCommand extends CommandKamkeelBase {
|
||||
|
||||
public Faction selectedFaction;
|
||||
@@ -47,22 +47,22 @@ public class FactionCommand extends CommandKamkeelBase {
|
||||
if (data.isEmpty()) {
|
||||
sendError(sender, "Unknown player: " + playername);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
try{
|
||||
selectedFaction = FactionController.getInstance().getFaction(Integer.parseInt(factionname));
|
||||
}
|
||||
catch(NumberFormatException e){
|
||||
selectedFaction = FactionController.getInstance().getFactionFromName(factionname);
|
||||
}
|
||||
|
||||
|
||||
if (selectedFaction == null) {
|
||||
sendError(sender, "Unknown faction: " + factionname);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
processSubCommand(sender, args[2], Arrays.copyOfRange(args, 3, args.length));
|
||||
|
||||
|
||||
for(PlayerData playerdata : data){
|
||||
playerdata.save();
|
||||
}
|
||||
@@ -135,7 +135,7 @@ public class FactionCommand extends CommandKamkeelBase {
|
||||
sendResult(sender, String.format("Set Points \u00A7a%d\u00A77, Faction \u00A7e%s (%d)\u00A77 for Player \u00A7b%s\u00A77", points, this.selectedFaction.getName(), this.selectedFaction.id, playerdata.playername));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(desc = "Drop relationship")
|
||||
public void drop(ICommandSender sender, String[] args){
|
||||
for(PlayerData playerdata : data){
|
||||
@@ -143,7 +143,7 @@ public class FactionCommand extends CommandKamkeelBase {
|
||||
sendResult(sender, String.format("Dropped Faction \u00A7e%s (%d)\u00A77 from Player \u00A7b%s\u00A77", this.selectedFaction.getName(), this.selectedFaction.id, playerdata.playername));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List addTabCompletionOptions(ICommandSender par1, String[] args) {
|
||||
if(args.length == 3){
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package kamkeel.command;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class HelpCommand extends CommandKamkeelBase{
|
||||
private CommandKamkeel parent;
|
||||
|
||||
|
||||
public HelpCommand(CommandKamkeel parent){
|
||||
this.parent = parent;
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class HelpCommand extends CommandKamkeelBase{
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
CommandKamkeelBase command = parent.getCommand(args);
|
||||
if(command == null){
|
||||
sendError(sender, "Unknown command " + args[0]);
|
||||
@@ -45,7 +45,7 @@ public class HelpCommand extends CommandKamkeelBase{
|
||||
sender.addChatMessage(new ChatComponentTranslation(command.getCommandUsage(sender)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Method m = null;
|
||||
if(args.length > 1){
|
||||
m = command.subcommands.get(args[1].toLowerCase());
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package kamkeel.command;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
@@ -22,6 +19,9 @@ import noppes.npcs.roles.RoleCompanion;
|
||||
import noppes.npcs.roles.RoleFollower;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class NpcCommand extends CommandKamkeelBase {
|
||||
|
||||
public EntityNPCInterface selectedNpc;
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
package kamkeel.command;
|
||||
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.api.ISkinOverlay;
|
||||
import noppes.npcs.client.EntityUtil;
|
||||
import noppes.npcs.constants.EnumAvailabilityDialog;
|
||||
import noppes.npcs.constants.EnumAvailabilityQuest;
|
||||
import noppes.npcs.controllers.DialogController;
|
||||
import noppes.npcs.controllers.PlayerDataController;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
import noppes.npcs.entity.EntityDialogNpc;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class OverlayCommand extends CommandKamkeelBase {
|
||||
@@ -28,7 +20,7 @@ public class OverlayCommand extends CommandKamkeelBase {
|
||||
public String getDescription() {
|
||||
return "Overlay operations";
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc = "set an overlay to a player",
|
||||
usage = "<player> <num> <texture>"
|
||||
|
||||
@@ -11,8 +11,9 @@ import noppes.npcs.controllers.QuestController;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.controllers.data.QuestCategory;
|
||||
import java.util.Collection;
|
||||
import noppes.npcs.controllers.data.QuestData;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class QuestCategoryCommand extends CommandKamkeelBase {
|
||||
@@ -51,7 +52,7 @@ public class QuestCategoryCommand extends CommandKamkeelBase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc = "Finish a quest category for a player",
|
||||
usage = "<player> <questcatid>"
|
||||
@@ -61,18 +62,18 @@ public class QuestCategoryCommand extends CommandKamkeelBase {
|
||||
int questcatid;
|
||||
try {
|
||||
questcatid = Integer.parseInt(args[1]);
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException ex) {
|
||||
sendError(sender, "QuestCatID must be an integer: " + args[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
List<PlayerData> data = PlayerDataController.Instance.getPlayersData(sender, playername);
|
||||
if (data.isEmpty()) {
|
||||
sendError(sender, String.format("Unknown player '%s'", playername));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
QuestCategory questCategory = QuestController.Instance.categories.get(questcatid);
|
||||
if (questCategory == null){
|
||||
sendError(sender, "Unknown QuestCatID: " + questcatid);
|
||||
@@ -194,7 +195,7 @@ public class QuestCategoryCommand extends CommandKamkeelBase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc = "Remove a quest cat from active/finished",
|
||||
usage = "<player> <questcatid>"
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package kamkeel.command;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -14,9 +11,11 @@ import noppes.npcs.controllers.PlayerDataController;
|
||||
import noppes.npcs.controllers.QuestController;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.controllers.data.QuestCategory;
|
||||
import noppes.npcs.controllers.data.QuestData;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class QuestCommand extends CommandKamkeelBase {
|
||||
|
||||
@Override
|
||||
@@ -42,21 +41,21 @@ public class QuestCommand extends CommandKamkeelBase {
|
||||
sendError(sender, "QuestID must be an integer: " + args[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
List<PlayerData> data = PlayerDataController.Instance.getPlayersData(sender, playername);
|
||||
|
||||
|
||||
if (data.isEmpty()) {
|
||||
sendError(sender, "Unknown player: " + playername);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Quest quest = QuestController.Instance.quests.get(questid);
|
||||
if (quest == null){
|
||||
sendError(sender, "Unknown QuestID: " + questid);
|
||||
return;
|
||||
}
|
||||
|
||||
for(PlayerData playerdata : data){
|
||||
|
||||
for(PlayerData playerdata : data){
|
||||
QuestData questdata = new QuestData(quest);
|
||||
playerdata.questData.activeQuests.put(questid, questdata);
|
||||
playerdata.save();
|
||||
@@ -67,7 +66,7 @@ public class QuestCommand extends CommandKamkeelBase {
|
||||
sendResult(sender, String.format("Started Quest \u00A7e%d\u00A77 for Player '\u00A7b%s\u00A77'", questid, playerdata.playername));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc = "Finish a quest",
|
||||
usage = "<player> <quest>"
|
||||
@@ -77,23 +76,23 @@ public class QuestCommand extends CommandKamkeelBase {
|
||||
int questid;
|
||||
try {
|
||||
questid = Integer.parseInt(args[1]);
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException ex) {
|
||||
sendError(sender, "QuestID must be an integer: " + args[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
List<PlayerData> data = PlayerDataController.Instance.getPlayersData(sender, playername);
|
||||
if (data.isEmpty()) {
|
||||
sendError(sender, String.format("Unknown player '%s'", playername));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Quest quest = QuestController.Instance.quests.get(questid);
|
||||
if (quest == null){
|
||||
sendError(sender, "Unknown QuestID: " + questid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
if(playerdata.questData.activeQuests.containsKey(questid)){
|
||||
playerdata.questData.activeQuests.remove(questid);
|
||||
@@ -135,14 +134,14 @@ public class QuestCommand extends CommandKamkeelBase {
|
||||
if (quest == null){
|
||||
sendError(sender, "Unknown QuestID: " + questid);
|
||||
return;
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
}
|
||||
for(PlayerData playerdata : data){
|
||||
playerdata.questData.activeQuests.remove(questid);
|
||||
playerdata.save();
|
||||
sendResult(sender, String.format("Stopped Quest \u00A7e%d\u00A77 for Player '\u00A7b%s\u00A77'", questid, playerdata.playername));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc = "Removes a quest from finished and active quests",
|
||||
usage = "<player> <quest>"
|
||||
@@ -156,20 +155,20 @@ public class QuestCommand extends CommandKamkeelBase {
|
||||
sendError(sender, "QuestID must be an integer: " + args[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
List<PlayerData> data = PlayerDataController.Instance.getPlayersData(sender, playername);
|
||||
if (data.isEmpty()) {
|
||||
sendError(sender, String.format("Unknown player '%s'", playername));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Quest quest = QuestController.Instance.quests.get(questid);
|
||||
if (quest == null){
|
||||
sendError(sender, String.format("Unknown QuestID"));
|
||||
return;
|
||||
}
|
||||
|
||||
for(PlayerData playerdata : data){
|
||||
}
|
||||
|
||||
for(PlayerData playerdata : data){
|
||||
playerdata.questData.activeQuests.remove(questid);
|
||||
playerdata.questData.finishedQuests.remove(questid);
|
||||
playerdata.save();
|
||||
@@ -279,11 +278,11 @@ public class QuestCommand extends CommandKamkeelBase {
|
||||
}
|
||||
sendResult(sender, "--------------------");
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="reload quests from disk",
|
||||
permission = 4
|
||||
)
|
||||
)
|
||||
public void reload(ICommandSender sender, String args[]){
|
||||
new QuestController();
|
||||
QuestController.Instance.load();
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
package kamkeel.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
@@ -25,20 +19,22 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class SlayCommand extends CommandKamkeelBase {
|
||||
public Map<String, Class<?>> SlayMap = new LinkedHashMap<String, Class<?>>();
|
||||
|
||||
|
||||
public SlayCommand(){
|
||||
SlayMap.clear();
|
||||
|
||||
|
||||
SlayMap.put("all",EntityLivingBase.class);
|
||||
SlayMap.put("mobs",EntityMob.class);
|
||||
SlayMap.put("animals", EntityAnimal.class);
|
||||
SlayMap.put("items", EntityItem.class);
|
||||
SlayMap.put("xporbs", EntityXPOrb.class);
|
||||
SlayMap.put("npcs", EntityNPCInterface.class);
|
||||
|
||||
HashMap<String,Class<?>> list = new HashMap<String,Class<?>>(EntityList.stringToClassMapping);
|
||||
|
||||
HashMap<String,Class<?>> list = new HashMap<String,Class<?>>(EntityList.stringToClassMapping);
|
||||
for(String name : list.keySet()){
|
||||
Class<?> cls = list.get(name);
|
||||
if(EntityNPCInterface.class.isAssignableFrom(cls))
|
||||
@@ -51,7 +47,7 @@ public class SlayCommand extends CommandKamkeelBase {
|
||||
SlayMap.remove("monster");
|
||||
SlayMap.remove("mob");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "slay";
|
||||
@@ -90,11 +86,11 @@ public class SlayCommand extends CommandKamkeelBase {
|
||||
range = Integer.parseInt(args[args.length - 1]);
|
||||
}
|
||||
catch(NumberFormatException ex){
|
||||
|
||||
|
||||
}
|
||||
AxisAlignedBB box = player.boundingBox.expand(range, range, range);
|
||||
List<? extends Entity> list = sender.getEntityWorld().getEntitiesWithinAABB(EntityLivingBase.class, box);
|
||||
|
||||
|
||||
for(Entity entity : list){
|
||||
if(entity instanceof EntityPlayer)
|
||||
continue;
|
||||
@@ -119,10 +115,10 @@ public class SlayCommand extends CommandKamkeelBase {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sendResult(sender, count + " entities deleted");
|
||||
}
|
||||
|
||||
|
||||
private boolean delete(Entity entity, ArrayList<Class<?>> toDelete) {
|
||||
for(Class<?> delete : toDelete){
|
||||
if(delete == EntityAnimal.class && (entity instanceof EntityHorse)){
|
||||
@@ -135,7 +131,7 @@ public class SlayCommand extends CommandKamkeelBase {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List addTabCompletionOptions(ICommandSender sender, String[] args){
|
||||
return CommandBase.getListOfStringsMatchingLastWord(args, SlayMap.keySet().toArray(new String[SlayMap.size()]));
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
package net.minecraft.client.gui.inventory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
|
||||
public class NPCGuiContainerHelper {
|
||||
|
||||
public static int getLeft(GuiContainer gui) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package nikedemos.markovnames;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.ModContainer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
@@ -86,7 +86,7 @@ public class MarkovDictionary {
|
||||
|
||||
public void incrementSafe(String str1, String str2) {
|
||||
// so for instance, "_DUP_AUX", "_TOTAL" will count how many "DUP" seqCurrs we have
|
||||
if (occurrences.containsKeys(str1, str2))
|
||||
if (occurrences.containsKeys(str1, str2))
|
||||
{
|
||||
int curr = occurrences.get(str1, str2).intValue();
|
||||
occurrences.put(str1, str2, Integer.valueOf(curr + 1));
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import cpw.mods.fml.common.*;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import cpw.mods.fml.common.network.FMLEventChannel;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import foxz.command.CommandNoppes;
|
||||
import kamkeel.addon.AddonManager;
|
||||
import kamkeel.addon.GeckoAddon;
|
||||
import kamkeel.command.CommandKamkeel;
|
||||
import kamkeel.developer.Developer;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -305,4 +306,4 @@ public class CustomNpcs {
|
||||
public static MinecraftServer getServer(){
|
||||
return MinecraftServer.getServer();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,9 @@ import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.entity.data.DataSkinOverlays;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
public class DataDisplay {
|
||||
public EntityNPCInterface npc;
|
||||
|
||||
@@ -15,7 +15,6 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.event.entity.EntityEvent;
|
||||
@@ -28,7 +27,6 @@ import noppes.npcs.api.gui.ICustomGui;
|
||||
import noppes.npcs.api.gui.IItemSlot;
|
||||
import noppes.npcs.api.item.IItemCustom;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.client.gui.custom.components.CustomGuiSlot;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
import noppes.npcs.controllers.CustomGuiController;
|
||||
import noppes.npcs.controllers.ScriptContainer;
|
||||
@@ -762,4 +760,4 @@ public class EventHooks {
|
||||
handler.callScript(EnumScriptType.TIMER, event);
|
||||
NpcAPI.EVENT_BUS.post(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,6 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.village.MerchantRecipeList;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
import net.minecraft.world.WorldServer;
|
||||
|
||||
@@ -13,7 +13,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.village.MerchantRecipeList;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.util.CustomNPCsThreader;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
@@ -58,7 +57,7 @@ public class Server {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static boolean fillBuffer(ByteBuf buffer, Enum enu, Object... obs) throws IOException{
|
||||
buffer.writeInt(enu.ordinal());
|
||||
for(Object ob : obs){
|
||||
@@ -117,13 +116,13 @@ public class Server {
|
||||
buffer.readBytes(bytes);
|
||||
return CompressedStreamTools.func_152457_a(bytes, new NBTSizeTracker(2097152L));
|
||||
}
|
||||
|
||||
|
||||
public static void writeString(ByteBuf buffer, String s){
|
||||
byte[] bytes = s.getBytes(Charsets.UTF_8);
|
||||
buffer.writeShort((short)bytes.length);
|
||||
buffer.writeBytes(bytes);
|
||||
}
|
||||
|
||||
|
||||
public static String readString(ByteBuf buffer){
|
||||
try{
|
||||
byte[] bytes = new byte[buffer.readShort()];
|
||||
@@ -134,5 +133,5 @@ public class Server {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +1,5 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -11,6 +7,10 @@ import net.minecraft.util.DamageSource;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
public class CombatHandler {
|
||||
|
||||
private Map<EntityLivingBase, Float> aggressors = new HashMap<EntityLivingBase, Float>();
|
||||
|
||||
@@ -6,11 +6,11 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.potion.Potion;
|
||||
import noppes.npcs.compat.PixelmonHelper;
|
||||
import noppes.npcs.constants.EnumCompanionJobs;
|
||||
import noppes.npcs.constants.EnumJobType;
|
||||
import noppes.npcs.constants.EnumMovingType;
|
||||
import noppes.npcs.constants.EnumRoleType;
|
||||
import noppes.npcs.compat.PixelmonHelper;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobGuard;
|
||||
import noppes.npcs.roles.RoleCompanion;
|
||||
@@ -19,7 +19,7 @@ import noppes.npcs.roles.companion.CompanionGuard;
|
||||
public class NPCAttackSelector implements IEntitySelector
|
||||
{
|
||||
private EntityNPCInterface npc;
|
||||
|
||||
|
||||
public NPCAttackSelector(EntityNPCInterface npc){
|
||||
this.npc = npc;
|
||||
}
|
||||
@@ -32,12 +32,12 @@ public class NPCAttackSelector implements IEntitySelector
|
||||
return false;
|
||||
if (this.npc.ai.directLOS && !this.npc.getEntitySenses().canSee(entity))
|
||||
return false;
|
||||
|
||||
|
||||
if(!npc.stats.attackInvisible &&((EntityLivingBase)entity).isPotionActive(Potion.invisibility) && npc.getDistanceSqToEntity(entity) < 9)
|
||||
return false;
|
||||
|
||||
//prevent the npc from going on an endless killing spree
|
||||
if(!npc.isFollower() && npc.ai.returnToStart){
|
||||
if(!npc.isFollower() && npc.ai.returnToStart){
|
||||
int allowedDistance = npc.stats.aggroRange * 2;
|
||||
if(npc.ai.movingType == EnumMovingType.Wandering)
|
||||
allowedDistance += npc.ai.walkingRange;
|
||||
@@ -46,14 +46,14 @@ public class NPCAttackSelector implements IEntitySelector
|
||||
int[] arr = npc.ai.getCurrentMovingPath();
|
||||
distance = entity.getDistanceSq(arr[0], arr[1], arr[2]);
|
||||
}
|
||||
|
||||
|
||||
if(distance > allowedDistance * allowedDistance)
|
||||
return false;
|
||||
}
|
||||
|
||||
if(npc.advanced.job == EnumJobType.Guard && ((JobGuard)npc.jobInterface).isEntityApplicable(entity))
|
||||
return true;
|
||||
|
||||
|
||||
if(npc.advanced.role == EnumRoleType.Companion){
|
||||
RoleCompanion role = (RoleCompanion)npc.roleInterface;
|
||||
if(role.job == EnumCompanionJobs.GUARD && ((CompanionGuard)role.jobInterface).isEntityApplicable(entity))
|
||||
@@ -74,7 +74,7 @@ public class NPCAttackSelector implements IEntitySelector
|
||||
if(npc.advanced.attackOtherFactions)
|
||||
return npc.faction.isAggressiveToNpc((EntityNPCInterface)entity);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package noppes.npcs.ai.target;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAITarget;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class EntityAIClearTarget extends EntityAITarget
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package noppes.npcs.client;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.client.gui.OverlayQuestTracking;
|
||||
import noppes.npcs.client.gui.customoverlay.OverlayCustom;
|
||||
import noppes.npcs.client.renderer.ImageData;
|
||||
import noppes.npcs.config.ConfigClient;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.controllers.data.Party;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
import noppes.npcs.util.CacheHashMap;
|
||||
|
||||
@@ -6,22 +6,21 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.client.event.*;
|
||||
import net.minecraftforge.client.event.MouseEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderLivingEvent;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import noppes.npcs.config.ConfigMixin;
|
||||
import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.client.gui.customoverlay.OverlayCustom;
|
||||
import noppes.npcs.client.renderer.RenderCNPCPlayer;
|
||||
import noppes.npcs.constants.EnumAnimationPart;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
import noppes.npcs.controllers.data.Frame;
|
||||
import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.controllers.data.FramePart;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -27,7 +27,10 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import noppes.npcs.*;
|
||||
import noppes.npcs.CommonProxy;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.PacketHandlerPlayer;
|
||||
import noppes.npcs.api.IWorld;
|
||||
import noppes.npcs.blocks.tiles.*;
|
||||
import noppes.npcs.client.controllers.*;
|
||||
@@ -43,7 +46,6 @@ import noppes.npcs.client.gui.player.companion.GuiNpcCompanionInv;
|
||||
import noppes.npcs.client.gui.player.companion.GuiNpcCompanionStats;
|
||||
import noppes.npcs.client.gui.player.companion.GuiNpcCompanionTalents;
|
||||
import noppes.npcs.client.gui.questtypes.GuiNpcQuestTypeItem;
|
||||
import noppes.npcs.client.gui.GuiNpcRemoteEditor;
|
||||
import noppes.npcs.client.gui.roles.*;
|
||||
import noppes.npcs.client.gui.script.GuiScriptBlock;
|
||||
import noppes.npcs.client.gui.script.GuiScriptGlobal;
|
||||
@@ -597,4 +599,4 @@ public class ClientProxy extends CommonProxy {
|
||||
return textFont.usedFont().getFontName();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,18 +29,18 @@ import noppes.npcs.client.gui.customoverlay.OverlayCustom;
|
||||
import noppes.npcs.client.gui.player.GuiBook;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.config.ConfigClient;
|
||||
import noppes.npcs.constants.EnumAnimationPart;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.constants.EnumPacketClient;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.controllers.RecipeController;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.controllers.data.RecipeCarpentry;
|
||||
import noppes.npcs.entity.EntityDialogNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class PacketHandlerClient extends PacketHandlerServer{
|
||||
|
||||
@@ -55,7 +55,7 @@ public class PacketHandlerClient extends PacketHandlerServer{
|
||||
}
|
||||
}
|
||||
|
||||
private void client(ByteBuf buffer, final EntityPlayer player, EnumPacketClient type) throws IOException{
|
||||
private void client(ByteBuf buffer, final EntityPlayer player, EnumPacketClient type) throws IOException{
|
||||
if(type == EnumPacketClient.CHATBUBBLE){
|
||||
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(buffer.readInt());
|
||||
if(entity == null || !(entity instanceof EntityNPCInterface))
|
||||
@@ -65,7 +65,7 @@ public class PacketHandlerClient extends PacketHandlerServer{
|
||||
npc.messages = new RenderChatMessages();
|
||||
String text = NoppesStringUtils.formatText(Server.readString(buffer), player, npc);
|
||||
npc.messages.addMessage(text, npc);
|
||||
|
||||
|
||||
if(buffer.readBoolean())
|
||||
player.addChatMessage(new ChatComponentTranslation(npc.getCommandSenderName() + ": " + text));
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class PacketHandlerClient extends PacketHandlerServer{
|
||||
String str;
|
||||
while((str = Server.readString(buffer)) != null && !str.isEmpty())
|
||||
message += StatCollector.translateToLocal(str);
|
||||
|
||||
|
||||
player.addChatMessage(new ChatComponentTranslation(message));
|
||||
}
|
||||
else if(type == EnumPacketClient.MESSAGE || type == EnumPacketClient.PARTY_MESSAGE){
|
||||
@@ -93,7 +93,7 @@ public class PacketHandlerClient extends PacketHandlerServer{
|
||||
RecipeCarpentry recipe = RecipeCarpentry.read(list.getCompoundTagAt(i));
|
||||
RecipeController.syncRecipes.put(recipe.id,recipe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if(type == EnumPacketClient.SYNCRECIPES_WORKBENCH){
|
||||
RecipeController.reloadGlobalRecipes(RecipeController.syncRecipes);
|
||||
@@ -117,7 +117,7 @@ public class PacketHandlerClient extends PacketHandlerServer{
|
||||
}
|
||||
else if(type == EnumPacketClient.QUEST_COMPLETION){
|
||||
NoppesUtil.guiQuestCompletion(player, Server.readNBT(buffer));
|
||||
}
|
||||
}
|
||||
else if(type == EnumPacketClient.EDIT_NPC){
|
||||
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(buffer.readInt());
|
||||
if(entity == null || !(entity instanceof EntityNPCInterface))
|
||||
@@ -126,10 +126,10 @@ public class PacketHandlerClient extends PacketHandlerServer{
|
||||
}
|
||||
else if(type == EnumPacketClient.PLAY_MUSIC){
|
||||
MusicController.Instance.playMusic(Server.readString(buffer), player);
|
||||
}
|
||||
}
|
||||
else if(type == EnumPacketClient.PLAY_SOUND){
|
||||
MusicController.Instance.playSound(Server.readString(buffer),buffer.readFloat(),buffer.readFloat(),buffer.readFloat());
|
||||
}
|
||||
}
|
||||
else if(type == EnumPacketClient.UPDATE_NPC){
|
||||
NBTTagCompound compound = Server.readNBT(buffer);
|
||||
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(compound.getInteger("EntityId"));
|
||||
@@ -141,7 +141,7 @@ public class PacketHandlerClient extends PacketHandlerServer{
|
||||
NBTTagCompound compound = Server.readNBT(buffer);
|
||||
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(compound.getInteger("EntityId"));
|
||||
if(entity == null || !(entity instanceof EntityNPCInterface))
|
||||
return;
|
||||
return;
|
||||
((EntityNPCInterface)entity).advanced.setRole(compound.getInteger("Role"));
|
||||
((EntityNPCInterface)entity).roleInterface.readFromNBT(compound);
|
||||
NoppesUtil.setLastNpc((EntityNPCInterface) entity);
|
||||
@@ -213,10 +213,10 @@ public class PacketHandlerClient extends PacketHandlerServer{
|
||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||
if(gui == null || !(gui instanceof IGuiError))
|
||||
return;
|
||||
|
||||
|
||||
int i = buffer.readInt();
|
||||
NBTTagCompound compound = Server.readNBT(buffer);
|
||||
|
||||
|
||||
((IGuiError)gui).setError(i, compound);
|
||||
}
|
||||
else if(type == EnumPacketClient.GUI_CLOSE){
|
||||
@@ -229,7 +229,7 @@ public class PacketHandlerClient extends PacketHandlerServer{
|
||||
NBTTagCompound compound = Server.readNBT(buffer);
|
||||
((IGuiClose)gui).setClose(i, compound);
|
||||
}
|
||||
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
mc.displayGuiScreen(null);
|
||||
mc.setIngameFocus();
|
||||
@@ -240,7 +240,7 @@ public class PacketHandlerClient extends PacketHandlerServer{
|
||||
}
|
||||
else if(type == EnumPacketClient.OPEN_BOOK){
|
||||
int x = buffer.readInt(), y = buffer.readInt(), z = buffer.readInt();
|
||||
|
||||
|
||||
NoppesUtil.openGUI(player, new GuiBook(player, ItemStack.loadItemStackFromNBT(Server.readNBT(buffer)), x, y, z));
|
||||
}
|
||||
else if(type == EnumPacketClient.CONFIG){
|
||||
@@ -258,7 +258,7 @@ public class PacketHandlerClient extends PacketHandlerServer{
|
||||
if(ConfigClient.config.hasChanged()){
|
||||
ConfigClient.config.save();
|
||||
}
|
||||
|
||||
|
||||
player.addChatMessage(new ChatComponentTranslation("Font set to %s", ClientProxy.Font.getName()));
|
||||
}
|
||||
else
|
||||
|
||||
@@ -4,7 +4,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.controllers.ServerCloneController;
|
||||
import noppes.npcs.controllers.ServerTagMapController;
|
||||
import noppes.npcs.controllers.data.TagMap;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -6,16 +6,15 @@ import net.minecraft.client.audio.SoundHandler;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class ScriptSoundController {
|
||||
public HashMap<Integer, ScriptClientSound> sounds = new HashMap<>();
|
||||
public static ScriptSoundController Instance;
|
||||
|
||||
public ScriptSoundController() {
|
||||
public ScriptSoundController() {
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
|
||||
public void onUpdate() {
|
||||
SoundHandler soundHandler = Minecraft.getMinecraft().getSoundHandler();
|
||||
final Iterator<Map.Entry<Integer, ScriptClientSound>> iterator = sounds.entrySet().iterator();
|
||||
|
||||
@@ -6,8 +6,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.MathHelper;
|
||||
@@ -15,17 +13,10 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.client.ClientCacheHandler;
|
||||
import noppes.npcs.client.ClientProxy;
|
||||
import noppes.npcs.client.ImageDownloadAlt;
|
||||
import noppes.npcs.client.renderer.ImageBufferDownloadAlt;
|
||||
import noppes.npcs.client.renderer.ImageData;
|
||||
import noppes.npcs.scripted.ScriptParticle;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class CustomFX extends EntityFX {
|
||||
private final Entity entity;
|
||||
private final String directory;
|
||||
@@ -377,7 +368,7 @@ public class CustomFX extends EntityFX {
|
||||
|
||||
return (int)(((int)rr << 16) + ((int)rg << 8) + (rb));
|
||||
}
|
||||
|
||||
|
||||
public int getFXLayer(){
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ package noppes.npcs.client.fx;
|
||||
import net.minecraft.client.particle.EntityPortalFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.ClientProxy;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class EntityEnderFX extends EntityPortalFX{
|
||||
@@ -17,11 +17,11 @@ public class EntityEnderFX extends EntityPortalFX{
|
||||
private final ResourceLocation location;
|
||||
private boolean move = true;
|
||||
private float startX = 0, startY = 0, startZ = 0;
|
||||
|
||||
|
||||
public EntityEnderFX(EntityCustomNpc npc, double par2, double par4,
|
||||
double par6, double par8, double par10, double par12, ModelPartData data) {
|
||||
super(npc.worldObj, par2, par4, par6, par8, par10, par12);
|
||||
|
||||
|
||||
this.npc = npc;
|
||||
particleNumber = npc.getRNG().nextInt(2);
|
||||
portalParticleScale = particleScale = rand.nextFloat() * 0.2F + 0.5F;
|
||||
@@ -29,14 +29,14 @@ public class EntityEnderFX extends EntityPortalFX{
|
||||
particleRed = (data.color >> 16 & 255) / 255f;
|
||||
particleGreen = (data.color >> 8 & 255) / 255f;
|
||||
particleBlue = (data.color & 255) / 255f;
|
||||
|
||||
|
||||
if(npc.getRNG().nextInt(3) == 1){
|
||||
move = false;
|
||||
this.startX = (float) npc.posX;
|
||||
this.startY = (float) npc.posY;
|
||||
this.startZ = (float) npc.posZ;
|
||||
}
|
||||
|
||||
|
||||
if(data.playerTexture)
|
||||
location = npc.textureLocation;
|
||||
else
|
||||
@@ -45,7 +45,7 @@ public class EntityEnderFX extends EntityPortalFX{
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
{
|
||||
if(move){
|
||||
startX = (float)(npc.prevPosX + (npc.posX - npc.prevPosX) * (double)par2);
|
||||
startY = (float)(npc.prevPosY + (npc.posY - npc.prevPosY) * (double)par2);
|
||||
@@ -58,9 +58,9 @@ public class EntityEnderFX extends EntityPortalFX{
|
||||
scale *= scale;
|
||||
scale = 1.0F - scale;
|
||||
particleScale = portalParticleScale * scale;
|
||||
|
||||
|
||||
ClientProxy.bindTexture(location);
|
||||
|
||||
|
||||
float f = 0.875f;
|
||||
float f1 = f + 0.125f;
|
||||
float f2 = 0.75f - (particleNumber * 0.25f);
|
||||
@@ -79,12 +79,12 @@ public class EntityEnderFX extends EntityPortalFX{
|
||||
par1Tessellator.addVertexWithUV((f5 - par3 * f4) + par6 * f4, f6 + par4 * f4, (f7 - par5 * f4) + par7 * f4, f1, f2);
|
||||
par1Tessellator.addVertexWithUV(f5 + par3 * f4 + par6 * f4, f6 + par4 * f4, f7 + par5 * f4 + par7 * f4, f, f2);
|
||||
par1Tessellator.addVertexWithUV((f5 + par3 * f4) - par6 * f4, f6 - par4 * f4, (f7 + par5 * f4) - par7 * f4, f, f3);
|
||||
|
||||
|
||||
tessellator.draw();
|
||||
ClientProxy.bindTexture(resource);
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
|
||||
|
||||
public int getFXLayer(){
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -14,13 +14,15 @@ import noppes.npcs.client.controllers.ClientCloneController;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.controllers.data.TagMap;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.UUID;
|
||||
|
||||
public class GuiNpcMobSpawnerAdd extends GuiNPCInterface implements GuiYesNoCallback, IGuiData, ISubGuiListener {
|
||||
|
||||
|
||||
private Entity toClone;
|
||||
private NBTTagCompound compound;
|
||||
private static boolean serverSide = false;
|
||||
@@ -58,7 +60,7 @@ public class GuiNpcMobSpawnerAdd extends GuiNPCInterface implements GuiYesNoCall
|
||||
String name = toClone.getCommandSenderName();
|
||||
addLabel(new GuiNpcLabel(0, "Save as", guiLeft + 4, guiTop + 6));
|
||||
addTextField(new GuiNpcTextField(0, this, fontRendererObj, guiLeft + 4, guiTop + 18, 200, 20, name));
|
||||
|
||||
|
||||
|
||||
addLabel(new GuiNpcLabel(1, "Tab", guiLeft + 10, guiTop + 50));
|
||||
addButton(new GuiButtonBiDirectional(2, guiLeft + 40, guiTop + 45, 60, 20, new String[]{"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"}, tab - 1));
|
||||
@@ -140,7 +142,7 @@ public class GuiNpcMobSpawnerAdd extends GuiNPCInterface implements GuiYesNoCall
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,8 +11,6 @@ import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.controllers.MusicController;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import org.lwjgl.Sys;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -22,16 +20,16 @@ public class GuiNpcSoundSelection extends GuiNPCInterface {
|
||||
public String domain;
|
||||
private final GuiScreen parent;
|
||||
public GuiSelectionListener listener;
|
||||
|
||||
|
||||
private String up = "..<" + StatCollector.translateToLocal("gui.up") + ">..";
|
||||
|
||||
|
||||
private HashMap<String,List<String>> domains = new HashMap<String,List<String>>();
|
||||
|
||||
|
||||
public GuiNpcSoundSelection(GuiScreen parent, String sound)
|
||||
{
|
||||
SoundHandler handler = Minecraft.getMinecraft().getSoundHandler();
|
||||
SoundRegistry registry = ObfuscationReflectionHelper.getPrivateValue(SoundHandler.class, handler, 4);
|
||||
|
||||
|
||||
Set<ResourceLocation> set = registry.getKeys();
|
||||
for(ResourceLocation location : set){
|
||||
List<String> list = domains.get(location.getResourceDomain());
|
||||
@@ -53,9 +51,9 @@ public class GuiNpcSoundSelection extends GuiNPCInterface {
|
||||
if(domain == null)
|
||||
ss = "Select domain";
|
||||
addLabel(new GuiNpcLabel(0,ss, width / 2 - (this.fontRendererObj.getStringWidth(ss)/2), 20, 0xffffff));
|
||||
|
||||
|
||||
Collection<String> col = domains.keySet();
|
||||
|
||||
|
||||
if(domain != null){
|
||||
col = domains.get(domain);
|
||||
if(!col.contains(up))
|
||||
@@ -69,12 +67,12 @@ public class GuiNpcSoundSelection extends GuiNPCInterface {
|
||||
}
|
||||
else
|
||||
this.addButton(new GuiNpcButton(4, width / 2 - 100, height - 50,98, 20, "gui.open"));
|
||||
|
||||
|
||||
this.addButton(new GuiNpcButton(2, width / 2 + 2, height - 50,98, 20, "gui.cancel"));
|
||||
}
|
||||
|
||||
public void drawScreen(int i, int j, float f)
|
||||
{
|
||||
{
|
||||
slot.drawScreen(i, j, f);
|
||||
super.drawScreen(i, j, f);
|
||||
}
|
||||
@@ -123,7 +121,7 @@ public class GuiNpcSoundSelection extends GuiNPCInterface {
|
||||
}
|
||||
}
|
||||
public void save() {
|
||||
|
||||
|
||||
}
|
||||
public void close() {
|
||||
this.save();
|
||||
|
||||
@@ -3,7 +3,6 @@ package noppes.npcs.client.gui;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import org.lwjgl.Sys;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -119,4 +118,4 @@ public class SubGuiClonerQuickTags extends SubGuiInterface implements IScrollDat
|
||||
public void setSelected(String selected) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
package noppes.npcs.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.global.GuiNPCManageDialogs;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
@@ -1,18 +1,11 @@
|
||||
package noppes.npcs.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.constants.EnumPartyExchange;
|
||||
import noppes.npcs.constants.EnumPartyRequirements;
|
||||
import noppes.npcs.controllers.data.FactionOptions;
|
||||
import noppes.npcs.controllers.data.PartyOptions;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
public class SubGuiNpcPartyOptions extends SubGuiInterface implements ITextfieldListener
|
||||
{
|
||||
private final PartyOptions options;
|
||||
|
||||
@@ -4,7 +4,8 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.global.*;
|
||||
import noppes.npcs.client.gui.global.GuiNPCManageQuest;
|
||||
import noppes.npcs.client.gui.global.GuiNPCQuestSelection;
|
||||
import noppes.npcs.client.gui.questtypes.GuiNpcQuestTypeDialog;
|
||||
import noppes.npcs.client.gui.questtypes.GuiNpcQuestTypeKill;
|
||||
import noppes.npcs.client.gui.questtypes.GuiNpcQuestTypeLocation;
|
||||
|
||||
@@ -8,7 +8,6 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.controllers.MusicController;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
|
||||
@@ -29,7 +28,7 @@ public class SubGuiNpcSoundSelection extends SubGuiInterface {
|
||||
{
|
||||
SoundHandler handler = Minecraft.getMinecraft().getSoundHandler();
|
||||
SoundRegistry registry = ObfuscationReflectionHelper.getPrivateValue(SoundHandler.class, handler, 4);
|
||||
|
||||
|
||||
Set<ResourceLocation> set = registry.getKeys();
|
||||
for(ResourceLocation location : set){
|
||||
List<String> list = domains.get(location.getResourceDomain());
|
||||
@@ -51,9 +50,9 @@ public class SubGuiNpcSoundSelection extends SubGuiInterface {
|
||||
if(domain == null)
|
||||
ss = "Select domain";
|
||||
addLabel(new GuiNpcLabel(0,ss, width / 2 - (this.fontRendererObj.getStringWidth(ss)/2), 20, 0xffffff));
|
||||
|
||||
|
||||
Collection<String> col = domains.keySet();
|
||||
|
||||
|
||||
if(domain != null){
|
||||
col = domains.get(domain);
|
||||
if(!col.contains(up))
|
||||
@@ -67,12 +66,12 @@ public class SubGuiNpcSoundSelection extends SubGuiInterface {
|
||||
}
|
||||
else
|
||||
this.addButton(new GuiNpcButton(4, width / 2 - 100, height - 50,98, 20, "gui.open"));
|
||||
|
||||
|
||||
this.addButton(new GuiNpcButton(2, width / 2 + 2, height - 50,98, 20, "gui.cancel"));
|
||||
}
|
||||
|
||||
public void drawScreen(int i, int j, float f)
|
||||
{
|
||||
{
|
||||
slot.drawScreen(i, j, f);
|
||||
super.drawScreen(i, j, f);
|
||||
}
|
||||
@@ -119,7 +118,7 @@ public class SubGuiNpcSoundSelection extends SubGuiInterface {
|
||||
}
|
||||
}
|
||||
public void save() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void close() {
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package noppes.npcs.client.gui.advanced;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.gui.SubGuiNpcFactionOptions;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.controllers.RecipeController;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
public class GuiNPCTagSetup extends GuiNPCInterface2 implements IScrollData,ICustomScrollListener,IGuiData
|
||||
{
|
||||
@@ -78,9 +78,9 @@ public class GuiNPCTagSetup extends GuiNPCInterface2 implements IScrollData,ICus
|
||||
}
|
||||
initGui();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setData(Vector<String> list, HashMap<String, Integer> data)
|
||||
public void setData(Vector<String> list, HashMap<String, Integer> data)
|
||||
{
|
||||
allTags.addAll(data.keySet());
|
||||
allTags.sort(String.CASE_INSENSITIVE_ORDER);
|
||||
@@ -96,23 +96,23 @@ public class GuiNPCTagSetup extends GuiNPCInterface2 implements IScrollData,ICus
|
||||
tagNames.add(tagList.getStringTagAt(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void mouseClicked(int i, int j, int k)
|
||||
{
|
||||
super.mouseClicked(i, j, k);
|
||||
if(k == 0 && scrollTags != null)
|
||||
scrollTags.mouseClicked(i, j, k);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setSelected(String selected) {
|
||||
scrollTags.setSelected(selected);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void customScrollClicked(int i, int j, int k, GuiCustomScroll guiCustomScroll) {
|
||||
}
|
||||
|
||||
|
||||
public void save() {
|
||||
NBTTagCompound tagCompound = new NBTTagCompound();
|
||||
NBTTagList tagList = new NBTTagList();
|
||||
|
||||
@@ -2,15 +2,15 @@ package noppes.npcs.client.gui.global;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.gui.SubGuiAnimationFrame;
|
||||
import noppes.npcs.client.gui.SubGuiAnimationOptions;
|
||||
import noppes.npcs.client.gui.SubGuiColorSelector;
|
||||
import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumAnimationPart;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.controllers.data.Frame;
|
||||
import noppes.npcs.controllers.data.FramePart;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
|
||||
@@ -11,7 +11,6 @@ import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.controllers.data.Frame;
|
||||
import noppes.npcs.controllers.data.FramePart;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -43,10 +42,10 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
|
||||
|
||||
this.addButton(new GuiNpcButton(0,guiLeft + 368, guiTop + 8, 45, 20, "gui.add"));
|
||||
this.addButton(new GuiNpcButton(1,guiLeft + 368, guiTop + 32, 45, 20, "gui.remove"));
|
||||
|
||||
|
||||
if(scrollAnimations == null){
|
||||
scrollAnimations = new GuiCustomScroll(this,0, 0);
|
||||
scrollAnimations.setSize(143, 185);
|
||||
@@ -219,17 +218,17 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol
|
||||
String name = scrollAnimations.getSelected();
|
||||
this.data = data;
|
||||
scrollAnimations.setList(getSearchList());
|
||||
|
||||
|
||||
if(name != null)
|
||||
scrollAnimations.setSelected(name);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setSelected(String selected) {
|
||||
this.selected = selected;
|
||||
scrollAnimations.setSelected(selected);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void customScrollClicked(int i, int j, int k, GuiCustomScroll guiCustomScroll) {
|
||||
if(guiCustomScroll.id == 0)
|
||||
@@ -238,18 +237,18 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol
|
||||
Client.sendData(EnumPacketServer.AnimationGet, data.get(selected));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void save() {
|
||||
if(selected != null && data.containsKey(selected) && animation != null){
|
||||
Client.sendData(EnumPacketServer.AnimationSave, animation.writeToNBT());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void unFocused(GuiNpcTextField guiNpcTextField) {
|
||||
if(animation.id == -1)
|
||||
return;
|
||||
|
||||
|
||||
if(guiNpcTextField.id == 0) {
|
||||
String name = guiNpcTextField.getText();
|
||||
if(!name.isEmpty() && !data.containsKey(name)){
|
||||
|
||||
@@ -3,7 +3,8 @@ package noppes.npcs.client.gui.global;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.gui.*;
|
||||
import noppes.npcs.client.gui.SubGuiEditText;
|
||||
import noppes.npcs.client.gui.SubGuiNpcDialog;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
@@ -32,7 +33,7 @@ public class GuiNPCManageDialogs extends GuiNPCInterface2 implements IScrollGrou
|
||||
|
||||
private String catSearch = "";
|
||||
private String diagSearch = "";
|
||||
|
||||
|
||||
public GuiNPCManageDialogs(EntityNPCInterface npc)
|
||||
{
|
||||
super(npc);
|
||||
@@ -150,7 +151,7 @@ public class GuiNPCManageDialogs extends GuiNPCInterface2 implements IScrollGrou
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public void buttonEvent(GuiButton guibutton)
|
||||
{
|
||||
int id = guibutton.id;
|
||||
|
||||
@@ -4,9 +4,10 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.gui.*;
|
||||
import noppes.npcs.client.gui.SubGuiEditText;
|
||||
import noppes.npcs.client.gui.SubGuiNpcQuest;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.controllers.data.QuestCategory;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -3,10 +3,7 @@ package noppes.npcs.client.gui.global;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiYesNo;
|
||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.controllers.ClientCloneController;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.constants.EnumPlayerData;
|
||||
@@ -25,7 +22,7 @@ public class GuiNpcManagePlayerData extends GuiNPCInterface2 implements IScrollD
|
||||
private HashMap<String,Integer> data = new HashMap<String,Integer>();
|
||||
private EnumPlayerData selection = EnumPlayerData.Players;
|
||||
private String search = "";
|
||||
|
||||
|
||||
public GuiNpcManagePlayerData(EntityNPCInterface npc)
|
||||
{
|
||||
super(npc);
|
||||
@@ -34,13 +31,13 @@ public class GuiNpcManagePlayerData extends GuiNPCInterface2 implements IScrollD
|
||||
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
super.initGui();
|
||||
scroll = new GuiCustomScroll(this,0, 0);
|
||||
scroll.setSize(303, 175);
|
||||
scroll.guiLeft = guiLeft + 4;
|
||||
scroll.guiTop = guiTop + 16;
|
||||
addScroll(scroll);
|
||||
|
||||
|
||||
addLabel(new GuiNpcLabel(0,"All Players", guiLeft + 10, guiTop + 6));
|
||||
|
||||
this.addButton(new GuiNpcButton(0, guiLeft + 313, guiTop + 10,98, 20, "selectWorld.deleteButton"));
|
||||
@@ -55,7 +52,7 @@ public class GuiNpcManagePlayerData extends GuiNPCInterface2 implements IScrollD
|
||||
|
||||
addTextField(new GuiNpcTextField(0, this, fontRendererObj, guiLeft + 4, guiTop + 193, 303, 20, search));
|
||||
getTextField(0).enabled = selection == EnumPlayerData.Players;
|
||||
|
||||
|
||||
initButtons();
|
||||
}
|
||||
|
||||
@@ -66,7 +63,7 @@ public class GuiNpcManagePlayerData extends GuiNPCInterface2 implements IScrollD
|
||||
getButton(4).setEnabled(selection != EnumPlayerData.Transport);
|
||||
getButton(5).setEnabled(selection != EnumPlayerData.Bank);
|
||||
getButton(6).setEnabled(selection != EnumPlayerData.Factions);
|
||||
|
||||
|
||||
if(selection == EnumPlayerData.Players)
|
||||
getLabel(0).label = "All Players";
|
||||
else
|
||||
@@ -84,7 +81,7 @@ public class GuiNpcManagePlayerData extends GuiNPCInterface2 implements IScrollD
|
||||
if(k == 0 && scroll != null)
|
||||
scroll.mouseClicked(i, j, k);
|
||||
}
|
||||
|
||||
|
||||
public void keyTyped(char c, int i)
|
||||
{
|
||||
super.keyTyped(c, i);
|
||||
@@ -104,7 +101,7 @@ public class GuiNpcManagePlayerData extends GuiNPCInterface2 implements IScrollD
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
protected void actionPerformed(GuiButton guibutton)
|
||||
{
|
||||
int id = guibutton.id;
|
||||
@@ -141,7 +138,7 @@ public class GuiNpcManagePlayerData extends GuiNPCInterface2 implements IScrollD
|
||||
displayGuiScreen(new GuiYesNo(this, "Warning", "Do not operate on PlayerData as its regenerating", 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
}
|
||||
@@ -149,9 +146,9 @@ public class GuiNpcManagePlayerData extends GuiNPCInterface2 implements IScrollD
|
||||
@Override
|
||||
public void setData(Vector<String> list, HashMap<String, Integer> data) {
|
||||
this.data.putAll(data);
|
||||
|
||||
|
||||
scroll.setList(getSearchList());
|
||||
|
||||
|
||||
if(selection == EnumPlayerData.Players && selectedPlayer != null){
|
||||
scroll.setSelected(selectedPlayer);
|
||||
selected = selectedPlayer;
|
||||
|
||||
@@ -10,7 +10,6 @@ import noppes.npcs.client.gui.SubGuiNpcDimensions;
|
||||
import noppes.npcs.client.gui.SubGuiSpawningOptions;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.controllers.data.DialogImage;
|
||||
import noppes.npcs.controllers.data.SpawnData;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -23,12 +22,12 @@ public class GuiNpcNaturalSpawns extends GuiNPCInterface2 implements IGuiData, I
|
||||
private String search = "";
|
||||
|
||||
private SpawnData spawn = new SpawnData();
|
||||
|
||||
|
||||
public GuiNpcNaturalSpawns(EntityNPCInterface npc) {
|
||||
super(npc);
|
||||
Client.sendData(EnumPacketServer.NaturalSpawnGetAll);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initGui(){
|
||||
super.initGui();
|
||||
@@ -43,11 +42,11 @@ public class GuiNpcNaturalSpawns extends GuiNPCInterface2 implements IGuiData, I
|
||||
|
||||
this.addButton(new GuiNpcButton(1,guiLeft + 358, guiTop + 38, 58, 20, "gui.add"));
|
||||
this.addButton(new GuiNpcButton(2,guiLeft + 358, guiTop + 61, 58, 20, "gui.remove"));
|
||||
|
||||
|
||||
if(this.spawn.id >= 0)
|
||||
showSpawn();
|
||||
}
|
||||
|
||||
|
||||
private void showSpawn() {
|
||||
addLabel(new GuiNpcLabel(1,"gui.title", guiLeft + 4, guiTop + 8));
|
||||
addTextField(new GuiNpcTextField(1, this, this.fontRendererObj, guiLeft + 60, guiTop + 3, 140, 20, this.spawn.name));
|
||||
@@ -126,7 +125,7 @@ public class GuiNpcNaturalSpawns extends GuiNPCInterface2 implements IGuiData, I
|
||||
String name = "New";
|
||||
while(data.containsKey(name))
|
||||
name += "_";
|
||||
|
||||
|
||||
SpawnData spawn = new SpawnData();
|
||||
spawn.name = name;
|
||||
Client.sendData(EnumPacketServer.NaturalSpawnSave, spawn.writeNBT(new NBTTagCompound()));
|
||||
@@ -206,13 +205,13 @@ public class GuiNpcNaturalSpawns extends GuiNPCInterface2 implements IGuiData, I
|
||||
initGui();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setData(Vector<String> list, HashMap<String, Integer> data) {
|
||||
String name = scrollNaturalSpawns.getSelected();
|
||||
this.data = data;
|
||||
scrollNaturalSpawns.setList(getSearchList());
|
||||
|
||||
|
||||
if(name != null)
|
||||
scrollNaturalSpawns.setSelected(name);
|
||||
initGui();
|
||||
@@ -251,7 +250,7 @@ public class GuiNpcNaturalSpawns extends GuiNPCInterface2 implements IGuiData, I
|
||||
initGui();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setGuiData(NBTTagCompound compound) {
|
||||
spawn.readNBT(compound);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package noppes.npcs.client.gui.model;
|
||||
|
||||
import kamkeel.addon.GeckoAddon;
|
||||
import kamkeel.addon.client.GeckoAddonClient;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -17,8 +16,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.compat.PixelmonHelper;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.entity.*;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@@ -8,12 +8,12 @@ import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.client.EntityUtil;
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNPCStringSlot;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.entity.*;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -26,7 +26,7 @@ public class GuiEntitySelection extends GuiNPCInterface
|
||||
private Class<? extends EntityLivingBase> prevModel;
|
||||
private ModelData playerdata;
|
||||
private EntityCustomNpc npc;
|
||||
|
||||
|
||||
public GuiEntitySelection(GuiCreationScreen parent, ModelData playerdata, EntityCustomNpc npc)
|
||||
{
|
||||
this.parent = parent;
|
||||
@@ -35,7 +35,7 @@ public class GuiEntitySelection extends GuiNPCInterface
|
||||
drawDefaultBackground = false;
|
||||
prevModel = playerdata.getEntityClass();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
@@ -51,7 +51,7 @@ public class GuiEntitySelection extends GuiNPCInterface
|
||||
slot.selected = "CustomNPC";
|
||||
}
|
||||
slot.registerScrollButtons(4, 5);
|
||||
|
||||
|
||||
this.buttonList.add(new GuiNpcButton(2, width / 2 - 100, height - 44,98, 20, "gui.back"));
|
||||
}
|
||||
|
||||
@@ -63,18 +63,18 @@ public class GuiEntitySelection extends GuiNPCInterface
|
||||
entity = this.npc;
|
||||
else
|
||||
EntityUtil.Copy(npc, entity);
|
||||
|
||||
|
||||
int l = (width/2)-180;
|
||||
int i1 = (height/2) - 90;
|
||||
GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/);
|
||||
GL11.glEnable(2903 /*GL_COLOR_MATERIAL*/);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(l + 33, i1 + 131, 50F);
|
||||
|
||||
|
||||
float scale = 1;
|
||||
if(entity.height > 2.4)
|
||||
scale = 2 / entity.height;
|
||||
|
||||
|
||||
GL11.glScalef(-50 * scale, 50 * scale, 50 * scale);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
float f2 = entity.renderYawOffset;
|
||||
@@ -160,11 +160,11 @@ public class GuiEntitySelection extends GuiNPCInterface
|
||||
close();
|
||||
}
|
||||
}
|
||||
public void close() {
|
||||
public void close() {
|
||||
this.mc.displayGuiScreen(parent);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void actionPerformed(GuiButton guibutton)
|
||||
{
|
||||
close();
|
||||
@@ -173,7 +173,7 @@ public class GuiEntitySelection extends GuiNPCInterface
|
||||
@Override
|
||||
public void save() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.gui.util.GuiModelInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class GuiModelArms extends GuiModelInterface{
|
||||
|
||||
@@ -73,7 +73,7 @@ public class GuiModelArms extends GuiModelInterface{
|
||||
this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("claws"), npc));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void close(){
|
||||
this.mc.displayGuiScreen(parent);
|
||||
|
||||
@@ -2,11 +2,11 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.gui.util.GuiModelInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class GuiModelBody extends GuiModelInterface{
|
||||
|
||||
@@ -19,7 +19,7 @@ public class GuiModelBody extends GuiModelInterface{
|
||||
private final String[] arrParticles = new String[]{"gui.no","Player","Type1", "Type2", "Rainbow", "Type3", "Type4", "Type5", "Type6", "Type7"};
|
||||
private final String[] arrfins = new String[]{"gui.no","Player","Type1","Type2","Type3","Type4","Type5","Type6"};
|
||||
private final String[] arrskirt = new String[]{"gui.no","Player","Type1"};
|
||||
|
||||
|
||||
public GuiModelBody(GuiScreen parent, EntityCustomNpc npc){
|
||||
super(npc);
|
||||
this.parent = parent;
|
||||
@@ -137,7 +137,7 @@ public class GuiModelBody extends GuiModelInterface{
|
||||
if(particles.type == 1){
|
||||
return 4;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ public class GuiModelBody extends GuiModelInterface{
|
||||
this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("skirt"), npc));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void close(){
|
||||
this.mc.displayGuiScreen(parent);
|
||||
|
||||
@@ -4,11 +4,11 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.gui.util.GuiModelInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
import noppes.npcs.client.gui.util.ITextfieldListener;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
@@ -20,9 +20,9 @@ public class GuiModelColor extends GuiModelInterface implements ITextfieldListen
|
||||
|
||||
private GuiScreen parent;
|
||||
private final static ResourceLocation color = new ResourceLocation("customnpcs:textures/gui/color.png");
|
||||
|
||||
|
||||
private int colorX, colorY;
|
||||
|
||||
|
||||
private GuiNpcTextField textfield;
|
||||
|
||||
private ModelPartData data;
|
||||
@@ -42,7 +42,7 @@ public class GuiModelColor extends GuiModelInterface implements ITextfieldListen
|
||||
this.addTextField(textfield = new GuiNpcTextField(0, this, guiLeft + 25, guiTop + 20, 70, 20, data.getColor()));
|
||||
textfield.setTextColor(data.color);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void keyTyped(char c, int i){
|
||||
String prev = textfield.getText();
|
||||
@@ -74,11 +74,11 @@ public class GuiModelColor extends GuiModelInterface implements ITextfieldListen
|
||||
public void drawScreen(int par1, int par2, float par3){
|
||||
super.drawScreen(par1, par2, par3);
|
||||
mc.getTextureManager().bindTexture(color);
|
||||
|
||||
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
this.drawTexturedModalRect(colorX, colorY, 0, 0, 120, 120);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int i, int j, int k)
|
||||
{
|
||||
@@ -95,15 +95,15 @@ public class GuiModelColor extends GuiModelInterface implements ITextfieldListen
|
||||
textfield.setTextColor(color);
|
||||
textfield.setText(data.getColor());
|
||||
}
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
finally{
|
||||
if(stream != null){
|
||||
try {
|
||||
stream.close();
|
||||
} catch (IOException e) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.gui.util.GuiModelInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class GuiModelHead extends GuiModelInterface{
|
||||
|
||||
@@ -90,7 +90,7 @@ public class GuiModelHead extends GuiModelInterface{
|
||||
return 4;
|
||||
if(data.type == 1)
|
||||
return 3;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class GuiModelHead extends GuiModelInterface{
|
||||
protected void actionPerformed(GuiButton btn) {
|
||||
super.actionPerformed(btn);
|
||||
GuiNpcButton button = (GuiNpcButton) btn;
|
||||
|
||||
|
||||
if(button.id == 0){
|
||||
playerdata.headwear = (byte) button.getValue();
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.gui.util.GuiModelInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class GuiModelLegs extends GuiModelInterface{
|
||||
|
||||
@@ -83,7 +83,7 @@ public class GuiModelLegs extends GuiModelInterface{
|
||||
return 9;
|
||||
if(data.type == 6)
|
||||
return 10;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ public class GuiModelLegs extends GuiModelInterface{
|
||||
this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("tail"), npc));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void close(){
|
||||
this.mc.displayGuiScreen(parent);
|
||||
|
||||
@@ -2,14 +2,10 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelRotatePart;
|
||||
import noppes.npcs.client.gui.util.GuiModelInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcSlider;
|
||||
import noppes.npcs.client.gui.util.ISliderListener;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
|
||||
public class GuiModelRotate extends GuiModelInterface implements ISliderListener{
|
||||
|
||||
@@ -20,7 +16,7 @@ public class GuiModelRotate extends GuiModelInterface implements ISliderListener
|
||||
private GuiNpcSlider rotateX;
|
||||
private GuiNpcSlider rotateY;
|
||||
private GuiNpcSlider rotateZ;
|
||||
|
||||
|
||||
public GuiModelRotate(GuiScreen parent, ModelData data, EntityCustomNpc npc){
|
||||
super(npc);
|
||||
this.parent = parent;
|
||||
@@ -113,7 +109,7 @@ public class GuiModelRotate extends GuiModelInterface implements ISliderListener
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void drawSlider(int y, ModelRotatePart config){
|
||||
part = config;
|
||||
addButton(new GuiNpcButton(29, guiLeft + 100, y , 80, 20, new String[]{"gui.enabled","gui.disabled"}, config.disabled ?1:0));
|
||||
@@ -144,7 +140,7 @@ public class GuiModelRotate extends GuiModelInterface implements ISliderListener
|
||||
}
|
||||
if(!(btn instanceof GuiNpcButton))
|
||||
return;
|
||||
|
||||
|
||||
GuiNpcButton button = (GuiNpcButton) btn;
|
||||
if(btn.id == 14){
|
||||
playerdata.enableRotation = button.getValue() == 0;
|
||||
@@ -194,7 +190,7 @@ public class GuiModelRotate extends GuiModelInterface implements ISliderListener
|
||||
public void mouseDragged(GuiNpcSlider slider) {
|
||||
int percent = (int) ((slider.sliderValue) * 360);
|
||||
slider.setString(percent + "%");
|
||||
|
||||
|
||||
if(slider.id == 10)
|
||||
part.rotationX = slider.sliderValue - 0.5f;
|
||||
if(slider.id == 11)
|
||||
@@ -206,10 +202,10 @@ public class GuiModelRotate extends GuiModelInterface implements ISliderListener
|
||||
|
||||
@Override
|
||||
public void mousePressed(GuiNpcSlider slider) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(GuiNpcSlider slider) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,10 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelScalePart;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelScalePart;
|
||||
|
||||
public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
|
||||
@@ -39,7 +39,7 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
addButton(new GuiNpcButton(0, guiLeft + 110, y , 60, 20, "Edit"));
|
||||
y += 24;
|
||||
}
|
||||
|
||||
|
||||
addLabel(new GuiNpcLabel(21, "Body", guiLeft + 55, y + 5, 0xFFFFFF));
|
||||
if(type == 1){
|
||||
drawSlider(y, playerdata.modelScale.body);
|
||||
@@ -49,7 +49,7 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
addButton(new GuiNpcButton(1, guiLeft + 110, y , 60, 20, "Edit"));
|
||||
y += 24;
|
||||
}
|
||||
|
||||
|
||||
addLabel(new GuiNpcLabel(22, "Arms", guiLeft + 55, y + 5, 0xFFFFFF));
|
||||
if(type == 2){
|
||||
drawSlider(y, playerdata.modelScale.arms);
|
||||
@@ -59,7 +59,7 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
addButton(new GuiNpcButton(2, guiLeft + 110, y , 60, 20, "Edit"));
|
||||
y += 24;
|
||||
}
|
||||
|
||||
|
||||
addLabel(new GuiNpcLabel(23, "Legs", guiLeft + 55, y + 5, 0xFFFFFF));
|
||||
if(type == 3){
|
||||
drawSlider(y, playerdata.modelScale.legs);
|
||||
@@ -70,7 +70,7 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
y += 24;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void drawSlider(int y, ModelScalePart config){
|
||||
y += 20;
|
||||
addLabel(new GuiNpcLabel(10, "Width", guiLeft - 25 + offset, y + 5, 0xFFFFFF));
|
||||
@@ -150,7 +150,7 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
config = playerdata.modelScale.arms;
|
||||
else if(type == 3)
|
||||
config = playerdata.modelScale.legs;
|
||||
|
||||
|
||||
if(slider.id == 10)
|
||||
config.scaleX = slider.sliderValue + 0.5f;
|
||||
if(slider.id == 11)
|
||||
@@ -163,7 +163,7 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
|
||||
@Override
|
||||
public void mousePressed(GuiNpcSlider slider) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,17 +2,17 @@ package noppes.npcs.client.gui.model;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.client.controllers.Preset;
|
||||
import noppes.npcs.client.controllers.PresetController;
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
|
||||
public class GuiPresetSave extends GuiNPCInterface{
|
||||
private ModelData data;
|
||||
private GuiScreen parent;
|
||||
|
||||
|
||||
public GuiPresetSave(GuiScreen parent, ModelData data){
|
||||
this.data = data;
|
||||
this.parent = parent;
|
||||
@@ -44,6 +44,6 @@ public class GuiPresetSave extends GuiNPCInterface{
|
||||
@Override
|
||||
public void save() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.client.EntityUtil;
|
||||
import noppes.npcs.client.controllers.Preset;
|
||||
import noppes.npcs.client.controllers.PresetController;
|
||||
@@ -16,6 +15,7 @@ import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNPCStringSlot;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -28,7 +28,7 @@ public class GuiPresetSelection extends GuiNPCInterface
|
||||
private NBTTagCompound prevData;
|
||||
private ModelData playerdata;
|
||||
private EntityCustomNpc npc;
|
||||
|
||||
|
||||
public GuiPresetSelection(GuiCreationScreen parent, ModelData playerdata)
|
||||
{
|
||||
this.parent = parent;
|
||||
@@ -37,17 +37,17 @@ public class GuiPresetSelection extends GuiNPCInterface
|
||||
drawDefaultBackground = false;
|
||||
npc = new EntityCustomNpc(Minecraft.getMinecraft().theWorld);
|
||||
npc.modelData = playerdata.copy();
|
||||
|
||||
|
||||
PresetController.instance.load();
|
||||
}
|
||||
|
||||
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
Vector<String> list = new Vector<String>();
|
||||
for(Preset preset : PresetController.instance.presets.values())
|
||||
list.add(preset.name);
|
||||
|
||||
|
||||
Collections.sort(list,String.CASE_INSENSITIVE_ORDER);
|
||||
slot = new GuiNPCStringSlot(list,this,false,18);
|
||||
slot.registerScrollButtons(4, 5);
|
||||
@@ -65,7 +65,7 @@ public class GuiPresetSelection extends GuiNPCInterface
|
||||
entity = this.npc;
|
||||
else
|
||||
EntityUtil.Copy(npc, entity);
|
||||
|
||||
|
||||
int l = (width/2)-180;
|
||||
int i1 = (height/2) - 90;
|
||||
GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/);
|
||||
@@ -122,14 +122,14 @@ public class GuiPresetSelection extends GuiNPCInterface
|
||||
close();
|
||||
}
|
||||
}
|
||||
public void close() {
|
||||
public void close() {
|
||||
mc.displayGuiScreen(parent);
|
||||
}
|
||||
|
||||
public FontRenderer getFontRenderer() {
|
||||
return this.fontRendererObj;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button)
|
||||
{
|
||||
@@ -146,7 +146,7 @@ public class GuiPresetSelection extends GuiNPCInterface
|
||||
Vector<String> list = new Vector<String>();
|
||||
for(Preset preset : PresetController.instance.presets.values())
|
||||
list.add(preset.name);
|
||||
|
||||
|
||||
Collections.sort(list,String.CASE_INSENSITIVE_ORDER);
|
||||
slot.setList(list);
|
||||
slot.selected = "";
|
||||
@@ -156,7 +156,7 @@ public class GuiPresetSelection extends GuiNPCInterface
|
||||
@Override
|
||||
public void save() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import noppes.npcs.NBTTags;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.controllers.ScriptContainer;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.PlayerDataScript;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
package noppes.npcs.client.gui.util;
|
||||
|
||||
import kamkeel.util.TextSplitter;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static noppes.npcs.client.gui.util.GuiHoverText.buttonTextures;
|
||||
|
||||
public class GuiCustomScroll extends GuiScreen
|
||||
{
|
||||
public static final ResourceLocation resource = new ResourceLocation("customnpcs","textures/gui/misc.png");
|
||||
@@ -40,7 +35,7 @@ public class GuiCustomScroll extends GuiScreen
|
||||
private boolean isSorted = true;
|
||||
public boolean visible = true;
|
||||
private boolean selectable = true;
|
||||
|
||||
|
||||
public GuiCustomScroll(GuiScreen parent, int id)
|
||||
{
|
||||
width = 176;
|
||||
@@ -75,12 +70,12 @@ public class GuiCustomScroll extends GuiScreen
|
||||
ySize = y;
|
||||
xSize = x;
|
||||
listHeight = 14 * list.size();
|
||||
|
||||
|
||||
if(listHeight > 0)
|
||||
scrollHeight = (int) (((double)(ySize - 8) / (double)listHeight) * (ySize-8));
|
||||
else
|
||||
scrollHeight = Integer.MAX_VALUE;
|
||||
|
||||
|
||||
maxScrollY = listHeight - (ySize - 8) - 1;
|
||||
}
|
||||
|
||||
@@ -100,7 +95,7 @@ public class GuiCustomScroll extends GuiScreen
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(guiLeft, guiTop, 0.0F);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
|
||||
if(selectable)
|
||||
hover = getMouseOver(i,j);
|
||||
|
||||
@@ -131,10 +126,10 @@ public class GuiCustomScroll extends GuiScreen
|
||||
if(i >= xSize-9 && i < xSize-4 && j >= 4 && j < ySize){
|
||||
isScrolling = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
isScrolling = false;
|
||||
|
||||
|
||||
if(isScrolling){
|
||||
scrollY = (((j - 8) * listHeight) / (ySize-8)) - (scrollHeight);
|
||||
if(scrollY < 0){
|
||||
@@ -144,14 +139,14 @@ public class GuiCustomScroll extends GuiScreen
|
||||
scrollY = maxScrollY;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(mouseScrolled != 0){
|
||||
scrollY += mouseScrolled > 0?-14:14;
|
||||
if(scrollY > maxScrollY)
|
||||
scrollY = maxScrollY;
|
||||
if(scrollY < 0)
|
||||
scrollY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,12 +247,12 @@ public class GuiCustomScroll extends GuiScreen
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
return j1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -331,7 +326,7 @@ public class GuiCustomScroll extends GuiScreen
|
||||
Collections.sort(list,String.CASE_INSENSITIVE_ORDER);
|
||||
if(old.equals(select))
|
||||
select = name;
|
||||
|
||||
|
||||
selected = list.indexOf(select);
|
||||
setSize(xSize,ySize);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.gui.GuiNpcMobSpawner;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.UUID;
|
||||
|
||||
public class GuiCustomScrollCloner extends GuiCustomScroll {
|
||||
|
||||
@@ -6,27 +6,27 @@ import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.client.EntityUtil;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
public class GuiModelInterface extends GuiNPCInterface{
|
||||
public ModelData playerdata;
|
||||
|
||||
|
||||
private static float rotation = 0;
|
||||
|
||||
|
||||
private GuiNpcButton left,right,zoom,unzoom;
|
||||
|
||||
|
||||
private static float zoomed = 60;
|
||||
|
||||
|
||||
public int xOffset = 0;
|
||||
public int yOffset = 0;
|
||||
|
||||
|
||||
public EntityCustomNpc npc;
|
||||
|
||||
|
||||
public GuiModelInterface(EntityCustomNpc npc){
|
||||
this.npc = npc;
|
||||
playerdata = npc.modelData;
|
||||
@@ -70,7 +70,7 @@ public class GuiModelInterface extends GuiNPCInterface{
|
||||
zoomed+=par3 * 2;
|
||||
else if(unzoom.mousePressed(mc, par1, par2) && zoomed > 10)
|
||||
zoomed-=par3 * 2;
|
||||
|
||||
|
||||
}
|
||||
this.drawDefaultBackground();
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
@@ -78,16 +78,16 @@ public class GuiModelInterface extends GuiNPCInterface{
|
||||
EntityLivingBase entity = playerdata.getEntity(npc);
|
||||
if(entity == null)
|
||||
entity = this.npc;
|
||||
|
||||
|
||||
EntityUtil.Copy(npc, entity);
|
||||
|
||||
|
||||
int l = guiLeft + 190 + xOffset;
|
||||
int i1 = guiTop + 180 + yOffset;
|
||||
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(l, i1, 60F);
|
||||
|
||||
|
||||
|
||||
|
||||
GL11.glScalef(-zoomed, zoomed, zoomed);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
float f2 = entity.renderYawOffset;
|
||||
@@ -128,7 +128,7 @@ public class GuiModelInterface extends GuiNPCInterface{
|
||||
super.drawScreen(par1, par2, par3);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void keyTyped(char par1, int par2)
|
||||
{
|
||||
@@ -146,6 +146,6 @@ public class GuiModelInterface extends GuiNPCInterface{
|
||||
@Override
|
||||
public void save() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,12 +11,9 @@ import net.minecraft.util.ChatAllowedCharacters;
|
||||
import noppes.npcs.NoppesStringUtils;
|
||||
import noppes.npcs.client.ClientProxy;
|
||||
import noppes.npcs.client.gui.util.TextContainer.LineData;
|
||||
import noppes.npcs.config.ConfigClient;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import sun.font.TrueTypeFont;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@@ -9,7 +9,6 @@ import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.client.ImageDownloadAlt;
|
||||
import noppes.npcs.client.gui.custom.GuiCustom;
|
||||
import noppes.npcs.client.renderer.ImageBufferDownloadAlt;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.*;
|
||||
import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.api.ISkinOverlay;
|
||||
import noppes.npcs.client.ClientCacheHandler;
|
||||
import noppes.npcs.client.model.animation.AniCrawling;
|
||||
@@ -18,7 +17,6 @@ import noppes.npcs.client.model.part.*;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.client.model.util.ModelScaleRenderer;
|
||||
import noppes.npcs.client.renderer.ImageData;
|
||||
import noppes.npcs.client.renderer.RenderNPCInterface;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
import noppes.npcs.constants.EnumAnimationPart;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class ModelBeard extends ModelPartInterface {
|
||||
|
||||
private Model2DRenderer model;
|
||||
|
||||
|
||||
public ModelBeard(ModelMPM base) {
|
||||
super(base);
|
||||
model = new Model2DRenderer(base, 56, 20, 8, 12, 64, 32);
|
||||
@@ -38,7 +38,7 @@ public class ModelBeard extends ModelPartInterface {
|
||||
}
|
||||
color = config.color;
|
||||
isHidden = false;
|
||||
|
||||
|
||||
if(!config.playerTexture){
|
||||
location = config.getResource();
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
|
||||
public class ModelBreasts extends ModelPartInterface {
|
||||
private Model2DRenderer breasts;
|
||||
@@ -44,7 +44,7 @@ public class ModelBreasts extends ModelPartInterface {
|
||||
right.setScale(0.12f, 0.14f);
|
||||
right.setThickness(1.75f);
|
||||
breasts3.addChild(right);
|
||||
|
||||
|
||||
Model2DRenderer right2 = new Model2DRenderer(base, 20f, 22, 3, 1, width, height);
|
||||
right2.setTextureSize(width, height);
|
||||
right2.setRotationPoint(-3.8F, 4.1f, -3.14f);
|
||||
@@ -52,7 +52,7 @@ public class ModelBreasts extends ModelPartInterface {
|
||||
right2.setThickness(1.75f);
|
||||
right2.rotateAngleX = (float) (Math.PI / 9);
|
||||
breasts3.addChild(right2);
|
||||
|
||||
|
||||
Model2DRenderer right3 = new Model2DRenderer(base, 20f, 24, 3, 1, width, height);
|
||||
right3.setTextureSize(width, height);
|
||||
right3.setRotationPoint(-3.8F, 5.3f, -3.6f);
|
||||
@@ -60,7 +60,7 @@ public class ModelBreasts extends ModelPartInterface {
|
||||
right3.setThickness(1.75f);
|
||||
right3.rotateAngleX = (float) (-Math.PI / 9);
|
||||
breasts3.addChild(right3);
|
||||
|
||||
|
||||
Model2DRenderer right4 = new Model2DRenderer(base, 23f, 22, 1, 2, width, height);
|
||||
right4.setTextureSize(width, height);
|
||||
right4.setRotationPoint(-1.8f, 5.3f, -3.14f);
|
||||
@@ -75,7 +75,7 @@ public class ModelBreasts extends ModelPartInterface {
|
||||
left.setScale(0.12f, 0.14f);
|
||||
left.setThickness(1.75f);
|
||||
breasts3.addChild(left);
|
||||
|
||||
|
||||
Model2DRenderer left2 = new Model2DRenderer(base, 25f, 22, 3, 1, width, height);
|
||||
left2.setTextureSize(width, height);
|
||||
left2.setRotationPoint(0.8F, 4.1f, -3.18f);
|
||||
@@ -83,7 +83,7 @@ public class ModelBreasts extends ModelPartInterface {
|
||||
left2.setThickness(1.75f);
|
||||
left2.rotateAngleX = (float) (Math.PI / 9);
|
||||
breasts3.addChild(left2);
|
||||
|
||||
|
||||
Model2DRenderer left3 = new Model2DRenderer(base, 25f, 24, 3, 1, width, height);
|
||||
left3.setTextureSize(width, height);
|
||||
left3.setRotationPoint(0.8F, 5.3f, -3.6f);
|
||||
@@ -91,7 +91,7 @@ public class ModelBreasts extends ModelPartInterface {
|
||||
left3.setThickness(1.75f);
|
||||
left3.rotateAngleX = (float) (-Math.PI / 9);
|
||||
breasts3.addChild(left3);
|
||||
|
||||
|
||||
Model2DRenderer left4 = new Model2DRenderer(base, 24f, 22, 1, 2, width, height);
|
||||
left4.setTextureSize(width, height);
|
||||
left4.setRotationPoint(0.8f, 5.3f, -3.6f);
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package noppes.npcs.client.model.part;
|
||||
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class ModelClaws extends ModelPartInterface {
|
||||
|
||||
private Model2DRenderer model;
|
||||
private boolean isRight = false;
|
||||
|
||||
|
||||
public ModelClaws(ModelMPM base, boolean isRight) {
|
||||
super(base);
|
||||
this.isRight = isRight;
|
||||
@@ -34,7 +34,7 @@ public class ModelClaws extends ModelPartInterface {
|
||||
}
|
||||
color = config.color;
|
||||
isHidden = false;
|
||||
|
||||
|
||||
if(!config.playerTexture){
|
||||
location = config.getResource();
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class ModelEars extends ModelPartInterface {
|
||||
private ModelRenderer ears;
|
||||
private ModelRenderer bunny;
|
||||
public ModelEars(ModelMPM par1ModelBase) {
|
||||
super(par1ModelBase);
|
||||
|
||||
|
||||
ears = new ModelRenderer(base);
|
||||
this.addChild(ears);
|
||||
|
||||
@@ -42,10 +42,10 @@ public class ModelEars extends ModelPartInterface {
|
||||
left2.setThickness(1.16f);
|
||||
ears.addChild(left2);
|
||||
|
||||
|
||||
|
||||
bunny = new ModelRenderer(base);
|
||||
this.addChild(bunny);
|
||||
|
||||
|
||||
ModelRenderer earleft = new ModelRenderer(base, 56, 0);
|
||||
earleft.mirror = true;
|
||||
earleft.addBox(-1.466667F, -4F, 0F, 3, 7, 1);
|
||||
@@ -68,7 +68,7 @@ public class ModelEars extends ModelPartInterface {
|
||||
}
|
||||
isHidden = false;
|
||||
this.color = config.color;
|
||||
|
||||
|
||||
ears.isHidden = config.type != 0;
|
||||
bunny.isHidden = config.type != 1;
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package noppes.npcs.client.model.part;
|
||||
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class ModelFin extends ModelPartInterface {
|
||||
|
||||
private Model2DRenderer model;
|
||||
|
||||
|
||||
public ModelFin(ModelMPM base) {
|
||||
super(base);
|
||||
model = new Model2DRenderer(base, 48, 8, 16, 24, 64, 32);
|
||||
@@ -29,7 +29,7 @@ public class ModelFin extends ModelPartInterface {
|
||||
}
|
||||
color = config.color;
|
||||
isHidden = false;
|
||||
|
||||
|
||||
if(!config.playerTexture){
|
||||
location = config.getResource();
|
||||
}
|
||||
|
||||
@@ -2,15 +2,15 @@ package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class ModelHair extends ModelPartInterface {
|
||||
private Model2DRenderer model;
|
||||
|
||||
|
||||
public ModelHair(ModelMPM base) {
|
||||
super(base);
|
||||
model = new Model2DRenderer(base, 56, 20, 8, 12, 64, 32);
|
||||
|
||||
@@ -2,21 +2,21 @@ package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.part.horns.ModelAntennasBack;
|
||||
import noppes.npcs.client.model.part.horns.ModelAntennasFront;
|
||||
import noppes.npcs.client.model.part.horns.ModelAntlerHorns;
|
||||
import noppes.npcs.client.model.part.horns.ModelBullHorns;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class ModelHorns extends ModelPartInterface {
|
||||
private ModelRenderer bull;
|
||||
private ModelRenderer antlers;
|
||||
private ModelRenderer antennasBack;
|
||||
private ModelRenderer antennasFront;
|
||||
|
||||
|
||||
public ModelHorns(ModelMPM base) {
|
||||
super(base);
|
||||
|
||||
@@ -42,12 +42,12 @@ public class ModelHorns extends ModelPartInterface {
|
||||
}
|
||||
color = config.color;
|
||||
isHidden = false;
|
||||
|
||||
|
||||
bull.isHidden = config.type != 0;
|
||||
antlers.isHidden = config.type != 1;
|
||||
antennasBack.isHidden = config.type != 2;
|
||||
antennasFront.isHidden = config.type != 3;
|
||||
|
||||
|
||||
if(!config.playerTexture){
|
||||
location = config.getResource();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package noppes.npcs.client.model.part;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.ClientProxy;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.part.legs.ModelDigitigradeLegs;
|
||||
@@ -13,6 +12,7 @@ import noppes.npcs.client.model.part.legs.ModelNagaLegs;
|
||||
import noppes.npcs.client.model.util.ModelScaleRenderer;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ModelLegs extends ModelScaleRenderer{
|
||||
@@ -35,25 +35,25 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
private ModelRenderer spiderLeg8;
|
||||
private ModelRenderer spiderBody;
|
||||
private ModelRenderer spiderNeck;
|
||||
|
||||
|
||||
private ModelRenderer backLeftLeg;
|
||||
private ModelRenderer backLeftShin;
|
||||
private ModelRenderer backLeftHoof;
|
||||
|
||||
|
||||
private ModelRenderer backRightLeg;
|
||||
private ModelRenderer backRightShin;
|
||||
private ModelRenderer backRightHoof;
|
||||
|
||||
|
||||
private ModelRenderer frontLeftLeg;
|
||||
private ModelRenderer frontLeftShin;
|
||||
private ModelRenderer frontLeftHoof;
|
||||
|
||||
|
||||
private ModelRenderer frontRightLeg;
|
||||
private ModelRenderer frontRightShin;
|
||||
private ModelRenderer frontRightHoof;
|
||||
|
||||
|
||||
private ModelMPM base;
|
||||
|
||||
|
||||
public ModelLegs(ModelMPM base, ModelScaleRenderer leg1, ModelScaleRenderer leg2, int textWidth, int textHeight) {
|
||||
super(base);
|
||||
|
||||
@@ -73,62 +73,62 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
spiderNeck.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, var1);
|
||||
spiderNeck.setRotationPoint(0.0F, (float)var2, 2.0F);
|
||||
spider.addChild(spiderNeck);
|
||||
|
||||
|
||||
spiderBody = new ModelRenderer(base, 0, 12);
|
||||
spiderBody.setTextureSize(64,32);
|
||||
spiderBody.addBox(-5.0F, -4.0F, -6.0F, 10, 8, 12, var1);
|
||||
spiderBody.setRotationPoint(0.0F, (float)var2, 11.0F);
|
||||
spider.addChild(spiderBody);
|
||||
|
||||
|
||||
this.spiderLeg1 = new ModelRenderer(base, 18, 0);
|
||||
this.spiderLeg1.setTextureSize(64,32);
|
||||
this.spiderLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
|
||||
this.spiderLeg1.setRotationPoint(-4.0F, (float)var2, 4.0F);
|
||||
spider.addChild(spiderLeg1);
|
||||
|
||||
|
||||
this.spiderLeg2 = new ModelRenderer(base, 18, 0);
|
||||
this.spiderLeg2.setTextureSize(64,32);
|
||||
this.spiderLeg2.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
|
||||
this.spiderLeg2.setRotationPoint(4.0F, (float)var2, 4.0F);
|
||||
spider.addChild(spiderLeg2);
|
||||
|
||||
|
||||
this.spiderLeg3 = new ModelRenderer(base, 18, 0);
|
||||
this.spiderLeg3.setTextureSize(64,32);
|
||||
this.spiderLeg3.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
|
||||
this.spiderLeg3.setRotationPoint(-4.0F, (float)var2, 3.0F);
|
||||
spider.addChild(spiderLeg3);
|
||||
|
||||
|
||||
this.spiderLeg4 = new ModelRenderer(base, 18, 0);
|
||||
this.spiderLeg4.setTextureSize(64,32);
|
||||
this.spiderLeg4.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
|
||||
this.spiderLeg4.setRotationPoint(4.0F, (float)var2, 3.0F);
|
||||
spider.addChild(spiderLeg4);
|
||||
|
||||
|
||||
this.spiderLeg5 = new ModelRenderer(base, 18, 0);
|
||||
this.spiderLeg5.setTextureSize(64,32);
|
||||
this.spiderLeg5.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
|
||||
this.spiderLeg5.setRotationPoint(-4.0F, (float)var2, 2.0F);
|
||||
spider.addChild(spiderLeg5);
|
||||
|
||||
|
||||
this.spiderLeg6 = new ModelRenderer(base, 18, 0);
|
||||
this.spiderLeg6.setTextureSize(64,32);
|
||||
this.spiderLeg6.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
|
||||
this.spiderLeg6.setRotationPoint(4.0F, (float)var2, 2.0F);
|
||||
spider.addChild(spiderLeg6);
|
||||
|
||||
|
||||
this.spiderLeg7 = new ModelRenderer(base, 18, 0);
|
||||
this.spiderLeg7.setTextureSize(64,32);
|
||||
this.spiderLeg7.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, var1);
|
||||
this.spiderLeg7.setRotationPoint(-4.0F, (float)var2, 1.0F);
|
||||
spider.addChild(spiderLeg7);
|
||||
|
||||
|
||||
this.spiderLeg8 = new ModelRenderer(base, 18, 0);
|
||||
this.spiderLeg8.setTextureSize(64,32);
|
||||
this.spiderLeg8.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, var1);
|
||||
this.spiderLeg8.setRotationPoint(4.0F, (float)var2, 1.0F);
|
||||
spider.addChild(spiderLeg8);
|
||||
|
||||
|
||||
|
||||
int zOffset = 10;
|
||||
float yOffset = 7f;
|
||||
horse = new ModelRenderer(base);
|
||||
@@ -139,7 +139,7 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
body.addBox(-5.0F, -8.0F, -19.0F, 10, 10, 24);
|
||||
body.setRotationPoint(0.0F, 11.0F + yOffset, 9.0F + zOffset);
|
||||
horse.addChild(body);
|
||||
|
||||
|
||||
this.backLeftLeg = new ModelRenderer(base, 78, 29);
|
||||
this.backLeftLeg.setTextureSize(128, 128);
|
||||
this.backLeftLeg.addBox(-2.5F, -2.0F, -2.5F, 4, 9, 5);
|
||||
@@ -155,7 +155,7 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
this.backLeftHoof.addBox(-2.5F, 5.1F, -2.0F, 4, 3, 4);
|
||||
this.backLeftHoof.setRotationPoint(0F, 7.0F, 0);
|
||||
backLeftLeg.addChild(backLeftHoof);
|
||||
|
||||
|
||||
this.backRightLeg = new ModelRenderer(base, 96, 29);
|
||||
this.backRightLeg.setTextureSize(128, 128);
|
||||
this.backRightLeg.addBox(-1.5F, -2.0F, -2.5F, 4, 9, 5);
|
||||
@@ -171,7 +171,7 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
this.backRightHoof.addBox(-1.5F, 5.1F, -2.0F, 4, 3, 4);
|
||||
this.backRightHoof.setRotationPoint(0F, 7, 0);
|
||||
backRightLeg.addChild(backRightHoof);
|
||||
|
||||
|
||||
this.frontLeftLeg = new ModelRenderer(base, 44, 29);
|
||||
this.frontLeftLeg.setTextureSize(128, 128);
|
||||
this.frontLeftLeg.addBox(-1.9F, -1.0F, -2.1F, 3, 8, 4);
|
||||
@@ -187,7 +187,7 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
this.frontLeftHoof.addBox(-2.4F, 5.1F, -2.1F, 4, 3, 4);
|
||||
this.frontLeftHoof.setRotationPoint(.0F, 7.0F, 0F);
|
||||
frontLeftLeg.addChild(frontLeftHoof);
|
||||
|
||||
|
||||
this.frontRightLeg = new ModelRenderer(base, 60, 29);
|
||||
this.frontRightLeg.setTextureSize(128, 128);
|
||||
this.frontRightLeg.addBox(-1.1F, -1.0F, -2.1F, 3, 8, 4);
|
||||
@@ -234,7 +234,7 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
ModelPartData part = this.entity.modelData.legParts;
|
||||
rotationPointZ = 0;
|
||||
rotationPointY = 0;
|
||||
|
||||
|
||||
if(base.isArmor)
|
||||
return;
|
||||
if(part.type == 2){
|
||||
@@ -242,7 +242,7 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
spiderBody.rotationPointY = 15;
|
||||
spiderBody.rotationPointZ = 11;
|
||||
spiderNeck.rotateAngleX = 0;
|
||||
|
||||
|
||||
float var8 = ((float)Math.PI / 4F);
|
||||
this.spiderLeg1.rotateAngleZ = -var8;
|
||||
this.spiderLeg2.rotateAngleZ = var8;
|
||||
@@ -287,7 +287,7 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
this.spiderLeg7.rotateAngleZ += var18;
|
||||
this.spiderLeg8.rotateAngleZ += -var18;
|
||||
|
||||
|
||||
|
||||
if(base.isSneak){
|
||||
rotationPointZ = 5;
|
||||
rotationPointY = -1;
|
||||
@@ -303,7 +303,7 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
}
|
||||
}
|
||||
else if(part.type == 3){
|
||||
this.frontLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * .4F * par2;
|
||||
this.frontLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * .4F * par2;
|
||||
this.frontRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * .4F * par2;
|
||||
this.backLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * .4F * par2;
|
||||
this.backRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * .4F * par2;
|
||||
@@ -331,7 +331,7 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
digitigrade.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void render(float par1)
|
||||
{
|
||||
@@ -367,7 +367,7 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
mermaid.isHidden = part.type != 4;
|
||||
mermaid2.isHidden = part.type != 6;
|
||||
digitigrade.isHidden = part.type != 5;
|
||||
|
||||
|
||||
if(!horse.isHidden){
|
||||
x = 0;
|
||||
y *= 1.8f;
|
||||
@@ -398,7 +398,7 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
GL11.glColor4f(1, 1, 1, base.alpha);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
|
||||
|
||||
}
|
||||
public void setData(EntityCustomNpc entity) {
|
||||
this.entity = entity;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class ModelMohawk extends ModelPartInterface {
|
||||
private Model2DRenderer model;
|
||||
@@ -22,7 +22,7 @@ public class ModelMohawk extends ModelPartInterface {
|
||||
@Override
|
||||
public void setRotationAngles(float par1, float par2, float par3,
|
||||
float par4, float par5, float par6, Entity entity) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ModelMohawk extends ModelPartInterface {
|
||||
color = config.color;
|
||||
isHidden = false;
|
||||
location = config.getResource();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,11 +3,11 @@ package noppes.npcs.client.model.part;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.client.model.util.ModelPlaneRenderer;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ModelSkirt extends ModelPartInterface {
|
||||
@@ -22,7 +22,7 @@ public class ModelSkirt extends ModelPartInterface {
|
||||
Shape1 = new ModelPlaneRenderer(base, 58, 18);
|
||||
Shape1.setTextureSize(64,32);
|
||||
Shape1.addSidePlane(0, 0, 0, 9, 2);
|
||||
|
||||
|
||||
ModelPlaneRenderer part1 = new ModelPlaneRenderer(base, 58, 18);
|
||||
part1.setTextureSize(64,32);
|
||||
part1.addSidePlane(2, 0, 0, 9, 2);
|
||||
|
||||
@@ -2,10 +2,10 @@ package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class ModelSnout extends ModelPartInterface {
|
||||
private ModelRenderer small;
|
||||
@@ -13,10 +13,10 @@ public class ModelSnout extends ModelPartInterface {
|
||||
private ModelRenderer large;
|
||||
private ModelRenderer bunny;
|
||||
private ModelRenderer beak;
|
||||
|
||||
|
||||
public ModelSnout(ModelMPM base) {
|
||||
super(base);
|
||||
|
||||
|
||||
small = new ModelRenderer(base, 24, 0);
|
||||
small.setTextureSize(64,32);
|
||||
small.addBox(0F, 0F, 0F, 4, 3, 1);
|
||||
@@ -34,13 +34,13 @@ public class ModelSnout extends ModelPartInterface {
|
||||
large.addBox(0F, 0F, 0F, 4, 3, 3);
|
||||
large.setRotationPoint(-2F, -3F, -7F);
|
||||
this.addChild(large);
|
||||
|
||||
|
||||
bunny = new ModelRenderer(base, 24, 0);
|
||||
bunny.setTextureSize(64,32);
|
||||
bunny.addBox(1F, 1F, 0F, 4, 2, 1);
|
||||
bunny.setRotationPoint(-3F, -4F, -5F);
|
||||
this.addChild(bunny);
|
||||
|
||||
|
||||
ModelRenderer tooth = new ModelRenderer(base, 24, 3);
|
||||
tooth.setTextureSize(64,32);
|
||||
tooth.addBox(2F, 3f, 0F, 2, 1, 1);
|
||||
@@ -75,7 +75,7 @@ public class ModelSnout extends ModelPartInterface {
|
||||
large.isHidden = config.type != 2;
|
||||
bunny.isHidden = config.type != 3;
|
||||
beak.isHidden = config.type != 4;
|
||||
|
||||
|
||||
if(!config.playerTexture){
|
||||
location = config.getResource();
|
||||
}
|
||||
|
||||
@@ -5,19 +5,19 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.ClientProxy;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.part.tails.*;
|
||||
import noppes.npcs.client.model.util.ModelScaleRenderer;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ModelTail extends ModelScaleRenderer {
|
||||
private EntityCustomNpc entity;
|
||||
private ModelMPM base;
|
||||
|
||||
|
||||
private ModelRenderer tail;
|
||||
private ModelRenderer dragon;
|
||||
private ModelRenderer squirrel;
|
||||
@@ -25,11 +25,11 @@ public class ModelTail extends ModelScaleRenderer {
|
||||
private ModelRenderer fin;
|
||||
private ModelRenderer rodent;
|
||||
private ModelRenderer feather;
|
||||
|
||||
|
||||
private int color = 0xFFFFFF;
|
||||
|
||||
|
||||
private ResourceLocation location = null;
|
||||
|
||||
|
||||
public ModelTail(ModelMPM base) {
|
||||
super(base);
|
||||
this.base = base;
|
||||
@@ -41,7 +41,7 @@ public class ModelTail extends ModelScaleRenderer {
|
||||
tail.setRotationPoint(0F, 0, 1F);
|
||||
setRotation(tail, 0.8714253F, 0F, 0F);
|
||||
this.addChild(tail);
|
||||
|
||||
|
||||
horse = new ModelRenderer(base);
|
||||
horse.setTextureSize(32, 32);
|
||||
horse.setRotationPoint(0, -1, 1);
|
||||
@@ -79,14 +79,14 @@ public class ModelTail extends ModelScaleRenderer {
|
||||
this.entity = entity;
|
||||
initData(entity);
|
||||
}
|
||||
|
||||
|
||||
public void setRotationAngles(float par1, float par2, float par3,
|
||||
float par4, float par5, float par6, Entity entity) {
|
||||
if(this.entity==null) return;
|
||||
|
||||
rotateAngleY = MathHelper.cos(par1 * 0.6662F) * 0.3f * par2;
|
||||
rotateAngleX = MathHelper.sin(par3 * 0.067F) * 0.05F;
|
||||
|
||||
|
||||
if(this.entity.modelData.legParts.type == 2){
|
||||
rotationPointY = 13f;
|
||||
rotationPointZ = 14 * this.entity.modelData.modelScale.legs.scaleZ;
|
||||
|
||||
@@ -2,27 +2,27 @@ package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class ModelWings extends ModelPartInterface {
|
||||
|
||||
|
||||
private Model2DRenderer lWing;
|
||||
private Model2DRenderer rWing;
|
||||
|
||||
|
||||
public ModelWings(ModelMPM base) {
|
||||
super(base);
|
||||
|
||||
|
||||
lWing = new Model2DRenderer(base, 48, 32, 16, 32, 64, 32);
|
||||
lWing.mirror = true;
|
||||
lWing.setRotationPoint(2F, 4, 2F);
|
||||
lWing.setRotationOffset(-16, -12);
|
||||
setRotation(lWing, 0.7141593F, -0.5235988F, -0.5090659F);
|
||||
this.addChild(lWing);
|
||||
|
||||
|
||||
rWing = new Model2DRenderer(base, 48, 32, 16, 32, 64, 32);
|
||||
rWing.setRotationPoint(-2F, 4F, 2F);
|
||||
rWing.setRotationOffset(-16, -12);
|
||||
@@ -35,7 +35,7 @@ public class ModelWings extends ModelPartInterface {
|
||||
float par4, float par5, float par6, Entity entity) {
|
||||
rWing.rotateAngleX = 0.7141593F;
|
||||
rWing.rotateAngleZ = 0.5090659F;
|
||||
|
||||
|
||||
lWing.rotateAngleX = 0.7141593F;
|
||||
lWing.rotateAngleZ = -0.5090659F;
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import noppes.npcs.client.ClientProxy;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelData;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public abstract class ModelPartInterface extends ModelRenderer {
|
||||
@@ -18,7 +18,7 @@ public abstract class ModelPartInterface extends ModelRenderer {
|
||||
public float scale = 1;
|
||||
protected ResourceLocation location;
|
||||
public int color = 0xFFFFFF;
|
||||
|
||||
|
||||
public ModelMPM base;
|
||||
|
||||
public ModelPartInterface(ModelMPM par1ModelBase) {
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
package noppes.npcs.client.renderer;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.ITextureObject;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.client.resources.SkinManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.client.ImageDownloadAlt;
|
||||
import noppes.npcs.client.renderer.ImageBufferDownloadAlt;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import noppes.npcs.client.ClientCacheHandler;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
@@ -153,7 +152,7 @@ public class RenderCNPCPlayer extends RenderPlayer {
|
||||
}
|
||||
|
||||
protected void func_96449_a(AbstractClientPlayer p_96449_1_, double p_96449_2_, double p_96449_4_, double p_96449_6_, String p_96449_8_, float p_96449_9_, double p_96449_10_) {}
|
||||
|
||||
|
||||
public void renderHand(float partialTicks, int renderPass) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityRenderer entityRenderer = mc.entityRenderer;
|
||||
|
||||
@@ -2,7 +2,6 @@ package noppes.npcs.client.renderer;
|
||||
|
||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
|
||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
||||
import kamkeel.addon.GeckoAddon;
|
||||
import kamkeel.addon.client.GeckoAddonClient;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
@@ -29,7 +28,6 @@ import noppes.npcs.constants.EnumStandingType;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import org.lwjgl.Sys;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
@@ -3,13 +3,10 @@ package noppes.npcs.client.renderer.blocks;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -26,11 +23,11 @@ public class BlockBannerRenderer extends BlockRendererInterface{
|
||||
|
||||
private final ModelBanner model = new ModelBanner();
|
||||
private final ModelBannerFlag flag = new ModelBannerFlag();
|
||||
|
||||
|
||||
public static final ResourceLocation resourceFlag = new ResourceLocation("customnpcs","textures/models/BannerFlag.png");
|
||||
|
||||
|
||||
|
||||
|
||||
public BlockBannerRenderer(){
|
||||
((BlockBanner)CustomItems.banner).renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(this);
|
||||
@@ -48,7 +45,7 @@ public class BlockBannerRenderer extends BlockRendererInterface{
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glRotatef(90 * tile.rotation, 0, 1, 0);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
|
||||
|
||||
setMaterialTexture(var1.getBlockMetadata());
|
||||
model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
|
||||
@@ -151,7 +148,7 @@ public class BlockBannerRenderer extends BlockRendererInterface{
|
||||
public int getRenderId() {
|
||||
return CustomItems.banner.getRenderType();
|
||||
}
|
||||
|
||||
|
||||
public int specialRenderDistance(){
|
||||
return 26;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -21,6 +20,7 @@ import noppes.npcs.items.ItemScripted;
|
||||
import noppes.npcs.scripted.item.ScriptCustomItem;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import static net.minecraft.client.renderer.entity.RenderItem.renderInFrame;
|
||||
|
||||
@@ -3,8 +3,6 @@ package noppes.npcs.config;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.config.legacy.LegacyConfig;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import java.io.File;
|
||||
@@ -60,4 +58,4 @@ public class ConfigMixin
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,6 @@ import noppes.npcs.client.gui.custom.components.CustomGuiSlot;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.gui.ScriptGui;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
public class ContainerCustomGui extends Container {
|
||||
public ScriptGui customGui;
|
||||
public IInventory guiInventory;
|
||||
|
||||
@@ -12,7 +12,9 @@ import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.util.NBTJsonUtil;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
public class AnimationController implements IAnimationHandler {
|
||||
|
||||
Loaded 100 of 149 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user