#help-development

1 messages ยท Page 1705 of 1

minor garnet
#

how is the parameter / method init i don't know, of kotlin in java?

acoustic pendant
worldly ingot
#

If you mean <init>, that's a constructor, vinny

acoustic pendant
#

oh

minor garnet
#

like this

halcyon mica
#

I am updating the block data before setting it back

acoustic pendant
#

nvm i haven't registered it in plugin.yml

worldly ingot
#

vinny, ehm, I don't kotlin, but I'm going to assume the Java equivalent of that would be an init block just without the init keyword

minor garnet
#

nah is not this

worldly ingot
#
public class Example {

    {
        // This is an init block
    }

}```
minor garnet
#

I'm trying to redo this code in java, but I had problems

worldly ingot
#

Those init blocks are called regardless of the constructor used

minor garnet
#

let me test it

acoustic pendant
#

god:
description: Become a god
permission: minespace.god
default: op
usage: /<command>

is like that good registered?

#

ye ye

#

the command is registered

#

but i mean

#

in the plugin.yml

#

the permission is ok?

acoustic pendant
#

of the command

#

the permission i mean

#

but

#

i'm in op

#

and i can't send the command

#

it says the message that i don't have permission

eternal oxide
#

if you are op and you have set a permission in your plugin.yml, you have an error on startup

#

or you have another plugin with a god command

halcyon mica
#

@eternal oxide When I set the type of a block and get the block data afterwards, the block data should inherit all apropriate interfaces for that material, so why is setting type -> getting data -> updating data -> setting updated data wrong?

eternal oxide
#

to test your issue use the createBlockData from the Material, then use that

halcyon mica
#

No change

acoustic pendant
quaint mantle
#

is it possible to find the best item suitable for mining a block, for example:-

For Ores its a Pickaxe (since it drops items)
but for sand its Shovel (even tho u can get sand from mining with ur fist)
and log is Axe (even tho u can get the log from from mining with ur fist).

without hardcoding every block in the game ?

eternal oxide
#

indentation is wrong or your commands are formatted incorrectly in your plugin.yml

#

yes, wrong

#

; instead of a :

tardy delta
#

config;

waxen plinth
#
main: com.hitman.firstplugin.Main
name: TestPlugin
author: Hitman
description: Config
version: 1.0
commands:
  config:```
tardy delta
#

commands:

  • config
#

is that possible

waxen plinth
#

What, an empty block?

#

Yeah

#

It's dumb but it's valid

quaint mantle
#

@waxen plinth what is Void for

waxen plinth
#

???

tardy delta
#

how can this produce a npr if i return?

quaint mantle
#

nvm

waxen plinth
quaint mantle
#
@NotNull
Optional<Void> method() {
    return Optional.empty(); // Nonnull return
}
#

idk why you'd need this though

waxen plinth
waxen plinth
#

But Void is a boxed unit type

quaint mantle
#

yeah but why what does it do

waxen plinth
#

Sometimes you need a unit type

#

It's a type which can only have one value

halcyon mica
#

How do I get the sound for placing a specific material?

waxen plinth
#

In this case, null

tardy delta
spice hornet
#

What is the lowest Spigot version I can go with that has only minor breaking behaviour upwards? Basically, what should I pick to support as many versions as possible including the latest?

quaint mantle
#

1.13

spice hornet
#

I saw 1.13 broke some fairly serious stuff

quaint mantle
#

will this work or not ๐Ÿ˜•

waxen plinth
#

An example is if you're passing a lambda

spice hornet
#

Okay, thought so. 1.13. handles materials differently or something like that, right?

waxen plinth
#

And it requires a Function<T, U>

#

You have a function which provides a value while taking in nothing

quaint mantle
#

the only use i see is a Future<Void>

waxen plinth
#

You could pass in a Function<Void, String> or something

#

Yeah that's another valid use

spice hornet
tardy delta
#

if i do new ItemStack(null) what will that do?

spice hornet
#

No, they won't overlap on the classpath but it still would be a pain.

tardy delta
#

throw an exception?

waxen plinth
#

Probably

spice hornet
#

I can take a look at the implementation

waxen plinth
#

I've never tried it

tardy delta
waxen plinth
#

I mean, I don't know why people ask questions for things they can very easily test themselves

tardy delta
#

illegalargument exception

#

ugh

#

๐Ÿ˜ณ

spice hornet
waxen plinth
#

Seems about right

spice hornet
#

Like what class is throwing it?

waxen plinth
#

From the constructor, probably

#

I hope so

#

Rust is cool

spice hornet
#

Constructor does not check it

spice hornet
#

It is denoted as @NotNull so you will get some issues definitely. @NotNull will not keep you from trying it

waxen plinth
#

Very little will stop you from doing what you want in java

#

If you're persistent

#

For example, you can instantiate new enum values at runtime

tardy delta
#

it calls the deprecated one i assume

spice hornet
#

compiling? pah, me and the homies do runtime manipulation

#

using java as intended? pah, me and the homies use reflection (yes, don't flame me)

spice hornet
quaint mantle
#

any other idea ? Found another way to do this with using that method and breakSpeed method

tardy delta
#

well the constructor with (Material type) keeps calling this(...) and ends up with that

spice hornet
#

This is like the best way you can go, I am surprised this is even in the API.

idle cove
#

How would i check if the top inventory that the player is seeing is a chest using InventoryClickEvent?

quaint mantle
#

i want to make a multiversion nms plugin and i want to make a module for each version that i want to support (gradle)

spice hornet
#

go from there

#

You can then check inventory size to determinte it. I don't know if there is a direct api implementation

spice hornet
waxen plinth
#

If you get into making plugins seriously

idle cove
#

wait is there no other type of storage that has the same amount of slots as the player inventory?

waxen plinth
#

I would ditch the standard command system as soon as possible

spice hornet
waxen plinth
idle cove
quaint mantle
idle cove
#

I want the player to not be able to put a specific item in another storage place

waxen plinth
spice hornet
#

I don't know a lot about this API but possibly moving an item results in an event which you can cancel?

spice hornet
waxen plinth
waxen plinth
#

It works very differently from them all

spice hornet
#

Ah yes, makes sense. Did the same for my Discord bot back then

waxen plinth
quaint mantle
#

thanks

waxen plinth
#

See build.gradle for the base project as well as the modules

waxen plinth
#

It's more streamlined than ACF

spice hornet
#

Gradle is scary honestly, I don't really understand how it works but would like to understand it a bit better. Never tried Maven but will be the same

spice hornet
waxen plinth
#

Maven is far worse

spice hornet
#

Yeah, that's why I never even tried it.

waxen plinth
#

Gradle is not that scary and it's easy once you get the hang of it

spice hornet
#

I find the gradle "layout" confusing at times, I think it's Groovy language or something like that

eternal oxide
#

Maven is quite simple. Gradle is a confuddled mess

spice hornet
quaint mantle
spice hornet
#

With Gradle it usually seems like there are 10 ways to do a single thing.

waxen plinth
#

See the source and target compatibility

#

It's a bit weird but it works

quaint mantle
#

how to create a new submodule i never did ๐Ÿ˜‚

#

intellij

maiden briar
#

Can sb say what will happen if I set a display name to an Objective (scoreboard) with slot DisplaySlot.PLAYER_LIST?

tardy delta
#

for some reason i cant check if the inventory from the inventory click event is instanceof this class

idle cove
#

Does the armor and crafting area in the player's inventory count as a topinventory

trail flume
#

What is the argument for ConfiguarationSection.geyKeys(boolean)?

quaint mantle
#

false

acoustic pendant
#

Hello, i need some help.
I have a command registered and a permission as well, but when i type the command in op it says the message i have when you don't have permissions

#

here's the code

tardy delta
#

does event.getInventory() instanceof SomeClass not work if that class doesnt have a field with the inventory?

tardy delta
#

don't repeat code

acoustic pendant
#

wdym

trail flume
tardy delta
#

i see two times the permission check

waxen plinth
#

I don't think you need that alias

acoustic pendant
#

it's for override other plugins

trail flume
#

what does it do

opal juniper
#

itโ€™s a deep search iirc

#

so

#

false

acoustic pendant
opal juniper
#

= just the outermost keys

acoustic pendant
#

because when i didn't have it

trail flume
acoustic pendant
#

one time i needed the permission and the other one not

opal juniper
#

true = every key

trail flume
#

oh

#

thanks

tardy delta
#
if (sender instanceof Player) {
  Player player = (Player) sender;
if (!player.hasPermission("minespace.god")) {
  player.sendMessage(ChatColor.RED + "You don't have the required permission");
return true;
}
player.setInvulnerable(!p.isInvulnerable);
player.sendMessage(p.isInvulnerable ? ChatColor.GREEN + "God mode Enabled" : ChatColor.RED + "God mode Disabled");
return true;
}
#

something like that?

acoustic pendant
#

so

#

i should change all my code?

tardy delta
#

your choice

acoustic pendant
#

and with my code

#

can i do something to solve the permission problem?

tardy delta
#

i'm not sure if an op gets all the permissions but i made an utils method that checks for permission and checks if the player is an op

acoustic pendant
#

but

tardy delta
#
public static boolean isAuthorized(CommandSender p, String permission) {
        String prefix = name.toLowerCase() + ".";
        return p.hasPermission(prefix + permission.replace(name + ".", "").toLowerCase(Locale.ENGLISH)) || p.hasPermission(prefix + "admin");
    }
acoustic pendant
#

uh

#

i see

#

tysm

tardy delta
#

not sure why i'm replacing stuff ๐Ÿค”

#

ah because i was getting permissions from the plugin.yml file

eternal oxide
undone axleBOT
acoustic pendant
eternal oxide
#

plugin.yml

#

also your if/else will never pass on your second permission test

#

Your code, if the player has the permission and is not invulnerable, say they don't have the permission.
If the player doesn't have the permission always say they don;t have the permission and never run the other code to set invulnerable/

tardy delta
#

ugh a protected constructor can be called from its child class no?

eternal oxide
#

super yes

tardy delta
eternal oxide
#

different packages?

tardy delta
#

one is in .....utils and one in ....gui

eternal oxide
#

protected = package protected

tardy delta
#

so i have to move it?

eternal oxide
#

if they are in different packages, yes

tardy delta
#

ah now it works

tardy delta
#

?paste

undone axleBOT
tardy delta
golden turret
#

and yes

#

you cant access it out of the package

#

but you can extend it and make it public

eternal oxide
#

Exactly what I said

#

instead of null try new ArrayList()

#

its pointless, other than for readability though

tardy delta
#

so new arraylist clears the key?

eternal oxide
#

null removes the key

quaint mantle
#

i have a question about 1_16_R3 nms

quaint mantle
#

is this the same IChatBaseComponent.a() in 1_17_1 ?

eternal oxide
acoustic pendant
#

why?

eternal oxide
#

follow your tests, you do an if player has permissions chanck

acoustic pendant
#

so

eternal oxide
#

then in the else, you do the same check again

#

it can;t magically become true after you already tested it and found it false

acoustic pendant
#

it worked

eternal oxide
#

I'm just telling you what is in your code and how it will not work with yoru permission tests

tardy delta
#

is it possible that the first method is being executed when the second method started executing?

golden turret
trail flume
#

Is ConfigurationSection.getName() the name of the key the section is under?

eternal oxide
eternal oxide
# acoustic pendant it worked

Your command permissions are set in the plugin.yml, you don't need to test them at all in the command. Spigot will not allow a player without the permission to run the command.

acoustic pendant
#

so

#

with the permission

#

in enabling only

#

will work?

eternal oxide
#

you do not test the permission at all

acoustic pendant
#

oh

#

like this maybe?

#

wait

quaint mantle
#

these methods for armor stand

#

are not in 1.8.8 nms

acoustic pendant
eternal oxide
#

delete line 20 and 21

#

and 24

#

and 22

acoustic pendant
#

ye

#

i did a lot of changes

#

bc of the permission

#

i did already

#

well

#

i'm having a problem in the last line

eternal oxide
acoustic pendant
#

still

#

before i didn't have that problem

#

hmm

eternal oxide
#

it was still using player instead of p

acoustic pendant
#

i didn't copy your code

#

but

#

it says

#

} expected

eternal oxide
#

Well, mine is correct

tardy delta
idle cove
#

I am using InventoryClickEvent but i am having trouble making it so that the player cannot move stuff into the top inventory but can move it in the bottom inventory

acoustic pendant
eternal oxide
#

you do need 1 more } to close the class

#

I didn;t add one as I assumed you had more code in the class

idle cove
#

I will send my code one minute

eternal oxide
acoustic pendant
#

how do i register the message in yml?

eternal oxide
#

messages?

acoustic pendant
#

yes

#

the permission-message:

#

the color i mean

eternal oxide
#

I'm not understanding your question

acoustic pendant
#

in plugin.yml

golden turret
#

ยง

#

try it

acoustic pendant
#

commands:
god:
description: Become a god
permission: minespace.god
permission-message: &cYou don't have the required permission
aliases:
- god
usage: /god

balmy coyote
#

Hey is there an event or some way to obtain the Item used to Activate Beacon?

quaint mantle
eternal oxide
#

^

#

instead of the &

acoustic pendant
#

how do i make that simbol lol

quaint mantle
#

copy

eternal oxide
#

copy/paste ๐Ÿ˜‰

golden turret
#

alt gr + =

acoustic pendant
#

ik

#

but how

quaint mantle
#

ctrl c
ctrl v

#

is it hard ?

tardy delta
#

alt gr + = ??

#

what does that even do?

quaint mantle
eternal oxide
#

my keyboard has no gr key ๐Ÿ™‚

acoustic pendant
#

but by keybord is a little one

golden turret
tardy delta
#

Alt Gr

acoustic pendant
#

so doesn't have that things

tardy delta
#

smh the = is next to the :

eternal oxide
#

Does nothing for me

tardy delta
#

same

acoustic pendant
#

the permission-message with " or ' ?

tardy delta
#

try alt f4

acoustic pendant
#

oh

quaint mantle
#

ok

eternal oxide
#

๐Ÿ˜„

acoustic pendant
#

it worked alt f4

tardy delta
#

๐Ÿ˜ณ

idle cove
idle cove
#

The problem I face is that even if the top inventory is there

eternal oxide
tardy delta
#

brr empty lines

acoustic pendant
#

so like this should work?
god:
description: Become a god
permission: minespace.god
permission-message: "ยงcYou don't have the required permission"
aliases:
- god
usage: /god

eternal oxide
#

yes

acoustic pendant
#

k ty

eternal oxide
#

check yoru indentation though. Discord messes it up. 2 spaces indent

idle cove
golden turret
#

portuguese keyboard ๐Ÿ™ ยงยงยงยงยงยงยงยงยงยง

tardy delta
#

for some reason second line causes npr

final FileConfiguration dataFile = ConfigManager.getData();
        if (dataFile.contains("safe_chests") && dataFile.getConfigurationSection("safe_chests").getKeys(false).size() > 0) {

datafile cant be null as it initialized before

eternal night
#

just because it contains "safe_chests" does not mean that there is a configuration section available there

tardy delta
#

how can i check if there is a configurationsection?

#

ah isConfigurationSection i guess

tardy delta
#

and is it possible that section has 0 keys?

#

like just

safe_chests:

eternal oxide
#

no

#

that would return null if you tried to get the section

tardy delta
#

ok

acoustic pendant
#

it finally worked tysm :DDD

balmy coyote
golden turret
#

:C

balmy coyote
#

Nor Cancel does..

golden turret
#

then maybe intercepting packets?

balmy coyote
#

Never used packets. Where i can get some direction tip about it?

golden turret
#

and basically with plain spigot you can only send packets

#

but with some implementation like protrocollib, you can intercept them

balmy coyote
#

I probably need to read them

#

I just need to obtain the ItemStack used

#

When confirmed

tardy delta
#

what is better?

messages.forEach(message -> log(message));

or

for (String s : messages) {
  log(s);
}
acoustic pendant
#

is there any way to change the name of a project?

tawny shadow
eternal oxide
acoustic pendant
#

hmm

#

intelij

eternal oxide
#

Eclipse its Right click project -> refactor -> rename (type name) press enter

#

no clue on IJ

acoustic pendant
#

intelij

tardy delta
#

right click project refactor rename

acoustic pendant
#

where?

tardy delta
#

not sure if package name will change

acoustic pendant
#

i mean

#

when i compile it

tardy delta
#

wdym

#

the jar name?

acoustic pendant
#

ye

eternal oxide
#

using maven?

acoustic pendant
#

because is commands2

#

and if i change the jar name

tardy delta
#

pom.xml

acoustic pendant
#

will it change?

#

oh

#

nvm

#

forget that

#

this?

tardy delta
#

there was something as <jar.finalName> or something

#

something with jar

tawny shadow
#

File > Project Structure > Project > Project Name

tardy delta
#

if you dont want to change the prohject name

tawny shadow
#

The output

#

wait

#

File > Project Structure > Artifacts

#

if you have one

tardy delta
#

?paste

undone axleBOT
tardy delta
idle cove
#

Does anybody know a solution?

worldly ingot
#

impl of forEach() is just a for loop that calls that consumer

tardy delta
#

yea it has more parameters xd

#

i just read something about it on stackoverflow

tawny shadow
#

Does anyone know how to prevent the knockback reduce by many cps in the 1.8.9?

worldly ingot
#
    default void forEach(Consumer<? super T> action) {
        Objects.requireNonNull(action);
        for (T t : this) {
            action.accept(t);
        }
    }```
That's literally all forEach() is under the hood ๐Ÿ˜›
eternal oxide
tardy delta
#

oh lol

idle cove
#

Yeah I did that

tardy delta
#

well yea it has some small disadvantages but i can live with that

idle cove
#

Just that it doesn't let me move it at all when I want it so that the player cannot move it into a storage like a chest

#

But they can move it in their own inventory

eternal oxide
#

does it give you the message you are not allowed to move it?

idle cove
#

Yeah

eternal oxide
#

then your code is working as its written

idle cove
#

I got it so that it would let me move the item into the chest but it wouldn't let me move it out

tardy delta
idle cove
#

It works but not the way I want

#

I am trying to make it so that the item can be moved inside the player inventory but not into any external storage place

trail flume
#

Hiya, how can I save a config file with some default config? ( I don't mean the default config.yml file, it has a custom name)
I'd like to be able to set the config in my plugin resources directory like I do with config.yml

eternal oxide
tardy delta
#

hmm i'l check

#

would be strange

eternal oxide
#

then check it is the player inventory you are operating on

idle cove
#

So if the inventory type is player

#

But when I do that I would not let me move it in the players inventory

#

Wouldn't it?

tawny shadow
#

Preventing knockback reduction from players

eternal oxide
#

what exactly are you trying to prevent? moving it into a chest or into the players inventory?

idle cove
#

Moving it into a chest

#

Or any other external storage

#

Other than the player inv

eternal oxide
#

there are multiple things you are going to have to test

idle cove
#

But to be able to move it into the player inv

trail flume
#

Thanks

What exactly does ConfigurationSection.getList() do?

idle cove
#

What exactly will I have to test?

eternal oxide
#

dragging too

#

then you have shift clicking

idle cove
#

Isn't dragging just a click event and then moving your cursor?

tardy delta
#

well my file isnt null

idle cove
#

I don't see the difference between them

eternal oxide
tardy delta
#

ah wait

idle cove
#

That's what I did

eternal oxide
#

I forget if player is alwasy on top or bottom

idle cove
#

This is what I have currently

eternal oxide
#

ah I see you added one

tardy delta
trail flume
#

Thanks

idle cove
#

Is it different if I check for null instead of checking if it's the player inventory

#

Because I also tried checking if the clicked inventory is the player inventory

eternal oxide
idle cove
#

Wait so what if you are in the player inventory what will be the too and what will be the bottom?

#

As in the one where u can see the armor slots

eternal oxide
#

It will never be a PLAYER inventory. you test for CRAFTING

idle cove
#

Ohhhh

#

So it's not inventory type player but inventory type crafting?

#

I am very confused wouldn't that check for the crafting table inventory?

trail flume
#

Is this the correct way to get my config file? .getList is returning null

File configFile = new File(Main.getInstance().getDataFolder(), "chests.yml");

FileConfiguration config = YamlConfiguration.loadConfiguration(configFile);
idle cove
#

Instead of the mini crafting table in the player inv

eternal oxide
dry pike
#

Question on making a variable final... intelliJ is recommending I make a variable final, but I use methods within the object that changes variables within the object. So for example I have
private final NPCStuckController stuckController;
now does this mean I cant use methods within the npcstuck controller that change private variables within the controllers class? Like the variable in npcstuckcontroller boolean isRunning;

Can i still run
stuckController().setRunning(true);
even though the variable is final?

eternal oxide
#

WORKBENCH is a table

idle cove
#

Ohhhh

#

Also is the armor slots a different inventory type?

eternal oxide
#

no

idle cove
#

Ok

trail flume
#

It's not, calling getList isn't the problem. The value it returns is null.

idle cove
#

So all I have to check for is if the top inv is not crafting table?

eternal oxide
#

yes, then prevent moving

idle cove
#

Alright thank you very much!

trail flume
#

The value returned by .getList

#

Yes.

#

Hang on

tardy delta
#

for some reason data is null

 dataFile = new File(plugin.getDataFolder(), "data.yml");
        if (!dataFile.exists()) plugin.saveResource("data.yml", false);
        data = YamlConfiguration.loadConfiguration(dataFile);
trail flume
#

Oh. I completely forgot to add the dashes for each list item, sorry about that. I better add a null check.

#

Yeah

#

I added the dashes and it works now :D

#

Nah that'll be fine because I'm just using a for loop

#

I am right that for loops don't do anything if the list is empty, aren't I?

eternal oxide
#

yes

trail flume
#

ok good

#

im not dumb then

#

lol

quaint mantle
#

how to get a world by name ?

young knoll
#

Bukkit.getWorld

quaint mantle
#

thanks

solar sable
#

does anyone here know how to update a plugin's task?

eternal oxide
#

explain more

solar sable
#

well i am making a scoreboard right now, but it is not updating the statistics

#

the statistic is damage dealt to entities but i have to relog in to make it update, so how to update its task?

eternal oxide
#

then use teh scheduler to run an update

solar sable
#

example?

eternal oxide
#

?scheduling

undone axleBOT
quaint mantle
#

if i compile a plugin with java 16
can i run it in java 8, 1.8.8 ?

eternal oxide
#

no

eternal oxide
#

not unless you configure it to compile for 8

solar sable
#

below p.setScoreboard(board); ? or somewhere else

quaint mantle
#

im trying to do this
but 1.17.1 classes requires java 16

solar sable
eternal oxide
#

are they modules?

quaint mantle
#

nope

#

packages

eternal oxide
#

then you are going to have to do lots of reading about using modules and different java versions

tardy delta
#

finally found the problem

solar sable
eternal oxide
solar sable
#

hmm

eternal oxide
#

it doesn't need to run often only every few seconds

solar sable
#

can you give me any example of it? i dont get the link that you sent me

eternal oxide
#

read teh section on "Scheduling a Repeating Task"

solar sable
#
new BukkitRunnable() {
  @Override
  public void run() {
    Bukkit.broadcastMessage("Mooooo!");
  }
}.runTaskTimer(plugin, 20L * 10L /*<-- the initial delay */, 20L * 5L /*<-- the interval */);

this one seems good

#

but what do i need to change so it would repeat my scoreboard task?

eternal oxide
#

inside your task just loop over Bukkit.getOnlinePlayers() and call your showScoreBoard

solar sable
#
new BukkitRunnable() {
  @Override
  public void run() {
    Bukkit.getOnlinePlayers();
  }
}.runTaskTimer(plugin, 20L * 10L /*<-- the initial delay */, 20L * 5L /*<-- the interval */);
``` so like this? @eternal oxide
idle cove
#

what type of click is the number click?

#

where u press 1 and the item in your first slot goes to the slot that your cursor is in?

idle cove
#

So when you are in your inventory or in a chest inventory you can press 1 while your cursor is on a slot and if there is an item in your first slot then that item will be placed in the slot that your cursor is on or switched with the item in the slot that your cursor is on if there is an item there

solar sable
#

isnt that just basic mc keymap?

golden turret
#

check

idle cove
#

wrong person

idle cove
golden turret
#

๐Ÿคก

quaint mantle
#

how to create a new module

#

and use it i guess

golden turret
#

i am using gradle

quaint mantle
#

im not good at reading code

solar sable
quaint mantle
#

like how to create a submodule

idle cove
solar sable
#

i am just confused on what you are tryna ask

idle cove
#

what event is it

#

i mean action

#

Action.(WHAT)

solar sable
#

like click event?

idle cove
#

yeah

#

i am using click event#

#

to stop the player from moving the item

solar sable
#

ooh

idle cove
#

but they can still move the item when they are doing that action

solar sable
#

so you wanna make it like "cancel event" like that?

idle cove
#

i can cancel it

#

it just that

#

it doesnt cancel it if the player does it with that actiopn

quaint mantle
solar sable
#

so what you are trying to say is

#

players

#

can move the item

quaint mantle
#

what is this adapter thing

solar sable
#

if they are using the num 1 button?

idle cove
#

not specifically that

#

its a whole type of action

#

i am asking what action it is

solar sable
trail flume
#

Is there a way to stop empty configuration values being removed?

idle cove
#

so that i can check for it

trail flume
idle cove
#

alright i found ot

#

it

#

thanks

solar sable
#

you're welcome

#

alr i gtg now ya yeet

tardy delta
#

hey if this configurationsection does not exist, what does this returns?
null?

return new HashSet<>(homesFile.getConfigurationSection("homes." + p.getUniqueId()).getKeys(false));
eternal oxide
#

an NPE probably

tardy delta
#

yea i'm using it as tabcomplete and it returns an npe

#

wondering if null would be accepted as a tabcomplete

quaint mantle
#

if anyone got time to explain me the module and multiversion thing and help me please tell

plain oxide
#

Is there a way to display different information on each player's scoreboard and make the option of the team command work?

public static void makeScoreboard(Player player) {
        ScoreboardManager manager = Bukkit.getScoreboardManager();
        assert manager != null;
        Scoreboard board = manager.getNewScoreboard();

        Objective objective = board.registerNewObjective("info", "dummy","ๆƒ…ๅ ฑ");
        objective.setDisplaySlot(DisplaySlot.SIDEBAR);

        player.setScoreboard(board);
    }```

I'm doing this from "Player Join Event" 

Team Options won't work with this :(
rain igloo
#

just a quick question
what is the most preferred IDE for plugin developement?

rain igloo
#

thx ^^

acoustic pendant
#

How can i do to send the user a message with multiple lines?

#

i mean

#

he does /(command)

#

and it appears the list of commands and things like that

quaint mantle
acoustic pendant
#

what?

ivory sleet
#

Elaborate

#

just use
sendMessage("line1\nline2โ€) ?

acoustic pendant
#

don't understand

quaint mantle
acoustic pendant
#

i mean

#

i want to

golden turret
#

PlayerCommandPreprocessEvent

acoustic pendant
#

send a message with multiple lines

golden turret
#

\n

acoustic pendant
#

like for explain the commands

golden turret
#
player.sendMessage("h\ne\nl\nl\no");```
acoustic pendant
#

eehm

#

ok?

quaint mantle
# acoustic pendant i mean
List<String> list = getConfig().getStringList("myMessage");
for (String s : list) {
  player.sendMessage(s);
}
#

the config :

myMessage:
  - "Hello"
  - "There"
acoustic pendant
#

you mean

#

?paste

undone axleBOT
acoustic pendant
#

don't think so

quaint mantle
acoustic pendant
#

ig

quaint mantle
#

are you getting it from a config file ??

acoustic pendant
#

eehm

quaint mantle
#

or just want to send multiple messages at once

acoustic pendant
#

i want to do that

#

well

quaint mantle
acoustic pendant
#

this one

#

wait

#

this one

#

not by the config

quaint mantle
#

edit your config.yml default

acoustic pendant
#

no

quaint mantle
#

just use newline i guess

acoustic pendant
#

it's for showing the commands and that things

quaint mantle
#

player.sendMessage("Line1\nLine2")

#

wdym

acoustic pendant
#

player.sendMessage("Hello\nThere")

#

like that?

quaint mantle
#

the output will be

#

Hello
There

lost matrix
#
  String multiLine = String.join("\n", configuration.getStringList("some.path"));

๐Ÿ™‚

acoustic pendant
#

ok tysm ๐Ÿ˜„

quaint mantle
#

or just give me a guide about it

ivory sleet
#

Is it gradle related?

#

:0

quaint mantle
ivory sleet
#

Pog

lost matrix
quaint mantle
#

multi module

ivory sleet
#

Oh

lost matrix
#

Oh i thought maven

ivory sleet
#

Subprojects?

quaint mantle
#

i looked at more than 5 examples

ivory sleet
#

Yeah so what is it that you donโ€™t understand btw?

quaint mantle
#

yes

ivory sleet
#

?

quaint mantle
#

how to use it

#

like use the interface

lost matrix
#

Do you regularly use maven or gradle?

ivory sleet
#

Interface?

quaint mantle
#

gradle

#

i have this packages

#

and the IHologramManager

acoustic pendant
#

To do comments in config.yml is with // as well?

ivory sleet
#

Oh you wanna achieve nms abstraction

quaint mantle
#

yes

quaint mantle
#

and use the IHologramManager interface

ivory sleet
#

Right so first of all we need to think of subprojects / modules as dependencies also

acoustic pendant
quaint mantle
#

so how to make those ?

ivory sleet
#

In gradle we declare a subproject by the include function in settings.gradle

quaint mantle
#

ok

#

so is there a simpler way to do that in intellij ?

lost matrix
#

It works like the Spigot API.

  1. You write an Interface that has a bunch of methods.
  2. You write an implementation of that interface for every version
  3. You only use the interfaces for programming
  4. You have no idea what actual implementation is used later on because you have a manager that decides which implementation to use when the server starts.
ivory sleet
#

Open settings.gradle

#

then new line -> include ':folderToSubProject'

quaint mantle
#

ok

#

now what

#

so

ivory sleet
quaint mantle
#

what should i do

#

wait let me check it

ivory sleet
#

Itโ€™s a fine example of how one could do this

quaint mantle
#

thats kotlin

chrome beacon
#

What happened to your pfp Conclure

ivory sleet
#

Well that doesnโ€™t matter

ivory sleet
quaint mantle
#

so @ivory sleet

#

should i make a new module

ivory sleet
#

Yeah

quaint mantle
#

just for the

#

interface thing ?

ivory sleet
#

One module for the interfaces
one module for each nms version
one module for the implementation

ivory sleet
#

well

quaint mantle
#

the main parent module thing ?

ivory sleet
#

no

#

the implementation module is the module which is capable of choosing which nms version implementation of the interface to use

#

We have to do this due to that dependencies can only depend in a unidirectional way

quaint mantle
#

ok

ivory sleet
#

for instance

quaint mantle
#

i have done this

ivory sleet
#

you cannot have 2 modules simultaneously depending on each and another

quaint mantle
#

and made this thing

#

can i do it with modules ?

ivory sleet
#

yeah

quaint mantle
#

so

#

what should i do now

ivory sleet
#

Let me write an essay

quaint mantle
#

ok thanks

acoustic pendant
lost matrix
acoustic pendant
#

ik

#

but is a reload command

#

that gets the config

#

so idk

quaint mantle
#

wdym

lost matrix
acoustic pendant
#

that's the reload command

undone axleBOT
acoustic pendant
#

what?

lost matrix
acoustic pendant
#

and how to register a plugin in the main class? with other commands i did :
getCommand("name").setExecutor(new Class());

quaint mantle
#

you look weird in blue

lost matrix
dull whale
#

how can I increase a single mob's player detection range

quaint mantle
#

both suck

#

money = power

dry pike
#

How does a statement like this work? If one is false and one is true what is the booleans value?
boolean executing = !this.npc.getNavigator().isNavigating() && this.target != null;

eternal oxide
#

to be true they both have to return true

dry pike
#

otherwise false?

eternal oxide
#

yes

dry pike
#

Thanks

eternal oxide
#

its an &&

dry pike
#

and the ! at the beginning will invert the boolean correct?

quaint mantle
#

yes

dry pike
#

ok

acoustic pendant
#

if the

#

code is in the main class

neon nymph
#

You mean this?

tardy delta
#

register a plugin :/

acoustic pendant
#

@neon nymphi have this 3 commands

#

but i want to add a command

#

that is in the main class

ivory sleet
#

So we have modules which acts like dependencies. Modules just as dependencies can be dependents and dependencies.

Limitations
However as said one module or dependency cannot simultaneously depend on the other module or dependency of that other module or dependency depends on that one module or dependency.
dependency-one <-> dependency-two (does not work)

So to circumvent this you will have to create a unidirectionel (single directional) dependency hierarchy where higher dependencies don't know about lower dependencies within the hierarchy.

Modules
To create a module as you might know you do need to first declare the module inside settings.gradle like this:

include ':module'

Now the folder ./module will act as a module. If it is absent, go ahead and create one. Usually you also want to have a local build.gradle contained within every module. So create the file ./module/build.gradle

Go ahead and reload your Gradle project and you will see how IntelliJ reacts to it.

The infrastructure
Earlier I mentioned that dependencies cannot be cycled (simultaneously interdependent). To circumvent this with nms abstraction you will need to have three layer levels:

  • The interface layer, the layer of interfaces.
  • The nms layers, the layer of nms specific classes which implements the interfaces in the interface layer.
  • The final layer, this layerswitches on the nms version to then load the corresponding nms version module.

In order to achieve this we would need every nms module to depend on the interface module. You may have something like this in your settings.gradle:

//settings.gradle in rootproject
include ':api',
        ':v1-8-r3',
        ':v1-16-r3'
//class in api 
interface Blah {
  void blahLol();
}
//build.gradle in v1-8-r3
dependencies {
  implementation project(':api')
}
//class in v1-8-r3
class v1_8_R3Blah implements Blah {
  public void blahLol() {
    net.minecraft.server.v1_8_R3.Blah.blah();
  }
}
//build.gradle in v1-16-r3
dependencies {
  implementation project(':api')
}
//class in v1-16-r3
class v1_16_R3Blah implements Blah {
  public void blahLol() {
    net.minecraft.server.v1_16_R3.Blah.blah();
  }
}

Now when you're done with the interfaces and the respective nms implementations we also need to know which nms implementation to use, thus one should add a final module:

//settings.gradle in rootproject
include ':api',
        ':v1-8-r3',
        ':v1-16-r3',
        ':plugin'
//build.gradle in plugin
dependencies {
  implementation project(':api')
  implementation project(':v1-8-r3')
  implementation project(':v1-16-r3')
}
//class in plugin
class BlahPlugin extends JavaPlugin {
  Blah blah;

  @Override public void onEnable() {
    try {
      var ver = this.getServer().getClass().getPackage().getName().split("\\.")[3];
      switch(ver) {
        case "v1_8_R3": { this.blah = new v1_8_R3Blah(); break; }
        case "v1_16_R3": { this.blah = new v1_16_R3Blah(); break; }
      }
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
    blah.blahLol();
  }
}

Then to build I would in rootproject's build.gradle have something like:

//build.gradle of rootproject
dependencies {
  implementation project(':plugin')
}

Then of course you would need shadowJar I believe in order to shade @quaint mantle.

quaint mantle
#

omg

acoustic pendant
#

what?

ivory sleet
#

hope it helps lol, ask any questions in case I wasn't clear

quaint mantle
#

it was clear af

#

post it in spigot or something it is very good

acoustic pendant
ivory sleet
ivory sleet
#

you need to declare your commands in your plugin.yml

acoustic pendant
#

userevents:
description: Reload the plugin
permission: userevents.reload
permission-message: "ยงcYou don't have the required permission"
aliases:
- ue

#

like this?

ivory sleet
#

?paste your main class

undone axleBOT
acoustic pendant
#

sure

#

the "getCommad... are for other classes

ivory sleet
#

yes first of all

acoustic pendant
#

yes?

ivory sleet
#

for every getCommand("something")
the string something would have to be listed under commands: in plugin.yml

acoustic pendant
#

that 3 commands work

#

i'm just doing config.yml

#

and trying to get /userevents reload

ivory sleet
#

which does not work either

neon nymph
#

getCommand("userevents").setExecutor(this);

ivory sleet
#

the label is not for argument comparison

#

if (label.equalsIgnoreCase("userevents reload")) {

acoustic pendant
#

i'm just trying to reload the config

ivory sleet
#

the label will either be the command top node name or any alias of it, depending on which alias was used

acoustic pendant
#

ah?

ivory sleet
#

something like

@Override
public boolean onCommand(...) {
  if (args.length < 1) {
    return true;
  }

  if ("reload".equalsIgnoreCase(args[0])) {
    //TODO
  }
}```
should be enough
#

comparing labels is 99% of the time redundant

unreal quartz
#

@ivory sleet where dog

ivory sleet
#

disappeared :c

unreal quartz
#

๐Ÿ˜ฆ

acoustic pendant
#

@ivory sleetmaybe like this?

ivory sleet
#

not the userevents

#

just reload

acoustic pendant
#

and in plugin.yml

ivory sleet
#

userevents is apart of the command name

acoustic pendant
#

in usage

#

i do

ivory sleet
#

not a command argument

acoustic pendant
#

/userevents reload

#

?

ivory sleet
#

you currently check for
/userevents userevents reload

acoustic pendant
acoustic pendant
ivory sleet
#
/<command name> <command argument>
acoustic pendant
#

oh

#

i haven't seen arguments yet

ivory sleet
#

yes

#

?

acoustic pendant
#

i mean

#

in the tutorial

ivory sleet
#

this explains why your code seems so counter intuitive

#

following one of those outdated tutorials I see

acoustic pendant
#

yes

ivory sleet
#

anyways yeah

acoustic pendant
#

i'm doing this plugins to have them as example

ivory sleet
#

the command name is not a part of the command arguments

acoustic pendant
#

oh

#

i see

#

so this code is good

#

but i have to register the command

#

or is not good?

ivory sleet
#

I am not going to assess your code because you would barely understand the feedback seeing it as of now. Maybe in the future we could have a code review. Anyways you always need to register your commands.

shadow tide
#

for some reason this isn't working... (its in the PlayerDeathEvent event, and killee is a variable for event.getplayer().getKiller) java if (killee.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue() <= 2) { LifeSteal.getPlugin().getServer().getBanList(BanList.Type.NAME).addBan(killeeUUID, "You have lost all of your hearts", null, null); }

ivory sleet
#

what specifically is not working?

shadow tide
#

its just not doing anything

acoustic pendant
#

could you recommend me a not outdated guide?

shadow tide
#

no

acoustic pendant
#

if it by video it would be better

shadow tide
#

wrong

shadow tide
#

oooohhhh

neon nymph
#

Adding them to the banlist doesn't kick them out automatically

shadow tide
#

THANK U

ivory sleet
#

I don't endorse it being a good guide

#

but its not outdated

shadow tide
#

I said that because its a 1/99999999999999999999999999999999999999999 chance of me asking a question and it not turning into a big thing

short shale
#

what is better, creating a table for each user or creating a single table and registering all users in it? (SQLite)

#

see command description

#
  store:
    description: 'text'```
neon nymph
#

Having a table for every player that enters your server would be difficult to keep track of

#

My two cents ๐Ÿช™

short shale
#

i guess you're right

#

thx for the help ๐Ÿ™‚

eternal night
#

dynamic tables also prevent fun things like joins

acoustic pendant
#

I really need some help

#

i have this code

#

but

#

for some reason

#

when i type /userevents reload

#

it sends me the }else{ code

lost matrix
acoustic pendant
#

@lost matrixbut it doesn't send the message

#

and idk if it reload the config.yml

golden mortar
#

Is there a way to get the full and untrimmed string of a command when auto-completing instead of just an array of arguments?

#

To avoid the xy problem, I should maybe elaborate more on why I would need that

mortal hare
#

i have one hypothesis but couldnt figure out a way to prove it.

golden mortar
eternal oxide
#

args.length will tell you what tabcomplete to offer

mortal hare
#

Let say i have hashtable implementation. the keys for that could be only 20 chars wide and char range is from ASCII decimal value 101

neon nymph
mortal hare
#

is it true that using charValue*index+1 would make indexes that never collide if i input only characters starting from 101

#

word: prisitraukimai
hash: 112*1 114*2 105*3 115*4 105*5 116*6 114*7 97*8 117*9 107*10 105*11 109*12 97*13 105*14 32*15 32*16 32*17 32*18 32*19 32*20 (ascii value * its index + 1)

according to my brain, even if you manage to flip the multiplication of all or some of the values, collision can never happen since ascii value 1, 2,3.. etc is not inside the requirements range

#

and 101+ character length is bigger than 20 chars only requirement

#

so the question is, is my conclusion true or false?

golden mortar
mortal hare
mortal hare
neon nymph
lost matrix
#

Ok i got it. The first one is a proper A* approach and the second one is a fast distance interpolation approach.

neon nymph
#

For instance, this code

switch(args.length){
        case 1:
            tabComplete.add("help");
            tabComplete.add("add");
            tabComplete.add("delete");
            tabComplete.add("edit");
            return tabComplete;

Gives this

mortal hare
#

@lost matrix you big brain, can you state that my conclusion above is true or not, i really need an answer

lost matrix
#

Via the plugin.yml or via a manual check of the CommandSender inside your CommandExecutor

chrome beacon
#

It's sorted not inverted

#

but yeah

neon nymph
#

ascii sort yes

lost matrix
mortal hare
#

no its a whole hash

#

imagine pluses instead of spaces

slim kernel
lost matrix
mortal hare
#

because its not for minecraft

#

and im coding on cpp compiler and cant even use cpp libs

#

and only allowed to use c stuff

#

rofl

lost matrix
acoustic pendant
#

i think so

#

i prefer the permission in the plugin.yml

#

so you can delete the return true;

lost matrix
#

I wouldnt describe it as "perfect" but it should work.

acoustic pendant
#

OMFG

#

finally i can reload the config

#

๐Ÿ˜„

neon nymph
#

Add another )

#

Lul

#

Nah, it happens to the best of us

acoustic pendant
#

How can i get the config in a not main class?

quaint mantle
#

?di

undone axleBOT
lost matrix
# mortal hare word: prisitraukimai hash: ``112*1 114*2 105*3 115*4 105*5 116*6 114*7 97*8 117...

Using pluses is dangerous here. Each ASCII char needs 7 bits to be displayed unambiguously.
So your best bet would be using a bit mask.
So for the word "Car" you would need 21 bits:
0000000 0000000 0000000
Then you want to iterate over your chars and bit shift them according to their index.
'C' doesnt get shifted
'a' << (1 * 7)
'r' << (2 * 7)
After that you add all chars as a mask to your empty bits.
It should look a bit like this (pseudo code):
0000000 0000000 0000000 || 'C' << (0 * 7) || 'a' << (1 * 7) || 'r' << (2 * 7)

eternal oxide
#

and thats ASCII only

quaint mantle
#

How can I check if player hit entity with ender pearl in 1.17.1?

lost matrix
quaint mantle
#

Only thing i read that it fires when it hits block

eternal oxide
#

or entity

#

it has a getEntity/block method

quaint mantle
#

oh okay ill try thank you

lost matrix
quaint mantle
worldly ingot
quaint mantle
#

Oh, i may need to use getHitEntity()

quaint mantle
#

Yes that works, thank you.

lost matrix
quaint mantle
#

alr thnx

neon nymph
#

Add holding.setItemMeta(meta); after your #setLore()

#

Wrong ping, soz

#

@quaint mantle ^

quaint mantle
#

yeah i did that

acoustic pendant
#

anyone could tell me why in enabling_god.message

#

when i type it in minecraft

#

it doesn't give me the message?

acoustic pendant
#

it's being sending by the player

#

and all the rest of the commands works

#

but not that

#

maybe a return?

#

i have 2 commands more in different classes

lost matrix
#

Your logic currently looks like this:
"If the sender is not instanceof Player then set the player invulnerable"

acoustic pendant
#

but the actions works

eternal oxide
acoustic pendant
#

the thing is the command

lost matrix
acoustic pendant
#

this happens if i put it after

eternal oxide
#

go back to the original code I sorted out for you. Then see what you did wrong

acoustic pendant
#

uh

#

that code...

acoustic pendant
eternal oxide
#

Your logic and brackets are all messed up

#

now compare that to what you have now

acoustic pendant
#

but

#

to get the message from the console

#

i have to put that code

eternal oxide
#

you are literally just replacing the message lines. How could you have gone so wrong

acoustic pendant
#

cause the bracket ig

#

for (String i : fragment.getPlugin(fragment.class).getConfig().getStringList("disabling_god.message")) {

#

i need this

eternal oxide
#

all you had to do was take your for loops and replace the p.sendMessage lines

acoustic pendant
#

but in the other classes that worked

eternal oxide
#

that code you currently have would never work in any class

acoustic pendant
#

yes

#

look

eternal oxide
#

yes, no if tests, no else, no logic

acoustic pendant
#

but works

eternal oxide
#

of course it does

#

you are not testing anything, no conditionals, no curly braces

acoustic pendant
#

so

#

btw

eternal oxide
#

so go back to the original code and just replace the p.sendMessage lines

acoustic pendant
#

if the last return is false

#

it doesn't work

#

ok

eternal oxide
#

the last return false is correct

acoustic pendant
#

look

#

it returns

#

the command

eternal oxide
#

The code I gave you is 100% correct and working. If yours is not then you broke it.

acoustic pendant
#

ok

eternal oxide
#

if it shows you the command you didn;t use the exact code I gave you

#

it will only reach the return false; if its not a player issuing the command

acoustic pendant
#

@eternal oxidewill this work?

eternal oxide
#

it depends on whats above it

#

but just the snippet, yes

shadow gazelle
#

@hasty prawn okay, sorry I didn't respond until now, but when I print the ItemStack it for some reason doesn't have the enchantment even though I added it

vale cradle
vale cradle
shadow tide
#

How would I get the maximum amount of health a player can have? even with GENERIC_MAX_HEALTH attribute modifiers?

shadow gazelle
#

It for some reason wasn't recognizing the item I wanted it to even though I gave it the exact same properties

shadow tide
shadow gazelle
#

When I print the ItemStack it finds, it gives me this:

ItemStack{GLASS_BOTTLE x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"dark_purple","text":"Soul Vial"}],"text":""}, enchants={LUCK=1}, ItemFlags=[HIDE_ENCHANTS]}}
#

