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