Skip to content

Commit

Permalink
Merge pull request #262 from PrisonTeam/bleeding_branch_v3.3.0-alpha.17
Browse files Browse the repository at this point in the history
Bleeding branch v3.3.0 alpha.17
  • Loading branch information
rbluer committed Apr 29, 2024
2 parents bad1112 + e499773 commit 67d8e7e
Show file tree
Hide file tree
Showing 126 changed files with 7,167 additions and 1,121 deletions.
334 changes: 332 additions & 2 deletions docs/changelog_v3.3.x.md

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions docs/knownissues_v3.3.x.md
Expand Up @@ -13,6 +13,14 @@ Resolved issues have been relocated to:
* [Known Issues - Resolved](knownissues_v3.2.x_resolved.md)


# TODO Items for v3.3.0-alpha.16


DONE: Added support for BlockPlaceEvent to allow this - editid - Mine bombs cannot be placed in a mine that is protected by world guard, which is
reporting that the player does not have access. Had to allow players to place blocks in
mines, which is not appropriate.


# TODO Items for v3.3.0-alpha.15


Expand Down
6 changes: 3 additions & 3 deletions docs/prison_changelog_v3.3.0-alpha.16.md
Expand Up @@ -23,13 +23,13 @@ The following is a highlight of changes for the alpha.16 release since the alpha
* Auto Features: Many updates and enhancements.


* Sellall: Many updates and enhancements from API to GUI and autofeatures integration.
* Sellall: Many updates and enhancements from API to GUI and auto features integration.
- Streamlined to work with prison's custom blocks instead of just XMaterial items.
- New functionality to improve managing what's been sold, or just getting their value. Extended a lot of this new functionality to the prison APIs.
- Added many new default items
- Changed all of the commands under sellall to better organize like commands in to sub-commands
- Rank multipliers now works for all ranks, not just prestiges. New commands to reset all multipliers for ladders (which is great if you have a few thousand prestige ranks).
- If blocks could not be sold through auto features autosell, it will generate debug mmessages so it's easier to track why blocks are not being sold.
- If blocks could not be sold through auto features autosell, it will generate debug messages so it's easier to track why blocks are not being sold.
- Able to disable the "nothing to sell" message so it stops spamming the player.
- For different server configs, where there are issues that prevent autosell from being used, such as other plugins placing blocks in the player's inventory, you can now force a sellall after the block break event is finished being processed.
- Sellall Multipliers - Many new features and commands. Explore with `/sellall multiplier` and use the keyword `help` on each command for more details. The multiplier list can use different column widths to better support thousands of prestige ranks.
Expand Down Expand Up @@ -64,7 +64,7 @@ The following is a highlight of changes for the alpha.16 release since the alpha


* Mines -
- Mine tracer now has an option to 'clear' the whole mine, mark jjust the 'corners', or the standard full tracer.
- Mine tracer now has an option to 'clear' the whole mine, mark just the 'corners', or the standard full tracer.
- Found and fixed a sync task that was a possible cause of jitters. This helps when the server is under a heavy load.
- Added a `/mtop` command. `/mines top` which teleports a player to the top of the mine they are in.

Expand Down
1 change: 1 addition & 0 deletions docs/prison_changelogs.md
Expand Up @@ -22,6 +22,7 @@ These build logs represent the work that has been going on within prison.
- Future updates will be under the v3.3.x release


- [v3.3.3-alpha.17 - 2024-04-20](prison_changelog_v3.3.0-alpha.17.md)  
- [v3.3.3-alpha.16 - 2023-11-18](prison_changelog_v3.3.0-alpha.16.md)  
- [v3.3.3-alpha.15 - 2023-07-07](prison_changelog_v3.3.0-alpha.15.md)  
- [v3.3.3-alpha.14 - 2023-01-23](prison_changelog_v3.3.0-alpha.14.md)  
Expand Down
655 changes: 655 additions & 0 deletions docs/prison_chnagelog_v3.3.0-alpha.17.md

Large diffs are not rendered by default.

32 changes: 31 additions & 1 deletion docs/prison_docs_101_setting_up_mines.md
Expand Up @@ -6,7 +6,7 @@

This document provides some highlights to how to setup mines. It is a work in progress so check back for more information.

*Documented updated: 2023-01-13*
*Documented updated: 2024-03-11*

<hr style="height:1px; border:none; color:#aaf; background-color:#aaf;">

Expand All @@ -22,6 +22,12 @@ Prison has a list of suggested plugins that works well with Prison, and a few th
[Setting up Prison - The Basics](prison_docs_012_setting_up_prison_basics.md)


**New Command:**

`/mines block layerStats help`
This new command will provide a layer by layer inspection of what blocks were assigned to a mine, versus what is actually in the mine currently. This is useful when confirming block constraints are working correctly, or if another block was not spawning as expected, such that there is too much AIR.



