mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-24 08:14:27 +00:00
Proper Reformating
This commit is contained in:
1 parent
ce75880aba
commit
180d257024
1179 files changed
+59847
-61583
No files matched your search
@@ -9,47 +9,48 @@ import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.data.ModelPartData;
|
||||
|
||||
public class GuiModelLegs extends GuiModelInterface{
|
||||
public class GuiModelLegs extends GuiModelInterface {
|
||||
|
||||
private GuiScreen parent;
|
||||
private final String[] arrLeg = new String[]{"gui.no","Both","Right","Left"};
|
||||
private final String[] arrLegwear = new String[]{"gui.no","Both","Left","Right"};
|
||||
private final String[] arrSolidLegwear = new String[]{"gui.no","Both","Left","Right"};
|
||||
private final String[] arrLegs = new String[]{"gui.no","Player","Player Naga","Spider","Horse","Naga", "Mermaid", "Mermaid 2", "Digitigrade"};
|
||||
private final String[] arrTail = new String[]{"gui.no","Player", "Player Dragon","Cat","Wolf","Horse","Dragon", "Squirrel", "Fin", "Rodent", "Feather", "Fox", "Monkey"};
|
||||
public GuiModelLegs(GuiScreen parent, EntityCustomNpc npc){
|
||||
super(npc);
|
||||
this.parent = parent;
|
||||
this.xOffset = 60;
|
||||
}
|
||||
private GuiScreen parent;
|
||||
private final String[] arrLeg = new String[]{"gui.no", "Both", "Right", "Left"};
|
||||
private final String[] arrLegwear = new String[]{"gui.no", "Both", "Left", "Right"};
|
||||
private final String[] arrSolidLegwear = new String[]{"gui.no", "Both", "Left", "Right"};
|
||||
private final String[] arrLegs = new String[]{"gui.no", "Player", "Player Naga", "Spider", "Horse", "Naga", "Mermaid", "Mermaid 2", "Digitigrade"};
|
||||
private final String[] arrTail = new String[]{"gui.no", "Player", "Player Dragon", "Cat", "Wolf", "Horse", "Dragon", "Squirrel", "Fin", "Rodent", "Feather", "Fox", "Monkey"};
|
||||
|
||||
public GuiModelLegs(GuiScreen parent, EntityCustomNpc npc) {
|
||||
super(npc);
|
||||
this.parent = parent;
|
||||
this.xOffset = 60;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
int y = guiTop + 20;
|
||||
super.initGui();
|
||||
int y = guiTop + 20;
|
||||
|
||||
addButton(new GuiNpcButton(30, guiLeft + 50, y += 22, 70, 20, arrLeg, playerdata.hideLegs));
|
||||
addLabel(new GuiNpcLabel(30, "Hide", guiLeft, y + 5, 0xFFFFFF));
|
||||
addButton(new GuiNpcButton(30, guiLeft + 50, y += 22, 70, 20, arrLeg, playerdata.hideLegs));
|
||||
addLabel(new GuiNpcLabel(30, "Hide", guiLeft, y + 5, 0xFFFFFF));
|
||||
|
||||
if (npc.display.modelType == 1 || npc.display.modelType == 2) {
|
||||
addButton(new GuiNpcButton(8, guiLeft + 50, y += 22, 70, 20, arrLegwear, playerdata.legwear));
|
||||
addLabel(new GuiNpcLabel(8, "Legwear", guiLeft, y + 5, 0xFFFFFF));
|
||||
if (npc.display.modelType == 1 || npc.display.modelType == 2) {
|
||||
addButton(new GuiNpcButton(8, guiLeft + 50, y += 22, 70, 20, arrLegwear, playerdata.legwear));
|
||||
addLabel(new GuiNpcLabel(8, "Legwear", guiLeft, y + 5, 0xFFFFFF));
|
||||
|
||||
addButton(new GuiNpcButton(9, guiLeft + 50, y += 22, 70, 20, arrSolidLegwear, playerdata.solidLegwear));
|
||||
addLabel(new GuiNpcLabel(9, "Solid", guiLeft, y + 5, 0xFFFFFF));
|
||||
}
|
||||
addButton(new GuiNpcButton(9, guiLeft + 50, y += 22, 70, 20, arrSolidLegwear, playerdata.solidLegwear));
|
||||
addLabel(new GuiNpcLabel(9, "Solid", guiLeft, y + 5, 0xFFFFFF));
|
||||
}
|
||||
|
||||
addButton(new GuiNpcButton(1, guiLeft + 50, y += 22, 70, 20, arrLegs, getLegIndex(playerdata.legParts)));
|
||||
addLabel(new GuiNpcLabel(1, "Legs", guiLeft, y + 5, 0xFFFFFF));
|
||||
if(playerdata.legParts.type > 0)
|
||||
addButton(new GuiNpcButton(11, guiLeft + 122, y, 40, 20, playerdata.legParts.getColor()));
|
||||
addButton(new GuiNpcButton(1, guiLeft + 50, y += 22, 70, 20, arrLegs, getLegIndex(playerdata.legParts)));
|
||||
addLabel(new GuiNpcLabel(1, "Legs", guiLeft, y + 5, 0xFFFFFF));
|
||||
if (playerdata.legParts.type > 0)
|
||||
addButton(new GuiNpcButton(11, guiLeft + 122, y, 40, 20, playerdata.legParts.getColor()));
|
||||
|
||||
ModelPartData tail = playerdata.getPartData("tail");
|
||||
addButton(new GuiNpcButton(2, guiLeft + 50, y += 22, 70, 20, arrTail, getTailIndex(tail)));
|
||||
addLabel(new GuiNpcLabel(2, "Tail", guiLeft, y + 5, 0xFFFFFF));
|
||||
if(tail != null)
|
||||
addButton(new GuiNpcButton(12, guiLeft + 122, y, 40, 20, tail.getColor()));
|
||||
if(tail != null && tail.type == 8){
|
||||
ModelPartData tail = playerdata.getPartData("tail");
|
||||
addButton(new GuiNpcButton(2, guiLeft + 50, y += 22, 70, 20, arrTail, getTailIndex(tail)));
|
||||
addLabel(new GuiNpcLabel(2, "Tail", guiLeft, y + 5, 0xFFFFFF));
|
||||
if (tail != null)
|
||||
addButton(new GuiNpcButton(12, guiLeft + 122, y, 40, 20, tail.getColor()));
|
||||
if (tail != null && tail.type == 8) {
|
||||
y += 22;
|
||||
this.addLabel(new GuiNpcLabel(22, "Pattern", guiLeft, y + 5, 0xFFFFFF));
|
||||
this.addButton(new GuiButtonBiDirectional(22, guiLeft + 50, y, 100, 20, new String[]{"Normal", "Wrapped", "Large"}, tail.pattern));
|
||||
@@ -57,41 +58,41 @@ public class GuiModelLegs extends GuiModelInterface{
|
||||
}
|
||||
|
||||
private int getLegIndex(ModelPartData data) {
|
||||
if(!data.playerTexture && data.type == 1)
|
||||
return 5;
|
||||
if(data.type == 4)
|
||||
return 6;
|
||||
if(data.type == 5)
|
||||
return 8;
|
||||
return data.type + 1;
|
||||
}
|
||||
if (!data.playerTexture && data.type == 1)
|
||||
return 5;
|
||||
if (data.type == 4)
|
||||
return 6;
|
||||
if (data.type == 5)
|
||||
return 8;
|
||||
return data.type + 1;
|
||||
}
|
||||
|
||||
private int getTailIndex(ModelPartData data){
|
||||
if(data == null)
|
||||
return 0;
|
||||
if(data.playerTexture && data.type == 0)
|
||||
return 1;
|
||||
if(data.type == 0 && data.texture.contains("tail1"))
|
||||
return 3;
|
||||
if(data.type == 0 && data.texture.contains("tail2"))
|
||||
return 4;
|
||||
if(data.playerTexture && data.type == 1)
|
||||
return 2;
|
||||
if(data.type == 1)
|
||||
return 6;
|
||||
if(data.type == 2)
|
||||
return 5;
|
||||
if(data.type == 3)
|
||||
return 7;
|
||||
if(data.type == 4)
|
||||
return 8;
|
||||
if(data.type == 5)
|
||||
return 9;
|
||||
if(data.type == 6)
|
||||
return 10;
|
||||
if(data.type == 7)
|
||||
private int getTailIndex(ModelPartData data) {
|
||||
if (data == null)
|
||||
return 0;
|
||||
if (data.playerTexture && data.type == 0)
|
||||
return 1;
|
||||
if (data.type == 0 && data.texture.contains("tail1"))
|
||||
return 3;
|
||||
if (data.type == 0 && data.texture.contains("tail2"))
|
||||
return 4;
|
||||
if (data.playerTexture && data.type == 1)
|
||||
return 2;
|
||||
if (data.type == 1)
|
||||
return 6;
|
||||
if (data.type == 2)
|
||||
return 5;
|
||||
if (data.type == 3)
|
||||
return 7;
|
||||
if (data.type == 4)
|
||||
return 8;
|
||||
if (data.type == 5)
|
||||
return 9;
|
||||
if (data.type == 6)
|
||||
return 10;
|
||||
if (data.type == 7)
|
||||
return 11;
|
||||
if(data.type == 8)
|
||||
if (data.type == 8)
|
||||
return 12;
|
||||
|
||||
return 0;
|
||||
@@ -102,96 +103,96 @@ public class GuiModelLegs extends GuiModelInterface{
|
||||
super.actionPerformed(btn);
|
||||
GuiNpcButton button = (GuiNpcButton) btn;
|
||||
|
||||
if(button.id == 8){
|
||||
if (button.id == 8) {
|
||||
playerdata.legwear = (byte) button.getValue();
|
||||
}
|
||||
if(button.id == 9){
|
||||
if (button.id == 9) {
|
||||
playerdata.solidLegwear = (byte) button.getValue();
|
||||
}
|
||||
if(button.id == 30){
|
||||
if (button.id == 30) {
|
||||
playerdata.hideLegs = (byte) button.getValue();
|
||||
}
|
||||
if(button.id == 1){
|
||||
if (button.id == 1) {
|
||||
ModelPartData data = playerdata.legParts;
|
||||
int value = button.getValue() - 1;
|
||||
if(value < 1)
|
||||
if (value < 1)
|
||||
data.color = 0xFFFFFF;
|
||||
if(value < 2){
|
||||
if (value < 2) {
|
||||
data.setTexture("", value);
|
||||
}
|
||||
if(value == 2)
|
||||
if (value == 2)
|
||||
data.setTexture("legs/spider1", 2);
|
||||
if(value == 3)
|
||||
if (value == 3)
|
||||
data.setTexture("legs/horse1", 3);
|
||||
if(value == 4)
|
||||
if (npc.display.modelType == 1 || npc.display.modelType == 2){
|
||||
if (value == 4)
|
||||
if (npc.display.modelType == 1 || npc.display.modelType == 2) {
|
||||
data.setTexture("legs/naga2", 1);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
data.setTexture("legs/naga1", 1);
|
||||
}
|
||||
if(value == 5)
|
||||
if (value == 5)
|
||||
data.setTexture("legs/mermaid1", 4);
|
||||
if(value == 6)
|
||||
if (value == 6)
|
||||
data.setTexture("legs/mermaid1", 6);
|
||||
if(value == 7)
|
||||
if (value == 7)
|
||||
data.setTexture("", 5);
|
||||
|
||||
initGui();
|
||||
|
||||
}
|
||||
|
||||
if(button.id == 2){
|
||||
if (button.id == 2) {
|
||||
int value = button.getValue();
|
||||
if(value == 0)
|
||||
if (value == 0)
|
||||
playerdata.removePart("tail");
|
||||
else{
|
||||
else {
|
||||
ModelPartData data = playerdata.getOrCreatePart("tail");
|
||||
if(value == 1){}
|
||||
data.setTexture("", 0);
|
||||
if(value == 2)
|
||||
if (value == 1) {
|
||||
}
|
||||
data.setTexture("", 0);
|
||||
if (value == 2)
|
||||
data.setTexture("", 1);
|
||||
if(value == 3)
|
||||
if (value == 3)
|
||||
data.setTexture("tail/tail1", 0);
|
||||
if(value == 4)
|
||||
if (value == 4)
|
||||
data.setTexture("tail/tail2", 0);
|
||||
if(value == 5)
|
||||
if (value == 5)
|
||||
data.setTexture("tail/horse1", 2);
|
||||
if(value == 6)
|
||||
if (value == 6)
|
||||
data.setTexture("tail/dragon1", 1);
|
||||
if(value == 7)
|
||||
if (value == 7)
|
||||
data.setTexture("tail/squirrel1", 3);
|
||||
if(value == 8)
|
||||
if (value == 8)
|
||||
data.setTexture("tail/fin1", 4);
|
||||
if(value == 9)
|
||||
if (value == 9)
|
||||
data.setTexture("tail/rodent1", 5);
|
||||
if(value == 10)
|
||||
if (value == 10)
|
||||
data.setTexture("tail/feather1", 6);
|
||||
if(value == 11)
|
||||
if (value == 11)
|
||||
data.setTexture("tail/fox1", 7);
|
||||
if(value == 12)
|
||||
if (value == 12)
|
||||
data.setTexture("tail/monkey1", 8);
|
||||
|
||||
data.pattern = 0;
|
||||
}
|
||||
initGui();
|
||||
}
|
||||
if(button.id == 22){
|
||||
if (button.id == 22) {
|
||||
int value = button.getValue();
|
||||
ModelPartData data = playerdata.getOrCreatePart("tail");
|
||||
data.pattern = (byte) value;
|
||||
}
|
||||
if(button.id == 11){
|
||||
if (button.id == 11) {
|
||||
this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.legParts, npc));
|
||||
}
|
||||
|
||||
if(button.id == 12){
|
||||
if (button.id == 12) {
|
||||
this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("tail"), npc));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close(){
|
||||
public void close() {
|
||||
this.mc.displayGuiScreen(parent);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user