From 16a46a6a35c796b254e1c26df6261b08c4016204 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Sun, 9 May 2021 22:00:12 +0200 Subject: [PATCH] Implemented Objects to work with --- .../LinkedBeaconTeleporter.java | 20 +++++++++++++++++++ .../LinkedBeaconTeleporterBlock.java | 18 +++++++++++++++++ .../LinkedBeaconTeleporterItem.java | 17 ++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporter.java create mode 100644 src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterBlock.java create mode 100644 src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterItem.java diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporter.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporter.java new file mode 100644 index 0000000..243cda0 --- /dev/null +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporter.java @@ -0,0 +1,20 @@ +package eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter; + +import org.bukkit.Location; + +/** + * Describes a placed-beacon-teleporter in the world + */ +public abstract class LinkedBeaconTeleporter { + + // Persistent id for linked-beacons + public String teleporterId; + + public LinkedBeaconTeleporter(String teleporterId){ + this.teleporterId = teleporterId; + } + + public String teleporterId(){ + return teleporterId; + } +} diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterBlock.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterBlock.java new file mode 100644 index 0000000..5a486af --- /dev/null +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterBlock.java @@ -0,0 +1,18 @@ +package eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter; + +import org.bukkit.block.Block; +import org.bukkit.block.BlockState; + +public class LinkedBeaconTeleporterBlock extends LinkedBeaconTeleporter { + Block block; + + public LinkedBeaconTeleporterBlock(String teleporterId, Block block) { + super(teleporterId); + + this.block = block; + } + + public Block block(){ + return block; + } +} diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterItem.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterItem.java new file mode 100644 index 0000000..a39edd9 --- /dev/null +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterItem.java @@ -0,0 +1,17 @@ +package eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter; + +import org.bukkit.inventory.ItemStack; + +public class LinkedBeaconTeleporterItem extends LinkedBeaconTeleporter { + ItemStack item; + + public LinkedBeaconTeleporterItem(String teleporterId, ItemStack item) { + super(teleporterId); + + this.item = item; + } + + public ItemStack item(){ + return item; + } +}