add hint block

This commit is contained in:
Glease committed 2021-05-17 07:44:45 +08:00
1 parent 25971904a6
commit bee6ce337b
23 files changed
+235 -51

No files matched your search

@@ -12,32 +12,35 @@ import static com.gtnewhorizon.structurelib.StructureLib.RANDOM;
public class ClientProxy extends CommonProxy {
@Override
public void hint_particle_tinted(World w, int x, int y, int z, IIcon[] icons, short[] RGBa) {
public void hintParticleTinted(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));
createParticleFX(w, x, y, z);
}
@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));
createParticleFX(w, x, y, z);
}
@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));
createParticleFX(w, x, y, z);
}
@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));
createParticleFX(w, x, y, z);
}
private static void createParticleFX(World w, int x, int y, int z) {
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
public void hintParticleTinted(World w, int x, int y, int z, Block block, int meta, short[] RGBa) {
hintParticleTinted(w, x, y, z, createIIconFromBlock(block, meta), RGBa);
}
@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});
}
@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});
}
private static IIcon[] createIIconFromBlock(Block block, int meta) {
IIcon[] ret = new IIcon[6];
for (int i = 0; i < 6; i++) {
block.getIcon(i, meta);
}
return ret;
}
}