• Recently Browsing

    No registered users viewing this page.

  • Posts

    • I've encountered this prob, too, struggling to gradle forge source with my 1.15.2mdk
    • 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • ok, so: Does your texture exist where you told the game to find it? Does the log say anything?
    • I am trying to make a custom shield, right now, I would just like it to render the shield_base from my mod's resources!!   Most of the stuff I've take from existing code and started to update ... anything that can help would be greatly appreciated!   I'm think it's having issues with the AtlasTextures, this is my first one of those, please be nice   BlueShieldRenderer.java package weible.rupeehunt.item.blueshield; import java.util.Iterator; import java.util.List; import org.apache.logging.log4j.Level; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import com.mojang.datafixers.util.Pair; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.entity.model.ShieldModel; import net.minecraft.client.renderer.model.Material; import net.minecraft.client.renderer.model.ModelBakery; import net.minecraft.client.renderer.texture.AtlasTexture; import net.minecraft.client.renderer.tileentity.BannerTileEntityRenderer; import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer; import net.minecraft.item.DyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.item.ShieldItem; import net.minecraft.resources.IResource; import net.minecraft.tileentity.BannerPattern; import net.minecraft.tileentity.BannerTileEntity; import net.minecraft.util.ResourceLocation; import weible.rupeehunt.RupeeHuntMod; import weible.rupeehunt.init.ModItems; public class BlueShieldRenderer extends ItemStackTileEntityRenderer { private final BlueShieldModel modelShield = new BlueShieldModel(); public static final Material BLUE_SHIELD_BASE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(RupeeHuntMod.modId, "textures/items/blueshield.png")); public static final Material MINECRAFT_SHIELD_BASE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(RupeeHuntMod.modId, "textures/items/shield_base.png")); @Override public void render(ItemStack itemStackIn, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) { //RupeeHuntMod.LOGGER.log(Level.INFO, "Inside Blue Shield Renderer"); Item item = itemStackIn.getItem(); if (item == ModItems.BLUESHIELD) { //boolean flag = itemStackIn.getChildTag("BlockEntityTag") != null; matrixStackIn.push(); matrixStackIn.scale(1.0F, -1.0F, -1.0F); Material material = MINECRAFT_SHIELD_BASE; //RupeeHuntMod.LOGGER.log(Level.INFO, "Shield Base Material:" + MINECRAFT_SHIELD_BASE.getAtlasLocation() + " " + MINECRAFT_SHIELD_BASE.getTextureLocation()); RupeeHuntMod.LOGGER.log(Level.INFO, MINECRAFT_SHIELD_BASE.toString()); IVertexBuilder ivertexbuilder = material.getSprite().wrapBuffer(ItemRenderer.getBuffer(bufferIn, this.modelShield.getRenderType(material.getAtlasLocation()), false, itemStackIn.hasEffect())); this.modelShield.getHandleModelRenderer().render(matrixStackIn, ivertexbuilder, combinedLightIn, combinedOverlayIn, 1.0F, 1.0F, 1.0F, 1.0F); this.modelShield.getPlateModelRenderer().render(matrixStackIn, ivertexbuilder, combinedLightIn, combinedOverlayIn, 1.0F, 1.0F, 1.0F, 1.0F); matrixStackIn.pop(); } } }   BlueShieldModel.java package weible.rupeehunt.item.blueshield; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.model.Model; import net.minecraft.client.renderer.model.ModelRenderer; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class BlueShieldModel extends Model { private final ModelRenderer plate; private final ModelRenderer handle; public BlueShieldModel() { super(RenderType::getEntitySolid); this.textureWidth = 64; this.textureHeight = 64; this.plate = new ModelRenderer(this, 0, 0); this.plate.addBox(-6.0F, -11.0F, -2.0F, 12.0F, 22.0F, 1.0F, 0.0F); this.handle = new ModelRenderer(this, 26, 0); this.handle.addBox(-1.0F, -3.0F, -1.0F, 2.0F, 6.0F, 6.0F, 0.0F); } public ModelRenderer getPlateModelRenderer() { return this.plate; } public ModelRenderer getHandleModelRenderer() { return this.handle; } public void render(MatrixStack matrixStackIn, IVertexBuilder bufferIn, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) { this.plate.render(matrixStackIn, bufferIn, packedLightIn, packedOverlayIn, red, green, blue, alpha); this.handle.render(matrixStackIn, bufferIn, packedLightIn, packedOverlayIn, red, green, blue, alpha); } }    
  • Topics

  • Who's Online (See full list)