-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mines: Debug block breakage. Created a new command '/mines debugBlock…
…Break` that will now be able to use tools from other plugins. Realized there was a problem with using the mine wand when testing block breakage in that you could not test with any other tool, which would prevent other plugins from handling the events like they should. So now, by holding any tool in your hand, and issuing the command '/mines debugBlockBreak' it will test the block breakage with whatever they are holding.
- Loading branch information
Showing
4 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
.../main/java/tech/mcprison/prison/spigot/autofeatures/PrisonDebugBlockInspectorCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package tech.mcprison.prison.spigot.autofeatures; | ||
|
||
|
||
import tech.mcprison.prison.Prison; | ||
import tech.mcprison.prison.commands.Command; | ||
import tech.mcprison.prison.internal.CommandSender; | ||
import tech.mcprison.prison.internal.Player; | ||
import tech.mcprison.prison.spigot.autofeatures.events.PrisonDebugBlockInspector; | ||
import tech.mcprison.prison.spigot.commands.PrisonSpigotBaseCommands; | ||
import tech.mcprison.prison.spigot.game.SpigotPlayer; | ||
import tech.mcprison.prison.util.Location; | ||
|
||
public class PrisonDebugBlockInspectorCommand | ||
extends PrisonSpigotBaseCommands { | ||
|
||
|
||
@Command( identifier = "mines debugBlockBreak", | ||
description = "This will debug the BlockBreakEvent chain of plugins handling the " | ||
+ "event. Look at a block, while holding the tool of choice, and then " | ||
+ "issue this command.", | ||
altPermissions = "prison.admin", | ||
onlyPlayers = true | ||
) | ||
private void mineDebugBlockBreak(CommandSender sender) { | ||
|
||
// Player player = getSpigotPlayer(sender); | ||
|
||
|
||
PrisonDebugBlockInspector blockInspector = PrisonDebugBlockInspector.getInstance(); | ||
|
||
|
||
// (SpigotPlayer) sender.getPlatformPlayer(); | ||
|
||
Player player = Prison.get().getPlatform().getPlayer( sender.getPlatformPlayer().getUUID() ).orElse(null); | ||
|
||
|
||
if ( player != null && player instanceof SpigotPlayer ) { | ||
|
||
SpigotPlayer sPlayer = (SpigotPlayer) player; | ||
|
||
Location location = sPlayer.getLineOfSightExactLocation(); | ||
|
||
boolean isSneaking = true; | ||
|
||
blockInspector.debugBlockBreak( sPlayer, isSneaking, location ); | ||
} | ||
|
||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters