|
| 1 | +package com.uraneptus.sullysmod.core.events; |
| 2 | + |
| 3 | +import com.mojang.authlib.minecraft.MinecraftProfileTexture; |
| 4 | +import com.uraneptus.sullysmod.SullysMod; |
| 5 | +import net.minecraft.client.player.AbstractClientPlayer; |
| 6 | +import net.minecraft.resources.ResourceLocation; |
| 7 | +import net.minecraft.world.entity.player.Player; |
| 8 | +import net.minecraftforge.api.distmarker.Dist; |
| 9 | +import net.minecraftforge.client.event.RenderPlayerEvent; |
| 10 | +import net.minecraftforge.eventbus.api.SubscribeEvent; |
| 11 | +import net.minecraftforge.fml.common.Mod; |
| 12 | + |
| 13 | +import java.util.Map; |
| 14 | +import java.util.Set; |
| 15 | +import java.util.UUID; |
| 16 | + |
| 17 | +@Mod.EventBusSubscriber(modid = SullysMod.MOD_ID, value = Dist.CLIENT) |
| 18 | +public class SMClientForgeEvents { |
| 19 | + static final Set<UUID> DEV_UUIDS = Set.of( |
| 20 | + UUID.fromString("6c175d10-198a-49f9-8e2b-c74f1f0178f3"), //Sully |
| 21 | + UUID.fromString("fddaefa0-31d2-4acf-9cd2-4711d0e5e5d5"), //Uraneptus |
| 22 | + UUID.fromString("3fd1d511-62d6-4e18-a28d-3e3d4fd93620"), //Keke |
| 23 | + UUID.fromString("1fb0ecbd-2000-4f00-aa65-002c1ccedef7") //Stelle |
| 24 | + ); |
| 25 | + |
| 26 | + @SubscribeEvent |
| 27 | + public static void onEvent(RenderPlayerEvent.Post event) { |
| 28 | + Player player = event.getEntity(); |
| 29 | + UUID uuid = player.getGameProfile().getId(); |
| 30 | + if (DEV_UUIDS.contains(uuid)) { |
| 31 | + ResourceLocation cape = SullysMod.modPrefix("textures/entity/mosaic_modding_cape.png"); |
| 32 | + if (player instanceof AbstractClientPlayer clientPlayer && clientPlayer.playerInfo != null) { |
| 33 | + if (clientPlayer.isCapeLoaded() && clientPlayer.getCloakTextureLocation() == null) { |
| 34 | + Map<MinecraftProfileTexture.Type, ResourceLocation> playerTextures = clientPlayer.playerInfo.textureLocations; |
| 35 | + playerTextures.put(MinecraftProfileTexture.Type.CAPE, cape); |
| 36 | + playerTextures.put(MinecraftProfileTexture.Type.ELYTRA, cape); |
| 37 | + } |
| 38 | + } |
| 39 | + } |
| 40 | + } |
| 41 | +} |
0 commit comments