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.
[CORE] Re-Implement APIs. Add 2 new APIs for the Menus and Move Prote…
…ctions to the API folder. Add Lombok as Dependency Signed-off-by: Wolfieheart <[email protected]>
- Loading branch information
1 parent
9ef2f62
commit 9d190a3
Showing
14 changed files
with
349 additions
and
0 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
8 changes: 8 additions & 0 deletions
8
src/main/java/io/github/rypofalem/armorstandeditor/api/Protections.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,8 @@ | ||
package io.github.rypofalem.armorstandeditor.api; | ||
|
||
import org.bukkit.block.Block; | ||
import org.bukkit.entity.Player; | ||
|
||
public interface Protections { | ||
boolean checkPermission(Block block, Player player); | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/io/github/rypofalem/armorstandeditor/api/events/ArmorStandEvent.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,16 @@ | ||
package io.github.rypofalem.armorstandeditor.api.events; | ||
import lombok.Getter; | ||
|
||
import org.bukkit.entity.ArmorStand; | ||
import org.bukkit.event.Event; | ||
|
||
public abstract class ArmorStandEvent extends Event { | ||
|
||
@Getter | ||
protected final ArmorStand armorStand; | ||
|
||
protected ArmorStandEvent(ArmorStand armorStand) { | ||
this.armorStand = armorStand; | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
...main/java/io/github/rypofalem/armorstandeditor/api/events/ArmorStandManipulatedEvent.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 @@ | ||
package io.github.rypofalem.armorstandeditor.api.events; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import org.bukkit.entity.ArmorStand; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.HandlerList; | ||
|
||
public class ArmorStandManipulatedEvent extends ArmorStandEvent implements Cancellable { | ||
|
||
@Getter | ||
@Setter | ||
private boolean cancelled = false; | ||
|
||
@Getter | ||
protected final Player player; | ||
|
||
public ArmorStandManipulatedEvent(ArmorStand armorStand, Player player) { | ||
super(armorStand); | ||
this.player = player; | ||
} | ||
|
||
/* Generated for Bukkit */ | ||
private static final HandlerList handlers = new HandlerList(); | ||
|
||
public static HandlerList getHandlerList() { | ||
return (handlers); | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() { | ||
return (handlers); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/main/java/io/github/rypofalem/armorstandeditor/api/events/ArmorStandRenameEvent.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,41 @@ | ||
package io.github.rypofalem.armorstandeditor.api.events; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import org.bukkit.entity.ArmorStand; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.HandlerList; | ||
|
||
public class ArmorStandRenameEvent extends ArmorStandEvent implements Cancellable { | ||
|
||
@Getter | ||
@Setter | ||
private boolean cancelled = false; | ||
@Getter | ||
@Setter | ||
protected String name; | ||
|
||
@Getter | ||
protected final Player player; | ||
|
||
public ArmorStandRenameEvent(ArmorStand armorStand, Player player, String name) { | ||
super(armorStand); | ||
this.player = player; | ||
this.name = name; | ||
} | ||
|
||
/* Generated for Bukkit */ | ||
private static final HandlerList handlers = new HandlerList(); | ||
|
||
public static HandlerList getHandlerList() { | ||
return (handlers); | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() { | ||
return (handlers); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/io/github/rypofalem/armorstandeditor/api/events/ArmorStandTargetedEvent.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,35 @@ | ||
package io.github.rypofalem.armorstandeditor.api.events; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import org.bukkit.entity.ArmorStand; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.HandlerList; | ||
|
||
public class ArmorStandTargetedEvent extends ArmorStandEvent implements Cancellable { | ||
@Getter | ||
@Setter | ||
private boolean cancelled = false; | ||
|
||
@Getter | ||
protected final Player player; | ||
|
||
public ArmorStandTargetedEvent(ArmorStand armorStand, Player player) { | ||
super(armorStand); | ||
this.player = player; | ||
} | ||
|
||
/* Generated for Bukkit */ | ||
private static final HandlerList handlers = new HandlerList(); | ||
|
||
public static HandlerList getHandlerList() { | ||
return (handlers); | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() { | ||
return (handlers); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/io/github/rypofalem/armorstandeditor/api/events/ItemFrameEvent.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,17 @@ | ||
package io.github.rypofalem.armorstandeditor.api.events; | ||
|
||
import lombok.Getter; | ||
|
||
import org.bukkit.entity.ItemFrame; | ||
import org.bukkit.event.Event; | ||
|
||
public abstract class ItemFrameEvent extends Event { | ||
|
||
@Getter | ||
protected final ItemFrame itemFrame; | ||
|
||
protected ItemFrameEvent(ItemFrame itemFrame) { | ||
this.itemFrame = itemFrame; | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/io/github/rypofalem/armorstandeditor/api/events/ItemFrameManipulatedEvent.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,37 @@ | ||
package io.github.rypofalem.armorstandeditor.api.events; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import org.bukkit.entity.ItemFrame; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.HandlerList; | ||
|
||
public class ItemFrameManipulatedEvent extends ItemFrameEvent implements Cancellable { | ||
|
||
@Getter | ||
@Setter | ||
private boolean cancelled = false; | ||
|
||
@Getter | ||
protected final Player player; | ||
|
||
public ItemFrameManipulatedEvent(ItemFrame itemFrame, Player player) { | ||
super(itemFrame); | ||
this.player = player; | ||
} | ||
|
||
/* Generated for Bukkit */ | ||
private static final HandlerList handlers = new HandlerList(); | ||
|
||
public static HandlerList getHandlerList() { | ||
return (handlers); | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() { | ||
return (handlers); | ||
} | ||
} | ||
|
35 changes: 35 additions & 0 deletions
35
src/main/java/io/github/rypofalem/armorstandeditor/api/events/ItemFrameTargetedEvent.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,35 @@ | ||
package io.github.rypofalem.armorstandeditor.api.events; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import org.bukkit.entity.ItemFrame; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.HandlerList; | ||
|
||
public class ItemFrameTargetedEvent extends ItemFrameEvent implements Cancellable { | ||
@Getter | ||
@Setter | ||
private boolean cancelled = false; | ||
|
||
@Getter | ||
protected final Player player; | ||
|
||
public ItemFrameTargetedEvent(ItemFrame itemFrame, Player player) { | ||
super(itemFrame); | ||
this.player = player; | ||
} | ||
|
||
/* Generated for Bukkit */ | ||
private static final HandlerList handlers = new HandlerList(); | ||
|
||
public static HandlerList getHandlerList() { | ||
return (handlers); | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() { | ||
return (handlers); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/io/github/rypofalem/armorstandeditor/api/events/PlayerOpenMenuEvent.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,34 @@ | ||
package io.github.rypofalem.armorstandeditor.api.events; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
|
||
public class PlayerOpenMenuEvent extends Event implements Cancellable { | ||
@Getter | ||
@Setter | ||
private boolean cancelled = false; | ||
|
||
@Getter | ||
protected final Player player; | ||
|
||
public PlayerOpenMenuEvent(Player player) { | ||
this.player = player; | ||
} | ||
|
||
/* Generated for Bukkit */ | ||
private static final HandlerList handlers = new HandlerList(); | ||
|
||
public static HandlerList getHandlerList() { | ||
return (handlers); | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() { | ||
return (handlers); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...a/io/github/rypofalem/armorstandeditor/api/events/editor/ArmorStandEditorOpenedEvent.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,17 @@ | ||
package io.github.rypofalem.armorstandeditor.api.events.editor; | ||
|
||
import io.github.rypofalem.armorstandeditor.menu.EditorMenu; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
|
||
public class ArmorStandEditorOpenedEvent extends EditorMenuEvent implements Cancellable { | ||
@Getter | ||
@Setter | ||
private boolean cancelled = false; | ||
|
||
public ArmorStandEditorOpenedEvent(Player player, EditorMenu menu) { | ||
super(player, menu); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/io/github/rypofalem/armorstandeditor/api/events/editor/EditorMenuEvent.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,34 @@ | ||
package io.github.rypofalem.armorstandeditor.api.events.editor; | ||
|
||
import io.github.rypofalem.armorstandeditor.menu.EditorMenu; | ||
import lombok.Getter; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class EditorMenuEvent extends Event { | ||
|
||
@Getter | ||
private final Player player; | ||
@Getter | ||
private final EditorMenu menu; | ||
|
||
private static final HandlerList HANDLERS = new HandlerList(); | ||
|
||
public EditorMenuEvent(Player player, EditorMenu menu){ | ||
this.player = player; | ||
this.menu = menu; | ||
} | ||
|
||
@Override | ||
public @NotNull HandlerList getHandlers() { | ||
return HANDLERS; | ||
} | ||
|
||
public static HandlerList getHandlerList() { | ||
return HANDLERS; | ||
} | ||
|
||
|
||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/io/github/rypofalem/armorstandeditor/playereditor/PlayerEditor.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,18 @@ | ||
package io.github.rypofalem.armorstandeditor.playereditor; | ||
|
||
import io.github.rypofalem.armorstandeditor.ArmorStandEditorPlugin; | ||
|
||
//TODO: To be Refactored | ||
public class PlayerEditor { | ||
|
||
public final ArmorStandEditorPlugin plugin; | ||
|
||
public PlayerEditor(ArmorStandEditorPlugin plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
public PlayerEditorManager getManager(){ | ||
return plugin.editorManager; | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/io/github/rypofalem/armorstandeditor/playereditor/PlayerEditorManager.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,13 @@ | ||
package io.github.rypofalem.armorstandeditor.playereditor; | ||
|
||
//TODO: To be Refactored | ||
|
||
import io.github.rypofalem.armorstandeditor.menu.ASEHolder; | ||
import org.bukkit.event.EventHandler; | ||
|
||
public class PlayerEditorManager { | ||
|
||
@EventHandler | ||
private void onEditorOpened() | ||
|
||
} |