Skip to content

Commit

Permalink
Updated Chrysalis version
Browse files Browse the repository at this point in the history
  • Loading branch information
Sydokiddo committed May 24, 2024
1 parent da0aaab commit 6ff925b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ archives_base_name = odyssey

# Dependencies
fabric_version=0.93.1+1.20.4
chrysalis_version=0.3.5
chrysalis_version=0.3.6
mod_menu_version=9.0.0
cloth_version=13.0.121
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ public class SpawnerBubbleParticle extends TextureSheetParticle {

// region Initialization and Ticking

private SpawnerBubbleParticle(ClientLevel clientLevel, double d, double e, double f, double g, double h, double i) {
super(clientLevel, d, e, f);
private SpawnerBubbleParticle(ClientLevel clientLevel, double x, double y, double z, double velocityX, double velocityY, double velocityZ) {
super(clientLevel, x, y, z);
this.setSize(0.02F, 0.02F);
this.quadSize *= this.random.nextFloat() * 0.6F + 0.2F;
this.xd = g * (double) 0.2F + (Math.random() * 2.0 - 1.0) * (double) 0.02F;
this.yd = h * (double) 0.2F + (Math.random() * 2.0 - 1.0) * (double) 0.02F;
this.zd = i * (double) 0.2F + (Math.random() * 2.0 - 1.0) * (double) 0.02F;
this.lifetime = (int) (8.0 / (Math.random() * 0.8 + 0.2)) + 4;
this.xd = velocityX * (double) 0.2F + (Math.random() * 2.0 - 1.0) * (double) 0.02F;
this.yd = velocityY * (double) 0.2F + (Math.random() * 2.0 - 1.0) * (double) 0.02F;
this.zd = velocityZ * (double) 0.2F + (Math.random() * 2.0 - 1.0) * (double) 0.02F;
}

@Override
Expand Down Expand Up @@ -51,16 +51,20 @@ public void tick() {
// region Rendering

@Override
public int getLightColor(float f) {
float g = ((float) this.age + f) / (float) this.lifetime;
g = Mth.clamp(g, 1.0F, 0.0F);
int lightColor = super.getLightColor(f);
int j = lightColor & 0xFF;
int k = lightColor >> 16 & 0xFF;
if ((j += (int) (g * 15.0F * 16.0F)) > 240) {
j = 240;
public int getLightColor(float tickRate) {

float divider = ((float) this.age) / (float) this.lifetime;
divider = Mth.clamp(divider, 1.0F, 0.0F);

int lightColor = super.getLightColor(tickRate);
int int1 = lightColor & 0xFF;
int int2 = lightColor >> 16 & 0xFF;

if ((int1 += (int) (divider * 15.0F * 16.0F)) > 240) {
int1 = 240;
}
return j | k << 16;

return int1 | int2 << 16;
}

@Override
Expand All @@ -75,16 +79,16 @@ public int getLightColor(float f) {
@Environment(EnvType.CLIENT)
public static class SpawnerBubbleProvider implements ParticleProvider<SimpleParticleType> {

private final SpriteSet sprite;
private final SpriteSet spriteSet;

public SpawnerBubbleProvider(SpriteSet spriteSet) {
this.sprite = spriteSet;
this.spriteSet = spriteSet;
}

@Override
public Particle createParticle(SimpleParticleType simpleParticleType, ClientLevel clientLevel, double d, double e, double f, double g, double h, double i) {
SpawnerBubbleParticle spawnerBubbleParticle = new SpawnerBubbleParticle(clientLevel, d, e, f, g, h, i);
spawnerBubbleParticle.pickSprite(this.sprite);
public Particle createParticle(SimpleParticleType simpleParticleType, ClientLevel clientLevel, double x, double y, double z, double velocityX, double velocityY, double velocityZ) {
SpawnerBubbleParticle spawnerBubbleParticle = new SpawnerBubbleParticle(clientLevel, x, y, z, velocityX, velocityY, velocityZ);
spawnerBubbleParticle.pickSprite(this.spriteSet);
return spawnerBubbleParticle;
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"fabric-api": "*",
"minecraft": ">=1.20.4",
"java": ">=17",
"chrysalis": ">=0.3.5"
"chrysalis": ">=0.3.6"
},
"suggests": {
"another-mod": "*"
Expand Down

0 comments on commit 6ff925b

Please sign in to comment.