Skip to content

Commit

Permalink
Merge pull request #263 from PrisonTeam/bleeding_branch_v3.3.0-alpha.17a
Browse files Browse the repository at this point in the history
Bleeding branch v3.3.0 alpha.17a
  • Loading branch information
rbluer authored Apr 29, 2024
2 parents 67d8e7e + c0127e5 commit a70c103
Show file tree
Hide file tree
Showing 45 changed files with 1,184 additions and 251 deletions.
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
Loading

0 comments on commit a70c103

Please sign in to comment.