mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 11:19:19 +00:00
Finish migrate to vanilla particle sys
This commit is contained in:
1 parent
f0993c20a4
commit
b4e0a076e7
74 files changed
+455
-475
No files matched your search
@@ -259,53 +259,6 @@ public class ClientProxy implements IProxy {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean noclipEnabled = false;
|
||||
private static boolean corruptSparkle = false;
|
||||
|
||||
@Override
|
||||
public void setSparkleFXNoClip(boolean noclip) {
|
||||
noclipEnabled = noclip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSparkleFXCorrupt(boolean corrupt) {
|
||||
corruptSparkle = corrupt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sparkleFX(double x, double y, double z, float r, float g, float b, float size, int m, boolean fake) {
|
||||
if(!doParticle() && !fake)
|
||||
return;
|
||||
|
||||
FXSparkle sparkle = new FXSparkle(Minecraft.getInstance().world, x, y, z, size, r, g, b, m);
|
||||
sparkle.fake = fake;
|
||||
sparkle.setCanCollide(!fake);
|
||||
if(noclipEnabled)
|
||||
sparkle.setCanCollide(false);
|
||||
if(corruptSparkle)
|
||||
sparkle.corrupt = true;
|
||||
Minecraft.getInstance().particles.addEffect(sparkle);
|
||||
}
|
||||
|
||||
private static boolean distanceLimit = true;
|
||||
private static boolean depthTest = true;
|
||||
|
||||
private boolean doParticle() {
|
||||
if(Thread.currentThread().getThreadGroup() == SidedThreadGroups.SERVER)
|
||||
return false;
|
||||
|
||||
if(!ConfigHandler.CLIENT.useVanillaParticleLimiter.get())
|
||||
return true;
|
||||
|
||||
float chance = 1F;
|
||||
if(Minecraft.getInstance().gameSettings.particles == ParticleStatus.DECREASED)
|
||||
chance = 0.6F;
|
||||
else if(Minecraft.getInstance().gameSettings.particles == ParticleStatus.MINIMAL)
|
||||
chance = 0.2F;
|
||||
|
||||
return chance == 1F || Math.random() < chance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lightningFX(Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, long seed, int colorOuter, int colorInner) {
|
||||
Minecraft.getInstance().particles.addEffect(new FXLightning(Minecraft.getInstance().world, vectorStart, vectorEnd, ticksPerMeter, seed, colorOuter, colorInner));
|
||||
|
||||
@@ -52,7 +52,9 @@ public class FXSparkle extends Particle {
|
||||
private float f4;
|
||||
private float f5;
|
||||
|
||||
public FXSparkle(World world, double x, double y, double z, float size, float red, float green, float blue, int m) {
|
||||
public FXSparkle(World world, double x, double y, double z, float size,
|
||||
float red, float green, float blue, int m,
|
||||
boolean fake, boolean noClip, boolean corrupt) {
|
||||
super(world, x, y, z, 0.0D, 0.0D, 0.0D);
|
||||
particleRed = red;
|
||||
particleGreen = green;
|
||||
@@ -66,6 +68,9 @@ public class FXSparkle extends Particle {
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
this.fake = fake;
|
||||
this.corrupt = corrupt;
|
||||
this.canCollide = !fake && !noClip;
|
||||
}
|
||||
|
||||
public static void dispatchQueuedRenders(Tessellator tessellator) {
|
||||
|
||||
@@ -12,10 +12,10 @@ import static vazkii.botania.common.block.ModBlocks.register;
|
||||
@Mod.EventBusSubscriber(modid = LibMisc.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class ModParticles {
|
||||
@ObjectHolder(LibMisc.MOD_ID + ":wisp")
|
||||
public static ParticleType<ParticleData> WISP;
|
||||
public static ParticleType<WispParticleData> WISP;
|
||||
|
||||
@ObjectHolder(LibMisc.MOD_ID + ":sparkle")
|
||||
public static ParticleType<ParticleData> SPARKLE;
|
||||
public static ParticleType<SparkleParticleData> SPARKLE;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerParticles(RegistryEvent.Register<ParticleType<?>> evt) {
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
package vazkii.botania.client.fx;
|
||||
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.particles.IParticleData;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Locale;
|
||||
|
||||
public class SparkleParticleData implements IParticleData {
|
||||
public final float size;
|
||||
public final float r, g, b;
|
||||
public final int m;
|
||||
public final boolean noClip;
|
||||
public final boolean fake;
|
||||
public final boolean corrupt;
|
||||
|
||||
public static SparkleParticleData noClip(float size, float r, float g, float b, int m) {
|
||||
return new SparkleParticleData(size, r, g, b, m, true, false, false);
|
||||
}
|
||||
|
||||
public static SparkleParticleData fake(float size, float r, float g, float b, int m) {
|
||||
return new SparkleParticleData(size, r, g, b, m, false, true, false);
|
||||
}
|
||||
|
||||
public static SparkleParticleData corrupt(float size, float r, float g, float b, int m) {
|
||||
return new SparkleParticleData(size, r, g, b, m, false, false, true);
|
||||
}
|
||||
|
||||
public static SparkleParticleData sparkle(float size, float r, float g, float b, int m) {
|
||||
return new SparkleParticleData(size, r, g, b, m, false, false, false);
|
||||
}
|
||||
|
||||
private SparkleParticleData(float size, float r, float g, float b, int m, boolean noClip, boolean fake, boolean corrupt) {
|
||||
this.size = size;
|
||||
this.r = r;
|
||||
this.g = g;
|
||||
this.b = b;
|
||||
this.m = m;
|
||||
this.noClip = noClip;
|
||||
this.fake = fake;
|
||||
this.corrupt = corrupt;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ParticleType<SparkleParticleData> getType() {
|
||||
return ModParticles.SPARKLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(PacketBuffer buf) {
|
||||
buf.writeFloat(size);
|
||||
buf.writeFloat(r);
|
||||
buf.writeFloat(g);
|
||||
buf.writeFloat(b);
|
||||
buf.writeInt(m);
|
||||
buf.writeBoolean(noClip);
|
||||
buf.writeBoolean(fake);
|
||||
buf.writeBoolean(corrupt);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getParameters() {
|
||||
return String.format(Locale.ROOT, "%s %.2f %.2f %.2f %.2f %d %s %s %s",
|
||||
this.getType().getRegistryName(), this.size, this.r, this.g, this.b, this.m, this.noClip, this.fake, this.corrupt);
|
||||
}
|
||||
|
||||
public static final IDeserializer<SparkleParticleData> DESERIALIZER = new IDeserializer<SparkleParticleData>() {
|
||||
@Nonnull
|
||||
@Override
|
||||
public SparkleParticleData deserialize(@Nonnull ParticleType<SparkleParticleData> type, @Nonnull StringReader reader) throws CommandSyntaxException {
|
||||
reader.expect(' ');
|
||||
float size = reader.readFloat();
|
||||
reader.expect(' ');
|
||||
float r = reader.readFloat();
|
||||
reader.expect(' ');
|
||||
float g = reader.readFloat();
|
||||
reader.expect(' ');
|
||||
float b = reader.readFloat();
|
||||
reader.expect(' ');
|
||||
int m = reader.readInt();
|
||||
reader.expect(' ');
|
||||
boolean noClip = reader.readBoolean();
|
||||
reader.expect(' ');
|
||||
boolean fake = reader.readBoolean();
|
||||
reader.expect(' ');
|
||||
boolean corrupt = reader.readBoolean();
|
||||
|
||||
return new SparkleParticleData(size, r, g, b, m, noClip, fake, corrupt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SparkleParticleData read(@Nonnull ParticleType<SparkleParticleData> type, PacketBuffer buf) {
|
||||
return new SparkleParticleData(buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readInt(), buf.readBoolean(), buf.readBoolean(), buf.readBoolean());
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -3,12 +3,12 @@ package vazkii.botania.client.fx;
|
||||
import net.minecraft.client.particle.IParticleFactory;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
|
||||
public class SparkleParticleType extends ParticleType<ParticleData> {
|
||||
public class SparkleParticleType extends ParticleType<SparkleParticleData> {
|
||||
public SparkleParticleType() {
|
||||
super(false, ParticleData.DESERIALIZER);
|
||||
super(false, SparkleParticleData.DESERIALIZER);
|
||||
}
|
||||
|
||||
public static IParticleFactory<ParticleData> FACTORY =
|
||||
public static IParticleFactory<SparkleParticleData> FACTORY =
|
||||
(data, world, x, y, z, xSpeed, ySpeed, zSpeed)
|
||||
-> new FXSparkle(world, x, y, z, data.size, data.r, data.g, data.b, (int) data.maxAgeMul);
|
||||
-> new FXSparkle(world, x, y, z, data.size, data.r, data.g, data.b, data.m, data.fake, data.noClip, data.corrupt);
|
||||
}
|
||||
+14
-20
@@ -9,35 +9,29 @@ import net.minecraft.particles.ParticleType;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Locale;
|
||||
|
||||
public class ParticleData implements IParticleData {
|
||||
private final ParticleType<ParticleData> type;
|
||||
public class WispParticleData implements IParticleData {
|
||||
public final float size;
|
||||
public final float r, g, b;
|
||||
public final float maxAgeMul;
|
||||
public final boolean depthTest;
|
||||
|
||||
public static ParticleData wisp(float size, float r, float g, float b) {
|
||||
public static WispParticleData wisp(float size, float r, float g, float b) {
|
||||
return wisp(size, r, g, b, 1);
|
||||
}
|
||||
|
||||
public static ParticleData wisp(float size, float r, float g, float b, float maxAgeMul) {
|
||||
public static WispParticleData wisp(float size, float r, float g, float b, float maxAgeMul) {
|
||||
return wisp(size, r, g, b, maxAgeMul, true);
|
||||
}
|
||||
|
||||
public static ParticleData wisp(float size, float r, float g, float b, boolean depth) {
|
||||
public static WispParticleData wisp(float size, float r, float g, float b, boolean depth) {
|
||||
return wisp(size, r, g, b, 1, depth);
|
||||
}
|
||||
|
||||
public static ParticleData wisp(float size, float r, float g, float b, float maxAgeMul, boolean depthTest) {
|
||||
return new ParticleData(ModParticles.WISP, size, r, g, b, maxAgeMul, depthTest);
|
||||
public static WispParticleData wisp(float size, float r, float g, float b, float maxAgeMul, boolean depthTest) {
|
||||
return new WispParticleData(size, r, g, b, maxAgeMul, depthTest);
|
||||
}
|
||||
|
||||
public static ParticleData sparkle(float size, float r, float g, float b, int maxAgeMul) {
|
||||
return new ParticleData(ModParticles.SPARKLE, size, r, g, b, maxAgeMul, true);
|
||||
}
|
||||
|
||||
private ParticleData(ParticleType<ParticleData> type, float size, float r, float g, float b, float maxAgeMul, boolean depthTest) {
|
||||
this.type = type;
|
||||
private WispParticleData(float size, float r, float g, float b, float maxAgeMul, boolean depthTest) {
|
||||
this.size = size;
|
||||
this.r = r;
|
||||
this.g = g;
|
||||
@@ -49,8 +43,8 @@ public class ParticleData implements IParticleData {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ParticleType<ParticleData> getType() {
|
||||
return type;
|
||||
public ParticleType<WispParticleData> getType() {
|
||||
return ModParticles.WISP;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,10 +64,10 @@ public class ParticleData implements IParticleData {
|
||||
this.getType().getRegistryName(), this.size, this.r, this.g, this.b, this.maxAgeMul, this.depthTest);
|
||||
}
|
||||
|
||||
public static final IDeserializer<ParticleData> DESERIALIZER = new IDeserializer<ParticleData>() {
|
||||
public static final IDeserializer<WispParticleData> DESERIALIZER = new IDeserializer<WispParticleData>() {
|
||||
@Nonnull
|
||||
@Override
|
||||
public ParticleData deserialize(@Nonnull ParticleType<ParticleData> type, @Nonnull StringReader reader) throws CommandSyntaxException {
|
||||
public WispParticleData deserialize(@Nonnull ParticleType<WispParticleData> type, @Nonnull StringReader reader) throws CommandSyntaxException {
|
||||
reader.expect(' ');
|
||||
float size = reader.readFloat();
|
||||
reader.expect(' ');
|
||||
@@ -89,12 +83,12 @@ public class ParticleData implements IParticleData {
|
||||
reader.expect(' ');
|
||||
depth = reader.readBoolean();
|
||||
}
|
||||
return new ParticleData(type, size, r, g, b, mam, depth);
|
||||
return new WispParticleData(size, r, g, b, mam, depth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParticleData read(@Nonnull ParticleType<ParticleData> type, PacketBuffer buf) {
|
||||
return new ParticleData(type, buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readBoolean());
|
||||
public WispParticleData read(@Nonnull ParticleType<WispParticleData> type, PacketBuffer buf) {
|
||||
return new WispParticleData(buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readBoolean());
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -3,12 +3,12 @@ package vazkii.botania.client.fx;
|
||||
import net.minecraft.client.particle.IParticleFactory;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
|
||||
public class WispParticleType extends ParticleType<ParticleData> {
|
||||
public class WispParticleType extends ParticleType<WispParticleData> {
|
||||
public WispParticleType() {
|
||||
super(false, ParticleData.DESERIALIZER);
|
||||
super(false, WispParticleData.DESERIALIZER);
|
||||
}
|
||||
|
||||
public static IParticleFactory<ParticleData> FACTORY =
|
||||
public static IParticleFactory<WispParticleData> FACTORY =
|
||||
(data, world, x, y, z, xSpeed, ySpeed, zSpeed) ->
|
||||
new FXWisp(world, x, y, z, xSpeed, ySpeed, zSpeed, data.size, data.r, data.g, data.b, data.depthTest, data.maxAgeMul);
|
||||
}
|
||||
@@ -19,7 +19,6 @@ import net.minecraft.item.HoeItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.IItemProvider;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
@@ -31,7 +30,7 @@ import net.minecraftforge.common.PlantType;
|
||||
import net.minecraftforge.common.ToolType;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -106,14 +105,21 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
|
||||
world.addParticle(ParticleTypes.FLAME, pos.getX() + r.nextFloat(), pos.getY() + 1.1, pos.getZ() + r.nextFloat(), 0, 0, 0);
|
||||
break;
|
||||
case INFUSED:
|
||||
if(r.nextInt(100) == 0)
|
||||
Botania.proxy.sparkleFX(pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 0F, 1F, 1F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
if(r.nextInt(100) == 0) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(r.nextFloat() * 0.2F + 1F, 0F, 1F, 1F, 5);
|
||||
world.addParticle(data, pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case MUTATED:
|
||||
if(r.nextInt(100) == 0) {
|
||||
if(r.nextInt(100) > 25)
|
||||
Botania.proxy.sparkleFX(pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 1F, 0F, 1F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
else Botania.proxy.sparkleFX(pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 1F, 1F, 0F, r.nextFloat() * 0.2F + 1F, 5);
|
||||
if(r.nextInt(100) > 25) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(r.nextFloat() * 0.2F + 1F, 1F, 0F, 1F, 5);
|
||||
world.addParticle(data, pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 0, 0, 0);
|
||||
}
|
||||
else {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(r.nextFloat() * 0.2F + 1F, 1F, 1F, 0F, 5);
|
||||
world.addParticle(data, pos.getX() + r.nextFloat(), pos.getY() + 1.05, pos.getZ() + r.nextFloat(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -10,23 +10,18 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Random;
|
||||
@@ -39,8 +34,10 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void animateTick(BlockState state, World world, BlockPos pos, Random rand) {
|
||||
if(rand.nextBoolean())
|
||||
Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6);
|
||||
if(rand.nextBoolean()) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(0.45F + 0.2F * (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 6);
|
||||
world.addParticle(data, pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
||||
@@ -14,27 +14,19 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.TallFlowerBlock;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.state.properties.DoubleBlockHalf;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockModDoubleFlower extends TallFlowerBlock implements ILexiconable {
|
||||
@@ -58,8 +50,10 @@ public class BlockModDoubleFlower extends TallFlowerBlock implements ILexiconabl
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
|
||||
if(rand.nextDouble() < ConfigHandler.CLIENT.flowerParticleFrequency.get())
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
if(rand.nextDouble() < ConfigHandler.CLIENT.flowerParticleFrequency.get()) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(rand.nextFloat(), r / 255F, g / 255F, b / 255F, 5);
|
||||
world.addParticle(data, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, 0, 0, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,37 +14,23 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.DoublePlantBlock;
|
||||
import net.minecraft.block.FlowerBlock;
|
||||
import net.minecraft.block.DoublePlantBlock;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Effect;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Random;
|
||||
@@ -90,8 +76,10 @@ public class BlockModFlower extends FlowerBlock implements ILexiconable, IGrowab
|
||||
double y = pos.getY() + offset.y;
|
||||
double z = pos.getZ() + offset.z;
|
||||
|
||||
if(rand.nextDouble() < ConfigHandler.CLIENT.flowerParticleFrequency.get())
|
||||
Botania.proxy.sparkleFX(x + 0.3 + rand.nextFloat() * 0.5, y + 0.5 + rand.nextFloat() * 0.5, z + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
if(rand.nextDouble() < ConfigHandler.CLIENT.flowerParticleFrequency.get()) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(rand.nextFloat(), r / 255F, g / 255F, b / 255F, 5);
|
||||
world.addParticle(data, x + 0.3 + rand.nextFloat() * 0.5, y + 0.5 + rand.nextFloat() * 0.5, z + 0.3 + rand.nextFloat() * 0.5, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.BlockModFlower;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
@@ -58,10 +59,8 @@ public class BlockBuriedPetals extends BlockModFlower {
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
|
||||
Botania.proxy.setSparkleFXNoClip(true);
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.1 + rand.nextFloat() * 0.1, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
|
||||
Botania.proxy.setSparkleFXNoClip(false);
|
||||
SparkleParticleData data = SparkleParticleData.noClip(rand.nextFloat(), r / 255F, g / 255F, b / 255F, 5);
|
||||
world.addParticle(data, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.1 + rand.nextFloat() * 0.1, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, 0, 0, 0);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -32,7 +32,7 @@ import vazkii.botania.api.item.IFloatingFlower;
|
||||
import vazkii.botania.api.item.IFloatingFlower.IslandType;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.block.tile.TileFloatingFlower;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
@@ -79,8 +79,10 @@ public class BlockFloatingFlower extends BlockMod implements ILexiconable {
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
|
||||
if(rand.nextDouble() < ConfigHandler.CLIENT.flowerParticleFrequency.get())
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
if(rand.nextDouble() < ConfigHandler.CLIENT.flowerParticleFrequency.get()) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(rand.nextFloat(), r / 255F, g / 255F, b / 255F, 5);
|
||||
world.addParticle(data, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,7 +30,7 @@ import vazkii.botania.api.item.IHornHarvestable;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.recipe.ICustomApothecaryColor;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
@@ -77,8 +77,10 @@ public class BlockModMushroom extends MushroomBlock implements IHornHarvestable,
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
|
||||
if(rand.nextDouble() < ConfigHandler.CLIENT.flowerParticleFrequency.get() * 0.25F)
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5);
|
||||
if(rand.nextDouble() < ConfigHandler.CLIENT.flowerParticleFrequency.get() * 0.25F) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(rand.nextFloat(), r / 255F, g / 255F, b / 255F, 5);
|
||||
world.addParticle(data, pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,7 +18,7 @@ import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.mana.IManaPool;
|
||||
import vazkii.botania.api.subtile.TileEntitySpecialFlower;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -45,7 +45,7 @@ public class SubTileManastar extends TileEntitySpecialFlower {
|
||||
if(state != NONE && Math.random() > 0.6) {
|
||||
float r = state == INCREASING ? 0.05F : 1F;
|
||||
float b = state == INCREASING ? 1F : 0.05F;
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() / 7, r, 0.05F, b, 1);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() / 7, r, 0.05F, b, 1);
|
||||
world.addParticle(data, getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, getPos().getY() + 0.75 + Math.random() * 0.2 - 0.1, getPos().getZ() + 0.5, 0, (float) Math.random() / 50, 0);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -22,9 +22,8 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.recipe.RecipePureDaisy;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.TileEntitySpecialFlower;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModSubtiles;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -70,8 +69,9 @@ public class SubTilePureDaisy extends TileEntitySpecialFlower {
|
||||
for (int i = 0; i < POSITIONS.length; i++) {
|
||||
if ((activePositions >>> i & 1) > 0) {
|
||||
BlockPos coords = getPos().add(POSITIONS[i]);
|
||||
Botania.proxy.sparkleFX(coords.getX() + Math.random(), coords.getY() + Math.random(), coords.getZ() + Math.random(), 1F, 1F, 1F, (float) Math.random(), 5);
|
||||
}
|
||||
SparkleParticleData data = SparkleParticleData.sparkle((float) Math.random(), 1F, 1F, 1F, 5);
|
||||
world.addParticle(data, coords.getX() + Math.random(), coords.getY() + Math.random(), coords.getZ() + Math.random(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -146,7 +146,7 @@ public class SubTilePureDaisy extends TileEntitySpecialFlower {
|
||||
double y = coords.getY() + Math.random() + 0.5;
|
||||
double z = coords.getZ() + Math.random();
|
||||
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() / 2F, 1, 1, 1);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() / 2F, 1, 1, 1);
|
||||
getWorld().addParticle(data, x, y, z, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.TileEntityFunctionalFlower;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.network.PacketHandler;
|
||||
@@ -55,7 +55,7 @@ public class SubTileDaffomill extends TileEntityFunctionalFlower {
|
||||
super.tickFlower();
|
||||
|
||||
if(getWorld().rand.nextInt(4) == 0) {
|
||||
ParticleData data = ParticleData.wisp(0.25F + (float) Math.random() * 0.15F, 0.05F, 0.05F, 0.05F);
|
||||
WispParticleData data = WispParticleData.wisp(0.25F + (float) Math.random() * 0.15F, 0.05F, 0.05F, 0.05F);
|
||||
world.addParticle(data, getPos().getX() + Math.random(), getPos().getY() + Math.random(), getPos().getZ() + Math.random(), orientation.getXOffset() * 0.1F, orientation.getYOffset() * 0.1F, orientation.getZOffset() * 0.1F);
|
||||
}
|
||||
|
||||
|
||||
+5
-8
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
@@ -19,8 +18,7 @@ import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.TileEntityFunctionalFlower;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModSubtiles;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -55,6 +53,7 @@ public class SubTileTangleberrie extends TileEntityFunctionalFlower {
|
||||
AxisAlignedBB boundingBox = new AxisAlignedBB(x1 - range, y1 - range, z1 - range, x1 + range + 1, y1 + range + 1, z1 + range + 1);
|
||||
List<LivingEntity> entities = getWorld().getEntitiesWithinAABB(LivingEntity.class, boundingBox);
|
||||
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(1F, 0.5F, 0.5F, 0.5F, 3);
|
||||
for(LivingEntity entity : entities) {
|
||||
if(entity instanceof PlayerEntity || !entity.isNonBoss())
|
||||
continue;
|
||||
@@ -67,11 +66,9 @@ public class SubTileTangleberrie extends TileEntityFunctionalFlower {
|
||||
|
||||
if(distance > maxDist && distance < range) {
|
||||
MathHelper.setEntityMotionFromVector(entity, new Vector3(x1, y1, z1), getMotionVelocity());
|
||||
if(getWorld().rand.nextInt(3) == 0)
|
||||
Botania.proxy.sparkleFX(x2 + Math.random() * entity.getWidth(),
|
||||
y2 + Math.random() * entity.getHeight(),
|
||||
z2 + Math.random() * entity.getWidth(),
|
||||
0.5F, 0.5F, 0.5F, 1F, 3);
|
||||
if(getWorld().rand.nextInt(3) == 0) {
|
||||
world.addParticle(data, x2 + Math.random() * entity.getWidth(), y2 + Math.random() * entity.getHeight(), z2 + Math.random() * entity.getWidth(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-6
@@ -12,19 +12,16 @@ package vazkii.botania.common.block.subtile.generating;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.TNTEntity;
|
||||
import net.minecraft.entity.item.TNTEntity;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.TileEntityGeneratingFlower;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModSubtiles;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@@ -67,8 +64,10 @@ public class SubTileEntropinnyum extends TileEntityGeneratingFlower {
|
||||
if(getWorld().isRemote && getWorld().getEntityByID(param) instanceof TNTEntity) {
|
||||
Entity e = getWorld().getEntityByID(param);
|
||||
|
||||
for(int i = 0; i < 50; i++)
|
||||
Botania.proxy.sparkleFX(e.posX + Math.random() * 4 - 2, e.posY + Math.random() * 4 - 2, e.posZ + Math.random() * 4 - 2, 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, (float) (Math.random() * 0.65F + 1.25F), 12);
|
||||
for(int i = 0; i < 50; i++) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle((float) (Math.random() * 0.65F + 1.25F), 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 12);
|
||||
world.addParticle(data, e.posX + Math.random() * 4 - 2, e.posY + Math.random() * 4 - 2, e.posZ + Math.random() * 4 - 2, 0, 0, 0);
|
||||
}
|
||||
|
||||
getWorld().addParticle(ParticleTypes.EXPLOSION_EMITTER, e.posX, e.posY, e.posZ, 1D, 0D, 0D);
|
||||
}
|
||||
|
||||
+3
-3
@@ -31,7 +31,7 @@ import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.TileEntityGeneratingFlower;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -66,7 +66,7 @@ public class SubTileHydroangeas extends TileEntityGeneratingFlower {
|
||||
if(cooldown > 0) {
|
||||
cooldown--;
|
||||
for(int i = 0; i < 3; i++) {
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() / 6, 0.1F, 0.1F, 0.1F, 1);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() / 6, 0.1F, 0.1F, 0.1F, 1);
|
||||
world.addParticle(data, getPos().getX() + 0.5 + Math.random() * 0.2 - 0.1, getPos().getY() + 0.5 + Math.random() * 0.2 - 0.1, getPos().getZ() + 0.5 + Math.random() * 0.2 - 0.1, 0, (float) Math.random() / 30, 0);
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,7 @@ public class SubTileHydroangeas extends TileEntityGeneratingFlower {
|
||||
}
|
||||
|
||||
public void doBurnParticles() {
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() / 6, 0.05F, 0.05F, 0.7F, 1);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() / 6, 0.05F, 0.05F, 0.7F, 1);
|
||||
world.addParticle(data, getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, getPos().getY() + 0.55 + Math.random() * 0.2 - 0.1, getPos().getZ() + 0.5, 0, (float) Math.random() / 60, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -42,7 +42,7 @@ public class SubTileThermalily extends SubTileHydroangeas {
|
||||
|
||||
@Override
|
||||
public void doBurnParticles() {
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() / 6, 0.7F, 0.05F, 0.05F, 1);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() / 6, 0.7F, 0.05F, 0.05F, 1);
|
||||
world.addParticle(data, getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, getPos().getY() + 0.9 + Math.random() * 0.2 - 0.1, getPos().getZ() + 0.5, 0, (float) Math.random() / 60, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import vazkii.botania.api.recipe.IElvenItem;
|
||||
import vazkii.botania.api.recipe.RecipeElvenTrade;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.AlfPortalState;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.mana.BlockPool;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
@@ -211,7 +211,7 @@ public class TileAlfPortal extends TileMod implements ITickableTileEntity {
|
||||
pos = CONVERTER_X_Z_FP.apply(pos);
|
||||
|
||||
float motionMul = 0.2F;
|
||||
ParticleData data = ParticleData.wisp((float) (Math.random() * 0.15F + 0.1F), (float) (Math.random() * 0.25F), (float) (Math.random() * 0.5F + 0.5F), (float) (Math.random() * 0.25F));
|
||||
WispParticleData data = WispParticleData.wisp((float) (Math.random() * 0.15F + 0.1F), (float) (Math.random() * 0.25F), (float) (Math.random() * 0.5F + 0.5F), (float) (Math.random() * 0.25F));
|
||||
world.addParticle(data, getPos().getX() + pos[0], getPos().getY() + pos[1], getPos().getZ() + pos[2], (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,13 +14,9 @@ import net.minecraft.client.Minecraft;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Items;
|
||||
@@ -28,10 +24,7 @@ import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
@@ -53,7 +46,7 @@ import vazkii.botania.api.recipe.ICustomApothecaryColor;
|
||||
import vazkii.botania.api.recipe.RecipePetals;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
@@ -273,8 +266,9 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary,
|
||||
float blue = color.getBlue() / 255F;
|
||||
if(Math.random() >= 0.75F)
|
||||
world.playSound(null, pos, SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F);
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1.2, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10);
|
||||
}
|
||||
SparkleParticleData data = SparkleParticleData.sparkle((float) Math.random(), red, green, blue, 10);
|
||||
world.addParticle(data, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1.2, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if(hasLava()) {
|
||||
@@ -315,8 +309,9 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary,
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10);
|
||||
}
|
||||
SparkleParticleData data = SparkleParticleData.sparkle((float) Math.random(), red, green, blue, 10);
|
||||
world.addParticle(data, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0, 0);
|
||||
}
|
||||
world.playSound(pos.getX(), pos.getY(), pos.getZ(), ModSounds.altarCraft, SoundCategory.BLOCKS, 1F, 1F, false);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -29,8 +29,8 @@ import vazkii.botania.api.mana.IManaReceiver;
|
||||
import vazkii.botania.api.recipe.RecipeBrew;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
@@ -129,10 +129,10 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver, I
|
||||
float g = color.getGreen() / 255F;
|
||||
float b = color.getBlue() / 255F;
|
||||
for(int i = 0; i < 5; i++) {
|
||||
ParticleData data1 = ParticleData.wisp(0.1F + (float) Math.random() * 0.05F, r, g, b);
|
||||
WispParticleData data1 = WispParticleData.wisp(0.1F + (float) Math.random() * 0.05F, r, g, b);
|
||||
world.addParticle(data1, pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, 0.03F - (float) Math.random() * 0.06F, 0.03F + (float) Math.random() * 0.015F, 0.03F - (float) Math.random() * 0.06F);
|
||||
for(int j = 0; j < 2; j++) {
|
||||
ParticleData data = ParticleData.wisp(0.1F + (float) Math.random() * 0.2F, 0.2F, 0.2F, 0.2F);
|
||||
WispParticleData data = WispParticleData.wisp(0.1F + (float) Math.random() * 0.2F, 0.2F, 0.2F, 0.2F);
|
||||
world.addParticle(data, pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, 0.03F - (float) Math.random() * 0.06F, 0.03F + (float) Math.random() * 0.015F, 0.03F - (float) Math.random() * 0.06F);
|
||||
}
|
||||
}
|
||||
@@ -174,9 +174,10 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver, I
|
||||
float r = c.getRed() / 255F;
|
||||
float g = c.getGreen() / 255F;
|
||||
float b = c.getBlue() / 255F;
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, r, g, b, (float) Math.random() * 2F + 0.5F, 10);
|
||||
for(int j = 0; j < 2; j++) {
|
||||
ParticleData data = ParticleData.wisp(0.1F + (float) Math.random() * 0.2F, 0.2F, 0.2F, 0.2F);
|
||||
SparkleParticleData data1 = SparkleParticleData.sparkle((float) Math.random() * 2F + 0.5F, r, g, b, 10);
|
||||
world.addParticle(data1, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0, 0);
|
||||
for(int j = 0; j < 2; j++) {
|
||||
WispParticleData data = WispParticleData.wisp(0.1F + (float) Math.random() * 0.2F, 0.2F, 0.2F, 0.2F);
|
||||
world.addParticle(data, pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, 0.05F - (float) Math.random() * 0.1F, 0.05F + (float) Math.random() * 0.03F, 0.05F - (float) Math.random() * 0.1F);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ import vazkii.botania.api.mana.spark.ISparkEntity;
|
||||
import vazkii.botania.api.mana.spark.SparkHelper;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
@@ -307,10 +307,9 @@ public class TileEnchanter extends TileMod implements ISparkAttachable, ITickabl
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
Botania.proxy.sparkleFX(
|
||||
getPos().getX() + Math.random() * 0.4 - 0.2, getPos().getY(), getPos().getZ() + Math.random() * 0.4 - 0.2,
|
||||
red, green, blue, (float) Math.random(), 10);
|
||||
}
|
||||
SparkleParticleData data = SparkleParticleData.sparkle((float) Math.random(), red, green, blue, 10);
|
||||
world.addParticle(data, getPos().getX() + Math.random() * 0.4 - 0.2, getPos().getY(), getPos().getZ() + Math.random() * 0.4 - 0.2, 0, 0, 0);
|
||||
}
|
||||
world.playSound(pos.getX(), pos.getY(), pos.getZ(), ModSounds.enchanterEnchant, SoundCategory.BLOCKS, 1F, 1F, false);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.brew.Brew;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.brew.ItemIncenseStick;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
@@ -78,9 +78,9 @@ public class TileIncensePlate extends TileSimpleInventory implements ITickableTi
|
||||
float r = color.getRed() / 255F;
|
||||
float g = color.getGreen() / 255F;
|
||||
float b = color.getBlue() / 255F;
|
||||
ParticleData data1 = ParticleData.wisp(0.05F + (float) Math.random() * 0.02F, r, g, b);
|
||||
WispParticleData data1 = WispParticleData.wisp(0.05F + (float) Math.random() * 0.02F, r, g, b);
|
||||
world.addParticle(data1, x - (Math.random() - 0.5) * 0.2, y - (Math.random() - 0.5) * 0.2, z - (Math.random() - 0.5) * 0.2, 0.005F - (float) Math.random() * 0.01F, 0.01F + (float) Math.random() * 0.005F, 0.005F - (float) Math.random() * 0.01F);
|
||||
ParticleData data = ParticleData.wisp(0.05F + (float) Math.random() * 0.02F, 0.2F, 0.2F, 0.2F);
|
||||
WispParticleData data = WispParticleData.wisp(0.05F + (float) Math.random() * 0.02F, 0.2F, 0.2F, 0.2F);
|
||||
world.addParticle(data, x - (Math.random() - 0.5) * 0.2, y - (Math.random() - 0.5) * 0.2, z - (Math.random() - 0.5) * 0.2, 0.005F - (float) Math.random() * 0.01F, 0.01F + (float) Math.random() * 0.001F, 0.005F - (float) Math.random() * 0.01F);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -18,17 +18,14 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.item.EnderPearlEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
@@ -37,27 +34,23 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.network.NetworkHooks;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.LuminizerVariant;
|
||||
import vazkii.botania.api.wand.IWandBindable;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.block.BlockLightRelay;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.core.helper.PlayerHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibEntityNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public class TileLightRelay extends TileMod implements ITickableTileEntity, IWandBindable {
|
||||
@@ -117,7 +110,7 @@ public class TileLightRelay extends TileMod implements ITickableTileEntity, IWan
|
||||
mul = Math.min(maxMul, mul + mulPer);
|
||||
double rad = radPer * (i + ticksElapsed * 0.4);
|
||||
Vector3 vecRot = vecMag.crossProduct(Vector3.ONE).multiply(mul).rotate(rad, vecMag).add(vecTip);
|
||||
ParticleData data = ParticleData.wisp(0.1F, 0.4F, 0.4F, 1F, 1);
|
||||
WispParticleData data = WispParticleData.wisp(0.1F, 0.4F, 0.4F, 1F, 1);
|
||||
world.addParticle(data, vecRot.x, vecRot.y, vecRot.z, (float) -vecMag.x, (float) -vecMag.y, (float) -vecMag.z);
|
||||
vecTip = vecTip.add(vecMag);
|
||||
}
|
||||
@@ -329,8 +322,9 @@ public class TileLightRelay extends TileMod implements ITickableTileEntity, IWan
|
||||
double sin = Math.sin(rad);
|
||||
double s = 0.4;
|
||||
|
||||
Botania.proxy.sparkleFX(posX + cos * s, posY - 0.5, posZ + sin * s, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1.2F, 10);
|
||||
}
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(1.2F, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 10);
|
||||
world.addParticle(data, posX + cos * s, posY - 0.5, posZ + sin * s, 0, 0, 0);
|
||||
}
|
||||
|
||||
posX += motVec.x;
|
||||
posY += motVec.y;
|
||||
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@@ -66,7 +66,7 @@ public class TileManaFlame extends TileMod implements ITickableTileEntity {
|
||||
float s = 0.2F + (float) Math.random() * 0.1F;
|
||||
float m = 0.03F + (float) Math.random() * 0.015F;
|
||||
|
||||
ParticleData data = ParticleData.wisp(s, r, g, b, 1);
|
||||
WispParticleData data = WispParticleData.wisp(s, r, g, b, 1);
|
||||
world.addParticle(data, x, y, z, 0, m, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.AlfPortalState;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.block.BlockModFlower;
|
||||
import vazkii.botania.common.block.BlockPylon;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -74,10 +74,10 @@ public class TilePylon extends TileEntity implements ITickableTileEntity {
|
||||
centerBlock = centerBlock.subtract(new Vector3(0, 0.5, 0));
|
||||
Vector3 movementVector = centerBlock.subtract(ourCoords).normalize().multiply(0.2);
|
||||
|
||||
ParticleData data = ParticleData.wisp(0.25F + (float) Math.random() * 0.1F, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 1);
|
||||
WispParticleData data = WispParticleData.wisp(0.25F + (float) Math.random() * 0.1F, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 1);
|
||||
world.addParticle(data, x, pos.getY() + 0.25, z, 0, -(-0.075F - (float) Math.random() * 0.015F), 0);
|
||||
if(world.rand.nextInt(3) == 0) {
|
||||
ParticleData data1 = ParticleData.wisp(0.25F + (float) Math.random() * 0.1F, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F);
|
||||
WispParticleData data1 = WispParticleData.wisp(0.25F + (float) Math.random() * 0.1F, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F);
|
||||
world.addParticle(data1, x, pos.getY() + 0.25, z, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z);
|
||||
}
|
||||
}
|
||||
@@ -92,21 +92,28 @@ public class TilePylon extends TileEntity implements ITickableTileEntity {
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
|
||||
if(world.rand.nextInt(4) == 0)
|
||||
Botania.proxy.sparkleFX(centerBlock.x + (Math.random() - 0.5) * 0.5, centerBlock.y, centerBlock.z + (Math.random() - 0.5) * 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random(), 8);
|
||||
if(world.rand.nextInt(4) == 0) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle((float) Math.random(), r / 255F, g / 255F, b / 255F, 8);
|
||||
world.addParticle(data, centerBlock.x + (Math.random() - 0.5) * 0.5, centerBlock.y, centerBlock.z + (Math.random() - 0.5) * 0.5, 0, 0, 0);
|
||||
}
|
||||
|
||||
ParticleData data1 = ParticleData.wisp((float) Math.random() / 3F, r / 255F, g / 255F, b / 255F, 1);
|
||||
WispParticleData data1 = WispParticleData.wisp((float) Math.random() / 3F, r / 255F, g / 255F, b / 255F, 1);
|
||||
world.addParticle(data1, pos.getX() + 0.5 + (Math.random() - 0.5) * 0.25, pos.getY() - 0.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.25, 0, - -0.04F, 0);
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() / 5F, r / 255F, g / 255F, b / 255F, 1);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() / 5F, r / 255F, g / 255F, b / 255F, 1);
|
||||
world.addParticle(data, pos.getX() + 0.5 + (Math.random() - 0.5) * 0.125, pos.getY() + 1.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.125, 0, - -0.001F, 0);
|
||||
ParticleData data2 = ParticleData.wisp((float) Math.random() / 8F, r / 255F, g / 255F, b / 255F);
|
||||
WispParticleData data2 = WispParticleData.wisp((float) Math.random() / 8F, r / 255F, g / 255F, b / 255F);
|
||||
world.addParticle(data2, pos.getX() + 0.5 + (Math.random() - 0.5) * 0.25, pos.getY() + 1.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.25, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(world.rand.nextBoolean() && world.isRemote)
|
||||
Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random() * 1.5, pos.getZ() + Math.random(), variant == BlockPylon.Variant.GAIA ? 1F : 0.5F, variant == BlockPylon.Variant.NATURA ? 1F : 0.5F, variant == BlockPylon.Variant.NATURA ? 0.5F : 1F, (float) Math.random(), 2);
|
||||
if(world.rand.nextBoolean() && world.isRemote) {
|
||||
float r = variant == BlockPylon.Variant.GAIA ? 1F : 0.5F;
|
||||
float g = variant == BlockPylon.Variant.NATURA ? 1F : 0.5F;
|
||||
float b = variant == BlockPylon.Variant.NATURA ? 0.5F : 1F;
|
||||
SparkleParticleData data = SparkleParticleData.sparkle((float) Math.random(), r, g, b, 2);
|
||||
world.addParticle(data, pos.getX() + Math.random(), pos.getY() + Math.random() * 1.5, pos.getZ() + Math.random(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private Block getBlockForMeta() {
|
||||
|
||||
@@ -32,7 +32,8 @@ import vazkii.botania.api.mana.IManaReceiver;
|
||||
import vazkii.botania.api.recipe.RecipeRuneAltar;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
@@ -122,8 +123,9 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver,
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10);
|
||||
}
|
||||
SparkleParticleData data = SparkleParticleData.sparkle((float) Math.random(), red, green, blue, 10);
|
||||
world.addParticle(data, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 1, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0, 0);
|
||||
}
|
||||
world.playSound(pos.getX(), pos.getY(), pos.getZ(), ModSounds.runeAltarCraft, SoundCategory.BLOCKS, 1, 1, false);
|
||||
}
|
||||
return true;
|
||||
@@ -169,7 +171,7 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver,
|
||||
}
|
||||
|
||||
if (cooldown > 0) {
|
||||
ParticleData data = ParticleData.wisp(0.2F, 0.2F, 0.2F, 0.2F, 1);
|
||||
WispParticleData data = WispParticleData.wisp(0.2F, 0.2F, 0.2F, 0.2F, 1);
|
||||
world.addParticle(data, pos.getX() + Math.random(), pos.getY() + 0.8, pos.getZ() + Math.random(), 0, - -0.025F, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.mana.IManaReceiver;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@@ -60,7 +60,7 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver, ITickable
|
||||
if (world.isRemote) {
|
||||
// Botania - use own particles
|
||||
if(Math.random() > 0.5) {
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() / 3F, 0.6F - (float) Math.random() * 0.3F, 0.1F, 0.6F - (float) Math.random() * 0.3F, 2F);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() / 3F, 0.6F - (float) Math.random() * 0.3F, 0.1F, 0.6F - (float) Math.random() * 0.3F, 2F);
|
||||
world.addParticle(data, getPos().getX() + 0.3 + Math.random() * 0.5, getPos().getY() - 0.3 + Math.random() * 0.25, getPos().getZ() + Math.random(), 0, -(-0.025F - 0.005F * (float) Math.random()), 0);
|
||||
}
|
||||
if (logic.spawnDelay > 0) {
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
|
||||
public class TileSpiritShrine extends TileMod implements ITickableTileEntity {
|
||||
|
||||
@@ -55,10 +54,10 @@ public class TileSpiritShrine extends TileMod implements ITickableTileEntity {
|
||||
|
||||
wticks += tickIncrement;
|
||||
float[] colorsfx = colors[i >= colors.length ? 0 : i];
|
||||
ParticleData data = ParticleData.wisp(0.85F, colorsfx[0], colorsfx[1], colorsfx[2], 0.25F);
|
||||
WispParticleData data = WispParticleData.wisp(0.85F, colorsfx[0], colorsfx[1], colorsfx[2], 0.25F);
|
||||
world.addParticle(data, x, y, z, 0, (float) (-g * 0.05), 0);
|
||||
|
||||
data = ParticleData.wisp((float) Math.random() * 0.1F + 0.1F, colorsfx[0], colorsfx[1], colorsfx[2], 0.9F);
|
||||
data = WispParticleData.wisp((float) Math.random() * 0.1F + 0.1F, colorsfx[0], colorsfx[1], colorsfx[2], 0.9F);
|
||||
world.addParticle(data, x, y, z, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ package vazkii.botania.common.block.tile;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -46,8 +46,9 @@ public class TileStarfield extends TileMod implements ITickableTileEntity {
|
||||
float s = 20F + (float) Math.random() * 20F;
|
||||
int m = 50;
|
||||
|
||||
Botania.proxy.sparkleFX(x, y, z, r, g, b, s, m);
|
||||
}
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(s, r, g, b, m);
|
||||
world.addParticle(data, x, y, z, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.block.tile.TileMod;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -39,8 +39,10 @@ public class TileManaDetector extends TileMod implements ITickableTileEntity {
|
||||
world.setBlockState(getPos(), world.getBlockState(getPos()).with(BotaniaStateProps.POWERED, expectedState));
|
||||
|
||||
if(expectedState)
|
||||
for(int i = 0; i < 4; i++)
|
||||
Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 1F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5);
|
||||
for(int i = 0; i < 4; i++) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(0.7F + 0.5F * (float) Math.random(), 1F, 0.2F, 0.2F, 5);
|
||||
world.addParticle(data, pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@ package vazkii.botania.common.block.tile.mana;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.mana.IClientManaHandler;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.block.tile.TileMod;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -39,8 +39,10 @@ public class TileManaVoid extends TileMod implements IClientManaHandler {
|
||||
@Override
|
||||
public void recieveMana(int mana) {
|
||||
if(mana > 0)
|
||||
for(int i = 0; i < 10; i++)
|
||||
Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 0.2F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5);
|
||||
for(int i = 0; i < 10; i++) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(0.7F + 0.5F * (float) Math.random(), 0.2F, 0.2F, 0.2F, 5);
|
||||
world.addParticle(data, pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,21 +13,15 @@ package vazkii.botania.common.block.tile.mana;
|
||||
import com.google.common.base.Predicates;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.play.server.SUpdateTileEntityPacket;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
@@ -35,8 +29,6 @@ import net.minecraft.util.Direction;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
@@ -52,11 +44,10 @@ import vazkii.botania.api.mana.ManaNetworkEvent;
|
||||
import vazkii.botania.api.mana.spark.ISparkAttachable;
|
||||
import vazkii.botania.api.mana.spark.ISparkEntity;
|
||||
import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.mana.BlockPool;
|
||||
@@ -227,9 +218,9 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
Botania.proxy.sparkleFX(pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 0.75, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2,
|
||||
red, green, blue, (float) Math.random(), 10);
|
||||
}
|
||||
SparkleParticleData data = SparkleParticleData.sparkle((float) Math.random(), red, green, blue, 10);
|
||||
world.addParticle(data, pos.getX() + 0.5 + Math.random() * 0.4 - 0.2, pos.getY() + 0.75, pos.getZ() + 0.5 + Math.random() * 0.4 - 0.2, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -261,7 +252,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
|
||||
if(world.isRemote) {
|
||||
double particleChance = 1F - (double) getCurrentMana() / (double) manaCap * 0.1;
|
||||
if(Math.random() > particleChance) {
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() / 3F, PARTICLE_COLOR.getRed() / 255F, PARTICLE_COLOR.getGreen() / 255F, PARTICLE_COLOR.getBlue() / 255F, 2F);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() / 3F, PARTICLE_COLOR.getRed() / 255F, PARTICLE_COLOR.getGreen() / 255F, PARTICLE_COLOR.getBlue() / 255F, 2F);
|
||||
world.addParticle(data, pos.getX() + 0.3 + Math.random() * 0.5, pos.getY() + 0.6 + Math.random() * 0.25, pos.getZ() + Math.random(), 0, (float) Math.random() / 25F, 0);
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -38,6 +38,7 @@ import vazkii.botania.api.subtile.TileEntityGeneratingFlower;
|
||||
import vazkii.botania.api.subtile.TileEntitySpecialFlower;
|
||||
import vazkii.botania.client.core.handler.BossBarHandler;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.BlockModFlower;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -149,8 +150,9 @@ public class InternalMethodHandler extends DummyMethodHandler {
|
||||
|
||||
@Override
|
||||
public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m) {
|
||||
Botania.proxy.sparkleFX(x, y, z, r, g, b, size, m);
|
||||
}
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(size, r, g, b, m);
|
||||
world.addParticle(data, x, y, z, 0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getDefaultBossBarTexture() {
|
||||
|
||||
@@ -5,11 +5,10 @@ import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.boss.IBotaniaBoss;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
|
||||
public interface IProxy {
|
||||
@@ -37,16 +36,6 @@ public interface IProxy {
|
||||
|
||||
long getWorldElapsedTicks();
|
||||
|
||||
void setSparkleFXNoClip(boolean noclip);
|
||||
|
||||
void setSparkleFXCorrupt(boolean corrupt);
|
||||
|
||||
default void sparkleFX(double x, double y, double z, float r, float g, float b, float size, int m) {
|
||||
sparkleFX(x, y, z, r, g, b, size, m, false);
|
||||
}
|
||||
|
||||
void sparkleFX(double x, double y, double z, float r, float g, float b, float size, int m, boolean fake);
|
||||
|
||||
default void lightningFX(Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, int colorOuter, int colorInner) {
|
||||
lightningFX(vectorStart, vectorEnd, ticksPerMeter, System.nanoTime(), colorOuter, colorInner);
|
||||
}
|
||||
|
||||
@@ -70,15 +70,6 @@ public class ServerProxy implements IProxy {
|
||||
return ServerLifecycleHooks.getCurrentServer().getWorld(DimensionType.OVERWORLD).getGameTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSparkleFXNoClip(boolean noclip) {}
|
||||
|
||||
@Override
|
||||
public void setSparkleFXCorrupt(boolean corrupt) {}
|
||||
|
||||
@Override
|
||||
public void sparkleFX(double x, double y, double z, float r, float g, float b, float size, int m, boolean fake) {}
|
||||
|
||||
@Override
|
||||
public void lightningFX(Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, long seed, int colorOuter, int colorInner) {}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.core.helper.PlayerHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
@@ -160,7 +160,7 @@ public class EntityBabylonWeapon extends EntityThrowableCopy {
|
||||
setMotion(mot);
|
||||
|
||||
if(liveTime > delay) {
|
||||
ParticleData data = ParticleData.wisp(0.3F, 1F, 1F, 0F, 1);
|
||||
WispParticleData data = WispParticleData.wisp(0.3F, 1F, 1F, 0F, 1);
|
||||
world.addParticle(data, posX, posY, posZ, 0, -0F, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ import vazkii.botania.api.lexicon.multiblock.MultiblockSet;
|
||||
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
|
||||
import vazkii.botania.client.core.handler.BossBarHandler;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.advancements.DopplegangerNoArmorTrigger;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -299,7 +299,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti
|
||||
}
|
||||
|
||||
private static void warnInvalidBlocks(World world, Iterable<BlockPos> invalidPositions) {
|
||||
ParticleData data = ParticleData.wisp(0.5F, 1, 0.2F, 0.2F, 8, false);
|
||||
WispParticleData data = WispParticleData.wisp(0.5F, 1, 0.2F, 0.2F, 8, false);
|
||||
for(BlockPos pos_ : invalidPositions) {
|
||||
world.addParticle(data, pos_.getX() + 0.5, pos_.getY() + 0.5, pos_.getZ() + 0.5, 0, 0, 0);
|
||||
}
|
||||
@@ -532,7 +532,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti
|
||||
double y = source.getY() + 0.5;
|
||||
double z = source.getZ() + 0.5 - Math.sin(rad) * ARENA_RANGE;
|
||||
|
||||
ParticleData data = ParticleData.wisp(0.5F, r, g, b);
|
||||
WispParticleData data = WispParticleData.wisp(0.5F, r, g, b);
|
||||
world.addParticle(data, x, y, z, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * mv, (float) (Math.random() - 0.5F) * m);
|
||||
}
|
||||
|
||||
@@ -554,9 +554,9 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti
|
||||
float g = (float) Math.random() * 0.3F;
|
||||
float b = 0.7F + (float) Math.random() * 0.3F;
|
||||
|
||||
ParticleData data = ParticleData.wisp(0.25F + (float) Math.random() * 0.1F, r, g, b, 1);
|
||||
WispParticleData data = WispParticleData.wisp(0.25F + (float) Math.random() * 0.1F, r, g, b, 1);
|
||||
world.addParticle(data, partPos.x, partPos.y, partPos.z, 0, -(-0.075F - (float) Math.random() * 0.015F), 0);
|
||||
ParticleData data1 = ParticleData.wisp(0.4F, r, g, b);
|
||||
WispParticleData data1 = WispParticleData.wisp(0.4F, r, g, b);
|
||||
world.addParticle(data1, partPos.x, partPos.y, partPos.z, (float) mot.x, (float) mot.y, (float) mot.z);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraft.util.math.EntityRayTraceResult;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
|
||||
import java.util.List;
|
||||
@@ -51,11 +51,12 @@ public class EntityFallingStar extends EntityThrowableCopy {
|
||||
super.tick();
|
||||
|
||||
float dist = 1.5F;
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(2F, 1F, 0.4F, 1F, 6);
|
||||
for(int i = 0; i < 10; i++) {
|
||||
float xs = (float) (Math.random() - 0.5) * dist;
|
||||
float ys = (float) (Math.random() - 0.5) * dist;
|
||||
float zs = (float) (Math.random() - 0.5) * dist;
|
||||
Botania.proxy.sparkleFX(posX + xs, posY + ys, posZ + zs, 1F, 0.4F, 1F, 2F, 6);
|
||||
world.addParticle(data, posX + xs, posY + ys, posZ + zs, 0, 0, 0);
|
||||
}
|
||||
|
||||
LivingEntity thrower = getThrower();
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.network.NetworkHooks;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -63,14 +63,14 @@ public class EntityFlameRing extends Entity {
|
||||
double x = Math.cos(rad) * renderRadius;
|
||||
double z = Math.sin(rad) * renderRadius;
|
||||
|
||||
ParticleData data1 = ParticleData.wisp(0.65F + (float) Math.random() * 0.45F, 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F);
|
||||
WispParticleData data1 = WispParticleData.wisp(0.65F + (float) Math.random() * 0.45F, 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F);
|
||||
world.addParticle(data1, posX + x, posY - 0.2, posZ + z, (float) (Math.random() - 0.5F) * 0.15F, 0.055F + (float) Math.random() * 0.025F, (float) (Math.random() - 0.5F) * 0.15F);
|
||||
|
||||
float gs = (float) Math.random() * 0.15F;
|
||||
float smokeRadius = (float) (renderRadius - Math.random() * renderRadius * 0.9);
|
||||
x = Math.cos(rad) * smokeRadius;
|
||||
z = Math.sin(rad) * smokeRadius;
|
||||
ParticleData data = ParticleData.wisp(0.65F + (float) Math.random() * 0.45F, gs, gs, gs, 1);
|
||||
WispParticleData data = WispParticleData.wisp(0.65F + (float) Math.random() * 0.45F, gs, gs, gs, 1);
|
||||
world.addParticle(data, posX + x, posY - 0.2, posZ + z, 0, -(-0.155F - (float) Math.random() * 0.025F), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.network.NetworkHooks;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -60,7 +60,7 @@ public class EntityMagicLandmine extends Entity {
|
||||
|
||||
//Botania.proxy.wispFX(world, posX, posY, posZ, r, g, b, 0.6F, -0.2F, 1);
|
||||
for(int i = 0; i < 6; i++) {
|
||||
ParticleData data = ParticleData.wisp(0.4F, r, g, b, (float) 1);
|
||||
WispParticleData data = WispParticleData.wisp(0.4F, r, g, b, (float) 1);
|
||||
world.addParticle(data, posX - range + Math.random() * range * 2, posY, posZ - range + Math.random() * range * 2, 0, - -0.015F, 0);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class EntityMagicLandmine extends Entity {
|
||||
float m = 0.35F;
|
||||
g = 0.4F;
|
||||
for(int i = 0; i < 25; i++) {
|
||||
ParticleData data = ParticleData.wisp(0.5F, r, g, b);
|
||||
WispParticleData data = WispParticleData.wisp(0.5F, r, g, b);
|
||||
world.addParticle(data, posX, posY + 1, posZ, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * m);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import net.minecraft.util.math.EntityRayTraceResult;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -110,15 +111,16 @@ public class EntityMagicMissile extends ThrowableEntity {
|
||||
int steps = (int) (diff.mag() / step.mag());
|
||||
Vector3 particlePos = oldPos;
|
||||
|
||||
Botania.proxy.setSparkleFXCorrupt(evil);
|
||||
SparkleParticleData data = evil ? SparkleParticleData.corrupt(0.8F, 1F, 0.0F, 1F, 2)
|
||||
: SparkleParticleData.sparkle(0.8F, 1F, 0.4F, 1F, 2);
|
||||
for(int i = 0; i < steps; i++) {
|
||||
Botania.proxy.sparkleFX(particlePos.x, particlePos.y, particlePos.z, 1F, evil ? 0F : 0.4F, 1F, 0.8F, 2);
|
||||
world.addParticle(data, particlePos.x, particlePos.y, particlePos.z, 0, 0, 0);
|
||||
|
||||
if(world.rand.nextInt(steps) <= 1)
|
||||
Botania.proxy.sparkleFX(particlePos.x + (Math.random() - 0.5) * 0.4, particlePos.y + (Math.random() - 0.5) * 0.4, particlePos.z + (Math.random() - 0.5) * 0.4, 1F, evil ? 0F : 0.4F, 1F, 0.8F, 2);
|
||||
world.addParticle(data, particlePos.x + (Math.random() - 0.5) * 0.4, particlePos.y + (Math.random() - 0.5) * 0.4, particlePos.z + (Math.random() - 0.5) * 0.4, 0, 0, 0);
|
||||
|
||||
particlePos = particlePos.add(step);
|
||||
}
|
||||
Botania.proxy.setSparkleFXCorrupt(false);
|
||||
|
||||
LivingEntity target = getTargetEntity();
|
||||
if(target != null) {
|
||||
|
||||
@@ -64,7 +64,8 @@ import vazkii.botania.api.mana.IManaSpreader;
|
||||
import vazkii.botania.api.mana.IManaTrigger;
|
||||
import vazkii.botania.api.mana.IPingable;
|
||||
import vazkii.botania.api.mana.IThrottledPacket;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
@@ -442,13 +443,16 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst {
|
||||
else if(fullManaLastTick)
|
||||
size = 4F;
|
||||
|
||||
if(!noParticles && shouldDoFakeParticles())
|
||||
Botania.proxy.sparkleFX(posX, posY, posZ, r, g, b, 0.4F * size, 1, true);
|
||||
if(!noParticles && shouldDoFakeParticles()) {
|
||||
SparkleParticleData data = SparkleParticleData.fake(0.4F * size, r, g, b, 1);
|
||||
// todo 1.14 usage of client-only method
|
||||
world.addParticle(data, true, posX, posY, posZ, 0, 0, 0);
|
||||
}
|
||||
} else {
|
||||
boolean depth = !Botania.proxy.isClientPlayerWearingMonocle();
|
||||
|
||||
if(ConfigHandler.CLIENT.subtlePowerSystem.get()) {
|
||||
ParticleData data = ParticleData.wisp(0.1F * size, r, g, b, depth);
|
||||
WispParticleData data = WispParticleData.wisp(0.1F * size, r, g, b, depth);
|
||||
world.addParticle(data, posX, posY, posZ, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.01F);
|
||||
} else {
|
||||
float or = r;
|
||||
@@ -475,7 +479,7 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst {
|
||||
b = ob + (float) Math.random() * 0.125F;
|
||||
}
|
||||
size = osize + ((float) Math.random() - 0.5F) * 0.065F + (float) Math.sin(new Random(entityUniqueID.getMostSignificantBits()).nextInt(9001)) * 0.4F;
|
||||
ParticleData data = ParticleData.wisp(0.2F * size, r, g, b, depth);
|
||||
WispParticleData data = WispParticleData.wisp(0.2F * size, r, g, b, depth);
|
||||
world.addParticle(data, posX, posY, posZ,
|
||||
(float) -getMotion().getX() * 0.01F,
|
||||
(float) -getMotion().getY() * 0.01F,
|
||||
@@ -491,7 +495,7 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst {
|
||||
break;
|
||||
} while(Math.abs(diffVec.mag()) > distance);
|
||||
|
||||
ParticleData data = ParticleData.wisp(0.1F * size, or, og, ob, depth);
|
||||
WispParticleData data = WispParticleData.wisp(0.1F * size, or, og, ob, depth);
|
||||
world.addParticle(data, posX, posY, posZ, (float) (Math.random() - 0.5F) * 0.06F, (float) (Math.random() - 0.5F) * 0.06F, (float) (Math.random() - 0.5F) * 0.06F);
|
||||
|
||||
posX = savedPosX;
|
||||
@@ -565,10 +569,11 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst {
|
||||
|
||||
if(!ConfigHandler.CLIENT.subtlePowerSystem.get())
|
||||
for(int i = 0; i < 4; i++) {
|
||||
ParticleData data = ParticleData.wisp(0.15F * size, r, g, b);
|
||||
WispParticleData data = WispParticleData.wisp(0.15F * size, r, g, b);
|
||||
world.addParticle(data, posX, posY, posZ, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F);
|
||||
}
|
||||
Botania.proxy.sparkleFX((float) posX, (float) posY, (float) posZ, r, g, b, 4, 2);
|
||||
SparkleParticleData data = SparkleParticleData.sparkle((float) 4, r, g, b, 2);
|
||||
world.addParticle(data, (float) posX, (float) posY, (float) posZ, 0, 0, 0);
|
||||
}
|
||||
|
||||
remove();
|
||||
|
||||
@@ -13,19 +13,16 @@ package vazkii.botania.common.entity;
|
||||
import net.minecraft.entity.FlyingEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -129,15 +126,22 @@ public class EntityPixie extends FlyingEntity {
|
||||
|
||||
boolean dark = getPixieType() == 1;
|
||||
if(world.isRemote)
|
||||
for(int i = 0; i < 4; i++)
|
||||
Botania.proxy.sparkleFX(posX + (Math.random() - 0.5) * 0.25, posY + 0.5 + (Math.random() - 0.5) * 0.25, posZ + (Math.random() - 0.5) * 0.25, dark ? 0.1F : 1F, dark ? 0.025F : 0.25F, dark ? 0.09F : 0.9F, 0.1F + (float) Math.random() * 0.25F, 12);
|
||||
for(int i = 0; i < 4; i++) {
|
||||
float r = dark ? 0.1F : 1F;
|
||||
float g = dark ? 0.025F : 0.25F;
|
||||
float b = dark ? 0.09F : 0.9F;
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(0.1F + (float) Math.random() * 0.25F, r, g, b, 12);
|
||||
world.addParticle(data, posX + (Math.random() - 0.5) * 0.25, posY + 0.5 + (Math.random() - 0.5) * 0.25, posZ + (Math.random() - 0.5) * 0.25, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
if(world != null && world.isRemote && getPixieType() == 0)
|
||||
for(int i = 0; i < 12; i++)
|
||||
Botania.proxy.sparkleFX(posX + (Math.random() - 0.5) * 0.25, posY + 0.5 + (Math.random() - 0.5) * 0.25, posZ + (Math.random() - 0.5) * 0.25, 1F, 0.25F, 0.9F, 1F + (float) Math.random() * 0.25F, 5);
|
||||
for(int i = 0; i < 12; i++) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(1F + (float) Math.random() * 0.25F, 1F, 0.25F, 0.9F, 5);
|
||||
world.addParticle(data, posX + (Math.random() - 0.5) * 0.25, posY + 0.5 + (Math.random() - 0.5) * 0.25, posZ + (Math.random() - 0.5) * 0.25, 0, 0, 0);
|
||||
}
|
||||
super.remove();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.mana.IManaPool;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
import vazkii.botania.common.block.tile.mana.TilePump;
|
||||
@@ -119,7 +119,7 @@ public class EntityPoolMinecart extends AbstractMinecartEntity {
|
||||
double y = MathHelper.floor(posY);
|
||||
double z = MathHelper.floor(posZ);
|
||||
if(Math.random() > particleChance) {
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() / 3F, (float) color.getRed(), color.getGreen() / 255F, color.getBlue() / 255F, 2F);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() / 3F, (float) color.getRed(), color.getGreen() / 255F, color.getBlue() / 255F, 2F);
|
||||
world.addParticle(data, x + 0.3 + Math.random() * 0.5, y + 0.85 + Math.random() * 0.25, z + Math.random(), 0, (float) Math.random() / 25F, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,15 +16,13 @@ import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.datasync.DataParameter;
|
||||
import net.minecraft.network.datasync.DataSerializers;
|
||||
import net.minecraft.network.datasync.EntityDataManager;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.network.NetworkHooks;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@@ -71,12 +69,12 @@ public class EntitySignalFlare extends Entity {
|
||||
|
||||
// todo 1.14 use of client only addParticle version
|
||||
for(int i = 0; i < 3; i++) {
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() * 5 + 1F, r / 255F, g / 255F, b / 255F);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() * 5 + 1F, r / 255F, g / 255F, b / 255F);
|
||||
world.addParticle(data, true, posX, posY, posZ + 0.5, (float) (Math.random() - 0.5F), 10F * (float) Math.sqrt(256F / (256F - (float) posY)), (float) (Math.random() - 0.5F));
|
||||
}
|
||||
|
||||
for(int i = 0; i < 4; i++) {
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() * 15 + 8F, r / 255F, g / 255F, b / 255F);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() * 15 + 8F, r / 255F, g / 255F, b / 255F);
|
||||
world.addParticle(data, true, posX + 0.5, Math.min(256, getFiredAt() + Botania.proxy.getClientRenderDistance() * 16), posZ + 0.5, (float) (Math.random() - 0.5F) * 8F, 0F, (float) (Math.random() - 0.5F) * 8F);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ import net.minecraftforge.items.ItemStackHandler;
|
||||
import net.minecraftforge.items.wrapper.EmptyHandler;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.client.gui.crafting.ContainerCraftingHalo;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
@@ -195,8 +195,8 @@ public class ItemCraftingHalo extends ItemMod {
|
||||
Vector3 centerVector = Vector3.fromEntityCenter(player).add(lookVec3.x * 3, 1.3, lookVec3.z * 3);
|
||||
float m = 0.1F;
|
||||
for(int i = 0; i < 4; i++) {
|
||||
ParticleData data = ParticleData.wisp(0.2F + 0.2F * (float) Math.random(), 1F, 0F, 1F);
|
||||
world.addParticle(data, centerVector.x, centerVector.y, centerVector.z, ((float) Math.random() - 0.5F) * m, ((float) Math.random() - 0.5F) * m, ((float) Math.random() - 0.5F) * m);
|
||||
WispParticleData data = WispParticleData.wisp(0.2F + 0.2F * (float) Math.random(), 1F, 0F, 1F);
|
||||
player.world.addParticle(data, centerVector.x, centerVector.y, centerVector.z, ((float) Math.random() - 0.5F) * m, ((float) Math.random() - 0.5F) * m, ((float) Math.random() - 0.5F) * m);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -62,7 +62,7 @@ public class ItemFertilizer extends ItemMod {
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
ParticleData data = ParticleData.wisp(0.15F + (float) Math.random() * 0.25F, red, green, blue, 1);
|
||||
WispParticleData data = WispParticleData.wisp(0.15F + (float) Math.random() * 0.25F, red, green, blue, 1);
|
||||
world.addParticle(data, x, y, z, 0, (float) Math.random() * 0.1F - 0.05F, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import vazkii.botania.api.item.IFloatingFlower.IslandType;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@@ -98,7 +98,7 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant {
|
||||
float motionx = (float) -x * velMul;
|
||||
float motiony = (float) -y * velMul;
|
||||
float motionz = (float) -z * velMul;
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() * 0.15F + 0.15F, r, g, b);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() * 0.15F + 0.15F, r, g, b);
|
||||
world.addParticle(data, pos.getX() + 0.5 + x, pos.getY() + 0.5 + y, pos.getZ() + 0.5 + z, motionx, motiony, motionz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.api.lexicon.multiblock.Multiblock;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
@@ -78,14 +78,15 @@ public class ItemSextant extends ItemMod {
|
||||
|
||||
double radius = calculateRadius(stack, (PlayerEntity) living);
|
||||
|
||||
if(count % 10 == 0)
|
||||
for(int i = 0; i < 360; i++) {
|
||||
if(count % 10 == 0) {
|
||||
WispParticleData data = WispParticleData.wisp(0.3F, 0F, 1F, 1F, 1);
|
||||
for (int i = 0; i < 360; i++) {
|
||||
float radian = (float) (i * Math.PI / 180);
|
||||
double xp = x + Math.cos(radian) * radius;
|
||||
double zp = z + Math.sin(radian) * radius;
|
||||
ParticleData data = ParticleData.wisp(0.3F, 0F, 1F, 1F, 1);
|
||||
world.addParticle(data, xp + 0.5, source.y + 1, zp + 0.5, 0, - -0.01F, 0);
|
||||
}
|
||||
living.world.addParticle(data, xp + 0.5, source.y + 1, zp + 0.5, 0, - -0.01F, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,8 +132,8 @@ public class ItemSextant extends ItemMod {
|
||||
int y = ItemNBTHelper.getInt(stack, TAG_SOURCE_Y, -1);
|
||||
int z = ItemNBTHelper.getInt(stack, TAG_SOURCE_Z, 0);
|
||||
Vector3 source = new Vector3(x, y, z);
|
||||
ParticleData data = ParticleData.wisp(0.2F, 1F, 0F, 0F, 1);
|
||||
world.addParticle(data, source.x + 0.5, source.y + 1, source.z + 0.5, 0, - -0.1F, 0);
|
||||
WispParticleData data = WispParticleData.wisp(0.2F, 1F, 0F, 0F, 1);
|
||||
player.world.addParticle(data, source.x + 0.5, source.y + 1, source.z + 0.5, 0, - -0.1F, 0);
|
||||
|
||||
Vector3 centerVec = Vector3.fromEntityCenter(player);
|
||||
Vector3 diffVec = source.subtract(centerVec);
|
||||
|
||||
@@ -30,8 +30,8 @@ import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.advancements.UseItemSuccessTrigger;
|
||||
import vazkii.botania.common.core.helper.PlayerHelper;
|
||||
|
||||
@@ -123,8 +123,10 @@ public class ItemSpawnerMover extends ItemMod {
|
||||
ctx.getPlayer().sendBreakAnimation(ctx.getHand());
|
||||
mover.shrink(1);
|
||||
} else {
|
||||
for(int i = 0; i < 100; i++)
|
||||
Botania.proxy.sparkleFX(pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.45F + 0.2F * (float) Math.random(), 6);
|
||||
for(int i = 0; i < 100; i++) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(0.45F + 0.2F * (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 6);
|
||||
world.addParticle(data, pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +156,7 @@ public class ItemSpawnerMover extends ItemMod {
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() * 0.1F + 0.05F, red, green, blue);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() * 0.1F + 0.05F, red, green, blue);
|
||||
world.addParticle(data, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, (float) (Math.random() - 0.5F) * 0.15F, (float) (Math.random() - 0.5F) * 0.15F, (float) (Math.random() - 0.5F) * 0.15F);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,8 @@ import vazkii.botania.api.wand.ICoordBoundItem;
|
||||
import vazkii.botania.api.wand.ITileBound;
|
||||
import vazkii.botania.api.wand.IWandBindable;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.BlockPistonRelay;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -153,7 +154,7 @@ public class ItemTwigWand extends ItemMod implements ICoordBoundItem {
|
||||
float motionx = (float) -x * velMul;
|
||||
float motiony = (float) -y * velMul;
|
||||
float motionz = (float) -z * velMul;
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() * 0.15F + 0.15F, red, green, blue);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() * 0.15F + 0.15F, red, green, blue);
|
||||
world.addParticle(data, pos.getX() + 0.5 + x, pos.getY() + 0.5 + y, pos.getZ() + 0.5 + z, motionx, motiony, motionz);
|
||||
}
|
||||
}
|
||||
@@ -221,9 +222,8 @@ public class ItemTwigWand extends ItemMod implements ICoordBoundItem {
|
||||
float g = color.getGreen() / 255F;
|
||||
float b = color.getBlue() / 255F;
|
||||
|
||||
Botania.proxy.setSparkleFXNoClip(true);
|
||||
Botania.proxy.sparkleFX(currentPos.x, currentPos.y, currentPos.z, r, g, b, 0.5F, 4);
|
||||
Botania.proxy.setSparkleFXNoClip(false);
|
||||
SparkleParticleData data = SparkleParticleData.noClip(0.5F, r, g, b, 4);
|
||||
world.addParticle(data, currentPos.x, currentPos.y, currentPos.z, 0, 0, 0);
|
||||
currentPos = currentPos.add(movement);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,22 +10,17 @@
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -50,11 +45,10 @@ public class ItemWorldSeed extends ItemMod {
|
||||
player.setPositionAndUpdate(player.posX, player.posY + 1, player.posZ);
|
||||
|
||||
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 1F, 1F);
|
||||
for(int i = 0; i < 50; i++)
|
||||
Botania.proxy.sparkleFX(player.posX + Math.random() * player.getWidth(),
|
||||
player.posY - 1.6 + Math.random() * player.getHeight(),
|
||||
player.posZ + Math.random() * player.getWidth(),
|
||||
0.25F, 1F, 0.25F, 1F, 10);
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(1F, 0.25F, 1F, 0.25F, 10);
|
||||
for(int i = 0; i < 50; i++) {
|
||||
world.addParticle(data, player.posX + Math.random() * player.getWidth(), player.posY - 1.6 + Math.random() * player.getHeight(), player.posZ + Math.random() * player.getWidth(), 0, 0, 0);
|
||||
}
|
||||
|
||||
stack.shrink(1);
|
||||
return ActionResult.newResult(ActionResultType.SUCCESS, stack);
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
@@ -19,10 +18,9 @@ import net.minecraft.util.SoundCategory;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemBalanceCloak extends ItemHolyCloak {
|
||||
|
||||
@@ -49,8 +47,11 @@ public class ItemBalanceCloak extends ItemHolyCloak {
|
||||
double y = player.posY + Math.random() * player.getHeight();
|
||||
double z = player.posZ + Math.random() * player.getWidth() * 2 - player.getWidth();
|
||||
boolean green = Math.random() > 0.5;
|
||||
Botania.proxy.sparkleFX(x, y, z, 0.3F, green ? 1F : 0.3F, green ? 0.3F : 1F, 0.8F + (float) Math.random() * 0.4F, 3);
|
||||
}
|
||||
float g = green ? 1F : 0.3F;
|
||||
float b = green ? 0.3F : 1F;
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(0.8F + (float) Math.random() * 0.4F, 0.3F, g, b, 3);
|
||||
player.world.addParticle(data, x, y, z, 0, 0, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.AbstractGui;
|
||||
import net.minecraft.client.gui.AbstractGui;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.platform.GLX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -21,8 +20,6 @@ import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -33,7 +30,6 @@ import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -49,6 +45,7 @@ import vazkii.botania.client.core.handler.MiscellaneousIcons;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
@@ -181,10 +178,10 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem {
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
Botania.proxy.sparkleFX(x + Math.random() * event.getEntityLiving().getWidth(),
|
||||
y + Math.random() * 0.4, z + Math.random() * event.getEntityLiving().getWidth(),
|
||||
r, g, b, 2F * (float) Math.random(), 20);
|
||||
for(int i = 0; i < 2; i++) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(2F * (float) Math.random(), r, g, b, 20);
|
||||
player.world.addParticle(data, x + Math.random() * event.getEntityLiving().getWidth(), y + Math.random() * 0.4, z + Math.random() * event.getEntityLiving().getWidth(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -15,7 +15,6 @@ import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.platform.GLX;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -25,9 +24,9 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import vazkii.botania.api.item.AccessoryRenderHelper;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelCloak;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.handler.EquipmentHandler;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
@@ -109,8 +108,12 @@ public class ItemHolyCloak extends ItemBauble {
|
||||
double y = player.posY + Math.random() * player.getHeight();
|
||||
double z = player.posZ + Math.random() * player.getWidth() * 2 - player.getWidth();
|
||||
boolean yellow = Math.random() > 0.5;
|
||||
Botania.proxy.sparkleFX(x, y, z, yellow ? 1F : 0.3F, yellow ? 1F : 0.3F, yellow ? 0.3F : 1F, 0.8F + (float) Math.random() * 0.4F, 3);
|
||||
}
|
||||
float r = yellow ? 1F : 0.3F;
|
||||
float g = yellow ? 1F : 0.3F;
|
||||
float b = yellow ? 0.3F : 1F;
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(0.8F + (float) Math.random() * 0.4F, r, g, b, 3);
|
||||
player.world.addParticle(data, x, y, z, 0, 0, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,23 +18,17 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.merchant.villager.VillagerEntity;
|
||||
import net.minecraft.entity.merchant.villager.VillagerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.inventory.EquipmentSlotType;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.MerchantOffer;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.nbt.LongNBT;
|
||||
import net.minecraft.nbt.LongNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -48,13 +42,11 @@ import net.minecraftforge.items.wrapper.InvWrapper;
|
||||
import vazkii.botania.api.item.AccessoryRenderHelper;
|
||||
import vazkii.botania.client.core.handler.MiscellaneousIcons;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.handler.EquipmentHandler;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemItemFinder extends ItemBauble {
|
||||
@@ -108,7 +100,7 @@ public class ItemItemFinder extends ItemBauble {
|
||||
for(int i = 0; i < blocks.size(); i++) {
|
||||
BlockPos pos = BlockPos.fromLong(((LongNBT) blocks.get(i)).getLong());
|
||||
float m = 0.02F;
|
||||
ParticleData data = ParticleData.wisp(0.15F + 0.05F * (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), false);
|
||||
WispParticleData data = WispParticleData.wisp(0.15F + 0.05F * (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), false);
|
||||
player.world.addParticle(data, pos.getX() + (float) Math.random(), pos.getY() + (float) Math.random(), pos.getZ() + (float) Math.random() , m * (float) (Math.random() - 0.5), m * (float) (Math.random() - 0.5), m * (float) (Math.random() - 0.5));
|
||||
}
|
||||
|
||||
@@ -116,7 +108,7 @@ public class ItemItemFinder extends ItemBauble {
|
||||
for(int i : entities) {
|
||||
Entity e = player.world.getEntityByID(i);
|
||||
if(e != null && Math.random() < 0.6) {
|
||||
ParticleData data = ParticleData.wisp(0.15F + 0.05F * (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), Math.random() < 0.6);
|
||||
WispParticleData data = WispParticleData.wisp(0.15F + 0.05F * (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), Math.random() < 0.6);
|
||||
player.world.addParticle(data, e.posX + (float) (Math.random() * 0.5 - 0.25) * 0.45F, e.posY + e.getHeight(), e.posZ + (float) (Math.random() * 0.5 - 0.25) * 0.45F, 0, 0.05F + 0.03F * (float) Math.random(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,10 +12,7 @@ package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
@@ -28,7 +25,7 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.item.ItemTossEvent;
|
||||
import vazkii.botania.api.item.IRelic;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.block.subtile.functional.SubTileSolegnolia;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.handler.EquipmentHandler;
|
||||
@@ -98,8 +95,11 @@ public class ItemMagnetRing extends ItemBauble {
|
||||
MathHelper.setEntityMotionFromVector(item, new Vector3(x, y, z), 0.45F);
|
||||
if(living.world.isRemote) {
|
||||
boolean red = living.world.rand.nextBoolean();
|
||||
Botania.proxy.sparkleFX(item.posX, item.posY, item.posZ, red ? 1F : 0F, 0F, red ? 0F : 1F, 1F, 3);
|
||||
}
|
||||
float r = red ? 1F : 0F;
|
||||
float b = red ? 0F : 1F;
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(1F, r, 0F, b, 3);
|
||||
living.world.addParticle(data, item.posX, item.posY, item.posZ, 0, 0, 0);
|
||||
}
|
||||
pulled++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
|
||||
@@ -54,8 +54,8 @@ public class ItemUnholyCloak extends ItemHolyCloak {
|
||||
float rad = i * 4F * (float) Math.PI / 180F;
|
||||
float xMotion = (float) Math.cos(rad) * 0.2F;
|
||||
float zMotion = (float) Math.sin(rad) * 0.2F;
|
||||
ParticleData data = ParticleData.wisp(0.6F + (float) Math.random() * 0.2F, 0.4F + (float) Math.random() + 0.25F, 0F, 0F);
|
||||
world.addParticle(data, player.posX, player.posY + 0.5, player.posZ, xMotion, 0F, zMotion);
|
||||
WispParticleData data = WispParticleData.wisp(0.6F + (float) Math.random() * 0.2F, 0.4F + (float) Math.random() + 0.25F, 0F, 0F);
|
||||
player.world.addParticle(data, player.posX, player.posY + 0.5, player.posZ, xMotion, 0F, zMotion);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import vazkii.botania.api.mana.IManaSpreader;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
@@ -61,8 +61,8 @@ public class LensFlare extends Lens {
|
||||
float g = ((hex & 0xFF00) >> 8) / 255F;
|
||||
float b = (hex & 0xFF) / 255F;
|
||||
|
||||
ParticleData data = ParticleData.wisp(0.4F, r, g, b);
|
||||
world.addParticle(data, tile.getPos().getX() + 0.5, tile.getPos().getY() + 0.5, tile.getPos().getZ() + 0.5, mx, my, mz);
|
||||
WispParticleData data = WispParticleData.wisp(0.4F, r, g, b);
|
||||
tile.getWorld().addParticle(data, tile.getPos().getX() + 0.5, tile.getPos().getY() + 0.5, tile.getPos().getZ() + 0.5, mx, my, mz);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,7 +29,7 @@ import net.minecraft.world.dimension.DimensionType;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.api.wand.ICoordBoundItem;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -62,7 +62,7 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs
|
||||
float x1 = (float) (pos.getX() + Math.random());
|
||||
float y1 = pos.getY() + 1;
|
||||
float z1 = (float) (pos.getZ() + Math.random());
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() * 0.5F, (float) Math.random(), (float) Math.random(), (float) Math.random(), 1);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() * 0.5F, (float) Math.random(), (float) Math.random(), (float) Math.random(), 1);
|
||||
world.addParticle(data, x1, y1, z1, 0, -(-0.05F + (float) Math.random() * 0.05F), 0);
|
||||
}
|
||||
} else {
|
||||
@@ -85,8 +85,8 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs
|
||||
float x = (float) (living.posX - Math.random() * living.getWidth());
|
||||
float y = (float) (living.posY + Math.random());
|
||||
float z = (float) (living.posZ - Math.random() * living.getWidth());
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() * 0.7F, (float) Math.random(), (float) Math.random(), (float) Math.random(), 1);
|
||||
world.addParticle(data, (double) x, (double) y, (double) z, 0, -(-0.05F - (float) Math.random() * 0.05F), 0);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() * 0.7F, (float) Math.random(), (float) Math.random(), (float) Math.random(), 1);
|
||||
living.world.addParticle(data, x, y, z, 0, 0.05F + (float) Math.random() * 0.05F, 0);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -12,8 +12,6 @@ package vazkii.botania.common.item.rod;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.block.Blocks;
|
||||
@@ -21,24 +19,20 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.item.IAvatarTile;
|
||||
import vazkii.botania.api.item.IAvatarWieldable;
|
||||
import vazkii.botania.api.item.IBlockProvider;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.helper.PlayerHelper;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -75,10 +69,10 @@ public class ItemDirtRod extends ItemMod implements IManaUsingItem, IBlockProvid
|
||||
|
||||
if(stackToPlace.isEmpty()) {
|
||||
ManaItemHandler.requestManaExactForTool(stack, player, cost, true);
|
||||
for(int i = 0; i < 6; i++)
|
||||
Botania.proxy.sparkleFX(pos.getX() + side.getXOffset() + Math.random(),
|
||||
pos.getY() + side.getYOffset() + Math.random(),
|
||||
pos.getZ() + side.getZOffset() + Math.random(), r, g, b, 1F, 5);
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(1F, r, g, b, 5);
|
||||
for(int i = 0; i < 6; i++) {
|
||||
world.addParticle(data, pos.getX() + side.getXOffset() + Math.random(), pos.getY() + side.getYOffset() + Math.random(), pos.getZ() + side.getZOffset() + Math.random(), 0, 0, 0);
|
||||
}
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,14 +12,11 @@ package vazkii.botania.common.item.rod;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -30,12 +27,10 @@ import vazkii.botania.api.item.IAvatarWieldable;
|
||||
import vazkii.botania.api.item.IManaProficiencyArmor;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Random;
|
||||
@@ -74,7 +69,7 @@ public class ItemDiviningRod extends ItemMod implements IManaUsingItem, IAvatarW
|
||||
|
||||
if(Tags.Blocks.ORES.contains(state.getBlock())) {
|
||||
Random rand = new Random(state.hashCode() ^ seedxor);
|
||||
ParticleData data = ParticleData.wisp(0.25F, rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), 8);
|
||||
WispParticleData data = WispParticleData.wisp(0.25F, rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), 8);
|
||||
world.addParticle(data, pos_.getX() + world.rand.nextFloat(),
|
||||
pos_.getY() + world.rand.nextFloat(),
|
||||
pos_.getZ() + world.rand.nextFloat(),
|
||||
|
||||
@@ -29,7 +29,7 @@ import net.minecraft.world.World;
|
||||
import vazkii.botania.api.item.IManaProficiencyArmor;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
@@ -163,7 +163,7 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem {
|
||||
float xm = ((float) Math.random() - 0.5F) * m;
|
||||
float ym = ((float) Math.random() - 0.5F) * m;
|
||||
float zm = ((float) Math.random() - 0.5F) * m;
|
||||
ParticleData data = ParticleData.wisp(s, r, 0F, b);
|
||||
WispParticleData data = WispParticleData.wisp(s, r, 0F, b);
|
||||
world.addParticle(data, target.posX + target.getWidth() / 2, target.posY + target.getHeight() / 2, target.posZ + target.getWidth() / 2, xm, ym, zm);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,10 +12,8 @@ package vazkii.botania.common.item.rod;
|
||||
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.UseAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.UseAction;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
@@ -27,12 +25,11 @@ import vazkii.botania.api.item.IAvatarWieldable;
|
||||
import vazkii.botania.api.item.IManaProficiencyArmor;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.entity.EntityMagicMissile;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -67,8 +64,9 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
if(spawnMissile(player.world, player, player.posX + (Math.random() - 0.5 * 0.1), player.posY + 2.4 + (Math.random() - 0.5 * 0.1), player.posZ + (Math.random() - 0.5 * 0.1)))
|
||||
ManaItemHandler.requestManaExactForTool(stack, player, COST_PER, true);
|
||||
|
||||
Botania.proxy.sparkleFX(player.posX, player.posY + 2.4, player.posZ, 1F, 0.4F, 1F, 6F, 6);
|
||||
}
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(6F, 1F, 0.4F, 1F, 6);
|
||||
player.world.addParticle(data, player.posX, player.posY + 2.4, player.posZ, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean spawnMissile(World world, LivingEntity thrower, double x, double y, double z) {
|
||||
@@ -109,8 +107,9 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
if(spawnMissile(world, null, te.getPos().getX() + 0.5 + (Math.random() - 0.5 * 0.1), te.getPos().getY() + 2.5 + (Math.random() - 0.5 * 0.1), te.getPos().getZ() + (Math.random() - 0.5 * 0.1))) {
|
||||
if(!world.isRemote)
|
||||
tile.recieveMana(-COST_AVATAR);
|
||||
Botania.proxy.sparkleFX(te.getPos().getX() + 0.5, te.getPos().getY() + 2.5, te.getPos().getZ() + 0.5, 1F, 0.4F, 1F, 6F, 6);
|
||||
}
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(6F, 1F, 0.4F, 1F, 6);
|
||||
world.addParticle(data, te.getPos().getX() + 0.5, te.getPos().getY() + 2.5, te.getPos().getZ() + 0.5, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,6 @@ import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -28,10 +26,9 @@ import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.core.helper.PlayerHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -63,8 +60,10 @@ public class ItemSkyDirtRod extends ItemDirtRod {
|
||||
|
||||
if(stackToPlace.isEmpty()) {
|
||||
ManaItemHandler.requestManaExactForTool(stack, player, COST * 2, true);
|
||||
for(int i = 0; i < 6; i++)
|
||||
Botania.proxy.sparkleFX(x + Math.random(), y + Math.random(), z + Math.random(), 0.35F, 0.2F, 0.05F, 1F, 5);
|
||||
for(int i = 0; i < 6; i++) {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(1F, 0.35F, 0.2F, 0.05F, 5);
|
||||
world.addParticle(data, x + Math.random(), y + Math.random(), z + Math.random(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.minecraft.world.World;
|
||||
import vazkii.botania.api.item.IManaProficiencyArmor;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.item.equipment.tool.ToolCommons;
|
||||
|
||||
@@ -119,7 +119,7 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem {
|
||||
double y = pos.getPos().getY() + Math.random();
|
||||
double z = pos.getPos().getZ() + Math.random();
|
||||
|
||||
ParticleData data1 = ParticleData.wisp(0.5F, 1F, 0.2F, 0.2F, 1);
|
||||
WispParticleData data1 = WispParticleData.wisp(0.5F, 1F, 0.2F, 0.2F, 1);
|
||||
p.world.addParticle(data1, x, y, z, 0, (float) -Math.random() / 10F, 0);
|
||||
}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem {
|
||||
double x = pos.getPos().getX() + Math.random();
|
||||
double y = pos.getPos().getY() + Math.random();
|
||||
double z = pos.getPos().getZ() + Math.random();
|
||||
ParticleData data = ParticleData.wisp(0.5F, 1F, 0.2F, 0.2F, 1);
|
||||
WispParticleData data = WispParticleData.wisp(0.5F, 1F, 0.2F, 0.2F, 1);
|
||||
p.world.addParticle(data, x, y, z, 0, (float) Math.random() / 10F, 0);
|
||||
}
|
||||
if(time % 10 == 0)
|
||||
|
||||
@@ -16,31 +16,19 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.DoublePlantBlock;
|
||||
import net.minecraft.block.FlowerBlock;
|
||||
import net.minecraft.block.DoublePlantBlock;
|
||||
import net.minecraft.block.FlowerBlock;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.UseAction;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.item.UseAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.item.IBlockProvider;
|
||||
@@ -48,10 +36,9 @@ import vazkii.botania.api.item.IManaProficiencyArmor;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.api.subtile.ISpecialFlower;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -155,8 +142,9 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP
|
||||
if(!blocks.isEmpty()) {
|
||||
for(int i = 0; i < 10; i++)
|
||||
world.playSound(player, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_SAND_STEP, SoundCategory.BLOCKS, 1F, 0.4F);
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(2F, 0.35F, 0.2F, 0.05F, 5);
|
||||
for(int i = 0; i < 120; i++)
|
||||
Botania.proxy.sparkleFX(startCenter.getX() - range + range * 2 * Math.random(), startCenter.getY() + 2 + (Math.random() - 0.5) * 2, startCenter.getZ() - range + range * 2 * Math.random(), 0.35F, 0.2F, 0.05F, 2F, 5);
|
||||
world.addParticle(data, startCenter.getX() - range + range * 2 * Math.random(), startCenter.getY() + 2 + (Math.random() - 0.5) * 2, startCenter.getZ() - range + range * 2 * Math.random(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import vazkii.botania.api.item.IAvatarWieldable;
|
||||
import vazkii.botania.api.item.IManaProficiencyArmor;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.brew.ModPotions;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
@@ -77,7 +77,7 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
|
||||
player.world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.airRod, SoundCategory.PLAYERS, 0.1F, 0.25F);
|
||||
for(int i = 0; i < 5; i++) {
|
||||
ParticleData data = ParticleData.wisp(0.35F + (float) Math.random() * 0.1F, 0.25F, 0.25F, 0.25F);
|
||||
WispParticleData data = WispParticleData.wisp(0.35F + (float) Math.random() * 0.1F, 0.25F, 0.25F, 0.25F);
|
||||
world.addParticle(data, player.posX, player.posY, player.posZ, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5));
|
||||
}
|
||||
}
|
||||
@@ -147,7 +147,7 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
|
||||
for(int i = 0; i < 20; i++)
|
||||
for(int j = 0; j < 5; j++) {
|
||||
ParticleData data = ParticleData.wisp(0.35F + (float) Math.random() * 0.1F, 0.25F, 0.25F, 0.25F);
|
||||
WispParticleData data = WispParticleData.wisp(0.35F + (float) Math.random() * 0.1F, 0.25F, 0.25F, 0.25F);
|
||||
world.addParticle(data, p.posX, p.posY + i, p.posZ, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5));
|
||||
}
|
||||
|
||||
|
||||
@@ -2,21 +2,16 @@ package vazkii.botania.common.item.rod;
|
||||
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.IBucketPickupHandler;
|
||||
import net.minecraft.block.ILiquidContainer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.tags.FluidTags;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.item.BucketItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Stats;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.RayTraceContext;
|
||||
@@ -24,7 +19,7 @@ import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -62,8 +57,9 @@ public class ItemWaterRod extends ItemMod implements IManaUsingItem {
|
||||
}
|
||||
|
||||
playerIn.addStat(Stats.ITEM_USED.get(this));
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(1F, 0.2F, 0.2F, 1F, 5);
|
||||
for(int i = 0; i < 6; i++)
|
||||
Botania.proxy.sparkleFX(blockpos1.getX() + Math.random(), blockpos1.getY() + Math.random(), blockpos1.getZ() + Math.random(), 0.2F, 0.2F, 1F, 1F, 5);
|
||||
playerIn.world.addParticle(data, blockpos1.getX() + Math.random(), blockpos1.getY() + Math.random(), blockpos1.getZ() + Math.random(), 0, 0, 0);
|
||||
return new ActionResult<>(ActionResultType.SUCCESS, itemstack);
|
||||
} else {
|
||||
return new ActionResult<>(ActionResultType.FAIL, itemstack);
|
||||
|
||||
@@ -10,8 +10,8 @@ import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.network.NetworkEvent;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.SparkleParticleData;
|
||||
import vazkii.botania.client.fx.WispParticleData;
|
||||
import vazkii.botania.common.block.tile.TileTerraPlate;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
@@ -79,23 +79,19 @@ public class PacketBotaniaEffect {
|
||||
int b = hex & 0xFF;
|
||||
for(int i = 0; i < 10; i++) {
|
||||
BlockPos pos = new BlockPos(message.x, message.y, message.z).offset(Direction.random(world.rand));
|
||||
Botania.proxy.sparkleFX(
|
||||
pos.getX() + (float) Math.random(), pos.getY() + (float) Math.random(), pos.getZ() + (float) Math.random(),
|
||||
r / 255F, g / 255F, b / 255F, 0.6F + (float) Math.random() * 0.5F, 5);
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(0.6F + (float) Math.random() * 0.5F, r / 255F, g / 255F, b / 255F, 5);
|
||||
world.addParticle(data, pos.getX() + (float) Math.random(), pos.getY() + (float) Math.random(), pos.getZ() + (float) Math.random(), 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ARENA_INDICATOR: {
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(5F, 1, 0, 1, 120);
|
||||
for(int i = 0; i < 360; i += 8) {
|
||||
float r = 1F;
|
||||
float g = 0F;
|
||||
float b = 1F;
|
||||
float rad = i * (float) Math.PI / 180F;
|
||||
double x = message.x + 0.5 - Math.cos(rad) * EntityDoppleganger.ARENA_RANGE;
|
||||
double y = message.y + 0.5;
|
||||
double z = message.z + 0.5 - Math.sin(rad) * EntityDoppleganger.ARENA_RANGE;
|
||||
|
||||
Botania.proxy.sparkleFX(x, y, z, r, g, b, 5F, 120);
|
||||
world.addParticle(data, x, y, z, 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -140,9 +136,8 @@ public class PacketBotaniaEffect {
|
||||
float g = Math.min(1F, color.getGreen() / 255F + 0.4F);
|
||||
float b = Math.min(1F, color.getBlue() / 255F + 0.4F);
|
||||
|
||||
Botania.proxy.setSparkleFXNoClip(true);
|
||||
Botania.proxy.sparkleFX(currentPos.x, currentPos.y, currentPos.z, r, g, b, 1F, 12);
|
||||
Botania.proxy.setSparkleFXNoClip(false);
|
||||
SparkleParticleData data = SparkleParticleData.noClip(1, r, g, b, 12);
|
||||
world.addParticle(data, currentPos.x, currentPos.y, currentPos.z, 0, 0, 0);
|
||||
currentPos = currentPos.add(movement);
|
||||
}
|
||||
|
||||
@@ -165,7 +160,7 @@ public class PacketBotaniaEffect {
|
||||
float b = 0.4F + 0.3F * (float) Math.random();
|
||||
float size = 0.125F + 0.125F * (float) Math.random();
|
||||
|
||||
ParticleData data = ParticleData.wisp(size, r, g, b);
|
||||
WispParticleData data = WispParticleData.wisp(size, r, g, b);
|
||||
world.addParticle(data, thisVec.x, thisVec.y, thisVec.z, (float) motion.x, (float) motion.y, (float) motion.z);
|
||||
break;
|
||||
}
|
||||
@@ -174,7 +169,7 @@ public class PacketBotaniaEffect {
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() * 0.15F + 0.15F, red, green, blue);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random() * 0.15F + 0.15F, red, green, blue);
|
||||
world.addParticle(data, message.x, message.y, message.z, (float) (Math.random() - 0.5F) * 0.25F, (float) (Math.random() - 0.5F) * 0.25F, (float) (Math.random() - 0.5F) * 0.25F);
|
||||
}
|
||||
break;
|
||||
@@ -191,7 +186,7 @@ public class PacketBotaniaEffect {
|
||||
float my = (float) Math.random() * m;
|
||||
float mz = ((float) Math.random() - 0.5F) * m;
|
||||
|
||||
ParticleData data = ParticleData.wisp(s, r, g, b);
|
||||
WispParticleData data = WispParticleData.wisp(s, r, g, b);
|
||||
world.addParticle(data, message.x, message.y, message.z, mx, my, mz);
|
||||
}
|
||||
|
||||
@@ -220,14 +215,14 @@ public class PacketBotaniaEffect {
|
||||
float[] colorsfx = new float[] {
|
||||
0F, (float) ticks / (float) 100, 1F - (float) ticks / (float) 100
|
||||
};
|
||||
ParticleData data = ParticleData.wisp(0.85F, colorsfx[0], colorsfx[1], colorsfx[2], 0.25F);
|
||||
WispParticleData data = WispParticleData.wisp(0.85F, colorsfx[0], colorsfx[1], colorsfx[2], 0.25F);
|
||||
world.addParticle(data, x, y, z, 0, (float) (-g*0.05), 0);
|
||||
data = ParticleData.wisp((float) Math.random() * 0.1F + 0.1F, colorsfx[0], colorsfx[1], colorsfx[2], 0.9F);
|
||||
data = WispParticleData.wisp((float) Math.random() * 0.1F + 0.1F, colorsfx[0], colorsfx[1], colorsfx[2], 0.9F);
|
||||
world.addParticle(data, x, y, z, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F);
|
||||
|
||||
if(ticks == 100)
|
||||
for(int j = 0; j < 15; j++) {
|
||||
data = ParticleData.wisp((float) Math.random() * 0.15F + 0.15F, colorsfx[0], colorsfx[1], colorsfx[2]);
|
||||
data = WispParticleData.wisp((float) Math.random() * 0.15F + 0.15F, colorsfx[0], colorsfx[1], colorsfx[2]);
|
||||
world.addParticle(data, message.x + 0.5, message.y + 0.5, message.z + 0.5, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F);
|
||||
}
|
||||
}
|
||||
@@ -241,7 +236,7 @@ public class PacketBotaniaEffect {
|
||||
float x = (float) (entity.posX + Math.random());
|
||||
float y = (float) (entity.posY + Math.random());
|
||||
float z = (float) (entity.posZ + Math.random());
|
||||
ParticleData data = ParticleData.wisp((float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 1);
|
||||
WispParticleData data = WispParticleData.wisp((float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 1);
|
||||
world.addParticle(data, x, y, z, 0, -(-0.3F + (float) Math.random() * 0.2F), 0);
|
||||
}
|
||||
}
|
||||
@@ -262,8 +257,9 @@ public class PacketBotaniaEffect {
|
||||
double y = target.posY;
|
||||
double z = target.posZ;
|
||||
|
||||
SparkleParticleData data = SparkleParticleData.sparkle(1F, 1F, 1F, 0.25F, 3);
|
||||
for(int i = 0; i < 50; i++)
|
||||
Botania.proxy.sparkleFX(x + Math.random() * target.getWidth(), y + Math.random() * target.getHeight(), z + Math.random() * target.getWidth(), 1F, 1F, 0.25F, 1F, 3);
|
||||
world.addParticle(data, x + Math.random() * target.getWidth(), y + Math.random() * target.getHeight(), z + Math.random() * target.getWidth(), 0, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user