Turns out we don't need these

This commit is contained in:
Sollace 2018-07-21 15:31:49 +02:00
parent ebb139431b
commit d755639544
2 changed files with 3 additions and 20 deletions

View file

@ -3,7 +3,6 @@ package com.voxelmodpack.hdskins.mixin;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
import com.voxelmodpack.hdskins.HDSkinManager; import com.voxelmodpack.hdskins.HDSkinManager;
import com.voxelmodpack.hdskins.util.Optionals;
import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
@ -23,10 +22,10 @@ public abstract class MixinSkullRenderer extends TileEntitySpecialRenderer<TileE
at = @At(value = "INVOKE", at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/renderer/tileentity/TileEntitySkullRenderer;bindTexture(Lnet/minecraft/util/ResourceLocation;)V", target = "Lnet/minecraft/client/renderer/tileentity/TileEntitySkullRenderer;bindTexture(Lnet/minecraft/util/ResourceLocation;)V",
ordinal = 4)) ordinal = 4))
private void onBindTexture(TileEntitySkullRenderer tesr, ResourceLocation rl, float x, float y, float z, EnumFacing facing, float rotation, int meta, private void onBindTexture(TileEntitySkullRenderer tesr, ResourceLocation rl, float x, float y, float z, // ow my back
@Nullable GameProfile profile, int a, float ticks) { EnumFacing facing, float rotation, int meta, @Nullable GameProfile profile, int a, float ticks) {
if (profile != null) { if (profile != null) {
bindTexture(Optionals.getOrDefault(HDSkinManager.INSTANCE.getSkinLocation(profile, Type.SKIN, true), rl)); bindTexture(HDSkinManager.INSTANCE.getSkinLocation(profile, Type.SKIN, true).orElse(rl));
} else { } else {
bindTexture(rl); bindTexture(rl);
} }

View file

@ -1,16 +0,0 @@
package com.voxelmodpack.hdskins.util;
import java.util.Optional;
/**
* Silly optionals
*/
public final class Optionals {
public static <T> T nullableOf(Optional<T> optional) {
return getOrDefault(optional, null);
}
public static <T> T getOrDefault(Optional<T> optional, T def) {
return optional.isPresent() ? optional.get() : def;
}
}