-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #221 from FreakyFreakyNerd/master
[feature] Anvil GUI
- Loading branch information
Showing
6 changed files
with
450 additions
and
6 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
generic/src/main/java/net/swofty/types/generic/event/actions/player/ActionAnvilClick.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,33 @@ | ||
package net.swofty.types.generic.event.actions.player; | ||
|
||
import net.minestom.server.coordinate.Point; | ||
import net.minestom.server.event.Event; | ||
import net.minestom.server.event.player.PlayerBlockInteractEvent; | ||
import net.minestom.server.instance.Instance; | ||
import net.swofty.types.generic.event.EventNodes; | ||
import net.swofty.types.generic.event.EventParameters; | ||
import net.swofty.types.generic.event.SkyBlockEvent; | ||
import net.swofty.types.generic.gui.inventory.inventories.GUIAnvil; | ||
import net.swofty.types.generic.gui.inventory.inventories.GUIChest; | ||
import net.swofty.types.generic.item.ChestImpl; | ||
import net.swofty.types.generic.user.SkyBlockPlayer; | ||
|
||
@EventParameters(description = "Handles clicking on the Anvil", | ||
node = EventNodes.PLAYER, | ||
requireDataLoaded = true) | ||
public class ActionAnvilClick extends SkyBlockEvent { | ||
@Override | ||
public Class<? extends Event> getEvent() { | ||
return PlayerBlockInteractEvent.class; | ||
} | ||
|
||
@Override | ||
public void run(Event tempEvent) { | ||
PlayerBlockInteractEvent event = (PlayerBlockInteractEvent) tempEvent; | ||
|
||
SkyBlockPlayer player = (SkyBlockPlayer) event.getPlayer(); | ||
if (!event.getBlock().name().equals("minecraft:anvil")) return; | ||
|
||
new GUIAnvil().open(player); | ||
} | ||
} |
Oops, something went wrong.