Inspection and Cleanup
This commit is contained in:
		| @@ -5,26 +5,19 @@ import eu.mhsl.minenet.minigames.instance.game.minigame.config.GameFactory; | ||||
| import eu.mhsl.minenet.minigames.util.CommonEventHandles; | ||||
| import eu.mhsl.minenet.minigames.instance.Spawnable; | ||||
| import eu.mhsl.minenet.minigames.instance.room.Room; | ||||
| import io.github.bloepiloepi.pvp.config.PvPConfig; | ||||
| import net.minestom.server.MinecraftServer; | ||||
| import net.minestom.server.coordinate.Pos; | ||||
| import net.minestom.server.entity.Player; | ||||
| import net.minestom.server.event.EventNode; | ||||
| import net.minestom.server.event.instance.AddEntityToInstanceEvent; | ||||
| import net.minestom.server.event.instance.RemoveEntityFromInstanceEvent; | ||||
| import net.minestom.server.event.item.ItemDropEvent; | ||||
| import net.minestom.server.event.player.PlayerBlockBreakEvent; | ||||
| import net.minestom.server.event.player.PlayerBlockPlaceEvent; | ||||
| import net.minestom.server.event.player.PlayerMoveEvent; | ||||
| import net.minestom.server.event.trait.InstanceEvent; | ||||
| import net.minestom.server.instance.InstanceContainer; | ||||
| import net.minestom.server.timer.ExecutionType; | ||||
| import net.minestom.server.timer.TaskSchedule; | ||||
| import net.minestom.server.world.DimensionType; | ||||
| import org.jetbrains.annotations.NotNull; | ||||
|  | ||||
| import java.util.Random; | ||||
| import java.util.UUID; | ||||
| import java.util.concurrent.CompletableFuture; | ||||
| import java.util.logging.Logger; | ||||
|  | ||||
|   | ||||
| @@ -12,8 +12,8 @@ public enum GameList { | ||||
|     MINERUN(new MinerunFactory(), GameType.PVE), | ||||
|     TRAFFICLIGHTRACE(new TrafficLightRaceFactory(), GameType.OTHER); | ||||
|  | ||||
|     private GameFactory factory; | ||||
|     private GameType type; | ||||
|     private final GameFactory factory; | ||||
|     private final GameType type; | ||||
|     GameList(GameFactory factory, GameType type) { | ||||
|         this.factory = factory; | ||||
|         this.type = type; | ||||
|   | ||||
| @@ -9,9 +9,9 @@ public enum GameType { | ||||
|     PVE(Material.DIAMOND_PICKAXE, TranslatedComponent.byId("GameType#pve"), TranslatedComponent.byId("GameType#pve_description")); | ||||
|  | ||||
|  | ||||
|     Material icon; | ||||
|     TranslatedComponent title; | ||||
|     TranslatedComponent description; | ||||
|     final Material icon; | ||||
|     final TranslatedComponent title; | ||||
|     final TranslatedComponent description; | ||||
|  | ||||
|     GameType(Material icon, TranslatedComponent title, TranslatedComponent description) { | ||||
|         this.title = title; | ||||
|   | ||||
| @@ -9,22 +9,20 @@ import eu.mhsl.minenet.minigames.score.Score; | ||||
| import net.kyori.adventure.audience.Audience; | ||||
| import net.kyori.adventure.text.Component; | ||||
| import net.kyori.adventure.text.format.NamedTextColor; | ||||
| import net.minestom.server.event.player.PlayerMoveEvent; | ||||
| import net.minestom.server.timer.ExecutionType; | ||||
| import net.minestom.server.timer.TaskSchedule; | ||||
| import net.minestom.server.world.DimensionType; | ||||
| import org.jetbrains.annotations.NotNull; | ||||
|  | ||||
| import java.time.Duration; | ||||
| import java.util.concurrent.CompletableFuture; | ||||
|  | ||||
| public class Minigame extends Game { | ||||
|     private final String name; | ||||
|     private Score score = new Score(this); | ||||
|     private final Score score = new Score(this); | ||||
|  | ||||
|     private int timeLimit = 0; | ||||
|     private int timePlayed = 0; | ||||
|     private boolean preventExit = false; | ||||
|     private final boolean preventExit = false; | ||||
|     public Minigame(DimensionType dimensionType, String gameName) { | ||||
|         super(dimensionType); | ||||
|  | ||||
| @@ -54,14 +52,10 @@ public class Minigame extends Game { | ||||
|      */ | ||||
|     protected CompletableFuture<Void> countdownStart() { | ||||
|         return new Countdown(TitleMessage.class) | ||||
|                 .countdown(Audience.audience(getPlayers()), 5, countdownModifier -> { | ||||
|                     countdownModifier.message = new TitleMessage(Duration.ofMillis(300), Duration.ofMillis(700)) | ||||
|                             .subtitle(subtitleMessage -> { | ||||
|                                 subtitleMessage.appendStatic(Component.text("in ", NamedTextColor.DARK_GREEN)) | ||||
|                                         .appendStatic(Component.text(countdownModifier.timeLeft, NamedTextColor.GREEN)) | ||||
|                                         .appendStatic(Component.text(" seconds", NamedTextColor.DARK_GREEN)); | ||||
|                             }); | ||||
|                 }); | ||||
|                 .countdown(Audience.audience(getPlayers()), 5, countdownModifier -> countdownModifier.message = new TitleMessage(Duration.ofMillis(300), Duration.ofMillis(700)) | ||||
|                         .subtitle(subtitleMessage -> subtitleMessage.appendStatic(Component.text("in ", NamedTextColor.DARK_GREEN)) | ||||
|                                     .appendStatic(Component.text(countdownModifier.timeLeft, NamedTextColor.GREEN)) | ||||
|                                     .appendStatic(Component.text(" seconds", NamedTextColor.DARK_GREEN)))); | ||||
|     } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1,21 +1,16 @@ | ||||
| package eu.mhsl.minenet.minigames.instance.game.minigame.config; | ||||
|  | ||||
| import com.extollit.linalg.mutable.Vec2d; | ||||
| import eu.mhsl.minenet.minigames.instance.game.Game; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.restriction.IRestriction; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.restriction.Restriction; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.restriction.RestrictionData; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.restriction.RestrictionHandler; | ||||
| import eu.mhsl.minenet.minigames.message.component.TranslatedComponent; | ||||
| import eu.mhsl.minenet.minigames.shared.inventory.InteractableInventory; | ||||
| import eu.mhsl.minenet.minigames.util.InventoryItemAlignment; | ||||
| import eu.mhsl.minenet.minigames.util.TextUtil; | ||||
| import eu.mhsl.minenet.minigames.instance.room.Room; | ||||
| import net.kyori.adventure.sound.Sound; | ||||
| import net.kyori.adventure.text.Component; | ||||
| import net.kyori.adventure.text.format.NamedTextColor; | ||||
| import net.minestom.server.MinecraftServer; | ||||
| import net.minestom.server.coordinate.Vec; | ||||
| import net.minestom.server.entity.Player; | ||||
| import net.minestom.server.event.instance.AddEntityToInstanceEvent; | ||||
| import net.minestom.server.event.instance.RemoveEntityFromInstanceEvent; | ||||
| @@ -116,7 +111,7 @@ public class GameConfigurationInventory extends InteractableInventory { | ||||
|  | ||||
|         if(!map.containsKey(slot)) return; | ||||
|  | ||||
|         Option item = map.get(slot); | ||||
|         Option<?> item = map.get(slot); | ||||
|         setDummyItem( | ||||
|                 item.getNext(p), | ||||
|                 slot | ||||
| @@ -138,9 +133,7 @@ public class GameConfigurationInventory extends InteractableInventory { | ||||
|                             .lore(restrictionHandler.getWarnings(restrictionData).stream().map(translatedComponent -> translatedComponent.getAssembled(p)).collect(Collectors.toList())) | ||||
|                             .build(), | ||||
|                     8, | ||||
|                     itemClick -> { | ||||
|                         Game.initialize(factory, itemClick.getPlayer()); | ||||
|                     }, | ||||
|                     itemClick -> Game.initialize(factory, itemClick.getPlayer()), | ||||
|                     true | ||||
|             ); | ||||
|  | ||||
| @@ -152,8 +145,8 @@ public class GameConfigurationInventory extends InteractableInventory { | ||||
|                             .lore( | ||||
|                                     restrictionHandler.getRestrictions() | ||||
|                                             .stream() | ||||
|                                             .filter(iRestriction -> iRestriction.calculate(restrictionData).getType().equals(Restriction.Type.FAIL)) | ||||
|                                             .map(iRestriction -> iRestriction.calculate(restrictionData).getDescription().getAssembled(p)) | ||||
|                                             .filter(iRestriction -> iRestriction.calculate(restrictionData).type().equals(Restriction.Type.FAIL)) | ||||
|                                             .map(iRestriction -> iRestriction.calculate(restrictionData).description().getAssembled(p)) | ||||
|                                             .collect(Collectors.toList())) | ||||
|                             .build(), | ||||
|                     8, | ||||
|   | ||||
| @@ -3,8 +3,6 @@ package eu.mhsl.minenet.minigames.instance.game.minigame.config; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.Minigame; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.restriction.RestrictionHandler; | ||||
| import eu.mhsl.minenet.minigames.message.component.TranslatedComponent; | ||||
| import net.kyori.adventure.text.Component; | ||||
| import net.minestom.server.instance.block.Block; | ||||
| import net.minestom.server.item.Material; | ||||
|  | ||||
| import java.util.HashMap; | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| package eu.mhsl.minenet.minigames.instance.game.minigame.config.common; | ||||
|  | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.Option; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.restriction.RestrictionHandler; | ||||
| import eu.mhsl.minenet.minigames.message.component.TranslatedComponent; | ||||
| import net.minestom.server.item.Material; | ||||
|  | ||||
|   | ||||
| @@ -2,40 +2,19 @@ package eu.mhsl.minenet.minigames.instance.game.minigame.config.restriction; | ||||
|  | ||||
| import eu.mhsl.minenet.minigames.message.component.TranslatedComponent; | ||||
|  | ||||
| public class Restriction { | ||||
|     final private TranslatedComponent name; | ||||
|     final private TranslatedComponent description; | ||||
|     final private TranslatedComponent warnMessage; | ||||
|  | ||||
|     final private Type type; | ||||
|  | ||||
| public record Restriction(TranslatedComponent name, TranslatedComponent description, TranslatedComponent warnMessage, | ||||
|                           eu.mhsl.minenet.minigames.instance.game.minigame.config.restriction.Restriction.Type type) { | ||||
|     public Restriction(TranslatedComponent name, TranslatedComponent description, TranslatedComponent warnMessage, Type type) { | ||||
|         this.name = name; | ||||
|         this.description = description; | ||||
|         this.warnMessage = warnMessage; | ||||
|         this.type = type; | ||||
|  | ||||
|         if(this.warnMessage == null && this.type.equals(Type.WARN)) { | ||||
|         if (this.warnMessage == null && this.type.equals(Type.WARN)) { | ||||
|             throw new IllegalStateException("warnMessage cannot be null when RestrictionType is WARN"); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public TranslatedComponent getName() { | ||||
|         return name; | ||||
|     } | ||||
|  | ||||
|     public TranslatedComponent getDescription() { | ||||
|         return description; | ||||
|     } | ||||
|  | ||||
|     public TranslatedComponent getWarnMessage() { | ||||
|         return warnMessage; | ||||
|     } | ||||
|  | ||||
|     public Type getType() { | ||||
|         return type; | ||||
|     } | ||||
|  | ||||
|     public enum Type { | ||||
|         OK, | ||||
|         WARN, | ||||
|   | ||||
| @@ -2,14 +2,5 @@ package eu.mhsl.minenet.minigames.instance.game.minigame.config.restriction; | ||||
|  | ||||
| import eu.mhsl.minenet.minigames.instance.room.Room; | ||||
|  | ||||
| public class RestrictionData { | ||||
|     final private Room room; | ||||
|  | ||||
|     public RestrictionData(Room room) { | ||||
|         this.room = room; | ||||
|     } | ||||
|  | ||||
|     public Room getRoom() { | ||||
|         return room; | ||||
|     } | ||||
| public record RestrictionData(Room room) { | ||||
| } | ||||
|   | ||||
| @@ -2,7 +2,6 @@ package eu.mhsl.minenet.minigames.instance.game.minigame.config.restriction; | ||||
|  | ||||
| import eu.mhsl.minenet.minigames.message.component.TranslatedComponent; | ||||
|  | ||||
| import java.lang.reflect.Array; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| @@ -29,16 +28,16 @@ public class RestrictionHandler { | ||||
|     public boolean canPlay(RestrictionData data) { | ||||
|         if(restrictions.size() < 1) return true; | ||||
|         return this.restrictions.stream() | ||||
|                 .noneMatch(iRestriction -> iRestriction.calculate(data).getType().equals(Restriction.Type.FAIL)); | ||||
|                 .noneMatch(iRestriction -> iRestriction.calculate(data).type().equals(Restriction.Type.FAIL)); | ||||
|     } | ||||
|  | ||||
|     public List<TranslatedComponent> getWarnings(RestrictionData data) { | ||||
|         List<TranslatedComponent> warnings = new ArrayList<>(); | ||||
|         for (IRestriction r : this.restrictions) { | ||||
|             Restriction calculated = r.calculate(data); | ||||
|             if(!calculated.getType().equals(Restriction.Type.WARN)) continue; | ||||
|             if(!calculated.type().equals(Restriction.Type.WARN)) continue; | ||||
|  | ||||
|             warnings.add(calculated.getWarnMessage()); | ||||
|             warnings.add(calculated.warnMessage()); | ||||
|         } | ||||
|         return warnings; | ||||
|     } | ||||
|   | ||||
| @@ -6,7 +6,7 @@ import eu.mhsl.minenet.minigames.instance.game.minigame.config.restriction.Restr | ||||
| import eu.mhsl.minenet.minigames.message.component.TranslatedComponent; | ||||
|  | ||||
| public class MaximalPlayeramountGameRestriction implements IRestriction { | ||||
|     private int max; | ||||
|     private final int max; | ||||
|  | ||||
|     public MaximalPlayeramountGameRestriction(int max) { | ||||
|         this.max = max; | ||||
| @@ -18,7 +18,7 @@ public class MaximalPlayeramountGameRestriction implements IRestriction { | ||||
|                 TranslatedComponent.byId("restriction#maxPlayersInRoom"), | ||||
|                 TranslatedComponent.byId("restriction#maxPlayersInRoomDescription"), | ||||
|                 null, | ||||
|                 data.getRoom().getAllMembers().size() > this.max ? Restriction.Type.FAIL : Restriction.Type.OK | ||||
|                 data.room().getAllMembers().size() > this.max ? Restriction.Type.FAIL : Restriction.Type.OK | ||||
|         ); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -5,10 +5,8 @@ import eu.mhsl.minenet.minigames.instance.game.minigame.config.restriction.Restr | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.restriction.RestrictionData; | ||||
| import eu.mhsl.minenet.minigames.message.component.TranslatedComponent; | ||||
|  | ||||
| import javax.xml.transform.OutputKeys; | ||||
|  | ||||
| public class MinimalPlayeramountGameRestriction implements IRestriction { | ||||
|     private int min; | ||||
|     private final int min; | ||||
|  | ||||
|     public MinimalPlayeramountGameRestriction(int min) { | ||||
|         this.min = min; | ||||
| @@ -20,7 +18,7 @@ public class MinimalPlayeramountGameRestriction implements IRestriction { | ||||
|                 TranslatedComponent.byId("restriction#minPlayersInRoom"), | ||||
|                 TranslatedComponent.byId("restriction#minPlayersInRoomDescription"), | ||||
|                 null, | ||||
|                 data.getRoom().getAllMembers().size() < this.min ? Restriction.Type.FAIL : Restriction.Type.OK | ||||
|                 data.room().getAllMembers().size() < this.min ? Restriction.Type.FAIL : Restriction.Type.OK | ||||
|         ); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -14,7 +14,9 @@ import java.util.concurrent.CompletableFuture; | ||||
|  | ||||
| class Deathcube extends Minigame { | ||||
|  | ||||
|     int radius, height, percentage; | ||||
|     final int radius; | ||||
|     final int height; | ||||
|     final int percentage; | ||||
|  | ||||
|     public Deathcube(int radius, int height, int percentage) { | ||||
|         super(Dimension.THE_END.DIMENSION, "Deathcube"); | ||||
|   | ||||
| @@ -6,7 +6,6 @@ import eu.mhsl.minenet.minigames.instance.game.minigame.config.Option; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.ConfigManager; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.common.NumericOption; | ||||
| import eu.mhsl.minenet.minigames.message.component.TranslatedComponent; | ||||
| import net.kyori.adventure.text.Component; | ||||
| import net.minestom.server.item.Material; | ||||
|  | ||||
| import java.util.Map; | ||||
|   | ||||
| @@ -28,7 +28,6 @@ class Minerun extends Minigame { | ||||
|     private int width = 100; | ||||
|     private int length = 50; | ||||
|  | ||||
|     private final int backRun = -5; | ||||
|     private final int preRun = 5; | ||||
|     private final int afterMines = 2; | ||||
|     private final int afterFinishLine = 10; | ||||
| @@ -45,7 +44,6 @@ class Minerun extends Minigame { | ||||
|     @Override | ||||
|     protected void onLoad(CompletableFuture<Void> callback) { | ||||
|         int spawnToFinishLine = preRun + length + afterMines; | ||||
|         int spawnToEnd = spawnToFinishLine + afterFinishLine; | ||||
|  | ||||
|         Random random = new Random(); | ||||
|         AbsoluteBlockBatch batch = new AbsoluteBlockBatch(); | ||||
| @@ -71,9 +69,7 @@ class Minerun extends Minigame { | ||||
|             batch.setBlock(x, 49, preRun, Block.GOLD_BLOCK); | ||||
|             batch.setBlock(x, 50, preRun, Block.OAK_FENCE.withProperties(properties)); | ||||
|         } | ||||
|         BatchUtil.loadAndApplyBatch(batch, this, () -> { | ||||
|             callback.complete(null); | ||||
|         }); | ||||
|         BatchUtil.loadAndApplyBatch(batch, this, () -> callback.complete(null)); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
| @@ -83,9 +79,7 @@ class Minerun extends Minigame { | ||||
|             batch.setBlock(x, 50, preRun, Block.AIR); | ||||
|         } | ||||
|  | ||||
|         BatchUtil.loadAndApplyBatch(batch, this, () -> { | ||||
|             playSound(Sound.sound(SoundEvent.BLOCK_WOOD_BREAK, Sound.Source.BLOCK, 1f, 1f)); | ||||
|         }); | ||||
|         BatchUtil.loadAndApplyBatch(batch, this, () -> playSound(Sound.sound(SoundEvent.BLOCK_WOOD_BREAK, Sound.Source.BLOCK, 1f, 1f))); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|   | ||||
| @@ -6,7 +6,6 @@ import eu.mhsl.minenet.minigames.instance.game.minigame.config.GameFactory; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.Option; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.common.NumericOption; | ||||
| import eu.mhsl.minenet.minigames.message.component.TranslatedComponent; | ||||
| import net.kyori.adventure.text.Component; | ||||
| import net.minestom.server.item.Material; | ||||
|  | ||||
| import java.util.Map; | ||||
|   | ||||
| @@ -4,16 +4,11 @@ import eu.mhsl.minenet.minigames.instance.Dimension; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.Minigame; | ||||
| import eu.mhsl.minenet.minigames.util.BatchUtil; | ||||
| import eu.mhsl.minenet.minigames.world.generator.terrain.CircularTerrainGenerator; | ||||
| import eu.mhsl.minenet.minigames.world.generator.terrain.SquareTerrainGenerator; | ||||
| import io.github.bloepiloepi.pvp.PvpExtension; | ||||
| import io.github.bloepiloepi.pvp.config.*; | ||||
| import io.github.bloepiloepi.pvp.events.FinalAttackEvent; | ||||
| import net.minestom.server.coordinate.Pos; | ||||
| import net.minestom.server.entity.Player; | ||||
| import net.minestom.server.event.EventNode; | ||||
| import net.minestom.server.event.instance.AddEntityToInstanceEvent; | ||||
| import net.minestom.server.event.player.PlayerMoveEvent; | ||||
| import net.minestom.server.event.trait.InstanceEvent; | ||||
| import net.minestom.server.instance.batch.AbsoluteBlockBatch; | ||||
| import net.minestom.server.instance.block.Block; | ||||
| import org.jetbrains.annotations.NotNull; | ||||
|   | ||||
| @@ -5,7 +5,6 @@ import eu.mhsl.minenet.minigames.instance.game.minigame.config.GameFactory; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.ConfigManager; | ||||
| import eu.mhsl.minenet.minigames.instance.game.minigame.config.Option; | ||||
| import eu.mhsl.minenet.minigames.message.component.TranslatedComponent; | ||||
| import net.kyori.adventure.text.Component; | ||||
| import net.minestom.server.item.Material; | ||||
|  | ||||
| import java.util.Map; | ||||
|   | ||||
| @@ -8,13 +8,10 @@ import eu.mhsl.minenet.minigames.instance.Spawnable; | ||||
| import eu.mhsl.minenet.minigames.instance.Dimension; | ||||
| import net.minestom.server.MinecraftServer; | ||||
| import net.minestom.server.coordinate.Pos; | ||||
| import net.minestom.server.event.instance.AddEntityToInstanceEvent; | ||||
| import net.minestom.server.event.player.*; | ||||
| import net.minestom.server.instance.AnvilLoader; | ||||
| import net.minestom.server.instance.InstanceContainer; | ||||
|  | ||||
| import java.nio.file.Path; | ||||
| import java.util.UUID; | ||||
|  | ||||
| public class Hub extends MineNetInstance implements Spawnable { | ||||
|     public static final Hub INSTANCE = new Hub(); | ||||
|   | ||||
| @@ -3,7 +3,6 @@ package eu.mhsl.minenet.minigames.instance.hub.inventory; | ||||
| import eu.mhsl.minenet.minigames.instance.room.Room; | ||||
| import eu.mhsl.minenet.minigames.message.component.TranslatedComponent; | ||||
| import eu.mhsl.minenet.minigames.shared.inventory.InteractableInventory; | ||||
| import net.kyori.adventure.text.Component; | ||||
| import net.minestom.server.entity.Player; | ||||
| import net.minestom.server.inventory.InventoryType; | ||||
| import net.minestom.server.item.ItemHideFlag; | ||||
|   | ||||
| @@ -17,7 +17,6 @@ import net.minestom.server.entity.Player; | ||||
| import net.minestom.server.event.player.PlayerBlockBreakEvent; | ||||
| import net.minestom.server.event.player.PlayerDisconnectEvent; | ||||
| import net.minestom.server.instance.AnvilLoader; | ||||
| import net.minestom.server.instance.InstanceContainer; | ||||
|  | ||||
| import java.util.*; | ||||
| import java.util.logging.Logger; | ||||
| @@ -114,9 +113,7 @@ public class Room extends MineNetInstance implements Spawnable { | ||||
|  | ||||
|     public void moveMembersToGame(Game game) { | ||||
|         logger.info("Move room group with " + this.getAllMembers().size() + " players to Game " + game.getUniqueId()); | ||||
|         this.getAllMembers().forEach(player -> { | ||||
|             MoveInstance.move(player, game); | ||||
|         }); | ||||
|         this.getAllMembers().forEach(player -> MoveInstance.move(player, game)); | ||||
|     } | ||||
|  | ||||
|     public Set<Player> getAllMembers() { | ||||
|   | ||||
| @@ -8,7 +8,6 @@ import eu.mhsl.minenet.minigames.instance.room.Room; | ||||
| import eu.mhsl.minenet.minigames.message.component.TranslatedComponent; | ||||
| import eu.mhsl.minenet.minigames.shared.inventory.InteractableInventory; | ||||
| import eu.mhsl.minenet.minigames.util.InventoryItemAlignment; | ||||
| import net.kyori.adventure.text.Component; | ||||
| import net.minestom.server.entity.Player; | ||||
| import net.minestom.server.inventory.InventoryType; | ||||
| import net.minestom.server.item.ItemHideFlag; | ||||
| @@ -34,9 +33,7 @@ public class MinigameSelectInventory extends InteractableInventory { | ||||
|                             .lore(type.getDescription().getAssembled(p)) | ||||
|                             .build(), | ||||
|                     itemAlignment.next().get(), | ||||
|                     itemClick -> { | ||||
|                         drawGames(type); | ||||
|                     } | ||||
|                     itemClick -> drawGames(type) | ||||
|             ); | ||||
|         } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user