Skip to content

Commit b7e7f79

Browse files
Some Work for 1.0.0
1 parent 6f63e9d commit b7e7f79

50 files changed

Lines changed: 574 additions & 589 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ yarn_mappings=1.21+build.2
99
loader_version=0.15.11
1010

1111
# Mod Properties
12-
mod_version=0.4.2-beta
12+
mod_version=1.0.0
1313
maven_group=com.mmodding.env.json
1414
archives_base_name=env_json
1515

src/main/java/com/mmodding/env/json/api/EnvJsonVisitor.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package com.mmodding.env.json.api;
22

3-
import com.mmodding.env.json.api.rule.SkyEnvJsonRule;
4-
import com.mmodding.env.json.api.rule.VoidEnvJsonRule;
5-
import com.mmodding.env.json.api.rule.WaterEnvJsonRule;
63
import it.unimi.dsi.fastutil.ints.Int2BooleanFunction;
74
import net.minecraft.registry.RegistryKey;
85
import net.minecraft.registry.tag.TagKey;
@@ -27,9 +24,9 @@ public interface EnvJsonVisitor {
2724

2825
boolean applySubmerged(boolean submerged);
2926

30-
boolean applySky(SkyEnvJsonRule.Localization localization);
27+
boolean applySky(RelativeLocation localization);
3128

32-
boolean applyWater(WaterEnvJsonRule.Localization localization);
29+
boolean applyWater(RelativeLocation localization);
3330

34-
boolean applyVoid(VoidEnvJsonRule.Localization localization);
31+
boolean applyVoid(RelativeLocation localization);
3532
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.mmodding.env.json.api;
2+
3+
public enum RelativeLocation {
4+
BELOW,
5+
AT,
6+
ABOVE
7+
}

src/main/java/com/mmodding/env/json/api/rule/AnyEnvJsonRule.java

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/main/java/com/mmodding/env/json/api/rule/DimensionEnvJsonRule.java

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/main/java/com/mmodding/env/json/api/rule/EnvJsonRule.java

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -9,70 +9,5 @@ static <T extends EnvJsonRule> T safeCast(EnvJsonRule rule, Class<T> type) {
99
return EnvJsonRuleImpl.safeCast(rule, type);
1010
}
1111

12-
Type type();
13-
1412
boolean apply(EnvJsonVisitor visitor);
15-
16-
enum Type {
17-
18-
/**
19-
* Represents a sequence of combined rules with the AND operator.
20-
*/
21-
SEQUENCE,
22-
23-
/**
24-
* Represents a sequence of combined rules with the OR operator.
25-
*/
26-
ANY,
27-
28-
/**
29-
* Reverses the rule.
30-
*/
31-
NOT,
32-
33-
/**
34-
* Represents a dimension rule where the object should be.
35-
*/
36-
DIMENSION,
37-
38-
/**
39-
* Represents a biome rule where the object should be.
40-
*/
41-
BIOME,
42-
43-
/**
44-
* Represents an x coordinate comparator rule which is applied to the object.
45-
*/
46-
X_COORD,
47-
48-
/**
49-
* Represents a y coordinate comparator rule which is applied to the object.
50-
*/
51-
Y_COORD,
52-
53-
/**
54-
* Represents a z coordinate comparator rule which is applied to the object.
55-
*/
56-
Z_COORD,
57-
58-
/**
59-
* Represents a rule checking if the object os surrounded by water.
60-
*/
61-
SUBMERGED,
62-
63-
/**
64-
* Represents a rule checking if the object is below or above the sky limit.
65-
*/
66-
SKY,
67-
68-
/**
69-
* Represents a rule checking if the object is below or above the water level.
70-
*/
71-
WATER,
72-
73-
/**
74-
* Represents a rule checking if the object is below or above the void limit.
75-
*/
76-
VOID;
77-
}
7813
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.mmodding.env.json.api.rule;
2+
3+
import com.google.gson.JsonElement;
4+
import com.mmodding.env.json.api.rule.parsing.EnvJsonRuleParser;
5+
import com.mmodding.env.json.impl.rule.EnvJsonRulesImpl;
6+
import net.minecraft.util.Identifier;
7+
import org.jetbrains.annotations.ApiStatus;
8+
9+
@ApiStatus.NonExtendable
10+
public final class EnvJsonRules {
11+
12+
public EnvJsonRules() {
13+
throw new IllegalStateException("EnvJsonRules class only contains static definitions");
14+
}
15+
16+
/**
17+
* Allows to register a new {@link EnvJsonRuleParser} under an identifier
18+
* @param identifier the identifier
19+
* @param parser the parser
20+
* @param <E> the class of the shape of the json element the parser should parse
21+
*/
22+
public static <E extends JsonElement> void register(Identifier identifier, EnvJsonRuleParser<E, ? extends EnvJsonRule> parser) {
23+
EnvJsonRulesImpl.REGISTRY.put(identifier, parser);
24+
}
25+
}

src/main/java/com/mmodding/env/json/api/rule/NotEnvJsonRule.java

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/main/java/com/mmodding/env/json/api/rule/SequenceEnvJsonRule.java

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/main/java/com/mmodding/env/json/api/rule/SkyEnvJsonRule.java

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)