aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/github/technus/tectech/entity/fx/BlockHint.java19
-rw-r--r--src/main/java/com/github/technus/tectech/mechanics/structure/StructureUtility.java23
-rw-r--r--src/main/java/com/github/technus/tectech/proxy/ClientProxy.java10
-rw-r--r--src/main/java/com/github/technus/tectech/proxy/CommonProxy.java2
4 files changed, 54 insertions, 0 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 ab075f7ffd..24459a89b8 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
@@ -19,6 +19,25 @@ public class BlockHint extends EntityFX {
this(world,0,0,0, Blocks.stone,0);
}
+ /**
+ *
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param icons DOWN, UP, NORTH, SOUTH, WEST, EAST
+ */
+ public BlockHint(World world, int x, int y, int z, IIcon[] icons) {
+ super(world, x + .25, y + .5, z + .25);
+ particleGravity = 0;
+ prevPosX = posX;
+ prevPosY = posY;
+ prevPosZ = posZ;
+ noClip = true;
+ particleMaxAge = 2000 + TecTech.RANDOM.nextInt(200);
+ this.icons=icons;
+ }
+
public BlockHint(World world, int x, int y, int z, Block block, int meta) {
super(world, x+.25, y+.5, z+.25);
particleGravity = 0;
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 8e2cedd6e2..d544efc48e 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
@@ -13,6 +13,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import java.util.*;
@@ -135,6 +136,28 @@ public class StructureUtility {
}
/**
+ * Check always returns: true.
+ *
+ * @param icons
+ * @param <T>
+ * @return
+ */
+ public static <T> IStructureElementNoPlacement<T> ofHint(IIcon[] icons) {
+ 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(world, x, y, z, icons);
+ 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 720460d56b..43f4989638 100644
--- a/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
+++ b/src/main/java/com/github/technus/tectech/proxy/ClientProxy.java
@@ -24,6 +24,7 @@ import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.util.ForgeDirection;
@@ -46,6 +47,15 @@ public class ClientProxy extends CommonProxy {
}
@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));
+
+ 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, Block block, int meta) {
Minecraft.getMinecraft().effectRenderer.addEffect(new BlockHint(w,x,y,z,block,meta));
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 955b664bd1..5891c21d5d 100644
--- a/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java
+++ b/src/main/java/com/github/technus/tectech/proxy/CommonProxy.java
@@ -7,12 +7,14 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
public class CommonProxy implements IGuiHandler {
public void registerRenderInfo() {}
+ 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!
public void pollutor_particle(IGregTechTileEntity aPollutor, byte facing) {}//CUTE!