Items to add to this document:
* Use of ***/mines backup help** this command will make an individual backup of a mine's config settings on the server's file system. This backup can manually be used to rollback any changes to a mine. Prison has a command **/prison support backup help** that will make a backup of all files within the server directory **plugins/Prison/**, of which it will include all mine backup files, then remove them from file system. Contact support on our discord server for help.
Expand Down Expand Up @@ -353,6 +359,30 @@ Example of a mine reset including a sealantern. Notice that there is still 19.5



<hr style="height:1px; border:none; color:#aaf; background-color:#aaf;">


# Allowing Players to place blocks in mines

Normally, players are not allowed to place blocks in mines. Prison will identify that the blocks placed by players were not placed by Prison during the last mine reset, and therefore will fast-fail and ignore that block.

By default though, prison will cancel the event, no matter what setting you have for general events, such as cancel events, or canceling the drops.

To override this behavior, so players can actually break blocks within mines, you need to change the autoFeaturesConfig.yml file's setting:

`ifBlockIsAlreadyCountedThenCancelEvent: false`

You can then reload the settings without restarting the server:
`/prison reload autoFeatures`


By default, this setting is set to "true" so older installs of Prison will not break when they upgrade to a version that supports this feature.

Just because prison is now ignoring the block break, this does not mean the player can break the block. This technically means that prison is doing nothing with it; not even canceling the event. So other plugins will be allowed to process the block. For example, WorldGuard may reject the player's access and prevent block breakage, and then WorldGuard will cancel the event.

To address this issue, you would need to setup a WorldGuard region covering the whole mine, and then allowing the players to break blocks within the mine. This will allow the block to pass through to other plugins. If not other plugin does anything with the block, then bukkit will break the block normally at the end of handling the BlockBreakEvent.


<hr style="height:1px; border:none; color:#aaf; background-color:#aaf;">


Expand Down
9 changes: 9 additions & 0 deletions docs/prison_docs_111_mine_commands.md
Expand Up @@ -6,6 +6,7 @@

This document provides information how to setup and use Mine Commands.

*Documented updated: 2024-03-11*

<hr style="height:1px; border:none; color:#aaf; background-color:#aaf;">

Expand All @@ -21,6 +22,14 @@ My personal goals to use this new feature was to dynamically build a large fores
- Blue



**New Command:**

`/mines block layerStats help`
This new command will provide a layer by layer inspection of what blocks were assigned to a mine, versus what is actually in the mine currently. This is useful when confirming block constraints are working correctly, or if another block was not spawning as expected, such that there is too much AIR.



<hr style="height:1px; border:none; color:#aaf; background-color:#aaf;">


Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
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.16
version=3.3.0-alpha.17



Expand Down
2 changes: 2 additions & 0 deletions prison-core/build.gradle
Expand Up @@ -32,6 +32,8 @@ repositories {
dependencies {
implementation 'org.apache.commons:commons-lang3:3.12.0'


// https://github.com/InstantlyMoist/privatebin-java-api
//implementation 'com.github.InstantlyMoist:privatebin-java-api:1.0.2'

//implementation 'org.json:json:20230227'
Expand Down
41 changes: 36 additions & 5 deletions prison-core/src/main/java/tech/mcprison/prison/Prison.java
Expand Up @@ -213,7 +213,13 @@ public LocaleManager getLocaleManager() {

if ( this.localeManager == null ) {

this.localeManager = new LocaleManager(this, "lang/core");
synchronized ( this ) {
if ( this.localeManager == null ) {

this.localeManager = new LocaleManager(this, "lang/core");
}
}

}
return localeManager;
}
Expand All @@ -228,7 +234,13 @@ public LocaleManager getLocaleManager() {
public File getModuleDataFolder() {

if ( moduleDataFolder == null ) {
this.moduleDataFolder = Module.setupModuleDataFolder( "core" );
if ( this.localeManager == null ) {
if ( moduleDataFolder == null ) {

this.moduleDataFolder = Module.setupModuleDataFolder( "core" );

}
}
}
return moduleDataFolder;
}
Expand All @@ -237,18 +249,37 @@ public void setupJUnitInstance( Platform platform ) {
this.platform = platform;
}




/**
* Initializes prison-core. In the implementations, this should be called when the plugin is
* enabled. After this is called, every getter in this class will return a value.
* <p>
* Note that modules <b>should not call this method</b>. This is solely for the implementations.
*/
public void init(Platform platform, String minecraftVersion ) {
long startTime = System.currentTimeMillis();


this.platform = platform;
this.minecraftVersion = minecraftVersion;

}


