make some progress towards fixing fabulous conjures

This commit is contained in:
yrsegal@gmail.com 2022-06-09 17:02:19 -04:00
parent b0bdbb7d76
commit 233fb28eac
2 changed files with 13 additions and 16 deletions

View file

@ -33,13 +33,11 @@ public class ConjureParticle extends TextureSheetParticle {
this.quadSize *= light ? 0.9f : 0.75f;
this.setParticleSpeed(dx, dy, dz);
var lightness = light ? 0.3f : 1.0f;
var r = FastColor.ARGB32.red(color);
var g = FastColor.ARGB32.green(color);
var b = FastColor.ARGB32.blue(color);
var a = FastColor.ARGB32.alpha(color);
this.setColor(r / 255f * lightness, g / 255f * lightness, b / 255f * lightness);
this.setAlpha(a / 255f * lightness);
this.setColor(r / 255f, g / 255f, b / 255f);
this.setAlpha(light ? 0.3f : 1.0f);
this.friction = 0.96F;
this.gravity = light && dy != 0 && dx != 0 && dz != 0 ? -0.01F : 0F;
@ -63,6 +61,7 @@ public class ConjureParticle extends TextureSheetParticle {
this.setSpriteFromAge(this.sprites);
this.alpha = 1.0f - ((float) this.age / (float) this.lifetime);
if (light) {
this.alpha *= 0.3f;
this.quadSize *= 0.96f;
}
}

View file

@ -73,18 +73,16 @@ public class BlockEntityConjured extends HexBlockEntity {
}
public void landParticle(Entity entity, int number) {
if (getBlockState().getBlock() instanceof BlockConjuredLight) {
for (int i = 0; i < number * 2; i++) {
int color = this.colorizer.getColor(entity.tickCount, entity.position()
.add(new Vec3(RANDOM.nextFloat(), RANDOM.nextFloat(), RANDOM.nextFloat()).scale(
RANDOM.nextFloat() * 3)));
assert level != null;
level.addParticle(new ConjureParticleOptions(color, false),
entity.getX() + (RANDOM.nextFloat() * 0.8D) - 0.2D,
getBlockPos().getY() + (RANDOM.nextFloat() * 0.05D) + 0.95D,
entity.getZ() + (RANDOM.nextFloat() * 0.8D) - 0.2D,
0.0, 0.0, 0.0);
}
for (int i = 0; i < number * 2; i++) {
int color = this.colorizer.getColor(entity.tickCount, entity.position()
.add(new Vec3(RANDOM.nextFloat(), RANDOM.nextFloat(), RANDOM.nextFloat()).scale(
RANDOM.nextFloat() * 3)));
assert level != null;
level.addParticle(new ConjureParticleOptions(color, false),
entity.getX() + (RANDOM.nextFloat() * 0.8D) - 0.2D,
getBlockPos().getY() + (RANDOM.nextFloat() * 0.05D) + 0.95D,
entity.getZ() + (RANDOM.nextFloat() * 0.8D) - 0.2D,
0.0, 0.0, 0.0);
}
}