Skip to content

Commit

Permalink
Disabled worlds still showing measurement (#57)
Browse files Browse the repository at this point in the history
* Comment and adding return if player is in disabled world

* Version bump
  • Loading branch information
jackah2 committed Apr 26, 2022
1 parent 9fa961b commit e894767
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>edu.whimc</groupId>
<artifactId>WHIMC-ScienceTools</artifactId>
<version>2.4.6</version>
<version>2.4.7</version>
<name>WHIMC Science Tools</name>
<description>Simulate values for scientific tools</description>
<repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ public NumericScienceTool(String toolKey,
*/
@Override
public @Nullable String displayMeasurement(Player player) {
// check if player in disabled world

// Check if the player is in a disabled world
if (super.disabledWorlds.contains(player.getWorld())) {
Utils.msg(player, Message.DISABLED_IN_WORLD.format(this, player));
return null;
}

String message = Message.NUMERIC_MEASURE.format(this, player);
double data = getData(player.getLocation());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,12 @@ protected String getMeasurement(Location loc) {
* @return The measurement
*/
public @Nullable String displayMeasurement(Player player) {
// Check if the player is in a disabled world
if (this.disabledWorlds.contains(player.getWorld())) {
Utils.msg(player, Message.DISABLED_IN_WORLD.format(this, player));
return null;
}

String measurement = Message.MEASURE.format(this, player);
Utils.msg(player, measurement);
return measurement;
Expand Down

0 comments on commit e894767

Please sign in to comment.