Skip to content

Commit

Permalink
Mc rabbit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
N1nn1 committed May 12, 2024
1 parent d2c6c49 commit 0fc4285
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/main/java/com/ninni/spawn/mixin/RabbitMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.ninni.spawn.mixin;

import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.VariantHolder;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.entity.animal.Rabbit;
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(Rabbit.class)
public abstract class RabbitMixin extends Animal implements VariantHolder<Rabbit.Variant> {
protected RabbitMixin(EntityType<? extends Animal> entityType, Level level) {
super(entityType, level);
}

@Inject(method = "<init>", at = @At("TAIL"))
private void S$init(EntityType<? extends Rabbit> entityType, Level level, CallbackInfo ci) {
this.setMaxUpStep(1);
}
}
1 change: 1 addition & 0 deletions src/main/resources/spawn.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"OverworldBiomeBuilderMixin",
"PlayerMixin",
"PoseMixin",
"RabbitMixin",
"ServerPlayerMixin",
"accessor.NoiseGeneratorSettingsAccessor",
"accessor.PlayerAccessor",
Expand Down

0 comments on commit 0fc4285

Please sign in to comment.