1.20.1
This commit is contained in:
parent
455b5ebb8d
commit
09be9e5e46
|
|
@ -41,10 +41,10 @@ tasks {
|
|||
file.parentFile.mkdirs()
|
||||
}
|
||||
if (!file.exists()) {
|
||||
download("https://repo.destro.xyz/snapshots/com/alttd/Galaxy-Server/Galaxy-paperclip-1.19.2-R0.1-SNAPSHOT-reobf.jar", fileName)
|
||||
download("https://repo.destro.xyz/private/com/alttd/Galaxy-Server/Galaxy-paperclip-1.20.1-R0.1-SNAPSHOT-reobf.jar", fileName)
|
||||
}
|
||||
serverJar(file)
|
||||
minecraftVersion("1.19.2")
|
||||
minecraftVersion("1.20.1")
|
||||
}
|
||||
|
||||
jar {
|
||||
|
|
@ -71,7 +71,7 @@ publishing {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("com.alttd:Galaxy-API:1.19.2-R0.1-SNAPSHOT")
|
||||
compileOnly("com.alttd:Galaxy-API:1.20.1-R0.1-SNAPSHOT")
|
||||
compileOnly("com.github.milkbowl:VaultAPI:1.7") {
|
||||
exclude("org.bukkit","bukkit")
|
||||
}
|
||||
|
|
@ -102,9 +102,10 @@ bukkit {
|
|||
name = rootProject.name
|
||||
main = "$group.${rootProject.name}"
|
||||
version = "${rootProject.version}-${gitCommit()}"
|
||||
apiVersion = "1.19"
|
||||
apiVersion = "1.19" // todo update to 1.20
|
||||
authors = listOf("destro174")
|
||||
depend = listOf("Vault", "GriefPrevention")
|
||||
depend = listOf("Vault")
|
||||
softDepend = listOf("GriefPrevention")
|
||||
|
||||
permissions {
|
||||
register("playershops.admin") {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import org.bukkit.block.data.BlockData;
|
|||
import org.bukkit.block.data.Directional;
|
||||
import org.bukkit.block.data.Rotatable;
|
||||
import org.bukkit.block.data.type.WallSign;
|
||||
import org.bukkit.block.sign.Side;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
|
@ -78,12 +79,10 @@ public class PlayerListener extends EventListener {
|
|||
public void onShopCreation(SignChangeEvent event) {
|
||||
if(!this.isRegistered)
|
||||
return;
|
||||
|
||||
Block b = event.getBlock();
|
||||
Player player = event.getPlayer();
|
||||
if (!(b.getState() instanceof Sign))
|
||||
return;
|
||||
|
||||
BlockFace facing;
|
||||
BlockData data = b.getState().getBlockData();
|
||||
if (data instanceof WallSign) {
|
||||
|
|
@ -96,6 +95,8 @@ public class PlayerListener extends EventListener {
|
|||
|
||||
if (shopHandler.isShopMaterial(bRelative)) {
|
||||
Sign signBlock = (Sign) b.getState();
|
||||
if (signBlock.isWaxed())
|
||||
return;
|
||||
Component signLine = event.line(0);
|
||||
if (signLine == null)
|
||||
return;
|
||||
|
|
@ -139,6 +140,7 @@ public class PlayerListener extends EventListener {
|
|||
EconomyUtils.removeFunds(player, Config.shopCreationBalance);
|
||||
shopHandler.addShop(playerShop);
|
||||
PlayerShops.getInstance().getDatabaseHelper().createShop(playerShop);
|
||||
signBlock.setWaxed(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ public class TransactionListener extends EventListener {
|
|||
String shopType = playerShop.getType().toString();
|
||||
if (!player.hasPermission("playershops.shop.use." + shopType)) {
|
||||
player.sendMiniMessage(MessageConfig.NO_PERMISSION_FOR_SHOP_TYPE, Placeholder.unparsed("shop_type", shopType));
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -80,10 +81,13 @@ public class TransactionListener extends EventListener {
|
|||
}
|
||||
|
||||
if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||
if (event.getPlayer().isSneaking() && (player.hasPermission("playershop.shop.check-stock") || playerShop.getOwnerUUID().equals(player.getUniqueId())))
|
||||
if (event.getPlayer().isSneaking() && (player.hasPermission("playershop.shop.check-stock") || playerShop.getOwnerUUID().equals(player.getUniqueId()))) {
|
||||
giveStockInfo(playerShop, player);
|
||||
else
|
||||
event.setCancelled(true);
|
||||
} else {
|
||||
giveInfo(playerShop, player);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -93,13 +97,17 @@ public class TransactionListener extends EventListener {
|
|||
|
||||
ShopManagementGui gui = new ShopManagementGui(player.getUniqueId(), playerShop);
|
||||
gui.open();
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!playerShop.isInitialized())
|
||||
if (!playerShop.isInitialized()) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
executeTransaction(player, playerShop);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
private void giveStockInfo(PlayerShop playerShop, Player player) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user