forked from SteamWar/SteamWar
Add BauSystem module
Fix ci java version Fix LinkageProcessor
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package de.steamwar.lobby.particle.elements.custom;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
import de.steamwar.lobby.particle.elements.DelegatingParticleElement;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class HearthBeat extends DelegatingParticleElement {
|
||||
|
||||
private double speed;
|
||||
|
||||
private double y(double time) {
|
||||
double d1 = Math.pow(2, -Math.pow(time * 17 - 7.5, 2));
|
||||
double d2 = Math.pow(2, -Math.pow(time * 20 - 11, 2)) * 0.5;
|
||||
double d3 = Math.pow(2, -Math.pow(time * 25 - 17, 2)) * 0.1;
|
||||
return (d1 - d2 + d3) * 0.5;
|
||||
}
|
||||
|
||||
public HearthBeat(ParticleElement particleElement, double speed) {
|
||||
super(particleElement);
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
double time = ((particleTickData.getDeg() * speed) % 360) / 360.0;
|
||||
double y = y(time) * 2;
|
||||
double x = (time - 0.5) * 2;
|
||||
|
||||
Vector vector = new Vector(x, 1.1 + y - (particleTickData.getPlayer().isSneaking() ? 0.5 : 0), 0.7);
|
||||
vector.rotateAroundY(Math.toRadians(particleTickData.getPlayer().getLocation().getYaw() * -1));
|
||||
vector.setX(-vector.getX());
|
||||
vector.setZ(-vector.getZ());
|
||||
Location location = particleTickData.getPlayer().getLocation().clone().add(vector);
|
||||
ParticleTickData current = particleTickData.withLocation(location);
|
||||
particleElement.tick(current);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package de.steamwar.lobby.particle.elements.custom;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
import de.steamwar.lobby.particle.elements.DelegatingParticleElement;
|
||||
|
||||
public class NonMoving extends DelegatingParticleElement {
|
||||
|
||||
public NonMoving(ParticleElement particleElement) {
|
||||
super(particleElement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return "PARTICLE_ATTRIBUTE_NON_MOVING";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
if (particleTickData.isMoving()) {
|
||||
return;
|
||||
}
|
||||
particleElement.tick(particleTickData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package de.steamwar.lobby.particle.elements.custom;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
import de.steamwar.lobby.particle.elements.DelegatingParticleElement;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class PulseShimmer extends DelegatingParticleElement {
|
||||
|
||||
private int speed;
|
||||
private int rotationSpeed;
|
||||
|
||||
private double x(double time) {
|
||||
if (time < 0.45) {
|
||||
return Math.pow(2, -Math.pow((time - 0.45) * 6, 2)) * 0.8;
|
||||
} else {
|
||||
return Math.pow(2, -Math.pow((time - 0.45) * 4, 2)) * 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
private double y(double time) {
|
||||
return (8 * Math.pow(time, 2.2) - time) / (6.5 / 3.5) -0.1;
|
||||
}
|
||||
|
||||
public PulseShimmer(ParticleElement particleElement, int speed, int rotationSpeed) {
|
||||
super(particleElement);
|
||||
this.speed = speed;
|
||||
this.rotationSpeed = rotationSpeed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
double time = ((particleTickData.getDeg() * speed) % 360) / 360.0;
|
||||
double x = x(time);
|
||||
double y = y(time);
|
||||
Vector vector = new Vector(x, y, 0);
|
||||
vector.rotateAroundY((particleTickData.getDeg() * rotationSpeed) % 360);
|
||||
|
||||
particleElement.tick(particleTickData.withLocation(particleTickData.getLocation().clone().add(vector)));
|
||||
vector.rotateAroundY(90);
|
||||
particleElement.tick(particleTickData.withLocation(particleTickData.getLocation().clone().add(vector)));
|
||||
vector.rotateAroundY(90);
|
||||
particleElement.tick(particleTickData.withLocation(particleTickData.getLocation().clone().add(vector)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package de.steamwar.lobby.particle.elements.custom;
|
||||
|
||||
import de.steamwar.lobby.particle.ParticleElement;
|
||||
import de.steamwar.lobby.particle.ParticleTickData;
|
||||
import de.steamwar.lobby.particle.elements.DelegatingParticleElement;
|
||||
|
||||
public class YOffset extends DelegatingParticleElement {
|
||||
|
||||
private double multiplication;
|
||||
private double minY;
|
||||
private double maxY;
|
||||
private boolean inverted;
|
||||
|
||||
public YOffset(ParticleElement particleElement, double speed, double minY, double maxY, boolean inverted) {
|
||||
super(particleElement);
|
||||
this.multiplication = speed;
|
||||
this.minY = minY;
|
||||
this.maxY = maxY;
|
||||
this.inverted = inverted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String attribute() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(ParticleTickData particleTickData) {
|
||||
double value = ((particleTickData.getDeg() * multiplication) % 360) / 180;
|
||||
double y;
|
||||
if (inverted) {
|
||||
if (value <= 1) {
|
||||
y = maxY - (maxY - minY) * value;
|
||||
} else {
|
||||
y = minY + (maxY - minY) * (value - 1);
|
||||
}
|
||||
} else {
|
||||
if (value <= 1) {
|
||||
y = minY + (maxY - minY) * value;
|
||||
} else {
|
||||
y = maxY - (maxY - minY) * (value - 1);
|
||||
}
|
||||
}
|
||||
ParticleTickData current = particleTickData.withLocation(particleTickData.getLocation().clone().add(0, y, 0));
|
||||
particleElement.tick(current);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user