mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-24 13:27:59 +01:00
Only replace a layer if it has a compatible buffer format. Should fix #254
This commit is contained in:
parent
4717c9e458
commit
2ed7f91786
1 changed files with 2 additions and 4 deletions
|
@ -14,7 +14,6 @@ import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.item.CrossbowItem;
|
import net.minecraft.item.CrossbowItem;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.screen.PlayerScreenHandler;
|
import net.minecraft.screen.PlayerScreenHandler;
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
import net.minecraft.util.UseAction;
|
import net.minecraft.util.UseAction;
|
||||||
import net.minecraft.util.math.RotationAxis;
|
import net.minecraft.util.math.RotationAxis;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
@ -23,11 +22,10 @@ public class LevitatingItemRenderer {
|
||||||
private VertexConsumerProvider getProvider(Pony pony, VertexConsumerProvider renderContext) {
|
private VertexConsumerProvider getProvider(Pony pony, VertexConsumerProvider renderContext) {
|
||||||
final int color = pony.metadata().glowColor();
|
final int color = pony.metadata().glowColor();
|
||||||
return layer -> {
|
return layer -> {
|
||||||
Identifier texture = RenderLayerUtil.getTexture(layer).orElse(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE);
|
if (layer.getVertexFormat() != VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL) {
|
||||||
if (texture == ItemRenderer.ENTITY_ENCHANTMENT_GLINT || texture == ItemRenderer.ITEM_ENCHANTMENT_GLINT) {
|
|
||||||
return renderContext.getBuffer(layer);
|
return renderContext.getBuffer(layer);
|
||||||
}
|
}
|
||||||
return renderContext.getBuffer(MagicGlow.getColoured(texture, color));
|
return renderContext.getBuffer(MagicGlow.getColoured(RenderLayerUtil.getTexture(layer).orElse(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE), color));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue