Skip to content

Commit

Permalink
feat(effect): 支持简单的传送粒子效果
Browse files Browse the repository at this point in the history
  • Loading branch information
CarmJos committed Feb 14, 2023
1 parent bc14c39 commit b23997f
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
import cc.carm.plugin.moeteleport.teleport.target.TeleportLocationTarget;
import cc.carm.plugin.moeteleport.teleport.target.TeleportTarget;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.Nullable;
import xyz.xenondevs.particle.ParticleBuilder;
import xyz.xenondevs.particle.ParticleEffect;
import xyz.xenondevs.particle.data.texture.ItemTexture;

import java.time.Duration;
import java.time.temporal.ChronoUnit;
Expand Down Expand Up @@ -59,7 +62,7 @@ public void tickQueue() {

if (enableEffect) {
new ParticleBuilder(ParticleEffect.PORTAL, queue.getPlayer().getLocation())
.setAmount(100).display();
.setAmount(100).setOffsetY(1F).display();
}

continue;
Expand Down Expand Up @@ -136,6 +139,13 @@ protected void executeTeleport(TeleportQueue queue) {
player.teleport(location);
PluginConfig.TELEPORTATION.SOUND.TELEPORTED.playTo(player);
});


if (PluginConfig.TELEPORTATION.EFFECTS.getNotNull()) {
new ParticleBuilder(ParticleEffect.ITEM_CRACK, location)
.setParticleData(new ItemTexture(new ItemStack(Material.ENDER_EYE)))
.setAmount(1).setOffsetY(1F).display();
}
}
}
}

0 comments on commit b23997f

Please sign in to comment.