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<>();
|
private Map<Type, MinecraftProfileTexture> vanillaProfiles = new HashMap<>();
|
||||||
|
|
||||||
@Shadow @Final
|
@Shadow
|
||||||
|
@Final
|
||||||
private GameProfile gameProfile;
|
private GameProfile gameProfile;
|
||||||
|
|
||||||
@Shadow Map<Type, ResourceLocation> playerTextures;
|
@Shadow
|
||||||
|
Map<Type, ResourceLocation> playerTextures;
|
||||||
|
|
||||||
@SuppressWarnings("InvalidMemberReference") // mc-dev bug?
|
@SuppressWarnings("InvalidMemberReference") // mc-dev bug?
|
||||||
@Redirect(method = {"getLocationSkin", "getLocationCape", "getLocationElytra"},
|
@Redirect(method = {"getLocationSkin", "getLocationCape", "getLocationElytra"},
|
||||||
|
@ -91,14 +93,12 @@ public abstract class MixinNetworkPlayerInfo implements INetworkPlayerInfo {
|
||||||
+ "Lcom/mojang/authlib/GameProfile;"
|
+ "Lcom/mojang/authlib/GameProfile;"
|
||||||
+ "Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;"
|
+ "Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;"
|
||||||
+ "Z)V"))
|
+ "Z)V"))
|
||||||
private void redirectLoadPlayerTextures(SkinManager skinManager, GameProfile profile, SkinManager.SkinAvailableCallback callback,
|
private void redirectLoadPlayerTextures(SkinManager skinManager, GameProfile profile, SkinManager.SkinAvailableCallback callback, boolean requireSecure) {
|
||||||
boolean requireSecure) {
|
|
||||||
skinManager.loadProfileTextures(profile, (typeIn, location, profileTexture) -> {
|
skinManager.loadProfileTextures(profile, (typeIn, location, profileTexture) -> {
|
||||||
HDSkinManager.INSTANCE.parseSkin(profile, typeIn, location, profileTexture)
|
HDSkinManager.INSTANCE.parseSkin(profile, typeIn, location, profileTexture).thenAccept(v -> {
|
||||||
.thenAccept(v -> {
|
playerTextures.put(typeIn, location);
|
||||||
playerTextures.put(typeIn, location);
|
vanillaProfiles.put(typeIn, profileTexture);
|
||||||
vanillaProfiles.put(typeIn, profileTexture);
|
});
|
||||||
});
|
|
||||||
}, requireSecure);
|
}, requireSecure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import com.minelittlepony.render.layer.LayerPonyCustomHead;
|
||||||
import com.minelittlepony.render.layer.LayerPonyElytra;
|
import com.minelittlepony.render.layer.LayerPonyElytra;
|
||||||
|
|
||||||
import net.minecraft.block.BlockBed;
|
import net.minecraft.block.BlockBed;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.culling.ICamera;
|
import net.minecraft.client.renderer.culling.ICamera;
|
||||||
|
@ -90,6 +91,9 @@ public class RenderPonyPlayer extends RenderPlayer implements IRenderPony<Abstra
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldRender(AbstractClientPlayer entity, ICamera camera, double camX, double camY, double camZ) {
|
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);
|
return super.shouldRender(entity, renderPony.getFrustrum(entity, camera), camX, camY, camZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue