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.quadSize *= light ? 0.9f : 0.75f;
this.setParticleSpeed(dx, dy, dz); this.setParticleSpeed(dx, dy, dz);
var lightness = light ? 0.3f : 1.0f;
var r = FastColor.ARGB32.red(color); var r = FastColor.ARGB32.red(color);
var g = FastColor.ARGB32.green(color); var g = FastColor.ARGB32.green(color);
var b = FastColor.ARGB32.blue(color); var b = FastColor.ARGB32.blue(color);
var a = FastColor.ARGB32.alpha(color); this.setColor(r / 255f, g / 255f, b / 255f);
this.setColor(r / 255f * lightness, g / 255f * lightness, b / 255f * lightness); this.setAlpha(light ? 0.3f : 1.0f);
this.setAlpha(a / 255f * lightness);
this.friction = 0.96F; this.friction = 0.96F;
this.gravity = light && dy != 0 && dx != 0 && dz != 0 ? -0.01F : 0F; 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.setSpriteFromAge(this.sprites);
this.alpha = 1.0f - ((float) this.age / (float) this.lifetime); this.alpha = 1.0f - ((float) this.age / (float) this.lifetime);
if (light) { if (light) {
this.alpha *= 0.3f;
this.quadSize *= 0.96f; this.quadSize *= 0.96f;
} }
} }

View file

@ -73,7 +73,6 @@ public class BlockEntityConjured extends HexBlockEntity {
} }
public void landParticle(Entity entity, int number) { public void landParticle(Entity entity, int number) {
if (getBlockState().getBlock() instanceof BlockConjuredLight) {
for (int i = 0; i < number * 2; i++) { for (int i = 0; i < number * 2; i++) {
int color = this.colorizer.getColor(entity.tickCount, entity.position() int color = this.colorizer.getColor(entity.tickCount, entity.position()
.add(new Vec3(RANDOM.nextFloat(), RANDOM.nextFloat(), RANDOM.nextFloat()).scale( .add(new Vec3(RANDOM.nextFloat(), RANDOM.nextFloat(), RANDOM.nextFloat()).scale(
@ -86,7 +85,6 @@ public class BlockEntityConjured extends HexBlockEntity {
0.0, 0.0, 0.0); 0.0, 0.0, 0.0);
} }
} }
}
@Override @Override
protected void saveModData(CompoundTag tag) { protected void saveModData(CompoundTag tag) {