-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from CanadianBaconBoi/dev
Implement RTP minimum and maximum distance arguments
- Loading branch information
Showing
6 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
common/src/main/java/dev/ftb/mods/ftbessentials/config/PermissionBasedBooleanValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package dev.ftb.mods.ftbessentials.config; | ||
|
||
import dev.ftb.mods.ftbessentials.integration.PermissionsHelper; | ||
import dev.ftb.mods.ftblibrary.snbt.config.BooleanValue; | ||
import net.minecraft.server.level.ServerPlayer; | ||
|
||
public class PermissionBasedBooleanValue { | ||
public final BooleanValue value; | ||
public final String permission; | ||
|
||
public PermissionBasedBooleanValue(BooleanValue value, String permission, String... comment) { | ||
this.value = value | ||
.comment(comment) | ||
.comment("You can override this with FTB Ranks using " + permission); | ||
this.permission = permission; | ||
} | ||
|
||
public boolean get(ServerPlayer player) { | ||
return PermissionsHelper.getInstance().getBool(player, value.get(), permission); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters