Surface rule builder prototype
This commit is contained in:
parent
6118dcb2cf
commit
a5e6344cdd
3 changed files with 129 additions and 4 deletions
24
src/main/java/ru/bclib/api/biomes/SurfaceRuleEntry.java
Normal file
24
src/main/java/ru/bclib/api/biomes/SurfaceRuleEntry.java
Normal file
|
@ -0,0 +1,24 @@
|
|||
package ru.bclib.api.biomes;
|
||||
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.level.levelgen.SurfaceRules;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class SurfaceRuleEntry<M extends Mob> implements Comparable<SurfaceRuleEntry> {
|
||||
private final SurfaceRules.RuleSource rule;
|
||||
private final byte priority;
|
||||
|
||||
public SurfaceRuleEntry(int priority, SurfaceRules.RuleSource rule) {
|
||||
this.priority = (byte) priority;
|
||||
this.rule = rule;
|
||||
}
|
||||
|
||||
protected SurfaceRules.RuleSource getRule() {
|
||||
return rule;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(@NotNull SurfaceRuleEntry entry) {
|
||||
return Integer.compare(priority, entry.priority);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue