Revert "Revert "WORKING MODEL CHANGER!""

This reverts commit d2b5ce2880.
This commit is contained in:
KAMKEEL committed 2021-04-29 20:42:52 -04:00
1 parent 2afbdbf94d
commit ea1672a242
12 files changed
+81 -92

No files matched your search

@@ -76,8 +76,8 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
this.addButton(new GuiNpcButton(5, guiLeft + 120, y, 50, 20, new String[]{"gui.yes","gui.no"}, display.disableLivingAnimation?1:0));
// Square Texture Button
addLabel(new GuiNpcLabel(300,"display.squareTexture", guiLeft + 230, y + 5));
this.addButton(new GuiNpcButton(300, guiLeft + 313, y, 50, 20, new String[]{"gui.no","gui.yes"}, display.squareTexture));
// addLabel(new GuiNpcLabel(300,"display.squareTexture", guiLeft + 230, y + 5));
// this.addButton(new GuiNpcButton(300, guiLeft + 313, y, 50, 20, new String[]{"gui.no","gui.yes"}, display.squareTexture));
y+=23;
addLabel(new GuiNpcLabel(7,"display.visible", guiLeft + 5, y + 5));
@@ -150,9 +150,9 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
else if(button.id == 7){
display.visible = button.getValue();
}
else if(button.id == 300){
display.squareTexture = (byte)button.getValue();
}
// else if(button.id == 300){
// display.squareTexture = (byte)button.getValue();
// }
else if(button.id == 8){
NoppesUtil.openGUI(player, new GuiNpcTextureCloaks(npc, this));
}
@@ -42,7 +42,7 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol
private final String[] ignoredTags = {"CanBreakDoors", "Bred", "PlayerCreated", "Tame", "HasReproduced"};
private GuiNpcButton prev,next;
private GuiScreen parent;
private HashMap<Integer, String> mapped = new HashMap<Integer, String>();
@@ -54,7 +54,7 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol
for(Object name : mapping.keySet()){
Class<?> c = (Class<?>) mapping.get(name);
try {
if(!EntityCustomNpc.class.isAssignableFrom(c) && !EntityCustomNpc64.class.isAssignableFrom(c) && EntityLiving.class.isAssignableFrom(c) && c.getConstructor(new Class[] {World.class}) != null && !Modifier.isAbstract(c.getModifiers())){
if(!EntityCustomNpc.class.isAssignableFrom(c) && EntityLiving.class.isAssignableFrom(c) && c.getConstructor(new Class[] {World.class}) != null && !Modifier.isAbstract(c.getModifiers())){
if(RenderManager.instance.getEntityClassRenderObject(c) instanceof RendererLivingEntity)
data.put(name.toString(),c.asSubclass(EntityLivingBase.class));
}
@@ -111,6 +111,9 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol
addButton(new GuiNpcButton(7, guiLeft + 50, y += 22, 50, 20, "selectServer.edit"));
addLabel(new GuiNpcLabel(4, "Legs", guiLeft, y + 5, 0xFFFFFF));
addButton(new GuiNpcButton(250, guiLeft + 50, y += 22, 50, 20, new String[]{"Default","Steve64","Alex"}, this.npc.display.modelType));
addLabel(new GuiNpcLabel(250, "Model", guiLeft, y + 5, 0xFFFFFF));
addButton(new GuiNpcButton(44, guiLeft + 310, guiTop + 14, 80, 20, "Save Model"));
addButton(new GuiNpcButton(45, guiLeft + 310, guiTop + 36, 80, 20, "Load Model"));
@@ -265,6 +268,20 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol
if(button.id == 7){
this.mc.displayGuiScreen(new GuiModelLegs(this, npc));
}
// New Button for Changing Models
if(button.id == 250){
if(npc.display.modelType == 0){
npc.display.modelType = 1;
}
else if(npc.display.modelType == 1){
npc.display.modelType = 2;
}
else {
npc.display.modelType = 0;
}
}
if(button.id == 8){
this.mc.displayGuiScreen(new GuiModelScale(this, playerdata, npc));
}
@@ -46,8 +46,9 @@ public class GuiEntitySelection extends GuiNPCInterface
list.add("CustomNPC");
Collections.sort(list,String.CASE_INSENSITIVE_ORDER);
slot = new GuiNPCStringSlot(list,this,false,18);
if(playerdata.getEntityClass() != null)
slot.selected = (String) EntityList.classToStringMapping.get(playerdata.getEntityClass());
if(playerdata.getEntityClass() != null){
slot.selected = (String) EntityList.classToStringMapping.get(playerdata.getEntityClass());
}
else{
slot.selected = "CustomNPC";
}
@@ -121,6 +122,7 @@ public class GuiEntitySelection extends GuiNPCInterface
if(entity != null){
RendererLivingEntity render = (RendererLivingEntity) RenderManager.instance.getEntityRenderObject(entity);
npc.display.texture = NPCRendererHelper.getTexture(render,entity);
npc.display.modelType = 0;
}
else{
npc.display.texture = "customnpcs:textures/entity/humanmale/Steve.png";
@@ -67,7 +67,6 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
addButton(new GuiNpcButton(3, guiLeft + 110, y , 60, 20, "Edit"));
y += 24;
}
}
private void drawSlider(int y, ModelPartConfig config){