#help-development

1 messages · Page 572 of 1

wet breach
#

anyways its outdated but yes it is still there

tender shard
#

there never was any 1.8.9 server IIRC

ancient plank
#

wasn't that a client update

tender shard
#

1.8.9 is a "client-only" update

wet breach
tender shard
#

anyway, the proper version to use today is 1.20.1

soft tendon
#

Heyo, quick question - i am trying to cancel the ServerConnectEvent since i am disconnecting the player anyways

#

but uh, i dont see how i could cancel the event without a reason or server since i kinda dont need em

#
    @EventHandler
    public void onServerConnectEvent(ServerConnectEvent event) {
        // check if the player is a bedrock player
        if (!GeyserApi.api().isBedrockPlayer(event.getPlayer().getUniqueId())) {
            logger.info("Player " + event.getPlayer().getName() + " is not a Bedrock player");
            return;
        }

        UUID playerUUID = event.getPlayer().getUniqueId();
        Connection connection = GeyserApi.api().connectionByUuid(playerUUID);
        if (connection == null) {
            logger.error("Connection is null for Bedrock player " + playerUUID);
            return;
        }

        String xuid = connection.xuid();
        if (playerCache.containsKey(xuid)) {
            // case: player is known to us, redirecting
            logger.info("Player known - wants to connect to server: " + playerCache.get(xuid).getName());
            event.setTarget(playerCache.remove(xuid));

        } else {
            logger.info("Player unknown - saving server: " + event.getTarget().getName());
            playerCache.put(xuid, event.getTarget());

            connection.transfer(plugin.getConfig().getAddress(), plugin.getConfig().getPort());// do we need to cancel the event?
            event.setCancelled(true);
        }
    }

something like this

wet breach
#

oh using geyser

flint coyote
wet breach
#

just fyi, this is the bungee and spigot discord, not sure how much more different geyser is or what they change

