Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
cf9f2a2375
Commit
82421d9544
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
SCHEM_SELECTOR_TITLE={0} auswählen: {1}
|
SCHEM_SELECTOR_TITLE={0} auswählen: {1}
|
||||||
SCHEM_SELECTOR_BACK=§eZurück
|
SCHEM_SELECTOR_BACK=§eZurück
|
||||||
SCHEM_SELECTOR_DIR=Ordner
|
SCHEM_SELECTOR_DIR=§9Ordner
|
||||||
SCHEM_SELECTOR_RANK=§8Rang {0}
|
SCHEM_SELECTOR_RANK=§8Rang {0}
|
||||||
SCHEM_SELECTOR_OWN=§7Eigene Schematics
|
SCHEM_SELECTOR_OWN=§7Eigene Schematics
|
||||||
SCHEM_SELECTOR_PUB=§7Public Schematics
|
SCHEM_SELECTOR_PUB=§7Public Schematics
|
||||||
|
@ -97,7 +97,7 @@ public class SchematicSelector {
|
|||||||
list.add(renderItem(node));
|
list.add(renderItem(node));
|
||||||
}
|
}
|
||||||
|
|
||||||
SWListInv<SchematicNode> inv = new SWListInv<>(player, MessageFormat.format(injectable.createTitle(player), target.target.getName(player), filter.getName().isEmpty()?(parent == null?"/":parent.generateBreadcrumbs(user)):filter.getName()), false, list, (clickType, node) -> handleClick(node, parent));
|
SWListInv<SchematicNode> inv = new SWListInv<>(player, MessageFormat.format(injectable.createTitle(player), target.target.getName(player), filter.getName() == null?(parent == null?"/":parent.generateBreadcrumbs(user)):filter.getName()), false, list, (clickType, node) -> handleClick(node, parent));
|
||||||
if(publicMode == PublicMode.ALL) {
|
if(publicMode == PublicMode.ALL) {
|
||||||
if(user.getId() == 0) {
|
if(user.getId() == 0) {
|
||||||
inv.setItem(48, Material.BUCKET, Core.MESSAGE.parse("SCHEM_SELECTOR_OWN", player), clickType -> {
|
inv.setItem(48, Material.BUCKET, Core.MESSAGE.parse("SCHEM_SELECTOR_OWN", player), clickType -> {
|
||||||
@ -152,13 +152,13 @@ public class SchematicSelector {
|
|||||||
else
|
else
|
||||||
m = SWItem.getMaterial(node.getItem());
|
m = SWItem.getMaterial(node.getItem());
|
||||||
|
|
||||||
String name = "§" + (filter.getName().isEmpty()?"e":"7") + node.getName();
|
String name = "§" + (filter.getName() == null?"e":"7") + node.getName();
|
||||||
|
|
||||||
if(!filter.getName().isEmpty()) {
|
if(filter.getName() != null) {
|
||||||
name = name.replace(filter.getName(), "§e" + filter.getName() + "§7");
|
name = name.replace(filter.getName(), "§e" + filter.getName() + "§7");
|
||||||
}
|
}
|
||||||
|
|
||||||
SWItem item = new SWItem(m, name, Collections.singletonList(node.isDir() ? ("§9" + Core.MESSAGE.parse("SCHEM_SELECTOR_DIR", player)) : "§7" + node.getSchemtype().name()), !node.isDir() && !node.getSchemtype().writeable(), click -> {
|
SWItem item = new SWItem(m, name, Collections.singletonList(node.isDir() ? (Core.MESSAGE.parse("SCHEM_SELECTOR_DIR", player)) : "§7" + node.getSchemtype().name()), !node.isDir() && !node.getSchemtype().writeable(), click -> {
|
||||||
});
|
});
|
||||||
if(!node.isDir() && node.getRank() > 0) {
|
if(!node.isDir() && node.getRank() > 0) {
|
||||||
item.setLore(Arrays.asList("§7" + node.getSchemtype().name(), Core.MESSAGE.parse("SCHEM_SELECTOR_RANK", player)));
|
item.setLore(Arrays.asList("§7" + node.getSchemtype().name(), Core.MESSAGE.parse("SCHEM_SELECTOR_RANK", player)));
|
||||||
@ -182,7 +182,7 @@ public class SchematicSelector {
|
|||||||
SWInventory inv = new SWInventory(player, 9, Core.MESSAGE.parse("SCHEM_SELECTOR_FILTER_TITLE", player));
|
SWInventory inv = new SWInventory(player, 9, Core.MESSAGE.parse("SCHEM_SELECTOR_FILTER_TITLE", player));
|
||||||
InvCallback nameCallback = clickType -> {
|
InvCallback nameCallback = clickType -> {
|
||||||
if(clickType.isRightClick()) {
|
if(clickType.isRightClick()) {
|
||||||
filter.setName("");
|
filter.setName(null);
|
||||||
openFilter();
|
openFilter();
|
||||||
} else {
|
} else {
|
||||||
SWAnvilInv swAnvilInv = new SWAnvilInv(player, Core.MESSAGE.parse("SCHEM_SELECTOR_FILTER_ENTER_NAME", player));
|
SWAnvilInv swAnvilInv = new SWAnvilInv(player, Core.MESSAGE.parse("SCHEM_SELECTOR_FILTER_ENTER_NAME", player));
|
||||||
@ -194,7 +194,7 @@ public class SchematicSelector {
|
|||||||
swAnvilInv.open();
|
swAnvilInv.open();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if(filter.getName().isEmpty()) {
|
if(filter.getName() == null) {
|
||||||
inv.setItem(0, Material.NAME_TAG, Core.MESSAGE.parse("SCHEM_SELECTOR_FILTER_NAME", player), nameCallback);
|
inv.setItem(0, Material.NAME_TAG, Core.MESSAGE.parse("SCHEM_SELECTOR_FILTER_NAME", player), nameCallback);
|
||||||
} else {
|
} else {
|
||||||
inv.setItem(0, Material.NAME_TAG, Core.MESSAGE.parse("SCHEM_SELECTOR_FILTER_NAME", player), Collections.singletonList(Core.MESSAGE.parse("SCHEM_SELECTOR_FILTER_NAME_SEARCH", player, filter.getName())), true, nameCallback);
|
inv.setItem(0, Material.NAME_TAG, Core.MESSAGE.parse("SCHEM_SELECTOR_FILTER_NAME", player), Collections.singletonList(Core.MESSAGE.parse("SCHEM_SELECTOR_FILTER_NAME_SEARCH", player, filter.getName())), true, nameCallback);
|
||||||
@ -386,13 +386,13 @@ public class SchematicSelector {
|
|||||||
|
|
||||||
private boolean filter;
|
private boolean filter;
|
||||||
|
|
||||||
private String name = "";
|
private String name = null;
|
||||||
private Integer owner = null;
|
private Integer owner = null;
|
||||||
private SchematicType type = null;
|
private SchematicType type = null;
|
||||||
private Material item = null;
|
private Material item = null;
|
||||||
|
|
||||||
public void reset() {
|
public void reset() {
|
||||||
name = "";
|
name = null;
|
||||||
owner = null;
|
owner = null;
|
||||||
type = null;
|
type = null;
|
||||||
item = null;
|
item = null;
|
||||||
@ -401,7 +401,7 @@ public class SchematicSelector {
|
|||||||
|
|
||||||
public boolean matches(SchematicNode node) {
|
public boolean matches(SchematicNode node) {
|
||||||
boolean matches = true;
|
boolean matches = true;
|
||||||
if(!name.isEmpty() && !node.getName().contains(name)) {
|
if(name != null && !node.getName().contains(name)) {
|
||||||
matches = false;
|
matches = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren