Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bleeding branch v3.3.0 alpha.17a #263

Merged
merged 21 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cf0b4c9
Economy: EdPrison's economy. Added support for use of EdPrison's econ…
rbluer Apr 22, 2024
51acf96
Economy: EdPrison's economy. Added support for use of EdPrison's econ…
rbluer Apr 24, 2024
23674a6
Update privatebin-java-api to a newer release that now does a better …
rbluer Apr 26, 2024
79e573b
Update privatebin-java-api to a newer release that now does a better …
rbluer Apr 26, 2024
dc4ef6f
RankPlayer and topn ranking: This may not have an impact overall, but…
rbluer Apr 26, 2024
c8ac93c
GUI Player ranks: The setting for Options.Ranks.MaterialType.NoRankAc…
rbluer Apr 26, 2024
036a178
Economies: fixed the display of too many economy related messages, in…
rbluer Apr 28, 2024
06eeec3
Update to plugin.yml since some soft dependencies were missing.
rbluer Apr 28, 2024
1d46816
GUI: Player ranks: Fixed a bug where clicking on a rank in the player…
rbluer Apr 28, 2024
70df9ef
GUI: tool bar's prior page and next page: Suppress the page buttons i…
rbluer Apr 28, 2024
a4a9227
GUI: ranks and mines: setup and enable a new default access block typ…
rbluer Apr 28, 2024
5d183cb
Placeholders: bug fix: When using a search from the console which inc…
rbluer Apr 28, 2024
638b3d9
Auto features: Inventory full chat notification: bug fix. This fixes…
rbluer Apr 28, 2024
a272d70
Auto features: normal drop processing: Added a new feature to check i…
rbluer Apr 28, 2024
3991806
XSeries XMaterials: Update to XSeries v9.10.0 from v9.9.0.
rbluer Apr 28, 2024
f226e0a
CustomItems: Fixed an issue when CustomItems is a plugin on the serve…
rbluer Apr 28, 2024
dc2d0e7
Update the plugin.yml and removed the permissions configs since they …
rbluer Apr 28, 2024
7557b13
Initial setup of the GUI tools messages that are at the bottom of a p…
rbluer Apr 29, 2024
d92f929
GUI Tools messages: refined the messages and hooked them up.
rbluer Apr 29, 2024
ef2cf06
GUI settings: Update them to remove unused stuff.
rbluer Apr 29, 2024
c0127e5
v3.3.0-alpha.17a 2024-04-29
rbluer Apr 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
71 changes: 70 additions & 1 deletion docs/changelog_v3.3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,82 @@
These change logs represent the work that has been going on within prison.


# 3.3.0-alpha.17 2024-04-20
# 3.3.0-alpha.17a 2024-04-29



**v3.3.0-alpha.17a 2024-04-29**


* **GUI settings: Update them to remove unused stuff.**


* **GUI Tools messages: refined the messages and hooked them up.**


* **Initial setup of the GUI tools messages that are at the bottom of a page.**
Setup the handling of the messages and added the messages to all of the language files.
Support for prior, current, and next page. Also close.


* **Update the plugin.yml and removed the permissions configs since they were generating errors (lack of a schema) and the perms and handled through the prison command handler.**



* **CustomItems: Fixed an issue when CustomItems is a plugin on the server, but the plugin fails to load.**
Therefore the problem was fixed to allow a failed CustomItems loading to bypass being setup and loaded for prison.
`CustomItems.isEnabled()` must exist and return a value of true before the integration is enabled.


* **XSeries XMaterials: Update to XSeries v9.10.0 from v9.9.0.**
Had issues with case sensitivity when using `valueOf()`, which was changed to `matchXMaterial().orElse(null)` which resolves a few issues.
XMaterials v9.10.0 sets up support for spigot 1.20.5. There may be more changes as spigot stabilizes.
The issue with using `valueOf("green_wool")` would not find any matches since the enum case must match the string value exactly. So `valueOf("GREEN_WOOL")` would have worked. This was fixed to help eliminate possible issues with configuring the server.


* **Auto features: normal drop processing: Added a new feature to check inventory for being full, and if it is, then display the messages.**



* **Auto features: Inventory full chat notification: bug fix. This fixes using the wrong player object.**
It now use prison's player object so the color codes are properly translated.


* **Placeholders: bug fix: When using a search from the console which included a player name, it was generating an invalid cast to a SpigotPlayer object when it wasn't related to that class due to the player being offline.**


* **GUI: ranks and mines: setup and enable a new default access block type that can be used if that rank or mine has not been specifically specified.**


* **GUI: tool bar's prior page and next page: Suppress the page buttons if there is only one page worth of gui content. **


* **GUI: Player ranks: Fixed a bug where clicking on a rank in the player's gui was trying to run an empty command, which was generating an invalid command error.**
Ignores the command running if the command is either null or blank.



* **Update to plugin.yml since some soft dependencies were missing.**


* **Economies: fixed the display of too many economy related messages, including eliminating logging of messages for offline players.**
The vault economy check for offline players, will now only show one informational message if a player is not setup in the economy.


* **GUI Player ranks: The setting for Options.Ranks.MaterialType.NoRankAccess was not hooked up properly so it was not really working.**
The config creation was wrong. Also fixed the code that was generating the gui.


* **RankPlayer and topn ranking: This may not have an impact overall, but for both the default and prestiges ladders, they are defaulting to a value of -1 when performing a comparison between players.**


* **Update privatebin-java-api to a newer release that now does a better job with a failure to use the correct protocol.**
It identifies what TLS version is being used, and if TLSv1.3 is missing, then it will indicate that the java version needs to be updated.
As a fallback, if the privatebin cannot be used, it is now using the older paste.helpch.at service. But if it does, the resulting documents are not purged and not encrypted.


* **Economy: EdPrison's economy. Added support for use of EdPrison's economy and custom currencies.**
This will allow prison to use EdPrison's economy does not also use another established economy that is accessible through vault, or multi-currency.



Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## # This is actually the "correct" place to define the version for the project.
## # Used within build.gradle with ${project.version}.
## # Can be overridden on the command line: gradle -Pversion=3.2.1-alpha.3
version=3.3.0-alpha.17
version=3.3.0-alpha.17a



Expand Down
2 changes: 1 addition & 1 deletion gradlew8.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
./gradlew build -Dorg.gradle.java.home="C:\Program Files\Java\jdk1.8.0_321" --stacktrace %*
./gradlew build -Dorg.gradle.java.home="C:\Program Files\Java\jdk-1.8_411" --stacktrace %*
2 changes: 1 addition & 1 deletion prison-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies {
//implementation 'org.json:json:20230227'

implementation fileTree(dir: 'lib',
include: ['privatebin-java-api-1.0.2.jar',
include: ['PrivateBin-java-1.1-SNAPSHOT.jar',
'json-20230227.jar'])

}
Expand Down
Binary file added prison-core/lib/PrivateBin-java-1.1-SNAPSHOT.jar
Binary file not shown.
Binary file removed prison-core/lib/privatebin-java-api-1.0.2.jar
Binary file not shown.
11 changes: 11 additions & 0 deletions prison-core/src/main/java/tech/mcprison/prison/PrisonCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,17 @@ public void autoFeaturesInformation(CommandSender sender) {
afw.isBoolean( AutoFeatures.autoBlockEnabled ));


display.addText( "&b " );
display.addText( "&b options.normalDrop.handleNormalDropsEvents %s",
afw.isBoolean( AutoFeatures.handleNormalDropsEvents ));
display.addText( "&b options.normalDrop.normalDropSmelt %s",
afw.isBoolean( AutoFeatures.normalDropSmelt ));
display.addText( "&b options.normalDrop.normalDropSmelt %s",
afw.isBoolean( AutoFeatures.normalDropSmelt ));
display.addText( "&b options.normalDrop.normalDropCheckForFullInventory %s",
afw.isBoolean( AutoFeatures.normalDropCheckForFullInventory ));



display.addText( "&b " );
display.addText( "&b options.general.isCalculateDurabilityEnabled %s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ public enum AutoFeatures {
handleNormalDropsEvents(normalDrop, true),
normalDropSmelt(normalDrop, true),
normalDropBlock(normalDrop, true),
normalDropCheckForFullInventory(normalDrop, false),



durability(options),
Expand Down Expand Up @@ -1189,6 +1191,9 @@ public TreeMap<String, String> getBstatsDetails() {

bStatsDetailBoolean( AutoFeatures.normalDropSmelt, tm );
bStatsDetailBoolean( AutoFeatures.normalDropBlock, tm );

bStatsDetailBoolean( AutoFeatures.normalDropCheckForFullInventory, tm );

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ public PrisonPasteChat( String supportName, TreeMap<String, String> supportURLs
}

public String post( String text ) {
return post( text, false, false );
String results = post( text, false, false );

if ( results == null ) {
results = postFailureBackup( text, false, false );
}

return results;
}

/**
Expand All @@ -98,11 +104,18 @@ public String post( String text ) {
* @return
*/
public String postKeepColorCodes( String text ) {
return post( text, false, true );
String results = post( text, false, true );

if ( results == null ) {
results = postFailureBackup( text, false, true );
}

return results;
}

public String post( String text, boolean raw, boolean keepColorCodes ) {
private String post( String text, boolean raw, boolean keepColorCodes ) {
String results = null;
String src = "privateBin";

try {

Expand All @@ -113,14 +126,17 @@ public String post( String text, boolean raw, boolean keepColorCodes ) {
String service = Prison.get().getPlatform()
.getConfigString( "prison-support.submit-service", "PRIVATEBIN-NET" );


switch ( service ) {
case "PRIVATEBIN-NET":

src = "privateBin";
results = postPrivateBin( cleanedText, raw );
break;

case "PASTE-HELPCHAT":

src = "paste.helpch.at";
results = postPasteHelpchAt( cleanedText, raw );
break;

Expand All @@ -130,7 +146,36 @@ public String post( String text, boolean raw, boolean keepColorCodes ) {

}
catch (Exception e) {
Output.get().logInfo( "PrisonPasteChat: Failed to paste to paste.helpch.at. " +
Output.get().logInfo( "PrisonPasteChat: Failed to paste to " + src + ". " +
"You'll have to manually paste the data. [%s]", e.getMessage() );
}

return results;
}

/**
* This will "force" the use of the paste.helpch.at service if the privatebin fails.
*
* @param text
* @param raw
* @param keepColorCodes
* @return
*/
private String postFailureBackup( String text, boolean raw, boolean keepColorCodes ) {
String results = null;

try {

String cleanedText = cleanText( text, keepColorCodes );

cleanedText = addHeaders( cleanedText );

results = postPasteHelpchAt( cleanedText, raw );

}
catch (Exception e) {
Output.get().logInfo( "PrisonPasteChat: postFailureBackup: "
+ "Failed to paste to paste.helpch.at. " +
"You'll have to manually paste the data. [%s]", e.getMessage() );
}

Expand Down Expand Up @@ -247,6 +292,7 @@ private String postPrivateBin( String text, boolean raw )
.setExpire( getExpire( expire ) )
.setPasteFormat( PasteFormat.PLAINTEXT )
.setUserPassword( password )
// .setCompression( Compression.GZIP)
// .removeIps()
.encrypt();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,85 @@ protected String guiPagePriorMsg() {
.getLocalizable( "core_gui__page_prior" )
.localize();
}

protected String guiPageToolsCloseMsg() {

return Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_close" )
.localize();
}
protected String guiPageToolsGoBackMsg() {

return Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_go_back" )
.localize();
}
private String formmatPageToolsPlaceholders( String msg, int currentPage, int maxPage ) {

if ( maxPage < 1 ) {
maxPage = 1;
}
int priorPage = currentPage == 1 ? 1 : currentPage - 1;
int nextPage = currentPage == maxPage ? maxPage : currentPage + 1;

msg = msg.replace("{first_page}", "1" )
.replace("{prior_page}", Integer.toString(priorPage) )
.replace("{current_page}", Integer.toString(currentPage))
.replace("{next_page}", Integer.toString(nextPage))
.replace("{last_page}", Integer.toString(maxPage))
;

return msg;
}
protected String guiPageToolsCloseMsg( int currentPage, int maxPage ) {

String msg = Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_close" )
.localize();

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}
protected String guiPageToolsFirstPageMsg( int currentPage, int maxPage ) {

String msg = Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_first_page" )
.localize();

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}
protected String guiPageToolsPriorPageMsg( int currentPage, int maxPage ) {

String msg = Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_prior_page" )
.localize();

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}
protected String guiPageToolsCurrentPageMsg( int currentPage, int maxPage ) {

String msg = Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_current_page" )
.localize();

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}
protected String guiPageToolsNextPageMsg( int currentPage, int maxPage ) {

String msg = Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_next_page" )
.localize();

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}
protected String guiPageToolsLastPageMsg( int currentPage, int maxPage ) {

String msg = Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_last_page" )
.localize();

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}



protected String guiPriceMsg( Double price ) {
Expand Down