Skip to content

Commit 2492537

Browse files
Merge pull request #415 from VolmitSoftware/Development
Development
2 parents a73de7e + e9c8760 commit 2492537

File tree

14 files changed

+1796
-9
lines changed

14 files changed

+1796
-9
lines changed

build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ plugins {
2323
id "de.undercouch.download" version "5.0.1"
2424
}
2525

26-
version '1.7.1-1.19.4'
26+
version '1.7.2-1.19.4'
2727
def nmsVersion = "1.19.4" //[NMS]
2828
def apiVersion = '1.19'
2929
def specialSourceVersion = '1.11.0' //[NMS]
@@ -155,9 +155,7 @@ dependencies {
155155
implementation "com.github.TechFortress:GriefPrevention:16.18.1"
156156
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
157157

158-
159158
// Shaded
160-
implementation 'io.papermc:paperlib:1.0.5'
161159
implementation 'net.kyori:adventure-text-minimessage:4.12.0'
162160
implementation 'net.kyori:adventure-platform-bukkit:4.1.2'
163161
implementation 'net.kyori:adventure-api:4.12.0'

src/main/java/com/volmit/adapt/Adapt.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import com.volmit.adapt.content.protector.FactionsClaimProtector;
3232
import com.volmit.adapt.content.protector.ResidenceProtector;
3333
import com.volmit.adapt.content.protector.WorldGuardProtector;
34+
import com.volmit.adapt.nms.GlowingEntities;
3435
import com.volmit.adapt.nms.NMS;
3536
import com.volmit.adapt.util.*;
3637
import com.volmit.adapt.util.secret.SecretSplash;
@@ -64,6 +65,8 @@ public class Adapt extends VolmitPlugin {
6465
private final CommandAdapt commandAdapt = new CommandAdapt();
6566
public boolean usingMagicCosmetics = Bukkit.getServer().getPluginManager().getPlugin("MagicCosmetics") != null;
6667
@Getter
68+
private GlowingEntities glowingEntities;
69+
@Getter
6770
private Ticker ticker;
6871
@Getter
6972
private AdaptServer adaptServer;
@@ -75,6 +78,7 @@ public class Adapt extends VolmitPlugin {
7578
@Getter
7679
private Map<String, Window> guiLeftovers = new HashMap<>();
7780

81+
7882

7983
public Adapt() {
8084
super();
@@ -255,12 +259,14 @@ public void start() {
255259
if (getServer().getPluginManager().getPlugin("Factions") != null) {
256260
protectorRegistry.registerProtector(new FactionsClaimProtector());
257261
}
262+
258263
if (getServer().getPluginManager().getPlugin("ChestProtect") != null) {
259264
protectorRegistry.registerProtector(new ChestProtectProtector());
260265
}
261266
if (getServer().getPluginManager().getPlugin("Residence") != null) {
262267
protectorRegistry.registerProtector(new ResidenceProtector());
263268
}
269+
glowingEntities = new GlowingEntities(this);
264270
}
265271

266272
@Override

src/main/java/com/volmit/adapt/api/Component.java

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,11 @@
4646
import org.bukkit.util.Vector;
4747

4848
import javax.annotation.Nullable;
49-
import java.util.ArrayList;
50-
import java.util.Arrays;
51-
import java.util.List;
52-
import java.util.Set;
49+
import java.util.*;
5350
import java.util.function.Predicate;
5451

52+
import static xyz.xenondevs.particle.utils.MathUtils.RANDOM;
53+
5554
public interface Component {
5655
default void wisdom(Player p, long w) {
5756
XP.wisdom(p, w);
@@ -267,6 +266,22 @@ default double getValue(Block block) {
267266
return MaterialValue.getValue(block.getType());
268267
}
269268

269+
default void vfxDome(Location center, double range, Color color, int particleCount) {
270+
Particle.DustOptions dustOptions = new Particle.DustOptions(color, 1);
271+
World world = center.getWorld();
272+
273+
for (int i = 0; i < particleCount; i++) {
274+
double theta = 2 * Math.PI * RANDOM.nextDouble();
275+
double phi = Math.PI / 2 * RANDOM.nextDouble(); // Adjusted range of phi to create a dome
276+
double x = range * Math.sin(phi) * Math.cos(theta);
277+
double y = range * Math.sin(phi) * Math.sin(theta);
278+
double z = range * Math.cos(phi);
279+
280+
Location particleLocation = center.clone().add(x, y, z);
281+
world.spawnParticle(Particle.REDSTONE, particleLocation, 0, 0, 0, 0, dustOptions);
282+
}
283+
}
284+
270285
default void vfxSphereV1(Player p, Location l, double radius, Particle particle, int verticalDensity, int radialDensity) {
271286
for (double phi = 0; phi <= Math.PI; phi += Math.PI / verticalDensity) {
272287
for (double theta = 0; theta <= 2 * Math.PI; theta += Math.PI / radialDensity) {
@@ -428,6 +443,44 @@ default void vfxPrismOutline(Location placer, double outset, Particle particle,
428443
}
429444
}
430445

446+
default void vfxCreateSphereAlt(Location center, double range, Color color, int particleCount) {
447+
Particle.DustOptions dustOptions = new Particle.DustOptions(color, 1);
448+
World world = center.getWorld();
449+
450+
for (int i = 0; i < particleCount; i++) {
451+
double x, y, z;
452+
do {
453+
x = RANDOM.nextDouble() * 2 - 1;
454+
y = RANDOM.nextDouble() * 2 - 1;
455+
z = RANDOM.nextDouble() * 2 - 1;
456+
} while (x * x + y * y + z * z > 1);
457+
458+
double magnitude = Math.sqrt(x * x + y * y + z * z);
459+
x = x / magnitude * range;
460+
y = y / magnitude * range;
461+
z = z / magnitude * range;
462+
463+
Location particleLocation = center.clone().add(x, y, z);
464+
world.spawnParticle(Particle.REDSTONE, particleLocation, 0, 0, 0, 0, dustOptions);
465+
}
466+
}
467+
468+
default void vfxSphereV3(Location center, double range, Color color, int particleCount) {
469+
Particle.DustOptions dustOptions = new Particle.DustOptions(color, 1);
470+
World world = center.getWorld();
471+
472+
for (int i = 0; i < particleCount; i++) {
473+
double theta = 2 * Math.PI * RANDOM.nextDouble();
474+
double phi = Math.acos(2 * RANDOM.nextDouble() - 1);
475+
double x = range * Math.sin(phi) * Math.cos(theta);
476+
double y = range * Math.sin(phi) * Math.sin(theta);
477+
double z = range * Math.cos(phi);
478+
479+
Location particleLocation = center.clone().add(x, y, z);
480+
world.spawnParticle(Particle.REDSTONE, particleLocation, 0, 0, 0, 0, dustOptions);
481+
}
482+
}
483+
431484

432485
default void vfxLevelUp(Player p) {
433486
p.spawnParticle(Particle.REVERSE_PORTAL, p.getLocation().clone().add(0, 1.7, 0), 100, 0.1, 0.1, 0.1, 4.1);

src/main/java/com/volmit/adapt/content/adaptation/axe/AxeChop.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ private boolean breakStuff(Block b, int power, Player player) {
116116
b.getWorld().playSound(ll.getLocation(), Sound.ITEM_AXE_STRIP, 0.75f, 1.3f);
117117

118118
player.breakBlock(ll);
119-
// ll.breakNaturally();
120119
return true;
121120
}
122121

0 commit comments

Comments
 (0)