mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-12-01 16:27:59 +01:00
Turns out we don't need these
This commit is contained in:
parent
ebb139431b
commit
d755639544
2 changed files with 3 additions and 20 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue