#help-development

1 messages ยท Page 1434 of 1

dusty herald
#

debug maps[0]

#

what is the value?

#

and team, what is that value?

#

and double check this data is actually in the config and exists when you request it

#

might just not be loading anything from your locations.yml

river shell
#

Looking to hire a dev - needs to be very good with MC world gen source. Willing to pay a premium. please contact me!

wispy fossil
#

?services

queen dragonBOT
wispy fossil
#

ooo right command

#

@river shell have a lookie up there

river shell
#

I have unfortunately, not many bites!

wispy fossil
#

oh strange!

#

well if I can ask, what specific aspect of world gen?

river shell
#

Trying to give away some money here I can't believe how hard it is haha

wispy fossil
#

yeah usually devs are up for anything if its paid

river shell
#

I want to be able to generate chunks with a cli tool

#

Given seed, xz and radius

wispy fossil
#

on that's interesting

river shell
#

And which realm/level it's in

#

Has to be fast.

#

If possible, I'd prefer just all ore vein XYZ and abundance to be saved to a Json/yaml file

#

Ore to start with anyway

wispy fossil
#

ah so, the plugin would be

  1. fetch a chunk given the x,y coords and world
  2. find ore veins in chunk
  3. save them into file
river shell
#

Yep exactly. Or if the ore gen can be run by itself and just hand back XYZ and abundance, even better

wispy fossil
#

doesnt sound too complicated.
did you make a thread in the development hiring category?
usually there are plenty of hungry devs, weird how no one's applied

river shell
#

Oh that's right! I don't have perms on spigot

#

It's forge I posted on

wispy fossil
#

oh haha

river shell
#

Need a week and 20 posts which I can't spend time doing right now unfortunately

wispy fossil
#

to create a thread? really?

#

didnt know that

#

i'd just check the Offering category, msg everyone there who seems capable enough.
that plugin sounds pretty basic though, I'm sure some newer devs would love the chance at a low cost

river shell
#

I've done about 20 I think and all said can't do or no-show so far

#

Thanks for the link I'll contact him! Honestly though I think it's one of those ones that sounds simple but it's going to take someone who really knows what they're doing

#

I've already paid one dev and I don't think they're going to satisfactorily complete it

river shell
slow galleon
#

Hello, I'm new to Java and coding minecraft plugins. I know some basic java. I actually saw this video of Dream and George(Minecraft youtubers) who also code their own plugins. Here he is using an arduino with using Java code. I just want to know how that works, like are their any dependencies of stuff. I'll show an image of the code.

#

Im not copying their code or anything Im just curios how can an arduino work with java

#

Also I asked about this in this server coz its about minecraft

chrome beacon
chrome beacon
#

Yeah it's the API I linked above

ivory sleet
#

Ah

slow galleon
#

oh lemme check

#

ok maybe im just too dumb idk how to even add that

#

well thanks for helping tho

quaint mantle
#

jesus

slow galleon
#

lol ok can someone help me how to add tat?

#

pls

chrome beacon
slow galleon
#

All I know is java

chrome beacon
slow galleon
#

oh

#

thanks mate

chrome beacon
#

If you have any questions ping me

solemn glade
#

Can you fine fellers share a few tips and tricks for tidying up code? :D Just learnt about switch, which is better than using 100 if's and I wonder if there are any other ways to make code more efficient.

chrome beacon
#

I wouldn't worry about it too much

#

Mostly learn as you go, but if you want feedback on your code feel free to post it here

slow galleon
#

Ok Olivo I read about it. So how do I like uk import that thing?

wraith rapids
#

you read the maven guide and then follow it

chrome beacon
#

Here's the dependency:

<dependency>
    <groupId>com.github.kurbatov</groupId>
    <artifactId>firmata4j</artifactId>
    <version>2.3.8</version>
</dependency>
slow galleon
#

oh

wraith rapids
#

since the repository isn't mentioned it's likely at maven central

slow galleon
#

wait lemme do that real quick

solemn glade
#

Two different events run the same code. Is there a way to only need to write this code once?

wraith rapids
#

yes

#

declare a method and move the code there

#

and then call the method from the event handlers

slow galleon
maiden briar
#

*Bungee is active!

chrome beacon
slow galleon
#
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>groupId</groupId>
    <artifactId>CustomPlugins</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>com.github.kurbatov</groupId>
            <artifactId>firmata4j</artifactId>
            <version>2.3.8</version>
        </dependency>
    </dependencies>

    
</project>```
#

like that?

chrome beacon
#

Yes but you should have a better groupId and artifiactId

slow galleon
#

line no. 8 and 9 right?

chrome beacon
#

Yes

wraith rapids
#

use your domain or github or whatever for the group id

slow galleon
#
<groupId>com.github.Aaryesh24</groupId>
    <artifactId>CustomPlugins</artifactId>
    <version>1.0-SNAPSHOT</version>
``` this ok?
#

jeeez this is too complicated

chrome beacon
#

It's not really complicated. groupId should be your package and artifactId plugin name

slow galleon
#

ok my plugin name is 'CustomPlugin'

#

and ill let the group id the github one xD

#

alr thanks its done

#

๐Ÿ˜„

slow galleon
#

Im getting this error while copying his code....maybe ill do this thing someday when im capable enough of understanding this xD

lofty mulch
#

did you try to load plugin without spigot?

wraith apex
#

Lol

vast quest
#

how can I make a material glowing?

#

without enchants

proper notch
#

the only way is with enchants.

#

You can then disable the showing of item enchants if you wish though

vast quest
#

I have seen plugins not use enchants

proper notch
#

And how do you know they don't?

vast quest
#

uh

#

when I add enchantments to that item

#

the enchant still shows

proper notch
#

Did you like... read what I said?

#

You can then disable the showing of item enchants if you wish though

vast quest
#

Yeah

#

but the item does not have enchantments and it still glows

#

when I add enchantments the enchants show

wraith apex
#

You can add an ItemFlag to the meta of the item

#

to stop the item showing enchants

solemn glade
#

you can add a flag that makes the item glow like its enchanted

vast quest
#

And whats that flag

#

and how do I do that

wraith apex
#

ItemFlag.HIDE_ENCHANTS

vast quest
#

nothat would hide enchants

#

thats not what he said

#

you can add a flag that makes the item glow like its enchanted

candid galleon
#

really? what flag?

solemn glade
#

/give @p stone{Enchantments:[{}]} 1 is vanilla atleast

candid galleon
#

I'm on LogicalDark's side here

wraith apex
#