flint coyote
#
System.out.println("test");
``` like this
tender shard
soft tendon
# wet breach oh using geyser

yee
i need to cancel the server switch event, and reconnect em to re-apply packs in geyser, and then have them re-join

noble lantern
#

ah i got it fixed now for this

However, i keep getting mismatching hashes in my client, are we supposed to be hashing the URL of the resource pack or something else?

wet breach
soft tendon
tender shard
soft tendon
noble lantern
wet breach
#

you are using their software

noble lantern
#

tyty

wet breach
#

it makes a big difference

grave kayak
wet breach
#

they make changes that we are not aware about

#

and do things differently

tender shard
wet breach
#

to expect support for someone elses product is quite dumb

noble lantern
#

would of assumed files would of been more intense for some reason

soft tendon
# wet breach to expect support for someone elses product is quite dumb

bro
i aint asking about their project, nor do i need to since i contribute there and wrote the Geyser api that i am using in my project.
I am asking about how i would cancel the server connect event here without it trowing an error - the error indicates that i should give it a reason, but i cant find a method in bungee's api to do so.

tender shard
soft tendon
#

yes

#

well, atleast initially

tender shard
#

you cannot cancel that event then, you first have to allow them to join one server, and only then you can cancel switching to other servers

#

basically, just check if the ServerConnectEvent#getReason() is JOIN_PROXY, and if yes, don't cancel it

soft tendon
#

can i get/change the server the player would initially connect to in a join/post long event?

tender shard
#

yeah, either in bungeecord's config, or through ServerConnectEvent#setTarget(ServerInfo)

#

just check that you only change the target if the reason is JOIN_PROXY or LOBBY_FALLBACK or however it's called

soft tendon
#

the config part wouldnt work though since bungee seems to remember the server the player disconnected from and reconnects them there :/

soft tendon
tender shard
wet breach
soft tendon
#

cool, but i want it to work regardless of the setting being on or off

ancient jackal
#

Any idea on how to quickly get a random X and Z position where top Y block isn't water? Right now it's greedy but I fear a cache may be too large

wet breach
#

well, can't have everything

#

either you have it enabled and you deal with them connecting to whever they were at, or you disable it and bungee stops worrying about that and always connects them to the lobby

tender shard
#

ofc you should avoid loading new chunks or else it's gonna suck lol

soft tendon
# wet breach well, can't have everything

i dont want to mess with how bungee reconnects them, i just need to get the server they are connecting to, reconnect them, and then manually connect them to the server they wanted to go to all along
tldr: bedrock is dumb and only allows to get new resource packs when the client connects - therefore, i need to reconnect the player (using geyser's api), to then apply the packs in the respective geyser event. For that, i need to know the server the client will connect to - hence why i cancel the first join attempt.

wet breach
#

then you are going to have to work around that

#

not sure what you are expecting

#

you are free to change it in your geyser fork though

#

if you don't like it

soft tendon
#

it is literally a bedrock limitation, and i aint complaining about it.. i just wanted to know how i should handle the warning in bungee's api when i cancel the event; that is literally all there is

#

Thanks to mfnalex, i know how to avoid it. Thanks!

ancient jackal
#

Might be an issue with a plugin though so I'll try it again on a new server

undone axleBOT
wet breach
#

most probably won't help with outdated stuff

#

so will have to wait for someone who doesn't mind

tender shard
#

why the heck are you castimg the meta to Object

#

setOwner is for player names btw

#

what's the durability for?

#

I'd use setOwningPlayer on skull meta btw

young knoll
#

1.8 moment

worldly ingot
#

In ye old days of pre-1.13, they had to use primitive concepts such as numerical block ids, and a subsection of ids for more specific blocks

young knoll
#

Gotta love Skull:3

worldly ingot
#

No no, 271:3

#

or whatever the id for skulls was lol

tender shard
#

1.13, 1.14.1 and 1.16.3 were the best API updates ever

young knoll
#

Same thing

wet breach
#

the only people who really complained about this were the ones that couldn't understand how bits worked

worldly ingot
#

You cannot sit here and tell me you know what block id 52 referred to

somber scarab
#

I have another question:

Can I create a new world and ONLY selectively load the chunks I want?

wet breach
tender shard
wet breach
#

because you can if you wanted change what the id's referred to

quaint mantle
#

I have those ids ingrained in my mind

wet breach
#

lmao

somber scarab
#

How can one generate an world where only the chunks I want are allowed to load?

wet breach
#

but all well people will complain regardless

#

in terms of efficiency strings are slowest

#

and use up more space

tender shard
#

but it still uses numbers internally

wet breach
#

as a byte and it depends on character points being used

#

strings take up more space. There is never going to be an instance where a string takes less space then a primitive

full glade
#

How to make wither skeletons not give the wither effect when attacking? Spigot 1.20

somber scarab
#

Can I make a per player border?

tender shard
#

Player#setWorldBorder(WorldBorder)

somber scarab
#

This was so much easier than I thought.

#

Thanks. My mind had the wildest most painfull solutions to what I needed

wet breach
#

lol

haughty storm
#

How could I spawn a structure by its schematic

wet breach
#

well, first you get the width and height of your schematic, this lets you get relative coords in regards to where you want to spawn it in at

#

and then its a matter of traversing the schematic and setting the blocks appropriately

haughty storm
#

ok, but there isn't a method to do that for you, right?

young knoll
#

Worldedit api has stuff to deal with schematics

#

Otherwise you need to load and parse and place it yourself

haughty storm
#

ok, thank you

wet breach
#

its not hard to implement yourself, I mean I suppose it can be if you don't understand bitshifting and bitmasks etc

#

otherwise not all that hard

somber scarab
#

Hey guys. so I have a question.

#

I am looping through blocks from y 319 down to the first block that isnt Air or Lava

next zinc
#

Is there any way around the deprecated boat methods besides using NMS?

somber scarab
# somber scarab I am looping through blocks from y 319 down to the first block that isnt Air or ...
        for (int y = 319; y >= -64; y--){
            if(unsafeLoc.getWorld().getBlockAt((int)unsafeLoc.getX(),y,(int)unsafeLoc.getZ()).getType().equals(Material.AIR)) continue;
            if(unsafeLoc.getWorld().getBlockAt((int)unsafeLoc.getX(),y,(int)unsafeLoc.getZ()).getType().equals(Material.LAVA)) continue;

            safeLoc.setX(chunkGlobal.getX()+unsafeLoc.getX());
            safeLoc.setZ(chunkGlobal.getZ()+unsafeLoc.getZ());

            safeLoc.setY(y+1.0);
            break;
        }
#

oh the indenting is fucked...

#

but when I tried it. my server crashed. saying...java.lang.ArrayIndexOutOfBoundsException: Index 180355379 out of bounds for length 315

tender shard
#

also you don't need equals to compare enums

#

also you should be using WorldInfo#getMinHeight() and #getMaxHeight() istead of hardcoded heights

#

also why don't you start at World#getHighestBlockYAt(int x, int z) instead of startig at the max height?

somber scarab
#

huh.. didnt know all that

#

thanks alot.

tender shard
#

np. If you just want to find the highest not-air, not-lava block, I'd do it like this:

somber scarab
#

I dont get the error tbh.

tender shard
#
    public static Block getHighestUsableBlockAt(World world, int x, int z) {
        Block block = world.getHighestBlockAt(x, z);
        while(block.getType().isAir() || block.getType() == Material.LAVA) {
            block = block.getRelative(0, -1, 0);
            if(block.getY() <= world.getMinHeight()) {
                return null; // COuldn't find any block
            }
        }
        return block;
    }

sth like this is how I'd do it

#

haven't tested, I don't have any IDE open

somber scarab
#

whats weirder is the stack trace didnt point to this specific point in the code.

#

pointed to a different class

tender shard
somber scarab
#

oka.

#

I cant send docs...

#

no text files

#

im not verified

tender shard
#

?paste

undone axleBOT
tender shard
#

paste it there

somber scarab
#

I have a suspision it's because the chunk isnt generated yet.

#

because it worked at spawn

#

but when I did it far away.. it crashed

tender shard
#

are you calling that during chunk generation?

somber scarab
#

it happens on a command

soft tendon
#

Hey, me again. Can i get the defined forced hosts via the bungee api?

hollow oxide
#

i've a question, can i make an entity invisible for only one player by using packets suppression?

glacial narwhal
#

is there a way do edit a player name color but only 1 player can see it ?

tender shard
#

I love this class name

wet breach
soft tendon
#

is there a method in api for it? Could not find one.. "this.getProxy().getConfig()" doesnt seem to have a methd to get the forced hosts

wet breach
#

maybe forced hosts isn't part of the api

#

you could optionally however just read the config file

soft tendon
#

uuhh yikes
i'd like to avoid reading the config file xd

#

thanks tho

wet breach
#

its just a yaml file

#

what is so bad about that?

soft tendon
#

nothing really, just more complexity

tender shard
#

you create a new Object of that, then you can use setCooldown(...) and hasCooldown(...) etc

#
public class MyCommandExecutor extends CommandExecutor {
  private final Cooldown cooldown = new Cooldown();

  @Override
  public boolean onCommand(CommandSender sender, ...) {
    if(cooldown.hasCooldown(sender)) {
      sender.sendMessage("You can only use this command once every 20 seconds!");
      return true;
    }

    cooldown.setCooldown(sender, 20, TimeUnit.SECONDS);
    // Your command code
  }
}
earnest mountain
#

How to make an Event handler that executes after minecraft has already handled the event?

scenic onyx
#

"craftPlayer.getHandle().playerConnection.sendPacket(packet);"playerConnection get error you can resolve it?

earnest mountain
#

Do I need to use priorities or tasks?

flint coyote
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

earnest mountain
flint coyote
#

yup

scenic onyx
flint coyote
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

tender shard
scenic onyx
tender shard
#

?switchmappings

scenic onyx
tender shard
#

it's called "connection", not "playerConnection"

#

it's also not called sendPacket but just send

#

you are trying to use spigot mappings instead of mojang mappings

scenic onyx
tender shard
scenic onyx
tender shard
#

Cooldown#getCooldownRemaining(Object, TimeUnit)

scenic onyx
tender shard
#

dude you must learn basic java

#

obviously "cooldown" is the name of your Cooldown object

scenic onyx
# tender shard then you are not using mojang mappings

i a musing grandle:
repositories {
mavenCentral()
jcenter()

maven {url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven {url = 'https://oss.sonatype.org/content/groups/public/'}
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
mavenLocal()

}

dependencies {
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
compileOnly 'org.spigotmcspigot1.19-R0.1-SNAPSHOT'

}

tender shard
scenic onyx
tender shard
#

spigot officially only supports maven:

#

?nms

tender shard
#

this is how to use mojang maps in maven ^

scenic onyx
tender shard
#

for gradle, there's no official way to use mojang maps for spigot

river oracle
#

paperweight is best way tbh just odn't use any paper methods

tender shard
#

I'd just use maven for mojang maps on spigot, that's the easiest way

scenic onyx
remote swallow
#

no

#

that wont remap it

river oracle
#

he said already it won't work on gradle

tender shard
remote swallow
#

you are stuck with 3 optioons

tender shard
#

as I already said twice:
the only official way to use mojang maps for spigot is to use maven

remote swallow
#

move to maven, use paperweight and dont use paper methods, use a 3rd party gradle special source plugin

cobalt thorn
remote swallow
#

very true

#

cant lie

scenic onyx
#

So should I switch to marven?

cobalt thorn
scenic onyx
cobalt thorn
# scenic onyx there is no way?

we are 3 peoples saying, you should consider switching if you want use a feature, probably is not possible in the official way and probably support is not given idk that

remote swallow
#

there is a way to use mojmaps in gradle but its not an official spigot way

tender shard
remote swallow
#

?learnjava

undone axleBOT
scenic onyx
cobalt thorn
#

code

remote swallow
river oracle
#

says italy in bio

cobalt thorn
scenic onyx
tender shard
tender shard
#

after that, add the settings for mojang maps, like this:

#

?nms

cobalt thorn
#

?paste

undone axleBOT
cobalt thorn
#

paste your code in this link and send it here

tender shard
#

dude for real, it's getting so annoying. YOu have absolutely no clue how java works. You don't know what a class is, nor an instance of it. You try to call methods that are declared in Cooldown.java on a Player object. You keep refusing to read the basic java tutorials. The cooldown class is so extremely easy to use, if you don't even manage to understand that, nobody here can help you.

#

Why do you keep refusing to read the java tutorials?

#

?learnjava!

undone axleBOT
full glade
#

dolphin.setTarget(player); does not work. Is it possible to fix this?

undone axleBOT
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

tender shard
cobalt thorn
#

as mfnalex learn java that's not how it works

scenic onyx
# cobalt thorn as mfnalex learn java that's not how it works

using marven found! but PacketPlayOutBlockBreakAnimation packet = new PacketPlayOutBlockBreakAnimation(entityId, blockPosition, animationTime); get error because mot import import net.minecraft.network.protocol.game.PacketPlayOutBlockBreakAnimation;

tender shard
#

?switchmappings

scenic onyx
# tender shard that's not a mojang mapped name

yes it is <dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>

tender shard
#

"PacketPlayOutBlockBreakAnimation " is not a mojang mapped name

#

?switchmappings

tender shard
#

read this ^

full glade
grave kayak
scenic onyx
twilit roost
tender shard
remote swallow
#

@scenic onyx you are trying to using a SPIGOT mapped name, you need the MOJANG mapped name

somber scarab
#

?paste

undone axleBOT
tender shard
#

I sent them ?switchmappings three times already but they keep ignoring it

scenic onyx
somber scarab
#

im out of ideas...

scenic onyx
remote swallow
#

the mojang mapped varient of that is ClientboundBlockDestructionPacket

tender shard
#

I will now send the blog post a fourth time, if you still keep ignoring that, I'll just block you

remote swallow
#

just found another mappings site

tender shard
#

?switchmappings

remote swallow
#

actually pretty decent

scenic onyx
#

ah

remote swallow
#

very nice

tender shard
remote swallow
#

@river oracle you probably want that too

#

rip screaming sandles ig

scenic onyx
tender shard
#

yes

remote swallow
#

this other mappings browser is nice

scenic onyx
tender shard
#

yeah Imma block you now

#

you still haven't read the blog post

#

?switchmappings

tender shard
#

good bye and good luck fixing your issue while ignoring all the answers you got

scenic onyx
remote swallow
#

YOU ARE USING THE SPIGOT MAPPING NAMES WHEN YOU SHOULD BE USING THE MOJANG MAPPED NAMES

#

you have the mojmaps available you just need to use them

tender shard
#

don't waste your time on them

#

they keep using spigot mapped names, completely ignoring the switchmappings blog post lol

somber scarab
#

So.

remote swallow
#

no you arent

somber scarab
scenic onyx
# remote swallow no you arent

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>

somber scarab
#

lmao

remote swallow
#

yes

#

that is the dependency

#

you in your own code are still using spigot mappings, you need to convert

scenic onyx
tender shard
remote swallow
chrome beacon
#

They don't even need nms for block damage

#

It's like talking to a wall

tender shard
#

no 123 on my discord block list

river oracle
somber scarab
river oracle
#

nice

remote swallow
#

ill call it now, they saw that you needed nms on a kody simpson youtube video

remote swallow
#

i still did find another like great site

remote swallow
#

that allows me to search any mapping name and get the mojmap class

scenic onyx
tender shard
#

idk screaming sandals is way more comfortable imho

remote swallow
#

yeah

tender shard
#

the other website looks weird and it's quite cluttered with different namespaces I don't wanna search in

subtle folio
#

that guy is such a bad teacher for actually good practice

river oracle
remote swallow
#

oh lmfao

#

i still like it

river oracle
#

they are upgrading their project to be better and faster thus deprecating the old one

remote swallow
#

makes sense

tender shard
#

the new mappings browser isn't only ugly and mixes up all namespaces in the search, it also doesn't show the list of interfaces something implements

remote swallow
tender shard
remote swallow
#

they're deprecating it at some point

#

which will also cause it not to get new versions

#

(probably)

tender shard
#

they say we'll continue updating NMSMapper's generator for as long as you'll need it

#

oh wait that's only for the reflection stuff

remote swallow
#

@rough drift ur italian right

somber scarab
#

hello?

#

wtf

#

I thought i was timed out

remote swallow
#

is that a crash log

somber scarab
#

Yes. It happened when I was trying to get the first block on a Y coord that isnt AIR or LAVA

remote swallow
#

paste the full crash log

somber scarab
#

the code is here.

    public static Location getSafeLocation(Chunk chunk, Location unsafeLoc){
        Location safeLoc = new Location(unsafeLoc.getWorld(),unsafeLoc.getX(),unsafeLoc.getY(),unsafeLoc.getZ());
        Location chunkGlobal = new Location(unsafeLoc.getWorld(),(chunk.getX() >> 4),1,(chunk.getZ() >> 4));

        safeLoc.setX(chunkGlobal.getX()+unsafeLoc.getX());
        safeLoc.setZ(chunkGlobal.getZ()+unsafeLoc.getZ());
        safeLoc.setY(getHighestUsableBlockAt(unsafeLoc.getWorld(),(int)safeLoc.getX(),(int)safeLoc.getZ()).getY()+1.0);

        return safeLoc;
    }
    public static Block getHighestUsableBlockAt(World world, int x, int z) {
        Block block = world.getHighestBlockAt(x, z);
        while(block.getType().isAir() || block.getType() == Material.LAVA) {
            block = block.getRelative(0, -1, 0);
            if(block.getY() <= world.getMinHeight()) {
                return null; // Couldn't find any block
            }
        }
        return block;
    }
twilit roost
#

can I somehow use an "instance" of vanilla chunk generator?

like when in World Creator you supply null generator, it uses the vanilla
how can I manually set the vanilla chunk generator?

remote swallow
somber scarab
somber scarab
#

but it's weird because it should work...

#

I dont even know where the error is from

remote swallow
#

if anything this crash log isnt caused from that

#

does it still happen with no other plugins on he server

somber scarab
#

okay. how can I know where it's from?

somber scarab
remote swallow
#

remove half, see if it still happens, if it does remove half again

remote swallow
#

the plugins

somber scarab
#

code?

#

oh

#

Im pretty sure it's my plugin. Im coding it myself

remote swallow
#

im gonna take a guess this was tested on a prod server

somber scarab
#

and It happens when I type the command I made

somber scarab
remote swallow
#

test it localhost with no other plugins

somber scarab
remote swallow
#

run buildtools, accept eula, done

somber scarab
#

is there a way i can quickly deply a local server

#

ah well fine.

remote swallow
#

could use paper if you really want

eternal night
#

if you use gradle

#

there is a gradle plugin to spawn a server for you

#

with a single gradle task

remote swallow
#

run paper smh

eternal night
remote swallow
#

personally i dont want to create a server dir in every plugin i want to test

eternal night
#

idk how little disk space you have but like

#

not that large xD

remote swallow
#

i have enough disk space i just dont want to create a server dir everywhere

#

lot easier to just change dest dir

somber scarab
remote swallow
#

--rev version

somber scarab
#

ok....

eternal night
#

yea can always also just symlink

#

das what I do

remote swallow
#

open gitbash/powershell/command promt where the jar is and java -jar Buildtools.jar --rev version

somber scarab
#

oh okay.

#

java -jar Buildtools.jar --rev 1.20 ?

remote swallow
#

yeah

eternal night
#

.1

#

i presume ?

somber scarab
#

no

eternal night
somber scarab
#

thats why i dont want latest

eternal night
remote swallow
#

latest isnt 1.20.1 yet iirc

eternal night
#

intersting

#

concerning 1.20 has some fun bugs/data loss issues

#

at least in vanilla, dunno if that applies to spigot

somber scarab
#

'java' is not recognized as an internal or external command,

#

wat...

#

I am certain i got java

#

leme test

remote swallow
#

probably isnt on path

somber scarab
#

omfg such a workout

#

okay.. wait

#

JDK or what exactly do I need?

remote swallow
#

17, id hope you have one installed if your playing mc

somber scarab
#

is that bad?

remote swallow
#

that should work

somber scarab
#

okay says it's done

remote swallow
#

the spigot-1.20.jar is the one u'll need

wraith bane
#

I am trying to give entities glowing effect that are only visible by a player (so not just applying the effect but rather using protocollib)
Here's my function that doesn't work

public static void applyGlow(Player receiver, Entity entity) {
    ProtocolManager pm = ProtocolLibrary.getProtocolManager();
    pm = ProtocolLibrary.getProtocolManager();
    PacketContainer packet = pm.createPacket(PacketType.Play.Server.ENTITY_METADATA);
    packet.getIntegers().write(0, receiver.getEntityId());

    WrappedDataWatcher watcher = packet.getDataWatcherModifier().read(0);
    watcher.setEntity(receiver);
    watcher.setObject(0, (byte) (0x40));

    final List<WrappedDataValue> wrappedDataValueList = Lists.newArrayList();
    watcher.getWatchableObjects().stream().filter(Objects::nonNull).forEach(entry -> {
        final WrappedDataWatcher.WrappedDataWatcherObject dataWatcherObject = entry.getWatcherObject();
        wrappedDataValueList.add(new WrappedDataValue(dataWatcherObject.getIndex(), dataWatcherObject.getSerializer(), entry.getRawValue()));
    });
    packet.getDataValueCollectionModifier().write(0, wrappedDataValueList);

    try {
        pm.sendServerPacket(receiver, packet);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

Currently crashes the client and throws an error in console

eternal night
#

provide the client and server logs ?

chrome ferry
#

How long does it take to verify a premium resource? I’m just wondering so I can plan stuff out

remote swallow
#

2-4 weeks iirc

chrome ferry
#

Oh damnnnn, okay

somber scarab
#

wow its taking long

#

i dont remember setting up a server taking that long

#

whats the difference between build tools and just a spigot server

echo basalt
#

this is what you want

remote swallow
#

we cant legally distribuite spigot jars

wraith bane
echo basalt
#

no I don't spoon-feed

wraith bane
#

Bruh how is that spoon feeding

somber scarab
wraith bane
#

U sent me it as an image

echo basalt
#

¯_(ツ)_/¯

#

One thing is copypasting the answer

#

Another is writing it for yourself while looking at a guide

wraith bane
#

Bruh I anyways have to modify this

somber scarab
echo basalt
#

If you really want the text then run it through ocr

echo basalt
#

and get fucked when it types fieldIndex:

remote swallow
#

i just ppress windows shift T

#

power toys for the win

echo basalt
#

sharex has that feature too

#

It's a bit dumb

#

and not accurate at all

#

but just write it yourself

remote swallow
#

i mean

#

powertoys didnt do too bad

somber scarab
#

Dont you guys copy paste your research results and modify the code to fit yours?

echo basalt
#

No

#

I look at it

#

understand it

#

and then write it myself

wraith bane
echo basalt
#

That's like one of the best ways to learn from copypasted code

wraith bane
#

I copy paste, get like 10 syntax errors and delete all the uneeded stuff

somber scarab
echo basalt
#

Not really

somber scarab
#

but whatever works for you i guess

echo basalt
#

You only learn to appreciate something if you understand it

#

Unless it's something braindead and stupid like uhh

#

this

#

That's fine to copypaste

somber scarab
#

@remote swallow sire why does it still show me I have 1.20.1

remote swallow
#

no clue

somber scarab
#

nvm

#

so what port is that server again??

#

25524 or smth

remote swallow
#

port doesnt matter here

#

its localhost

#

only you need to join

somber scarab
#

yeah i know. minecraft auto ports the connection?

#

didnt know that <.<

remote swallow
#

if only 1 server is running on ur local ip yeah

somber scarab
#

ah cool like a browser

#

nice

somber scarab
wraith bane
somber scarab
#

only my plugin exists on local

wraith bane
#

It still causes the client to crash after a few seconds

echo basalt
#

uhh

#

if you're below 1.19

#

it's something else

wraith bane
#

I am on 1.20

deft thistle
#

Is there a way to store (temporary, non presistent) data into a player? Something like pdc but non-presistent

tender shard
#

MetaData API

deft thistle
#

thank you

wraith bane
storm scaffold
#

How do I change the speed at which blocks can be mined? I don't mean with mining fatigue/haste, since that isn't very variable and also changes the speed at which your hand moves, I mean changing how fast you mine a specific block.

deft thistle
#

So I just cast whatever I want into a MetadataValue object?

wraith bane
# echo basalt if you're below 1.19
ProtocolManager pm = ProtocolLibrary.getProtocolManager();
PacketContainer packet = pm.createPacket(PacketType.Play.Server.ENTITY_METADATA);
packet.getIntegers().write(0, receiver.getEntityId());

List<WrappedDataValue> dataValues = Lists.newArrayList();
dataValues.add(new WrappedDataValue(0, WrappedDataWatcher.Registry.get(Byte.class), (byte) 0x40));
packet.getIntegers().write(0, receiver.getEntityId());
packet.getDataValueCollectionModifier().write(0, dataValues);

try {
    pm.sendServerPacket(receiver, packet);
} catch (Exception e) {
    e.printStackTrace();
}

This is my current code which crashes the client

#

(this is the client's crash exit code -1073741819)

deft thistle
#

ill tryandsee

#

!tryandsee

#

?tryandsee

undone axleBOT
somber scarab
somber scarab
#

make sure to check that the player is still looking at that block they were mining.

#

but still, even then. a player can leftclick a block once and look at it without holding down the mouse

storm scaffold
#

But what about the cracks on the block?

chrome beacon
#

You can probably figure out the rest

storm scaffold
#

You can give negative potion effects?

chrome beacon
#

Not sure if the api will let you do that

#

But try it

flint coyote
#

Doubt it - never heard of it

somber scarab
#

I think he means a harmful potion: mining fatiuge

flint coyote
#

Yup, still

somber scarab
#

not inverted mining fatigue

somber scarab
flint coyote
#

I mean for that potion he's lucky that mining fatigue is the opposite of haste

flint coyote
#

But besides that you can't really reverse potion effects

deft thistle
#

I can't case Location to Metadatavalue

#

How can I add a location as a metadatavalue for player?

#
    public void teleportToArena(Player joiningPlayer,String arenaName ) {
        if( this.arenaExists(arenaName) ) {
            ArenaModel arenaModel = arenas.get(arenaName);
            joiningPlayer.setMetadata("locationBeforeArena", (MetadataValue) joiningPlayer.getLocation());
            joiningPlayer.setMetadata("currentArena",(MetadataValue) arenaModel);
            joiningPlayer.teleport(arenaModel.getLobbySpawn());
            arenaModel.getCurrentPlayers().add(joiningPlayer.getUniqueId());
            String message = String.format("§f%s§e joined! §a(%d/2)",joiningPlayer.getName(),arenaModel.getCurrentPlayers().size());
            arenaModel.annunceMessage(message);
        }
    }

    public void teleportFromArena(Player quitingPlayer) {
        ArenaModel playerArena = this.getPlayerArena(quitingPlayer);
        playerArena.getCurrentPlayers().remove(quitingPlayer.getUniqueId());
        quitingPlayer.teleport( (Location) quitingPlayer.getMetadata("locationBeforeArena").get(0));
        String message = String.format("§f$s§e left! (§a(%d/2)",quitingPlayer.getName(),playerArena.getCurrentPlayers().size());
        playerArena.annunceMessage(message);
    }
remote swallow
deft thistle
#

alright

sacred berry
#

apparently org.bukkit.event.block.BlockPlaceEvent.getBlock isn't a thing anymore?

#

Anyone know about this?

remote swallow
#

it inherits it from BlockEvent so it should most definately exist

sacred berry
#

Doesn't work

flint coyote
#

Did you name your class "BlockPlaceEvent"?

remote swallow
#

is the import correct

somber scarab
remote swallow
#

report it as a bug on jira ig

sacred berry
somber scarab
remote swallow
#

is your package in it now

somber scarab
remote swallow
#

?paste the crash log

undone axleBOT
somber scarab
#

this is the lastest crash report

somber scarab
remote swallow
#

still doesnt include any plugin classes, report it as a bug

somber scarab
#

SO

#

wait one sec

#

I know where it is..

#

lemme formulate a report

remote swallow
#

?jira

undone axleBOT
somber scarab
#

so i mean. lemme see how to explain it

#
int x_chunk = new Random().nextInt();
int z_chunk = new Random().nextInt();
gameChunk = new Location(main.GAME_WORLD, x_chunk, 20, z_chunk).getChunk();
#

does that break the game?

remote swallow
#

shouldnt do

#

unless that int is too big

somber scarab
#

welp... index out of bounds...

#

Index -184549071 out of bounds for length 315

remote swallow
#

its too big of an int probably

#

use something like ThreadLocalRandom.current().nextInt(10000)

somber scarab
#

what is the 315 tho?

remote swallow
#

height map mayb

somber scarab
#

okay leme see

sacred berry
#
@EventHandler
    public void onBlockPlace(BlockPlaceEvent event) {
        Block b = event.getBlockPlaced();
        b.getLocation();
        int x = b.getX();
        int y = b.getY();
        int z = b.getZ();
    }

How do I make those integers public? So I can use them in other classes

somber scarab
#

other way around

remote swallow
#

++value returns then does stuff, value++ does it then returns

trail carbon
#

Hello, I am having some troubles understanding angles, I am trying to make a ring of fireballs around the player when they right click the ground, here is the code I have so far. ```java
else if (pChest.isSimilar(blazeChestplate)){
int angleChange = 360 / fireballs * 2;
for (int i = 0; i <= fireballs; i++) {
Fireball fireball = (Fireball) world.spawn(player.getEyeLocation().setDirection(new Vector(0,0,0)), Fireball.class);
fireball.setDirection(new Vector(angleChange * i, 0, 90));
}
}

