Fixed ponies not being able to see their own body whilst sleeping

This commit is contained in:
Sollace 2018-10-29 13:05:59 +02:00
parent 265c1d84de
commit 6f4df6c407
2 changed files with 13 additions and 9 deletions

View file

@ -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,11 +93,9 @@ 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 -> {
HDSkinManager.INSTANCE.parseSkin(profile, typeIn, location, profileTexture).thenAccept(v -> {
playerTextures.put(typeIn, location);
vanillaProfiles.put(typeIn, profileTexture);
});

View file

@ -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);
}