Archiviert
13
0

Add DoubleCircleParticle

Add CloudParticle
Add more particles
Dieser Commit ist enthalten in:
jojo 2021-01-08 21:28:02 +01:00
Ursprung a0498ce794
Commit 19cf849bf7
3 geänderte Dateien mit 91 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -28,8 +28,6 @@ import de.steamwar.sql.UserGroup;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Particle; import org.bukkit.Particle;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -70,7 +68,12 @@ public class ParticleInventory {
teamParticles.add(new SimpleParticle(Material.INK_SAC, "§8Squid", lore, Particle.SQUID_INK, 0.2F, 0.2F, 0.2F, 0.01)); teamParticles.add(new SimpleParticle(Material.INK_SAC, "§8Squid", lore, Particle.SQUID_INK, 0.2F, 0.2F, 0.2F, 0.01));
teamParticles.add(new SimpleParticle(Material.TUBE_CORAL, "§aBubble", lore, Particle.BUBBLE_POP, 0.2F, 0.2F, 0.2F, 0.01)); teamParticles.add(new SimpleParticle(Material.TUBE_CORAL, "§aBubble", lore, Particle.BUBBLE_POP, 0.2F, 0.2F, 0.2F, 0.01));
teamParticles.add(new SimpleParticle(Material.HONEY_BOTTLE, "§6Honey", lore, Particle.DRIPPING_HONEY, 0.2F, 0.2F, 0.2F, 1)); teamParticles.add(new SimpleParticle(Material.HONEY_BOTTLE, "§6Honey", lore, Particle.DRIPPING_HONEY, 0.2F, 0.2F, 0.2F, 1));
teamParticles.add(new SimpleParticle(Material.FIRE_CHARGE, "§7Firework", lore, Particle.FIREWORKS_SPARK, 0.2F, 0.2F, 0.2F, 0.5)); teamParticles.add(new SimpleParticle(Material.HONEYCOMB, "§6Nectar", lore, Particle.FALLING_NECTAR, 0.2F, 0.2F, 0.2F, 1));
teamParticles.add(new FunctionalParticle(Material.FIRE_CHARGE, "§7Firework", lore, (world, player, time) -> {
if (world.getBlockAt(player.getLocation().subtract(0, 1, 0)).getType() == Material.AIR) {
world.spawnParticle(Particle.FIREWORKS_SPARK, player.getLocation().subtract(0, -0.2, 0), 2, 0.1F, 0.1F, 0.1F, 0.2);
}
}));
teamParticles.add(new SimpleParticle(Material.DRAGON_BREATH, "§5Dragon Breath", lore, Particle.DRAGON_BREATH, 1F, 0.02F, 1F, 0.01)); teamParticles.add(new SimpleParticle(Material.DRAGON_BREATH, "§5Dragon Breath", lore, Particle.DRAGON_BREATH, 1F, 0.02F, 1F, 0.01));
teamParticles.add(new SimpleParticle(Material.SPIDER_EYE, "§5Damage", lore, Particle.DAMAGE_INDICATOR, 0.2F, 0F, 0.2F, 0.01)); teamParticles.add(new SimpleParticle(Material.SPIDER_EYE, "§5Damage", lore, Particle.DAMAGE_INDICATOR, 0.2F, 0F, 0.2F, 0.01));
teamParticles.add(new SimpleParticle(Material.BLUE_DYE, "§dDolphin", lore, Particle.DOLPHIN, 0.2F, 0F, 0.2F, 0.01)); teamParticles.add(new SimpleParticle(Material.BLUE_DYE, "§dDolphin", lore, Particle.DOLPHIN, 0.2F, 0F, 0.2F, 0.01));
@ -81,17 +84,24 @@ public class ParticleInventory {
serverteamParticles.add(new SimpleParticle(Material.ENCHANTING_TABLE, "§eZauber", lore, Particle.ENCHANTMENT_TABLE)); serverteamParticles.add(new SimpleParticle(Material.ENCHANTING_TABLE, "§eZauber", lore, Particle.ENCHANTMENT_TABLE));
serverteamParticles.add(new SimpleParticle(Material.EMERALD_BLOCK, "§2Freude", lore, Particle.VILLAGER_HAPPY, 0.2F, 0.2F, 0.2F, 0.01)); serverteamParticles.add(new SimpleParticle(Material.EMERALD_BLOCK, "§2Freude", lore, Particle.VILLAGER_HAPPY, 0.2F, 0.2F, 0.2F, 0.01));
serverteamParticles.add(new SimpleParticle(Material.FLINT_AND_STEEL, "§7Flammen", lore, Particle.FLAME, 0F, 0.2F, 0F, 0.01)); serverteamParticles.add(new SimpleParticle(Material.FLINT_AND_STEEL, "§7Flammen", lore, Particle.FLAME, 0F, 0.2F, 0F, 0.01));
serverteamParticles.add(new SimpleParticle(Material.TOTEM_OF_UNDYING, "§aTotem", lore, Particle.TOTEM, 0F, 0.2F, 0F, 0.01));
serverteamParticles.add(new SimpleParticle(Material.END_ROD, "§fEnd Rod", lore, Particle.END_ROD, 0.2F, 0.2F, 0.2F, 0.01)); serverteamParticles.add(new SimpleParticle(Material.END_ROD, "§fEnd Rod", lore, Particle.END_ROD, 0.2F, 0.2F, 0.2F, 0.01));
serverteamParticles.add(new CloudParticle(Material.WHITE_WOOL, "§fCloud", lore, Particle.CLOUD)); serverteamParticles.add(new CloudParticle(Material.WHITE_WOOL, "§fCloud", lore, Particle.CLOUD));
serverteamParticles.add(new CloudParticle(Material.TOTEM_OF_UNDYING, "§aTotem Wolke", lore, Particle.TOTEM));
serverteamParticles.add(new CloudParticle(Material.WHITE_DYE, "§eZauber Wolke", lore, Particle.ENCHANTMENT_TABLE)); serverteamParticles.add(new CloudParticle(Material.WHITE_DYE, "§eZauber Wolke", lore, Particle.ENCHANTMENT_TABLE));
serverteamParticles.add(new CloudParticle(Material.FIRE_CORAL_BLOCK, "§cFlammen Wolke", lore, Particle.FLAME)); serverteamParticles.add(new CloudParticle(Material.FIRE_CORAL_BLOCK, "§cFlammen Wolke", lore, Particle.FLAME));
serverteamParticles.add(new CloudParticle(Material.LIME_SHULKER_BOX, "§aSneeze Wolke", lore, Particle.SNEEZE)); serverteamParticles.add(new CloudParticle(Material.LIME_SHULKER_BOX, "§aSneeze Wolke", lore, Particle.SNEEZE));
serverteamParticles.add(new CloudParticle(Material.GREEN_SHULKER_BOX, "§aSchleim Wolke", lore, Particle.SLIME)); serverteamParticles.add(new CloudParticle(Material.GREEN_SHULKER_BOX, "§aSchleim Wolke", lore, Particle.SLIME));
serverteamParticles.add(new CloudParticle(Material.DEAD_BRAIN_CORAL_BLOCK, "§8Smoke Wolke", lore, Particle.CAMPFIRE_COSY_SMOKE));
serverteamParticles.add(new CloudParticle(Material.FIREWORK_STAR, "§5Town Wolke", lore, Particle.TOWN_AURA));
serverteamParticles.add(new CircleParticle(Material.MAGMA_BLOCK, "§cFlammen Ring", lore, Particle.FLAME, location -> location.add(0, 1.1, 0), 0F, 0.0F, 0F, 0.01)); serverteamParticles.add(new CircleParticle(Material.MAGMA_BLOCK, "§cFlammen Ring", lore, Particle.FLAME, location -> location.add(0, 1.1, 0), 0F, 0.0F, 0F, 0.01));
serverteamParticles.add(new CircleParticle(Material.ENCHANTED_BOOK, "§fEnchanted Ring", lore, Particle.ENCHANTMENT_TABLE, location -> location.add(0, 1.1, 0), 0.0F, 0.0F, 0.0F, 0.01)); serverteamParticles.add(new CircleParticle(Material.ENCHANTED_BOOK, "§fEnchanted Ring", lore, Particle.ENCHANTMENT_TABLE, location -> location.add(0, 1.1, 0), 0.0F, 0.0F, 0.0F, 0.01));
serverteamParticles.add(new CircleParticle(Material.NOTE_BLOCK, "§eNoten Ring", lore, Particle.NOTE, location -> location.add(0, 2.2, 0), 0.0F, 0.0F, 0.0F, 0.01)); serverteamParticles.add(new CircleParticle(Material.NOTE_BLOCK, "§eNoten Ring", lore, Particle.NOTE, location -> location.add(0, 2.2, 0), 0.0F, 0.0F, 0.0F, 0.01));
serverteamParticles.add(new DoubleCircleParticle(Material.GUARDIAN_SPAWN_EGG, "§bWater§7/§cFire Double Ring", lore, Particle.DRIP_WATER, Particle.DRIP_LAVA, location -> location.add(0, 1.1, 0), 0.0F, 0.0F, 0.0F, 0.01));
serverteamParticles.add(new DoubleCircleParticle(Material.DIAMOND_SWORD, "§5Magic§7/§eZauber Double Ring", lore, Particle.CRIT_MAGIC, Particle.ENCHANTMENT_TABLE, location -> location.add(0, 1.1, 0), 0.0F, 0.0F, 0.0F, 0.01));
serverteamParticles.add(new CloudCircleParticle(Material.GLOWSTONE_DUST, "§5Magic Ring Wolke", lore, Particle.CRIT_MAGIC, location -> location.add(0, 1.1, 0))); serverteamParticles.add(new CloudCircleParticle(Material.GLOWSTONE_DUST, "§5Magic Ring Wolke", lore, Particle.CRIT_MAGIC, location -> location.add(0, 1.1, 0)));
serverteamParticles.add(new CloudCircleParticle(Material.FIRE_CORAL, "§cFlammen Ring Wolke", lore, Particle.FLAME, location -> location.add(0, 1.1, 0)));
serverteamParticles.add(new CloudCircleParticle(Material.FIREWORK_ROCKET, "§7Firework Ring Wolke", lore, Particle.FIREWORKS_SPARK, location -> location.add(0, 1.1, 0)));
serverteamParticles.add(new CloudCircleParticle(Material.CYAN_DYE, "§aWater Ring Wolke", lore, Particle.WATER_WAKE, location -> location.add(0, 1.1, 0)));
playerParticles.forEach(specialParticle -> playerParticlesEntries.add(new SWListInv.SWListEntry<>(specialParticle.getItem(), specialParticle))); playerParticles.forEach(specialParticle -> playerParticlesEntries.add(new SWListInv.SWListEntry<>(specialParticle.getItem(), specialParticle)));
teamParticles.forEach(specialParticle -> teamParticlesEntries.add(new SWListInv.SWListEntry<>(specialParticle.getItem(), specialParticle))); teamParticles.forEach(specialParticle -> teamParticlesEntries.add(new SWListInv.SWListEntry<>(specialParticle.getItem(), specialParticle)));

Datei anzeigen

@ -34,7 +34,7 @@ public class CloudParticle extends FunctionalParticle {
super(material, name, lore, (world, player, time) -> { super(material, name, lore, (world, player, time) -> {
if (world.getBlockAt(player.getLocation().subtract(0, 1, 0)).getType() == Material.AIR) { if (world.getBlockAt(player.getLocation().subtract(0, 1, 0)).getType() == Material.AIR) {
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, 5, 2, false, false, false)); player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, 5, 2, false, false, false));
world.spawnParticle(particle, player.getLocation().subtract(0, -0.2, 0), 10, 1F, 0.02F, 1F, 0.01); world.spawnParticle(particle, player.getLocation().subtract(0, -0.2, 0), 5, 0.5F, 0.02F, 0.5F, 0.01);
} else { } else {
player.removePotionEffect(PotionEffectType.SLOW_FALLING); player.removePotionEffect(PotionEffectType.SLOW_FALLING);
} }

Datei anzeigen

@ -0,0 +1,76 @@
/*
*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2020 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* /
*/
package de.steamwar.lobby.particle;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import java.util.List;
import java.util.function.Function;
import java.util.function.UnaryOperator;
public class DoubleCircleParticle extends SpecialParticle {
private Particle particle1;
private Particle particle2;
private Function<Location, Location> locationShift;
private boolean customVelocity = false;
private float vx;
private float vy;
private float vz;
private double time = 1;
public DoubleCircleParticle(Material material, String name, List<String> lore, Particle particle1, Particle particle2, UnaryOperator<Location> locationShift, float vx, float vy, float vz, double time) {
super(material, name, lore);
this.particle1 = particle1;
this.particle2 = particle2;
this.locationShift = locationShift;
customVelocity = true;
this.vx = vx;
this.vy = vy;
this.vz = vz;
this.time = time;
}
@Override
public void particle(World world, Player player, double deg) {
Vector vector = new Vector(1, 0, 0);
vector.rotateAroundY(deg);
if (customVelocity) {
world.spawnParticle(particle1, locationShift.apply(player.getLocation().add(vector)), 1, vx, vy, vz, time);
} else {
world.spawnParticle(particle1, locationShift.apply(player.getLocation().add(vector)), 1);
}
vector.setX(-vector.getX());
vector.setZ(-vector.getZ());
if (customVelocity) {
world.spawnParticle(particle2, locationShift.apply(player.getLocation().add(vector)), 1, vx, vy, vz, time);
} else {
world.spawnParticle(particle2, locationShift.apply(player.getLocation().add(vector)), 1);
}
}
}