lobby-update #16
@ -35,7 +35,8 @@ import java.util.List;
|
|||||||
|
|
||||||
public class ParticleInventory {
|
public class ParticleInventory {
|
||||||
|
|
||||||
private ParticleInventory() {}
|
private ParticleInventory() {
|
||||||
|
}
|
||||||
|
|
||||||
private static List<String> lore = Arrays.asList("§aKlicken zum Auswählen");
|
private static List<String> lore = Arrays.asList("§aKlicken zum Auswählen");
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
package de.steamwar.lobby.particle;
|
package de.steamwar.lobby.particle;
|
||||||
|
|
||||||
import org.apache.logging.log4j.util.TriConsumer;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -30,16 +29,16 @@ import java.util.List;
|
|||||||
|
|
||||||
public class FunctionalParticle extends SpecialParticle {
|
public class FunctionalParticle extends SpecialParticle {
|
||||||
|
|
||||||
private TriConsumer<World, Player, Integer> particleSpawn;
|
private ParticleFunction particleFunction;
|
||||||
|
|
||||||
public FunctionalParticle(Material material, String name, List<String> lore, TriConsumer<World, Player, Integer> particleSpawn) {
|
public FunctionalParticle(Material material, String name, List<String> lore, ParticleFunction particleFunction) {
|
||||||
super(material, name, lore);
|
super(material, name, lore);
|
||||||
this.particleSpawn = particleSpawn;
|
this.particleFunction = particleFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void particle(World world, Player player, int deg) {
|
public void particle(World world, Player player, int deg) {
|
||||||
particleSpawn.accept(world, player, deg);
|
particleFunction.accept(world, player, deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
30
src/de/steamwar/lobby/particle/ParticleFunction.java
Normale Datei
30
src/de/steamwar/lobby/particle/ParticleFunction.java
Normale Datei
@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* 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.World;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
@FunctionalInterface
|
||||||
|
public interface ParticleFunction {
|
||||||
|
void accept(World world, Player player, Integer time);
|
||||||
Chaoscaot
hat
Warum brach der die Welt? Es ist doch alles auf einer Welt? Warum nicht einfach Bukkit.getWorlds().get(0)? Und sonst ist die welt auch noch im Spieler drin. Warum brach der die Welt? Es ist doch alles auf einer Welt? Warum nicht einfach Bukkit.getWorlds().get(0)? Und sonst ist die welt auch noch im Spieler drin.
YoyoNow
hat
'Bukkit.getWorlds().get(0)' ist unnütz, und dauert nur lang als call. Ich reiche das rein um es einfacher zu haben! 'Bukkit.getWorlds().get(0)' ist unnütz, und dauert nur lang als call. Ich reiche das rein um es einfacher zu haben!
|
|||||||
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren
Bitte wenn du schon einen mehrfachconsumer benötigst, nicht unbedingt den Consumer aus log4j verwenden, sondern eher einen aus dem Java-Core (falls vorhanden)
Dort ist keiner vorhanden deswegen.
Hab ich behoben