Skip to content

Commit

Permalink
Started massive reorganization of resource folder
Browse files Browse the repository at this point in the history
  • Loading branch information
MysticKoko committed Jul 13, 2024
1 parent fdc9777 commit cda9935
Show file tree
Hide file tree
Showing 259 changed files with 90 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
@Mixin(FishingBobberEntityRenderer.class)
public abstract class FishingBobberEntityRendererMixin {
@Unique
private static final RenderLayer BARBED_HOOK_LAYER = getRenderLayer(new Identifier(HybridAquatic.MOD_ID, "textures/entity/barbed_bobber.png"));
private static final RenderLayer BARBED_HOOK_LAYER = getRenderLayer(new Identifier(HybridAquatic.MOD_ID, "textures/entity/bobber/barbed_bobber.png"));
@Unique
private static final RenderLayer GLOWING_HOOK_LAYER = getRenderLayer(new Identifier(HybridAquatic.MOD_ID, "textures/entity/glowing_bobber.png"));
private static final RenderLayer GLOWING_HOOK_LAYER = getRenderLayer(new Identifier(HybridAquatic.MOD_ID, "textures/entity/bobber/glowing_bobber.png"));
@Unique
private static final RenderLayer MAGNETIC_HOOK_LAYER = getRenderLayer(new Identifier(HybridAquatic.MOD_ID, "textures/entity/magnetic_bobber.png"));
private static final RenderLayer MAGNETIC_HOOK_LAYER = getRenderLayer(new Identifier(HybridAquatic.MOD_ID, "textures/entity/bobber/magnetic_bobber.png"));
@Unique
private static final RenderLayer CREEPERMAGNET_HOOK_LAYER = getRenderLayer(new Identifier(HybridAquatic.MOD_ID, "textures/entity/creepermagnet_bobber.png"));
private static final RenderLayer CREEPERMAGNET_HOOK_LAYER = getRenderLayer(new Identifier(HybridAquatic.MOD_ID, "textures/entity/bobber/creepermagnet_bobber.png"));
@Unique
private static final RenderLayer OMINOUS_HOOK_LAYER = getRenderLayer(new Identifier(HybridAquatic.MOD_ID, "textures/entity/ominous_bobber.png"));
private static final RenderLayer OMINOUS_HOOK_LAYER = getRenderLayer(new Identifier(HybridAquatic.MOD_ID, "textures/entity/bobber/ominous_bobber.png"));

@Unique
FishingBobberEntity entity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ abstract class HybridAquaticCephalopodEntityModel<T: HybridAquaticCephalopodEnti
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/${id}_${variant.variantName}.png")
return Identifier(HybridAquatic.MOD_ID, "textures/entity/$id.png")
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ abstract class HybridAquaticCritterEntityModel<T: HybridAquaticCritterEntity> (p
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/${id}_${variant.getProvidedVariant(animatable)}.png")
return Identifier(HybridAquatic.MOD_ID, "textures/entity/$id.png")
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ abstract class HybridAquaticCrustaceanEntityModel<T: HybridAquaticCrustaceanEnti
}

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

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

override fun getAnimationResource(animatable: T?): Identifier {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ abstract class HybridAquaticFishEntityModel<T: HybridAquaticFishEntity> (private
override fun getTextureResource(animatable: T?): Identifier {
val variant = animatable?.variant
if (variant != null && !variant.ignore.contains(TEXTURE))
return Identifier(HybridAquatic.MOD_ID, "textures/entity/${id}_${variant.getProvidedVariant(animatable)}.png")
return Identifier(HybridAquatic.MOD_ID, "textures/entity/$id.png")
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ abstract class HybridAquaticRayEntityModel<T: HybridAquaticRayEntity> (private v
override fun getTextureResource(animatable: T?): Identifier {
val variant = animatable?.variant
if (variant != null && !variant.ignore.contains(TEXTURE))
return Identifier(HybridAquatic.MOD_ID, "textures/entity/${id}_${variant.getProvidedVariant(animatable)}.png")
return Identifier(HybridAquatic.MOD_ID, "textures/entity/$id.png")
return Identifier(HybridAquatic.MOD_ID, "textures/entity/fish/${id}_${variant.getProvidedVariant(animatable)}.png")
return Identifier(HybridAquatic.MOD_ID, "textures/entity/fish.$id.png")
}

override fun getAnimationResource(animatable: T?): Identifier {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ abstract class HybridAquaticJellyfishEntityModel<T: HybridAquaticJellyfishEntity
}

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

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

override fun getAnimationResource(animatable: T?): Identifier {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ abstract class HybridAquaticSharkEntityModel<T : HybridAquaticSharkEntity> (
}

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

override fun getAnimationResource(animatable: T?): Identifier {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import net.minecraft.entity.SpawnGroup;

public enum HybridAquaticSpawnGroup {
FISH("ha_fish", 5, true, false, 64),
FISH_UNDERGROUND("ha_fish_underground", 3, true, false, 64),
CEPHALOPOD("ha_cephalopod", 5, true, true, 64),
CEPHALOPOD_UNDERGROUND("ha_cephalopod_underground", 3, true, false, 64),
JELLY("ha_jelly", 5, true, false, 64),
JELLY_UNDERGROUND("ha_jelly_underground", 3, true, false, 64),
SHARK("ha_shark", 3, true, true, 64),
CRUSTACEAN("crustacean", 5, true, false, 64),
CRUSTACEAN_UNDERGROUND("crustacean_underground", 3, true, false, 64),
CRITTER("ha_critter", 5, true, false, 64);
FISH("ha_fish", 8, true, false, 64),
FISH_UNDERGROUND("ha_fish_underground", 8, true, false, 64),
CEPHALOPOD("ha_cephalopod", 4, true, true, 64),
CEPHALOPOD_UNDERGROUND("ha_cephalopod_underground", 4, true, false, 64),
JELLY("ha_jelly", 6, true, false, 64),
JELLY_UNDERGROUND("ha_jelly_underground", 2, true, false, 64),
SHARK("ha_shark", 6, true, true, 64),
CRUSTACEAN("crustacean", 6, true, false, 64),
CRUSTACEAN_UNDERGROUND("crustacean_underground", 6, true, false, 64),
CRITTER("ha_critter", 6, true, false, 64);

public SpawnGroup spawnGroup;
public final String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ open class HybridAquaticCephalopodEntity(
}

override fun getLimitPerChunk(): Int {
return 4
return 2
}

override fun getAmbientSound(): SoundEvent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class CarpEntity(entityType: EntityType<out CarpEntity>, world: World) :
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.7)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.6)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 1.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 12.0)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class ClownfishEntity(entityType: EntityType<out ClownfishEntity>, world: World)
"orange_skunk" to FishVariant.biomeVariant("orange_skunk", HybridAquaticBiomeTags.CLOWNFISH_SPAWN_BIOMES),),
HybridAquaticEntityTags.NONE, HybridAquaticEntityTags.CLOWNFISH_PREDATOR) {

override fun getLimitPerChunk(): Int {
return 2
}

public override fun getLootTableId(): Identifier {
return when (this.variant?.variantName) {
"ocellaris" -> Identifier("hybrid-aquatic", "entities/clownfish")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import net.minecraft.world.World

class MahiMahiEntity(entityType: EntityType<out MahiMahiEntity>, world: World) :
HybridAquaticFishEntity(entityType, world, emptyMap(), HybridAquaticEntityTags.MAHI_PREY, HybridAquaticEntityTags.MAHI_PREDATOR) {

override fun getLimitPerChunk(): Int {
return 2
}
override fun initGoals() {
super.initGoals()
goalSelector.add(5, FishJumpGoal(this, 10))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MorayEelEntity(entityType: EntityType<out MorayEelEntity>, world: World) :
HybridAquaticFishEntity(entityType, world, emptyMap(), HybridAquaticEntityTags.MORAY_EEL_PREY, HybridAquaticEntityTags.MORAY_EEL_PREDATOR) {

override fun getLimitPerChunk(): Int {
return 1
return 2
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class OpahEntity(entityType: EntityType<out OpahEntity>, world: World) :
HybridAquaticFishEntity(entityType, world, emptyMap(), HybridAquaticEntityTags.OPAH_PREY, HybridAquaticEntityTags.OPAH_PREDATOR) {

override fun getLimitPerChunk(): Int {
return 1
return 2
}

companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import net.minecraft.world.World
class RockfishEntity(entityType: EntityType<out RockfishEntity>, world: World) :
HybridAquaticSchoolingFishEntity(entityType, world, HybridAquaticEntityTags.NONE, HybridAquaticEntityTags.ROCKFISH_PREDATOR) {

override fun getLimitPerChunk(): Int {
return 4
}

companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class StonefishEntity(entityType: EntityType<out StonefishEntity>, world: World)
HybridAquaticFishEntity(entityType, world, emptyMap(), HybridAquaticEntityTags.NONE, HybridAquaticEntityTags.NONE) {

override fun getLimitPerChunk(): Int {
return 1
return 2
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SunfishEntity(entityType: EntityType<out SunfishEntity>, world: World) :
HybridAquaticEntityTags.SUNFISH_PREY, HybridAquaticEntityTags.SUNFISH_PREDATOR) {

override fun getLimitPerChunk(): Int {
return 1
return 2
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TriggerfishEntity(entityType: EntityType<out TriggerfishEntity>, world: Wo
HybridAquaticFishEntity(entityType, world, emptyMap(), HybridAquaticEntityTags.TRIGGERFISH_PREY, HybridAquaticEntityTags.TRIGGERFISH_PREDATOR) {

override fun getLimitPerChunk(): Int {
return 1
return 2
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import net.minecraft.world.World
class TunaEntity(entityType: EntityType<out TunaEntity>, world: World) :
HybridAquaticSchoolingFishEntity(entityType, world, HybridAquaticEntityTags.TUNA_PREY, HybridAquaticEntityTags.TUNA_PREDATOR) {

override fun getLimitPerChunk(): Int {
return 4
}

override fun initGoals() {
super.initGoals()
goalSelector.add(5, FishJumpGoal(this, 10))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AnglerfishEntity(entityType: EntityType<out AnglerfishEntity>, world: Worl
HybridAquaticDeepSeaFishEntity(entityType, world, emptyMap(), HybridAquaticEntityTags.ANGLERFISH_PREY, HybridAquaticEntityTags.ANGLERFISH_PREDATOR) {

override fun getLimitPerChunk(): Int {
return 1
return 3
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BarreleyeEntity(entityType: EntityType<out BarreleyeEntity>, world: World)
HybridAquaticDeepSeaFishEntity(entityType, world, emptyMap(), HybridAquaticEntityTags.NONE, HybridAquaticEntityTags.NONE) {

override fun getLimitPerChunk(): Int {
return 1
return 2
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DragonfishEntity(entityType: EntityType<out DragonfishEntity>, world: Worl
HybridAquaticDeepSeaFishEntity(entityType, world, emptyMap(), HybridAquaticEntityTags.DRAGONFISH_PREY, HybridAquaticEntityTags.DRAGONFISH_PREDATOR) {

override fun getLimitPerChunk(): Int {
return 2
return 4
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class OarfishEntity(entityType: EntityType<out OarfishEntity>, world: World) :
HybridAquaticDeepSeaFishEntity(entityType, world, emptyMap(), HybridAquaticEntityTags.OARFISH_PREY, HybridAquaticEntityTags.OARFISH_PREDATOR) {

override fun getLimitPerChunk(): Int {
return 1
return 2
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ open class HybridAquaticRayEntity(
if (spawnReason == SpawnReason.SPAWN_EGG) {
variantKey = variants.keys.elementAt(random.nextBetween(0, variants.size - 1))
} else {
// Handle collisions
val validKeys = variants.filter { it.value.spawnCondition(world, spawnReason, blockPos, random) }.map { it.key }

if (validKeys.isEmpty()) {
Expand All @@ -103,7 +102,6 @@ open class HybridAquaticRayEntity(
}
}
} else {
// Default to a priority based system
val validityFilter = variants.filter { validKeys.contains(it.key) }
variantKey = if (validityFilter.isNotEmpty()) {
val maxPriority = validityFilter.values.maxOf { it.priority }
Expand Down Expand Up @@ -224,7 +222,7 @@ open class HybridAquaticRayEntity(
}

override fun getLimitPerChunk(): Int {
return 2
return 4
}

// region Properties
Expand Down Expand Up @@ -379,9 +377,6 @@ open class HybridAquaticRayEntity(
}

companion object {
/**
* Creates a biome variant of a fish
*/
fun biomeVariant(variantName: String, biomes : TagKey<Biome>, ignore : List<Ignore> = emptyList()): RayVariant {
return RayVariant(variantName, { world, _, pos, _ ->
world.getBiome(pos).isIn(biomes)
Expand All @@ -399,41 +394,16 @@ open class HybridAquaticRayEntity(
@Suppress("UNUSED")
data class VariantCollisionRules(val variants : Set<String>, val collisionHandler: (Set<String>, Random, ServerWorldAccess) -> String, val exclusionStatus: ExclusionStatus = INCLUSIVE) {

/**
* INCLUSIVE - all other variants can exist within this selection swath
* <pre> </pre>
* EXCLUSIVE - all other variants are excluded from this selection swath
*/
enum class ExclusionStatus {
INCLUSIVE,
EXCLUSIVE
}

/**
* <pre></pre>
* Example:
* ```kotlin
* // returns a bluefin or a yellowfin tuna variant
* equalDistribution(setOf("bluefin", "yellowfin"))
* ```
* @return a random variant within the set
*/
fun equalDistribution(variants: Set<String>, status : ExclusionStatus = INCLUSIVE) : VariantCollisionRules {
return VariantCollisionRules(variants, { possibleVariants, _, _ ->
possibleVariants.random()
}, status)
}

/**
* Example
* ```
* weightedDistribution(setOf(
* Pair("bluefin", 0.80),
* Pair("yellowfin", 0.20)
* ))
* ```
* @return a premade variant collision rule which allows weighted distribution of variants.
*/
fun weightedDistribution(weights: Set<Pair<String, Double>>, status: ExclusionStatus = EXCLUSIVE) : VariantCollisionRules {
return VariantCollisionRules(weights.map { pair -> pair.first }.toSet(), { _, random, _ ->
// sum up weights
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import net.minecraft.world.World

class AtollaJellyfishEntity(entityType: EntityType<out AtollaJellyfishEntity>, world: World) : HybridAquaticJellyfishEntity(entityType, world, true) {

override fun getLimitPerChunk(): Int {
return 2
}

override fun initGoals() {
super.initGoals()
goalSelector.add(0, StayDeepGoal(this))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import net.minecraft.world.World

class BlueJellyfishEntity(entityType: EntityType<out BlueJellyfishEntity>, world: World) : HybridAquaticJellyfishEntity(entityType, world, true) {

override fun getLimitPerChunk(): Int {
return 2
}

companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import net.minecraft.world.World

class CauliflowerJellyfishEntity(entityType: EntityType<out CauliflowerJellyfishEntity>, world: World) : HybridAquaticJellyfishEntity(entityType, world, false) {

override fun getLimitPerChunk(): Int {
return 2
}

companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import net.minecraft.world.World

class CompassJellyfishEntity(entityType: EntityType<out CompassJellyfishEntity>, world: World) : HybridAquaticJellyfishEntity(entityType, world, true) {

override fun getLimitPerChunk(): Int {
return 2
}

companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
Expand Down
Loading

0 comments on commit cda9935

Please sign in to comment.