#

fireballs is 8 btw

#

all it does is fire straight at the ground

somber scarab
#

OMFG

trail carbon
#

Is this a EulerAngles situation?

fossil monolith
#

hey how do i install buildtools

quiet ice
remote swallow
undone axleBOT
fossil monolith
#

yeah i got the jar and setup it on windows

quiet ice
#

for it to fire in a circle at least two cords would need to be != 0

jolly forum
#

Hi, could someone tell me how I can disable a TextComponent as soon as I click on it?

fossil monolith
#

but the progress so far is that i have the folder with buildtools in it.

quiet ice
#

but you only set x

remote swallow
#

open gitbash/command promt/ powershell there

fossil monolith
#

but now how do i add that so that intellij actually works for

            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.19.4-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
remote swallow
#

have you ran buildtools

fossil monolith
#

how ☠️

quiet ice
#

?bt

remote swallow
#

do you have the jar installed

undone axleBOT
fossil monolith
#

yeah

fossil monolith
#

C:\Users\a\Downloads\Plateou\BuildTools

#

a@DESKTOP-EVOI9U7 MINGW64 ~
$

jolly forum
fossil monolith
#

this is what i got

#

how do i run it

#

--compile craftbukkit?

remote swallow
#

now type java -jar BuildTools.jar --rev ver

