Fix mappings (forgot to build)

This commit is contained in:
Matthew Messinger 2018-08-14 20:00:16 -04:00
parent 199ba53a4e
commit 38a2fcd7c0
4 changed files with 17 additions and 12 deletions

View file

@ -6,7 +6,6 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureUtil;
import net.minecraft.util.ResourceLocation;
import javax.annotation.Nullable;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
@ -14,6 +13,8 @@ import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.function.Supplier;
import javax.annotation.Nullable;
public class ImageLoader implements Supplier<ResourceLocation> {
private static Minecraft mc = Minecraft.getMinecraft();
@ -60,7 +61,7 @@ public class ImageLoader implements Supplier<ResourceLocation> {
@Nullable
private ResourceLocation loadSkin(BufferedImage image) {
ResourceLocation conv = new ResourceLocation(original.getResourceDomain() + "-converted", original.getResourcePath());
ResourceLocation conv = new ResourceLocation(original.getNamespace() + "-converted", original.getPath());
boolean success = mc.getTextureManager().loadTexture(conv, new DynamicTextureImage(image));
return success ? conv : null;
}

View file

@ -34,13 +34,13 @@ public class LayerEntityOnPonyShoulder extends AbstractPonyLayer<AbstractClientP
NBTTagCompound leftTag = player.getLeftShoulderEntity();
if (!leftTag.hasNoTags()) {
if (!leftTag.isEmpty()) {
leftEntity = renderShoulderEntity(player, leftEntity, leftTag, headYaw, headPitch, true);
}
NBTTagCompound rightTag = player.getRightShoulderEntity();
if (!rightTag.hasNoTags()) {
if (!rightTag.isEmpty()) {
rightEntity = renderShoulderEntity(player, rightEntity, rightTag, headYaw, headPitch, false);
}

View file

@ -7,7 +7,6 @@ import com.minelittlepony.model.armour.IEquestrianArmor;
import com.minelittlepony.model.armour.ModelPonyArmor;
import com.minelittlepony.model.capabilities.IModelArmor;
import com.minelittlepony.util.coordinates.Color;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
@ -24,11 +23,11 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Tuple;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.Map;
import javax.annotation.Nullable;
public class LayerPonyArmor<T extends EntityLivingBase> extends AbstractPonyLayer<T> {
private static final Map<String, ResourceLocation> HUMAN_ARMOUR = Maps.newHashMap();
@ -149,11 +148,11 @@ public class LayerPonyArmor<T extends EntityLivingBase> extends AbstractPonyLaye
private static ResourceLocation getPonyResource(ResourceLocation human) {
return PONY_ARMOUR.computeIfAbsent(human, key -> {
String domain = human.getResourceDomain();
String domain = human.getNamespace();
if ("minecraft".equals(domain)) {
domain = "minelittlepony"; // it's a vanilla armor. I provide these.
}
String path = human.getResourcePath().replace(".png", "_pony.png");
String path = human.getPath().replace(".png", "_pony.png");
return new ResourceLocation(domain, path);
});
}

View file

@ -1,5 +1,12 @@
package com.minelittlepony.render.layer;
import static net.minecraft.client.renderer.GlStateManager.color;
import static net.minecraft.client.renderer.GlStateManager.popMatrix;
import static net.minecraft.client.renderer.GlStateManager.pushMatrix;
import static net.minecraft.client.renderer.GlStateManager.rotate;
import static net.minecraft.client.renderer.GlStateManager.scale;
import static net.minecraft.client.renderer.GlStateManager.translate;
import com.minelittlepony.ducks.IRenderPony;
import com.minelittlepony.model.AbstractPonyModel;
import com.minelittlepony.model.BodyPart;
@ -23,8 +30,6 @@ import net.minecraft.nbt.NBTUtil;
import net.minecraft.tileentity.TileEntitySkull;
import net.minecraft.util.EnumFacing;
import static net.minecraft.client.renderer.GlStateManager.*;
public class LayerPonyCustomHead<T extends EntityLivingBase> implements LayerRenderer<T> {
private RenderLivingBase<T> renderer;
@ -92,7 +97,7 @@ public class LayerPonyCustomHead<T extends EntityLivingBase> implements LayerRen
if (nbt.hasKey("SkullOwner", 10)) {
profile = NBTUtil.readGameProfileFromNBT(nbt.getCompoundTag("SkullOwner"));
} else if (nbt.hasKey("SkullOwner", 8)) {
profile = TileEntitySkull.updateGameprofile(new GameProfile(null, nbt.getString("SkullOwner")));
profile = TileEntitySkull.updateGameProfile(new GameProfile(null, nbt.getString("SkullOwner")));
nbt.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), profile));
}
}