Fixup mixin warnings

This commit is contained in:
Matthew Messinger 2018-08-25 22:54:06 -04:00
parent e38856aee7
commit 8b779f57b2
2 changed files with 16 additions and 9 deletions

View file

@ -20,9 +20,14 @@ import java.util.concurrent.CompletableFuture;
@Mixin(targets = "net.minecraft.client.network.NetworkPlayerInfo$1")
public abstract class MixinNetworkPlayerInfo$1 implements SkinManager.SkinAvailableCallback {
@Shadow(aliases = {"this$0", "field_177224_a", "a"}) @Final private NetworkPlayerInfo player;
@Shadow(remap = false, aliases = {"this$0", "field_177224_a", "a"}) @Final private NetworkPlayerInfo player;
@Inject(method = "skinAvailable", at = @At(value = "HEAD"))
@Inject(method = "skinAvailable("
+ "Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;"
+ "Lnet/minecraft/util/ResourceLocation;"
+ "Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;"
+ ")V",
at = @At(value = "HEAD"))
private void skinAvailable(MinecraftProfileTexture.Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture,
CallbackInfo ci) {
CompletableFuture.runAsync(Runnables.doNothing())

View file

@ -33,12 +33,14 @@ public abstract class MixinNetworkPlayerInfo implements INetworkPlayerInfo {
@Shadow private String skinType;
@SuppressWarnings("InvalidMemberReference") // mc-dev bug?
@Redirect(
method = {
"getLocationSkin",
"getLocationCape",
"getLocationElytra"
}, at = @At(value = "INVOKE", target = "Ljava/util/Map;get(Ljava/lang/Object;)Ljava/lang/Object;"))
@Redirect(method = {
"getLocationSkin",
"getLocationCape",
"getLocationElytra"
},
at = @At(value = "INVOKE",
target = "Ljava/util/Map;get(Ljava/lang/Object;)Ljava/lang/Object;",
remap = false))
// synthetic
private Object getSkin(Map<Type, ResourceLocation> playerTextures, Object key) {
return getSkin(playerTextures, (Type) key);
@ -49,7 +51,7 @@ public abstract class MixinNetworkPlayerInfo implements INetworkPlayerInfo {
return getResourceLocation(type).orElseGet(() -> playerTextures.get(type));
}
@Redirect(method = "getSkinType()Ljava/lang/String;",
@Redirect(method = "getSkinType",
at = @At(value = "FIELD", target = "Lnet/minecraft/client/network/NetworkPlayerInfo;skinType:Ljava/lang/String;"))
private String getTextureModel(NetworkPlayerInfo self) {
return getProfileTexture(Type.SKIN).map(profile -> {