fossil monolith
#

a@DESKTOP-EVOI9U7 MINGW64 ~
$ java -jar BuildTools.jar --rev ver
Error: Unable to access jarfile BuildTools.jar

quiet ice
remote swallow
#

cd C:\Users\a\Downloads\Plateou\BuildTools

fossil monolith
#

ok

remote swallow
#

then java -jar BuildTools.jar --rev 1.20.1

jolly forum
sacred berry
#
public static void startGeneratorScheduler() {
            Main plugin = getInstance();
            Bukkit.getScheduler().runTaskTimer(me.Bamle.Main.getInstance(), () -> {
                Location generatorLocation = new Location(location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ());
                generatorLocation.getWorld().dropItem(generatorLocation.add(0.5, 1.0, 0.5), new ItemStack(Material.DIAMOND));
            }, 0, 100); // 100 ticks = 5 seconds
        }

I get an error at the parenthesis at "startGeneratorScheduler()"

quiet ice
sacred berry
smoky anchor
#

try compiling, it will tell you

remote swallow
#

hover over it

fossil monolith
#

ok that works now

remote swallow
#

finish*

fossil monolith
#

ah wait

#

The version you have requested to build requires Java versions between [Java
17, Java 20], but you are using Java 8

remote swallow
#

specify the direct path to java.exe in java17

