Added restrictions
This commit is contained in:
@@ -44,6 +44,6 @@ public class GameSelector extends InteractableEntity {
|
||||
return;
|
||||
}
|
||||
|
||||
playerEntityInteractEvent.getPlayer().openInventory(new MinigameTypeSelectInventory());
|
||||
playerEntityInteractEvent.getPlayer().openInventory(new MinigameTypeSelectInventory(room));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import eu.mhsl.minenet.minigames.instance.game.GameList;
|
||||
import eu.mhsl.minenet.minigames.instance.game.GameType;
|
||||
import eu.mhsl.minenet.minigames.instance.game.minigame.config.GameConfigurationInventory;
|
||||
import eu.mhsl.minenet.minigames.instance.game.minigame.config.GameFactory;
|
||||
import eu.mhsl.minenet.minigames.instance.room.Room;
|
||||
import eu.mhsl.minenet.minigames.shared.inventory.InteractableInventory;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.minestom.server.inventory.InventoryType;
|
||||
@@ -12,8 +13,10 @@ import net.minestom.server.item.ItemStack;
|
||||
import net.minestom.server.item.Material;
|
||||
|
||||
public class MinigameTypeSelectInventory extends InteractableInventory {
|
||||
public MinigameTypeSelectInventory() {
|
||||
final private Room room;
|
||||
public MinigameTypeSelectInventory(Room room) {
|
||||
super(InventoryType.CHEST_6_ROW, Component.text("MineNet Servernetzwerk"));
|
||||
this.room = room;
|
||||
|
||||
int typeCount = 0;
|
||||
for (GameType type : GameType.values()) {
|
||||
@@ -54,7 +57,7 @@ public class MinigameTypeSelectInventory extends InteractableInventory {
|
||||
.meta(metaBuilder -> metaBuilder.hideFlag(ItemHideFlag.HIDE_ATTRIBUTES))
|
||||
.build(),
|
||||
gameCount,
|
||||
itemClick -> itemClick.getPlayer().openInventory(new GameConfigurationInventory(gameFactory))
|
||||
itemClick -> itemClick.getPlayer().openInventory(new GameConfigurationInventory(room, gameFactory))
|
||||
);
|
||||
gameCount++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user