-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
167 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 1 addition & 5 deletions
6
...va/org/ladysnake/effective/core/mixin/chest_bubbles/UnderwaterOpenChestBubbleSpawner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
...g/ladysnake/effective/core/mixin/chest_bubbles/UnderwaterOpenEnderChestBubbleSpawner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/client/java/org/ladysnake/effective/core/particle/GlowCascadeParticle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.ladysnake.effective.core.particle; | ||
|
||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.client.particle.Particle; | ||
import net.minecraft.client.particle.ParticleFactory; | ||
import net.minecraft.client.particle.SpriteProvider; | ||
import net.minecraft.client.render.LightmapTextureManager; | ||
import net.minecraft.client.world.ClientWorld; | ||
import net.minecraft.particle.SimpleParticleType; | ||
import net.minecraft.util.math.BlockPos; | ||
import org.ladysnake.effective.core.utils.EffectiveUtils; | ||
|
||
import java.awt.*; | ||
|
||
public class GlowCascadeParticle extends CascadeParticle { | ||
private GlowCascadeParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { | ||
super(world, x, y, z, velocityX, velocityY, velocityZ, spriteProvider); | ||
|
||
Color glowingWaterColor = EffectiveUtils.getGlowingWaterColor(world, BlockPos.ofFloored(x, y, z)); | ||
this.red = glowingWaterColor.getRed() / 255f; | ||
this.green = glowingWaterColor.getGreen() / 255f; | ||
this.blue = glowingWaterColor.getBlue() / 255f; | ||
} | ||
|
||
@Override | ||
protected int getBrightness(float tint) { | ||
return LightmapTextureManager.MAX_LIGHT_COORDINATE; | ||
} | ||
|
||
@Environment(EnvType.CLIENT) | ||
public static class Factory implements ParticleFactory<SimpleParticleType> { | ||
private final SpriteProvider spriteProvider; | ||
|
||
public Factory(SpriteProvider spriteProvider) { | ||
this.spriteProvider = spriteProvider; | ||
} | ||
|
||
@Override | ||
public Particle createParticle(SimpleParticleType parameters, ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { | ||
return new GlowCascadeParticle(world, x, y, z, velocityX, velocityY, velocityZ, this.spriteProvider); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 60 additions & 57 deletions
117
src/client/java/org/ladysnake/effective/core/particle/MistParticle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,60 @@ | ||
package org.ladysnake.effective.core.particle; | ||
|
||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.client.particle.*; | ||
import net.minecraft.client.world.ClientWorld; | ||
import net.minecraft.particle.SimpleParticleType; | ||
import org.ladysnake.effective.core.Effective; | ||
|
||
public class MistParticle extends SpriteBillboardParticle { | ||
public MistParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { | ||
super(world, x, y, z, velocityX, velocityY, velocityZ); | ||
|
||
this.velocityX = velocityX; | ||
this.velocityY = velocityY; | ||
this.velocityZ = velocityZ; | ||
|
||
this.setSpriteForAge(spriteProvider); | ||
|
||
|
||
// WorldParticleBuilder.create(Effective.MIST) | ||
// .enableForcedSpawn() | ||
// .setSpinData(SpinParticleData.create((world.random.nextFloat() - world.random.nextFloat()) / 20f).build()) | ||
// .setScaleData(GenericParticleData.create(10f + world.random.nextFloat() * 5f).build()) | ||
// .setTransparencyData( | ||
// GenericParticleData.create(0.001f, 0.1f, 0f) | ||
// .setEasing(Easing.EXPO_OUT, Easing.SINE_OUT) | ||
// .build() | ||
// ) | ||
// .setLifetime(300) | ||
// .enableNoClip() | ||
// .setNaturalLighting() | ||
// .setRenderType(LodestoneWorldParticleRenderType.TRANSPARENT.withDepthFade()) | ||
// .setColorData(ColorParticleData.create(waterfall.mistColor(), waterfall.mistColor()).build()) | ||
// .setMotion(world.getRandom().nextFloat() / 15f * Math.signum(offsetX), world.getRandom().nextGaussian() / 25f, world.getRandom().nextFloat() / 15f * Math.signum(offsetZ)) | ||
// .spawn(world, blockPos.getX() + .5f, blockPos.getY() + .5f, blockPos.getZ() + .5f); | ||
} | ||
|
||
@Override | ||
public ParticleTextureSheet getType() { | ||
return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; | ||
} | ||
|
||
@Environment(EnvType.CLIENT) | ||
public static class Factory implements ParticleFactory<SimpleParticleType> { | ||
private final SpriteProvider spriteProvider; | ||
|
||
public Factory(SpriteProvider spriteProvider) { | ||
this.spriteProvider = spriteProvider; | ||
} | ||
|
||
@Override | ||
public Particle createParticle(SimpleParticleType parameters, ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { | ||
return new MistParticle(world, x, y, z, velocityX, velocityY, velocityZ, this.spriteProvider); | ||
} | ||
} | ||
} | ||
//package org.ladysnake.effective.core.particle; | ||
// | ||
//import net.fabricmc.api.EnvType; | ||
//import net.fabricmc.api.Environment; | ||
//import net.minecraft.client.particle.*; | ||
//import net.minecraft.client.world.ClientWorld; | ||
//import net.minecraft.particle.SimpleParticleType; | ||
//import org.ladysnake.effective.core.Effective; | ||
// | ||
//public class MistParticle extends SpriteBillboardParticle { | ||
// public MistParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) { | ||
// super(world, x, y, z, velocityX, velocityY, velocityZ); | ||
// | ||
// this.velocityX = velocityX; | ||
// this.velocityY = velocityY; | ||
// this.velocityZ = velocityZ; | ||
// | ||
// this.setSpriteForAge(spriteProvider); | ||
// | ||
// this.scale = 10f + world.random.nextFloat() * 5f; | ||
// this.maxAge = 0; | ||
// this.alpha = 0.01f; | ||
// | ||
//// WorldParticleBuilder.create(Effective.MIST) | ||
//// .enableForcedSpawn() | ||
//// .setSpinData(SpinParticleData.create((world.random.nextFloat() - world.random.nextFloat()) / 20f).build()) | ||
//// .setScaleData(GenericParticleData.create(10f + world.random.nextFloat() * 5f).build()) | ||
//// .setTransparencyData( | ||
//// GenericParticleData.create(0.001f, 0.1f, 0f) | ||
//// .setEasing(Easing.EXPO_OUT, Easing.SINE_OUT) | ||
//// .build() | ||
//// ) | ||
//// .setLifetime(300) | ||
//// .enableNoClip() | ||
//// .setNaturalLighting() | ||
//// .setRenderType(LodestoneWorldParticleRenderType.TRANSPARENT.withDepthFade()) | ||
//// .setColorData(ColorParticleData.create(waterfall.mistColor(), waterfall.mistColor()).build()) | ||
//// .setMotion(world.getRandom().nextFloat() / 15f * Math.signum(offsetX), world.getRandom().nextGaussian() / 25f, world.getRandom().nextFloat() / 15f * Math.signum(offsetZ)) | ||
//// .spawn(world, blockPos.getX() + .5f, blockPos.getY() + .5f, blockPos.getZ() + .5f); | ||
// } | ||
// | ||
// @Override | ||
// public ParticleTextureSheet getType() { | ||
// return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT; | ||
// } | ||
// | ||
// @Environment(EnvType.CLIENT) | ||
// public static class Factory implements ParticleFactory<SimpleParticleType> { | ||
// private final SpriteProvider spriteProvider; | ||
// | ||
// public Factory(SpriteProvider spriteProvider) { | ||
// this.spriteProvider = spriteProvider; | ||
// } | ||
// | ||
// @Override | ||
// public Particle createParticle(SimpleParticleType parameters, ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ) { | ||
// return new MistParticle(world, x, y, z, velocityX, velocityY, velocityZ, this.spriteProvider); | ||
// } | ||
// } | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.