that flag doesn't exist

solemn glade
#

i guess just give it an enchantment flags with no enchants

wraith apex
#

Give the item in question an enchantment that doesn't perform its effect when used. Like adding luck or fortune to anything but tools

#

and just hide the enchant

solemn glade
#

try
Bukkit.getUnsafe().modifyItemStack(item, "{Enchantments:[{}]}");

wraith apex
#

I don't think that's going to work...

#

a Null map

solemn glade
#

get the item meta first

wind veldt
#

What's the difference between HashSet, ArrayList and List? I wanted to set a list in my config and iterate it over in my plugin so people can add things, but I'm new and don't really understand it

wraith apex
#

HashSet is a collection of unique objects

candid galleon
#

Sets can't have duplicates

wraith apex
#

ArrayList is an implementation of a List

candid galleon
#

Arraylist is an implementation of a list

wraith apex
#

List is an interface

candid galleon
#

nice

wraith apex
#
List<String> list = new ArrayList<>();
candid galleon
#

think of it like this: all arraylists are lists, but not all lists are arraylists

#

ie, all dogs are animals but not all animals are dogs

wraith apex
#

List is an interface. So it basically dictates the minimum methods an implementation must implement

#

List has multiple implementations

#

the most commonly used is ArrayList

#

You also have others like LinkedList

wind veldt
#

Woah, didnt expect this much help

#

Thanks

#

:D

wraith apex
#

Don't use LinkedList unless you have a scenario which can utilise it well though

wind veldt
#

Alright

wraith apex
#

Same for sets

proper notch
#

also btw by default, a set will not have an order to it.

wraith apex
#
Set<String> set = new HashSet<>();
wind veldt
#

Can I use sets for like emote list?

candid galleon
#

what do you mean exactly?

wraith apex
#

Sets are unordered

vast quest
#

ok uh

#

how can I use a var that i set on enable on a event?

proper notch
#

Expand on what you mean by use.

#

As in, use in another class?

vast quest
#

like

proper notch
#

Or another method?

vast quest
#

another method

wraith apex
#

If you declared a variable in the scope of onEnable(); then you can only use it in the scope on onEnable unless you pass it to another method

proper notch
#

You can pass a variable in through a method's parameters.

vast quest
#

?

quaint mantle
#

Is there a way to get change in X or Z? .getvelocity always returns zero

wraith apex
vast quest
#

and how do I do that

proper notch
#

public void method(String value, int value2, double value3) {
do stuff with method
}

wind veldt
#

Ymm I also thought of something like key and value pair, because when im making emotes, it is like <3 = ๐Ÿ’™

vast quest
#

well uh

solemn glade
#

whyhax did you figure out how to get an item without enchants yet?

vast quest
#

im trying to use it in a event

proper notch
#

Oh, make it a class wide variable then.

vast quest
solemn glade
#

yay i helped

wraith apex
#

Unlike an array list though you'd iterate via

Set<Object> set = new HashSet<>();

for(Object o : set)
{

}

// or

set.stream().forEach(v -> );
silk hamlet
#

with enchantglint?

vast quest
wraith apex
#

Or use an iterator

vast quest
#

this is what I have

wind veldt
#

LogicalDark lets go on pv, I'll describe the problem better

proper notch
#

class Thing {
private int value;

public void onEnable() {
this.value = 5;
}

public void whateverEventThing(ThatEvent event) {
int newValue = this.value + event.getIdk();
}
}

vast quest
#

o

#

ok

wraith apex
#

vc?

wind veldt
#

Pv

vast quest
#

like this?

#

private ItemStack witherCoal;
@Override
public void onEnable(){
this.witherCoal = new ItemStack(Material.BLACK_DYE);

wind veldt
#

@wraith apex accept friend request please

#

Cant write on pv

vast quest
#

just drops a black dye

candid galleon
#

just make sure to add HIDE_ENCHANTMENTS to it

solemn glade
#

whyhax didn't want to hide enchants though. good alternate solution nontheless

candid galleon
#

then add the enchantment strings to the lore

#

and- if you don't want to hide the enchantments then I see no issue?

#

better yet if it's already enchanted then no need to add a fake enchant

solemn glade
#

true but whyhax needed it that way

vast quest
#

how can I add attribute?

vast quest
#

can someone hlep

#

i explained everythning there

young knoll
#

.equals or .isSimilar

#

However both require the same durability iirc

#

Use pdc to add a value to the item

vast quest
#

I mean

#

if they are crafitng that item

#

im pretty sure it would just be that item

#

It works

#

thanks!

vast quest
#

AttributeModifier modifier = new AttributeModifier("damageModifier", 50, AttributeModifier.Operation.ADD_NUMBER);
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, modifier);

#

why doesnt this work

#

no errors

young knoll
#

Did you set the meta back

vast quest
#

o

#

take that as a no

#

:d

#

OK uh

#

how can I make it so its only hand

#

?

wanton knoll
#

yo I dont suppose i can have a hand, feeling a little out of depth but i have been working on this for so many hours with no progress. I have made a custom crafting GUI with a custom optifine pack to go with it (ill post a screenshot below). Now I want to put the default mc crafting recipes in there, but i cant get it close to working :/

I keep going back to this post: https://www.spigotmc.org/threads/creating-a-custom-crafting-gui.430406/

Is there an easier way to go about this - i am happy to use an API if needs be

#

nvm wont post a picture below since no image perms

weary geyser
#

This is not really spigot related, but how do you stop a folder from disappearing and moving all it's files to the main directory? And I can't get them by doing getClass().getClassLoader().getResource()

eternal oxide
#

files/folders don;t move unless you move them

weary geyser
#

When I compile all the contents of the folder gets moved to the main dir and the folder disappears

eternal oxide
#

then thats what your build enviroment is configured to do

weary geyser
#

How would I change that? I compile it with maven

eternal oxide
#

are you using some custom jar configuration in your pom?

weary geyser
eternal oxide
#

which folder is your issue? resources or something with your dependencies?

vast quest
#

How do I make a attirubte only work for hand

granite arch
#

This maybe isn't the right place to ask but I want to know what format I should store for my ignore system (I'll be using mongodb kinda like json), the key for each document is the player uuid but do I use something like an arraylist to store the players ignored players (uuid) if that makes sense sorry if Im wording this so stupidily so kinda like

uuid: myuuid
ignoring:
    - uuid1
    - uuid2
    - uuid3```
eternal oxide
vast quest
#

nono

#

Ok so

#

I got this rn

#
        AttributeModifier modifier = new AttributeModifier("damageModifier", 50, AttributeModifier.Operation.ADD_NUMBER);
        witherSwordMeta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, modifier);```
#

but it gives to like

#

everything

#

cant I just make the attribute modifier to give the attribute if its hand

eternal oxide
#

hand?

#

you have hand and offhand

vast quest
#

I just wnat it to give to the When in main hand section

eternal oxide
#

as far as I know there is no API method to do that. What you see there is Lore on the item. You'd have to monitor PlayerItemHeldEvent and apply or remove the effects.

vast quest
#

but like

#

cant I just make it so it only gives it to When in main hand

#

cuz like it is a thing on normal mc

eternal oxide
#

Monitor PlayerItemHeldEvent

#

Not as far as I know

#

sec

#

Seems if you apply a SLOT TAG

vast quest
#

how

#

OK so

#

there is Equipment slot

#

but it wnats me to put a uuid

vast quest
#

It wants UUID

#

but idk how to get the UUID

#

nor what it does

ivory sleet
#

UUID.randomUUID()

#

or smntg mb

vast quest
#

seems to work

#

lemme try

#

IT WORKS

#

Thanks

untold rover
#

Hey can someone help me? I am Trying to hide a player from the Tablist using ProtocolLib. currently I have this Java var packetContainer = protocolManager.createPacket(PacketType.Play.Server.PLAYER_INFO); packetContainer.getPlayerInfoAction().write(0, EnumWrappers.PlayerInfoAction.REMOVE_PLAYER); try { protocolManager.sendServerPacket(player, packetContainer); } catch (InvocationTargetException e) { e.printStackTrace(); } but its not working because I don't know how to specify who to hide

molten tree
#

does anyone have any experience using a VPS or a proxy to host a minecraft server? I could use some help lol, thanks

idle grotto
molten tree
# idle grotto What exactly do you need help with?

well i have a server i host on a pc and i want to make it massively public. with my friends i just give them my public ip, but i obviously cant do that with random people. from my understanding i need to set up a vps or some kind of proxy server

glossy barn
#

But since we are here, I would recommend using another machine that isn't your home PC.

idle grotto
molten tree
#

from my understanding bungee cord is a widely used "thing" that does alot of the complex stuff, right?

#

i would need to rent some kind of server, i was thinking maybe an azure vm but it may be cheaper to find a minecraft server hosting website because alot of them sell a bungeecord service

idle grotto
#

Bungeecord is a proxy, basically allows you to connect multiple spigot servers into a network

#

There are minecraft only server hosting sites, but from what I've heard most of them are not really good

#

There are services that offer bare metal or vps's, on which you can host whatever you want (including bungeecord). If you have the ability, you'd probably be better off using one of those

sullen dome
#

there are good one's

#

but then, there are bisecthosting and apex

#

and stuff

molten tree
#

i know amazon has some sort of free proxy thing

sullen dome
#

if you wanna run only-minecraft, take a look at
bloom.host
thats where i am

molten tree
#

so you just use that for bungeecord?

sullen dome
#

thank you discord, for your dumb link feature

#

you can yeah

#

one sec

#

this one for example
you can split it into 4 different servers.
so for example:
main/1: bungee
2: lobby
3: survival
4: creative

#

and tbh, a ryzen 9 for that price is juicy

tribal holly
#

Someone know how to remove the compass travel from worldEdit with a plugin ? (without change config.yml)

sullen dome
#

maybe do an own event? idk if they overwrite

tribal holly
#

own ?

sullen dome
#

yeah, you're in help-development

tribal holly
#

yep i know

#

what's own event ?

molten tree
#

ah okay. so i have a physical pc i use for a server at my house, so i could get someone like that (not a beefy) and just link that to my server. i plan to just run a survival. so i would just be using bungeecord as a proxy

sullen dome
tribal holly
#

bro what do you mean by own event

#

i know what is an event

sullen dome
#

if you can port-forward, yeah.
then you could host it by yourself

#

CREATE A LISTENER

#

wtf

tribal holly
#

yeah and you listen what ?

sullen dome
#

to the compass click?

#

if you know how events work, you should be able to do that

idle grotto
sullen dome
#

true tho

#

proxy's are used to make a whole network of multiple servers

tribal holly
sullen dome
#

using bungeecord with just one server is completely redundant

#

then idk

molten tree
#

ahh okay, yeah im just know kinda learning ab this stuff so bare with me lol

sullen dome
#

why not just disabling it in yml? lol

#

it's that easy

tribal holly
#

by my own

sullen dome
#

i see

tribal holly
#

any user interraction required

sullen dome
#

maybe it works with the worldedit-api? idk

tribal holly
#

i already ask on them discord server but the tell me that i'm stupid and do it manually

#

so well

#

nice developers...

#

and i still don't understand why they implement this stupid fonctionality inside WE

sullen dome
#

yeah, worldedit devs are toxic tho

eternal oxide
tribal holly
#

hoo i forget this solution i'm trying

sullen dome
#

i asked one time, how to define a worldedit world, and they're just like
read your docs

yeah duh, your docs sadly are not telling that

sullen dome
#

oh true, there's event priorities

#

forgot lmao

eternal oxide
#

what priority did you try?

tribal holly
#

HIGHEST

sullen dome
#

?

molten tree
#

sorry i replied to the wrong thing at first

eternal oxide
sullen dome
#

not really

tribal holly
#

HIGH so ?

sullen dome
#

i guess you just need a domain?

eternal oxide
sullen dome
#

i mean sure, a vps would do it, but it'd still have a digit-ip

tribal holly
#

LOWEST okay

sullen dome
#

just get a domain i'd say.

way cheaper

#

way way way cheaper

tribal holly
#

okay it work thx

idle grotto
#

Could be a vps, bare metal etc.

sullen dome
#

why using a vps for hiding your ip? tf

hybrid spoke
molten tree
#

wait maybe i dont

#

i got a dns from noip, a domain is different right?

#

im not a network guy XD i can set up all kinds of different servers on linux and thats about it

sullen dome
#

not what i meant

#

he wants to host a server on his own rig

molten tree
#

correct

sullen dome
#

and dont wants others see the ip

tribal holly
#

huuuuu the solution work for WE but not for FAWE.... wanna kill my self*

eternal oxide
#

If you host on yoru own server unless you use a service like Cloudflare you will be vulnerable

sullen dome
#

obv it doesn't. but thats not what a vps does. except it has a ddos-protection

and tbh, no one will ddos you if you don't have 500+ players

eternal oxide
#

