Skip to content

Commit

Permalink
Actually fixed lol
Browse files Browse the repository at this point in the history
  • Loading branch information
N1nn1 committed Jul 14, 2024
1 parent afbf862 commit 326f1fb
Show file tree
Hide file tree
Showing 17 changed files with 109 additions and 51 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/ninni/spawn/entity/AnglerFish.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public class AnglerFish extends AbstractFish implements Bucketable, PathFindingF

public AnglerFish(EntityType<? extends AnglerFish> type, Level world) {
super(type, world);
this.moveControl = new SmoothSwimmingMoveControl(this, 85, 10, 0.02f, 0.1f, true);
this.lookControl = new SmoothSwimmingLookControl(this, 10);
}

public boolean isDeflated() {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/ninni/spawn/entity/Herring.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import net.minecraft.world.entity.SpawnGroupData;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.control.SmoothSwimmingLookControl;
import net.minecraft.world.entity.ai.control.SmoothSwimmingMoveControl;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.ServerLevelAccessor;
Expand All @@ -26,6 +28,8 @@ public class Herring extends BoidFishEntity {
private static final EntityDataAccessor<Integer> SCHOOL_SIZE = SynchedEntityData.defineId(Herring.class, EntityDataSerializers.INT);
public Herring(EntityType<? extends BoidFishEntity> entityType, Level level) {
super(entityType, level);
this.moveControl = new SmoothSwimmingMoveControl(this, 85, 10, 0.02f, 0.1f, true);
this.lookControl = new SmoothSwimmingLookControl(this, 10);
}

@Override
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/com/ninni/spawn/mixin/AbstractFishMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ private AbstractFishMixin(EntityType<? extends WaterAnimal> entityType, Level wo
super(entityType, world);
}


@Inject(method = "<init>", at = @At("TAIL"))
private void S$init(EntityType<? extends AbstractFish> entityType, Level level, CallbackInfo ci) {
AbstractFish that = AbstractFish.class.cast(this);
if ((that instanceof Cod) || (that instanceof Salmon) || (that instanceof TropicalFish)) {
this.moveControl = new SmoothSwimmingMoveControl(this, 85, 10, 0.02f, 0.1f, true);
this.lookControl = new SmoothSwimmingLookControl(this, 10);
}
}

@Inject(method = "aiStep", at = @At("HEAD"), cancellable = true)
private void S$aiStep(CallbackInfo ci) {
AbstractFish that = AbstractFish.class.cast(this);
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/com/ninni/spawn/mixin/tweaks/CodMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.ninni.spawn.mixin.tweaks;

import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.control.SmoothSwimmingLookControl;
import net.minecraft.world.entity.ai.control.SmoothSwimmingMoveControl;
import net.minecraft.world.entity.animal.*;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(Cod.class)
public abstract class CodMixin extends AbstractSchoolingFish {
protected CodMixin(EntityType<? extends AbstractSchoolingFish> entityType, Level level) {
super(entityType, level);
}

@Inject(method = "<init>", at = @At("TAIL"))
private void S$init(EntityType<? extends AbstractSchoolingFish> entityType, Level level, CallbackInfo ci) {
this.moveControl = new SmoothSwimmingMoveControl(this, 85, 10, 0.02f, 0.1f, true);
this.lookControl = new SmoothSwimmingLookControl(this, 10);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ninni.spawn.mixin;
package com.ninni.spawn.mixin.tweaks;

import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.VariantHolder;
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/com/ninni/spawn/mixin/tweaks/SalmonMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.ninni.spawn.mixin.tweaks;

import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.control.SmoothSwimmingLookControl;
import net.minecraft.world.entity.ai.control.SmoothSwimmingMoveControl;
import net.minecraft.world.entity.animal.*;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(Salmon.class)
public abstract class SalmonMixin extends AbstractSchoolingFish {
protected SalmonMixin(EntityType<? extends AbstractSchoolingFish> entityType, Level level) {
super(entityType, level);
}

@Inject(method = "<init>", at = @At("TAIL"))
private void S$init(EntityType<? extends AbstractSchoolingFish> entityType, Level level, CallbackInfo ci) {
this.moveControl = new SmoothSwimmingMoveControl(this, 85, 10, 0.02f, 0.1f, true);
this.lookControl = new SmoothSwimmingLookControl(this, 10);
}
}
24 changes: 24 additions & 0 deletions src/main/java/com/ninni/spawn/mixin/tweaks/TropicalFishMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.ninni.spawn.mixin.tweaks;

import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.control.SmoothSwimmingLookControl;
import net.minecraft.world.entity.ai.control.SmoothSwimmingMoveControl;
import net.minecraft.world.entity.animal.*;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(TropicalFish.class)
public abstract class TropicalFishMixin extends AbstractSchoolingFish {
protected TropicalFishMixin(EntityType<? extends AbstractSchoolingFish> entityType, Level level) {
super(entityType, level);
}

@Inject(method = "<init>", at = @At("TAIL"))
private void S$init(EntityType<? extends AbstractSchoolingFish> entityType, Level level, CallbackInfo ci) {
this.moveControl = new SmoothSwimmingMoveControl(this, 85, 10, 0.02f, 0.1f, true);
this.lookControl = new SmoothSwimmingLookControl(this, 10);
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
package com.ninni.spawn.mixin.client;
package com.ninni.spawn.mixin.tweaks.client;

import com.mojang.blaze3d.vertex.PoseStack;
import com.ninni.spawn.SpawnRPTweaks;
import com.ninni.spawn.client.model.BatRemodel;
import com.ninni.spawn.client.model.RabbitRemodel;
import com.ninni.spawn.registry.SpawnEntityModelLayers;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.model.BatModel;
import net.minecraft.client.model.RabbitModel;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.BatRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.RabbitRenderer;
import net.minecraft.world.entity.ambient.Bat;
import net.minecraft.world.entity.animal.Rabbit;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.ninni.spawn.mixin.client;
package com.ninni.spawn.mixin.tweaks.client;

import com.ninni.spawn.SpawnRPTweaks;
import net.minecraft.client.model.CodModel;
import net.minecraft.client.model.HierarchicalModel;
import net.minecraft.client.model.SalmonModel;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.CubeListBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
package com.ninni.spawn.mixin.client;
package com.ninni.spawn.mixin.tweaks.client;

import com.mojang.blaze3d.vertex.PoseStack;
import com.ninni.spawn.SpawnRPTweaks;
import com.ninni.spawn.client.model.ParrotRemodel;
import com.ninni.spawn.registry.SpawnEntityModelLayers;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ParrotModel;
import net.minecraft.client.model.PlayerModel;
import net.minecraft.client.model.geom.EntityModelSet;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.RenderLayerParent;
import net.minecraft.client.renderer.entity.layers.ParrotOnShoulderLayer;
import net.minecraft.client.renderer.entity.layers.RenderLayer;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Player;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package com.ninni.spawn.mixin.client;
package com.ninni.spawn.mixin.tweaks.client;

import com.mojang.blaze3d.vertex.PoseStack;
import com.ninni.spawn.SpawnRPTweaks;
import com.ninni.spawn.client.model.ParrotRemodel;
import com.ninni.spawn.registry.SpawnEntityModelLayers;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ParrotModel;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.ParrotRenderer;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.animal.Parrot;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
package com.ninni.spawn.mixin.client;
package com.ninni.spawn.mixin.tweaks.client;

import com.mojang.blaze3d.vertex.PoseStack;
import com.ninni.spawn.SpawnRPTweaks;
import com.ninni.spawn.client.model.ParrotRemodel;
import com.ninni.spawn.client.model.RabbitRemodel;
import com.ninni.spawn.registry.SpawnEntityModelLayers;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.model.ParrotModel;
import net.minecraft.client.model.RabbitModel;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.ParrotRenderer;
import net.minecraft.client.renderer.entity.RabbitRenderer;
import net.minecraft.world.entity.animal.Parrot;
import net.minecraft.world.entity.animal.Rabbit;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ninni.spawn.mixin.client;
package com.ninni.spawn.mixin.tweaks.client;

import com.ninni.spawn.SpawnRPTweaks;
import net.minecraft.client.model.HierarchicalModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ninni.spawn.mixin.client;
package com.ninni.spawn.mixin.tweaks.client;

import com.ninni.spawn.SpawnRPTweaks;
import net.minecraft.client.model.ColorableHierarchicalModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.ninni.spawn.mixin.client;
package com.ninni.spawn.mixin.tweaks.client;

import com.ninni.spawn.SpawnRPTweaks;
import net.minecraft.client.model.ColorableHierarchicalModel;
import net.minecraft.client.model.TropicalFishModelA;
import net.minecraft.client.model.TropicalFishModelB;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.ninni.spawn.mixin.client;
package com.ninni.spawn.mixin.tweaks.client;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.ninni.spawn.SpawnRPTweaks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.QuadrupedModel;
import net.minecraft.client.model.TurtleModel;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.animal.Turtle;
import org.spongepowered.asm.mixin.Final;
Expand Down
36 changes: 21 additions & 15 deletions src/main/resources/spawn.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
"package": "com.ninni.spawn.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"accessor.NoiseGeneratorSettingsAccessor",
"accessor.PlayerAccessor",
"accessor.TropicalFishAccessor",

"tweaks.CodMixin",
"tweaks.RabbitMixin",
"tweaks.SalmonMixin",
"tweaks.TropicalFishMixin",

"AbstractFishMixin",
"BlockEntityTypeMixin",
"ChestBlockMixin",
Expand All @@ -15,25 +24,22 @@
"OverworldBiomeBuilderMixin",
"PlayerMixin",
"PoseMixin",
"RabbitMixin",
"ServerPlayerMixin",
"accessor.NoiseGeneratorSettingsAccessor",
"accessor.PlayerAccessor",
"accessor.TropicalFishAccessor"
"ServerPlayerMixin"
],
"client": [
"tweaks.client.BatRendererMixin",
"tweaks.client.CodModelMixin",
"tweaks.client.ParrotOnShoulderLayerMixin",
"tweaks.client.ParrotRendererMixin",
"tweaks.client.RabbitRendererMixin",
"tweaks.client.SalmonModelMixin",
"tweaks.client.TropicalFishModelAMixin",
"tweaks.client.TropicalFishModelBMixin",
"tweaks.client.TurtleModelMixin",

"client.AxolotlModelMixin",
"client.BatRendererMixin",
"client.BlockEntityWithoutLevelRendererMixin",
"client.CodModelMixin",
"client.ParrotOnShoulderLayerMixin",
"client.ParrotRendererMixin",
"client.PufferfishRendererMixin",
"client.RabbitRendererMixin",
"client.SalmonModelMixin",
"client.TropicalFishModelAMixin",
"client.TropicalFishModelBMixin",
"client.TurtleModelMixin"
"client.BlockEntityWithoutLevelRendererMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit 326f1fb

Please sign in to comment.