Skip to content

Commit

Permalink
Updated entity stats
Browse files Browse the repository at this point in the history
Updated jellyfish venom
  • Loading branch information
MysticKoko committed Nov 29, 2023
1 parent f60f516 commit f4233b3
Show file tree
Hide file tree
Showing 62 changed files with 68 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CoconutCrabEntity(entityType: EntityType<out HybridAquaticCritterEntity>,
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 8.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.3)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.hybridlabs.aquatic.entity.critter

import dev.hybridlabs.aquatic.entity.ai.goal.CrabDigGoal
import net.minecraft.entity.EntityType
import net.minecraft.entity.attribute.DefaultAttributeContainer
import net.minecraft.entity.attribute.EntityAttributes
Expand All @@ -12,7 +11,7 @@ class CrabEntity(entityType: EntityType<out HybridAquaticCritterEntity>, world:
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.3)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CrayfishEntity(entityType: EntityType<out HybridAquaticCritterEntity>, wor
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.3)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.hybridlabs.aquatic.entity.critter

import dev.hybridlabs.aquatic.entity.ai.goal.CrabDigGoal
import net.minecraft.entity.EntityGroup
import net.minecraft.entity.EntityType
import net.minecraft.entity.attribute.DefaultAttributeContainer
Expand All @@ -13,7 +12,7 @@ class FiddlerCrabEntity(entityType: EntityType<out HybridAquaticCritterEntity>,
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.3)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.hybridlabs.aquatic.entity.critter

import dev.hybridlabs.aquatic.entity.ai.goal.CrabDigGoal
import net.minecraft.entity.EntityType
import net.minecraft.entity.attribute.DefaultAttributeContainer
import net.minecraft.entity.attribute.EntityAttributes
Expand All @@ -12,7 +11,7 @@ class FlowerCrabEntity(entityType: EntityType<out HybridAquaticCritterEntity>, w
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.3)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.hybridlabs.aquatic.entity.critter

import dev.hybridlabs.aquatic.entity.ai.goal.CrabDigGoal
import net.minecraft.entity.EntityType
import net.minecraft.entity.attribute.DefaultAttributeContainer
import net.minecraft.entity.attribute.EntityAttributes
Expand All @@ -12,7 +11,7 @@ class GhostCrabEntity(entityType: EntityType<out HybridAquaticCritterEntity>, wo
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.3)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class GiantClamEntity(entityType: EntityType<out GiantClamEntity>, world: World)
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder =
WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 18.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 10.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.0)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class GiantIsopodEntity(entityType: EntityType<out HybridAquaticCritterEntity>,
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.3)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class HorseshoeCrabEntity(entityType: EntityType<out HybridAquaticCritterEntity>
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.3)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.hybridlabs.aquatic.entity.critter

import dev.hybridlabs.aquatic.entity.ai.goal.CrabDigGoal
import net.minecraft.entity.EntityType
import net.minecraft.entity.attribute.DefaultAttributeContainer
import net.minecraft.entity.attribute.EntityAttributes
Expand All @@ -12,7 +11,7 @@ class LightfootCrabEntity(entityType: EntityType<out HybridAquaticCritterEntity>
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.3)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MantisShrimpEntity(entityType: EntityType<out HybridAquaticCritterEntity>,
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.4)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class NudibranchEntity(entityType: EntityType<out NudibranchEntity>, world: Worl
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 3.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.2)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SeaCucumberEntity(entityType: EntityType<out SeaCucumberEntity>, world: Wo
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 3.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.2)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 2.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 20.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SeaUrchinEntity(entityType: EntityType<out SeaUrchinEntity>, world: World)
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return PathAwareEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 3.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.2)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 2.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 20.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ShrimpEntity(entityType: EntityType<out HybridAquaticCritterEntity>, world
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.3)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class SpiderCrabEntity(entityType: EntityType<out HybridAquaticCritterEntity>, w
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.3)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class VampireCrabEntity(entityType: EntityType<out HybridAquaticCritterEntity>,
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.3)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import net.minecraft.entity.EntityType
import net.minecraft.entity.attribute.DefaultAttributeContainer
import net.minecraft.entity.attribute.EntityAttributes
import net.minecraft.entity.mob.WaterCreatureEntity
import net.minecraft.registry.tag.BlockTags
import net.minecraft.util.math.BlockPos
import net.minecraft.world.World

Expand All @@ -17,7 +16,7 @@ class YetiCrabEntity(entityType: EntityType<out HybridAquaticCritterEntity>, wor
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.3)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,77 +1,23 @@
package dev.hybridlabs.aquatic.entity.fish

import net.minecraft.entity.Entity
import net.minecraft.entity.EntityType
import net.minecraft.entity.attribute.DefaultAttributeContainer
import net.minecraft.entity.attribute.EntityAttributes
import net.minecraft.entity.mob.WaterCreatureEntity
import net.minecraft.util.math.BlockPos
import net.minecraft.util.math.Box
import net.minecraft.world.Heightmap
import net.minecraft.world.World

class AnglerfishEntity(entityType: EntityType<out AnglerfishEntity>, world: World) :
HybridAquaticFishEntity(entityType, world) {
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 4.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.6)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 2.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 20.0)

}
}

private fun isInDeepWater(): Boolean {
return isSubmergedInWater && isBlockInDeepWater(blockPos)
}

private fun isInShallowWater(): Boolean {
return isSubmergedInWater && !isBlockInDeepWater(blockPos)
}

private fun findNearestDeepWater(): BlockPos? {
val searchRadius = 32
val searchBox = boundingBox.expand(searchRadius.toDouble(), searchRadius.toDouble(), searchRadius.toDouble())
return world.getEntitiesByClass(Entity::class.java, searchBox) { entity -> entity.isSubmergedInWater }
.filterIsInstance<Entity>()
.mapNotNull { entity -> entity.blockPos }
.filter { blockPos -> isBlockInDeepWater(blockPos) }
.minByOrNull { blockPos -> blockPos.getSquaredDistance(x, y, z) }
}

private fun findNearestSurface(): BlockPos? {
val searchRadius = 48
val searchBox = boundingBox.expand(searchRadius.toDouble(), searchRadius.toDouble(), searchRadius.toDouble())
return world.getEntitiesByClass(Entity::class.java, searchBox) { entity -> entity.isSubmergedInWater }
.filterIsInstance<Entity>()
.mapNotNull { entity -> entity.blockPos }
.filter { blockPos -> isBlockAboveWaterSurface(blockPos) }
.minByOrNull { blockPos -> blockPos.getSquaredDistance(x, y, z) }
}

private fun isBlockInDeepWater(blockPos: BlockPos): Boolean {
val waterSurfaceY = world.getTopY(Heightmap.Type.WORLD_SURFACE, blockPos.x, blockPos.z)
val waterTopY = world.getTopY(Heightmap.Type.OCEAN_FLOOR, blockPos.x, blockPos.z)
val waterDepth = waterSurfaceY - waterTopY
return waterDepth >= 22
}

private fun isBlockAboveWaterSurface(blockPos: BlockPos): Boolean {
val waterSurfaceY = world.getTopY(Heightmap.Type.WORLD_SURFACE, blockPos.x, blockPos.z)
return blockPos.y >= waterSurfaceY
}

private fun getBoundingBoxForWaterCheck(): Box {
val collisionBox = boundingBox.contract(0.1)
val yOffset = 0.2
val minY = collisionBox.minY + yOffset
val maxY = collisionBox.maxY
return Box(collisionBox.minX, minY, collisionBox.minZ, collisionBox.maxX, maxY, collisionBox.maxZ)
}

override fun getMaxSize(): Int {
}override fun getMaxSize(): Int {
return 5
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package dev.hybridlabs.aquatic.entity.fish

import net.minecraft.entity.Entity
import net.minecraft.entity.EntityType
import net.minecraft.entity.attribute.DefaultAttributeContainer
import net.minecraft.entity.attribute.EntityAttributes
import net.minecraft.entity.mob.WaterCreatureEntity
import net.minecraft.util.math.BlockPos
import net.minecraft.util.math.Box
import net.minecraft.world.Heightmap
import net.minecraft.world.World

class BarreleyeEntity(entityType: EntityType<out BarreleyeEntity>, world: World) :
Expand All @@ -22,54 +18,6 @@ class BarreleyeEntity(entityType: EntityType<out BarreleyeEntity>, world: World)
}
}

private fun isInDeepWater(): Boolean {
return isSubmergedInWater && isBlockInDeepWater(blockPos)
}

private fun isInShallowWater(): Boolean {
return isSubmergedInWater && !isBlockInDeepWater(blockPos)
}

private fun findNearestDeepWater(): BlockPos? {
val searchRadius = 32
val searchBox = boundingBox.expand(searchRadius.toDouble(), searchRadius.toDouble(), searchRadius.toDouble())
return world.getEntitiesByClass(Entity::class.java, searchBox) { entity -> entity.isSubmergedInWater }
.filterIsInstance<Entity>()
.mapNotNull { entity -> entity.blockPos }
.filter { blockPos -> isBlockInDeepWater(blockPos) }
.minByOrNull { blockPos -> blockPos.getSquaredDistance(x, y, z) }
}

private fun findNearestSurface(): BlockPos? {
val searchRadius = 48
val searchBox = boundingBox.expand(searchRadius.toDouble(), searchRadius.toDouble(), searchRadius.toDouble())
return world.getEntitiesByClass(Entity::class.java, searchBox) { entity -> entity.isSubmergedInWater }
.filterIsInstance<Entity>()
.mapNotNull { entity -> entity.blockPos }
.filter { blockPos -> isBlockAboveWaterSurface(blockPos) }
.minByOrNull { blockPos -> blockPos.getSquaredDistance(x, y, z) }
}

private fun isBlockInDeepWater(blockPos: BlockPos): Boolean {
val waterSurfaceY = world.getTopY(Heightmap.Type.WORLD_SURFACE, blockPos.x, blockPos.z)
val waterTopY = world.getTopY(Heightmap.Type.OCEAN_FLOOR, blockPos.x, blockPos.z)
val waterDepth = waterSurfaceY - waterTopY
return waterDepth >= 22
}

private fun isBlockAboveWaterSurface(blockPos: BlockPos): Boolean {
val waterSurfaceY = world.getTopY(Heightmap.Type.WORLD_SURFACE, blockPos.x, blockPos.z)
return blockPos.y >= waterSurfaceY
}

private fun getBoundingBoxForWaterCheck(): Box {
val collisionBox = boundingBox.contract(0.1)
val yOffset = 0.2
val minY = collisionBox.minY + yOffset
val maxY = collisionBox.maxY
return Box(collisionBox.minX, minY, collisionBox.minZ, collisionBox.maxX, maxY, collisionBox.maxZ)
}

override fun getMaxSize(): Int {
return 5
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BettaEntity(entityType: EntityType<out BettaEntity>, world: World) :
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 3.0)
.add(EntityAttributes.GENERIC_MAX_HEALTH, 2.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.9)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 2.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 20.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ class BlueSpottedStingrayEntity(entityType: EntityType<out BlueSpottedStingrayEn
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 6.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 1.0)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 2.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 20.0)
}
}

Expand Down
Loading

0 comments on commit f4233b3

Please sign in to comment.