mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 03:15:07 +00:00
Prep for moving to vanilla particle system
This commit is contained in:
1 parent
4cd4b220d3
commit
f0993c20a4
60 files changed
+452
-353
No files matched your search
@@ -25,7 +25,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.settings.KeyConflictContext;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -58,7 +57,6 @@ import vazkii.botania.client.core.handler.PersistentVariableHelper;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.fx.FXLightning;
|
||||
import vazkii.botania.client.fx.FXSparkle;
|
||||
import vazkii.botania.client.fx.FXWisp;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexicon;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexiconEntry;
|
||||
import vazkii.botania.client.gui.lexicon.GuiLexiconIndex;
|
||||
@@ -292,26 +290,6 @@ public class ClientProxy implements IProxy {
|
||||
private static boolean distanceLimit = true;
|
||||
private static boolean depthTest = true;
|
||||
|
||||
@Override
|
||||
public void setWispFXDistanceLimit(boolean limit) {
|
||||
distanceLimit = limit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWispFXDepthTest(boolean test) {
|
||||
depthTest = test;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wispFX(double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz, float maxAgeMul) {
|
||||
if(!doParticle())
|
||||
return;
|
||||
|
||||
FXWisp wisp = new FXWisp(Minecraft.getInstance().world, x, y, z, size, r, g, b, distanceLimit, depthTest, maxAgeMul);
|
||||
wisp.setSpeed(motionx, motiony, motionz);
|
||||
Minecraft.getInstance().particles.addEffect(wisp);
|
||||
}
|
||||
|
||||
private boolean doParticle() {
|
||||
if(Thread.currentThread().getThreadGroup() == SidedThreadGroups.SERVER)
|
||||
return false;
|
||||
|
||||
@@ -54,11 +54,9 @@ public class FXSparkle extends Particle {
|
||||
|
||||
public FXSparkle(World world, double x, double y, double z, float size, float red, float green, float blue, int m) {
|
||||
super(world, x, y, z, 0.0D, 0.0D, 0.0D);
|
||||
|
||||
particleRed = red;
|
||||
particleGreen = green;
|
||||
particleBlue = blue;
|
||||
particleAlpha = 0.5F; // So MC renders us on the alpha layer, value not actually used
|
||||
particleGravity = 0;
|
||||
motionX = motionY = motionZ = 0;
|
||||
particleScale *= size;
|
||||
|
||||
@@ -47,14 +47,17 @@ public class FXWisp extends Particle {
|
||||
private float f4;
|
||||
private float f5;
|
||||
|
||||
public FXWisp(World world, double d, double d1, double d2, float size, float red, float green, float blue, boolean distanceLimit, boolean depthTest, float maxAgeMul) {
|
||||
super(world, d, d1, d2, 0.0D, 0.0D, 0.0D);
|
||||
public FXWisp(World world, double d, double d1, double d2, double xSpeed, double ySpeed, double zSpeed,
|
||||
float size, float red, float green, float blue, boolean depthTest, float maxAgeMul) {
|
||||
super(world, d, d1, d2, 0, 0, 0);
|
||||
// super applies wiggle to motion so set it here instead
|
||||
motionX = xSpeed;
|
||||
motionY = ySpeed;
|
||||
motionZ = zSpeed;
|
||||
particleRed = red;
|
||||
particleGreen = green;
|
||||
particleBlue = blue;
|
||||
particleAlpha = 0.5F; // So MC renders us on the alpha layer, value not actually used
|
||||
particleGravity = 0;
|
||||
motionX = motionY = motionZ = 0;
|
||||
particleScale *= size;
|
||||
moteParticleScale = particleScale;
|
||||
maxAge = (int)(28D / (Math.random() * 0.3D + 0.7D) * maxAgeMul);
|
||||
@@ -64,7 +67,8 @@ public class FXWisp extends Particle {
|
||||
setSize(0.01F, 0.01F);
|
||||
Entity renderentity = Minecraft.getInstance().getRenderViewEntity();
|
||||
|
||||
if(distanceLimit) {
|
||||
// todo 1.14
|
||||
if(false) {
|
||||
int visibleDistance = 50;
|
||||
if (!Minecraft.getInstance().gameSettings.fancyGraphics)
|
||||
visibleDistance = 25;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package vazkii.botania.client.fx;
|
||||
|
||||
import net.minecraft.particles.ParticleType;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
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;
|
||||
|
||||
@ObjectHolder(LibMisc.MOD_ID + ":sparkle")
|
||||
public static ParticleType<ParticleData> SPARKLE;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerParticles(RegistryEvent.Register<ParticleType<?>> evt) {
|
||||
register(evt.getRegistry(), new WispParticleType(), "wisp");
|
||||
register(evt.getRegistry(), new SparkleParticleType(), "sparkle");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
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 ParticleData implements IParticleData {
|
||||
private final ParticleType<ParticleData> type;
|
||||
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) {
|
||||
return wisp(size, r, g, b, 1);
|
||||
}
|
||||
|
||||
public static ParticleData 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) {
|
||||
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 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;
|
||||
this.size = size;
|
||||
this.r = r;
|
||||
this.g = g;
|
||||
this.b = b;
|
||||
this.maxAgeMul = maxAgeMul;
|
||||
this.depthTest = depthTest;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ParticleType<ParticleData> getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(PacketBuffer buf) {
|
||||
buf.writeFloat(size);
|
||||
buf.writeFloat(r);
|
||||
buf.writeFloat(g);
|
||||
buf.writeFloat(b);
|
||||
buf.writeFloat(maxAgeMul);
|
||||
buf.writeBoolean(depthTest);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getParameters() {
|
||||
return String.format(Locale.ROOT, "%s %.2f %.2f %.2f %.2f %.2f %s",
|
||||
this.getType().getRegistryName(), this.size, this.r, this.g, this.b, this.maxAgeMul, this.depthTest);
|
||||
}
|
||||
|
||||
public static final IDeserializer<ParticleData> DESERIALIZER = new IDeserializer<ParticleData>() {
|
||||
@Nonnull
|
||||
@Override
|
||||
public ParticleData deserialize(@Nonnull ParticleType<ParticleData> 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(' ');
|
||||
float mam = reader.readFloat();
|
||||
boolean depth = true;
|
||||
if (reader.canRead()) {
|
||||
reader.expect(' ');
|
||||
depth = reader.readBoolean();
|
||||
}
|
||||
return new ParticleData(type, 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());
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -16,8 +16,14 @@ import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.profiler.IProfiler;
|
||||
import net.minecraft.profiler.Profiler;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.client.event.ParticleFactoryRegisterEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = LibMisc.MOD_ID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public final class ParticleRenderDispatcher {
|
||||
|
||||
public static int wispFxCount = 0;
|
||||
@@ -26,6 +32,12 @@ public final class ParticleRenderDispatcher {
|
||||
public static int fakeSparkleFxCount = 0;
|
||||
public static int lightningCount = 0;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerFactories(ParticleFactoryRegisterEvent evt) {
|
||||
Minecraft.getInstance().particles.registerFactory(ModParticles.WISP, WispParticleType.FACTORY);
|
||||
Minecraft.getInstance().particles.registerFactory(ModParticles.SPARKLE, SparkleParticleType.FACTORY);
|
||||
}
|
||||
|
||||
// Called from LightningHandler.onRenderWorldLast since that was
|
||||
// already registered. /shrug
|
||||
public static void dispatch() {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package vazkii.botania.client.fx;
|
||||
|
||||
import net.minecraft.client.particle.IParticleFactory;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
|
||||
public class SparkleParticleType extends ParticleType<ParticleData> {
|
||||
public SparkleParticleType() {
|
||||
super(false, ParticleData.DESERIALIZER);
|
||||
}
|
||||
|
||||
public static IParticleFactory<ParticleData> 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);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package vazkii.botania.client.fx;
|
||||
|
||||
import net.minecraft.client.particle.IParticleFactory;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
|
||||
public class WispParticleType extends ParticleType<ParticleData> {
|
||||
public WispParticleType() {
|
||||
super(false, ParticleData.DESERIALIZER);
|
||||
}
|
||||
|
||||
public static IParticleFactory<ParticleData> 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);
|
||||
}
|
||||
+1
-1
@@ -50,8 +50,8 @@ public class ManaPoolRecipeCategory implements IRecipeCategory<RecipeManaInfusio
|
||||
localizedName = I18n.format("botania.nei.manaPool");
|
||||
overlay = guiHelper.createDrawable(new ResourceLocation("botania", "textures/gui/pure_daisy_overlay.png"),
|
||||
0, 0, 64, 46);
|
||||
icon = guiHelper.createDrawableIngredient(renderStack.copy());
|
||||
ItemNBTHelper.setBoolean(renderStack, "RenderFull", true);
|
||||
icon = guiHelper.createDrawableIngredient(renderStack.copy());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -13,14 +13,12 @@ package vazkii.botania.common.block.subtile;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
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.common.Botania;
|
||||
import vazkii.botania.common.block.ModSubtiles;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -44,8 +42,12 @@ public class SubTileManastar extends TileEntitySpecialFlower {
|
||||
super.tickFlower();
|
||||
|
||||
if(getWorld().isRemote) {
|
||||
if(state != NONE && Math.random() > 0.6)
|
||||
Botania.proxy.wispFX(getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, getPos().getY() + 0.75 + Math.random() * 0.2 - 0.1, getPos().getZ() + 0.5, state == INCREASING ? 0.05F : 1F, 0.05F, state == INCREASING ? 1F : 0.05F, (float) Math.random() / 7, (float) -Math.random() / 50);
|
||||
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);
|
||||
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 {
|
||||
int mana = 0;
|
||||
for(Direction dir : MathHelper.HORIZONTALS) {
|
||||
|
||||
@@ -22,6 +22,7 @@ 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.common.core.handler.ConfigHandler;
|
||||
@@ -145,7 +146,8 @@ public class SubTilePureDaisy extends TileEntitySpecialFlower {
|
||||
double y = coords.getY() + Math.random() + 0.5;
|
||||
double z = coords.getZ() + Math.random();
|
||||
|
||||
Botania.proxy.wispFX(x, y, z, 1F, 1F, 1F, (float) Math.random() / 2F);
|
||||
ParticleData data = ParticleData.wisp((float) Math.random() / 2F, 1, 1, 1);
|
||||
getWorld().addParticle(data, x, y, z, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,19 +12,13 @@ package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
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.entity.player.ServerPlayerEntity;
|
||||
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.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -34,8 +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.common.Botania;
|
||||
import vazkii.botania.common.block.ModSubtiles;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.network.PacketHandler;
|
||||
@@ -61,8 +54,10 @@ public class SubTileDaffomill extends TileEntityFunctionalFlower {
|
||||
public void tickFlower() {
|
||||
super.tickFlower();
|
||||
|
||||
if(getWorld().rand.nextInt(4) == 0)
|
||||
Botania.proxy.wispFX(getPos().getX() + Math.random(), getPos().getY() + Math.random(), getPos().getZ() + Math.random(), 0.05F, 0.05F, 0.05F, 0.25F + (float) Math.random() * 0.15F, orientation.getXOffset() * 0.1F, orientation.getYOffset() * 0.1F, orientation.getZOffset() * 0.1F);
|
||||
if(getWorld().rand.nextInt(4) == 0) {
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
|
||||
if(windTicks == 0 && mana > 0) {
|
||||
windTicks = 20;
|
||||
|
||||
+8
-9
@@ -14,14 +14,11 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.IFluidState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tags.FluidTags;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
@@ -34,8 +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.common.Botania;
|
||||
import vazkii.botania.common.block.ModSubtiles;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -69,8 +65,10 @@ public class SubTileHydroangeas extends TileEntityGeneratingFlower {
|
||||
|
||||
if(cooldown > 0) {
|
||||
cooldown--;
|
||||
for(int i = 0; i < 3; i++)
|
||||
Botania.proxy.wispFX(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.1F, 0.1F, 0.1F, (float) Math.random() / 6, (float) -Math.random() / 30);
|
||||
for(int i = 0; i < 3; i++) {
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
}
|
||||
|
||||
if(burnTime == 0) {
|
||||
@@ -121,8 +119,9 @@ public class SubTileHydroangeas extends TileEntityGeneratingFlower {
|
||||
}
|
||||
|
||||
public void doBurnParticles() {
|
||||
Botania.proxy.wispFX(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.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
}
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
|
||||
public Tag<Fluid> getMaterialToSearchFor() {
|
||||
return FluidTags.WATER;
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.generating;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.tags.FluidTags;
|
||||
import net.minecraft.tags.Tag;
|
||||
@@ -18,8 +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.common.Botania;
|
||||
import vazkii.botania.common.block.ModSubtiles;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -44,8 +42,9 @@ public class SubTileThermalily extends SubTileHydroangeas {
|
||||
|
||||
@Override
|
||||
public void doBurnParticles() {
|
||||
Botania.proxy.wispFX(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.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
}
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tag<Fluid> getMaterialToSearchFor() {
|
||||
|
||||
@@ -12,17 +12,12 @@ package vazkii.botania.common.block.tile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
@@ -40,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.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.mana.BlockPool;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
@@ -216,8 +211,9 @@ public class TileAlfPortal extends TileMod implements ITickableTileEntity {
|
||||
pos = CONVERTER_X_Z_FP.apply(pos);
|
||||
|
||||
float motionMul = 0.2F;
|
||||
Botania.proxy.wispFX(getPos().getX() + pos[0], getPos().getY() + pos[1], getPos().getZ() + pos[2], (float) (Math.random() * 0.25F), (float) (Math.random() * 0.5F + 0.5F), (float) (Math.random() * 0.25F), (float) (Math.random() * 0.15F + 0.1F), (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul, (float) (Math.random() - 0.5F) * motionMul);
|
||||
}
|
||||
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));
|
||||
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);
|
||||
}
|
||||
|
||||
public boolean onWanded() {
|
||||
AlfPortalState state = world.getBlockState(getPos()).get(BotaniaStateProps.ALFPORTAL_STATE);
|
||||
|
||||
@@ -29,6 +29,7 @@ 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.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
@@ -128,9 +129,12 @@ 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++) {
|
||||
Botania.proxy.wispFX(pos.getX() + 0.7 - Math.random() * 0.4, pos.getY() + 0.9 - Math.random() * 0.2, pos.getZ() + 0.7 - Math.random() * 0.4, r, g, b, 0.1F + (float) Math.random() * 0.05F, 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++)
|
||||
Botania.proxy.wispFX(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.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.03F - (float) Math.random() * 0.06F, 0.03F + (float) Math.random() * 0.015F, 0.03F - (float) Math.random() * 0.06F);
|
||||
ParticleData data1 = ParticleData.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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,8 +175,10 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver, I
|
||||
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++)
|
||||
Botania.proxy.wispFX(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.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.05F - (float) Math.random() * 0.1F, 0.05F + (float) Math.random() * 0.03F, 0.05F - (float) Math.random() * 0.1F);
|
||||
for(int j = 0; j < 2; j++) {
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
}
|
||||
world.playSound(pos.getX(), pos.getY(), pos.getZ(), ModSounds.potionCreate, SoundCategory.BLOCKS, 1F, 1.5F + (float) Math.random() * 0.25F, false);
|
||||
}
|
||||
|
||||
@@ -10,24 +10,21 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
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.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.brew.ItemIncenseStick;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
@@ -81,9 +78,11 @@ public class TileIncensePlate extends TileSimpleInventory implements ITickableTi
|
||||
float r = color.getRed() / 255F;
|
||||
float g = color.getGreen() / 255F;
|
||||
float b = color.getBlue() / 255F;
|
||||
Botania.proxy.wispFX(x - (Math.random() - 0.5) * 0.2, y - (Math.random() - 0.5) * 0.2, z - (Math.random() - 0.5) * 0.2, r, g, b, 0.05F + (float) Math.random() * 0.02F, 0.005F - (float) Math.random() * 0.01F, 0.01F + (float) Math.random() * 0.005F, 0.005F - (float) Math.random() * 0.01F);
|
||||
Botania.proxy.wispFX(x - (Math.random() - 0.5) * 0.2, y - (Math.random() - 0.5) * 0.2, z - (Math.random() - 0.5) * 0.2, 0.2F, 0.2F, 0.2F, 0.05F + (float) Math.random() * 0.02F, 0.005F - (float) Math.random() * 0.01F, 0.01F + (float) Math.random() * 0.001F, 0.005F - (float) Math.random() * 0.01F);
|
||||
}
|
||||
ParticleData data1 = ParticleData.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);
|
||||
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 {
|
||||
itemHandler.setStackInSlot(0, ItemStack.EMPTY);
|
||||
burning = false;
|
||||
|
||||
@@ -49,6 +49,7 @@ 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.common.block.BlockLightRelay;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -116,7 +117,8 @@ 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);
|
||||
Botania.proxy.wispFX(vecRot.x, vecRot.y, vecRot.z, 0.4F, 0.4F, 1F, 0.1F, (float) -vecMag.x, (float) -vecMag.y, (float) -vecMag.z, 1F);
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@@ -66,8 +66,9 @@ 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;
|
||||
|
||||
Botania.proxy.wispFX(x, y, z, r, g, b, s, -m);
|
||||
}
|
||||
ParticleData data = ParticleData.wisp(s, r, g, b, 1);
|
||||
world.addParticle(data, x, y, z, 0, m, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public int getLightColor() {
|
||||
|
||||
@@ -18,6 +18,7 @@ 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.common.block.BlockModFlower;
|
||||
import vazkii.botania.common.block.BlockPylon;
|
||||
@@ -73,9 +74,12 @@ 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);
|
||||
|
||||
Botania.proxy.wispFX(x, pos.getY() + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F);
|
||||
if(world.rand.nextInt(3) == 0)
|
||||
Botania.proxy.wispFX(x, pos.getY() + 0.25, z, (float) Math.random() * 0.25F, 0.75F + (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.25F + (float) Math.random() * 0.1F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z);
|
||||
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);
|
||||
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);
|
||||
world.addParticle(data1, x, pos.getY() + 0.25, z, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Vector3 ourCoords = Vector3.fromTileEntityCenter(this).add(0, 1 + (Math.random() - 0.5 * 0.25), 0);
|
||||
@@ -91,9 +95,12 @@ public class TilePylon extends TileEntity implements ITickableTileEntity {
|
||||
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);
|
||||
|
||||
Botania.proxy.wispFX(pos.getX() + 0.5 + (Math.random() - 0.5) * 0.25, pos.getY() - 0.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.25, r / 255F, g / 255F, b / 255F, (float) Math.random() / 3F, -0.04F);
|
||||
Botania.proxy.wispFX(pos.getX() + 0.5 + (Math.random() - 0.5) * 0.125, pos.getY() + 1.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.125, r / 255F, g / 255F, b / 255F, (float) Math.random() / 5F, -0.001F);
|
||||
Botania.proxy.wispFX(pos.getX() + 0.5 + (Math.random() - 0.5) * 0.25, pos.getY() + 1.5, pos.getZ() + 0.5 + (Math.random() - 0.5) * 0.25, r / 255F, g / 255F, b / 255F, (float) Math.random() / 8F, (float) movementVector.x, (float) movementVector.y, (float) movementVector.z);
|
||||
ParticleData data1 = ParticleData.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);
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,16 +14,12 @@ 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.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
@@ -36,6 +32,7 @@ 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.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
@@ -44,8 +41,6 @@ import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.material.ItemRune;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.network.PacketBotaniaEffect;
|
||||
import vazkii.botania.common.network.PacketHandler;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -173,8 +168,10 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver,
|
||||
Botania.proxy.lightningFX(vec, endVec, 2F, 0x00948B, 0x00E4D7);
|
||||
}
|
||||
|
||||
if (cooldown > 0)
|
||||
Botania.proxy.wispFX(pos.getX() + Math.random(), pos.getY() + 0.8, pos.getZ() + Math.random(), 0.2F, 0.2F, 0.2F, 0.2F, -0.025F);
|
||||
if (cooldown > 0) {
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
}
|
||||
|
||||
if(cooldown > 0) {
|
||||
|
||||
@@ -14,27 +14,20 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.MobEntity;
|
||||
import net.minecraft.entity.ILivingEntityData;
|
||||
import net.minecraft.entity.MobEntity;
|
||||
import net.minecraft.entity.SpawnReason;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.tileentity.MobSpawnerTileEntity;
|
||||
import net.minecraft.world.spawner.AbstractSpawner;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.MobSpawnerTileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.WeightedSpawnerEntity;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.spawner.AbstractSpawner;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.api.mana.IManaReceiver;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@@ -66,8 +59,10 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver, ITickable
|
||||
BlockPos blockpos = logic.getSpawnerPosition();
|
||||
if (world.isRemote) {
|
||||
// Botania - use own particles
|
||||
if(Math.random() > 0.5)
|
||||
Botania.proxy.wispFX(getPos().getX() + 0.3 + Math.random() * 0.5, getPos().getY() - 0.3 + Math.random() * 0.25, getPos().getZ() + Math.random(), 0.6F - (float) Math.random() * 0.3F, 0.1F, 0.6F - (float) Math.random() * 0.3F, (float) Math.random() / 3F, -0.025F - 0.005F * (float) Math.random(), 2F);
|
||||
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);
|
||||
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) {
|
||||
--logic.spawnDelay;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.Botania;
|
||||
|
||||
public class TileSpiritShrine extends TileMod implements ITickableTileEntity {
|
||||
@@ -54,8 +55,11 @@ public class TileSpiritShrine extends TileMod implements ITickableTileEntity {
|
||||
|
||||
wticks += tickIncrement;
|
||||
float[] colorsfx = colors[i >= colors.length ? 0 : i];
|
||||
Botania.proxy.wispFX(x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], 0.85F, (float)g * 0.05F, 0.25F);
|
||||
Botania.proxy.wispFX(x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.1F + 0.1F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, 0.9F);
|
||||
ParticleData data = ParticleData.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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ 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.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -259,8 +260,10 @@ 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)
|
||||
Botania.proxy.wispFX(pos.getX() + 0.3 + Math.random() * 0.5, pos.getY() + 0.6 + Math.random() * 0.25, pos.getZ() + Math.random(), PARTICLE_COLOR.getRed() / 255F, PARTICLE_COLOR.getGreen() / 255F, PARTICLE_COLOR.getBlue() / 255F, (float) Math.random() / 3F, (float) -Math.random() / 25F, 2F);
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ 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.common.core.helper.Vector3;
|
||||
|
||||
public interface IProxy {
|
||||
@@ -46,28 +47,6 @@ public interface IProxy {
|
||||
|
||||
void sparkleFX(double x, double y, double z, float r, float g, float b, float size, int m, boolean fake);
|
||||
|
||||
void setWispFXDistanceLimit(boolean limit);
|
||||
|
||||
void setWispFXDepthTest(boolean depth);
|
||||
|
||||
default void wispFX(double x, double y, double z, float r, float g, float b, float size) {
|
||||
wispFX(x, y, z, r, g, b, size, 0F);
|
||||
}
|
||||
|
||||
default void wispFX(double x, double y, double z, float r, float g, float b, float size, float gravity) {
|
||||
wispFX(x, y, z, r, g, b, size, gravity, 1F);
|
||||
}
|
||||
|
||||
default void wispFX(double x, double y, double z, float r, float g, float b, float size, float gravity, float maxAgeMul) {
|
||||
wispFX(x, y, z, r, g, b, size, 0, -gravity, 0, maxAgeMul);
|
||||
}
|
||||
|
||||
default void wispFX(double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz) {
|
||||
wispFX(x, y, z, r, g, b, size, motionx, motiony, motionz, 1F);
|
||||
}
|
||||
|
||||
void wispFX(double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz, float maxAgeMul);
|
||||
|
||||
default void lightningFX(Vector3 vectorStart, Vector3 vectorEnd, float ticksPerMeter, int colorOuter, int colorInner) {
|
||||
lightningFX(vectorStart, vectorEnd, ticksPerMeter, System.nanoTime(), colorOuter, colorInner);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ 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 net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.fml.server.ServerLifecycleHooks;
|
||||
@@ -80,15 +79,6 @@ public class ServerProxy implements IProxy {
|
||||
@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 setWispFXDistanceLimit(boolean limit) {}
|
||||
|
||||
@Override
|
||||
public void setWispFXDepthTest(boolean depth) {}
|
||||
|
||||
@Override
|
||||
public void wispFX(double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz, float maxAgeMul) {}
|
||||
|
||||
@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.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.core.helper.PlayerHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
@@ -159,8 +159,10 @@ public class EntityBabylonWeapon extends EntityThrowableCopy {
|
||||
|
||||
setMotion(mot);
|
||||
|
||||
if(liveTime > delay)
|
||||
Botania.proxy.wispFX(posX, posY, posZ, 1F, 1F, 0F, 0.3F, 0F);
|
||||
if(liveTime > delay) {
|
||||
ParticleData data = ParticleData.wisp(0.3F, 1F, 1F, 0F, 1);
|
||||
world.addParticle(data, posX, posY, posZ, 0, -0F, 0);
|
||||
}
|
||||
|
||||
if(liveTime > 200 + delay)
|
||||
remove();
|
||||
|
||||
@@ -21,8 +21,6 @@ import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.ai.goal.SwimGoal;
|
||||
import net.minecraft.entity.ai.goal.LookAtGoal;
|
||||
import net.minecraft.entity.monster.SkeletonEntity;
|
||||
import net.minecraft.entity.monster.WitchEntity;
|
||||
import net.minecraft.entity.monster.WitherSkeletonEntity;
|
||||
import net.minecraft.entity.monster.ZombieEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -51,7 +49,6 @@ import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.Style;
|
||||
@@ -75,6 +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.common.Botania;
|
||||
import vazkii.botania.common.advancements.DopplegangerNoArmorTrigger;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -199,7 +197,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti
|
||||
List<BlockPos> invalidPylonBlocks = checkPylons(world, pos);
|
||||
if(!invalidPylonBlocks.isEmpty()) {
|
||||
if(world.isRemote) {
|
||||
warnInvalidBlocks(invalidPylonBlocks);
|
||||
warnInvalidBlocks(world, invalidPylonBlocks);
|
||||
} else {
|
||||
player.sendMessage(new TranslationTextComponent("botaniamisc.needsCatalysts").setStyle(new Style().setColor(TextFormatting.RED)));
|
||||
}
|
||||
@@ -211,7 +209,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti
|
||||
List<BlockPos> invalidArenaBlocks = checkArena(world, pos);
|
||||
if(!invalidArenaBlocks.isEmpty()) {
|
||||
if(world.isRemote) {
|
||||
warnInvalidBlocks(invalidArenaBlocks);
|
||||
warnInvalidBlocks(world, invalidArenaBlocks);
|
||||
} else {
|
||||
PacketHandler.sendTo((ServerPlayerEntity) player,
|
||||
new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ARENA_INDICATOR, pos.getX(), pos.getY(), pos.getZ()));
|
||||
@@ -300,12 +298,11 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti
|
||||
return trippedPositions;
|
||||
}
|
||||
|
||||
private static void warnInvalidBlocks(Iterable<BlockPos> invalidPositions) {
|
||||
Botania.proxy.setWispFXDepthTest(false);
|
||||
private static void warnInvalidBlocks(World world, Iterable<BlockPos> invalidPositions) {
|
||||
ParticleData data = ParticleData.wisp(0.5F, 1, 0.2F, 0.2F, 8, false);
|
||||
for(BlockPos pos_ : invalidPositions) {
|
||||
Botania.proxy.wispFX(pos_.getX() + 0.5, pos_.getY() + 0.5, pos_.getZ() + 0.5, 1F, 0.2F, 0.2F, 0.5F, 0F, 8);
|
||||
world.addParticle(data, pos_.getX() + 0.5, pos_.getY() + 0.5, pos_.getZ() + 0.5, 0, 0, 0);
|
||||
}
|
||||
Botania.proxy.setWispFXDepthTest(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -535,7 +532,8 @@ 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;
|
||||
|
||||
Botania.proxy.wispFX(x, y, z, r, g, b, 0.5F, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * mv, (float) (Math.random() - 0.5F) * m);
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
|
||||
if(getInvulTime() > 10) {
|
||||
@@ -556,8 +554,10 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti
|
||||
float g = (float) Math.random() * 0.3F;
|
||||
float b = 0.7F + (float) Math.random() * 0.3F;
|
||||
|
||||
Botania.proxy.wispFX(partPos.x, partPos.y, partPos.z, r, g, b, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F);
|
||||
Botania.proxy.wispFX(partPos.x, partPos.y, partPos.z, r, g, b, 0.4F, (float) mot.x, (float) mot.y, (float) mot.z);
|
||||
ParticleData data = ParticleData.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);
|
||||
world.addParticle(data1, partPos.x, partPos.y, partPos.z, (float) mot.x, (float) mot.y, (float) mot.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,19 +13,16 @@ package vazkii.botania.common.entity;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
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.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -66,14 +63,16 @@ public class EntityFlameRing extends Entity {
|
||||
double x = Math.cos(rad) * renderRadius;
|
||||
double z = Math.sin(rad) * renderRadius;
|
||||
|
||||
Botania.proxy.wispFX(posX + x, posY - 0.2, posZ + z, 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 0.65F + (float) Math.random() * 0.45F, (float) (Math.random() - 0.5F) * 0.15F, 0.055F + (float) Math.random() * 0.025F, (float) (Math.random() - 0.5F) * 0.15F);
|
||||
ParticleData data1 = ParticleData.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;
|
||||
Botania.proxy.wispFX(posX + x, posY - 0.2, posZ + z, gs, gs, gs, 0.65F + (float) Math.random() * 0.45F, -0.155F - (float) Math.random() * 0.025F);
|
||||
}
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
}
|
||||
|
||||
if(world.rand.nextInt(20) == 0)
|
||||
|
||||
@@ -13,11 +13,9 @@ package vazkii.botania.common.entity;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
@@ -26,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.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -61,16 +59,20 @@ public class EntityMagicLandmine extends Entity {
|
||||
float b = 0.2F;
|
||||
|
||||
//Botania.proxy.wispFX(world, posX, posY, posZ, r, g, b, 0.6F, -0.2F, 1);
|
||||
for(int i = 0; i < 6; i++)
|
||||
Botania.proxy.wispFX(posX - range + Math.random() * range * 2, posY, posZ - range + Math.random() * range * 2, r, g, b, 0.4F, -0.015F, 1);
|
||||
for(int i = 0; i < 6; i++) {
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
|
||||
if(ticksExisted >= 55) {
|
||||
world.playSound(null, posX, posY, posZ, ModSounds.gaiaTrap, SoundCategory.NEUTRAL, 0.3F, 1F);
|
||||
|
||||
float m = 0.35F;
|
||||
g = 0.4F;
|
||||
for(int i = 0; i < 25; i++)
|
||||
Botania.proxy.wispFX(posX, posY + 1, posZ, r, g, b, 0.5F, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * m, (float) (Math.random() - 0.5F) * m);
|
||||
for(int i = 0; i < 25; i++) {
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
|
||||
if(!world.isRemote) {
|
||||
List<PlayerEntity> players = world.getEntitiesWithinAABB(PlayerEntity.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range));
|
||||
|
||||
@@ -64,6 +64,7 @@ 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.common.Botania;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
@@ -444,13 +445,12 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst {
|
||||
if(!noParticles && shouldDoFakeParticles())
|
||||
Botania.proxy.sparkleFX(posX, posY, posZ, r, g, b, 0.4F * size, 1, true);
|
||||
} else {
|
||||
boolean monocle = Botania.proxy.isClientPlayerWearingMonocle();
|
||||
if(monocle)
|
||||
Botania.proxy.setWispFXDepthTest(false);
|
||||
boolean depth = !Botania.proxy.isClientPlayerWearingMonocle();
|
||||
|
||||
if(ConfigHandler.CLIENT.subtlePowerSystem.get())
|
||||
Botania.proxy.wispFX(posX, posY, posZ, r, g, b, 0.1F * size, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.01F);
|
||||
else {
|
||||
if(ConfigHandler.CLIENT.subtlePowerSystem.get()) {
|
||||
ParticleData data = ParticleData.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;
|
||||
float og = g;
|
||||
float ob = b;
|
||||
@@ -475,7 +475,8 @@ 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;
|
||||
Botania.proxy.wispFX(posX, posY, posZ, r, g, b, 0.2F * size,
|
||||
ParticleData data = ParticleData.wisp(0.2F * size, r, g, b, depth);
|
||||
world.addParticle(data, posX, posY, posZ,
|
||||
(float) -getMotion().getX() * 0.01F,
|
||||
(float) -getMotion().getY() * 0.01F,
|
||||
(float) -getMotion().getZ() * 0.01F);
|
||||
@@ -490,15 +491,13 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst {
|
||||
break;
|
||||
} while(Math.abs(diffVec.mag()) > distance);
|
||||
|
||||
Botania.proxy.wispFX(posX, posY, posZ, or, og, ob, 0.1F * size, (float) (Math.random() - 0.5F) * 0.06F, (float) (Math.random() - 0.5F) * 0.06F, (float) (Math.random() - 0.5F) * 0.06F);
|
||||
ParticleData data = ParticleData.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;
|
||||
posY = savedPosY;
|
||||
posZ = savedPosZ;
|
||||
}
|
||||
|
||||
if(monocle)
|
||||
Botania.proxy.setWispFXDepthTest(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -565,8 +564,10 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst {
|
||||
float size = (float) mana / (float) maxMana;
|
||||
|
||||
if(!ConfigHandler.CLIENT.subtlePowerSystem.get())
|
||||
for(int i = 0; i < 4; i++)
|
||||
Botania.proxy.wispFX(posX, posY, posZ, r, g, b, 0.15F * size, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F, (float) (Math.random() - 0.5F) * 0.04F);
|
||||
for(int i = 0; i < 4; i++) {
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
import vazkii.botania.common.block.tile.mana.TilePump;
|
||||
@@ -118,8 +118,10 @@ public class EntityPoolMinecart extends AbstractMinecartEntity {
|
||||
double x = MathHelper.floor(posX);
|
||||
double y = MathHelper.floor(posY);
|
||||
double z = MathHelper.floor(posZ);
|
||||
if(Math.random() > particleChance)
|
||||
Botania.proxy.wispFX(x + 0.3 + Math.random() * 0.5, y + 0.85 + Math.random() * 0.25, z + Math.random(), color.getRed(), color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random() / 3F, (float) -Math.random() / 25F, 2F);
|
||||
if(Math.random() > particleChance) {
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ 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.common.Botania;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
@@ -68,13 +69,16 @@ public class EntitySignalFlare extends Entity {
|
||||
int g = (hex & 0xFF00) >> 8;
|
||||
int b = hex & 0xFF;
|
||||
|
||||
Botania.proxy.setWispFXDistanceLimit(false);
|
||||
for(int i = 0; i < 3; i++)
|
||||
Botania.proxy.wispFX(posX, posY, posZ + 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random() * 5 + 1F, (float) (Math.random() - 0.5F), 10F * (float) Math.sqrt(256F / (256F - (float) posY)), (float) (Math.random() - 0.5F));
|
||||
// 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);
|
||||
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++)
|
||||
Botania.proxy.wispFX(posX + 0.5, Math.min(256, getFiredAt() + Botania.proxy.getClientRenderDistance() * 16), posZ + 0.5, r / 255F, g / 255F, b / 255F, (float) Math.random() * 15 + 8F, (float) (Math.random() - 0.5F) * 8F, 0F, (float) (Math.random() - 0.5F) * 8F);
|
||||
Botania.proxy.setWispFXDistanceLimit(true);
|
||||
for(int i = 0; i < 4; i++) {
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,61 +13,39 @@ package vazkii.botania.common.item;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.AbstractGui;
|
||||
import net.minecraft.client.gui.AbstractGui;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
import net.minecraft.inventory.container.SimpleNamedContainerProvider;
|
||||
import net.minecraft.inventory.container.WorkbenchContainer;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
import net.minecraft.inventory.container.WorkbenchContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipeType;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
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.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.network.NetworkHooks;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
@@ -75,16 +53,14 @@ 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.gui.crafting.ContainerCraftingHalo;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.PlayerHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.lib.LibGuiIDs;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -218,8 +194,10 @@ public class ItemCraftingHalo extends ItemMod {
|
||||
Vec3d lookVec3 = player.getLookVec();
|
||||
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++)
|
||||
Botania.proxy.wispFX(centerVector.x, centerVector.y, centerVector.z, 1F, 0F, 1F, 0.2F + 0.2F * (float) Math.random(), ((float) Math.random() - 0.5F) * m, ((float) Math.random() - 0.5F) * m, ((float) Math.random() - 0.5F) * m);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean consumeRecipeIngredients(ItemStack[] recipe, IItemHandler inv, PlayerEntity player) {
|
||||
|
||||
@@ -10,20 +10,13 @@
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
@@ -69,8 +62,9 @@ public class ItemFertilizer extends ItemMod {
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
Botania.proxy.wispFX(x, y, z, red, green, blue, 0.15F + (float) Math.random() * 0.25F, -(float) Math.random() * 0.1F - 0.05F);
|
||||
}
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
}
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
|
||||
@@ -13,41 +13,27 @@ package vazkii.botania.common.item;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import vazkii.botania.api.item.IFloatingFlower.IslandType;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.client.core.handler.ModelHandler;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
@@ -109,8 +95,12 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant {
|
||||
double z = (Math.random() - 0.5) * 3;
|
||||
float velMul = 0.025F;
|
||||
|
||||
Botania.proxy.wispFX(pos.getX() + 0.5 + x, pos.getY() + 0.5 + y, pos.getZ() + 0.5 + z, r, g, b, (float) Math.random() * 0.15F + 0.15F, (float) -x * velMul, (float) -y * velMul, (float) -z * velMul);
|
||||
}
|
||||
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);
|
||||
world.addParticle(data, pos.getX() + 0.5 + x, pos.getY() + 0.5 + y, pos.getZ() + 0.5 + z, motionx, motiony, motionz);
|
||||
}
|
||||
}
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
|
||||
@@ -24,7 +24,6 @@ import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.EntityRayTraceResult;
|
||||
import net.minecraft.util.math.RayTraceContext;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
@@ -33,6 +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.common.Botania;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
@@ -83,8 +83,9 @@ public class ItemSextant extends ItemMod {
|
||||
float radian = (float) (i * Math.PI / 180);
|
||||
double xp = x + Math.cos(radian) * radius;
|
||||
double zp = z + Math.sin(radian) * radius;
|
||||
Botania.proxy.wispFX(xp + 0.5, source.y + 1, zp + 0.5, 0F, 1F, 1F, 0.3F, -0.01F);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,9 +131,10 @@ 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);
|
||||
Botania.proxy.wispFX(source.x + 0.5, source.y + 1, source.z + 0.5, 1F, 0F, 0F, 0.2F, -0.1F);
|
||||
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);
|
||||
|
||||
Vector3 centerVec = Vector3.fromEntityCenter(player);
|
||||
Vector3 centerVec = Vector3.fromEntityCenter(player);
|
||||
Vector3 diffVec = source.subtract(centerVec);
|
||||
Vector3 lookVec = new Vector3(player.getLookVec());
|
||||
double mul = diffVec.y / lookVec.y;
|
||||
|
||||
@@ -10,44 +10,30 @@
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.EntityType;
|
||||
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.item.BlockItemUseContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.MobSpawnerTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.MobSpawnerTileEntity;
|
||||
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.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
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.common.advancements.UseItemSuccessTrigger;
|
||||
import vazkii.botania.common.core.helper.PlayerHelper;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -168,8 +154,9 @@ public class ItemSpawnerMover extends ItemMod {
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
Botania.proxy.wispFX(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, red, green, blue, (float) Math.random() * 0.1F + 0.05F, (float) (Math.random() - 0.5F) * 0.15F, (float) (Math.random() - 0.5F) * 0.15F, (float) (Math.random() - 0.5F) * 0.15F);
|
||||
}
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else return false;
|
||||
|
||||
@@ -35,7 +35,6 @@ import net.minecraft.util.Rotation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.EntityRayTraceResult;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
@@ -48,6 +47,7 @@ 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.common.Botania;
|
||||
import vazkii.botania.common.block.BlockPistonRelay;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -150,8 +150,12 @@ public class ItemTwigWand extends ItemMod implements ICoordBoundItem {
|
||||
|
||||
float velMul = 0.07F;
|
||||
|
||||
Botania.proxy.wispFX(pos.getX() + 0.5 + x, pos.getY() + 0.5 + y, pos.getZ() + 0.5 + z, red, green, blue, (float) Math.random() * 0.15F + 0.15F, (float) -x * velMul, (float) -y * velMul, (float) -z * velMul);
|
||||
}
|
||||
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);
|
||||
world.addParticle(data, pos.getX() + 0.5 + x, pos.getY() + 0.5 + y, pos.getZ() + 0.5 + z, motionx, motiony, motionz);
|
||||
}
|
||||
}
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
|
||||
@@ -48,6 +48,7 @@ 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.common.Botania;
|
||||
import vazkii.botania.common.core.handler.EquipmentHandler;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
@@ -103,24 +104,22 @@ public class ItemItemFinder extends ItemBauble {
|
||||
return;
|
||||
|
||||
ListNBT blocks = ItemNBTHelper.getList(stack, TAG_BLOCK_POSITIONS, Constants.NBT.TAG_LONG, false);
|
||||
Botania.proxy.setWispFXDepthTest(false);
|
||||
|
||||
for(int i = 0; i < blocks.size(); i++) {
|
||||
BlockPos pos = BlockPos.fromLong(((LongNBT) blocks.get(i)).getLong());
|
||||
float m = 0.02F;
|
||||
Botania.proxy.wispFX(pos.getX() + (float) Math.random(), pos.getY() + (float) Math.random(), pos.getZ() + (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.15F + 0.05F * (float) Math.random(), m * (float) (Math.random() - 0.5), m * (float) (Math.random() - 0.5), m * (float) (Math.random() - 0.5));
|
||||
ParticleData data = ParticleData.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));
|
||||
}
|
||||
|
||||
int[] entities = ItemNBTHelper.getIntArray(stack, TAG_ENTITY_POSITIONS);
|
||||
for(int i : entities) {
|
||||
Entity e = player.world.getEntityByID(i);
|
||||
if(e != null && Math.random() < 0.6) {
|
||||
Botania.proxy.setWispFXDepthTest(Math.random() < 0.6);
|
||||
Botania.proxy.wispFX(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, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0.15F + 0.05F * (float) Math.random(), -0.05F - 0.03F * (float) Math.random());
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
}
|
||||
|
||||
Botania.proxy.setWispFXDepthTest(true);
|
||||
}
|
||||
|
||||
protected void tickServer(ItemStack stack, PlayerEntity player) {
|
||||
|
||||
@@ -15,7 +15,6 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -24,10 +23,9 @@ 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.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -56,8 +54,9 @@ 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;
|
||||
Botania.proxy.wispFX(player.posX, player.posY + 0.5, player.posZ, 0.4F + (float) Math.random() + 0.25F, 0F, 0F, 0.6F + (float) Math.random() * 0.2F, xMotion, 0F, zMotion);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -10,13 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.lens;
|
||||
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.DyeColor;
|
||||
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.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
@@ -62,7 +61,8 @@ public class LensFlare extends Lens {
|
||||
float g = ((hex & 0xFF00) >> 8) / 255F;
|
||||
float b = (hex & 0xFF) / 255F;
|
||||
|
||||
Botania.proxy.wispFX(tile.getPos().getX() + 0.5, tile.getPos().getY() + 0.5, tile.getPos().getZ() + 0.5, r, g, b, 0.4F, mx, my, mz);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,34 +12,26 @@ package vazkii.botania.common.item.relic;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
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.item.UseAction;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.item.UseAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
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 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.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.network.PacketBotaniaEffect;
|
||||
import vazkii.botania.common.network.PacketHandler;
|
||||
@@ -70,8 +62,9 @@ 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());
|
||||
Botania.proxy.wispFX(x1, y1, z1, (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random() * 0.5F, -0.05F + (float) Math.random() * 0.05F);
|
||||
}
|
||||
ParticleData data = ParticleData.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 {
|
||||
ItemStack stack = ctx.getItem();
|
||||
ItemNBTHelper.setInt(stack, TAG_X, pos.getX());
|
||||
@@ -92,8 +85,9 @@ 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());
|
||||
Botania.proxy.wispFX(x, y, z, (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random() * 0.7F, -0.05F - (float) Math.random() * 0.05F);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
|
||||
@@ -30,6 +30,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.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
@@ -67,21 +68,19 @@ public class ItemDiviningRod extends ItemMod implements IManaUsingItem, IAvatarW
|
||||
}
|
||||
|
||||
private void doHighlight(World world, BlockPos pos, int range, long seedxor) {
|
||||
Botania.proxy.setWispFXDepthTest(false);
|
||||
for(BlockPos pos_ : BlockPos.getAllInBoxMutable(pos.add(-range, -range, -range),
|
||||
pos.add(range, range, range))) {
|
||||
BlockState state = world.getBlockState(pos_);
|
||||
|
||||
if(Tags.Blocks.ORES.contains(state.getBlock())) {
|
||||
Random rand = new Random(state.hashCode() ^ seedxor);
|
||||
Botania.proxy.wispFX(pos_.getX() + world.rand.nextFloat(),
|
||||
ParticleData data = ParticleData.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(),
|
||||
rand.nextFloat(), rand.nextFloat(), rand.nextFloat(),
|
||||
0.25F, 0F, 8);
|
||||
0, 0, 0);
|
||||
}
|
||||
}
|
||||
Botania.proxy.setWispFXDepthTest(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,37 +13,29 @@ package vazkii.botania.common.item.rod;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
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.entity.player.PlayerEntity;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Effects;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.tags.EntityTypeTags;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.item.IManaProficiencyArmor;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.entity.EntityThrownItem;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@@ -171,12 +163,9 @@ 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;
|
||||
Botania.proxy.wispFX(target.posX + target.getWidth() / 2,
|
||||
target.posY + target.getHeight() / 2,
|
||||
target.posZ + target.getWidth() / 2,
|
||||
r, 0F, b,
|
||||
s, xm, ym, zm);
|
||||
}
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
|
||||
MathHelper.setEntityMotionFromVector(target, target3, 0.3333333F);
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
@@ -33,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.common.Botania;
|
||||
import vazkii.botania.client.fx.ParticleData;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.item.equipment.tool.ToolCommons;
|
||||
|
||||
@@ -120,8 +119,9 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem {
|
||||
double y = pos.getPos().getY() + Math.random();
|
||||
double z = pos.getPos().getZ() + Math.random();
|
||||
|
||||
Botania.proxy.wispFX(x, y, z, 1F, 0.2F, 0.2F, 0.5F, (float) -Math.random() / 10F);
|
||||
}
|
||||
ParticleData data1 = ParticleData.wisp(0.5F, 1F, 0.2F, 0.2F, 1);
|
||||
p.world.addParticle(data1, x, y, z, 0, (float) -Math.random() / 10F, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -133,8 +133,9 @@ 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();
|
||||
Botania.proxy.wispFX(x, y, z, 1F, 0.2F, 0.2F, 0.5F, (float) -Math.random() / 10F);
|
||||
}
|
||||
ParticleData data = ParticleData.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)
|
||||
p.world.playSound(null, p.posX, p.posY, p.posZ, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.PLAYERS, (float) Math.random() / 2F + 0.5F, 1F);
|
||||
}
|
||||
|
||||
@@ -12,17 +12,12 @@ package vazkii.botania.common.item.rod;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
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.potion.EffectInstance;
|
||||
import net.minecraft.potion.EffectInstance;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
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;
|
||||
@@ -33,13 +28,12 @@ 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.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.brew.ModPotions;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
@@ -82,8 +76,10 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
player.setMotion(player.getMotion().add(0, dy, 0));
|
||||
|
||||
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++)
|
||||
Botania.proxy.wispFX(player.posX, player.posY, player.posZ, 0.25F, 0.25F, 0.25F, 0.35F + (float) Math.random() * 0.1F, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5));
|
||||
for(int i = 0; i < 5; i++) {
|
||||
ParticleData data = ParticleData.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));
|
||||
}
|
||||
}
|
||||
|
||||
stack.getTag().putInt(TAG_FLYCOUNTER, Math.min(max, stack.getTag().getInt(TAG_FLYCOUNTER) + FALL_MULTIPLIER));
|
||||
@@ -150,8 +146,10 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi
|
||||
p.setMotion(p.getMotion().getX(), 2.8, p.getMotion().getZ());
|
||||
|
||||
for(int i = 0; i < 20; i++)
|
||||
for(int j = 0; j < 5; j++)
|
||||
Botania.proxy.wispFX(p.posX, p.posY + i, p.posZ, 0.25F, 0.25F, 0.25F, 0.35F + (float) Math.random() * 0.1F, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5));
|
||||
for(int j = 0; j < 5; j++) {
|
||||
ParticleData data = ParticleData.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));
|
||||
}
|
||||
|
||||
if(!world.isRemote) {
|
||||
p.world.playSound(null, p.posX, p.posY, p.posZ, ModSounds.dash, SoundCategory.PLAYERS, 1F, 1F);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package vazkii.botania.common.network;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
@@ -8,13 +7,12 @@ import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
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.common.block.tile.TileTerraPlate;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
import vazkii.botania.common.item.ItemTwigWand;
|
||||
@@ -167,8 +165,8 @@ public class PacketBotaniaEffect {
|
||||
float b = 0.4F + 0.3F * (float) Math.random();
|
||||
float size = 0.125F + 0.125F * (float) Math.random();
|
||||
|
||||
Botania.proxy.wispFX(thisVec.x, thisVec.y, thisVec.z, r, g, b,
|
||||
size, (float) motion.x, (float) motion.y, (float) motion.z);
|
||||
ParticleData data = ParticleData.wisp(size, r, g, b);
|
||||
world.addParticle(data, thisVec.x, thisVec.y, thisVec.z, (float) motion.x, (float) motion.y, (float) motion.z);
|
||||
break;
|
||||
}
|
||||
case ENCHANTER_DESTROY: {
|
||||
@@ -176,8 +174,8 @@ public class PacketBotaniaEffect {
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
Botania.proxy.wispFX(message.x, message.y, message.z,
|
||||
red, green, blue, (float) Math.random() * 0.15F + 0.15F, (float) (Math.random() - 0.5F) * 0.25F, (float) (Math.random() - 0.5F) * 0.25F, (float) (Math.random() - 0.5F) * 0.25F);
|
||||
ParticleData data = ParticleData.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;
|
||||
}
|
||||
@@ -193,7 +191,8 @@ public class PacketBotaniaEffect {
|
||||
float my = (float) Math.random() * m;
|
||||
float mz = ((float) Math.random() - 0.5F) * m;
|
||||
|
||||
Botania.proxy.wispFX(message.x, message.y, message.z, r, g, b, s, mx, my, mz);
|
||||
ParticleData data = ParticleData.wisp(s, r, g, b);
|
||||
world.addParticle(data, message.x, message.y, message.z, mx, my, mz);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -221,12 +220,16 @@ public class PacketBotaniaEffect {
|
||||
float[] colorsfx = new float[] {
|
||||
0F, (float) ticks / (float) 100, 1F - (float) ticks / (float) 100
|
||||
};
|
||||
Botania.proxy.wispFX(x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], 0.85F, (float)g * 0.05F, 0.25F);
|
||||
Botania.proxy.wispFX(x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.1F + 0.1F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, (float) (Math.random() - 0.5) * 0.05F, 0.9F);
|
||||
ParticleData data = ParticleData.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);
|
||||
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++)
|
||||
Botania.proxy.wispFX(message.x + 0.5, message.y + 0.5, message.z + 0.5, colorsfx[0], colorsfx[1], colorsfx[2], (float) Math.random() * 0.15F + 0.15F, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F, (float) (Math.random() - 0.5F) * 0.125F);
|
||||
for(int j = 0; j < 15; j++) {
|
||||
data = ParticleData.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -238,8 +241,9 @@ public class PacketBotaniaEffect {
|
||||
float x = (float) (entity.posX + Math.random());
|
||||
float y = (float) (entity.posY + Math.random());
|
||||
float z = (float) (entity.posZ + Math.random());
|
||||
Botania.proxy.wispFX(x, y, z, (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), -0.3F + (float) Math.random() * 0.2F);
|
||||
}
|
||||
ParticleData data = ParticleData.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);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user