diff --git a/common/src/main/java/dev/itsmeow/betteranimalsplus/client/ClientLifecycleHandler.java b/common/src/main/java/dev/itsmeow/betteranimalsplus/client/ClientLifecycleHandler.java index 8031e2ab..7f94d1e3 100644 --- a/common/src/main/java/dev/itsmeow/betteranimalsplus/client/ClientLifecycleHandler.java +++ b/common/src/main/java/dev/itsmeow/betteranimalsplus/client/ClientLifecycleHandler.java @@ -206,7 +206,7 @@ public static void registerEntityRenders() { })); R.addRender(ModEntities.GAZELLE::getEntityType, 0.8F, r -> r.tVariant().childScale(0.6F).mMapped(e -> { String v = e.getVariantNameOrEmpty(); - if(v.equals("blackbuck_2")) { + if(v.equals("blackbuck_light") || v.equals("blackbuck_dark")) { return "blackbuck_gazelle"; } return v.isEmpty() ? "blackbuck_gazelle" : v + "_gazelle"; diff --git a/common/src/main/java/dev/itsmeow/betteranimalsplus/common/entity/EntityCrocodile.java b/common/src/main/java/dev/itsmeow/betteranimalsplus/common/entity/EntityCrocodile.java index 1d6c850d..850db5e6 100644 --- a/common/src/main/java/dev/itsmeow/betteranimalsplus/common/entity/EntityCrocodile.java +++ b/common/src/main/java/dev/itsmeow/betteranimalsplus/common/entity/EntityCrocodile.java @@ -4,10 +4,20 @@ import dev.itsmeow.betteranimalsplus.common.entity.util.abstracts.EntityWaterMobPathing; import dev.itsmeow.betteranimalsplus.init.ModEntities; import dev.itsmeow.imdlib.entity.EntityTypeContainer; +import dev.itsmeow.imdlib.entity.interfaces.ISelectiveVariantTypes; +import dev.itsmeow.imdlib.entity.util.BiomeTypes; +import net.minecraft.resources.ResourceKey; import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.MobSpawnType; import net.minecraft.world.level.Level; +import net.minecraft.world.level.biome.Biome; -public class EntityCrocodile extends EntityCrocidilian { +import java.util.Set; + +public class EntityCrocodile extends EntityCrocidilian implements ISelectiveVariantTypes { + + private static final String[] ALL_TYPE = {"american", "nile"}; + private static final String[] SAVANNA_TYPE = {"nile"}; public EntityCrocodile(EntityType entityType, Level level) { super(entityType, level); @@ -18,4 +28,13 @@ public EntityTypeContainer getContainer() { return ModEntities.CROCODILE; } + @Override + public String[] getTypesFor(ResourceKey biomeKey, Biome biome, Set types, MobSpawnType reason) { + if (types.contains(BiomeTypes.SAVANNA)) { + return SAVANNA_TYPE; + } else if (types.contains(BiomeTypes.SWAMP)) { + return ALL_TYPE; + } + return ALL_TYPE; + } } diff --git a/common/src/main/java/dev/itsmeow/betteranimalsplus/init/ModEntities.java b/common/src/main/java/dev/itsmeow/betteranimalsplus/init/ModEntities.java index 55b48293..9618a390 100644 --- a/common/src/main/java/dev/itsmeow/betteranimalsplus/init/ModEntities.java +++ b/common/src/main/java/dev/itsmeow/betteranimalsplus/init/ModEntities.java @@ -496,9 +496,9 @@ public class ModEntities { .egg(0x593306, 0xedc391) .size(1F, 1.5F) .biomesOverworld(BiomeTypes.SAVANNA) - .variants("blackbuck", "blackbuck_2", "chinkara", "erlanger", "springbok") + .variants("blackbuck_dark", "blackbuck_light", "chinkara", "erlanger", "springbok") .head().itemGroup(G).mapToNames().setModelMapped(() -> headTypeName -> ModelGazelleHead::new, - headTypeName -> headTypeName.equals("blackbuck_2") ? "blackbuck_gazelle_head" : headTypeName + "_gazelle_head") + headTypeName -> headTypeName.startsWith("blackbuck") ? "blackbuck_gazelle_head" : headTypeName + "_gazelle_head") .done()); public static final EntityTypeContainer CROCODILE = H.add(EntityCrocodile.class, EntityCrocodile::new, "crocodile", () -> Mob.createMobAttributes() .add(Attributes.MAX_HEALTH, 25.0D) @@ -509,7 +509,7 @@ public class ModEntities { .waterPlacement() .egg(0x4d4732, 0x404a42) .size(2.2F, 0.8F) - .biomesOverworld(BiomeTypes.SWAMP, BiomeTypes.RIVER) + .biomesOverworld(BiomeTypes.SWAMP, BiomeTypes.SAVANNA) .variants("american", "nile")); public static LinkedHashMap> getEntities() { diff --git a/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_blackbuck_dark.json b/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_blackbuck_dark.json new file mode 100644 index 00000000..5a206b96 --- /dev/null +++ b/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_blackbuck_dark.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "betteranimalsplus:item/gazellehead_blackbuck_dark" + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_blackbuck_light.json b/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_blackbuck_light.json new file mode 100644 index 00000000..864e894e --- /dev/null +++ b/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_blackbuck_light.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "betteranimalsplus:item/gazellehead_blackbuck_light" + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_chinkara.json b/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_chinkara.json new file mode 100644 index 00000000..8f7abd75 --- /dev/null +++ b/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_chinkara.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "betteranimalsplus:item/gazellehead_chinkara" + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_erlanger.json b/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_erlanger.json new file mode 100644 index 00000000..79d16416 --- /dev/null +++ b/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_erlanger.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "betteranimalsplus:item/gazellehead_erlanger" + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_springbok.json b/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_springbok.json new file mode 100644 index 00000000..f0f0b116 --- /dev/null +++ b/common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_springbok.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "betteranimalsplus:item/gazellehead_springbok" + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/betteranimalsplus/textures/entity/gazelle_blackbuck.png b/common/src/main/resources/assets/betteranimalsplus/textures/entity/gazelle_blackbuck_dark.png similarity index 100% rename from common/src/main/resources/assets/betteranimalsplus/textures/entity/gazelle_blackbuck.png rename to common/src/main/resources/assets/betteranimalsplus/textures/entity/gazelle_blackbuck_dark.png diff --git a/common/src/main/resources/assets/betteranimalsplus/textures/entity/gazelle_blackbuck_2.png b/common/src/main/resources/assets/betteranimalsplus/textures/entity/gazelle_blackbuck_light.png similarity index 100% rename from common/src/main/resources/assets/betteranimalsplus/textures/entity/gazelle_blackbuck_2.png rename to common/src/main/resources/assets/betteranimalsplus/textures/entity/gazelle_blackbuck_light.png diff --git a/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_blackbuck_dark.png b/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_blackbuck_dark.png new file mode 100644 index 00000000..e04ed33f Binary files /dev/null and b/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_blackbuck_dark.png differ diff --git a/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_blackbuck_light.png b/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_blackbuck_light.png new file mode 100644 index 00000000..2126e2cc Binary files /dev/null and b/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_blackbuck_light.png differ diff --git a/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_chinkara.png b/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_chinkara.png new file mode 100644 index 00000000..89d9ea0a Binary files /dev/null and b/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_chinkara.png differ diff --git a/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_erlanger.png b/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_erlanger.png new file mode 100644 index 00000000..bc60aa14 Binary files /dev/null and b/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_erlanger.png differ diff --git a/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_springbok.png b/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_springbok.png new file mode 100644 index 00000000..357ea4eb Binary files /dev/null and b/common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_springbok.png differ diff --git a/common/src/main/resources/data/betteranimalsplus/advancements/animal_head_all.json b/common/src/main/resources/data/betteranimalsplus/advancements/animal_head_all.json index cbe2d104..3a75a4b9 100644 --- a/common/src/main/resources/data/betteranimalsplus/advancements/animal_head_all.json +++ b/common/src/main/resources/data/betteranimalsplus/advancements/animal_head_all.json @@ -334,25 +334,25 @@ ] } }, - "gazelle_blackbuck": { + "gazelle_blackbuck_dark": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "items": [ - "betteranimalsplus:gazellehead_blackbuck" + "betteranimalsplus:gazellehead_blackbuck_dark" ] } ] } }, - "gazelle_blackbuck_2": { + "gazelle_blackbuck_light": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "items": [ - "betteranimalsplus:gazellehead_blackbuck_2" + "betteranimalsplus:gazellehead_blackbuck_light" ] } ] @@ -466,10 +466,10 @@ "feralwolfhead_red" ], [ - "gazelle_blackbuck" + "gazelle_blackbuck_dark" ], [ - "gazelle_blackbuck_2" + "gazelle_blackbuck_light" ], [ "gazelle_chinkara" diff --git a/common/src/main/resources/data/betteranimalsplus/advancements/animal_head_first.json b/common/src/main/resources/data/betteranimalsplus/advancements/animal_head_first.json index c4233c7a..3a2872d3 100644 --- a/common/src/main/resources/data/betteranimalsplus/advancements/animal_head_first.json +++ b/common/src/main/resources/data/betteranimalsplus/advancements/animal_head_first.json @@ -325,25 +325,25 @@ ] } }, - "gazelle_blackbuck": { + "gazelle_blackbuck_dark": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "items": [ - "betteranimalsplus:gazellehead_blackbuck" + "betteranimalsplus:gazellehead_blackbuck_dark" ] } ] } }, - "gazelle_blackbuck_2": { + "gazelle_blackbuck_light": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "items": [ - "betteranimalsplus:gazellehead_blackbuck_2" + "betteranimalsplus:gazellehead_blackbuck_light" ] } ] @@ -413,8 +413,8 @@ "feralwolfhead_arctic", "feralwolfhead_brown", "feralwolfhead_red", - "gazelle_blackbuck", - "gazelle_blackbuck_2", + "gazelle_blackbuck_dark", + "gazelle_blackbuck_light", "gazelle_chinkara", "gazelle_erlanger", "gazelle_springbok" diff --git a/common/src/main/resources/data/betteranimalsplus/advancements/animal_head_variants.json b/common/src/main/resources/data/betteranimalsplus/advancements/animal_head_variants.json index a8377002..64406401 100644 --- a/common/src/main/resources/data/betteranimalsplus/advancements/animal_head_variants.json +++ b/common/src/main/resources/data/betteranimalsplus/advancements/animal_head_variants.json @@ -325,25 +325,25 @@ ] } }, - "gazelle_blackbuck": { + "gazelle_blackbuck_dark": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "items": [ - "betteranimalsplus:gazellehead_blackbuck" + "betteranimalsplus:gazellehead_blackbuck_dark" ] } ] } }, - "gazelle_blackbuck_2": { + "gazelle_blackbuck_light": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "items": [ - "betteranimalsplus:gazellehead_blackbuck_2" + "betteranimalsplus:gazellehead_blackbuck_light" ] } ] @@ -427,8 +427,8 @@ "head21" ], [ - "gazelle_blackbuck", - "gazelle_blackbuck_2", + "gazelle_blackbuck_dark", + "gazelle_blackbuck_light", "gazelle_chinkara", "gazelle_erlanger", "gazelle_springbok" diff --git a/common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/gazellehead_blackbuck.json b/common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/gazellehead_blackbuck_dark.json similarity index 80% rename from common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/gazellehead_blackbuck.json rename to common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/gazellehead_blackbuck_dark.json index fb5b9435..63e78960 100644 --- a/common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/gazellehead_blackbuck.json +++ b/common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/gazellehead_blackbuck_dark.json @@ -6,7 +6,7 @@ "entries": [ { "type": "minecraft:item", - "name": "betteranimalsplus:gazellehead_blackbuck" + "name": "betteranimalsplus:gazellehead_blackbuck_dark" } ], "conditions": [ diff --git a/common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/gazellehead_blackbuck_2.json b/common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/gazellehead_blackbuck_light.json similarity index 80% rename from common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/gazellehead_blackbuck_2.json rename to common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/gazellehead_blackbuck_light.json index ac2482f4..fe6fc6c0 100644 --- a/common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/gazellehead_blackbuck_2.json +++ b/common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/gazellehead_blackbuck_light.json @@ -6,7 +6,7 @@ "entries": [ { "type": "minecraft:item", - "name": "betteranimalsplus:gazellehead_blackbuck_2" + "name": "betteranimalsplus:gazellehead_blackbuck_light" } ], "conditions": [