mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 18:57:32 +00:00
Merge remote-tracking branch 'origin/patch' into patch
This commit is contained in:
commit
b3a5854ff1
4 files changed
+66
-17
No files matched your search
@@ -36,7 +36,7 @@ import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
@Mod(modid = "customnpcs", name = "CustomNPC+", version = "1.8.4-beta")
|
||||
@Mod(modid = "customnpcs", name = "CustomNPC+", version = "1.8.4")
|
||||
public class CustomNpcs {
|
||||
|
||||
@SidedProxy(clientSide = "noppes.npcs.client.ClientProxy", serverSide = "noppes.npcs.CommonProxy")
|
||||
|
||||
@@ -42,6 +42,7 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData {
|
||||
private int posX,posY,posZ;
|
||||
|
||||
private List<String> list;
|
||||
private List<String> rawList;
|
||||
private List<String> tagList;
|
||||
|
||||
private static int showingClones = 0;
|
||||
@@ -181,6 +182,7 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData {
|
||||
}
|
||||
}
|
||||
this.list = list;
|
||||
this.rawList = new ArrayList<String>(this.list);
|
||||
scroll.setList(getSearchList(), ascending == 0, sortType == 0);
|
||||
}
|
||||
private void showClones() {
|
||||
@@ -198,6 +200,26 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData {
|
||||
}
|
||||
|
||||
this.tagMap = ClientTagMapController.Instance.getTagMap(activeTab);
|
||||
this.rawList = new ArrayList<String>(this.list);
|
||||
if(this.tagMap != null){
|
||||
if(GuiNpcMobSpawner.displayTags == 0 || GuiNpcMobSpawner.displayTags == 1){
|
||||
for(int i = 0; i < this.list.size(); i++){
|
||||
StringBuilder npcName = new StringBuilder(list.get(i));
|
||||
if (this.tagMap.hasClone(list.get(i))) {
|
||||
for (UUID tagUUID : this.tagMap.getUUIDsList(list.get(i))){
|
||||
Tag tag = tags.get(tagUUID);
|
||||
if(tag != null){
|
||||
if(GuiNpcMobSpawner.displayTags == 1 || !tag.getIsHidden()){
|
||||
npcName.append(" [" + tag.name + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.rawList.set(i, npcName.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scroll.setList(getSearchList(), ascending == 0, sortType == 0);
|
||||
}
|
||||
public void keyTyped(char c, int i)
|
||||
@@ -222,6 +244,9 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData {
|
||||
if(this.list == null){
|
||||
this.list = new ArrayList<String>();
|
||||
}
|
||||
if(this.rawList == null){
|
||||
this.rawList = new ArrayList<String>();
|
||||
}
|
||||
|
||||
// No Filters - or - Entities
|
||||
if(tagFilters.size() == 0 || showingClones == 1){
|
||||
@@ -231,9 +256,10 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData {
|
||||
// Yes Search
|
||||
else {
|
||||
List<String> list = new ArrayList<String>();
|
||||
for(String name : this.list){
|
||||
if(name.toLowerCase().contains(search))
|
||||
list.add(name);
|
||||
for(int i = 0; i < this.list.size(); i++){
|
||||
if(this.rawList.get(i).toLowerCase().contains(search)){
|
||||
list.add(this.list.get(i));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -257,14 +283,16 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData {
|
||||
|
||||
// Yes Search
|
||||
List<String> list = new ArrayList<String>();
|
||||
for(String name : this.list){
|
||||
if(name.toLowerCase().contains(search)) {
|
||||
if(tagMap.hasClone(name)){
|
||||
if(meetsCondition(name)){
|
||||
list.add(name);
|
||||
for(int i = 0; i < this.list.size(); i++){
|
||||
if(this.rawList.get(i).toLowerCase().contains(search)){
|
||||
String npcName = this.list.get(i);
|
||||
if(tagMap.hasClone(npcName)){
|
||||
if(meetsCondition(npcName)){
|
||||
list.add(npcName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -481,6 +509,27 @@ public class GuiNpcMobSpawner extends GuiNPCInterface implements IGuiData {
|
||||
}
|
||||
|
||||
this.list = list;
|
||||
|
||||
this.rawList = new ArrayList<String>(this.list);
|
||||
if(this.tagMap != null){
|
||||
if(GuiNpcMobSpawner.displayTags == 0 || GuiNpcMobSpawner.displayTags == 1){
|
||||
for(int i = 0; i < this.list.size(); i++){
|
||||
StringBuilder npcName = new StringBuilder(list.get(i));
|
||||
if (this.tagMap.hasClone(list.get(i))) {
|
||||
for (UUID tagUUID : this.tagMap.getUUIDsList(list.get(i))){
|
||||
Tag tag = tags.get(tagUUID);
|
||||
if(tag != null){
|
||||
if(GuiNpcMobSpawner.displayTags == 1 || !tag.getIsHidden()){
|
||||
npcName.append(" [" + tag.name + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.rawList.set(i, npcName.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scroll.setList(getSearchList(), ascending == 0, sortType == 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class GuiCustomScrollCloner extends GuiCustomScroll {
|
||||
}
|
||||
|
||||
if((this.parent.getShowingClones() == 0 || this.parent.getShowingClones() == 2) && this.parent.tagMap != null){
|
||||
int tagStartX = j + fontRendererObj.getStringWidth(displayString) + 5;
|
||||
int tagStartX = j + fontRendererObj.getStringWidth(displayString) + 3;
|
||||
if(GuiNpcMobSpawner.displayTags == 0 || GuiNpcMobSpawner.displayTags == 1){
|
||||
if (this.parent.tagMap.hasClone(list.get(i))) {
|
||||
for (UUID tagUUID : this.parent.tagMap.getUUIDsList(list.get(i))){
|
||||
@@ -64,7 +64,7 @@ public class GuiCustomScrollCloner extends GuiCustomScroll {
|
||||
if(tag != null){
|
||||
if(GuiNpcMobSpawner.displayTags == 1 || !tag.getIsHidden()){
|
||||
fontRendererObj.drawString("[" + tag.name + "]", tagStartX, k, tag.color);
|
||||
tagStartX += fontRendererObj.getStringWidth("[" + tag.name + "]") + 2;
|
||||
tagStartX += fontRendererObj.getStringWidth("[" + tag.name + "]") + 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user