Skip to content

Commit 18f24a5

Browse files
committed
A few tweaks of shoulder stuff.
1 parent b4bb00f commit 18f24a5

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

common/src/main/java/generations/gg/generations/core/generationscore/common/client/render/entity/GenerationsPokemonOnShoulderProxy.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ object GenerationsPokemonOnShoulderProxy {
3939
netHeadYaw: Float,
4040
headPitch: Float,
4141
pLeftShoulder: Boolean,
42-
): Boolean {
42+
) {
4343
val compoundTag = if (pLeftShoulder) livingEntity.shoulderEntityLeft else livingEntity.shoulderEntityRight
4444
if (compoundTag.isPokemonEntity()) {
4545
matrixStack.pushPose()
@@ -58,7 +58,7 @@ object GenerationsPokemonOnShoulderProxy {
5858

5959
if (shoulderData == null){
6060
// Could be null
61-
shoulderData = (if (pLeftShoulder) cache.lastKnownLeft else cache.lastKnownRight) ?: return false
61+
shoulderData = (if (pLeftShoulder) cache.lastKnownLeft else cache.lastKnownRight) ?: return
6262
}
6363

6464
val model = PokemonModelRepository.getPoser(shoulderData.species.resourceIdentifier, shoulderData.aspects)
@@ -123,9 +123,7 @@ object GenerationsPokemonOnShoulderProxy {
123123
}
124124
model.setDefault()
125125
matrixStack.popPose()
126-
return true
127126
}
128-
return false
129127
}
130128

131129
private data class ShoulderCache(

common/src/main/java/generations/gg/generations/core/generationscore/common/mixin/client/PokemonOnShoulderRenderMixin.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ public PokemonOnShoulderRenderMixin(RenderLayerParent<T, PlayerModel<T>> rendere
3434

3535
@Inject(method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/world/entity/player/Player;FFFFFFZ)V", at = @At("HEAD"), cancellable = true)
3636
public void render(PoseStack matrixStack, MultiBufferSource buffer, int packedLight, T livingEntity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, boolean pLeftShoulder, CallbackInfo ci) {
37-
if(GenerationsPokemonOnShoulderProxy.render(this, matrixStack, buffer, packedLight, livingEntity, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, pLeftShoulder)) {
38-
ci.cancel();
39-
}
37+
GenerationsPokemonOnShoulderProxy.render(this, matrixStack, buffer, packedLight, livingEntity, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, pLeftShoulder);
38+
ci.cancel();
4039
}
4140
}

common/src/main/java/generations/gg/generations/core/generationscore/common/mixin/client/PokemonOnShoulderRendererCompanionAccessorMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
public class PokemonOnShoulderRendererCompanionAccessorMixin {
2121

2222
@Inject(method = "shoulderDataOf", at = @At("HEAD"), cancellable = true)
23-
public void blep(Player player, CallbackInfoReturnable<Tuple<PokemonOnShoulderRenderer.ShoulderData, PokemonOnShoulderRenderer.ShoulderData>> cir) {
23+
public void of(Player player, CallbackInfoReturnable<Tuple<PokemonOnShoulderRenderer.ShoulderData, PokemonOnShoulderRenderer.ShoulderData>> cir) {
2424
cir.setReturnValue(GenerationsPokemonOnShoulderProxy.shoulderDataOf(player));
2525
}
2626
}

0 commit comments

Comments
 (0)