Merge pull request #11 from AmyMialee/main

Conjured Lights Update
This commit is contained in:
petrak@ 2022-02-05 00:00:45 -06:00 committed by GitHub
commit b2a7b864c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 25 additions and 13 deletions

View file

@ -12,19 +12,23 @@ import java.util.Random;
public class ConjureParticle extends TextureSheetParticle {
private static final Random RANDOM = new Random();
private final SpriteSet sprites;
private final boolean light;
ConjureParticle(ClientLevel pLevel, double pX, double pY, double pZ, SpriteSet pSprites, boolean light) {
super(pLevel, pX, pY, pZ, (0.5D - RANDOM.nextDouble()) * .002, 0, (0.5D - RANDOM.nextDouble()) * .002);
this.friction = 0.96F;
this.gravity = light ? -0.005F : 0F;
this.gravity = light ? -0.01F : 0F;
this.speedUpWhenYMotionIsBlocked = true;
this.sprites = pSprites;
this.yd *= 0F;
this.xd *= 0.1F;
this.zd *= 0.1F;
this.xd *= light ? 0.001f : 0.1F;
this.zd *= light ? 0.001f : 0.1F;
this.roll = RANDOM.nextFloat(360);
this.oRoll = this.roll;
this.light = light;
this.quadSize *= light ? 0.9f : 0.75f;
this.quadSize *= 0.75F;
this.lifetime = (int) ((light ? 64.0D : 32.0D) / (Math.random() + 1f));
this.lifetime = (int) ((light ? 64.0D : 32.0D) / ((Math.random() + 3f) * 0.25f));
this.hasPhysics = false;
this.setSpriteFromAge(pSprites);
}
@ -36,6 +40,15 @@ public class ConjureParticle extends TextureSheetParticle {
public void tick() {
super.tick();
this.setSpriteFromAge(this.sprites);
if (light) this.quadSize *= 0.96f;
}
public void setSpriteFromAge(@NotNull SpriteSet pSprite) {
if (!this.removed) {
int age = this.age * 4;
if (age > this.lifetime) age /= 4;
this.setSprite(pSprite.get(age, this.lifetime));
}
}
@OnlyIn(Dist.CLIENT)

View file

@ -1,12 +1,11 @@
{
"textures": [
"minecraft:glitter_7",
"minecraft:glitter_6",
"minecraft:glitter_5",
"minecraft:glitter_4",
"minecraft:glitter_3",
"minecraft:glitter_2",
"minecraft:glitter_1",
"minecraft:glitter_0"
"hexcasting:spin_cube_7",
"hexcasting:spin_cube_6",
"hexcasting:spin_cube_5",
"hexcasting:spin_cube_4",
"hexcasting:spin_cube_3",
"hexcasting:spin_cube_2",
"hexcasting:spin_cube_1"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B