fossil monolith
#

linux?

remote swallow
#

if you dont have java 17

#

?java17

undone axleBOT
fossil monolith
#

as linux

remote swallow
fossil monolith
#

is that windows

remote swallow
#

in windows it wants the .exe on linux it has no extension

fossil monolith
#

which one linux or window

#

to install

remote swallow
#

do you have linux or windows

sacred berry
fossil monolith
#

i have windows

remote swallow
#

so you install windows

fossil monolith
#

i thought u run it like buildtools

remote swallow
#

you dont have the right java version to run buildtools

quiet ice
#

If you have linux use sudo alternatives --config java

#

After installing the right java version through your package manager (unless you already did that that is)

smoky anchor
#

?paste

undone axleBOT
fossil monolith
#

isnt it java 17 not jdk

remote swallow
#

java 17 is the jdk

#

jdk is java development kit, its still java

sacred berry
fossil monolith
#

oh

trail carbon
smoky anchor
fossil monolith
#

still doesnt work with jdk

remote swallow
#

specify the path to it

fossil monolith
#

what path

#

buildtools?

remote swallow
#

the file path

fossil monolith
#

path to jdk?

remote swallow
#

to the java.exe in the jdk

quiet ice
remote swallow
#

jdk-version/bin/java.exe

fossil monolith
#

