forked from RypoFalem/ArmorStandEditor
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MENU] Add Groundwork for the Main Menu
Signed-off-by: Wolfieheart <[email protected]>
- Loading branch information
1 parent
b47b5cd
commit 916ca12
Showing
2 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
src/main/java/io/github/rypofalem/armorstandeditor/api/MainMenuOpenedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package io.github.rypofalem.armorstandeditor.api; | ||
|
||
import io.github.rypofalem.armorstandeditor.api.interfaces.OpenMenuEvent; | ||
import io.github.rypofalem.armorstandeditor.menu.EditorMenu; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.HandlerList; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class MainMenuOpenedEvent extends OpenMenuEvent implements Cancellable { | ||
|
||
@Getter | ||
@Setter | ||
private boolean isCancelled = false; | ||
|
||
@Getter | ||
protected final Player player; | ||
|
||
@Getter | ||
protected final EditorMenu edtMenu; | ||
|
||
private static final HandlerList HANDLERS = new HandlerList(); | ||
|
||
public MainMenuOpenedEvent(Player player, EditorMenu edtMenu) { | ||
super(player, edtMenu); | ||
this.player = player; | ||
this.edtMenu = edtMenu; | ||
} | ||
|
||
@Override | ||
public @NotNull HandlerList getHandlers() { | ||
return HANDLERS; | ||
} | ||
public static HandlerList getHandlerList() { | ||
return HANDLERS; | ||
} | ||
@Override | ||
public boolean isCancelled() { | ||
return this.isCancelled; | ||
} | ||
|
||
@Override | ||
public void setCancelled(boolean isCancelled) { | ||
this.isCancelled = isCancelled; | ||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/io/github/rypofalem/armorstandeditor/menu/MainMenu.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package io.github.rypofalem.armorstandeditor.menu; | ||
|
||
import io.github.rypofalem.armorstandeditor.PlayerEditor; | ||
import io.github.rypofalem.armorstandeditor.devtools.Debug; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.entity.ArmorStand; | ||
import org.bukkit.inventory.Inventory; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import static net.kyori.adventure.text.Component.text; | ||
|
||
public class MainMenu implements EditorMenu{ | ||
|
||
private final Inventory menuInv; | ||
private final PlayerEditor pe; | ||
private String name; | ||
private Debug debug; | ||
|
||
public MainMenu(Inventory menuInv, PlayerEditor pe) { | ||
this.menuInv = menuInv; | ||
this.pe = pe; | ||
name = pe.plugin.getLanguage().getMessage("mainmenutitle","menutitle"); | ||
menuInv = Bukkit.createInventory(pe.getPlayer(),54,name); | ||
|
||
} | ||
|
||
@Override | ||
public void open() { | ||
|
||
} | ||
|
||
@Override | ||
public void fillInventory() { | ||
|
||
} | ||
|
||
@Override | ||
public ArmorStand getArmorStand() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public @NotNull Inventory getInventory() { | ||
return null; | ||
} | ||
} |