This repository has been archived by the owner on Dec 13, 2021. It is now read-only.
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
8383f43
commit 997d42f
Showing
7 changed files
with
95 additions
and
4 deletions.
There are no files selected for viewing
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
36 changes: 36 additions & 0 deletions
36
src/dk/simonmaribo/endcrate/listener/EndCratePreviewClickEvent.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,36 @@ | ||
/* | ||
AUTHOR: FlupMC | ||
CONTRIBUTORS: Steilgaard | ||
WEBSITE: simonmaribo.dk | ||
SUPPORT: discord.simonmaribo.dk | ||
Copyright 2021 © Simon Maribo | ||
*/ | ||
package dk.simonmaribo.endcrate.listener; | ||
|
||
import dk.simonmaribo.endcrate.Main; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.inventory.InventoryClickEvent; | ||
|
||
public class EndCratePreviewClickEvent implements Listener { | ||
private Main main; | ||
|
||
public EndCratePreviewClickEvent(Main main) { | ||
this.main = main; | ||
} | ||
|
||
@EventHandler | ||
public void onEndCratePreviewClick(InventoryClickEvent event){ | ||
Player player = (Player) event.getWhoClicked(); | ||
if(event.getClickedInventory().getTitle() == Main.rc.getPreview().getTitle()){ | ||
if (String.valueOf(event.getClickedInventory()).replaceAll("Custom", "").equals(String.valueOf(Main.rc.getPreview()).replaceAll("Custom", ""))) { | ||
event.setCancelled(true); | ||
} | ||
} | ||
|
||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/dk/simonmaribo/endcrate/listener/EntityClickEvent.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 @@ | ||
/* | ||
AUTHOR: FlupMC | ||
CONTRIBUTORS: Steilgaard | ||
WEBSITE: simonmaribo.dk | ||
SUPPORT: discord.simonmaribo.dk | ||
Copyright 2021 © Simon Maribo | ||
*/ | ||
|
||
package dk.simonmaribo.endcrate.listener; | ||
|
||
import dk.simonmaribo.endcrate.Main; | ||
import org.bukkit.entity.ArmorStand; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.player.PlayerInteractAtEntityEvent; | ||
|
||
public class EntityClickEvent implements Listener { | ||
private Main main; | ||
public EntityClickEvent(Main main){ | ||
this.main = main; | ||
} | ||
|
||
@EventHandler | ||
public void onArmorStandClick(PlayerInteractAtEntityEvent event){ | ||
if(!(event.getRightClicked() instanceof ArmorStand)) return; | ||
|
||
if(Main.getArmorStandList().contains((ArmorStand) event.getRightClicked())) event.setCancelled(true); | ||
|
||
} | ||
} |
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