From 387c641915a66bed2df542024aa154cf14b830f4 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 14 Sep 2015 00:15:52 +0200 Subject: [PATCH] Added the (still unused!) DoughnutRender for DoughnutDev as he is apparently crazy enough to want to localize all of the booklet chapters which is awesome because it's a pain and I'm too freaking lazy to do it. --- .../event/RenderPlayerEventAA.java | 21 ++++++++++++------- .../gadget/RenderSpecial.java | 18 ++++++++++------ .../items/metalists/TheFoods.java | 3 ++- .../assets/actuallyadditions/lang/en_US.lang | 1 + 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/event/RenderPlayerEventAA.java b/src/main/java/ellpeck/actuallyadditions/event/RenderPlayerEventAA.java index 0b0a30c50..2adc8c4b2 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/RenderPlayerEventAA.java +++ b/src/main/java/ellpeck/actuallyadditions/event/RenderPlayerEventAA.java @@ -14,25 +14,28 @@ import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.gadget.RenderSpecial; +import ellpeck.actuallyadditions.items.InitItems; import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraftforge.client.event.RenderPlayerEvent; import java.util.UUID; public class RenderPlayerEventAA{ - private static RenderSpecial ellpeckRender = new RenderSpecial(InitBlocks.blockPhantomLiquiface, 0); - private static RenderSpecial hoseRender = new RenderSpecial(Blocks.torch, 0); - private static RenderSpecial paktoRender = new RenderSpecial(Blocks.wool, 6); - private static RenderSpecial glenRender = new RenderSpecial(InitBlocks.blockHeatCollector, 0); - private static RenderSpecial lordiRender = new RenderSpecial(InitBlocks.blockBreaker, 0); - public static RenderSpecial lariRender = new RenderSpecial(null, 0); + private static RenderSpecial ellpeckRender = new RenderSpecial(new ItemStack(InitItems.itemPhantomConnector)); + private static RenderSpecial hoseRender = new RenderSpecial(new ItemStack(Blocks.torch)); + private static RenderSpecial paktoRender = new RenderSpecial(new ItemStack(Blocks.wool, 1, 6)); + private static RenderSpecial glenRender = new RenderSpecial(new ItemStack(InitBlocks.blockHeatCollector)); + private static RenderSpecial lordiRender = new RenderSpecial(new ItemStack(InitBlocks.blockBreaker)); + public static RenderSpecial lariRender = new RenderSpecial(null); + //public static RenderSpecial doughnutRender = new RenderSpecial(new ItemStack(InitItems.itemFoods, 1, TheFoods.DOUGHNUT.ordinal())); @SubscribeEvent(priority = EventPriority.HIGHEST) public void RenderPlayerEvent(RenderPlayerEvent.Specials.Pre event){ //Ellpeck if(event.entityPlayer.getUniqueID().equals(UUID.fromString("3f9f4a94-95e3-40fe-8895-e8e3e84d1468"))){ - ellpeckRender.render(event.entityPlayer, 0.3F, 0); + ellpeckRender.render(event.entityPlayer, 0.4F, 0.2F); } //Paktosan else if(event.entityPlayer.getUniqueID().equals(UUID.fromString("0bac71ad-9156-487e-9ade-9c5b57274b23"))){ @@ -54,5 +57,9 @@ public class RenderPlayerEventAA{ else if(event.entityPlayer.getUniqueID().equals(UUID.fromString("ac275e30-c468-42af-b5d4-b26c1c705b70"))){ lariRender.render(event.entityPlayer, 0.15F, -0.125F); } + //DoughnutDev + /*else if(event.entityPlayer.getUniqueID().equals(UUID.fromString("fd303402-d627-4de0-8a02-eb8c7fd2acb6"))){ + doughnutRender.render(event.entityPlayer, 0.35F, 0.225F); + }*/ } } diff --git a/src/main/java/ellpeck/actuallyadditions/gadget/RenderSpecial.java b/src/main/java/ellpeck/actuallyadditions/gadget/RenderSpecial.java index f11b8a363..3e8ffc6aa 100644 --- a/src/main/java/ellpeck/actuallyadditions/gadget/RenderSpecial.java +++ b/src/main/java/ellpeck/actuallyadditions/gadget/RenderSpecial.java @@ -16,6 +16,8 @@ import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelSquid; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; @@ -23,14 +25,12 @@ public class RenderSpecial{ private double lastTimeForBobbing; - private Block theBlock; - private int meta; + private ItemStack theThingToRender; private static final ResourceLocation squidTextures = new ResourceLocation("textures/entity/squid.png"); - public RenderSpecial(Block block, int meta){ - this.theBlock = block; - this.meta = meta; + public RenderSpecial(ItemStack stack){ + this.theThingToRender = stack; } public void render(EntityPlayer player, float size, float offsetUp){ @@ -65,7 +65,13 @@ public class RenderSpecial{ new ModelSquid().render(null, 0F, 0F, 0.25F, 0F, 0F, 0.0625F); } else{ - AssetUtil.renderBlock(this.theBlock, this.meta); + if(this.theThingToRender.getItem() instanceof ItemBlock){ + AssetUtil.renderBlock(Block.getBlockFromItem(this.theThingToRender.getItem()), this.theThingToRender.getItemDamage()); + } + else{ + GL11.glTranslatef(-0.5F, 0F, 0F); + AssetUtil.renderItem(this.theThingToRender, 0); + } } GL11.glEnable(GL11.GL_LIGHTING); diff --git a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheFoods.java b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheFoods.java index 5fc129432..62406f737 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheFoods.java +++ b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheFoods.java @@ -35,7 +35,8 @@ public enum TheFoods implements INameableItem{ PIZZA("Pizza", 20, 10F, false, 45, EnumRarity.uncommon), BAGUETTE("Baguette", 7, 2F, false, 25, EnumRarity.common), RICE("Rice", 2, 1F, false, 10, EnumRarity.uncommon), - RICE_BREAD("RiceBread", 8, 3F, false, 25, EnumRarity.uncommon); + RICE_BREAD("RiceBread", 8, 3F, false, 25, EnumRarity.uncommon), + DOUGHNUT("Doughnut", 4, 0.5F, false, 10, EnumRarity.epic); public static void setReturnItems(){ SPAGHETTI.returnItem = new ItemStack(Items.bowl); diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index c3972dac8..284e81a3f 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -26,6 +26,7 @@ tile.actuallyadditions.blockEnergizer.name=Energizer tile.actuallyadditions.blockEnervator.name=Enervator tile.actuallyadditions.blockRice.name=Rice Plant item.actuallyadditions.itemFoodRice.name=Rice +item.actuallyadditions.itemFoodDoughnut.name=Doughnut item.actuallyadditions.itemMiscRiceDough.name=Rice Dough item.actuallyadditions.itemFoodRiceBread.name=Rice Bread item.actuallyadditions.itemRiceSeed.name=Rice Seeds