/**
* Initializes prison-core. In the implementations, this should be called when the plugin is
* enabled. After this is called, every getter in this class will return a value.
* <p>
* Note that modules <b>should not call this method</b>. This is solely for the implementations.
*/
public boolean init(Platform platform, String minecraftVersion, File dataFolder ) {
public boolean init( File dataFolder ) {
long startTime = System.currentTimeMillis();


this.platform = platform;
this.minecraftVersion = minecraftVersion;
// this.platform = platform;
// this.minecraftVersion = minecraftVersion;

this.dataFolder = dataFolder;

Expand Down
21 changes: 18 additions & 3 deletions prison-core/src/main/java/tech/mcprison/prison/PrisonCommand.java
Expand Up @@ -1126,7 +1126,7 @@ public void toggleDebug(CommandSender sender,
@Arg(name = "targets", def = " ",
description = "Optional. Enable or disable a debugging target, or set a count down timer. " +
"[on, off, targets, (count-down-timer), selective, jarScan, " +
"testPlayerUtil, testLocale, rankup, player=<playerName> ] " +
"testPlayerUtil, testLocale, rankup, blockConstraints, player=<playerName> ] " +
"Use 'targets' to list all available targets. Use 'on' or 'off' to toggle " +
"on and off individual targets, or 'all' targets if no target is specified. " +
"If any targets are enabled, then debug in general will be enabled. Selective will only " +
Expand Down Expand Up @@ -1535,7 +1535,21 @@ public void supportSubmitVersion(CommandSender sender

PrisonPasteChat pasteChat = new PrisonPasteChat( getSupportName(), getSupportURLs() );

String helpURL = pasteChat.post( text.toString() );
String helpURL = "(Failure in running the commmand.)";

try {
helpURL = pasteChat.post( text.toString() );
}
catch (Exception e) {
Output.get().logRaw(

String.format(
"Failed to paste support info to the support server: %s "
+ "raw message: [%s]",
e.getMessage(),
text.toString()
) );
}

getSupportURLs().put( "Submit version:", helpURL );

Expand Down Expand Up @@ -2019,7 +2033,8 @@ public void supportListenersDump(CommandSender sender,
description = "Provides a detailed list of all registered event listeners for" +
"the various event types. BlockBreak listeners will include all " +
"listeners that are being monitored within auto features. " +
"[all, blockBreak, chat, playerInteract]"
"[all, blockBreak, blockPlace, chat, playerDropItem, "
+ "playerPickupItem, playerInteract]"
) String listener
) {

Expand Down
Expand Up @@ -262,6 +262,13 @@ public enum AutoFeatures {
permissionAutoSmelt(permissions, "prison.automanager.smelt"),
permissionAutoBlock(permissions, "prison.automanager.block"),

permissionAuto__readme(permissions, "If permmissions are enabled, of which they are by default, " +
"and 'isAutoFeaturesEnabled' is enabled, then all OPs will automatically " +
"enable auto pickup, auto smelt, and auto block because bukkit will always " +
"test 'true' for any permmission when OP'd. There is no way around this, " +
"other than just turning off these perms, which is not advisable because " +
"players should not be playing as OP'd. To disable these perms, then " +
"use a value of 'disable'."),

lore(options),

Expand Down
Expand Up @@ -203,6 +203,12 @@ public class MineBombData {



/**
*
*/
private boolean applyToPlayersBlockCount = true;


/**
* <p>Internal just to indicated if a mine bomb is activated or not.
* This has not purpose if used in a save file.
Expand Down Expand Up @@ -274,6 +280,9 @@ public MineBombData( String name, String itemType, String explosionShape,
this.autosell = false;
this.customModelData = 0;


this.applyToPlayersBlockCount = true;

}


Expand Down Expand Up @@ -326,6 +335,7 @@ public MineBombData clone() {
cloned.getPreventedMines().add( mine );
}

cloned.setApplyToPlayersBlockCount( isApplyToPlayersBlockCount() );

for ( MineBombEffectsData soundEffect : getSoundEffects() )
{
Expand Down Expand Up @@ -541,6 +551,13 @@ public void setActivated( boolean activated ) {
this.activated = activated;
}

public boolean isApplyToPlayersBlockCount() {
return applyToPlayersBlockCount;
}
public void setApplyToPlayersBlockCount(boolean applyToPlayersBlockCount) {
this.applyToPlayersBlockCount = applyToPlayersBlockCount;
}

public TreeSet<MineBombEffectsData> getSoundEffects() {
return soundEffects;
}
Expand Down
Expand Up @@ -16,7 +16,7 @@ public class MineBombsConfigData
* data.
* </p>
*/
public static final int MINE_BOMB_DATA_FORMAT_VERSION = 2;
public static final int MINE_BOMB_DATA_FORMAT_VERSION = 3;

private int dataFormatVersion = 0;

Expand Down
Expand Up @@ -23,10 +23,10 @@ public void setCmdGroup( String cmdGroup ) {
}


public Player getPlayer( CommandSender sender ) {
Optional<Player> player = Prison.get().getPlatform().getPlayer( sender.getName() );
return player.isPresent() ? player.get() : null;
}
// public Player getPlayer( CommandSender sender ) {
// Optional<Player> player = Prison.get().getPlatform().getPlayer( sender.getName() );
// return player.isPresent() ? player.get() : null;
// }

/**
* <p>Gets a player by name. If the player is not online, then try to get them from
Expand Down

0 comments on commit 67d8e7e

Please sign in to comment.