Skip to content

Commit

Permalink
Fully hide reachDistance with REA installed
Browse files Browse the repository at this point in the history
  • Loading branch information
RubixDev committed Jul 1, 2022
1 parent ded17ae commit 3d9a385
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ org.gradle.jvmargs=-Xmx4G
carpet_core_version=1.4.79+v220607

# Mod Properties
mod_version = 1.3.4-beta.1
mod_version = 1.3.4
maven_group = de.rubixdev.rug
archives_base_name = rug

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/rubixdev/rug/RugServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
import org.apache.logging.log4j.Logger;

public class RugServer implements CarpetExtension, ModInitializer {
public static final String VERSION = "1.3.4-beta.1";
public static final String VERSION = "1.3.4";
public static final Logger LOGGER = LogManager.getLogger("Rug");

private static MinecraftServer minecraftServer;
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/de/rubixdev/rug/RugSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import static carpet.settings.RuleCategory.*;

import carpet.settings.Condition;
import carpet.settings.ParsedRule;
import carpet.settings.Rule;
import carpet.settings.Validator;
import de.rubixdev.rug.util.CraftingRule;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.server.command.ServerCommandSource;

@SuppressWarnings("CanBeFinal")
Expand Down Expand Up @@ -224,11 +226,17 @@ public String description() {
}
}

public static class conditionReachDistance implements Condition {
@Override
public boolean isTrue() { return !FabricLoader.getInstance().isModLoaded("reach-entity-attributes"); }
}

@Rule(
desc = "Reach in which you can place and break blocks. Value will be 0.5 higher in creative",
extra = "Mod needed on server and client for this feature to work",
strict = false,
validate = validatorReachDistance.class,
condition = conditionReachDistance.class,
options = { "0.0", "4.5", "5.0", "10.0" },
category = { EXPERIMENTAL, CREATIVE, CLIENT, RUG }
)
Expand Down

0 comments on commit 3d9a385

Please sign in to comment.