Skip to content

Commit

Permalink
AyameGeoAnimatable接口注入成功
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyRespawnanchor committed Nov 23, 2024
1 parent b5aeace commit b1ca52c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
public class ClientEntityRenderersMixin {
@Inject(method = "createPlayerRenderers", at = @At("RETURN"), cancellable = true)
private static void createPlayerRenderers(EntityRendererProvider.Context context, CallbackInfoReturnable<Map<PlayerSkin.Model, EntityRenderer<? extends Player>>> cir) {
Map<PlayerSkin.Model, EntityRenderer<? extends Player>> m = new HashMap<>(Map.of(PlayerSkin.Model.WIDE, new AyamePlayerRender(context)));
Map<PlayerSkin.Model, EntityRenderer<? extends Player>> m =
new HashMap<>(Map.of(PlayerSkin.Model.WIDE, new AyamePlayerRender(context)));

m.put(PlayerSkin.Model.SLIM, new AyamePlayerRender(context));
cir.setReturnValue(ImmutableMap.copyOf(m));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
import org.spongepowered.asm.mixin.Mixin;
import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache;
import software.bernie.geckolib.animation.AnimatableManager;
import software.bernie.geckolib.util.GeckoLibUtil;

@Mixin(ItemInHandRenderer.class)
public class ItemInHandRendererMixin implements AyameGeoAnimatable {
@Override
public void registerControllers(AnimatableManager.ControllerRegistrar controllers) {

AyameGeoAnimatable.super.registerControllers(controllers);
controllers.add();
}

@Override
public AnimatableInstanceCache getAnimatableInstanceCache() {
return AyameGeoAnimatable.super.getAnimatableInstanceCache();
return GeckoLibUtil.createInstanceCache(this);
}

@Override
Expand Down

0 comments on commit b1ca52c

Please sign in to comment.