Skip to content

Commit

Permalink
Launch Update - Make Particles match Origins - PlaySound
Browse files Browse the repository at this point in the history
  • Loading branch information
Dueris committed Apr 11, 2024
1 parent 2931826 commit 1d6a1cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ public void prep() {
}
return false;
}));
register(new ConditionFactory(GenesisMC.apoliIdentifier("sprinting"), (condition, entity) -> {
return entity instanceof Player p && p.isSprinting();
}));
register(new ConditionFactory(GenesisMC.apoliIdentifier("sprinting"), (condition, entity) -> entity instanceof CraftPlayer player && player.isSprinting()));
register(new ConditionFactory(GenesisMC.apoliIdentifier("food_level"), (condition, entity) -> {
String comparison = condition.get("comparison").toString();
int compare_to = Integer.parseInt(condition.get("compare_to").toString());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.dueris.genesismc.factory.powers.apoli;

import me.dueris.calio.util.MiscUtils;
import me.dueris.genesismc.GenesisMC;
import me.dueris.genesismc.event.KeybindTriggerEvent;
import me.dueris.genesismc.factory.CraftApoli;
Expand All @@ -11,8 +12,12 @@
import me.dueris.genesismc.util.KeybindingUtils;
import me.dueris.genesismc.util.Utils;
import me.dueris.genesismc.util.entity.OriginPlayerAccessor;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.server.level.ServerLevel;
import org.bukkit.Particle;
import org.bukkit.craftbukkit.v1_20_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_20_R3.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_20_R3.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand Down Expand Up @@ -78,7 +83,10 @@ public void run() {
setActive(p, power.getTag(), true);
p.setVelocity(p.getVelocity().setY(0));
p.setVelocity(p.getVelocity().setY(speed));
p.spawnParticle(Particle.CLOUD, p.getLocation(), 100);
((CraftWorld) p.getWorld()).getHandle().sendParticles(ParticleTypes.CLOUD, p.getX(), p.getY(), p.getZ(), 8, ((CraftPlayer)p).getHandle().getRandom().nextGaussian(), 0.0D, ((CraftPlayer)p).getHandle().getRandom().nextGaussian(), 0.5);
if(power.containsInstance("sound")){
p.getWorld().playSound(p, MiscUtils.parseSound(power.getString("sound")), 0.5F, 0.4F / (((CraftPlayer)p).getHandle().getRandom().nextFloat() * 0.4F + 0.8F));
}
setActive(p, power.getTag(), true);
times[0]++;
}
Expand Down

0 comments on commit 1d6a1cd

Please sign in to comment.