Minor comment and formatting cleanup

This commit is contained in:
Kristian Knarvik 2021-10-09 03:57:24 +02:00
parent 336c3c4bfb
commit f87ffc906c
8 changed files with 25 additions and 18 deletions

View File

@ -234,9 +234,8 @@ normal buttons cannot be used since they'd fall off. Using wall coral fans work
`SHULKER_BOX` works too.
Using `AIR` for a closed underwater gate looks weird, so `WATER` might be better. If using `AIR` for the closed gate,
you need to make sure it actually contains air when creating it.
For partially submerged portals, like ones used for boat teleportation, you need to keep water away
from the portal entrance/opening until it's been created.
you need to make sure it actually contains air when creating it. For partially submerged portals, like ones used for
boat teleportation, you need to keep water away from the portal entrance/opening until it's been created.
# Configuration
@ -278,9 +277,9 @@ debugging:
It is possible to customize all the messages Stargate displays, including the [Stargate] prefix. You can find the
strings in plugins/Stargate/lang/chosenLanguage.txt.
If a string is removed, or left blank, it will default to the default english string. There are some special cases
regarding messages. When you see %variableName%, you need to keep this part in your string, as it will be replaced
with relevant values.
If a string is removed, or left blank, it will default to the default english string. There are some special cases
regarding messages. When you see %variableName%, you need to keep this part in your string, as it will be replaced with
relevant values.
The full list of strings is as follows:
@ -368,8 +367,8 @@ bungeeSign=Teleport to
#### \[Version 0.8.0.0] PseudoKnight fork
- Update for 1.13/1.14 compatibility. This update changes gate layouts to use new material names instead of numeric ids. You
need to update your gate layout configs.
- Update for 1.13/1.14 compatibility. This update changes gate layouts to use new material names instead of numeric ids.
You need to update your gate layout configs.
- Adds "verifyPortals" config option, which sets whether an old stargate's blocks are verified when loaded.
- Adds UUID support. (falls back to player names)

View File

@ -16,7 +16,6 @@ import java.util.Set;
*/
public class LanguageLoader {
// Variables
private final String languageFolder;
private final Map<String, String> loadedBackupStrings;
private String chosenLanguage;

View File

@ -73,11 +73,11 @@ public class Stargate extends JavaPlugin {
private String dataFolderPath;
public static ChatColor signColor;
// Used for debug
//Used for debug
public static boolean debuggingEnabled = false;
public static boolean permissionDebuggingEnabled = false;
// HashMap of player names for Bungee support
//HashMap of player names for Bungee support
public static final Map<String, String> bungeeQueue = new HashMap<>();
//World names that contain stargates
public static final HashSet<String> managedWorlds = new HashSet<>();
@ -189,7 +189,9 @@ public class Stargate extends JavaPlugin {
* @param error <p>Whether the message sent is an error</p>
*/
private static void sendMessage(CommandSender player, String message, boolean error) {
if (message.isEmpty()) return;
if (message.isEmpty()) {
return;
}
//Replace color codes with green? What's the deal with the dollar sign?
message = message.replaceAll("(&([a-f0-9]))", "\u00A7$2");
if (error) {
@ -330,7 +332,7 @@ public class Stargate extends JavaPlugin {
this.loadGates();
this.loadAllPortals();
// Check to see if Economy is loaded yet.
//Check to see if Economy is loaded yet.
setupVaultEconomy();
//Run necessary threads

View File

@ -6,6 +6,9 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.PortalCreateEvent;
/**
* Listens for and cancels relevant portal events
*/
public class PortalEventListener implements Listener {
@EventHandler
@ -13,6 +16,7 @@ public class PortalEventListener implements Listener {
if (event.isCancelled()) {
return;
}
//Cancel nether portal creation when the portal is a StarGate portal
for (BlockState block : event.getBlocks()) {
if (PortalHandler.getByBlock(block.getBlock()) != null) {
event.setCancelled(true);

View File

@ -30,7 +30,7 @@ public class Gate {
private final Material portalClosedBlock;
private final Material portalButton;
// Economy information
//Economy information
private final int useCost;
private final int createCost;
private final int destroyCost;

View File

@ -513,7 +513,7 @@ public class Portal {
/**
* Adjusts the rotation of the player to face out from the portal
*
* @param exit <p>The location the player will exit from</p>
* @param exit <p>The location the player will exit from</p>
*/
private void adjustRotation(Location exit) {
int adjust = 0;

View File

@ -1,5 +1,8 @@
package net.knarcraft.stargate.portal;
/**
* Each enum value represents one option a portal can have/use
*/
public enum PortalOption {
/**

View File

@ -13,10 +13,10 @@ public class StarGateThread implements Runnable {
@Override
public void run() {
long time = System.currentTimeMillis() / 1000;
// Close open portals
//Close open portals
for (Iterator<Portal> iterator = Stargate.openPortalsQueue.iterator(); iterator.hasNext(); ) {
Portal portal = iterator.next();
// Skip always open and non-open gates
//Skip always open and non-open gates
if (portal.getOptions().isAlwaysOn() || !portal.isOpen()) {
continue;
}
@ -25,7 +25,7 @@ public class StarGateThread implements Runnable {
iterator.remove();
}
}
// Deactivate active portals
//Deactivate active portals
for (Iterator<Portal> iterator = Stargate.activePortalsQueue.iterator(); iterator.hasNext(); ) {
Portal portal = iterator.next();
if (!portal.isActive()) {