This repository was archived by the owner on Dec 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59871fc
commit 1dc16fe
Showing
10 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
.idea/libraries/Maven__com_arcaniax_HeadDatabase_API_1_3_0.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
28 changes: 28 additions & 0 deletions
28
src/main/java/me/xiaozhangup/natunology/techcore/views/MainTap.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,28 @@ | ||
package me.xiaozhangup.natunology.techcore.views; | ||
|
||
import me.xiaozhangup.natunology.api.Message; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.inventory.InventoryClickEvent; | ||
import org.bukkit.inventory.Inventory; | ||
import org.bukkit.inventory.InventoryHolder; | ||
|
||
public class MainTap implements Listener { | ||
|
||
public static void openMainTap(Player p) { | ||
Inventory inventory = Bukkit.createInventory(new Menukey() , 54 , Message.color("&8&lNatunology 指导书")); | ||
p.openInventory(inventory); | ||
} | ||
|
||
@EventHandler | ||
public void onInvClick(InventoryClickEvent e) { | ||
if (!(e.getWhoClicked() instanceof Player)) return; | ||
Player player = (Player) e.getWhoClicked(); | ||
InventoryHolder holder = player.getOpenInventory().getTopInventory().getHolder(); | ||
if(holder instanceof Menukey) { | ||
e.setCancelled(true); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/me/xiaozhangup/natunology/techcore/views/Menukey.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,14 @@ | ||
package me.xiaozhangup.natunology.techcore.views; | ||
|
||
import org.bukkit.inventory.Inventory; | ||
import org.bukkit.inventory.InventoryHolder; | ||
|
||
public class Menukey implements InventoryHolder { | ||
|
||
private Inventory inv; | ||
|
||
@Override | ||
public Inventory getInventory() { | ||
return inv; | ||
} | ||
} |
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