forked from seymourimadeit/Piglin-Proliferation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a47e8a
commit 2e8c2a2
Showing
6 changed files
with
76 additions
and
11 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
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
12 changes: 12 additions & 0 deletions
12
src/main/java/tallestred/piglinproliferation/common/entities/ZiglinVariantWeight.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,12 @@ | ||
package tallestred.piglinproliferation.common.entities; | ||
|
||
import net.minecraft.util.random.Weight; | ||
import net.minecraft.util.random.WeightedEntry; | ||
import net.minecraft.world.entity.EntityType; | ||
|
||
public record ZiglinVariantWeight(EntityType<?> type, Weight weight) implements WeightedEntry { | ||
@Override | ||
public Weight getWeight() { | ||
return weight; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/tallestred/piglinproliferation/common/entities/ZombifiedPiglinVariant.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,14 @@ | ||
package tallestred.piglinproliferation.common.entities; | ||
|
||
import com.mojang.serialization.Codec; | ||
import com.mojang.serialization.codecs.RecordCodecBuilder; | ||
import net.minecraft.util.random.Weight; | ||
|
||
public record ZombifiedPiglinVariant(Weight weight) { | ||
public static final Codec<ZombifiedPiglinVariant> WEIGHT_CODEC = Weight.CODEC | ||
.xmap(ZombifiedPiglinVariant::new, ZombifiedPiglinVariant::weight); | ||
public static final Codec<ZombifiedPiglinVariant> CODEC = Codec.withAlternative( | ||
RecordCodecBuilder.create(in -> in.group( | ||
Weight.CODEC.fieldOf("weight").forGetter(ZombifiedPiglinVariant::weight)).apply(in, ZombifiedPiglinVariant::new)), | ||
WEIGHT_CODEC); | ||
} |
4 changes: 4 additions & 0 deletions
4
...n/resources/data/piglinproliferation/data_maps/entity_type/zombified_piglin_variants.json
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,4 @@ | ||
{ | ||
"values": { | ||
} | ||
} |