Skip to content

Commit

Permalink
Firework Jellyfish and lots of cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MysticKoko committed Dec 16, 2024
1 parent f8db825 commit 7816230
Show file tree
Hide file tree
Showing 44 changed files with 369 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import dev.hybridlabs.aquatic.entity.cephalopod.CuttlefishEntity
import net.minecraft.util.Identifier

class CuttlefishEntityModel : HybridAquaticCephalopodEntityModel<CuttlefishEntity>("cuttlefish") {
override fun getTextureResource(animatable: CuttlefishEntity?): Identifier {
val texturePath = when (animatable?.randomValue) {
override fun getTextureResource(animatable: CuttlefishEntity): Identifier {
val texturePath = when (animatable.randomValue) {
0 -> "textures/entity/cephalopod/cuttlefish/cuttlefish.png"
1 -> "textures/entity/cephalopod/cuttlefish/cuttlefish_zebra.png"
2 -> "textures/entity/cephalopod/cuttlefish/cuttlefish_disruptive.png"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ import software.bernie.geckolib.core.animation.AnimationState
import software.bernie.geckolib.model.GeoModel

abstract class HybridAquaticCephalopodEntityModel<T: HybridAquaticCephalopodEntity> (private val id: String) : GeoModel<T>() {
override fun getModelResource(animatable: T?): Identifier {
val variant = animatable?.variant
override fun getModelResource(animatable: T): Identifier {
val variant = animatable.variant
if (variant != null && !variant.ignore.contains(HybridAquaticCephalopodEntity.CephalopodVariant.Ignore.MODEL))
return Identifier(HybridAquatic.MOD_ID, "geo/cephalopod/${id}/${id}_${variant.variantName}.geo.json")
return Identifier(HybridAquatic.MOD_ID, "geo/cephalopod/${id}/$id.geo.json")
}

override fun getTextureResource(animatable: T?): Identifier {
val variant = animatable?.variant
override fun getTextureResource(animatable: T): Identifier {
val variant = animatable.variant
if (variant != null && !variant.ignore.contains(HybridAquaticCephalopodEntity.CephalopodVariant.Ignore.TEXTURE))
return Identifier(HybridAquatic.MOD_ID, "textures/entity/cephalopod/$id/${id}_${variant.variantName}.png")
return Identifier(HybridAquatic.MOD_ID, "textures/entity/cephalopod/$id/$id.png")
}

override fun getAnimationResource(animatable: T?): Identifier {
val variant = animatable?.variant
override fun getAnimationResource(animatable: T): Identifier {
val variant = animatable.variant
if (variant != null && !variant.ignore.contains(HybridAquaticCephalopodEntity.CephalopodVariant.Ignore.ANIMATION))
return Identifier(HybridAquatic.MOD_ID, "animations/${id}_${variant.variantName}.animation.json")
return Identifier(HybridAquatic.MOD_ID, "animations/$id.animation.json")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ import net.minecraft.util.Identifier
import software.bernie.geckolib.model.GeoModel

abstract class HybridAquaticCritterEntityModel<T: HybridAquaticCritterEntity> (private val id: String) : GeoModel<T>() {
override fun getModelResource(animatable: T?): Identifier {
val variant = animatable?.variant
override fun getModelResource(animatable: T): Identifier {
val variant = animatable.variant
if (variant != null && !variant.ignore.contains(HybridAquaticCritterEntity.CritterVariant.Ignore.MODEL))
return Identifier(HybridAquatic.MOD_ID, "geo/critter/${id}/${id}_${variant.getProvidedVariant(animatable)}.geo.json")
return Identifier(HybridAquatic.MOD_ID, "geo/critter/${id}/$id.geo.json")
}

override fun getTextureResource(animatable: T?): Identifier {
val variant = animatable?.variant
override fun getTextureResource(animatable: T): Identifier {
val variant = animatable.variant
if (variant != null && !variant.ignore.contains(HybridAquaticCritterEntity.CritterVariant.Ignore.TEXTURE))
return Identifier(HybridAquatic.MOD_ID, "textures/entity/critter/${id}/${id}_${variant.getProvidedVariant(animatable)}.png")
return Identifier(HybridAquatic.MOD_ID, "textures/entity/critter/$id/${id}.png")
}

override fun getAnimationResource(animatable: T?): Identifier {
val variant = animatable?.variant
override fun getAnimationResource(animatable: T): Identifier {
val variant = animatable.variant
if (variant != null && !variant.ignore.contains(HybridAquaticCritterEntity.CritterVariant.Ignore.ANIMATION))
return Identifier(HybridAquatic.MOD_ID, "animations/${id}_${variant.getProvidedVariant(animatable)}.animation.json")
return Identifier(HybridAquatic.MOD_ID, "animations/$id.animation.json")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ import net.minecraft.util.Identifier
import software.bernie.geckolib.model.GeoModel

abstract class HybridAquaticCrustaceanEntityModel<T: HybridAquaticCrustaceanEntity> (private val id: String) : GeoModel<T>() {
override fun getModelResource(animatable: T?): Identifier {
val variant = animatable?.variant
override fun getModelResource(animatable: T): Identifier {
val variant = animatable.variant
if (variant != null && !variant.ignore.contains(HybridAquaticCrustaceanEntity.CrustaceanVariant.Ignore.MODEL))
return Identifier(HybridAquatic.MOD_ID, "geo/crustacean/${id}/${id}_${variant.getProvidedVariant(animatable)}.geo.json")
return Identifier(HybridAquatic.MOD_ID, "geo/crustacean/${id}/$id.geo.json")
}

override fun getTextureResource(animatable: T?): Identifier {
val variant = animatable?.variant
override fun getTextureResource(animatable: T): Identifier {
val variant = animatable.variant
if (variant != null && !variant.ignore.contains(HybridAquaticCrustaceanEntity.CrustaceanVariant.Ignore.TEXTURE))
return Identifier(HybridAquatic.MOD_ID, "textures/entity/crustacean/${id}/${id}_${variant.getProvidedVariant(animatable)}.png")
return Identifier(HybridAquatic.MOD_ID, "textures/entity/crustacean/${id}/$id.png")
}

override fun getAnimationResource(animatable: T?): Identifier {
val variant = animatable?.variant
override fun getAnimationResource(animatable: T): Identifier {
val variant = animatable.variant
if (variant != null && !variant.ignore.contains(HybridAquaticCrustaceanEntity.CrustaceanVariant.Ignore.ANIMATION))
return Identifier(HybridAquatic.MOD_ID, "animations/${id}_${variant.getProvidedVariant(animatable)}.animation.json")
return Identifier(HybridAquatic.MOD_ID, "animations/$id.animation.json")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import net.minecraft.util.Identifier

class FlashlightFishEntityModel : HybridAquaticFishEntityModel<FlashlightFishEntity>("flashlight_fish") {

override fun getTextureResource(animatable: FlashlightFishEntity?): Identifier {
val isLightOn = animatable?.isLightOn ?: true
override fun getTextureResource(animatable: FlashlightFishEntity): Identifier {
val isLightOn = animatable.isLightOn

val texturePath = if (isLightOn) {
"textures/entity/fish/flashlight_fish/flashlight_fish.png"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ import software.bernie.geckolib.core.animation.AnimationState
import software.bernie.geckolib.model.GeoModel

abstract class HybridAquaticFishEntityModel<T: HybridAquaticFishEntity> (private val id: String) : GeoModel<T>() {
override fun getModelResource(animatable: T?): Identifier {
val variant = animatable?.variant
override fun getModelResource(animatable: T): Identifier {
val variant = animatable.variant
if (variant != null && !variant.ignore.contains(MODEL))
return Identifier(HybridAquatic.MOD_ID, "geo/fish/${id}/${id}_${variant.getProvidedVariant(animatable)}.geo.json")
return Identifier(HybridAquatic.MOD_ID, "geo/fish/${id}/$id.geo.json")
}

override fun getTextureResource(animatable: T?): Identifier {
val variant = animatable?.variant
override fun getTextureResource(animatable: T): Identifier {
val variant = animatable.variant
if (variant != null && !variant.ignore.contains(TEXTURE))
return Identifier(HybridAquatic.MOD_ID, "textures/entity/fish/${id}/${id}_${variant.getProvidedVariant(animatable)}.png")
return Identifier(HybridAquatic.MOD_ID, "textures/entity/fish/${id}/$id.png")
}

override fun getAnimationResource(animatable: T?): Identifier {
val variant = animatable?.variant
override fun getAnimationResource(animatable: T): Identifier {
val variant = animatable.variant
if (variant != null && !variant.ignore.contains(ANIMATION))
return Identifier(HybridAquatic.MOD_ID, "animations/${id}_${variant.getProvidedVariant(animatable)}.animation.json")
return Identifier(HybridAquatic.MOD_ID, "animations/$id.animation.json")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
package dev.hybridlabs.aquatic.client.model.entity.fish

import dev.hybridlabs.aquatic.entity.fish.HybridAquaticFishEntity
import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class JohnDoryEntityModel : HybridAquaticFishEntityModel<HybridAquaticFishEntity>("john_dory")
class JohnDoryEntityModel : HybridAquaticFishEntityModel<HybridAquaticFishEntity>("john_dory") {
override fun getRenderType(animatable: HybridAquaticFishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package dev.hybridlabs.aquatic.client.model.entity.fish

import dev.hybridlabs.aquatic.entity.fish.HybridAquaticFishEntity
import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class PearlfishEntityModel : HybridAquaticFishEntityModel<HybridAquaticFishEntity>("pearlfish")
class PearlfishEntityModel : HybridAquaticFishEntityModel<HybridAquaticFishEntity>("pearlfish") {
override fun getRenderType(animatable: HybridAquaticFishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class SeaAngelEntityModel : HybridAquaticFishEntityModel<HybridAquaticFishEntity>("sea_angel") {
override fun getRenderType(animatable: HybridAquaticFishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticFishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package dev.hybridlabs.aquatic.client.model.entity.fish

import dev.hybridlabs.aquatic.entity.fish.HybridAquaticFishEntity
import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class SnailfishEntityModel : HybridAquaticFishEntityModel<HybridAquaticFishEntity>("snailfish")
class SnailfishEntityModel : HybridAquaticFishEntityModel<HybridAquaticFishEntity>("snailfish") {
override fun getRenderType(animatable: HybridAquaticFishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import net.minecraft.util.Identifier

class ToadfishEntityModel : HybridAquaticFishEntityModel<ToadfishEntity>("toadfish") {

override fun getTextureResource(animatable: ToadfishEntity?): Identifier {
val puffState = animatable?.getPuffState() ?: 0
override fun getTextureResource(animatable: ToadfishEntity): Identifier {
val puffState = animatable.getPuffState()

val texturePath = when (puffState) {
0 -> "textures/entity/fish/toadfish/toadfish_small.png"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class AtollaJellyfishEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("atolla_jellyfish") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class BarrelJellyfishEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("barrel_jellyfish") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class BigRedJellyfishEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("big_red_jellyfish") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class BlueJellyfishEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("blue_jellyfish") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class BoxJellyfishEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("box_jellyfish") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class CauliflowerJellyfishEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("cauliflower_jellyfish") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class CompassJellyfishEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("compass_jellyfish") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class CosmicJellyfishEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("cosmic_jellyfish") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package dev.hybridlabs.aquatic.client.model.entity.jellyfish

import dev.hybridlabs.aquatic.entity.jellyfish.HybridAquaticJellyfishEntity
import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class FireworkJellyfishEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("firework_jellyfish") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class FriedEggJellyfishEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("fried_egg_jellyfish") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ import net.minecraft.util.Identifier
import software.bernie.geckolib.model.GeoModel

abstract class HybridAquaticJellyfishEntityModel<T: HybridAquaticJellyfishEntity> (private val id: String) : GeoModel<T>() {
override fun getModelResource(animatable: T?): Identifier {
override fun getModelResource(animatable: T): Identifier {
return Identifier(HybridAquatic.MOD_ID, "geo/jellyfish/$id.geo.json")
}

override fun getTextureResource(animatable: T?): Identifier {
override fun getTextureResource(animatable: T): Identifier {
return Identifier(HybridAquatic.MOD_ID, "textures/entity/jellyfish/$id.png")
}

fun getVariantTexture(variant: String): Identifier {
return Identifier(HybridAquatic.MOD_ID, "textures/entity/jellyfish/${id}_$variant.png")
}

override fun getAnimationResource(animatable: T?): Identifier {
override fun getAnimationResource(animatable: T): Identifier {
return Identifier(HybridAquatic.MOD_ID, "animations/$id.animation.json")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class LionsManeJellyfishEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("lions_mane_jellyfish") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class MauveStingerEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("mauve_stinger") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class MoonJellyfishEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("moon_jellyfish") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net.minecraft.client.render.RenderLayer
import net.minecraft.util.Identifier

class NomuraJellyfishEntityModel : HybridAquaticJellyfishEntityModel<HybridAquaticJellyfishEntity>("nomura_jellyfish") {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity?, texture: Identifier?): RenderLayer {
override fun getRenderType(animatable: HybridAquaticJellyfishEntity, texture: Identifier): RenderLayer {
return RenderLayer.getEntityTranslucent(texture)
}
}
Loading

0 comments on commit 7816230

Please sign in to comment.