Added bases for the spirit shrine, just particles at the moment.

This commit is contained in:
Vasco Lavos committed 2014-04-01 14:38:09 +01:00
1 parent ae32f9eacb
commit e9f4e67cf1
6 files changed
+81 -9

No files matched your search

@@ -122,8 +122,8 @@ public class ClientProxy extends CommonProxy {
}
@Override
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz) {
FXWisp wisp = new FXWisp(world, x, y, z, size, r, g, b, distanceLimit);
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz, float maxAgeMul) {
FXWisp wisp = new FXWisp(world, x, y, z, size, r, g, b, distanceLimit, maxAgeMul);
wisp.motionX = motionx;
wisp.motionY = motiony;
wisp.motionZ = motionz;
+3 -3
View File
@@ -28,16 +28,16 @@ public class FXWisp extends EntityFX {
public static final ResourceLocation particles = new ResourceLocation(LibResources.MISC_WISP_LARGE);
public FXWisp(World world, double d, double d1, double d2, float size, float red, float green, float blue, boolean distanceLimit) {
public FXWisp(World world, double d, double d1, double d2, float size, float red, float green, float blue, boolean distanceLimit, float maxAgeMul) {
super(world, d, d1, d2, 0.0D, 0.0D, 0.0D);
particleRed = red;
particleGreen = green;
particleBlue = blue;
particleGravity=0;
particleGravity = 0;
motionX = motionY = motionZ = 0;
particleScale *= size;
moteParticleScale = particleScale;
particleMaxAge = (int)(28D / (Math.random() * 0.3D + 0.7D));
particleMaxAge = (int)(28D / (Math.random() * 0.3D + 0.7D) * maxAgeMul);
moteHalfLife = particleMaxAge / 2;
noClip = true;
@@ -12,6 +12,7 @@
package vazkii.botania.common.block.tile;
import java.util.List;
import java.util.concurrent.Callable;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@@ -35,7 +36,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
int manaToGet = 0;
int mana = 0;
public boolean addItem(EntityPlayer player, ItemStack stack) {
if(stack.getItem() == ModItems.twigWand || stack.getItem() == ModItems.lexicon || manaToGet != 0)
return false;
@@ -0,0 +1,63 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [Apr 1, 2014, 1:55:57 PM (GMT)]
*/
package vazkii.botania.common.block.tile;
import vazkii.botania.common.Botania;
public class TileSpiritShrine extends TileMod {
int ticks;
@Override
public void updateEntity() {
if(worldObj.isRemote) {
if(ticks >= 40) {
float[][] colors = new float[][] {
{ 0F, 0.25F, 1F },
{ 1F, 0F, 0.2F },
{ 0F, 1F, 0.25F },
{ 1F, 1F, 0.25F },
{ 1F, 0.25F, 1F },
{ 0.25F, 1F, 1F }
};
int totalSpiritCount = 6;
double tickIncrement = 360D / totalSpiritCount;
int liftTicks = 40 * (totalSpiritCount + 1);
int existTicks = liftTicks * 2;
int lowerTicks = existTicks + liftTicks;
if(ticks < lowerTicks) {
int speed = 5;
double wticks = ticks * speed - tickIncrement;
double r = Math.sin((ticks >= liftTicks ? (ticks - liftTicks) * speed - tickIncrement : -tickIncrement) * Math.PI / 180 * 0.75) + 1 * 1.25 + 0.5;
double g = Math.sin(wticks * Math.PI / 180 * 0.55);
for(int i = 0; i < totalSpiritCount; i++) {
double x = xCoord + Math.sin(wticks * Math.PI / 180) * r + 0.5;
double y = yCoord + ((ticks > existTicks ? 40 - (double) (ticks - existTicks) : Math.min(80 + 40 * i, ticks) - 40 * (i + 1)) * 0.1);
double z = zCoord + Math.cos(wticks * Math.PI / 180) * r + 0.5;
wticks += tickIncrement;
float[] colorsfx = colors[i >= colors.length ? 0 : i];
Botania.proxy.wispFX(worldObj, x, y, z, colorsfx[0], colorsfx[1], colorsfx[2], 0.85F, (float)g * 0.05F, 0.25F);
Botania.proxy.wispFX(worldObj, 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);
}
}
}
++ticks;
}
}
}
@@ -91,10 +91,18 @@ public class CommonProxy {
}
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float gravity) {
wispFX(world, x, y, z, r, g, b, size, 0, -gravity, 0);
wispFX(world, x, y, z, r, gravity, b, size, gravity, 1F);
}
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float gravity, float maxAgeMul) {
wispFX(world, x, y, z, r, g, b, size, 0, -gravity, 0, maxAgeMul);
}
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz) {
wispFX(world, x, y, z, r, g, b, size, motionx, motiony, motionz, 1F);
}
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz, float maxAgeMul) {
// NO-OP
}
@@ -36,8 +36,8 @@ public class ItemFertilizer extends ItemMod {
if(!par3World.isRemote) {
List<ChunkCoordinates> validCoords = new ArrayList();
for(int i = -range; i < (range + 1); i++)
for(int j = -range; j < (range + 1); j++) {
for(int i = -range - 1; i < range; i++)
for(int j = -range - 1; j < range; j++) {
for(int k = 2; k >= -2; k--) {
int x = par4 + i + 1;
int y = par5 + k + 1;