jre-8u371-windows-x64

#

is this it?

remote swallow
#

thats java 8

quiet ice
remote swallow
#

you need 17

fossil monolith
#

OpenJDK17U-jdk_x64_windows_hotspot_17.0.7_7

sacred berry
remote swallow
smoky anchor
fossil monolith
#

what do i do with that

fossil monolith
remote swallow
#

do you have an msi file

fossil monolith
#

yes

remote swallow
#

double click it

fossil monolith
#

yes

remote swallow
#

then follow the instructions

fossil monolith
#

i installed

serene sigil
#

hey, is there any good tutorial on how to make a multi-version compatable spigot plugin?

sacred berry
fossil monolith
#

do i go to

#

java runtime settings

remote swallow
#

now get the instalation path

smoky anchor
remote swallow
#

now go to c:\users\Program Files\ its either in Java, Eclipse Adoptium or Eclipse Foundation

sacred berry
quiet ice
#

The angle is basically your 360 / fireballs * i I reckon

remote swallow
remote swallow
fossil monolith
#

C:\Program Files\Java

#

C:\Program Files\Java\jre1.8.0_351

remote swallow
#

nop

#

thats java 8

#

you need to find java 18

fossil monolith
#

C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-hotspot

remote swallow
#

yes

sacred berry
fossil monolith
#

what do i do wit dat

smoky anchor
remote swallow
#

then at the top of your screen press copy path

smoky anchor
sacred berry
#

Well I know, just a stupid mistake

fossil monolith
#

C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-hotspot\bin

remote swallow
#

find java.exe

#

or it might just be called java

fossil monolith
#

yes its in that file

remote swallow
#

click it once to select it and press the copy path button

quiet ice
fossil monolith
#

i dont have a copy path

remote swallow
#

press the drop down arrow on the top right

fossil monolith
#

yeah

#

oh

#

"C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-hotspot\bin\java.exe"

remote swallow
#

yeah

fossil monolith
#

okl

#

what do i do with that

remote swallow
#

now go back into gitbash, paste it and you should end up with "C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-hotspot\bin\java.exe" -jar BuildTools.jar --rev 1.20.1

serene sigil
#

if I make a plugin for 1.8.9, will it still work in 1.20?

remote swallow
#

