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.

This commit is contained in:
Ellpeck 2015-09-14 00:15:52 +02:00
parent c3c5963065
commit 387c641915
4 changed files with 29 additions and 14 deletions

View file

@ -14,25 +14,28 @@ import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.blocks.InitBlocks;
import ellpeck.actuallyadditions.gadget.RenderSpecial; import ellpeck.actuallyadditions.gadget.RenderSpecial;
import ellpeck.actuallyadditions.items.InitItems;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.client.event.RenderPlayerEvent;
import java.util.UUID; import java.util.UUID;
public class RenderPlayerEventAA{ public class RenderPlayerEventAA{
private static RenderSpecial ellpeckRender = new RenderSpecial(InitBlocks.blockPhantomLiquiface, 0); private static RenderSpecial ellpeckRender = new RenderSpecial(new ItemStack(InitItems.itemPhantomConnector));
private static RenderSpecial hoseRender = new RenderSpecial(Blocks.torch, 0); private static RenderSpecial hoseRender = new RenderSpecial(new ItemStack(Blocks.torch));
private static RenderSpecial paktoRender = new RenderSpecial(Blocks.wool, 6); private static RenderSpecial paktoRender = new RenderSpecial(new ItemStack(Blocks.wool, 1, 6));
private static RenderSpecial glenRender = new RenderSpecial(InitBlocks.blockHeatCollector, 0); private static RenderSpecial glenRender = new RenderSpecial(new ItemStack(InitBlocks.blockHeatCollector));
private static RenderSpecial lordiRender = new RenderSpecial(InitBlocks.blockBreaker, 0); private static RenderSpecial lordiRender = new RenderSpecial(new ItemStack(InitBlocks.blockBreaker));
public static RenderSpecial lariRender = new RenderSpecial(null, 0); 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) @SubscribeEvent(priority = EventPriority.HIGHEST)
public void RenderPlayerEvent(RenderPlayerEvent.Specials.Pre event){ public void RenderPlayerEvent(RenderPlayerEvent.Specials.Pre event){
//Ellpeck //Ellpeck
if(event.entityPlayer.getUniqueID().equals(UUID.fromString("3f9f4a94-95e3-40fe-8895-e8e3e84d1468"))){ 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 //Paktosan
else if(event.entityPlayer.getUniqueID().equals(UUID.fromString("0bac71ad-9156-487e-9ade-9c5b57274b23"))){ 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"))){ else if(event.entityPlayer.getUniqueID().equals(UUID.fromString("ac275e30-c468-42af-b5d4-b26c1c705b70"))){
lariRender.render(event.entityPlayer, 0.15F, -0.125F); 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);
}*/
} }
} }

View file

@ -16,6 +16,8 @@ import net.minecraft.block.Block;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelSquid; import net.minecraft.client.model.ModelSquid;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -23,14 +25,12 @@ public class RenderSpecial{
private double lastTimeForBobbing; private double lastTimeForBobbing;
private Block theBlock; private ItemStack theThingToRender;
private int meta;
private static final ResourceLocation squidTextures = new ResourceLocation("textures/entity/squid.png"); private static final ResourceLocation squidTextures = new ResourceLocation("textures/entity/squid.png");
public RenderSpecial(Block block, int meta){ public RenderSpecial(ItemStack stack){
this.theBlock = block; this.theThingToRender = stack;
this.meta = meta;
} }
public void render(EntityPlayer player, float size, float offsetUp){ 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); new ModelSquid().render(null, 0F, 0F, 0.25F, 0F, 0F, 0.0625F);
} }
else{ 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); GL11.glEnable(GL11.GL_LIGHTING);

View file

@ -35,7 +35,8 @@ public enum TheFoods implements INameableItem{
PIZZA("Pizza", 20, 10F, false, 45, EnumRarity.uncommon), PIZZA("Pizza", 20, 10F, false, 45, EnumRarity.uncommon),
BAGUETTE("Baguette", 7, 2F, false, 25, EnumRarity.common), BAGUETTE("Baguette", 7, 2F, false, 25, EnumRarity.common),
RICE("Rice", 2, 1F, false, 10, EnumRarity.uncommon), 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(){ public static void setReturnItems(){
SPAGHETTI.returnItem = new ItemStack(Items.bowl); SPAGHETTI.returnItem = new ItemStack(Items.bowl);

View file

@ -26,6 +26,7 @@ tile.actuallyadditions.blockEnergizer.name=Energizer
tile.actuallyadditions.blockEnervator.name=Enervator tile.actuallyadditions.blockEnervator.name=Enervator
tile.actuallyadditions.blockRice.name=Rice Plant tile.actuallyadditions.blockRice.name=Rice Plant
item.actuallyadditions.itemFoodRice.name=Rice item.actuallyadditions.itemFoodRice.name=Rice
item.actuallyadditions.itemFoodDoughnut.name=Doughnut
item.actuallyadditions.itemMiscRiceDough.name=Rice Dough item.actuallyadditions.itemMiscRiceDough.name=Rice Dough
item.actuallyadditions.itemFoodRiceBread.name=Rice Bread item.actuallyadditions.itemFoodRiceBread.name=Rice Bread
item.actuallyadditions.itemRiceSeed.name=Rice Seeds item.actuallyadditions.itemRiceSeed.name=Rice Seeds