Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
8ecb6e173f
Commit
13afc55b1f
@ -26,6 +26,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Lectern;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BookMeta;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
@ -91,7 +92,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (lectern.getPage() < pages) {
|
||||
lectern.setPage(lectern.getPage() + 1);
|
||||
parent.update(blockData);
|
||||
@ -116,7 +119,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (1 <= pages) {
|
||||
lectern.setPage(1);
|
||||
parent.update(blockData);
|
||||
@ -141,7 +146,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (2 <= pages) {
|
||||
lectern.setPage(2);
|
||||
parent.update(blockData);
|
||||
@ -166,7 +173,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (3 <= pages) {
|
||||
lectern.setPage(3);
|
||||
parent.update(blockData);
|
||||
@ -191,7 +200,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (4 <= pages) {
|
||||
lectern.setPage(4);
|
||||
parent.update(blockData);
|
||||
@ -216,7 +227,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (5 <= pages) {
|
||||
lectern.setPage(5);
|
||||
parent.update(blockData);
|
||||
@ -241,7 +254,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (6 <= pages) {
|
||||
lectern.setPage(6);
|
||||
parent.update(blockData);
|
||||
@ -266,7 +281,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (7 <= pages) {
|
||||
lectern.setPage(7);
|
||||
parent.update(blockData);
|
||||
@ -291,7 +308,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (8 <= pages) {
|
||||
lectern.setPage(8);
|
||||
parent.update(blockData);
|
||||
@ -316,7 +335,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (9 <= pages) {
|
||||
lectern.setPage(9);
|
||||
parent.update(blockData);
|
||||
@ -341,7 +362,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (10 <= pages) {
|
||||
lectern.setPage(10);
|
||||
parent.update(blockData);
|
||||
@ -366,7 +389,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (11 <= pages) {
|
||||
lectern.setPage(11);
|
||||
parent.update(blockData);
|
||||
@ -391,7 +416,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (12 <= pages) {
|
||||
lectern.setPage(12);
|
||||
parent.update(blockData);
|
||||
@ -416,7 +443,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (13 <= pages) {
|
||||
lectern.setPage(13);
|
||||
parent.update(blockData);
|
||||
@ -441,7 +470,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (14 <= pages) {
|
||||
lectern.setPage(14);
|
||||
parent.update(blockData);
|
||||
@ -466,7 +497,9 @@ public class LoaderLectern extends LoaderInteractionElement<LoaderLectern.Lecter
|
||||
public void execute(Location location, org.bukkit.block.data.type.Lectern blockData, LoaderLectern parent, int power, long ticks, Consumer<Long> delay) {
|
||||
if (!blockData.hasBook()) return;
|
||||
Lectern lectern = (Lectern) location.getBlock().getState();
|
||||
int pages = ((BookMeta) lectern.getInventory().getItem(0).getItemMeta()).getPages().size();
|
||||
ItemStack itemStack = lectern.getInventory().getItem(0);
|
||||
if (itemStack == null) return;
|
||||
int pages = ((BookMeta) itemStack.getItemMeta()).getPages().size();
|
||||
if (15 <= pages) {
|
||||
lectern.setPage(15);
|
||||
parent.update(blockData);
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren