forked from Upstream/CommandPanels
3.18.4.0
This commit is contained in:
parent
f3744a2bf7
commit
24e1b3b6e4
@ -1,9 +0,0 @@
|
|||||||
<component name="libraryTable">
|
|
||||||
<library name="spigot-api-1.19-R0.1-SNAPSHOT">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$PROJECT_DIR$/../../../Intellij Plugin Testers/Plugin Tester 1.19.2/bundler/libraries/spigot-api-1.19-R0.1-SNAPSHOT.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</component>
|
|
9
.idea/libraries/spigot_api_1_19_R0_1_SNAPSHOT1.xml
Normal file
9
.idea/libraries/spigot_api_1_19_R0_1_SNAPSHOT1.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="spigot-api-1.19-R0.1-SNAPSHOT1">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$PROJECT_DIR$/../../MC Test Server/bundler/libraries/spigot-api-1.19-R0.1-SNAPSHOT.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</component>
|
@ -7,7 +7,7 @@
|
|||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="temurin-1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -10,7 +10,7 @@
|
|||||||
<sourceFolder url="file://$MODULE_DIR$/resource_example" type="java-resource" />
|
<sourceFolder url="file://$MODULE_DIR$/resource_example" type="java-resource" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="temurin-1.8" jdkType="JavaSDK" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" name="HeadDatabaseAPI" level="project" />
|
<orderEntry type="library" name="HeadDatabaseAPI" level="project" />
|
||||||
<orderEntry type="library" name="TokenManager-3.2.4" level="project" />
|
<orderEntry type="library" name="TokenManager-3.2.4" level="project" />
|
||||||
@ -25,7 +25,7 @@
|
|||||||
<orderEntry type="library" name="spigot-1.13.2" level="project" />
|
<orderEntry type="library" name="spigot-1.13.2" level="project" />
|
||||||
<orderEntry type="library" name="spigot" level="project" />
|
<orderEntry type="library" name="spigot" level="project" />
|
||||||
<orderEntry type="library" name="CoinsAPI 1.8.9" level="project" />
|
<orderEntry type="library" name="CoinsAPI 1.8.9" level="project" />
|
||||||
<orderEntry type="library" name="spigot-api-1.19-R0.1-SNAPSHOT" level="project" />
|
<orderEntry type="library" name="spigot-api-1.19-R0.1-SNAPSHOT1" level="project" />
|
||||||
<orderEntry type="library" name="Maven: net.kyori:adventure-text-minimessage:4.11.0" level="project" />
|
<orderEntry type="library" name="Maven: net.kyori:adventure-text-minimessage:4.11.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: net.kyori:adventure-api:4.11.0" level="project" />
|
<orderEntry type="library" name="Maven: net.kyori:adventure-api:4.11.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: net.kyori:adventure-key:4.11.0" level="project" />
|
<orderEntry type="library" name="Maven: net.kyori:adventure-key:4.11.0" level="project" />
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
version: 3.18.3.0
|
version: 3.18.4.0
|
||||||
main: me.rockyhawk.commandpanels.CommandPanels
|
main: me.rockyhawk.commandpanels.CommandPanels
|
||||||
name: CommandPanels
|
name: CommandPanels
|
||||||
author: RockyHawk
|
author: RockyHawk
|
||||||
|
@ -24,12 +24,6 @@ public class HasSections {
|
|||||||
String setName;
|
String setName;
|
||||||
if(cf.isSet("has" + count)) {
|
if(cf.isSet("has" + count)) {
|
||||||
setName = "has" + count;
|
setName = "has" + count;
|
||||||
}else if(cf.isSet("hasperm" + count)) {
|
|
||||||
setName = "hasperm" + count;
|
|
||||||
}else if(cf.isSet("hasvalue" + count)) {
|
|
||||||
setName = "hasvalue" + count;
|
|
||||||
}else if(cf.isSet("hasgreater" + count)) {
|
|
||||||
setName = "hasgreater" + count;
|
|
||||||
}else{
|
}else{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -114,7 +108,7 @@ public class HasSections {
|
|||||||
if(setName.startsWith("hasgreater")) {
|
if(setName.startsWith("hasgreater")) {
|
||||||
return (Long.parseLong(compare) >= Long.parseLong(value)) == outputValue;
|
return (Long.parseLong(compare) >= Long.parseLong(value)) == outputValue;
|
||||||
}
|
}
|
||||||
//the current has section with all of the functions implemented inside it
|
//the current has section with all the functions implemented inside it
|
||||||
if(setName.startsWith("has")) {
|
if(setName.startsWith("has")) {
|
||||||
if(value.endsWith(" HASPERM")) {
|
if(value.endsWith(" HASPERM")) {
|
||||||
return Bukkit.getPlayer(value.substring(0, value.length()-8)).hasPermission(compare) == outputValue;
|
return Bukkit.getPlayer(value.substring(0, value.length()-8)).hasPermission(compare) == outputValue;
|
||||||
|
@ -285,9 +285,9 @@ public class ItemCreation {
|
|||||||
BannerMeta bannerMeta = (BannerMeta) s.getItemMeta();
|
BannerMeta bannerMeta = (BannerMeta) s.getItemMeta();
|
||||||
List<Pattern> patterns = new ArrayList<>(); //Load patterns in order top to bottom
|
List<Pattern> patterns = new ArrayList<>(); //Load patterns in order top to bottom
|
||||||
for (String temp : itemSection.getStringList("banner")) {
|
for (String temp : itemSection.getStringList("banner")) {
|
||||||
temp = plugin.tex.placeholders(panel,position,p,temp);
|
temp = plugin.tex.placeholdersNoColour(panel,position,p,temp);
|
||||||
String[] dyePattern = temp.split(",");
|
String[] dyePattern = temp.split(",");
|
||||||
patterns.add(new Pattern(DyeColor.valueOf(dyePattern[0]), PatternType.valueOf(dyePattern[1]))); //load patterns in config: RED:STRIPE_TOP
|
patterns.add(new Pattern(DyeColor.valueOf(dyePattern[0]), PatternType.valueOf(dyePattern[1]))); //load patterns in config: RED,STRIPE_TOP
|
||||||
}
|
}
|
||||||
bannerMeta.setPatterns(patterns);
|
bannerMeta.setPatterns(patterns);
|
||||||
bannerMeta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
|
bannerMeta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
|
||||||
|
@ -18,6 +18,7 @@ import java.net.Socket;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class Placeholders {
|
public class Placeholders {
|
||||||
CommandPanels plugin;
|
CommandPanels plugin;
|
||||||
@ -96,7 +97,8 @@ public class Placeholders {
|
|||||||
case("online-players"): {
|
case("online-players"): {
|
||||||
return Integer.toString(Bukkit.getServer().getOnlinePlayers().size());
|
return Integer.toString(Bukkit.getServer().getOnlinePlayers().size());
|
||||||
}
|
}
|
||||||
case("online-players-true"): {
|
case("online-players-visible"): {
|
||||||
|
//will filter out players with metadata 'vanished'
|
||||||
return Integer.toString(Bukkit.getOnlinePlayers().stream().filter(player -> !player.getMetadata("vanished").get(0).asBoolean()).collect(Collectors.toList()).size());
|
return Integer.toString(Bukkit.getOnlinePlayers().stream().filter(player -> !player.getMetadata("vanished").get(0).asBoolean()).collect(Collectors.toList()).size());
|
||||||
}
|
}
|
||||||
case("panel-position"): {
|
case("panel-position"): {
|
||||||
@ -326,22 +328,17 @@ public class Placeholders {
|
|||||||
//checks for players online
|
//checks for players online
|
||||||
if(identifier.startsWith("player-online-")) {
|
if(identifier.startsWith("player-online-")) {
|
||||||
try {
|
try {
|
||||||
if (identifier.endsWith("-true")){
|
String playerLocation = identifier.replace("player-online-", "");
|
||||||
String playerLocation = identifier.replace("player-online-", "");
|
Player[] playerFind;
|
||||||
Player[] playerFind = Bukkit.getOnlinePlayers().toArray(new Player[Bukkit.getOnlinePlayers().stream().filter(player -> !player.getMetadata("vanished").get(0).asBoolean()).collect(Collectors.toList()).size()]);
|
if (identifier.endsWith("-visible")){
|
||||||
if (Double.parseDouble(playerLocation) > playerFind.length) {
|
playerFind = Bukkit.getOnlinePlayers().toArray(new Player[Bukkit.getOnlinePlayers().stream().filter(player -> !player.getMetadata("vanished").get(0).asBoolean()).collect(Collectors.toList()).size()]);
|
||||||
return plugin.tex.colour(Objects.requireNonNull(plugin.config.getString("config.format.offline")));
|
|
||||||
} else {
|
|
||||||
return playerFind[(int)(Double.parseDouble(playerLocation) - 1)].getName();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
String playerLocation = identifier.replace("player-online-", "");
|
playerFind = Bukkit.getOnlinePlayers().toArray(new Player[Bukkit.getOnlinePlayers().size()]);
|
||||||
Player[] playerFind = Bukkit.getOnlinePlayers().toArray(new Player[Bukkit.getOnlinePlayers().size()]);
|
}
|
||||||
if (Double.parseDouble(playerLocation) > playerFind.length) {
|
if (Double.parseDouble(playerLocation) > playerFind.length) {
|
||||||
return plugin.tex.colour(Objects.requireNonNull(plugin.config.getString("config.format.offline")));
|
return plugin.tex.colour(Objects.requireNonNull(plugin.config.getString("config.format.offline")));
|
||||||
} else {
|
} else {
|
||||||
return playerFind[(int)(Double.parseDouble(playerLocation) - 1)].getName();
|
return playerFind[(int)(Double.parseDouble(playerLocation) - 1)].getName();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}catch (Exception ex){
|
}catch (Exception ex){
|
||||||
plugin.debug(ex,p);
|
plugin.debug(ex,p);
|
||||||
|
@ -29,8 +29,14 @@ public class OpenGUI {
|
|||||||
if(position == PanelPosition.Top) {
|
if(position == PanelPosition.Top) {
|
||||||
String title;
|
String title;
|
||||||
if (openType != PanelOpenType.Editor) {
|
if (openType != PanelOpenType.Editor) {
|
||||||
//regular inventory
|
if(pconfig.contains("custom-title")) {
|
||||||
title = plugin.tex.placeholders(panel, position, p, pconfig.getString("title"));
|
//used for titles in the custom-title section, for has sections
|
||||||
|
String section = plugin.has.hasSection(panel,position,pconfig.getConfigurationSection("custom-title"), p);
|
||||||
|
title = plugin.tex.placeholders(panel, position, p, pconfig.getString("custom-title" + section + ".title"));
|
||||||
|
}else {
|
||||||
|
//regular inventory title
|
||||||
|
title = plugin.tex.placeholders(panel, position, p, pconfig.getString("title"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//editor inventory
|
//editor inventory
|
||||||
title = "Editing Panel: " + panel.getName();
|
title = "Editing Panel: " + panel.getName();
|
||||||
|
Loading…
Reference in New Issue
Block a user