no

#

1.8.9 is a client only version

serene sigil
#

what does that mean?=

remote swallow
#

1.8.8 is the server version, if you dont use nms it will work

fossil monolith
#

EZ

#

its cloning

#

if i restart my pc

remote swallow
fossil monolith
#

i gotta reopen it?

remote swallow
#

yeah

fossil monolith
#

ok

remote swallow
#

just wait for it to finish

fossil monolith
#

ima save the thing then

quiet ice
serene sigil
remote swallow
#

it takes 5-10 minutes normally

#

if you dont use nms yeah

serene sigil
#

not much

serene sigil
quiet ice
#

Invoking event constructors could for example be the end

trail carbon
#

@quiet ice Thank you, that worked, however now the fireballs are bouncing on each other

serene sigil
remote swallow
#

just the 1.8.8 api

fossil monolith
#

so

#

now i got buildtools

#

wait

remote swallow
#

once it finishes running you will have a spigot-1.20.1.jar in the folder BuildTools.jar is in that is your server jar

fossil monolith
#

npo

#

im using pufferfish/papermc

#

very fast

remote swallow
#

okay?

fossil monolith
#

so i dont have to change

remote swallow
#

do you need buildtools for plugin dev then?

fossil monolith
#

is in that your server jar

fossil monolith
#

intellij

#

i need the jars or something

remote swallow
#

use maven

fossil monolith
#

i have that yeah

fossil monolith
#

my dev told me to get nms

#

no i know how

remote swallow
#

do you know java

fossil monolith
#

i just needed buildtools for the classes

#

yeah

#

i take computer shiene

#

but yeah my dev has a whole core made already

#

and i just needed to modify sendactionbar some random classes and add my own

#

so do i import these jars

remote swallow
#

what do you need to modify that for

fossil monolith
remote swallow
#

you just call the method

#

what

fossil monolith
#

uh

#

ok

remote swallow
#

you cant change server code and have it change on the client too

fossil monolith
#

im new to intellij

remote swallow
#

if you change code on the server to make something look different on the client it wont work, you would need to change the client code

fossil monolith
#

ok its fully installed

serene sigil
#

@remote swallow this?

fossil monolith
#

how do i add images

serene sigil
#

what version?

remote swallow
fossil monolith
#

for example

quiet ice
fossil monolith
#

import net.minecraft.world.entity.player.EntityHuman;

remote swallow
serene sigil
#

thx

somber scarab
#

When I do Chunk.getX() getZ(), why are the coords not exactly on one of the edges of the chunk?

fossil monolith
#

ok there

remote swallow
#

theres block and chunk coords

fossil monolith
#

here look

#

those are nms he said

remote swallow
#

change the import

fossil monolith
#

to wat

remote swallow
#

spigot instead of spigot-api

somber scarab
fossil monolith
fossil monolith
somber scarab
#

wait.. getblock

fossil monolith
#

so buildtools

somber scarab
#

ahh

remote swallow
remote swallow
fossil monolith
#

how do i change them ☠️

remote swallow
#

open pom.xml

#

idk how your doing comp sci and havent used maven at alla

fossil monolith
#

bro

#

its like console

#

oh wait

remote swallow
#

you have a dev? why isnt he doing it

fossil monolith
#

spigot-api not spigot

fossil monolith
#

pedro

#

he devs for donutsmp

remote swallow
remote swallow
fossil monolith
fossil monolith
#

but its like i need to test yk

round finch
#

?bootrap

remote swallow
#

ask him to build it for you

#

and send you the jar

fossil monolith
#

i changed it to spigot-api

#

and it works now

#

but the imports dont work

remote swallow
#

just ask your dev to build it for you

#

its way easier than me explaning it

fossil monolith
#

no no it works but

#

those imports

cinder abyss
#

Hello, how can I get the particle of the block break ?

ocean hollow
#

how do i teleport an entity to another so that it is one block to the right?

remote swallow
#

those imports are nms, you ran buildtools for 1.20.1, you needed 1.19.4 im guessing

round finch
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

quiet ice
#

(also applies to future versions)

remote swallow
#

someone should update that to the spigot jars since 1.18

native ruin
ocean hollow
#

and at the same time take into account the rotation of the entity

sacred berry
young knoll
#

Plugin is null

tender shard
young knoll
#

But reading is hard :(

serene sigil
#

@remote swallow I created a plugin with version 1.8.8 but it gives me an error

tender shard
#

the following api versions exist:
1.13, 1.14, 1.15, 1.16, ... 1.20

serene sigil
#

oh

tender shard
#

for 1.8.8, do not set any api version

serene sigil
#

u mean in the yml

tender shard
#

yes

#

in plugin.yml

serene sigil
#

what is the api version even for?

#

does it matter if i choose a different one

tender shard
#

if it's set, legacy material support is disabled

#

if it's unset, legacy material support is enabled

serene sigil
#

so what would u recommend?

tender shard
#

which versions is your plugin supposed to run on?

serene sigil
#

1.8.8-1.20

#

on any

chrome beacon
#

1.13

young knoll
#

Use 1.13 then

serene sigil
#

alr

tender shard
#

but then you get issues with materials

#

I would not set any API version and use legacy material names

#

oooor: I'd not support anything below 1.16, easiest fix

quartz spruce
#

Hello i am having this error with my code when executing a command

young knoll
#

Read it

#

Specifically the nice little line that says “Caused by”

serene sigil
#

thx now it works!

tender shard
tender shard
#

no

#

what's Currency1_19 line 220? How does the config look like?

quartz spruce
#
  power: 0.16559999999999997
  amount: 100.0
  totalvalue: 18.0
  economic-activity: 0.9199999999999999
  description: defaultDescription
  peers: 1
  author: RGn3
  team:
    RGn3:
      mint: true
      deposit: true
      rename: true
      description: true```
#

this is what the config is like

tranquil prairie
#

Why does this return empty

data.getStringList("stakes")

with this yml?

stakes:
  test:
    price: 111
tender shard
quartz spruce
somber scarab
#

Do I have to implement all methods when I wanna make anew worldborder() ??????

tender shard
tranquil prairie
#

Oh I see

tender shard
#
this:
  is:
    a: configuration section
#
this-is-a-map-list:
  - name: "mfnalex"
    age: 28
  - name: "someone else"
    age: 999
tender shard
#

you are supposed to use the factory method in the Bukkit class

somber scarab
#

okay thanks

tranquil prairie
#

@tender shard thanks for the help btw

tender shard
#

np

rough drift
#

what do you need

remote swallow
#

needed you to translate something earlier

tranquil prairie
#

How do I remove a key from a configuration section?

#

I tried data.getConfigurationSection("stakes").set(name, null); but if I opened the file it was still there

tender shard
#

you also have to set the config section back

#
ConfigurationSection section = getConfig().getConfigurationSection("stakes");
section.set("name", null);
getConfig().set("stakes", section);
saveConfig();
eternal oxide
#

grr spigot now requiring 2fa to post an update? 😦

tranquil prairie
# tender shard ```java ConfigurationSection section = getConfig().getConfigurationSection("stak...

Im not using the config.yml Im using a custom yml file and I still have the same problem after updating my code. I think its something with dataFile not updating? Not sure

private void save() {
        try {
            data.save(dataFile);
        } catch (IOException e) {
            Bukkit.getLogger().log(Level.SEVERE, "Failed to log data.");
        }
 }

public void removeStake(String name) {
        ConfigurationSection section = data.getConfigurationSection("stakes");
        section.set(name, null);
        data.set("stakes", section);
        save();
    }```
pine fable
#

Hello, about a week ago I bought a plugin [ItemsAdder] I thought it was a correct platform, it turns out that they haven't delivered my plugin yet...

nimble oxide
pine fable
#

im buy in spingot

#

site web

somber scarab
#

spingot or spigot?

pine fable
#

spigot

#

sorry

nimble oxide
#

send link

somber scarab
#

then you should message support

tender shard
#

#general

somber scarab
pine fable
#

How do I send a message to support?

somber scarab
pine fable
#

thanks

flint coyote
#
long millis = System.currentTimeMillis();
player.chat("test");
System.out.println(System.currentTimeMillis() - millis);

Dang that function is slow for some reason. It's 2-4ms

#

Probably faking packets or whatever

quaint mantle
#

theres no way its 4ms

flint coyote
#

I even hit higher numbers (rarely)

#

never below 2 though

opal juniper
#

do you have a chat listener running

flint coyote
#

not that I know of

#

oh actually yes I do. It just sets a format. Lemme disable that

eternal oxide
#

Thats not Spigot

tall sparrow
#

whoo^ps

desert tinsel
#

is there any event to catch when a player switches his hotbar selected item?

eternal oxide
#

inventoryClickEvent

flint coyote
#

Alright without the chat listener it's somewhat consistent 2ms. Rarely 1

quaint mantle
#

How would I check a player's reach? I've tried using pythagoras to find it. By using an event to find out when someone attacks:

package AC.Checks.Combat;

import AC.Checks.Main;
import AC.Checks.Return.ReturnChatMessage;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;

import java.text.DecimalFormat;

public class Reach implements Listener {

    public Double difference(Double a, Double b) {
        Double toReturn = Math.abs(a - b);
        return toReturn;
    }

    public double round(double d) {
        DecimalFormat twoDForm = new DecimalFormat("#.###");
        return Double.valueOf(twoDForm.format(d));
    }

    @EventHandler
    public void attackEntity(EntityDamageByEntityEvent event) {
        if (event.getDamager() instanceof Player) {
            Player attacker = (Player) event.getDamager();
            Entity attacked = (Entity) event.getEntity();
            Integer minDetection = Integer.valueOf(Main.plugin.getConfig().getString("AC.Logs.Reach.MinDistance"));

            Double distX = difference(attacker.getLocation().getX(), attacked.getLocation().getX());
            Double distZ = difference(attacker.getLocation().getZ(), attacked.getLocation().getZ());
            Double distY = difference(attacker.getLocation().getY(), attacked.getLocation().getY());

            Double reachDist = round(Math.sqrt((distX * distX) + (distZ * distZ) + (distY * distY)));

            if (reachDist > minDetection) {
                new ReturnChatMessage().ReturnChatMessage("&4" + attacker.getName().toString() + "&7 has failed &4Reach &7[" + reachDist + "]&r", Main.plugin.getConfig().getString("AC.Logs.Reach.ViewReachPermission"));
            }
        }
    }
}

However this just constantly false-flags? Any ideas?

eternal oxide
#

oh no

desert tinsel
young knoll
#

PlayerItemHeldEvent

#

Iirc

tardy delta
#

why are you creating a double wrapper

eternal oxide
#

yep

quaint mantle
desert tinsel
tardy delta
#

use a primitive

tranquil prairie
#
private void save() {
        try {
            data.save(dataFile);
        } catch (IOException e) {
            Bukkit.getLogger().log(Level.SEVERE, "Failed to log data.");
        }
    }

    public void removeStake(String name) {
        ConfigurationSection section = data.getConfigurationSection("stakes");
        section.set(name, null);
        data.set("stakes." + name, null);
        save();
    }```


Everytime I do this it works untill I reload or restart server. Is it possible this is because i run saveDefaultConfig in onEnable?
tardy delta
#

did you assign getConfig() to a local variable? if yes theres your problem

#

@tranquil prairie

tranquil prairie
#

omfg im so stupid

#

i left in a line that created it each time for testing

tardy delta
#

why is stuff static and other stuff public

#

also YamlConfiguration.loadConfiguration() is a thing

remote swallow
#

idk what ur on, i dont see static

#

oh

#

other than the dataFile

tranquil prairie
rough drift
shadow night
#

Make sure you are using correct numbers, idk exactly what it returns but it might returns kilobytes for ram.

remote swallow
fluid river
#

jree

tardy delta
#

turns out 0x1.0p-53 is a valid double literal

livid dove
#

So sanity check question / hot take...

CommandExecutor... its is really daft the parameters were not collated into some sort of "CommandSenderInfo" class.

Because thats a lot of parameters that just make Javadocs a mess.

Have I missed something? Or is it just poor practice thats crept through the many forks as "god if we do that a lot of a stuff is gonna break" ?

tardy delta
#

you are talking about ::onCommand?

livid dove
tardy delta
#

dont see any problems with it

livid dove
#

neither did i until this:

If we pretend it isnt onCommand for a second and just think of it in terms of "number of parameters for a method" , we'd probably rinse the dude who made a method like this lol

#

i used the params from onCommand to do something else and was making java docs and well... lol

young knoll
#

4 params isn’t that much

tardy delta
#

wait until you see jdk methods will 16 params

young knoll
#

I think my ide yells at me past 7