diff options
Diffstat (limited to 'src/main')
4 files changed, 51 insertions, 1 deletions
diff --git a/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java b/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java index 24459a89b8..dd5cd59ac7 100644 --- a/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java +++ b/src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java @@ -3,6 +3,7 @@ package com.github.technus.tectech.entity.fx; import com.github.technus.tectech.TecTech; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Dyes; import net.minecraft.block.Block; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; @@ -14,6 +15,7 @@ import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class BlockHint extends EntityFX { private IIcon[] icons = new IIcon[6]; + private short[] mRGBa = Dyes._NULL.mRGBa; public BlockHint(World world){ this(world,0,0,0, Blocks.stone,0); @@ -51,6 +53,11 @@ public class BlockHint extends EntityFX { } } + public BlockHint withColorTint(short[] coloure){ + this.mRGBa =coloure; + return this; + } + @Override public void renderParticle(Tessellator tes, float subTickTime, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { float size = .5f; @@ -59,7 +66,7 @@ public class BlockHint extends EntityFX { float Z = (float) (prevPosZ + (posZ - prevPosZ) * (double) subTickTime - EntityFX.interpPosZ); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); - tes.setColorRGBA_F(.9F, .95F, 1F, .75f); + tes.setColorRGBA((int) (mRGBa[0] * .9F), (int) (mRGBa[1] * .95F), (int) (mRGBa[2] * 1F), 192); //var8, var9 - X U //var 10, var 11 - Y V diff --git a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java index d544efc48e..2177d1a00e 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java +++ b/src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java @@ -158,6 +158,29 @@ public class StructureUtility { } /** + * Check always returns: true. + * + * @param icons + * @param RGBa + * @param <T> + * @return + */ + public static <T> IStructureElementNoPlacement<T> ofHint(IIcon[] icons,short[] RGBa) { + return new IStructureElementNoPlacement<T>() { + @Override + public boolean check(T t, World world, int x, int y, int z) { + return true; + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + TecTech.proxy.hint_particle_tinted(world, x, y, z, icons,RGBa); + return false; + } + }; + } + + /** * Does not allow Block duplicates (with different meta) */ public static <T> IStructureElementNoPlacement<T> ofBlocksFlatHint(Map<Block, Integer> blocsMap, Block hintBlock, int hintMeta) { diff --git a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java index 43f4989638..9e693b7664 100644 --- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java @@ -47,6 +47,24 @@ public class ClientProxy extends CommonProxy { } @Override + public void hint_particle_tinted(World w,int x, int y, int z, IIcon[] icons,short[] RGBa) { + Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(w,x,y,z,icons).withColorTint(RGBa)); + + EntityFX particle = new WeightlessParticleFX(w, x + TecTech.RANDOM.nextFloat() * 0.5F, y + TecTech.RANDOM.nextFloat() * 0.5F, z + TecTech.RANDOM.nextFloat() * 0.5F, 0, 0, 0); + particle.setRBGColorF(0, 0.6F * TecTech.RANDOM.nextFloat(), 0.8f); + Minecraft.getMinecraft().effectRenderer.addEffect(particle); + } + + @Override + public void hint_particle_tinted(World w,int x, int y, int z, Block block, int meta,short[] RGBa) { + Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(w,x,y,z,block,meta).withColorTint(RGBa)); + + EntityFX particle = new WeightlessParticleFX(w, x + TecTech.RANDOM.nextFloat() * 0.5F, y + TecTech.RANDOM.nextFloat() * 0.5F, z + TecTech.RANDOM.nextFloat() * 0.5F, 0, 0, 0); + particle.setRBGColorF(0, 0.6F * TecTech.RANDOM.nextFloat(), 0.8f); + Minecraft.getMinecraft().effectRenderer.addEffect(particle); + } + + @Override public void hint_particle(World w,int x, int y, int z, IIcon[] icons) { Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(w,x,y,z,icons)); diff --git a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java index 5891c21d5d..490cdf1092 100644 --- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java +++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java @@ -14,6 +14,8 @@ import net.minecraft.world.WorldServer; public class CommonProxy implements IGuiHandler { public void registerRenderInfo() {} + public void hint_particle_tinted(World w,int x, int y, int z, IIcon[] icons,short[] RGBa){} + public void hint_particle_tinted(World w,int x, int y, int z, Block block, int meta,short[] RGBa){} public void hint_particle(World w,int x, int y, int z, IIcon[] icons){} public void hint_particle(World w,int x, int y, int z, Block block, int meta){} public void em_particle(IGregTechTileEntity aMuffler, byte facing) {}//CUTE! |