9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2025-12-29 11:49:08 +00:00

Make several fields GUI editable, deprecate old annotations for removal

This commit is contained in:
SamB440
2023-04-23 21:07:42 +01:00
parent 818c4a39a6
commit c8aedf375c
6 changed files with 115 additions and 16 deletions

View File

@@ -12,7 +12,7 @@ import java.lang.annotation.Target;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Deprecated
@Deprecated(forRemoval = true)
public @interface EditableField {
Material material() default Material.OAK_SIGN;

View File

@@ -10,4 +10,5 @@ import java.lang.annotation.Target;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Deprecated(forRemoval = true)
public @interface NeedsGUI { }

View File

@@ -48,18 +48,16 @@ public class ConfiguredRegion {
private String customName;
private final List<DiscoveryReward> rewards;
@NeedsGUI private Sound sound;
@NeedsGUI private String icon;
private String icon;
private int iconModel;
private int undiscoveredIconModel;
@NeedsGUI private String undiscoveredIcon;
private String undiscoveredIcon;
private final List<IconCommand> iconCommand;
@EditableField(description = "Toggle whether the coordinates of the region are shown", name = "Toggle coordinates")
@NeedsGUI private final boolean showCoords;
private boolean showCoords;
@EditableField(material = Material.ENDER_PEARL, name = "Set teleport location", description = "Set the teleport location to your current location")
@NeedsGUI private Location location;
@NeedsGUI private final List<String> hints;
@EditableField(description = "Toggle whether the hint is shown", name = "Toggle hint")
@NeedsGUI private final boolean showHint;
private boolean showHint;
private boolean teleportable;
private boolean hidden;
private boolean discoverable;
@@ -73,15 +71,14 @@ public class ConfiguredRegion {
private List<String> discoveredTitle;
private List<String> discoveredSubtitle;
private Regenerate regenerate;
@EditableField(material = Material.NETHER_STAR, name = "Set teleport cooldown", description = "Set the cooldown for teleportation")
private int teleportCooldown;
@EditableField(material = Material.NETHER_STAR, name = "Set teleport cost", description = "Set the cost for teleportation")
private double teleportCost;
@NeedsGUI private boolean showActionbar;
private boolean showActionbar;
@EditableField(material = Material.RED_DYE, name = "Hex display colour", description = "Set the colour of the region. It is a hex colour (e.g 0x42f4f1 for red) and is used in dynmap.")
private final String colour;
private final String lineColour;
@NeedsGUI private final boolean dynmap;
private boolean dynmap;
private int secondsInsideToDiscover;
// If this is the prioritised region and disablePassthrough is set to true, only the prioritised region shall run
private boolean disablePassthrough;
@@ -200,19 +197,27 @@ public class ConfiguredRegion {
this.location = location;
}
public boolean isShowCoords() {
public boolean showCoords() {
return showCoords;
}
public void setShowCoords(boolean showCoords) {
this.showCoords = showCoords;
}
@Nullable
public List<String> getHints() {
return hints;
}
public boolean isShowHint() {
public boolean showHint() {
return showHint;
}
public void setShowHint(boolean showHint) {
this.showHint = showHint;
}
public boolean isTeleportable() {
return teleportable;
}
@@ -389,10 +394,14 @@ public class ConfiguredRegion {
return lineColour;
}
public boolean isDynmap() {
public boolean dynmap() {
return dynmap;
}
public void setDynmap(boolean dynmap) {
this.dynmap = dynmap;
}
public int getSecondsInsideToDiscover() {
return secondsInsideToDiscover;
}