From 09bbe6359ac6761d938f3530e66c0737e75b7c00 Mon Sep 17 00:00:00 2001 From: itsmeow Date: Wed, 22 Feb 2023 11:24:21 -0600 Subject: [PATCH] Rename gazelle variants, add head 2d textures, add selective types to crocodiles --- .../client/ClientLifecycleHandler.java | 2 +- .../common/entity/EntityCrocodile.java | 21 +++++++++++++++++- .../betteranimalsplus/init/ModEntities.java | 6 ++--- .../item/gazellehead_blackbuck_dark.json | 6 +++++ .../item/gazellehead_blackbuck_light.json | 6 +++++ .../models/item/gazellehead_chinkara.json | 6 +++++ .../models/item/gazellehead_erlanger.json | 6 +++++ .../models/item/gazellehead_springbok.json | 6 +++++ ...ackbuck.png => gazelle_blackbuck_dark.png} | Bin ...buck_2.png => gazelle_blackbuck_light.png} | Bin .../item/gazellehead_blackbuck_dark.png | Bin 0 -> 301 bytes .../item/gazellehead_blackbuck_light.png | Bin 0 -> 318 bytes .../textures/item/gazellehead_chinkara.png | Bin 0 -> 307 bytes .../textures/item/gazellehead_erlanger.png | Bin 0 -> 325 bytes .../textures/item/gazellehead_springbok.png | Bin 0 -> 302 bytes .../advancements/animal_head_all.json | 12 +++++----- .../advancements/animal_head_first.json | 12 +++++----- .../advancements/animal_head_variants.json | 12 +++++----- ...k.json => gazellehead_blackbuck_dark.json} | 2 +- ....json => gazellehead_blackbuck_light.json} | 2 +- 20 files changed, 74 insertions(+), 25 deletions(-) create mode 100644 common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_blackbuck_dark.json create mode 100644 common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_blackbuck_light.json create mode 100644 common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_chinkara.json create mode 100644 common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_erlanger.json create mode 100644 common/src/main/resources/assets/betteranimalsplus/models/item/gazellehead_springbok.json rename common/src/main/resources/assets/betteranimalsplus/textures/entity/{gazelle_blackbuck.png => gazelle_blackbuck_dark.png} (100%) rename common/src/main/resources/assets/betteranimalsplus/textures/entity/{gazelle_blackbuck_2.png => gazelle_blackbuck_light.png} (100%) create mode 100644 common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_blackbuck_dark.png create mode 100644 common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_blackbuck_light.png create mode 100644 common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_chinkara.png create mode 100644 common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_erlanger.png create mode 100644 common/src/main/resources/assets/betteranimalsplus/textures/item/gazellehead_springbok.png rename common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/{gazellehead_blackbuck.json => gazellehead_blackbuck_dark.json} (80%) rename common/src/main/resources/data/betteranimalsplus/loot_tables/blocks/{gazellehead_blackbuck_2.json => gazellehead_blackbuck_light.json} (80%) 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 0000000000000000000000000000000000000000..e04ed33fe8223cb539b1f7759531f7ff534f7019 GIT binary patch literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}r0G|+7e_QoCp6TwpKLna=f%BvE-%Lu@uF4pqGs5cq@DU@U2W3u*u$`% z#l?Z6gLOvh%#y&a854e2PJdN3Kf20QrD4b2gNS%G}B0G|+7e_Qo}N-eYshcXvlG?XPf=<7HxE z3=0Z$v9&hU(-9RF1#0~pP?HO!gi3<^g8!ofhDZDN3jt+03p^r=85sBugD~Uq{1quc z!D3Gr#}JKR-yTMxRs{~1!ww5J*?r&t#{Gb#@Yr{%^)bil+<)@XSvW)f#Rn1zXJtp-*soVMjj6++wJsH_Pw|u>xSwB pd_RuYIjI!{)iDZdZgiM>Q+}Q^uVDMk;!dFT44$rjF6*2UngFkjb^`za literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..89d9ea0a0e280eebd2ba4efdc4b177dc4ed16038 GIT binary patch literal 307 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|m0G|+7QBhG76BBuPc^gN^N#Xj7@||v<*l=u4`R?xM7grDLUo&~@!rrC* z6--QwF1FS{O>@MTNdPH!>}BeIx*f$tCqGm2_>H2?(*JY5_^ zG=hD5B83hpa5xt-uhqTte_QJ2%QZ*b&#<_#bj@1zBk{?%=eN#8oA&#=Z|CU>i_&pr z*!q3e3%i7p7kyF+XH7HuvW47|@AC^iEPkJ{qC!x&>viTZ%-}z|nK37D hYNLSa90k=+OrhU+qLyuWa1>}agQu&X%Q~loCIA6~aGn4F literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..bc60aa1403393823d82cffa2433c3db352eddafb GIT binary patch literal 325 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}Z0G|+7e_Qp&Y~Ofqqa{5VMRu|i5-o3^*s!fPYekjsi>n9rubI4cVeiuZ z3MM8-7hCI=nzG!q1W{2@pzcjN=av8|;gTS~;QttaVN>lL4xlt=fk$L90|Vb75M~tB z@M-`GmU+53hG+!)_C^XFR^V|yo2AjoyzhVFYu&l8oR#IIBxguYnxS#idGgKrbFO<+ zO8;-k5L576`ePFFiLK8%p7BPtW(7JNHNS%G|m0G|+7QBl!&Z==R+UlS7(e_QqaYbNjRj^4Vk_x6bmFRmVFvtvFsr#x4g zWodr}6B8p)(|p$zOM#R?NswRge^kKmKsi