But when it prints the ItemStack that should be identical, it gives me this:

ItemStack{GLASS_BOTTLE x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name={"extra":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"dark_purple","text":"Soul Vial"}],"text":""}, ItemFlags=[HIDE_ENCHANTS]}}
hasty prawn
shadow tide
#

first, its depricated... second I don't think so

hasty prawn
quaint mantle
#

can someone review my code rq and tell if it's good

#

or dangerous or bad

#
  public void onPhase(PlayerMoveEvent event) {
    PlayerData data = FunkePhase.INSTANCE.getDataManager().getPlayerData(event.getPlayer());
    if (data == null)
      return; 
    long timestamp = System.currentTimeMillis();
    if (data.getLastTeleport() != null && event.getTo().equals(data.getLastTeleport())) {
      data.setLastTeleport(null);
      return;
    } 
    FunkePhase.INSTANCE.getService().execute(() -> {
          Player player = event.getPlayer();
          if (player.getAllowFlight() || event.getTo().getWorld().getUID() != event.getFrom().getWorld().getUID() || player.getVehicle() != null || !FunkePhase.INSTANCE.phaseEnabled || timestamp - data.lastDoorSwing < 500L)
            return; 
          if (event.getFrom().distanceSquared(event.getTo()) > (FunkePhase.INSTANCE.getMaxMove() * FunkePhase.INSTANCE.getMaxMove())) {
            event.setCancelled(true);
            return;
          } 
          float minX = (float)Math.min(event.getFrom().getX(), event.getTo().getX());
          float minY = (float)Math.min(event.getFrom().getY(), event.getTo().getY());
          float minZ = (float)Math.min(event.getFrom().getZ(), event.getTo().getZ());
          float maxX = (float)Math.max(event.getFrom().getX(), event.getTo().getX());
          float maxY = (float)Math.max(event.getFrom().getY(), event.getTo().getY());
          float maxZ = (float)Math.max(event.getFrom().getZ(), event.getTo().getZ());
          SimpleCollisionBox box = (new SimpleCollisionBox(minX, minY, minZ, maxX, (maxY + 1.8F), maxZ)).shrink(0.05000000074505806D, 0.05000000074505806D, 0.05000000074505806D);
          int x1 = (int)Math.floor(box.xMin);
          int y1 = (int)Math.floor(box.yMin);
          int z1 = (int)Math.floor(box.zMin);
          int x2 = (int)Math.ceil(box.xMax);
          int y2 = (int)Math.ceil(box.yMax);
          int z2 = (int)Math.ceil(box.zMax);
          for (int x = x1; x <= x2; x++) {
            for (int y = y1; y <= y2; y++) {
              for (int z = z1; z <= z2; z++) {
                Block block;
                Material material;
                if ((block = Helper.getBlockAt(event.getTo().getWorld(), x, y, z)) != null && (material = block.getType()) != AIR && Materials.checkFlag(material, 1) && !FunkePhase.INSTANCE.getExcludedBlocks().contains(material)) {
                  CollisionBox blockBox = BlockData.getData(material).getBox(block, ProtocolVersion.getGameVersion());
                  if (blockBox.isIntersected((CollisionBox)box)) {
                    Location setback = findSetback(data);
                    if (setback != null) {
                      setback.setPitch(event.getTo().getPitch());
                      setback.setYaw(event.getTo().getYaw());
                    } 
                    event.getPlayer().teleport((setback != null) ? setback : event.getFrom());
                    FunkePhase.INSTANCE.alert(event.getPlayer());
                    return;
                  } 
                } 
              } 
            } 
          } 
          data.locations.addLocation(event.getFrom().clone());
        });
  }

+ 
  private ExecutorService service;```
#
  • this.service = Executors.newSingleThreadExecutor();