Optimize Imports

This commit is contained in:
Kam committed 2024-02-15 17:54:28 -05:00
1 parent ec78673fa2
commit e46b78ff71
149 files changed
+931 -1029

No files matched your search

@@ -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;