Changed formatting to have bracing on a new line
This commit is contained in:
parent
e5eddd6c45
commit
e48eedb874
189 changed files with 6092 additions and 4041 deletions
|
@ -11,51 +11,60 @@ import net.minecraft.world.World;
|
|||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyArrayEffectCrafting;
|
||||
import WayofTime.bloodmagic.client.render.alchemyArray.BindingAlchemyCircleRenderer;
|
||||
|
||||
public class AlchemyArrayEffectBinding extends AlchemyArrayEffect {
|
||||
public class AlchemyArrayEffectBinding extends AlchemyArrayEffect
|
||||
{
|
||||
|
||||
@Getter
|
||||
public final ItemStack outputStack;
|
||||
@Getter
|
||||
public final ItemStack outputStack;
|
||||
|
||||
public AlchemyArrayEffectBinding(ItemStack outputStack) {
|
||||
this.outputStack = outputStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(TileEntity tile, int ticksActive) {
|
||||
if(ticksActive >= 50 && ticksActive <= 250) {
|
||||
//TODO: Find a way to spawn lightning from only the server side - does not render when just spawned on server, not client.
|
||||
this.spawnLightningOnCircle(tile.getWorld(), tile.getPos(), ticksActive);
|
||||
}
|
||||
|
||||
if(tile.getWorld().isRemote) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(ticksActive >= 300){
|
||||
BlockPos pos = tile.getPos();
|
||||
public AlchemyArrayEffectBinding(ItemStack outputStack)
|
||||
{
|
||||
this.outputStack = outputStack;
|
||||
}
|
||||
|
||||
ItemStack output = outputStack.copy();
|
||||
EntityItem outputEntity = new EntityItem(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
|
||||
@Override
|
||||
public boolean update(TileEntity tile, int ticksActive)
|
||||
{
|
||||
if (ticksActive >= 50 && ticksActive <= 250)
|
||||
{
|
||||
// TODO: Find a way to spawn lightning from only the server side -
|
||||
// does not render when just spawned on server, not client.
|
||||
this.spawnLightningOnCircle(tile.getWorld(), tile.getPos(), ticksActive);
|
||||
}
|
||||
|
||||
tile.getWorld().spawnEntityInWorld(outputEntity);
|
||||
if (tile.getWorld().isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void spawnLightningOnCircle(World world, BlockPos pos, int ticksActive) {
|
||||
if(ticksActive % 50 == 0) {
|
||||
int circle = ticksActive / 50 - 1;
|
||||
float distance = BindingAlchemyCircleRenderer.getDistanceOfCircle(circle, ticksActive);
|
||||
float angle = BindingAlchemyCircleRenderer.getAngleOfCircle(circle, ticksActive);
|
||||
|
||||
double dispX = distance * Math.sin(angle);
|
||||
double dispZ = -distance * Math.cos(angle);
|
||||
|
||||
EntityLightningBolt lightning = new EntityLightningBolt(world, pos.getX() + dispX, pos.getY(), pos.getZ() + dispZ);
|
||||
world.spawnEntityInWorld(lightning);
|
||||
}
|
||||
}
|
||||
if (ticksActive >= 300)
|
||||
{
|
||||
BlockPos pos = tile.getPos();
|
||||
|
||||
ItemStack output = outputStack.copy();
|
||||
EntityItem outputEntity = new EntityItem(tile.getWorld(), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, output);
|
||||
|
||||
tile.getWorld().spawnEntityInWorld(outputEntity);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void spawnLightningOnCircle(World world, BlockPos pos, int ticksActive)
|
||||
{
|
||||
if (ticksActive % 50 == 0)
|
||||
{
|
||||
int circle = ticksActive / 50 - 1;
|
||||
float distance = BindingAlchemyCircleRenderer.getDistanceOfCircle(circle, ticksActive);
|
||||
float angle = BindingAlchemyCircleRenderer.getAngleOfCircle(circle, ticksActive);
|
||||
|
||||
double dispX = distance * Math.sin(angle);
|
||||
double dispZ = -distance * Math.cos(angle);
|
||||
|
||||
EntityLightningBolt lightning = new EntityLightningBolt(world, pos.getX() + dispX, pos.getY(), pos.getZ() + dispZ);
|
||||
world.spawnEntityInWorld(lightning);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue