diff options
Diffstat (limited to 'src/Java/gtPlusPlus')
3 files changed, 114 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/client/renderer/RenderPotionthrow.java b/src/Java/gtPlusPlus/core/client/renderer/RenderPotionthrow.java new file mode 100644 index 0000000000..0f5e2f08c8 --- /dev/null +++ b/src/Java/gtPlusPlus/core/client/renderer/RenderPotionthrow.java @@ -0,0 +1,100 @@ +package gtPlusPlus.core.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.item.Item; +import net.minecraft.item.ItemPotion; +import net.minecraft.potion.PotionHelper; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class RenderPotionthrow extends Render +{ + private Item field_94151_a; + private int field_94150_f; + + public RenderPotionthrow(Item p_i1259_1_, int p_i1259_2_) + { + this.field_94151_a = p_i1259_1_; + this.field_94150_f = p_i1259_2_; + } + + public RenderPotionthrow(Item p_i1260_1_) + { + this(p_i1260_1_, 0); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1, + * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. + */ + public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) + { + IIcon iicon = this.field_94151_a.getIconFromDamage(this.field_94150_f); + + if (iicon != null) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glScalef(0.5F, 0.5F, 0.5F); + this.bindEntityTexture(p_76986_1_); + Tessellator tessellator = Tessellator.instance; + + if (iicon == ItemPotion.func_94589_d("bottle_splash")) + { + int i = PotionHelper.func_77915_a(((EntityPotion)p_76986_1_).getPotionDamage(), false); + float f2 = (float)(i >> 16 & 255) / 255.0F; + float f3 = (float)(i >> 8 & 255) / 255.0F; + float f4 = (float)(i & 255) / 255.0F; + GL11.glColor3f(f2, f3, f4); + GL11.glPushMatrix(); + this.func_77026_a(tessellator, ItemPotion.func_94589_d("overlay")); + GL11.glPopMatrix(); + GL11.glColor3f(1.0F, 1.0F, 1.0F); + } + + this.func_77026_a(tessellator, iicon); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + return TextureMap.locationItemsTexture; + } + + private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_) + { + float f = p_77026_2_.getMinU(); + float f1 = p_77026_2_.getMaxU(); + float f2 = p_77026_2_.getMinV(); + float f3 = p_77026_2_.getMaxV(); + float f4 = 1.0F; + float f5 = 0.5F; + float f6 = 0.25F; + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + p_77026_1_.startDrawingQuads(); + p_77026_1_.setNormal(0.0F, 1.0F, 0.0F); + p_77026_1_.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3); + p_77026_1_.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3); + p_77026_1_.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2); + p_77026_1_.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2); + p_77026_1_.draw(); + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/item/general/ItemSulfuricAcidPotion.java b/src/Java/gtPlusPlus/core/item/general/ItemSulfuricAcidPotion.java index 885919dccb..90cd0c74ae 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemSulfuricAcidPotion.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemSulfuricAcidPotion.java @@ -1,9 +1,14 @@ package gtPlusPlus.core.item.general; +import gregtech.api.enums.GT_Values; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion; +import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.base.CoreItem; +import gtPlusPlus.core.util.fluid.FluidUtils; +import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; @@ -13,6 +18,8 @@ public class ItemSulfuricAcidPotion extends CoreItem { public ItemSulfuricAcidPotion(String unlocalizedName, String displayName, String description) { super(unlocalizedName, displayName, AddToCreativeTab.tabMisc, 16, 0, description, EnumRarity.common, EnumChatFormatting.GRAY, false, null); + GT_Values.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(Items.glass_bottle), ItemUtils.getSimpleStack(ModItems.itemSulfuricPotion), FluidUtils.getFluidStack("sulfuricacid", 250), null); + GT_Values.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(ModItems.itemSulfuricPotion), ItemUtils.getSimpleStack(Items.glass_bottle), null, FluidUtils.getFluidStack("sulfuricacid", 250)); } public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) { diff --git a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java index 9440522db8..77b845260a 100644 --- a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java +++ b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java @@ -18,8 +18,10 @@ import gtPlusPlus.core.common.compat.COMPAT_PlayerAPI; import gtPlusPlus.core.entity.EntityPrimedMiningExplosive; import gtPlusPlus.core.entity.monster.EntitySickBlaze; import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; +import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion; import gtPlusPlus.core.entity.projectile.EntityToxinballSmall; import gtPlusPlus.core.handler.render.FirepitRender; +import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.tileentities.general.TileEntityFirepit; @@ -29,7 +31,10 @@ import gtPlusPlus.xmod.gregtech.common.render.GTPP_CapeRenderer; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.entity.RenderIronGolem; +import net.minecraft.client.renderer.entity.RenderSnowball; import net.minecraft.entity.Entity; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.init.Items; public class ClientProxy extends CommonProxy implements Runnable{ @@ -89,7 +94,9 @@ public class ClientProxy extends CommonProxy implements Runnable{ RenderingRegistry.registerEntityRenderingHandler(EntitySickBlaze.class, new RenderSickBlaze()); RenderingRegistry.registerEntityRenderingHandler(EntityStaballoyConstruct.class, new RenderIronGolem()); RenderingRegistry.registerEntityRenderingHandler(EntityToxinballSmall.class, new RenderToxinball(1F)); + RenderingRegistry.registerEntityRenderingHandler(EntitySulfuricAcidPotion.class, new RenderPotionthrow(ModItems.itemSulfuricPotion)); + //ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBloodSteelChest.class, new BloodSteelChestRenderer()); //MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.tutChest), new ItemRenderBloodSteelChest()); Utils.LOG_INFO("Registering Custom Renderer for the Fire Pit."); |