Skip to content

Commit

Permalink
Temporarily removed thalassophobia, crab pots, and mantis shrimp
Browse files Browse the repository at this point in the history
Added colors to all new spawn eggs
Edited entity loot tables
Edited some item tags
Fixed seahorse texture issue
Fixed seahorse AI issue
Removed whale shark glow
  • Loading branch information
MysticKoko committed Jan 15, 2024
1 parent 5cba4d2 commit 4480264
Show file tree
Hide file tree
Showing 22 changed files with 1,467 additions and 92 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
package dev.hybridlabs.aquatic.mixin.client;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import dev.hybridlabs.aquatic.fog.ThalassophobiaFogModifier;
import dev.hybridlabs.aquatic.utils.MeasurementUtils;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.render.BackgroundRenderer;
import net.minecraft.client.render.BackgroundRenderer.BlindnessFogModifier;
import net.minecraft.client.render.BackgroundRenderer.DarknessFogModifier;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.CameraSubmersionType;
import net.minecraft.client.render.FogShape;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.registry.tag.BiomeTags;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import dev.hybridlabs.aquatic.effect.HybridAquaticStatusEffects;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
Expand All @@ -36,13 +26,6 @@ public class BackgroundRendererMixin {
@Shadow private static float red, green, blue;
@Mutable @Final @Shadow private static List<BackgroundRenderer.StatusEffectFogModifier> FOG_MODIFIERS;

@Inject(method = "<clinit>", at = @At("TAIL"))
private static void hybrid$initInject(CallbackInfo ci) {
List<BackgroundRenderer.StatusEffectFogModifier> tempList = FOG_MODIFIERS;
tempList.add(new ThalassophobiaFogModifier());
FOG_MODIFIERS = tempList;
System.out.println(FOG_MODIFIERS);
}

// @Inject(method = "render", at=@At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;clearColor(FFFF)V"), locals = LocalCapture.CAPTURE_FAILHARD)
// private static void hybrid$fogColor(Camera camera, float tickDelta, ClientWorld world, int viewDistance, float skyDarkness, CallbackInfo ci, CameraSubmersionType cameraSubmersionType, Entity entity) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package dev.hybridlabs.aquatic.client.model.entity

import dev.hybridlabs.aquatic.entity.critter.HybridAquaticCritterEntity

class KarkinosEntityModel : HybridAquaticCritterEntityModel<HybridAquaticCritterEntity>("karkinos")
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ object HybridAquaticEntityRenderers {
//endregion

//region critters
val KARKINOS = EntityRendererRegistry.register(HybridAquaticEntityTypes.KARKINOS, ::KarkinosEntityRenderer)
val CRAB = EntityRendererRegistry.register(HybridAquaticEntityTypes.CRAB, ::CrabEntityRenderer)
val FIDDLER_CRAB = EntityRendererRegistry.register(HybridAquaticEntityTypes.FIDDLER_CRAB, ::FiddlerCrabEntityRenderer)
val GHOST_CRAB = EntityRendererRegistry.register(HybridAquaticEntityTypes.GHOST_CRAB, ::GhostCrabEntityRenderer)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package dev.hybridlabs.aquatic.client.render.entity

import dev.hybridlabs.aquatic.client.model.entity.KarkinosEntityModel
import dev.hybridlabs.aquatic.entity.critter.HybridAquaticCritterEntity
import net.minecraft.client.render.VertexConsumerProvider
import net.minecraft.client.render.entity.EntityRendererFactory.Context
import net.minecraft.client.util.math.MatrixStack
import software.bernie.geckolib.renderer.GeoEntityRenderer

class KarkinosEntityRenderer(context: Context) : GeoEntityRenderer<HybridAquaticCritterEntity>(context, KarkinosEntityModel()) {
override fun render(
entity: HybridAquaticCritterEntity?,
entityYaw: Float,
partialTick: Float,
poseStack: MatrixStack?,
bufferSource: VertexConsumerProvider?,
packedLight: Int
) {
val size = HybridAquaticCritterEntity.getScaleAdjustment(entity!!, 0.05f)
poseStack!!.scale(size, size, size)
super.render(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight)
}

override fun getMotionAnimThreshold(animatable: HybridAquaticCritterEntity?): Float {
return 0.0025f
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import net.minecraft.client.render.VertexConsumerProvider
import net.minecraft.client.render.entity.EntityRendererFactory.Context
import net.minecraft.client.util.math.MatrixStack
import software.bernie.geckolib.renderer.GeoEntityRenderer
import software.bernie.geckolib.renderer.layer.AutoGlowingGeoLayer
class WhaleSharkEntityRenderer(context: Context) : GeoEntityRenderer<HybridAquaticSharkEntity>(context, WhaleSharkEntityModel()) {
init {
addRenderLayer(AutoGlowingGeoLayer(this))
}
override fun render(
entity: HybridAquaticSharkEntity?,
entityYaw: Float,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"type": "minecraft:entity",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"conditions": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"flags": {
"is_on_fire": true
}
}
}
],
"function": "minecraft:furnace_smelt"
},
{
"count": {
"type": "minecraft:uniform",
"max": 1.0,
"min": 0.0
},
"function": "minecraft:looting_enchant"
},
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 2.0,
"min": 1.0
},
"function": "minecraft:set_count"
}
],
"name": "hybrid-aquatic:crab_claw"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"type": "minecraft:entity",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"conditions": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"flags": {
"is_on_fire": true
}
}
}
],
"function": "minecraft:furnace_smelt"
},
{
"count": {
"type": "minecraft:uniform",
"max": 1.0,
"min": 0.0
},
"function": "minecraft:looting_enchant"
},
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 2.0,
"min": 1.0
},
"function": "minecraft:set_count"
}
],
"name": "hybrid-aquatic:crab_claw"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,30 @@ class EntityTypeLootTableProvider(output: FabricDataOutput) : SimpleFabricLootTa
)
}

export(exporter, HybridAquaticEntityTypes.LOBSTER) {
pool(
LootPool.builder()
.with(
ItemEntry.builder(HybridAquaticItems.CRAB_CLAW)
.apply(FurnaceSmeltLootFunction.builder().conditionally(EntityPropertiesLootCondition.builder(LootContext.EntityTarget.THIS, NEEDS_ENTITY_ON_FIRE)))
.apply(LootingEnchantLootFunction.builder(UniformLootNumberProvider.create(0.0F, 1.0F)))
.apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(1.0F, 2.0F)))
)
)
}

export(exporter, HybridAquaticEntityTypes.CRAYFISH) {
pool(
LootPool.builder()
.with(
ItemEntry.builder(HybridAquaticItems.CRAB_CLAW)
.apply(FurnaceSmeltLootFunction.builder().conditionally(EntityPropertiesLootCondition.builder(LootContext.EntityTarget.THIS, NEEDS_ENTITY_ON_FIRE)))
.apply(LootingEnchantLootFunction.builder(UniformLootNumberProvider.create(0.0F, 1.0F)))
.apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(1.0F, 2.0F)))
)
)
}

// cephalopods
export(exporter, HybridAquaticEntityTypes.VAMPIRE_SQUID) {
pool(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,13 @@ object HybridAquaticEntityTypes {
YetiCrabEntity.createMobAttributes()
)

val KARKINOS = registerCritter(
"karkinos",
::KarkinosEntity,
EntityDimensions.fixed(2.25f, 1.25f),
KarkinosEntity.createMobAttributes()
)


//critters

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package dev.hybridlabs.aquatic.entity.critter

import net.minecraft.enchantment.EnchantmentHelper
import net.minecraft.enchantment.Enchantments
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.entity.player.PlayerEntity
import net.minecraft.world.Difficulty
import net.minecraft.world.World
import software.bernie.geckolib.core.animatable.GeoAnimatable
import software.bernie.geckolib.core.animation.AnimationState
import software.bernie.geckolib.core.`object`.PlayState

class KarkinosEntity(entityType: EntityType<out HybridAquaticCritterEntity>, world: World) :
HybridAquaticCrabEntity(entityType, world) {

private var isFlipped: Boolean = false
private var flipTimer: Int = 0

companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 100.0)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.6)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.0)
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 32.0)
.add(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, 100.0)
}
}

private fun beFlipped() {
isFlipped = true
flipTimer = 100
}

override fun damage(source: net.minecraft.entity.damage.DamageSource?, amount: Float): Boolean {
val damaged = super.damage(source, amount)

if (damaged && source?.source is PlayerEntity && !isFlipped) {
val player = source.source as PlayerEntity
val heldItem = player.mainHandStack

if (EnchantmentHelper.getLevel(Enchantments.BANE_OF_ARTHROPODS, heldItem) > 2 ||
(EnchantmentHelper.getLevel(Enchantments.RIPTIDE, heldItem) > 0)
) {
beFlipped()
}
}

return damaged
}

override fun checkDespawn() {
if (world.difficulty == Difficulty.PEACEFUL && this.isDisallowedInPeaceful) {
discard()
} else {
despawnCounter = 0
}
}

override fun isPushable(): Boolean =
this.isFlipped



override fun <E : GeoAnimatable> predicate(event: AnimationState<E>): PlayState {
if (isFlipped) {
event.controller.setAnimation(FLIPPED_ANIMATION)
return PlayState.CONTINUE
}

return super.predicate(event)
}


override fun getMovementSpeed(): Float {
return if (isFlipped) 0.0f else super.getMovementSpeed()
}
}
Loading

0 comments on commit 4480264

Please sign in to comment.