mirror of
https://gitlab.com/SamB440/rpgregions-2.git
synced 2026-01-04 15:31:38 +00:00
Add passthrough setting to regions
This commit is contained in:
@@ -61,7 +61,8 @@ public interface IntegrationManager {
|
||||
*/
|
||||
Set<String> getAllRegionNames(World world);
|
||||
|
||||
default boolean checkRequirements(PlayerMoveEvent event, String region) {
|
||||
default boolean checkRequirements(PlayerMoveEvent event, ConfiguredRegion priority, String region) {
|
||||
if (priority.disablesPassthrough() && !region.equals(priority.getId())) return true;
|
||||
Player player = event.getPlayer();
|
||||
IRPGRegionsAPI plugin = RPGRegionsAPI.getAPI();
|
||||
Optional<ConfiguredRegion> configuredRegion = plugin.getManagers().getRegionsCache().getConfiguredRegion(region);
|
||||
|
||||
@@ -78,6 +78,8 @@ public class ConfiguredRegion {
|
||||
private final String lineColour;
|
||||
@NeedsGUI private final 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;
|
||||
|
||||
public ConfiguredRegion(@Nullable World world, String id, String customName,
|
||||
List<DiscoveryReward> rewards, List<RegionEffect> effects) {
|
||||
@@ -378,6 +380,14 @@ public class ConfiguredRegion {
|
||||
return secondsInsideToDiscover != 0;
|
||||
}
|
||||
|
||||
public boolean disablesPassthrough() {
|
||||
return disablePassthrough;
|
||||
}
|
||||
|
||||
public void setDisablePassthrough(boolean disablePassthrough) {
|
||||
this.disablePassthrough = disablePassthrough;
|
||||
}
|
||||
|
||||
public File getFile(IRPGRegionsAPI plugin) {
|
||||
File file = null;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user