3
0
Fork 0

Bumped to v3.2.3
All checks were successful
Plugins/ThemeParkPlus/pipeline/head This commit looks good

This commit is contained in:
Stijn Bannink 2023-10-12 20:37:53 +02:00
parent d71f9a0fca
commit 10754f8119
3 changed files with 16 additions and 18 deletions

View file

@ -6,7 +6,7 @@
<groupId>nl.SBDeveloper</groupId>
<artifactId>ThemeParkPlus</artifactId>
<version>3.2.1</version>
<version>3.2.3</version>
<packaging>jar</packaging>
<name>ThemeParkPlus</name>

View file

@ -1,31 +1,33 @@
package nl.sbdeveloper.themeparkplus.util;
import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Directional;
import org.bukkit.block.data.Lightable;
import org.bukkit.block.data.Openable;
import org.jetbrains.annotations.NotNull;
public class LGUtil {
private static final BlockData lampAanData = Bukkit.createBlockData(XMaterial.REDSTONE_LAMP.parseMaterial(), "lit=true");
private static final BlockData lampUitData = Bukkit.createBlockData(XMaterial.REDSTONE_LAMP.parseMaterial(), "lit=false");
private LGUtil() {}
public static boolean zetLampAan(Block lampBlock) {
if ((isLamp(lampBlock)) && (!isAan(lampBlock))) {
lampBlock.setBlockData(lampAanData);
if (isLamp(lampBlock)) {
Lightable lb = (Lightable) lampBlock.getBlockData();
if (lb.isLit()) return false;
lb.setLit(true);
lampBlock.setBlockData(lb);
return true;
}
return false;
}
public static boolean zetLampUit(Block lampBlock) {
if ((isLamp(lampBlock)) && (isAan(lampBlock))) {
lampBlock.setBlockData(lampUitData);
if (isLamp(lampBlock)) {
Lightable lb = (Lightable) lampBlock.getBlockData();
if (!lb.isLit()) return false;
lb.setLit(false);
lampBlock.setBlockData(lb);
return true;
}
return false;
@ -84,14 +86,10 @@ public class LGUtil {
}
public static boolean isOpenable(@NotNull Block b) {
return b.getBlockData() instanceof org.bukkit.block.data.Openable;
return b.getBlockData() instanceof Openable;
}
private static boolean isAan(Block lamp) {
return lamp.getBlockData().getAsString().contains("lit=true");
}
private static boolean isLamp(Block lamp) {
return lamp.getType() == XMaterial.REDSTONE_LAMP.parseMaterial();
private static boolean isLamp(Block b) {
return b.getBlockData() instanceof Lightable;
}
}

View file

@ -56,7 +56,7 @@ DiscordWebhook:
WebhookURL: ""
Embed:
Title: "%RideName% - Status change"
Copyright: "Copyright ThemePark 2020"
Copyright: "Copyright ThemePark 2023"
CopyrightImage: "https://www.spigotmc.org/data/resource_icons/48/48648.jpg?1544984106"
Colors:
OPEN: 0x55FF55