diff --git a/src/main/java/com/hbm/main/ModEventHandlerClient.java b/src/main/java/com/hbm/main/ModEventHandlerClient.java index 4f97748f1..4d24efe10 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerClient.java +++ b/src/main/java/com/hbm/main/ModEventHandlerClient.java @@ -84,6 +84,7 @@ import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderPlayer; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; @@ -882,6 +883,7 @@ public class ModEventHandlerClient { } private static final ResourceLocation poster = new ResourceLocation(RefStrings.MODID + ":textures/models/misc/poster.png"); + private static final ResourceLocation poster_cat = new ResourceLocation(RefStrings.MODID + ":textures/models/misc/poster_cat.png"); @SubscribeEvent public void renderFrame(RenderItemInFrameEvent event) { @@ -903,5 +905,23 @@ public class ModEventHandlerClient { tess.draw(); GL11.glEnable(GL11.GL_LIGHTING); } + + if(event.item != null && event.item.getItem() == Items.paper) { + event.setCanceled(true); + + double p = 0.0625D; + double o = p * 2.75D; + + GL11.glDisable(GL11.GL_LIGHTING); + Minecraft.getMinecraft().renderEngine.bindTexture(poster_cat); + Tessellator tess = Tessellator.instance; + tess.startDrawingQuads(); + tess.addVertexWithUV(0.5, 0.5 + o, p * 0.5, 1, 0); + tess.addVertexWithUV(-0.5, 0.5 + o, p * 0.5, 0, 0); + tess.addVertexWithUV(-0.5, -0.5 + o, p * 0.5, 0, 1); + tess.addVertexWithUV(0.5, -0.5 + o, p * 0.5, 1, 1); + tess.draw(); + GL11.glEnable(GL11.GL_LIGHTING); + } } } diff --git a/src/main/resources/assets/hbm/textures/models/misc/poster_cat.png b/src/main/resources/assets/hbm/textures/models/misc/poster_cat.png new file mode 100644 index 000000000..591134e84 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/models/misc/poster_cat.png differ