This commit is contained in:
2025-10-01 20:25:54 +02:00
parent 1bf5487600
commit 49246d47a4
4 changed files with 22 additions and 6 deletions

View File

@@ -2,13 +2,13 @@
org.gradle.jvmargs=-Xmx1G org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://modmuss50.me/fabric.html # check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.8 minecraft_version=1.21.9
yarn_mappings=1.21.8+build.1 yarn_mappings=1.21.9+build.1
loader_version=0.16.14 loader_version=0.17.2
# Mod Properties # Mod Properties
mod_version=1.0 mod_version=1.1
maven_group=com.kasetoatz maven_group=com.kasetoatz
archives_base_name=hungryfrog archives_base_name=hungryfrog
# Dependencies # Dependencies
# check this on https://modmuss50.me/fabric.html # check this on https://modmuss50.me/fabric.html
fabric_version=0.131.0+1.21.8 fabric_version=0.133.14+1.21.9

View File

@@ -0,0 +1,14 @@
package com.kasetoatz.hungryfrog.mixin;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.FrogEntity;
import net.minecraft.util.math.Vec3d;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(Entity.class)
public interface EntityAccessor
{
@Accessor("pos")
Vec3d getPos();
}

View File

@@ -2,6 +2,7 @@ package com.kasetoatz.hungryfrog.task;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.kasetoatz.hungryfrog.HungryFrog; import com.kasetoatz.hungryfrog.HungryFrog;
import com.kasetoatz.hungryfrog.mixin.EntityAccessor;
import net.minecraft.block.*; import net.minecraft.block.*;
import net.minecraft.command.argument.EntityAnchorArgumentType; import net.minecraft.command.argument.EntityAnchorArgumentType;
import net.minecraft.entity.EntityPose; import net.minecraft.entity.EntityPose;
@@ -163,7 +164,7 @@ public class FrogEatBlockTask extends MultiTickTask<FrogEntity>
switch (this.phase) switch (this.phase)
{ {
case MOVE_TO_TARGET: case MOVE_TO_TARGET:
if (frog.getPos().distanceTo(Vec3d.of(pos)) < 1.75F) if (((EntityAccessor)frog).getPos().distanceTo(Vec3d.of(pos)) < 1.75F)
{ {
world.playSoundFromEntity(null, frog, TONGUE_SOUND, SoundCategory.NEUTRAL, 2.0F, 1.0F); world.playSoundFromEntity(null, frog, TONGUE_SOUND, SoundCategory.NEUTRAL, 2.0F, 1.0F);
frog.setPose(EntityPose.USING_TONGUE); frog.setPose(EntityPose.USING_TONGUE);

View File

@@ -6,6 +6,7 @@
"mixins": [ "mixins": [
"BrainAccessor", "BrainAccessor",
"FrogBrainMixin", "FrogBrainMixin",
"EntityAccessor",
"FrogEntityMixin", "FrogEntityMixin",
"LivingEntityMixin", "LivingEntityMixin",
"ProfileAccessor" "ProfileAccessor"