Additionally most home IPs will not support over 10-20 players

sullen dome
#

why that

compact haven
#

@molten tree a domain just maps to your IP address

#

it doesnt hide it at all

eternal oxide
sullen dome
#

lol

compact haven
sullen dome
#

doesn't a domain is enough for him? i dont think he has like 500+ players

eternal oxide
#

I self host on a domain. It simply provides a DNS resolution, name to IP

sullen dome
#

and if it only supports like 20 people

#

yeah obv

#

but if he doesnt have that much players, no one cares about his real ip lol

compact haven
#

He probably doesnt want his IP to be public

eternal oxide
#

and allows you to redirect specific ports to other IPs

compact haven
#

even though it already is xd

eternal oxide
#

NO way to hide the IP with just a domain

sullen dome
#

no one wants to take in effort to get his ip

hybrid spoke
#

don't say that

#

there are enough

compact haven
sullen dome
#

tf

hybrid spoke
#

that just want to damage you

sullen dome
#

damage? he obv doesn't make money with that

#

there's no damage

compact haven
#

people have ddosed me before and I dont own a 500 player mc server, there are just some people out there

molten tree
#

i mean i have 300mbps up and down, so i would think there is pptential more quite a bit of people. but of course thats odds are small of that happening.

eternal oxide
#

If you host a web server from your home it can be ddos by a single person with a web browser (most home IPs

sullen dome
#

100down - 20up for me

#

enough

molten tree
sullen dome
#

only my up is trash tho

eternal oxide
#

I could ddos that with a simple F5 refresh on a web page

compact haven
#

right but a domain isnt going to hide your IP

#

I recommend just getting a vps or hosting it on an actual server

hybrid spoke
#

jff

compact haven
#

and not your home pc

hybrid spoke
#

without further reason

#

better said

#

they want to harm you

sullen dome
#

one sec. whats the worst on a ddos? isn't it just "disabling" your connection for a time?

hybrid spoke
#

damage wasnt the right word

eternal oxide
#

There is only one "safe" way to home host. Thats with a hosted server running Bungee as a front end to the server hosted at home.

compact haven
#

hm

#

havent though of that but that would work

#

since it acts as a proxy

molten tree
compact haven
#

well you still need to buy a server xd

molten tree
#

right, but it can be a cheap one

eternal oxide
#

being just a proxy you can get a cheap one though

compact haven
#

true

#

a bungee server doesnt need much

hybrid spoke
#

proxys doesn't need much

molten tree
#

500mb of ram is what i saw

eternal oxide
#

but be absoloutely certain you setup your server/bungee correctly

hybrid spoke
#

<500mb

eternal oxide
#

if you do not secure your server for Bungee it can be hacked

molten tree
#

i know some mimecraft server hosting services offer bungee

#

i was thinking maybe azure, but just some random server hosting service might be cheaper

compact haven
#

when you're looking at disk space but think its ram usage on your panel

molten tree
#

now a bungee server would have to have decent internet speeds corrrect?

compact haven
#

well it would be interfacing all of your players' connections

#

but for a handful of people it doesnt need to be like enterprise leve kek

molten tree
#

gotchya

#

thank you ALL for your help, yall saved me a lot of confusing googling lol

half bane
#

how do I check if player has specific tag?
i mean tags added by /tag command

vast quest
#

how can I make smth loop forever without creating a softlock

#

on enable

sullen dome
#
Bukkit.getScheduler().runTaskTimer(this, () -> {
//whatever you want to run
}, 0, 20); //20 means it runs every 20 Ticks, so every second
vast quest
#

how can I make that repeating

sullen dome
#

wdym repeating

upper vale
#

runTaskTimer is repeating

sullen dome
#

yeah

vast quest
#

forever?

upper vale
#

yes

vast quest
#

oh

upper vale
#

until you cancel

vast quest
#

ok

sullen dome
#

until you stop the task

#

every 20 ticks in this case

#

starts instantly, because 0

#

i personally don't like it because for me it doesn't run on a lag

#

so i use java's Timer

worn sierra
#

how should I store my map on redis, byte array or json?

#

which one takes less space?

half bane
#
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(label.equalsIgnoreCase("rankreload")) {
            sender.sendMessage("Przeล‚adowywanie rang graczy. To moลผฤ™ chwilฤ™ potrfaฤ‡.");
            for(int i = 0; i >= Main.plugin.getServer().getOnlinePlayers().size();i++){

               Main.plugin.getLogger().info("Reloading ranks "+ i);
                ArrayList<Player> currentList = new ArrayList<>(Main.plugin.getServer().getOnlinePlayers());
                Player current = currentList.get(i);
                
                if(current.getScoreboardTags().contains("vip")){
                    current.sendMessage("twoja ranga zostaล‚a oล›wieลผona");

                }

            }

        }
        return true;
    }

why for isn't running?

dull vault
#

Looking for plugin developers dm me

half bane
lusty cipher
#

so your player count would need to be 0 or less for the for loop to run

compact haven
#

but a byte array can be larger than json, if you're using like 1k bytes for everything?

dull vault
worn sierra
compact haven
#

@dull vault this is not where you hire developers

lusty cipher
compact haven
#

@half bane he wasnt talking to you, he's just advertising

eternal oxide
#

?services

queen dragonBOT
worn sierra
#

