Skip to content

Commit

Permalink
fix: NPE without action bars
Browse files Browse the repository at this point in the history
  • Loading branch information
Thatsmusic99 committed Jun 4, 2023
1 parent 14992b4 commit fd2dc55
Show file tree
Hide file tree
Showing 5 changed files with 264 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,10 @@ public static void sendMessage(
) {
if (config == null) return;
if (sender instanceof Player player) {
ConfigSection titles = config.getConfigSection(path + "_title");
ConfigSection subtitles = config.getConfigSection(path + "_subtitle");
ConfigSection actionBars = config.getConfigSection(path + "_actionbar");

@Nullable ConfigSection titles = config.getConfigSection(path + "_title");
@Nullable ConfigSection subtitles = config.getConfigSection(path + "_subtitle");
@Nullable ConfigSection actionBars = config.getConfigSection(path + "_actionbar");
if (titles != null || subtitles != null || actionBars != null) {

// Fade in, stay, out
Expand Down Expand Up @@ -576,10 +577,8 @@ public void run() {

var component = Component.text();
if (config.get(path) instanceof List) {

// TODO - broken
config.getStringList(path).forEach(line -> appendNonEmpty(component, preProcess, line, placeholders));
} else appendNonEmpty(component, preProcess, path, placeholders);
config.getStringList(path).forEach(line -> component.append(get(preProcess.apply(line), placeholders)));
} else if (config.getString(path) != null) appendNonEmpty(component, preProcess, config.getString(path), placeholders);

if (component.content().isEmpty() && component.children().size() == 0) return;
asAudience(sender).sendMessage(component);
Expand Down
254 changes: 254 additions & 0 deletions AdvancedTeleport-Bukkit/target/classes/plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
main: io.github.niestrat99.advancedteleport.CoreClass
name: AdvancedTeleport
version: 5.6.8+DEV_${env.BUILD_NUMBER}
description: A rapidly growing teleportation plugin looking to break the boundaries of traditional teleport plugins.
authors: [Niestrat99, Thatsmusic99]
contributors: [SuspiciousLookingOwl (Github), animeavi (Github), MrEngMan, LucasMucGH (Github), jonas-t-s (Github)]
softdepend: [Vault, Ultimate_Economy, ConfigurationMaster, WorldBorder, ChunkyBorder, floodgate]
loadbefore: [Essentials, EssentialsSpawn]
api-version: 1.13

commands:
at:
description: The core AT command.
permission: at.member.core
warps:
description: Gives you a list of warps.
permission: at.member.warps
warp:
description: Teleports you to a specified warp.
permission: at.member.warp
usage: /warp <Warp name>
setwarp:
description: Sets a warp at your location.
permission: at.admin.setwarp
usage: /setwarp <Warp name>
delwarp:
description: Deletes a specified warp.
permission: at.admin.delwarp
usage: /delwarp <Warp name>
movewarp:
description: Moves a specified warp.
permission: at.admin.movewarp
usage: /movewarp <Warp name>
tpr:
description: Teleports you to a random place.
permission: at.member.tpr
aliases: rtp
usage: /tpr [World]
tpohere:
description: (ADMIN ONLY COMMAND) Instantly teleports a player to you.
permission: at.admin.tpohere
usage: /tpohere <Player>
tpaall:
description: (ADMIN ONLY COMMAND) Sends a "TPAHere"-request to every online player.
permission: at.admin.all
aliases: tpall
tpoff:
description: Stops you from receiving teleport requests.
permission: at.member.off
tpon:
description: Allows you to receive teleport requests.
permission: at.member.on
toggletp:
description: Lets you switch between receiving tp requests and not receiving them.
permission: at.member.toggletp
tpcancel:
description: Cancels a teleport request you've sent.
permission: at.member.cancel
tpunblock:
description: Unblocks a player.
permission: at.member.unblock
usage: /tpunblock <Player>
tpblock:
description: Blocks and prevents a player to send a teleport request to you.
permission: at.member.block
usage: /tpblock <Player>
tpdeny:
description: Declines a teleport request someone sent you.
permission: at.member.no
aliases: [tpano , tpno]
tpaccept:
description: Accepts a teleport request someone sent you.
permission: at.member.yes
aliases: [tpayes , tpyes]
usage: /tpaccept [Player]
tpo:
description: (ADMIN ONLY COMMAND) Instantly teleports you to another player.
permission: at.admin.tpo
usage: /tpo <Player>
tpahere:
description: Sends the targeted player a teleport requests to where you are.
permission: at.member.here
usage: /tpahere <Player>
tpa:
description: Sends the targeted player a teleport request to where they are.
permission: at.member.tpa
usage: /tpa <Player>
tpalist:
description: Lists your teleport requests.
permission: at.member.list
usage: /tpalist
spawn:
description: Teleports you to the spawn location.
permission: at.member.spawn
usage: /spawn
setspawn:
description: Sets a spawn at your location.
permission: at.admin.setspawn
usage: /setspawn
mirrorspawn:
description: Redirects people using /spawn in one world to another spawn point.
permission: at.admin.mirrorspawn
usage: /mirrorspawn <To World>|[From World] [To World]
removespawn:
description: Removes a given spawnpoint.
permission: at.admin.removespawn
usage: /removespawn [ID]
setmainspawn:
description: Sets the main spawnpoint.
permission: at.admin.setmainspawn
usage: /setmainspawn [ID]
sethome:
description: Sets a home point at your location.
permission: at.member.sethome
usage: /sethome <Home>
delhome:
description: Deletes a home point you've set.
permission: at.member.delhome
usage: /delhome <Home>
home:
description: Sends you to your home point.
permission: at.member.home
usage: /home <Home>
homes:
description: Gives a list of homes you've set.
permission: at.member.homes
usage: /homes [Player]
movehome:
description: Moves a home to a new location.
permission: at.member.movehome
usage: /movehome <Home>
setmainhome:
description: Sets a user's main home.
permission: at.member.setmainhome
usage: /setmainhome <Home>
aliases: [setmhome]
back:
description: Teleports you to your last location.
permission: at.member.back
usage: /back
tploc:
description: Teleports you to a specified location.
permission: at.admin.tploc
usage: /tploc <x> <y> <z> [Yaw] [Pitch] [World] [Player]
tpoffline:
description: Teleports to an offline player.
permission: at.admin.tpoffline
usage: /tpoffline <Player>
aliases: [tpoffl]
tpofflinehere:
description: Teleports an offline player to your location.
permission: at.admin.tpofflinehere
usage: /tpofflinehere <Player>
aliases: [tpofflh, tpofflhere]
permissions:
at.member.core.*:
default: op
children:
at.member.core.help: true
at.member.core.info: true
at.member.core.clearcache: false
at.member.core.export: false
at.member.core.import: false
at.member.core.purge: false
at.member.core.reload: false
at.admin.core.*:
default: op
children:
at.admin.core.clearcache: true
at.admin.core.export: true
at.admin.core.import: true
at.admin.core.purge: true
at.admin.core.reload: true
at.member.warp.*:
default: op
at.member.spawn:
default: true
children:
at.member.spawn.*: false
# Allows all member permissions
at.member.*:
default: op
description: Allows access to member-based commands of the plugin.
children:
# All of these are "sub-permissions" of at.member.*.
at.member.tpr: true
at.member.off: true
at.member.on: true
at.member.toggletp: true
at.member.cancel: true
at.member.unblock: true
at.member.block: true
at.member.no: true
at.member.yes: true
at.member.here: true
at.member.help: true
at.member.list: true
at.member.warp: true
at.member.warps: true
at.member.spawn: true
at.member.sethome: true
at.member.delhome: true
at.member.home: true
at.member.homes: true
at.member.setmainhome: true
at.member.movehome: true
at.member.tpa: true
at.member.back: true
at.member.spawn.use-sign: true
at.member.randomtp.use-sign: true
at.member.warp.use-sign: true
at.member.warps.use-sign: true
at.member.bed.use-sign: true
at.member.back.death: true
at.member.warps.location: true
at.member.homes.location: true
at.member.spawn.*: false
at.member.core.*: true
at.admin.*:
default: op
description: Allows access to admin-based commands of the plugin.
children:
at.admin.tpohere: true
at.admin.all: true
at.admin.tpo: true
at.admin.setwarp: true
at.admin.delwarp: true
at.admin.setspawn: true
at.admin.setspawn.other: true
at.admin.removespawn: true
at.admin.mirrorspawn: true
at.admin.setmainspawn: true
at.admin.sethome: true
at.admin.delhome: true
at.admin.homes: true
at.admin.home: true
at.admin.bypass.distance-limit: true
at.admin.sethome.bypass: true
at.admin.bypass.teleport-on-join: true
at.admin.toggletp: true
at.admin.bypass: true
at.admin.tploc: true
at.admin.tploc.others: true
at.admin.bypass.timer: true
at.admin.bypass.cooldown: true
at.admin.request-in-vanish: true
at.admin.sign.spawn.create: true
at.admin.sign.randomtp.create: true
at.admin.sign.warp.create: true
at.admin.sign.warps.create: true
at.admin.sign.bed.create: true
at.admin.tpoffline: true
at.admin.tpofflinehere: true
at.member.homes.unlimited: true
1 change: 1 addition & 0 deletions AdvancedTeleport-Bukkit/target/classes/update.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
update-timestamp=2023-06-04T12:07:03Z
3 changes: 3 additions & 0 deletions AdvancedTeleport-Bukkit/target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
artifactId=AdvancedTeleport-Bukkit
groupId=io.github.niestrat99
version=v5.6.8
Binary file not shown.

0 comments on commit fd2dc55

Please sign in to comment.