Minor code maintenance

This commit is contained in:
Glease committed 2022-07-08 17:17:40 +08:00
1 parent 8de7026a00
commit 4c03406640
2 files changed
+6 -7

No files matched your search

@@ -46,7 +46,7 @@ public class StructureLibAPI {
}
/**
* Start current batch of hinting. All hints particles generated during one batch will be considered to belong to one hologram.
* End current batch of hinting. All hints particles generated during one batch will be considered to belong to one hologram.
* <p>
* You don't need to call this unless your constructable tool didn't call {@link com.gtnewhorizon.structurelib.alignment.constructable.ConstructableUtility#handle(ItemStack, EntityPlayer, World, int, int, int, int)}
*/
@@ -26,6 +26,9 @@ import java.util.List;
import static com.gtnewhorizon.structurelib.StructureLib.RANDOM;
public class ClientProxy extends CommonProxy {
private static final short[] NO_TINT = {255, 255, 255, 0};
@Override
public void hintParticleTinted(World w, int x, int y, int z, IIcon[] icons, short[] RGBa) {
EntityFXBlockHint hint = new EntityFXBlockHint(w, x, y, z, icons).withColorTint(RGBa);
@@ -46,10 +49,6 @@ public class ClientProxy extends CommonProxy {
allHints.forcePut(hint, info);
}
currentHints.add(hint);
EntityFX particle = new WeightlessParticleFX(w, x + RANDOM.nextFloat() * 0.5F, y + RANDOM.nextFloat() * 0.5F, z + RANDOM.nextFloat() * 0.5F, 0, 0, 0);
particle.setRBGColorF(0, 0.6F * RANDOM.nextFloat(), 0.8f);
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
}
@Override
@@ -59,12 +58,12 @@ public class ClientProxy extends CommonProxy {
@Override
public void hintParticle(World w, int x, int y, int z, IIcon[] icons) {
hintParticleTinted(w, x, y, z, icons, new short[]{255, 255, 255, 0});
hintParticleTinted(w, x, y, z, icons, NO_TINT);
}
@Override
public void hintParticle(World w, int x, int y, int z, Block block, int meta) {
hintParticleTinted(w, x, y, z, createIIconFromBlock(block, meta), new short[]{255, 255, 255, 0});
hintParticleTinted(w, x, y, z, createIIconFromBlock(block, meta), NO_TINT);
}
private static IIcon[] createIIconFromBlock(Block block, int meta) {