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
@ -279,8 +278,8 @@ It is possible to customize all the messages Stargate displays, including the [S
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.
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

@ -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) {

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

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