mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 07:35:11 +00:00
1.4
Fix Decimal Display
This commit is contained in:
1 parent
e10aa09728
commit
f508fbed1a
8 files changed
+17
-49
No files matched your search
@@ -61,7 +61,7 @@ import noppes.npcs.entity.old.EntityNpcNagaMale;
|
||||
import noppes.npcs.entity.old.EntityNpcSkeleton;
|
||||
import noppes.npcs.scripted.wrapper.WrapperNpcAPI;
|
||||
|
||||
@Mod(modid = "customnpcs", name = "CustomNpcs", version = "1.4-beta")
|
||||
@Mod(modid = "customnpcs", name = "CustomNpcs", version = "1.4")
|
||||
public class CustomNpcs {
|
||||
|
||||
@ConfigProp(info = "Disable Chat Bubbles")
|
||||
|
||||
@@ -54,37 +54,6 @@ public class DataDisplay {
|
||||
|
||||
public DataDisplay(EntityNPCInterface npc){
|
||||
this.npc = npc;
|
||||
|
||||
/*
|
||||
Implementing MarkovNames generator. You can blame this blunder on Nikedemos.
|
||||
|
||||
Please refer to nikedemos.markovnames.generators.MarkovCustomNPCsClassic.java
|
||||
|
||||
String[] names = { "Noppes", "Noppes", "Noppes", "Noppes", "Atesson",
|
||||
"Rothcersul", "Achdranys", "Pegato", "Chald", "Gareld",
|
||||
"Nalworche", "Ineald", "Tia'kim", "Torerod", "Turturdar",
|
||||
"Ranler", "Dyntan", "Oldrake", "Gharis", "Elmn", "Tanal",
|
||||
"Waran-ess", "Ach-aldhat", "Athi", "Itageray", "Tasr",
|
||||
"Ightech", "Gakih", "Adkal", "Qua'an", "Sieq", "Urnp", "Rods",
|
||||
"Vorbani", "Smaik", "Fian", "Hir", "Ristai", "Kineth", "Naif",
|
||||
"Issraya", "Arisotura", "Honf", "Rilfom", "Estz", "Ghatroth",
|
||||
"Yosil", "Darage", "Aldny", "Tyltran", "Armos", "Loxiku",
|
||||
"Burhat", "Tinlt", "Ightyd", "Mia",
|
||||
"Ken", "Karla", "Lily", "Carina", "Daniel", "Slater", "Zidane", "Valentine", "Eirina",
|
||||
"Carnow", "Grave", "Shadow", "Drakken", "Kaoz", "Silk", "Drake", "Oldam", "Lynxx", "Lenyx",
|
||||
"Winter", "Seth", "Apolitho", "Amethyst", "Ankin", "Seinkan", "Ayumu", "Sakamoto", "Divina",
|
||||
"Div", "Magia", "Magnus", "Tiakono", "Ruin", "Hailinx", "Ethan", "Wate", "Carter", "William",
|
||||
"Brion", "Sparrow", "Basrrelen", "Gyaku", "Claire", "Crowfeather", "Blackwell", "Raven", "Farcri",
|
||||
"Lucas", "Bangheart", "Kamoku", "Kyoukan", "Blaze", "Benjamin", "Larianne", "Kakaragon",
|
||||
"Melancholy", "Epodyno", "Thanato", "Mika", "Dacks", "Ylander", "Neve", "Meadow", "Cuero",
|
||||
"Embrera", "Eldamore", "Faolan", "Chim", "Nasu", "Kathrine", "Ariel", "Arei", "Demytrix",
|
||||
"Kora", "Ava", "Larson", "Leonardo", "Wyrl", "Sakiama", "Lambton", "Kederath", "Malus", "Riplette",
|
||||
"Andern", "Ezall", "Lucien", "Droco", "Cray", "Tymen", "Zenix", "Entranger",
|
||||
"Saenorath", "Chris", "Christine", "Marble", "Mable", "Ross", "Rose", "Xalgan ", "Kennet", "Kamkeel"
|
||||
};
|
||||
name = names[new Random().nextInt(names.length)];
|
||||
*/
|
||||
|
||||
markovGeneratorId = new Random().nextInt(CustomNpcs.MARKOV_GENERATOR.length-1);
|
||||
name = getRandomName();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class SubGuiNpcMeleeProperties extends SubGuiInterface implements ITextfi
|
||||
{
|
||||
super.initGui();
|
||||
addLabel(new GuiNpcLabel(1,"stats.meleestrength", guiLeft + 5, guiTop + 15));
|
||||
addTextField(new GuiNpcTextField(1,this, fontRendererObj, guiLeft + 85, guiTop + 10, 50, 18, stats.getAttackStrength()+""));
|
||||
addTextField(new GuiNpcTextField(1,this, fontRendererObj, guiLeft + 85, guiTop + 10, 50, 18, String.format("%.0f", stats.getAttackStrength()) + ""));
|
||||
getTextField(1).floatsOnly = true;
|
||||
getTextField(1).setMinMaxDefaultFloat(0,Float.MAX_VALUE,5);
|
||||
addLabel(new GuiNpcLabel(2,"stats.meleerange", guiLeft + 5, guiTop + 45));
|
||||
|
||||
@@ -28,7 +28,7 @@ public class SubGuiNpcProjectiles extends SubGuiInterface implements ITextfieldL
|
||||
{
|
||||
super.initGui();
|
||||
addLabel(new GuiNpcLabel(1,"enchantment.arrowDamage", guiLeft + 5, guiTop + 15));
|
||||
addTextField(new GuiNpcTextField(1,this, fontRendererObj, guiLeft + 45, guiTop + 10, 50, 18, stats.pDamage+""));
|
||||
addTextField(new GuiNpcTextField(1,this, fontRendererObj, guiLeft + 45, guiTop + 10, 50, 18, String.format("%.0f", stats.pDamage) +""));
|
||||
getTextField(1).setFloatsOnly();
|
||||
getTextField(1).setMinMaxDefaultFloat(0, Float.MAX_VALUE, 5);
|
||||
addLabel(new GuiNpcLabel(2,"enchantment.arrowKnockback", guiLeft + 110, guiTop + 15));
|
||||
|
||||
@@ -2,7 +2,6 @@ package noppes.npcs.client.gui.mainmenu;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.EnumCreatureAttribute;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.DataStats;
|
||||
import noppes.npcs.client.Client;
|
||||
@@ -34,19 +33,19 @@ public class GuiNpcStats extends GuiNPCInterface2 implements ITextfieldListener,
|
||||
super.initGui();
|
||||
int y = guiTop + 10;
|
||||
addLabel(new GuiNpcLabel(0,"stats.health", guiLeft + 5, y + 5));
|
||||
addTextField(new GuiNpcTextField(0,this, guiLeft + 85, y, 50, 18, stats.maxHealth+""));
|
||||
addTextField(new GuiNpcTextField(0,this, guiLeft + 85, y, 50, 18, String.format("%.0f", stats.maxHealth) + ""));
|
||||
getTextField(0).doublesOnly = true;
|
||||
getTextField(0).setMinMaxDefaultDouble(0,Double.MAX_VALUE,20);
|
||||
getTextField(0).setMinMaxDefaultDouble(0, Double.MAX_VALUE,20);
|
||||
addLabel(new GuiNpcLabel(1,"stats.aggro", guiLeft + 140, y + 5));
|
||||
addTextField(new GuiNpcTextField(1, this, fontRendererObj, guiLeft + 220, y, 50, 18, stats.aggroRange+""));
|
||||
getTextField(1).integersOnly = true;
|
||||
getTextField(1).setMinMaxDefault(1, Integer.MAX_VALUE, 2);
|
||||
getTextField(1).setMinMaxDefault(1, 96, 2); // Doesn't work past 32 technically (MC Limitations)
|
||||
addLabel(new GuiNpcLabel(34,"stats.creaturetype", guiLeft + 275, y + 5));
|
||||
addButton(new GuiNpcButton(8,guiLeft + 355, y, 56, 20, new String[]{"stats.normal","stats.undead","stats.arthropod"} ,stats.creatureType.ordinal()));
|
||||
|
||||
addButton(new GuiNpcButton(0,guiLeft + 82, y+=22, 56, 20, "selectServer.edit"));
|
||||
addLabel(new GuiNpcLabel(2,"stats.respawn", guiLeft + 5, y + 5));
|
||||
|
||||
|
||||
this.addButton(new GuiNpcButton(2, guiLeft + 82, y+=22, 56, 20, "selectServer.edit"));
|
||||
addLabel(new GuiNpcLabel(5,"stats.meleeproperties", guiLeft + 5, y + 5));
|
||||
this.addButton(new GuiNpcButton(3, guiLeft + 82, y+=22, 56, 20, "selectServer.edit"));
|
||||
@@ -64,10 +63,10 @@ public class GuiNpcStats extends GuiNPCInterface2 implements ITextfieldListener,
|
||||
addLabel(new GuiNpcLabel(10,"stats.fireimmune", guiLeft + 5, y + 5));
|
||||
addButton(new GuiNpcButton(5,guiLeft + 217, y, 56, 20, new String[]{"gui.no","gui.yes"} ,stats.canDrown? 1:0));
|
||||
addLabel(new GuiNpcLabel(11,"stats.candrown", guiLeft + 140, y + 5));
|
||||
addTextField(new GuiNpcTextField(14, this, guiLeft + 355, y, 56, 20, stats.healthRegen + "").setFloatsOnly());
|
||||
addTextField(new GuiNpcTextField(14, this, guiLeft + 355, y, 56, 20, String.format("%.0f", stats.healthRegen) + "").setFloatsOnly());
|
||||
addLabel(new GuiNpcLabel(14,"stats.regenhealth", guiLeft + 275, y + 5));
|
||||
|
||||
addTextField(new GuiNpcTextField(16, this, guiLeft + 355, y+=22, 56, 20, stats.combatRegen + "").setFloatsOnly());
|
||||
addTextField(new GuiNpcTextField(16, this, guiLeft + 355, y+=22, 56, 20, String.format("%.0f", stats.combatRegen) + "").setFloatsOnly());
|
||||
addLabel(new GuiNpcLabel(16,"stats.combatregen", guiLeft + 275, y + 5));
|
||||
addButton(new GuiNpcButton(6,guiLeft + 82, y, 56, 20, new String[]{"gui.no","gui.yes"} ,stats.burnInSun? 1:0));
|
||||
addLabel(new GuiNpcLabel(12,"stats.burninsun", guiLeft + 5, y + 5));
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GuiModelArms extends GuiModelInterface{
|
||||
addLabel(new GuiNpcLabel(8, "Armwear", guiLeft, y + 5, 0xFFFFFF));
|
||||
|
||||
addButton(new GuiNpcButton(9, guiLeft + 50, y += 22, 70, 20, arrSolidArmwear, playerdata.solidArmwear));
|
||||
addLabel(new GuiNpcLabel(9, "Solid Armwear", guiLeft, y + 5, 0xFFFFFF));
|
||||
addLabel(new GuiNpcLabel(9, "Solid", guiLeft, y + 5, 0xFFFFFF));
|
||||
}
|
||||
|
||||
ModelPartData claws = playerdata.getPartData("claws");
|
||||
|
||||
@@ -126,12 +126,12 @@ public class GuiNpcTextField extends GuiTextField{
|
||||
setText(max+"");
|
||||
}
|
||||
else if(doublesOnly && !floatsOnly){
|
||||
if(isEmpty() || !isDouble())
|
||||
setText(defDouble +"");
|
||||
else if(getDouble() < minDouble)
|
||||
setText(minDouble +"");
|
||||
else if(getDouble() > maxDouble)
|
||||
setText(maxDouble +"");
|
||||
if (isEmpty() || !isDouble())
|
||||
setText(defDouble + "");
|
||||
else if (getDouble() < minDouble)
|
||||
setText(minDouble + "");
|
||||
else if (getDouble() > maxDouble)
|
||||
setText(maxDouble + "");
|
||||
}
|
||||
else if(floatsOnly){
|
||||
if(isEmpty() || !isFloat())
|
||||
|
||||
Reference in new issue
Block a user