mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 04:57:27 +00:00
Minor class changes to fix / refactor for GTNH Gradle
This commit is contained in:
1 parent
fd7db84eb7
commit
8a4e4760bb
8 files changed
+34
-46
No files matched your search
@@ -2,10 +2,8 @@ package foxz.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import scala.actors.threadpool.Arrays;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.command.PlayerSelector;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@@ -33,10 +31,10 @@ public class CmdNpc extends ChMcLogger {
|
||||
CmdNpc(Object ctorParm) {
|
||||
super (ctorParm);
|
||||
}
|
||||
|
||||
|
||||
public EntityNPCInterface selectedNpc;
|
||||
|
||||
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="Set Home (respawn place)",
|
||||
usage=""
|
||||
@@ -45,16 +43,16 @@ public class CmdNpc extends ChMcLogger {
|
||||
double posX = pcParam.getPlayerCoordinates().posX;
|
||||
double posY = pcParam.getPlayerCoordinates().posY;
|
||||
double posZ = pcParam.getPlayerCoordinates().posZ;
|
||||
|
||||
|
||||
if(args.length == 3){
|
||||
posX = CommandBase.func_110666_a(pcParam, selectedNpc.posX, args[0]);
|
||||
posY = CommandBase.func_110665_a(pcParam, selectedNpc.posY, args[1].trim(), 0, 0);
|
||||
posZ = CommandBase.func_110666_a(pcParam, selectedNpc.posZ, args[2]);
|
||||
}
|
||||
|
||||
|
||||
selectedNpc.ai.startPos = new int[]{MathHelper.floor_double(posX), MathHelper.floor_double(posY), MathHelper.floor_double(posZ)};
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="Set npc visibility",
|
||||
usage=""
|
||||
@@ -64,7 +62,7 @@ public class CmdNpc extends ChMcLogger {
|
||||
return;
|
||||
boolean bo = args[0].equalsIgnoreCase("true");
|
||||
boolean semi = args[0].equalsIgnoreCase("semi");
|
||||
|
||||
|
||||
int current = selectedNpc.display.visible;
|
||||
if(semi)
|
||||
selectedNpc.display.visible = 2;
|
||||
@@ -72,12 +70,12 @@ public class CmdNpc extends ChMcLogger {
|
||||
selectedNpc.display.visible = 0;
|
||||
else
|
||||
selectedNpc.display.visible = 1;
|
||||
|
||||
|
||||
if(current != selectedNpc.display.visible)
|
||||
selectedNpc.updateClient = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="Delete an NPC",
|
||||
usage=""
|
||||
@@ -85,7 +83,7 @@ public class CmdNpc extends ChMcLogger {
|
||||
public void delete(String[] args){
|
||||
selectedNpc.delete();
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="Owner",
|
||||
usage=""
|
||||
@@ -95,10 +93,10 @@ public class CmdNpc extends ChMcLogger {
|
||||
EntityPlayer player = null;
|
||||
if(selectedNpc.roleInterface instanceof RoleFollower)
|
||||
player = ((RoleFollower)selectedNpc.roleInterface).owner;
|
||||
|
||||
|
||||
if(selectedNpc.roleInterface instanceof RoleCompanion)
|
||||
player = ((RoleCompanion)selectedNpc.roleInterface).owner;
|
||||
|
||||
|
||||
if(player == null)
|
||||
sendmessage("No owner");
|
||||
else
|
||||
@@ -108,13 +106,13 @@ public class CmdNpc extends ChMcLogger {
|
||||
EntityPlayerMP player = CommandBase.getPlayer(pcParam, args[0]);
|
||||
if(selectedNpc.roleInterface instanceof RoleFollower)
|
||||
((RoleFollower)selectedNpc.roleInterface).setOwner(player);
|
||||
|
||||
|
||||
if(selectedNpc.roleInterface instanceof RoleCompanion)
|
||||
((RoleCompanion)selectedNpc.roleInterface).setOwner(player);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc="Set npc name",
|
||||
usage=""
|
||||
@@ -122,18 +120,18 @@ public class CmdNpc extends ChMcLogger {
|
||||
public void name(String[] args){
|
||||
if(args.length < 1)
|
||||
return;
|
||||
|
||||
|
||||
String name = args[0];
|
||||
for(int i = 1; i < args.length; i++){
|
||||
name += " " + args[i];
|
||||
}
|
||||
|
||||
|
||||
if(!selectedNpc.display.name.equals(name)){
|
||||
selectedNpc.display.name = name;
|
||||
selectedNpc.updateClient = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubCommand(
|
||||
desc = "Creates an NPC",
|
||||
usage = "[name]",
|
||||
@@ -151,7 +149,7 @@ public class CmdNpc extends ChMcLogger {
|
||||
npc.setHealth(npc.getMaxHealth());
|
||||
NoppesUtilServer.sendOpenGui(player, EnumGuiType.MainMenuDisplay, npc);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List addTabCompletion(ICommandSender par1, String[] args) {
|
||||
if(args.length == 2){
|
||||
@@ -160,7 +158,7 @@ public class CmdNpc extends ChMcLogger {
|
||||
if(args.length == 3 && args[1].equalsIgnoreCase("owner")){
|
||||
return CommandBase.getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames());
|
||||
}
|
||||
|
||||
|
||||
return super.addTabCompletion(par1, args);
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,6 @@ public class ImageDownloadAlt extends SimpleTexture
|
||||
{
|
||||
this.imageThread = new Thread("Texture Downloader #" + threadDownloadCounter.incrementAndGet())
|
||||
{
|
||||
private static final String __OBFID = "CL_00001050";
|
||||
public void run()
|
||||
{
|
||||
HttpURLConnection connection = null;
|
||||
|
||||
@@ -35,8 +35,6 @@ public class GuiMerchantAdd extends GuiContainer
|
||||
private MerchantButton previousRecipeButtonIndex;
|
||||
private int currentRecipeIndex;
|
||||
private String field_94082_v;
|
||||
|
||||
|
||||
public GuiMerchantAdd()
|
||||
{
|
||||
super(new ContainerMerchantAdd(Minecraft.getMinecraft().thePlayer, ServerEventsHandler.Merchant, Minecraft.getMinecraft().theWorld));
|
||||
@@ -50,7 +48,7 @@ public class GuiMerchantAdd extends GuiContainer
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
|
||||
|
||||
int i = (this.width - this.xSize) / 2;
|
||||
int j = (this.height - this.ySize) / 2;
|
||||
this.buttonList.add(this.nextRecipeButtonIndex = new MerchantButton(1, i + 120 + 27, j + 24 - 1, true));
|
||||
@@ -104,7 +102,7 @@ public class GuiMerchantAdd extends GuiContainer
|
||||
--this.currentRecipeIndex;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
|
||||
if(par1GuiButton.id == 4){
|
||||
MerchantRecipeList merchantrecipelist = this.theIMerchant.getRecipes(mc.thePlayer);
|
||||
if(currentRecipeIndex < merchantrecipelist.size()){
|
||||
@@ -114,7 +112,7 @@ public class GuiMerchantAdd extends GuiContainer
|
||||
Client.sendData(EnumPacketServer.MerchantUpdate, ServerEventsHandler.Merchant.getEntityId(), merchantrecipelist);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(par1GuiButton.id == 5){
|
||||
ItemStack item1 = this.inventorySlots.getSlot(0).getStack();
|
||||
ItemStack item2 = this.inventorySlots.getSlot(1).getStack();
|
||||
@@ -123,7 +121,7 @@ public class GuiMerchantAdd extends GuiContainer
|
||||
item1 = item2;
|
||||
item2 = null;
|
||||
}
|
||||
|
||||
|
||||
if(item1 != null && sold != null){
|
||||
item1 = item1.copy();
|
||||
sold = sold.copy();
|
||||
@@ -136,7 +134,7 @@ public class GuiMerchantAdd extends GuiContainer
|
||||
merchantrecipelist.add(recipe);
|
||||
Client.sendData(EnumPacketServer.MerchantUpdate, ServerEventsHandler.Merchant.getEntityId(), merchantrecipelist);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (flag)
|
||||
@@ -266,7 +264,6 @@ public class GuiMerchantAdd extends GuiContainer
|
||||
static class MerchantButton extends GuiButton
|
||||
{
|
||||
private final boolean field_146157_o;
|
||||
private static final String __OBFID = "CL_00000763";
|
||||
|
||||
public MerchantButton(int par1, int par2, int par3, boolean par4)
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
|
||||
|
||||
private DataDisplay display;
|
||||
public GuiNpcTextField nameText;
|
||||
|
||||
|
||||
public GuiNpcDisplay(EntityNPCInterface npc) {
|
||||
super(npc,1);
|
||||
display = npc.display;
|
||||
@@ -205,7 +205,7 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
|
||||
mc.renderGlobal.onEntityDestroy(npc);
|
||||
mc.renderGlobal.onEntityCreate(npc);
|
||||
Client.sendData(EnumPacketServer.MainmenuDisplaySave, display.writeToNBT(new NBTTagCompound()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,9 +57,9 @@ public class GuiBook extends GuiScreen
|
||||
private GuiButton buttonSign;
|
||||
private GuiButton buttonFinalize;
|
||||
private GuiButton buttonCancel;
|
||||
|
||||
|
||||
private int x, y, z;
|
||||
|
||||
|
||||
public GuiBook(EntityPlayer par1EntityPlayer, ItemStack item, int x, int y, int z){
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
@@ -177,9 +177,9 @@ public class GuiBook extends GuiScreen
|
||||
this.bookObj.setTagInfo("title", new NBTTagString(this.bookTitle.trim()));
|
||||
this.bookObj.func_150996_a(Items.written_book);
|
||||
}
|
||||
|
||||
|
||||
NoppesUtilPlayer.sendData(EnumPlayerPacket.SaveBook, x, y, z, sign, bookObj.writeToNBT(new NBTTagCompound()));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -426,7 +426,6 @@ public class GuiBook extends GuiScreen
|
||||
static class NextPageButton extends GuiButton
|
||||
{
|
||||
private final boolean field_146151_o;
|
||||
private static final String __OBFID = "CL_00000745";
|
||||
|
||||
public NextPageButton(int par1, int par2, int par3, boolean par4)
|
||||
{
|
||||
@@ -461,4 +460,4 @@ public class GuiBook extends GuiScreen
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GuiButtonNextPage extends GuiNpcButton{
|
||||
private final boolean field_146151_o;
|
||||
private static final String __OBFID = "CL_00000745";
|
||||
private static final ResourceLocation field_110405_a = new ResourceLocation("textures/gui/book.png");
|
||||
|
||||
public GuiButtonNextPage(int par1, int par2, int par3, boolean par4)
|
||||
|
||||
@@ -10,11 +10,10 @@ import noppes.npcs.controllers.data.PlayerMailData;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class ContainerMail extends ContainerNpcInterface{
|
||||
private static final String __OBFID = "CL_00001742";
|
||||
public static PlayerMail staticmail = new PlayerMail();
|
||||
public PlayerMail mail = new PlayerMail();
|
||||
private boolean canEdit, canSend;
|
||||
|
||||
|
||||
|
||||
public ContainerMail(EntityPlayer player, boolean canEdit, boolean canSend){
|
||||
super(player);
|
||||
@@ -29,7 +28,7 @@ public class ContainerMail extends ContainerNpcInterface{
|
||||
{
|
||||
this.addSlotToContainer(new SlotValid(mail, k , 179 + k * 24, 138, canEdit));
|
||||
}
|
||||
|
||||
|
||||
|
||||
for (int j = 0; j < 3; ++j)
|
||||
{
|
||||
|
||||
@@ -4,9 +4,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.client.ClientCacheHandler;
|
||||
import noppes.npcs.constants.EnumAnimationPart;
|
||||
|
||||
Reference in new issue
Block a user