Fixes some minor formatting issues

This commit is contained in:
Kristian Knarvik 2022-01-28 23:23:33 +01:00
parent 7f08763624
commit 248caee620
3 changed files with 11 additions and 5 deletions

View File

@ -262,8 +262,8 @@ public final class StargateGateConfig {
if (colors[colorIndex].equalsIgnoreCase("inverted")) {
//Convert from ChatColor to awt.Color to Bukkit.Color then invert and convert to ChatColor
java.awt.Color color = defaultColors[colorIndex].getColor();
parsedColor = ColorHelper.fromColor(ColorHelper.invert(Color.fromRGB(color.getRed(),
color.getGreen(), color.getBlue())));
parsedColor = ColorHelper.fromColor(ColorHelper.invert(Color.fromRGB(color.getRed(), color.getGreen(),
color.getBlue())));
} else {
try {
parsedColor = ChatColor.of(colors[colorIndex]);

View File

@ -95,8 +95,7 @@ public class PortalEventListener implements Listener {
Portal exitPortal = teleportation.getExit();
//Overwrite respawn location to respawn in front of the portal
event.setRespawnLocation(new PlayerTeleporter(exitPortal, respawningPlayer).getExit(respawningPlayer,
respawningPlayer.getLocation()));
event.setRespawnLocation(new PlayerTeleporter(exitPortal, respawningPlayer).getExit());
//Properly close the portal to prevent it from staying in a locked state until it times out
exitPortal.getPortalOpener().closePortal(false);
}

View File

@ -6,7 +6,14 @@ import org.bukkit.Color;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ColorHelper {
/**
* A helper class for dealing with colors
*/
public final class ColorHelper {
private ColorHelper() {
}
/**
* Inverts the given color