mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Fixed ponies not being able to see their own body whilst sleeping
This commit is contained in:
parent
265c1d84de
commit
6f4df6c407
2 changed files with 13 additions and 9 deletions
|
@ -28,10 +28,12 @@ public abstract class MixinNetworkPlayerInfo implements INetworkPlayerInfo {
|
|||
|
||||
private Map<Type, MinecraftProfileTexture> vanillaProfiles = new HashMap<>();
|
||||
|
||||
@Shadow @Final
|
||||
@Shadow
|
||||
@Final
|
||||
private GameProfile gameProfile;
|
||||
|
||||
@Shadow Map<Type, ResourceLocation> playerTextures;
|
||||
@Shadow
|
||||
Map<Type, ResourceLocation> playerTextures;
|
||||
|
||||
@SuppressWarnings("InvalidMemberReference") // mc-dev bug?
|
||||
@Redirect(method = {"getLocationSkin", "getLocationCape", "getLocationElytra"},
|
||||
|
@ -91,14 +93,12 @@ public abstract class MixinNetworkPlayerInfo implements INetworkPlayerInfo {
|
|||
+ "Lcom/mojang/authlib/GameProfile;"
|
||||
+ "Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;"
|
||||
+ "Z)V"))
|
||||
private void redirectLoadPlayerTextures(SkinManager skinManager, GameProfile profile, SkinManager.SkinAvailableCallback callback,
|
||||
boolean requireSecure) {
|
||||
private void redirectLoadPlayerTextures(SkinManager skinManager, GameProfile profile, SkinManager.SkinAvailableCallback callback, boolean requireSecure) {
|
||||
skinManager.loadProfileTextures(profile, (typeIn, location, profileTexture) -> {
|
||||
HDSkinManager.INSTANCE.parseSkin(profile, typeIn, location, profileTexture)
|
||||
.thenAccept(v -> {
|
||||
playerTextures.put(typeIn, location);
|
||||
vanillaProfiles.put(typeIn, profileTexture);
|
||||
});
|
||||
HDSkinManager.INSTANCE.parseSkin(profile, typeIn, location, profileTexture).thenAccept(v -> {
|
||||
playerTextures.put(typeIn, location);
|
||||
vanillaProfiles.put(typeIn, profileTexture);
|
||||
});
|
||||
}, requireSecure);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ import com.minelittlepony.render.layer.LayerPonyCustomHead;
|
|||
import com.minelittlepony.render.layer.LayerPonyElytra;
|
||||
|
||||
import net.minecraft.block.BlockBed;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.culling.ICamera;
|
||||
|
@ -90,6 +91,9 @@ public class RenderPonyPlayer extends RenderPlayer implements IRenderPony<Abstra
|
|||
|
||||
@Override
|
||||
public boolean shouldRender(AbstractClientPlayer entity, ICamera camera, double camX, double camY, double camZ) {
|
||||
if (entity.isPlayerSleeping() && entity == Minecraft.getMinecraft().player) {
|
||||
return true;
|
||||
}
|
||||
return super.shouldRender(entity, renderPony.getFrustrum(entity, camera), camX, camY, camZ);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue