Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

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


# 3.3.0-alpha.19j 2026-03-07
# 3.3.0-alpha.19j 2026-03-15


* **Prison Cleanup: prison-spigot: Removed obsolete and unneeded comments and fix indentation where needed.** Second part.


* **Prison Cleanup: prison-spigot: Removed obsolete and unneeded comments and fix indentation where needed.** First part.


* **Bug fix in the ChatTest Junit test. When I was cleaning up that source I accidentally introduced a stray '.'.**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public UUID getUniqueId() {
}

public UUID getUUID() {
UUID uuid = null;
if ( isPlayer() ) {
uuid = ((org.bukkit.entity.Player) bukkitSender).getUniqueId();
}
UUID uuid = null;
if ( isPlayer() ) {
uuid = ((org.bukkit.entity.Player) bukkitSender).getUniqueId();
}
return uuid;
}

Expand All @@ -89,10 +89,10 @@ public String getName() {
@Override
public void dispatchCommand(String command) {

command = CommandHandler.remapRootCmdIdentifiers( command );

String registeredCmd = Prison.get().getCommandHandler()
.findRegisteredCommand( command );
command = CommandHandler.remapRootCmdIdentifiers( command );
String registeredCmd = Prison.get().getCommandHandler()
.findRegisteredCommand( command );

Bukkit.getServer().dispatchCommand(bukkitSender, registeredCmd);
}
Expand All @@ -104,36 +104,36 @@ public boolean doesSupportColors() {

@Override
public void sendMessage(String message) {

String[] msgs = Text.translateAmpColorCodes(message).split( "\\{br\\}" );

for ( String msg : msgs ) {
bukkitSender.sendMessage(msg);
String[] msgs = Text.translateAmpColorCodes(message).split( "\\{br\\}" );
for ( String msg : msgs ) {
bukkitSender.sendMessage(msg);
}
}

@Override
public void sendMessage(String[] messages) {
for (String message : messages) {

String[] msgs = Text.translateAmpColorCodes(message).split( "\\{br\\}" );
for ( String msg : msgs ) {

sendMessage(msg);
}
String[] msgs = Text.translateAmpColorCodes(message).split( "\\{br\\}" );
for ( String msg : msgs ) {
sendMessage(msg);
}
}
}

@Override
public void sendMessage(List<String> messages) {
for (String message : messages) {

String[] msgs = Text.translateAmpColorCodes(message).split( "\\{br\\}" );
for ( String msg : msgs ) {

sendMessage(msg);
}
}
for (String message : messages) {
String[] msgs = Text.translateAmpColorCodes(message).split( "\\{br\\}" );
for ( String msg : msgs ) {
sendMessage(msg);
}
}
}

@Override
Expand All @@ -146,7 +146,7 @@ public void sendRaw(String json) {

@Override
public boolean isOp() {
return bukkitSender.isOp();
return bukkitSender.isOp();
}

@Override
Expand All @@ -163,10 +163,10 @@ public boolean hasPermission(String perm) {

@Override
public List<String> getPermissions() {
List<String> results = new ArrayList<>();

Set<PermissionAttachmentInfo> perms = bukkitSender.getEffectivePermissions();
for ( PermissionAttachmentInfo perm : perms )
List<String> results = new ArrayList<>();
Set<PermissionAttachmentInfo> perms = bukkitSender.getEffectivePermissions();
for ( PermissionAttachmentInfo perm : perms )
{
results.add( perm.getPermission() );
}
Expand All @@ -178,128 +178,108 @@ public List<String> getPermissions() {
@Override
public List<String> getPermissions( String prefix ) {

return getPermissions( prefix, getPermissions() );
return getPermissions( prefix, getPermissions() );
}

@Override
public List<String> getPermissions( String prefix, List<String> perms ) {
List<String> results = new ArrayList<>();

for ( String perm : perms ) {
if ( perm.startsWith( prefix ) ) {
results.add( perm );
}
}

return results;
List<String> results = new ArrayList<>();
for ( String perm : perms ) {
if ( perm.startsWith( prefix ) ) {
results.add( perm );
}
}
return results;
}

// @Override
// public List<String> getPermissions( String prefix ) {
// List<String> results = new ArrayList<>();
//
// for ( String perm : getPermissions() ) {
// if ( perm.startsWith( prefix ) ) {
// results.add( perm );
// }
// }
//
// return results;
// }


@Override
public double getSellAllMultiplier() {
double results = 1.0;

if ( isPlayer() ) {

SellAllUtil sellall = SpigotPrison.getInstance().getSellAllUtil();

if ( sellall != null && getWrapper() != null ) {
results = sellall.getPlayerMultiplier((org.bukkit.entity.Player) getWrapper());
}
}

return results;

// Optional<Player> oPlayer = Prison.get().getPlatform().getPlayer( getName() );
//
// if ( oPlayer.isPresent() ) {
// results = oPlayer.get().getSellAllMultiplier();
// }
//
// return results;
double results = 1.0;

if ( isPlayer() ) {

SellAllUtil sellall = SpigotPrison.getInstance().getSellAllUtil();

if ( sellall != null && getWrapper() != null ) {
results = sellall.getPlayerMultiplier((org.bukkit.entity.Player) getWrapper());
}
}

return results;
}

@Override
public double getSellAllMultiplierDebug() {
double results = 1.0;

if ( isPlayer() ) {

SellAllUtil sellall = SpigotPrison.getInstance().getSellAllUtil();

if ( sellall != null && getWrapper() != null ) {

Player player = getPlatformPlayer();

results = sellall.getPlayerMultiplierDebug( player );
}
}

return results;
double results = 1.0;
if ( isPlayer() ) {
SellAllUtil sellall = SpigotPrison.getInstance().getSellAllUtil();
if ( sellall != null && getWrapper() != null ) {
Player player = getPlatformPlayer();
results = sellall.getPlayerMultiplierDebug( player );
}
}
return results;
}

@Override
public List<String> getSellAllMultiplierListings() {
List<String> results = new ArrayList<>();

if ( isPlayer() ) {

SellAllUtil sellall = SpigotPrison.getInstance().getSellAllUtil();

if ( sellall != null && getWrapper() != null ) {
results.addAll( sellall.getPlayerMultiplierList((org.bukkit.entity.Player) getWrapper()) );
}
}


return results;
List<String> results = new ArrayList<>();
if ( isPlayer() ) {
SellAllUtil sellall = SpigotPrison.getInstance().getSellAllUtil();
if ( sellall != null && getWrapper() != null ) {
results.addAll( sellall.getPlayerMultiplierList((org.bukkit.entity.Player) getWrapper()) );
}
}
return results;
}

public List<String> getPermissionsIntegrations( boolean detailed ) {
List<String> results = new ArrayList<>();

Optional<Player> oPlayer = Prison.get().getPlatform().getPlayer( getName() );

if ( oPlayer.isPresent() ) {

PermissionIntegration perms = PrisonAPI.getIntegrationManager() .getPermission();
if ( perms != null ) {
results = perms.getPermissions( oPlayer.get(), detailed );
}
}

return results;
List<String> results = new ArrayList<>();
Optional<Player> oPlayer = Prison.get().getPlatform().getPlayer( getName() );
if ( oPlayer.isPresent() ) {
PermissionIntegration perms = PrisonAPI.getIntegrationManager() .getPermission();
if ( perms != null ) {
results = perms.getPermissions( oPlayer.get(), detailed );
}
}
return results;
}



@Override
public boolean isPlayer() {
return bukkitSender != null && bukkitSender instanceof org.bukkit.entity.Player;
return bukkitSender != null && bukkitSender instanceof org.bukkit.entity.Player;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();

sb.append( "SpigotCommandSender: " ).append( getName() )
.append( " isOp=" ).append( isOp() )
.append( " isPlayer=" ).append( isPlayer() );

return sb.toString();
StringBuilder sb = new StringBuilder();
sb.append( "SpigotCommandSender: " ).append( getName() )
.append( " isOp=" ).append( isOp() )
.append( " isPlayer=" ).append( isPlayer() );
return sb.toString();
}

public org.bukkit.command.CommandSender getWrapper() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public org.bukkit.Location getBukkitLocation() {

if ( bukkitLocation == null ) {
bukkitLocation = getBukkitLocation( this );
// bukkitLocation = createBukkitLocation();
}

return bukkitLocation;
Expand All @@ -46,27 +45,9 @@ public static org.bukkit.Location getBukkitLocation( Location location ) {

bLocation.setPitch( location.getPitch() );

// bLocation.;

return bLocation;
}

// private org.bukkit.Location createBukkitLocation() {
//
// org.bukkit.World world = Bukkit.getWorld( getWorld().getName() );
//
// org.bukkit.Location bLocation = new org.bukkit.Location(world, getBlockX(), getBlockY(), getBlockZ() );
//
// bLocation.setYaw(getYaw());
//
// bLocation.setPitch(getPitch());
//
// return bLocation;
// }

// public void setBukkitLocation(org.bukkit.Location bukkitLocation) {
// this.bukkitLocation = bukkitLocation;
// }

public org.bukkit.World getBukkitWorld() {
return getBukkitLocation().getWorld();
Expand Down
Loading
Loading