forked from Upstream/CommandPanels
animated titles
set-data math fix tokenpaywall fix
This commit is contained in:
parent
64bc5f8f60
commit
2b354a62f7
25
.github/workflows/build.yml
vendored
Normal file
25
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
name: Java CI with Maven
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ latest ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
- name: Build with Maven
|
||||||
|
run: mvn clean package --file pom.xml
|
||||||
|
- name: Upload Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: CommandPanels-DEV
|
||||||
|
path: target/*.jar
|
5
pom.xml
5
pom.xml
@ -241,10 +241,5 @@
|
|||||||
<version>2.2.2-SNAPSHOT</version>
|
<version>2.2.2-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.rockyhawk64</groupId>
|
|
||||||
<artifactId>CommandPanels</artifactId>
|
|
||||||
<version>3.19.1.2</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
@ -83,6 +83,7 @@ public class CommandRunner {
|
|||||||
//do this on startup to load listeners
|
//do this on startup to load listeners
|
||||||
public void registerBuiltInTags() {
|
public void registerBuiltInTags() {
|
||||||
plugin.getServer().getPluginManager().registerEvents(new Paywall(plugin), plugin);
|
plugin.getServer().getPluginManager().registerEvents(new Paywall(plugin), plugin);
|
||||||
|
plugin.getServer().getPluginManager().registerEvents(new TokenPaywall(plugin), plugin);
|
||||||
plugin.getServer().getPluginManager().registerEvents(new ItemPaywall(plugin), plugin);
|
plugin.getServer().getPluginManager().registerEvents(new ItemPaywall(plugin), plugin);
|
||||||
plugin.getServer().getPluginManager().registerEvents(new Hasperm(plugin), plugin);
|
plugin.getServer().getPluginManager().registerEvents(new Hasperm(plugin), plugin);
|
||||||
plugin.getServer().getPluginManager().registerEvents(new XpPaywall(plugin), plugin);
|
plugin.getServer().getPluginManager().registerEvents(new XpPaywall(plugin), plugin);
|
||||||
|
@ -8,7 +8,6 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
public class PanelDataLoader {
|
public class PanelDataLoader {
|
||||||
CommandPanels plugin;
|
CommandPanels plugin;
|
||||||
@ -26,14 +25,6 @@ public class PanelDataLoader {
|
|||||||
if(!overwrite && dataConfig.isSet("playerData." + playerUUID + "." + dataPoint)){
|
if(!overwrite && dataConfig.isSet("playerData." + playerUUID + "." + dataPoint)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if string is numeric
|
|
||||||
Pattern pattern = Pattern.compile("-?\\d+(\\.\\d+)?");
|
|
||||||
if(pattern.matcher(dataValue).matches()){
|
|
||||||
doDataMath(playerUUID, dataPoint, dataValue);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
dataConfig.set("playerData." + playerUUID + "." + dataPoint, dataValue);
|
dataConfig.set("playerData." + playerUUID + "." + dataPoint, dataValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ public class OpenGUI {
|
|||||||
|
|
||||||
Inventory i;
|
Inventory i;
|
||||||
if(position == PanelPosition.Top) {
|
if(position == PanelPosition.Top) {
|
||||||
String title = getTitle(p, pconfig, panel, position);
|
String title = getTitle(p, pconfig, panel, position, animateValue);
|
||||||
|
|
||||||
if (isNumeric(pconfig.getString("rows"))) {
|
if (isNumeric(pconfig.getString("rows"))) {
|
||||||
i = Bukkit.createInventory(p, Integer.parseInt(pconfig.getString("rows")) * 9, title);
|
i = Bukkit.createInventory(p, Integer.parseInt(pconfig.getString("rows")) * 9, title);
|
||||||
@ -172,7 +172,7 @@ public class OpenGUI {
|
|||||||
(plugin.legacy.MAJOR_VERSION.greaterThanOrEqualTo(MinecraftVersions.v1_20) && plugin.legacy.MINOR_VERSION >= 5)){
|
(plugin.legacy.MAJOR_VERSION.greaterThanOrEqualTo(MinecraftVersions.v1_20) && plugin.legacy.MINOR_VERSION >= 5)){
|
||||||
//Title refresh ability added in 1.20.5 api
|
//Title refresh ability added in 1.20.5 api
|
||||||
if(position == PanelPosition.Top) {
|
if(position == PanelPosition.Top) {
|
||||||
p.getOpenInventory().setTitle(getTitle(p, pconfig, panel, position));
|
p.getOpenInventory().setTitle(getTitle(p, pconfig, panel, position, animateValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(position == PanelPosition.Top) {
|
if(position == PanelPosition.Top) {
|
||||||
@ -220,11 +220,17 @@ public class OpenGUI {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getTitle(Player p, ConfigurationSection pconfig, Panel panel, PanelPosition position){
|
private String getTitle(Player p, ConfigurationSection pconfig, Panel panel, PanelPosition position, Integer animateValue){
|
||||||
String title;
|
String title;
|
||||||
if(pconfig.contains("custom-title")) {
|
if(pconfig.contains("custom-title")) {
|
||||||
//used for titles in the custom-title section, for has sections
|
//used for titles in the custom-title section, for has sections
|
||||||
String section = plugin.has.hasSection(panel,position,pconfig.getConfigurationSection("custom-title"), p);
|
String section = plugin.has.hasSection(panel,position,pconfig.getConfigurationSection("custom-title"), p);
|
||||||
|
|
||||||
|
//check for if there is animations inside the custom-title section
|
||||||
|
if (pconfig.contains("custom-title" + section + ".animate" + animateValue)) {
|
||||||
|
section = section + ".animate" + animateValue;
|
||||||
|
}
|
||||||
|
|
||||||
title = plugin.tex.placeholders(panel, position, p, pconfig.getString("custom-title" + section + ".title"));
|
title = plugin.tex.placeholders(panel, position, p, pconfig.getString("custom-title" + section + ".title"));
|
||||||
}else {
|
}else {
|
||||||
//regular inventory title
|
//regular inventory title
|
||||||
|
Loading…
Reference in New Issue
Block a user