From 9f4b70a0efbaff8d023420791250734be42fadf9 Mon Sep 17 00:00:00 2001 From: Sekwah Date: Mon, 30 Dec 2019 14:52:00 +0000 Subject: [PATCH] Basic edits, though seems to work in 1.15 --- build.gradle | 8 +- out/production/resources/config.yml | 90 +++++++++++++++++++ out/production/resources/destinations.yml | 7 ++ out/production/resources/plugin.yml | 55 ++++++++++++ out/production/resources/portals.yml | 19 ++++ .../advancedportals/portals/Portal.java | 2 +- 6 files changed, 176 insertions(+), 5 deletions(-) create mode 100644 out/production/resources/config.yml create mode 100644 out/production/resources/destinations.yml create mode 100644 out/production/resources/plugin.yml create mode 100644 out/production/resources/portals.yml diff --git a/build.gradle b/build.gradle index 284b45a..98ccc31 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ repositories { // includeLibs just says to include the library in the final jar dependencies { - compile "org.bukkit:bukkit:1.14.1-R0.1-SNAPSHOT" + compile "org.bukkit:bukkit:1.15.1-R0.1-SNAPSHOT" compile "io.netty:netty-all:4.0.4.Final" } @@ -57,7 +57,7 @@ task copyPlugin { include "*.jar" } } - catch(UnableToDeleteFileException e) { + catch(RuntimeException e) { println e.getLocalizedMessage() } from file("$buildDir/libs/Advanced-Portals-${version}.jar") @@ -71,7 +71,7 @@ task copyPlugin { task runJar() { doLast { if(System.env.MC_SERVER_LOC == null || System.env.MC_SERVER_JAR == null) { - throw new GradleException('You must set the server location and jar to use') + throw new GradleException('You must set the server location and jar to use MC_SERVER_LOC and MC_SERVER_JAR') } javaexec { main "-jar" @@ -80,4 +80,4 @@ task runJar() { workingDir "${System.env.MC_SERVER_LOC}" } } -} \ No newline at end of file +} diff --git a/out/production/resources/config.yml b/out/production/resources/config.yml new file mode 100644 index 0000000..3d50c78 --- /dev/null +++ b/out/production/resources/config.yml @@ -0,0 +1,90 @@ +# Advanced Portals Config + +# To set this file back to its default state just delete it and reload the server or restart it! + + + +# Set to true if you want the normal axes to work normally but the ones gived with /portals selector or wand will still work though +# It can be usefull if people with permission want to use an iron axe on a survival server +UseOnlyServerMadeAxe: false + +# Preferably an item and not a block but it shouldnt matter +AxeItemId: IRON_AXE + +# Will be implemented so you can give yourself the portal block and build manually with it so its easier to make portals with the portal block. +CanBuildPortalBlock: true + +# Defines if portals protect themselves +PortalProtection: true + +# How many blocks around the portals will be protected from griefing or destruction +PortalProtectionRadius: 5 + +# What the default trigger block is for portals if nothing is defined. +DefaultPortalTriggerBlock: PORTAL + +# This stops all water flowing inside a portal area(can be disabled if something like world edit is handelling the water flow or you dont want it active) +# you want to +StopWaterFlow: true + +# This must be a placeable block or it will not work and may even crash +ShowSelectionBlockID: RED_STAINED_GLASS + +# WarpEffect +# 0 = disabled(no particles) +# 1 = Eye of ender explode effect(loads of portal particles) +# adding more soon and may create some custom ones +WarpParticles: 1 + +# WarpSound generally suggested to keep the same as warpeffect but can usually be used for just the sound and no particle effects +# 0 = disabled(no sound) +# 1 = Enderman Warp Sound +# adding more soon +WarpSound: 1 + +# In case you want to show the bungee attempting warp message +ShowBungeeWarpMessage: false + +# This changes how long the show seletion lasts in seconds + +ShowSelectionShowDuration: 10 + +# Where to display the message 0 = disabled(replaces PortalWarpMessages), 1 = in chat and 2 = action bar(1.8 and above only, anything lower will print the message that would +# generally on the action bar in the chat without a prefix or extra chat formatting) +WarpMessageDisplay: 2 + +# Use plugin name in the warp messages +UseWarpPrefix: true + +# If this is true a custom prefix can be used, (not fully coded yet!!) + +UseCustomPrefix: false + +CustomPrefix: '&a[&eAdvancedPortals&a]' + +CustomPrefixFail: '&c[&7AdvancedPortals&c]' + +BlockSpectatorMode: false + +PortalCooldown: 5 # How long after trying to enter a portal until the player can try to enter another. 0 or lower to deactivate. +ThrowbackAmount: 0.7 # How fast to throw them back, 0 or lower to disable throwback + +# Experimental, works but not all the time (Entities don't seem to be provided in the event sometimes or something is wrong) +# We have no plans to further this but if anyone has any tips feel free to contact us here https://discord.gg/25QZVVn +DisableGatewayBeam: false + +# Letters are flags. Include them to activate. n always disables everything, remove if you want it to work. +# Lettering may not make too much sense but meh its useful. Examples are "ocpk" or "cop" (doesnt matter order) +# +# Remember enabling this means potentially admins could leave a portal lying around which could let them reop themselves. +# If you think this may be an issue use a permission plugin and specifically give the users you trust permissions. +# +# n Disabled none, best just put this to really make sure the fact none are here is specified. It disables any others too +# o Admin Heighten Enabled Permission advancedportals.createportal.commandlevel.op +# p Perm Heighten Enabled Permission advancedportals.createportal.commandlevel.perms +# c Console Heighten Enabled Permission advancedportals.createportal.commandlevel.console +# h Ops can create admin commands without special perms +# e Ops can create all perm commands without special perms +# k Ops can create console commands without special perms +# +CommandLevels: opchek diff --git a/out/production/resources/destinations.yml b/out/production/resources/destinations.yml new file mode 100644 index 0000000..2d66a84 --- /dev/null +++ b/out/production/resources/destinations.yml @@ -0,0 +1,7 @@ + +# ExampleDestination: +# world: it will be the world name +# pos: +# X: +# Y: +# Z: diff --git a/out/production/resources/plugin.yml b/out/production/resources/plugin.yml new file mode 100644 index 0000000..38a8537 --- /dev/null +++ b/out/production/resources/plugin.yml @@ -0,0 +1,55 @@ +main: com.sekwah.advancedportals.AdvancedPortalsPlugin +name: AdvancedPortals +version: 0.2.1 +author: sekwah41 +description: An advanced portals plugin for bukkit. +api-version: 1.13 +commands: + advancedportals: + description: The main command for the advanced portals + aliases: [portals, aportals, portal, ap] + usage: / + destination: + description: Can be used to access portal destinations. + aliases: [desti] + usage: / +permissions: + advancedportals.*: + description: Gives access to all commands + default: op + children: + advancedportals.createportal: true + advancedportals.portal: true + advancedportals.build: true + advancedportals.desti: true + advancedportals.createportal: + description: Allows you to create portals + default: op + advancedportals.createportal.commandlevel.*: + description: Gives access to all level raisers + default: false + children: + advancedportals.createportal.commandlevel.op: true + advancedportals.createportal.commandlevel.perms: true + advancedportals.createportal.commandlevel.console: true + advancedportals.createportal.commandlevel.op: + description: Allows you to increase the users level temporaily to op + default: false + advancedportals.createportal.commandlevel.perms: + description: Allows you to increase the users level temporaily to have all perms + default: false + advancedportals.createportal.commandlevel.console: + description: Executes command in the console + default: false + advancedportals.portal: + description: Allows use of portal commands + default: op + advancedportals.build: + description: Allows you to build in the portal regions + default: op + advancedportals.desti: + description: Gives access to all desti commands + default: op + advancedportals.warp.*: + description: Access to all warps (not really used tbh) + default: op diff --git a/out/production/resources/portals.yml b/out/production/resources/portals.yml new file mode 100644 index 0000000..2238a58 --- /dev/null +++ b/out/production/resources/portals.yml @@ -0,0 +1,19 @@ + +# ExamplePortal: +# world: it will be the world name +# triggerblock: LAVA # will only be used if the hastriggerblock is true and can be id or text +# pos1: # dont mess with the data here, if you do it may stop the portal from working. +# X: +# Y: +# Z: +# pos2: +# X: +# Y: +# Z: +# destination: +# issetpoint: true # if this was false point name would not be used and the coordinates would be saved here, it just adds more customisation. +# pointname: examplepoint # if issetpoint is false this wont be here and tppos will be. +# tppos: +# X: +# Y: +# Z: diff --git a/src/main/java/com/sekwah/advancedportals/portals/Portal.java b/src/main/java/com/sekwah/advancedportals/portals/Portal.java index 556b0c9..59ea32d 100644 --- a/src/main/java/com/sekwah/advancedportals/portals/Portal.java +++ b/src/main/java/com/sekwah/advancedportals/portals/Portal.java @@ -388,7 +388,7 @@ public class Portal { int diff = (int) ((System.currentTimeMillis() - cooldown.get(player.getName())) / 1000); if (diff < cooldelay) { int time = (cooldelay - diff); - player.sendMessage(ChatColor.RED + "Please wait " + ChatColor.YELLOW + time + ChatColor.RED + (time == 1 ? "second" : "seconds") + " until attempting to enter this portal again."); + player.sendMessage(ChatColor.RED + "Please wait " + ChatColor.YELLOW + time + ChatColor.RED + (time == 1 ? " second" : " seconds") + " until attempting to enter this portal again."); failSound(player, portal); throwPlayerBack(player); return false;