@half bane use for (Player player : Bukkit.getOnlinePlayers()) { player.sendMessage("reloading your rank..."); //do stuff... } instead

half bane
#

thanks! worked

worn sierra
#

you're welcome

vestal dome
#

does anyone know how to do uhh... AI?

#

well for an EntityPlayer at least?

eternal oxide
#

you can't put AI on a player

vestal dome
#

Citizens?

#

hello?

eternal oxide
#

Citizens uses NMS and overrides just about everything

eternal oxide
#

I have no clue what a gif is supposed to mean

vestal dome
#

you're a robot then

eternal oxide
#

and youre rude

vestal dome
#

cannot disagree ugh

chrome beacon
#

You will have to write your own AI for your NPCs

small thunder
#

Hi guys, i;ve question about spigot yml hopper settings

#

Are they also modyfing hopper minecarts?

#

Cuz im afraid they are not, and im wondering if im doing something wrongly or it is as it is

eternal oxide
small thunder
#

okay, i've pasted it there

ivory sleet
#

good boy

muted idol
#

hey @ivory sleet so i kinda passed out (it was 1am where i lived) but do you mind us to continue with redis (jedis)

#

i think i needed to create a pool, but im not really sure how to do that

#

do i need to create a new class or can i just create a new public void?

ivory sleet
#

do smtng like this:

class Conclure extends JavaPlugin {
  Jedis redis;
  JedisPool redisPool;
  void onEnable() {
    redisPool = new JedisPool(new JedisPoolConfig(),"localhost"); // ofc change this
    redis = jedisPool.getResource();
    redis.subscribe(new RedisListener(),"channel");
  }
  void onDisable() {
    redis.close():
  }
}
class RedisListener extends JedisPubSub {
  //override methods
}``` iirc
cold field
#

Hi guys, is it possible serialize an object into another object serialization?

#

I'm using the Bukkit API for object serialization

eternal oxide
#

All objects that implement ConfigurationSerializable (and primitives) can be nested.

cold field
#

ok, thanks

muted idol
#

https://imgur.com/a/LLq1Kdf
@ivory sleet looks like i got some errors, maybe i didn't import redis/jedis correctly. btw should i change localhost to my server ip/domain?

cold field
#

does the List<? extends Number> type is somehow already registered as serializable or do I need to do it manually?

lilac dagger
#

the natives should be registered already ๐Ÿค”

cold field
#

ok, thanks

#

If a variable can throw a NPE, what is the point of checking that it isn't null if the handling means throw another exception?

quaint mantle
#

can anyone help me executing commands from an website to my server using php or anything else?

ivory sleet
muted idol
#

alright now everything works as i should!

#

so now i have a class called RedisListener and it extends JedisPubSub as it should!

#

where do i continue to connect to the other server

#

im assuming i have to connect to it and then send requests to it

vital swift
#

hello, does any1 know how to sort tablist using teams? or simple way

lilac dagger
vital swift
#

so like

#

A B C

#

a - z

#

?

red bolt
#

if I need to make changes to a certain file in NMS that doesn't have a patch yet, can I just copy the file for the work dir buildtools makes?

#

then if I use makePatches it'll make a patch for that file right?

lilac dagger
vital swift
#

so no need to set prefix?

#

btw ur plugin is amazing the minigames of famous server

#

i haven't tried it yet

lilac dagger
small thunder
#

Is InventoryMoveItemEvent fired when minecart hopper moves item?

vital swift
muted idol
untold rover
#

Hey, so I managed to remove the players from the tablist, but now they disappear after leaving the render distance and never appear again. So after googling for a bit I read to send the PlayerInfo Packet with ADD_PLAYER again and then remove it short after
but that didn't work, does anyone have an idea? https://paste.sentinalcoding.eu/Pj2XLIT24R

small thunder
#

I've tested and its not for me

ivory sleet
small thunder
#

So which one is fired?

vernal basalt
#

how can i filter out statistics that require a material input

opal juniper
#

I would have thought it was that one

#

There most likely isnโ€™t one if it isnโ€™t that

minor fox
#

@worn sierra I just came to think about something

lyric grove
#

i imported my project again and i get this

#

anyone know the maven repository?

lofty mulch
#

BuildTool -> MavenLocal

lyric grove
lofty mulch
#

yes it is

#

Run buildtool and it will automatically deploy to your maven local

lyric grove
#

oh ok thanks

#

i already have the jar in my maven pom

quaint mantle
#

wdym

#

you also haave to change the artifact to spigot

clear fable
#

How can I get the chat message of an advancement ie wowkster has completed the challenge [Cover Me in Debris]. I tried the BroadcastMessageEvent but it seems like advancements aren't broadcast. I also tried the PlayerAdvancementDoneEvent but it doesnt give you the actual chat message. Is there an easy way to get whatever was sent in the chat? I dont need any info about the advancement just the raw text

quaint mantle
#

you just wanna change text of the advancement or?

clear fable
#

I dont even need to change it

#

just get the raw text

#

I want to send it in a discord webhook

#

I cant figure out how to get the text

quaint mantle
#

check for event

lyric grove
clear fable
quaint mantle
quaint mantle
clear fable
#

That doesnt give the message

#

just the advancement object

quaint mantle
#

yes

#

you need it

#

do e.getAdvancement().getKey().toString()

#

that could be it

clear fable
#

ah ok

#

let me try

lyric grove
quaint mantle
#

did you refresh the maven

clear fable
#

:(

lyric grove
#

that fixed it thanks

clear fable
#

that might explain it

#

I'll take a look at the client 1.16 code and yoink it

quaint mantle
#

yyea

clear fable
#

yoink

vast quest
#

yoink

quaint mantle
#

or try getKey().getKey()

#

idk

clear fable
#

alr

#

same thing just without minecraft:

quaint mantle
#

and if you getKey().getKey().toString()?

clear fable
#

looks like the client has a ClientAdvancementManager class so I'll look there

quaint mantle
#

okay

clear fable
#

It's not actually a chat packet its an advancement packet

quaint mantle
#

yeah maybe that could be it

sage swift
#

look at how discordsrv does it

#

they have their own names for advancements

#

just a map of em

#

i think

clear fable
#

ok

vital swift
#

Hello, does someone knows how can i create multiple Scoreboards not objectives?

manic ravine
#

@vital swift What do you mean by "multiple"? One for multiple players or multiple Scoreboards for one player?

vital swift
#

multiple scoreboards for one player

manic ravine
#

@vital swift Use different DisplaySlots (Sidebar, PlayerList, BelowName) Or do I get your question wrong?

vital swift
#

ill try

#

PlayerList

#

because im doing teams for tablist

manic ravine
#

What exactly do you want to achieve?

#

You can also split your regular scoreboard into different sections.

#

HP BW for example shows "team infos" / "event timer" / "per player info" in one sidebar scoreboard split into "sections"

cold field
#

If I have a serialized obj of class B and this class extends class A. When I deserialize that object if the method deserialize() is in class A what will happen? (I'm using Bukkit Serialization API)

eternal oxide
#

If using the Bukkit serialization API you don;t call deserialize

cold field
eternal oxide
#

you are serializing to a file?

cold field
#

yes

eternal oxide
#

what object?

cold field
#

a custom one

eternal oxide
#

then did you correctly implement ConfigurationSerializable in that custom object?

cold field
#

I think so, the problem is I have a parent class that implements the interface and all the relatives methods but then I serialize the child classes

#

The serialization goes well, the deseralization don't

eternal oxide
#

Your custom class has to implement ConfigurationSerializable, AND you have to register it

cold field
#

I've only registered the parent class

eternal oxide
#

then you havn't correctly implemented CS

cold field
#

CS?

eternal oxide
#

I'm not typing ConfigurationSerializable every time

cold field
#

oh, ok

#

lol

#

should I register every child class?

eternal oxide
#

any Object you want to be able to serialize you have to implement it in

#

The Bukkit serializer has to understand the class you want to put/get from the config

manic ravine
#

Besides that you should ask yourself if inheritance is really needed. If you use it for a config for example then you can transfer the information to a data object and then serialize this object. Or keep it behind an architectural boundary then you have the option to change the kind of persistence if needed.

ivory sleet
#

IAbstractFactoryFinalBaseImplProvider

#

yes very nice

paper viper
#

conclure

#

yo

ivory sleet
#

yo pulse

#

I am gonna try convert

#

today

paper viper
#

is buildscript bad

ivory sleet
#

later

#

no

paper viper
#

nah i got most of it

#

i just need to get shadow

ivory sleet
#

oh nice

#

ok sure

paper viper
#

theres errors and idk how to fix it but yeah i made a separate branch

ivory sleet
#

let me check

#

where's errors

paper viper
#

i dont get why its saying that implementation reference cant be found

#

when i included java plugin and shadow plugin

#

and for some weird ass reason if I use buildscript, the errors go away. But it should be the same

ivory sleet
#

uh lmc

#

uh idk I dont use kts dsl

paper viper
#

isnt it mostly the same except like syntax?

ivory sleet
#

dependencies {
subprojects.forEach { implementation(it) }
}

plugins {
java
}

#

u r dumb

#

like very dumb

#

plugins block should be at the very top mostly

paper viper
#

Oh oops lmao i forgot to declare that before

ivory sleet
#

yeah I was lol

paper viper
#

not sure why gradle didnt give me an error tho

ivory sleet
#

gradle is kinda dodo sometimes when working with a lot of modules

paper viper
#

like any build management software anyways

ivory sleet
#

lmao

paper viper
#

lol

ivory sleet
#

true

manic ravine
ivory sleet
#

absolutely not

manic ravine
#

Sounds like^^

ivory sleet
#

have you tried spring?

paper viper
#

lol

clear fable
#

In the onDisable() method is there a way to tell if the server is shutting down or just reloading?

#

Not super necessary but would be a nice feature

manic ravine
#

@ivory sleet For luck not...

ivory sleet
#

lmao

cold field
#

why when I deserialize a float number it is converted as a double? @eternal oxide

eternal oxide
#

unless you are using an object it will be stored and read as a double

cold field
#

๐Ÿ˜ฆ

eternal oxide
#

cast it

cold field
#

The problem is that I'm using a list

ivory sleet
#

pretty sure bukkit has a number conversion class

eternal oxide
#

(float) getDouble(path)

cold field
#

I've already casted with the (List<Float>)

#

but it stores a list of doubles...

eternal oxide
#

yes

cold field
#

Do I need to map the list to float with lambda?

#

Or there is something better?

eternal oxide
#

why, are you getting an auto boxing problem?

cold field
#

I think so. I need a list of float

eternal oxide
#

config.getFloatList(path)

ivory sleet
#

does that exist?

ivory sleet
#

pog

cold field
#

I'm working inside the deserialize method. I've only access to a Map<String, Object>

#

The object is already a List of doubles

ivory sleet
#

nice

manic ravine
#

@ivory sleet Atm I try to decouple my code as much as possible from bukkit/spigot. So I ask myself a lot of such strange questions...

ivory sleet
#

ok

#

tho

#

sometimes u want cohesion

eternal oxide
manic ravine
#

@ivory sleet Often it results in high cohesion^^

ivory sleet
#

then its a pebkac issue

#

when u're trying to decouple then u shouldnt end up with something more cohesive

#

and vice versa

cold field
#

Am i missing something?

eternal oxide
#

?paste show me some code

queen dragonBOT
gaunt eagle
#

Is it possible to send down the new module (project) that I have boxed for intelij idea?
as if it was a different project. It looks so complicated that way

gaunt eagle
#

and bc I want to work with 2 projects at the same time

cold field
manic ravine
#

@ivory sleet decoupling result always in cohesion? Or I am wrong? Small cohesion -> high coupling and wise versa... ?

ivory sleet
#

wat

#

maybe I'm thinking of something different then

eternal oxide
ivory sleet
#

its hard to tell exactly without any concrete code

cold field
eternal oxide
#

ok

#

are you seeing an error? as that looks fine to me

#

so long as your floats are actually floats when you put then

cold field
#

wait a sec, I take a pic of the memory

#

The list that is actually stored inside the map is stored as a list of doubles from the very beginning... So I think that this is a bukkit problem @eternal oxide

eternal oxide
#

yeah, it should definitely not be doubles

#

not if the source is Floats

cold field
#

RIP me

lyric grove
#

hi, im trying to create a hologram but it says this

eternal oxide
#

it shows 2 doubles

cold field
#

It should be 2 floats

eternal oxide
#

will it cast without error?

cold field
#

Yes

#

Obv my plugin breaks bc I'm doing other things

eternal oxide
#

then you are getting 2 floats out but the only issue is that its storing as doubles

cold field
#

And mapping all to float

eternal oxide
#

I'd not wory about the storage type if the data is retrieved correctly

lyric grove
#

anyone know what i should do? it says this isnt a statement

#

(this.pointsHologram = (Hologram)HologramsAPI.createHologram((Plugin)this.plugin, this.plugin.getPointsLocation().addLine(CC.translate("&7&m-----&b&l Top Factions &7&m-----"))));

#

but it is

opal juniper
#

why do you have the outer brackets? @lyric grove

eternal oxide
cold field
#

packet.floats = ((List<Double>) args.get("data-floats")).stream().map(Double::floatValue).collect(Collectors.toList());

eternal oxide
#

ah ok

cold field
#

really rude but it works

#

XD

opal juniper
cold field
#

I'm Italian, this is a false-firend word

#

sorry

opal juniper
#

ahhh, no problem

acoustic token
#

im kinda new to java so im probably messing this up. but can someone tell me how to deal with this error
org.bukkit.plugin.InvalidPluginException: Cannot find main class `Minebot.MinebotRun'

cold field
#

I mean that

wraith rapids
#

your plugin.yml has a line that is supposed to point at your plugin's main class

#

the value on that line is incorrect

acoustic token
#

ok

#

is there an easy way to find what to type there

wraith rapids
#

yes

#

it should point at your main class

opal juniper
#

send a picture - of the package structure

#

we can tell you ig

wraith rapids
#

simply write the location of your main class

#

the first line in your main class should be package somethingsomething

#

and your main class might be named MyPlugin

#

in that case the value would be somethingsomething.MyPlugin

#

where it is.what it's called

opal juniper
#

one.two.three.JavaCore

#

for example

acoustic token
#

ok my package is minebot and the main is minebotrun so wouldnt that make it minebot.minebotrun

opal juniper
#

yeah...

wraith rapids
#

assuming they're both in lowercase, yes

opal juniper
#

what does the top line of your main class say?

#

just copy it here

acoustic token
#

package MineBot;

import org.bukkit.entity.*;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.event.player.AsyncPlayerChatEvent;

import java.io.IOException;

public class MinebotRun extends JavaPlugin{

@Override
public void onEnable(){
opal juniper
#

it is uppercase

acoustic token
#

main: Minebot.MinebotRun
name: Minebot
version: 1.0
description: Beta
author: dragonblade316
api-version: 1.16

#

thats my yml

wraith rapids
#

your package is MineBot

#

your yml says Minebot

opal juniper
#

^^

acoustic token
#

oh

wraith rapids
#

use proper naming conventions

#

packages should be all lowercase

#

minebot.MinebotRun

acoustic token
#

ok thx

fiery inlet
#

hi

#

ready for hell?

wraith rapids
#

did you do the excercises

fiery inlet
#

no im just joking

#

just wanted to say hi

opal juniper
#

hi

fiery inlet
#

but no im not done yet

#

at 26 lol

opal juniper
wraith rapids
#

i've never actually done any excercises or tutorials so idk how good those are but they're probably better than nothing

fiery inlet
#

59 it says

#

27/59

opal juniper
#

oooh

fiery inlet
#

i mean only now im getting stuff i dont know

torn oyster
#

how do i load a config from the resources folder in bungeecord

opal juniper
torn oyster
#

yea i have loaded it and saved it

#

but it still isnt showing up

#

i havent even made a bungeecord config my bad

opal juniper
#

<

torn oyster
#

the config.yml is in resources

#

and it still isnt showing up

#

why

opal juniper
#

I have 0 context to what you have done - strangely i don't know

torn oyster
#
    private void registerConfig() {
        try {
            config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(new File(getDataFolder(), "config.yml"));
            ConfigurationProvider.getProvider(YamlConfiguration.class).save(config, new File(getDataFolder(), "config.yml"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }```
#

probably so wrong huh

#

that isnt throwing an ioexception though

opal juniper
#

you need to save it right?

torn oyster
#

yea i did

#

ConfigurationProvider.getProvider(YamlConfiguration.class).save(config, new File(getDataFolder(), "config.yml"));

opal juniper
#

wait im blind

#

where do you define config?

wraith rapids
#

tbh just use some config library or framework

#

nothing that is bundled with bungee is ever good

opal juniper
torn oyster
#

nvm

torn shuttle
#

does anyone have a way of getting all blocks in a circle around a point in a way that is optimized for efficiency?

torn oyster
#

i did it

wraith rapids
#

how big of a circle are we talking about

torn shuttle
#

up to a radius of 30 blocks, give or take

wraith rapids
#

getting the blocks themselves will cost you significantly more time than calculating the locations

torn shuttle
#

and this is a circle not a sphere

wraith rapids
#

just compute the squared distance and compare to a limit

opal juniper
#

yeah what they said ^^

wraith rapids
#

math is cheap

#

even sqrts and powers are relatively cheap

#

it turns out that computers are sort of made for computing things

torn shuttle
#

hm

opal juniper
#

sqrts are not cheap, but cheaper than the Bukkit api

#

so in this instance, yes

wraith rapids
#

most cpu's have math coprocessors built in so just about any math operation is cheap

torn shuttle
#

I guess my main question is one of resolution, as in how do I optimize it so I get only the right amount of blocks and not way more or not enough

wraith rapids
#

although i'm not sure if java leverages the actual cpu level instructions

gaunt eagle
#

http://www.javadecompilers.com/
can anybody access this site? Or is it just me?

wraith rapids
#

i know when using strictfp and strict math they don't

#

but iirc in regular use they're just forwarded to the processor and are executed as a single instruction

torn shuttle
#

any idea for the resolution question?

wraith rapids
#

just iterate a square up to the maximum range

#

and check the distance of each block

#

distance squared, that is

#

sqrt might be cheap but there's still no point in spamming it needlessly

torn shuttle
#

but surely block distance would vary right

wraith rapids
#

of course

#

you compare it to your limit distance

#

so it becomes a circle

torn shuttle
#

oh I see what you mean

#

ok

#

that was not how I was going to approach it lol

#

I guess it would be sort of an edge fill system

wraith rapids
#

for bigger circles it might be beneficial to flip some signs and swap some axes so you only need to compute 1/8th of the blocks in the circle

wraith rapids
#

and for even bigger circles you could sort of A* it to draw an outline and fill that till the origo but that's probably unnecessary

torn shuttle
#

yeah 30 blocks should already be the maximum radius of the math done here

#

I was also considering just caching the results honestly

#

measure once cut a thousand times right

wraith rapids
#

maybe

#

if you only have ranges up to 30 you could just precompute them all

paper viper
#

dynamic programming to make bigger calculations faster

#

idk

wraith rapids
#

but probably not worth the effort

torn shuttle
#

yeah that's what I meant

paper viper
#

perhaps that may work

torn shuttle
#

thing is when it does activate it's constantly going to be calculating blocks from ranges 1-30

#

because it's a shockwave effect

#

bit of a waste

wraith rapids
#

precompute the blocks asynchronously ๐Ÿ™‰

torn shuttle
#

that's unironically what I did with the rest of my rotation math so I don't see why not lol

wraith rapids
#

then use protocol hacks to do the shockwave ๐Ÿ™ˆ

torn shuttle
#

ok that's too far

wraith rapids
#

don't synchronize to main at all and just read from the block palette of the chunks ๐Ÿ™Š

torn shuttle
#

man these memes make me want to remake the first minigame I ever played in minecraft

#

back in classic, the arenas that would autofill with lava

wraith rapids
#

like that one "async tree feller" plugin

#

jesus fuck

paper viper
#

"async tree feller"

#

that wouldnt even work properly or good tho

wraith rapids
#

it just invoked the api asynchronously, so each call to getBlock or getType would block the async thread for like 50ms

torn shuttle
#

can you even make blocks modifications async?

wraith rapids
#

it was thread safe but super slow

paper viper
wraith rapids
#

because bukkit forces it to sync

paper viper
#

prolly glitches

wraith rapids
#

bukkit forces the world modifications to happen synchronously

paper viper
#

and doesnt update lighting or blocks or some weird shit

#

yea

wraith rapids
#

but they are only scheduled to the start of the tick

#

so it takes like a tick per every 3 or 5 blocks

torn shuttle
#

try{async()}catch(DumbshitException ex){sync()} hey guys I made async mcmmo

wraith rapids
#

and you're jumping between main and the off-thread like 100s of times

torn shuttle
#

this is pretty fun though

#

I'm making a classic mmorpg power where there's a slice of terrain that is safe and the rest is deadly

#

feels good doing fun stuff like that

wraith rapids
#

no fun allowed

torn shuttle
#

oh shit it's the fun police

#

quick, hide that temporary solution from 3 years ago currently holding up the core features of your plugin

sage swift
#

is there a way to naturally place a block as a player

#

taking stuff like clicked face and whether the block can be placed into account

wraith rapids
#

spoof a block place packet or something for the player and hope there is no anticheat plugin installed

#

beyond that, it's nms town

sage swift
#

spoof an incoming one?

wraith rapids
#

myeah

sage swift
#

never done packets...

#

nms it is

wraith rapids
#

there is a method somewhere that does it, I remember it popping up in some noteblock thread where someone was trying to make noteblocks not interactable

#

lemme see if I can find the thread

#

idr if there is anything of use there for you but i vaguely remember someone mentioning a nms method that does it there

sage swift
#

wowee

torn shuttle
#

won't you take me to

#

nms tooown

wraith rapids
#

next stop is auschwitz

torn shuttle
#

I guess no one ever expects the nazi inquisition

sage swift
#

hmm seems odd that the method is in itemstack though, i'd think there would be something in EntityPlayer or Human

wraith rapids
#

you could say that they did nazi it coming

#

my jokes are so killer that the chat died

torn shuttle
#

I guess jokes shan't set you free after all

sage swift
#

is there like a tutorial for packets somewhere

#

where the hell are they in the nms code even

wraith rapids
#

protocollib is your friend

sage swift
#

more dependencies bro really

wraith rapids
#

just about anything hacky or complicated depends on protocollib anyway

#

it's the vault of 1337 developers

sage swift
#

alright well how would i send the packet to the server

wraith rapids
#

dunno

#

i don't remember

#

they have a tutorial or a guide somewhere

sleek dragon
#

is it possible to use TranslatableComponent in an Item's name?

wraith rapids
#

yes

#

or, well, on paper yes

muted idol
#

@ivory sleet hey there so i have everything you have said and now have a class called RedisListener which extends JedisPubSub. Where do i continue with what im assuming is connecting to the server and then running public void's on it

wraith rapids
#

idk if you can on spigot

sleek dragon
#

not sure how to go about it. LocalizedName no longer works past 1.13

wraith rapids
#

if there is a name setter that takes components, use that

#

if there isn't, you're out of luck

sleek dragon
#

setDisplayName only takes strings i think

#

dont know another way

wraith rapids
#

check if ItemStack or ItemMeta has a spigot() method

#

a lot of dumb stuff is hidden behind those

#

or use paper :fingerguns:

sleek dragon
#

well i am using tuinity lol so I should have access to papers methods

wraith rapids
#

ItemMeta::displayName

#

takes Adventure components

#

use Component.translatable() to create a translatable component with the key of your choice

sage swift
#

tunuti

wraith rapids
#

uwuinity

upper vale
#

is it possible to get the exact collision Location for a ray trace result?

wraith rapids
#

iirc that is provided by the RaytraceResult

#

not totally sure

upper vale
#

oh i think its getHitPosition

#

but its a vector

#

is that vector the location XYZ?

wraith rapids
#

either that or the distance from the raytrace origin

wraith rapids
#

can you even fish with the offhand?

sage swift
#

because if there's one in the main hand, it's the main hand, otherwise it's the offhand

wraith rapids
#

what if i'm dual wielding fishing rods

sage swift
#

if you cast with offhand and put one in your main hand it switches to main

wraith rapids
#

do i shoot 2 bobbers at once?

sage swift
#

so if there's one in main hand, it's main hand

#

otherwise offhand

#

again

wraith rapids
#

kinda seems something that should be on the event though

sage swift
#

main hand has fishing rod = main hand did event

wraith rapids
#

but blรถkkit is blรถkkit

#

can't expect everything to be good

sage swift
#

implements Handy

sharp bough
#
  public void reloadConfig() {
    super.reloadConfig();

    saveDefaultConfig();
    config = getConfig();
    config.options().copyDefaults(true);
    saveConfig();
  }```
is this an effective way to reload config file?
sage swift
#

really just need saveDefaultConfig and reloadConfig

#

ideally saveDefaultConfig first in case the existing one was deleted

#

dont really need a variable called config either

sharp bough
#

so if i just put reloadConfig(), it gets the job done, but all the other things are to make it safier

wraith rapids
#

copydefaults is redundant

#

saving the config is redundant

sage swift
#

all you need is saveDefaultConfig() and reloadConfig()

wraith rapids
#

just savedefaultconfig might do

#

iirc it loads the config from disk

sharp bough
#

public void reload(){
saveDefaultConfig();
reloadConfig();
}

#

so just that?

wraith rapids
#

in addition to writing it there if it isn't there already

#

idk, i never bother to write reload commands for my plugins

#

I just make them work fine on reload and expect people to use a plugin manager to reload them

sharp bough
#

yea ig

wraith rapids
#

only one of my plugins doesn't work properly over reloads and that's because slimefun is trash and just explodes on reloads

sage swift
#

pretty sure you need reloadConfig

wraith rapids
#

though I did rewrite parts of it so it works now

sage swift
#

ยฏ_(ใƒ„)_/ยฏ

wraith rapids
#

because I don't like restarting my test server

sage swift
#
            PacketPlayInBlockPlace packet = new PacketPlayInBlockPlace(evt.getHand() == EquipmentSlot.HAND ? EnumHand.MAIN_HAND : EnumHand.OFF_HAND);
            EntityPlayer player = ((CraftPlayer) evt.getPlayer()).getHandle();
            player.playerConnection.a(packet);``` how the hell can i spoof the packet to the server from the server? this doesn't do anything
subtle vector
#

whats the different between get x and get block x

sage swift
#

what

wraith rapids
#

do you mean the methods on the Location class

subtle vector
#

this

#

wait i cant send pics

wraith rapids
#

just yes or no will do

subtle vector