Skip to content

Commit

Permalink
Fix getUUID issue. Fix #78 #77
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Nov 15, 2024
1 parent 838e72d commit b758f8e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
java-version: 21
# to cache gradle files
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
dependency-graph: generate-and-submit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface CapeHolder {

public void setSimulation(BasicSimulation sim);

UUID getUUID();
UUID getWCUUID();

void setDirty();

Expand Down
8 changes: 8 additions & 0 deletions src/main/java/dev/tr7zw/waveycapes/mixin/PlayerMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.Level;

import java.util.UUID;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
Expand Down Expand Up @@ -60,4 +63,9 @@ private void moveCloakUpdate(CallbackInfo info) {
}
}

@Override
public UUID getWCUUID() {
return getUUID();
}

}
4 changes: 2 additions & 2 deletions src/main/java/dev/tr7zw/waveycapes/support/EarsSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public EarsSupport() {

@Override
public boolean shouldBeUsed(CapeRenderInfo capeRenderInfo) {
EarsFeatures playerFeatures = EarsFeatures.getById(capeRenderInfo.getCapeHolder().getUUID());
EarsFeatures playerFeatures = EarsFeatures.getById(capeRenderInfo.getCapeHolder().getWCUUID());
return playerFeatures != null && playerFeatures.capeEnabled;
}

Expand All @@ -54,7 +54,7 @@ private class EarsRenderer implements CapeRenderer {
@Override
public void render(CapeRenderInfo capeRenderInfo, int part, ModelPart model, PoseStack poseStack,
MultiBufferSource multiBufferSource, int light, int overlay) {
EarsFeatures playerFeatures = EarsFeatures.getById(capeRenderInfo.getCapeHolder().getUUID());
EarsFeatures playerFeatures = EarsFeatures.getById(capeRenderInfo.getCapeHolder().getWCUUID());

VertexConsumer vertexConsumer = null;
if (playerFeatures != null && playerFeatures.capeEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class MinecraftCapesSupport implements ModSupport {

private void init(CapeRenderInfo test) {
try {
PlayerHandler.get(test.getCapeHolder().getUUID()).getCapeLocation();
getCape = player -> PlayerHandler.get(player.getCapeHolder().getUUID());
PlayerHandler.get(test.getCapeHolder().getWCUUID()).getCapeLocation();
getCape = player -> PlayerHandler.get(player.getCapeHolder().getWCUUID());
ModBase.LOGGER.info("Using 'get(UUID)' method for MinecraftCapes.");
return;
} catch (Throwable ex) {
Expand Down

0 comments on commit b758f8e

Please sign in to comment.