#help-archived

1 messages · Page 61 of 1

safe mesa
#

i just tested it out

#

thats the wrong

#

crash report

frigid ember
#

oh

#

hec

safe mesa
#

my servere isnt opening

#

but it isnt putting a crash report

frigid ember
#

hmm

fleet crane
#

dont edit server-ip unless you know what youre doing

#

amazing how many people fill it with garbage

#

just leave it blank

safe mesa
#

: **** FAILED TO BIND TO PORT!
[23:34:14] [Server thread/WARN]: The exception was: java.net.BindException: Cannot assign requested address: bind
[23:34:14] [Server thread/WARN]: Perhaps a server is already running on that port?
[23:34:14] [Server thread/INFO]: Stopping server

frigid ember
#

yeah thats the thingy

safe mesa
#

i didnt

#

i havent touched anything

fleet crane
#

you did

#

you put 192.168.1.2 in it

hot girder
#

kill all java processes

#

haha

fleet crane
#

leave it blank

safe mesa
#

yeah because im port forwarding my server so i can with my friend

#

its always worked

fleet crane
#

just leave it blank

frigid ember
#

you dont need to have anything in server-ip usually :)

#

though

#

mine is set to an ip but works, cant really remember the reason though

#

also, came here with a question

#

blurred out the info but. rich presence

#

how do?

safe mesa
#

i cant join my server know

frigid ember
#

check your ports/router settings

#

probably an issue with port forwarding

safe mesa
#

omg bruh

frigid ember
#

heck

#

not even sure if it's possible to get a rich presence thingy working. curious though

#

wynn is a mod-free server though and they managed to do it

safe mesa
#

what the

#

holy

#

my thingy changed

#

192.168.1.17

frigid ember
#

that isn't your public IP, that's local

safe mesa
#

exACTLY

frigid ember
#

keep in mind, some are "dynamic" which means they change

#

which is bad

#

you'll want to change it to "static"

safe mesa
#

WHAT

frigid ember
#

Is there a reason why the PreLogin events don’t fire when the player joins the server while the server is still starting?

#

If the server has already finished starting, then the events fire fine

#

Otherwise if the player joins say mid world load, the events won’t get fired

#

not sure if this is a great idea but for me i changed late-bind in spigot.yml

#

Is that in response to my question?

#

ye!

#

i think i might have another answer though

#

Late bind on what toggle? true or false

pastel condor
#

I'm using a file configuration object and I was wondering if there is any way if I can get a list of all the boolean values that map to a string in that object. Ex: I want to get a list (with this image) like e54bb1e5-ee8d-44a5-8ebd-a44daf8c8dbd, 49a591c5-e116-4434-a8bf-6d3f225770e, more values.

safe mesa
#

i broke everything

frigid ember
#

late-bind: true seems to help :D

#

maybe your plugin is loading last, so when someone joins during the load, they "fly under the radar"

#

not sure how to change the 'load order' though

#

Well no because iirc, players can’t actually “join” until all plugins are loaded

pastel condor
#

event priority?

frigid ember
#

^

#

hmmmm alright, i'm not sure then :U

#

PlayerJoinEvent works fine, it’s just the pre login events

#

Nope, priority is something entirely different

pastel condor
#

why don't you just stick with PlayerJoinEvent then?

frigid ember
#

Ill try late bind once I’m out of the dumper

#

Because I’m trying to deny join if something in my plugin hasn’t loaded yet

#

this is a really bad workaround but uh

#

And I don’t really wanna have to kick 1-2 ticks after PlayerJoinEvent if that’s the case

pastel condor
#

you could still do that with playerjoinevent though

frigid ember
#

ye

pastel condor
#

event.setCancled(true);

frigid ember
#

maybe just declare some boolean somewhere, check if it's true, if not, kick

#

Seems like a hackjob

#

Wat

#

it’s not cancellable m8

pastel condor
#

oh lol

#

then player.kick("kicked");

#

idk lol

frigid ember
#

I know but that’s what I’m trying to avoid entirely, and imo that’s something the pre logins SHOULD be able to handle

#

the kicking seems like a hackjob to me and i don’t wanna have to implement it if I don’t have to

#

wish i could help more

pastel condor
#

I don't even think preloginevent returns a player

#

it's too pre

frigid ember
#

Yea no worries, gonna try the late bind thing when I’m done shitting

#

Not trying to grab a player, just need to disallow the joining

#

wait

#

actually

#

not sure if players can join before all plugins have loaded

#

something tells me they can

#

but late-bind: true will disable this

#

Yup, gonna try that in a bit

#

Having stomach problems rn

#

heck

#

hope you recover soon :^)

inland oxide
#

stomach empty probs

frigid ember
#

Tbh I think it’s the new protein I’m using

#

made me blast my toilet to oblivion

#

what are you using

#

Fortress-somethinf

inland oxide
#

probably some soy crapola

frigid ember
#

the new formula they did is horrible

#

no soy

#

whey

inland oxide
#

yeh, soy will grow you nipples

frigid ember
#

whey>>>

inland oxide
#

well you know what i mean

frigid ember
#

switching back to muscle pharm after i’m done with this bucket

inland oxide
#

anyway that stuff can go bad if left open

frigid ember
#

do you use protein

inland oxide
#

stick with the muscle milk, can't go wrong

frigid ember
#

it do be pricey

#

oh lol

#

never tried it

#

usually stick to muscle pharm

inland oxide
#

yeh, I like to do a bit of amino fuel before my workout

#

then a recovery drink

frigid ember
#

i do pre workout before i workout

inland oxide
#

pre-pre-workout?

frigid ember
#

?

inland oxide
#

I have a post-post-workout, involves tacos

frigid ember
#

lol

#

i mean the powder/supplement

inland oxide
#

yeh, most of that GNC, AMP stuff is ok

#

I like the twinlabs stuff for the aminos

pastel condor
#

Sorry for interrupting the conversation, but anyone know how I can create a list of all the items in a file configuration object? #help-archived message

inland oxide
#

you mean to get the keys?

pastel condor
#

yes

#

because it's like that hash map thingy

#

so yes a list of all the keys

inland oxide
#

look at the javadocs for ConfigurationSection

pastel condor
#

kk

inland oxide
#

probably just ConfigurationSection#getKeys(depth)

frigid ember
#

wait

#

you want to get all of the keys in a HashMap?

#

oh

#

nevermind

#

i was going to say getKeys

#

er

pastel condor
#

what in the world is a deep list?

frigid ember
#

keySet()

pastel condor
#

yeah

#

I just found that

#

oh wait

#

I was going to use getMapList(path)

inland oxide
#

well that gets a list of the keys in a map

pastel condor
#

I need the hash map format

#

so I can confirm that the value is ture

inland oxide
#

same, it's a map

pastel condor
#

*true

#

but theres some deep list thing?

#

whats that?

inland oxide
#

so I'm not following do you already have a Map object, or are you getting one from a ConfigurationSection?

#

deep list?

#

you mean the bool for getKeys?

pastel condor
#

I'm confused

inland oxide
#

ok, start over, what do you have and what are you trying to get?

pastel condor
#

so I have this data.yml file e54bb1e5-ee8d-44a5-8ebd-a44daf8c8dbd: true 49a591c5-e116-4434-a8bf-6d3f225770e9: true

inland oxide
#

right, so yml, means configuration file.

pastel condor
#

and I want to list all the uuids that have the "true" hash in a list

inland oxide
#

you will have a ConfigurationSection returned

pastel condor
#

okay?

#

so I have this Main.getInstance().Data.getMapList()

green hornet
pastel condor
#

but in getMapList() do I put true or false?

green hornet
#

how can i escape this issue

inland oxide
#

why are you assuming it's a map

pastel condor
#

because it is?

#

what else could it be?

#

because the only values in the config are string:boolean

inland oxide
#

so, you have a FileConfiguration object from your yml file

#

right?

pastel condor
#

yes

frigid ember
#

@frigid ember thanks

#

it worked

#

late bind feature was auto implemented in later versions, didn’t know that being disabled caused that issue in legacy versions

inland oxide
#

and you then iterate over whatever the base set of object (keys) are in it

frigid ember
#

glad it worked :)

pastel condor
#

yes

inland oxide
#

so simply iterate over getKeys(false) and get the boolean value of the key.

#

if they are always boolean values, then you won't have to worry

#

do you have anything else in this file?

pastel condor
#

nope, just that

frigid ember
#

i’d recommend storing data with gson

#

settings stuff with yaml

pastel condor
#

I think I made a noob mistake

#

Map<String, boolean> police = Main.getInstance().Data.getMapList(false);

keen compass
#

@green hornet you have something that is trying to modify something concurrently, looks like entities maybe. Either way its a plugin doing something it isn't suppose to

pastel condor
#

I just like yml though

green hornet
#

a plugin changing a pathfinder while minecraft is looping it?

frigid ember
#

are you trying to change a PathfinderGoal?

#

i have a method which can many any moving entity walk to any location if you like

#

it's kinda hacky and dirty though

keen compass
#

@green hornet I can't say for certain other then it involves the skeleton entity and something trying to be done concurrently

pastel condor
#

nevermind HashMap<String, boolean> police = Main.getInstance().Data.getMapList(false);

green hornet
#

ok thanks

inland oxide
#

@pastel condor what is Data

pastel condor
#

the config file object

keen compass
#

@green hornet I will bet it is probably MythicMobs

#

best way to find out is remove plugins one by one until it stops crashing

#

the last plugin you removed is most likely the one causing the issue

inland oxide
#

how are you getting/saving your data from the plugin instance?

pastel condor
#

Main.getInstance().SaveDataFile();

#
    try {
        Data.save(DataFile);
    } catch (Exception e) {
        e.printStackTrace();
    }
}```
inland oxide
#

you've lost me

keen compass
#

how about loading?

pastel condor
#
    DataFile = new File(getDataFolder(), "data.yml");
    if (!DataFile.exists()) {
        DataFile.getParentFile().mkdirs();
        saveResource("data.yml", false);
     }
    Data = YamlConfiguration.loadConfiguration(DataFile);
}```
#

then createData(); on the onEnable()

keen compass
#

and you keep a reference to this object?

inland oxide
#

so Data is static?

pastel condor
#

yes

#

and yes

keen compass
#

Doesn't appear you have a reference to Data in the main class, which is what you need

pastel condor
#

wdym I have my public static Main getInstance() { return instance; }

keen compass
#

normally I put the saving/loading methods for custom yml files in their own class

#

makes it easier

inland oxide
#

soz, I haven't seen any code yet.

pastel condor
#

oh okay

#

you can checkout my plugin if you want

keen compass
#

Lets see that main class

inland oxide
#

but anyway, you load the yaml file with YamlConfiguration.loadConfiguration, and it puts it in Data

pastel condor
#

yes

frigid ember
#

Anyone here know the 1.15.2 entity NMS mappings? Please dm or @ me 🙂

inland oxide
#

and you then access Data and get the keys with the getKeys(false)

pastel condor
#

or Main.getInstance().Data?

stable egret
#

hey someone give me an urgent help

#

/nocheatdkjsakjhlsadhjksa21

#

someone came

#

and did this command

#

and got op on our server

inland oxide
#

Depends on where you are acessing it from

pastel condor
#

wdym?

inland oxide
#

can just static import Data from Main class if it is public

keen compass
frigid ember
#

@stable egret sounds like you got a plugin w/ malware

keen compass
#

@stable egret means you are using a malicious plugin

inland oxide
#

entity NMS mappings? what does that mean?

stable egret
#

yea

#

i think so

frigid ember
#

@inland oxide NMS mappings have changed for entities from 1.14.4 to 1.15.2, looking to find what the new methods/classes are

keen moth
#

@frigid ember If you don't want to worry about some cross-compatbility later from when late-bind setting was removed, etc. You can just use PlayerLoginEvent

keen compass
#

@stable egret copy your plugins to another server, and then start removing them one by one, and use that command they used to see which one gives you ops. The moment that command don't work then you know the last plugin removed is your malicious ones. Generally shouldn't download plugins from random places. 😉

inland oxide
#

yeh, best look on wiki.vg or diff mappings from searge or forge

frigid ember
#

I will try that, will be much cleaner than working with late bind setting through server code

pastel condor
#

omg I meant to use getValues(false); not the map thingy

#

sorry about the time waster guys

inland oxide
#

usually, it's getKeys(false), then check if said key is boolean, then get value.

#

but if you are the only one saving to that file and it's all boolean then ...

pastel condor
#

yeah

#

or I could just check if the object is instanceOf boolean

#

just to make sure

#

people don't dump garbage in the config file and have my plugin spam errors

inland oxide
#

it is a text file

pastel condor
#

yes

safe mesa
#

omg

#

i just pulled a seed ive used before

#

i delte the world every time

#

and

#

i got one that had placed blocks

#

i use for speedrunning

stable egret
#

found that basturd plugin

#

thanks guys

pastel condor
#

just wondering which plugin was it? @stable egret

keen compass
#

if it is a plugin that you downloaded from spigot resources, I would highly recommend reporting it @stable egret

#

but I doubt that is where you got it from though lol

stable egret
#

no

#

my stupid developer

#

so here the story

#

we have a rival server for some reason they came on our server and used cheats

#

and then logged in with another username

#

told my stupid developer that i have a anticheat you can use its really god

#

good*

#

i was offline then

#

so my dev thought it was ok to use a plugin from a player

#

thus this happened

pastel condor
#

lol

#

that must be a very toxic rival server

stable egret
#

ik

#

they are salty

#

because we created a minigame same to them

#

xD

pastel condor
#

lol

#

thats not too bad though

keen compass
#

@stable egret prime example of not using plugins from unofficial sources

sour hinge
#

Helo

keen compass
#

never accept plugins from random players XD

sour hinge
#

Where general ?

keen compass
#

next channel up

pastel condor
#

#general

#

or click that

sour hinge
#

umm ok thanks

frigid ember
#

Hewoo i need halp

sour hinge
#

why?

frigid ember
#

I cant start the server, as soon as I try to ping it the console goes crazy

#

Im using spigot 1.8.8

sour hinge
#

umm maybe ur host

frigid ember
#

The PC is next to me

#

the Server PC

#

Vanilla minecraft works fine, but when I use the Spigot server.jar it doesn't work

#

I just spits out some information that I cannot read because its gone too fast

chrome edge
#

@frigid ember Are there any console error?

frigid ember
#

I cant read them

chrome edge
#

If there is, please send here so we can try to understand what problem is.

#

Try to open logs

#

logs/latest

frigid ember
#

k

#

one sec

#

I cant send anything in this channel

#

an copy paste is too long

chrome edge
#

Just use pastebin or hastebin

frigid ember
#

whats that

chrome edge
#

paste your code and save it then you can send the link here

frigid ember
#

Its still loading it

#

the text editor crashed...

chrome edge
#

Try to paste last 100 line

frigid ember
#

can I past all of it?

chrome edge
#

No, if it gets so many error.

#

Maybe last 100 lines works

frigid ember
#

I dont see lines, it just a basic text editor

sour hinge
#

l

chrome edge
#

...

frigid ember
#

I made about 5 Million lines in 3 seconds

keen compass
#

1.8 is outdated

#

should update 😉

#

majority of players and servers are on 1.15.2

frigid ember
#

but 1.8 should also work?

vital copper
#

1.8 bad 1.15 good

keen compass
#

you should expect zero support for such an outdated version

frigid ember
#

1.8 - 1.15.2 servers exist

#

but I guess ill make it 1.15

keen compass
#

regardless if outdated servers exist has no bearing on whether or not to expect support for outdated versions

#

officially supported version here is 1.15.2 There is little reason to run outdated versions

chrome edge
keen compass
#

1.8 only makes up 10% of servers, where 1.15 is like at 55%

frigid ember
#

ok

chrome edge
keen compass
#

not entirely sure what the screen shots are for o.O

chrome edge
#

for minecraft cancer 1.8 community

frigid ember
#

that servers also run 1.8?

chrome edge
#

so there're a lot of 1.8 servers which has a thousand players

keen compass
#

I never said they didn't, just that it is severely outdated

#

and there is no official support for outdated versions

chrome edge
#

as you mention it. I hope the community will move to 1.16

keen compass
#

if you want to consider 10% of servers a lot I guess @chrome edge

#

but 1.15 is at 55%

chrome edge
#

But there're not big enough. I love Minecraft latest version of course but there're no 1.15 server which has more then 100 players

keen compass
#

that is on the network to figure out how to get more 😉

#

its not imposssible to have more then 100 players on 1.15 if you know what you are doing

chrome edge
#

Should I wait player until GUI loads. GUI has data which comes from database but whenever I consider it, it's weird. Imagine you send request to open gui but you're waiting and you send 10 more time. I run async task back and can detect if there's request or not. If there is, it can cancel other request but what about others? There're a lot of database request in server like getting player data or guild datas. Have I use same method for all of them? 😭

keen compass
#

bit hard to read that

#

Anyways, grab the stuff from the DB first before launching the GUI

#

and it would be wise if you could centralize the methods, this way you don't have a bunch of duplicate code everywhere

chrome edge
#

There are a lot of datas which can gets by sending request. Should I use same method as gui?

keen compass
#

what same method?

chrome edge
#

Like I run asycn back. If you send request again it cancels due to there is already.

keen compass
#

your DB connections should be ran in their own threads using connection pooling

#

it would take a lot to bog down a decently configured mysql server

#

literally can handle millions of requests per second if configured properly. So your issue isn't going to be the connections or the amount of data going between the server and DB. Its going to be how you code your plugin and whether or not you take advantage of connection pooling.

chrome edge
#

My datas takes 1-3ms each. There's no problem for that but I've to take care for future.

#

You may understand what I said to looking hypixel profile. If you click "guild" category, your menu freezes and waiting until data comes. My question is should I use the method that is same what hypixel did for his guild menu for every data.

keen compass
#

have no idea how hypixel does it

#

however, you could use a caching mechanism like redis

#

to store cached data for later use that you know you might need

chrome edge
#

I use both mongo and redis. Mongo for saving player profile. Redis for cache

keen compass
#

Then you shouldn't have an issue with loading gui's if you can cache the data ahead of time

chrome edge
#

You don't understand my question or I couldn't write it properly 😦

tiny dagger
#

hypixel if they are smart they would have a server app specifically designed to handle this data

keen compass
#

most likely

#

But hypixel pays devs to solve those problems too

#

like what a large network should do 😛

chrome edge
#

My solution is cancel same process while its in async.

keen compass
#

you shouldn't need to cancel it

chrome edge
#

Example /profile X waits until data comes. But if you execute again you have to wait

keen compass
#

why would you have to wait?

chrome edge
#

'cause data is not coming yet

#

if you write it it'll going to pool and after a while it would kill database xD

keen compass
#

no, that isn't how that works

#

connection pooling works by not killing connections and just re-uses the connections no longer being used

#

and it won't kill the DB

chrome edge
#

I'fve tested a thousand ways to do. I meant to say not killing database just slowdown the data comes.

keen compass
#

then you need to redesign your db or re-configure your db server to handle it

chrome edge
#

It's just a test. It's not possible to send 10K data with my systems.

#

But I should thinking future

#

Am I crazy about it? :/

keen compass
#

anyways, if you want to handle the Queue, just make a custom object where it contains your methods for the DB that has a method that keeps track if the data was requested before

#

this way if the command is ran again, you can handle and know that data is waiting

#

and thus not make an additional call to the DB

dreamy ermine
#

I lost my account and I can’t get it back because I lose the device for the 2fa aswell as the back up codes

chrome edge
#

@keen compass that's what I said before 😭

keen compass
#

I don't normally mess with mongo, so I have no idea what methods are available for mongo to take advantage of if a request is pending

#

@dreamy ermine email support using the email of the account you need to get back into

#

?support

worldly heathBOT
keen compass
#

if you lost both the email and 2fa then you are pretty much screwed but you can try contacting support anyways

chrome edge
#

In the end I've decided to use check if there are async for this request. If it is, not call the db again.

frigid ember
#

atop

#

oof

#

wrong keyboard sorry

dreamy ermine
#

@keen compass I’ve got resources on the account that I need to update

keen compass
#

I am not the one that makes the rules, have to contact support

#

I am not even staff, just pointing you in the direction for you to get the appropriate help

dreamy ermine
#

Thanks man x

chrome edge
#

@keen compass I think CompletableFuture may help me. What do you think?

#

It's best for getting value without callback.

#

It can return back the method.

coarse minnow
#

Hello there.
Anyone aware of a bug whereby Bad Omen isn't given after killing a Pillager captain?

keen compass
#

you could try using that @chrome edge

#

anyways brb, I need to go check my property for predators. Dogs going crazy XD

chrome edge
#

Is CompletableFuture Supplier block spigot main thread?

keen compass
#

it should be ran async otherwise it will

chrome edge
#

        CompletableFuture<String> future = CompletableFuture.supplyAsync(new Supplier<String>() {
            @Override
            public String get() {
                try {
                    TimeUnit.SECONDS.sleep(5);
                } catch (InterruptedException e) {
                    throw new IllegalStateException(e);
                }
                return "result...";
            }
        });

        return future.get();
    }``` Is there any mistake?
#

oh wait I should run in background 😭

tiny dagger
#

i still don't understand completable future, if you put something to run async and then use get, wouldn't that lock the main thread till the async task is done? 🤔

keen compass
#

put get() into a variable so that you can check on it.

chrome edge
#

I can use it as a interface and callback with interface

#

but I just want to use get

#

and use ``` new Thread(() -> {

            }).start();``` works for interface and doing your work in background
keen compass
#

so, if you use get() in a separate thread, it will block just that thread and not the main thread

#

You can pass information from threads, not all that difficult to do.

chrome edge
#

But it how CompletableFuture works as I see from tutorial. As tutorial said If I want to return it, I should use it.

#

Even the code comes from tutorial pages on internet -_-

#

weird..

tiny dagger
#

if you want it now just don't use completable future at all :p

chrome edge
#

just delete minecraft it's solution for me xD

#

I noticed how weird I am. It is freeze main thread of course.. 'cause I'm trying to get future data...

chrome lark
#

You need to return the future itself so that you can tell it what to do with the data once it's done

#

calling get() will just block for the outcome

narrow crypt
#

Is it possible to check if lightning is summoned by a plugin such as essentials?

tiny dagger
#

nope

#

there is no plugin instance passed

#

to check for that

patent monolith
#

@narrow crypt what is essentials doing to summon lightning?

narrow crypt
#

the case is i dont know which plugin it is

#

one of my users that uses my plugin
the plugin summons a airdrop on lightning but he has a plugin that adds an enchantments which brings lightning as enchantments

patent monolith
#

I suggest creating a disabled-plugins folder, put all the plugins in there, and then start adding the suspected plugins one by one (testing each one) into the plugins folder

#

When it happens, you know which plugin it is

narrow crypt
#

yea but can i do event. cause. pluginname @patent monolith

#

cause its not only for him but for all users

paper pumice
rugged void
#

do i kill these or tame these?

stable egret
#

Are there any other plugin that does the same thing as viaversion?

#

Viaversion kicks disconnect.spam

lament wolf
#

Hello!

#

I've this:

#
        EntityPlayer npc = new EntityPlayer(nmsServer, nmsWorld, gameProfile, new PlayerInteractManager(nmsWorld));
        Player npcPlayer = npc.getBukkitEntity().getPlayer();
        
        npcPlayer.setPlayerListName("");

        npc.setLocation(spawn.getX(), spawn.getY(), spawn.getZ(), spawn.getYaw(), spawn.getPitch());```

The problem is the Yaw
#

It only rotates the body, but not the head

tiny dagger
#

the yaw has to be translated into radians

#

same for pitch

lament wolf
#

I should do * 2 PI ?

tiny dagger
#
  • 256 / 360
#

that would work too

lament wolf
#

Ok 'ill try

#

@tiny dagger head still doesn't want to rotate

tiny dagger
#

try switch all the internal values instead

#

something like am = lastyaw= yaw = youryaw

chrome edge
#

@paper pumice As I see, you're saving player's points into list integer but you forgot something very important. Map cannot containg same keys. So if you have "test" key in hasmap you cannot save another "test".

#

You can use java 8 method for sort maps effective way.

#
            Map<UUID, Double> r = map
                    .entrySet()
                    .stream()
                    .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
                    .collect(
                            Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,
                                    LinkedHashMap::new));
#

It sorts highest to lowest due to "reverseOrder"

paper pumice
#

Ahh I see, how can I implement this into my code? @chrome edge

#

Also thanks for the reply.

#

Do I just change the hashMap?

chrome edge
#

put your map data to "map"

#

"map".entrySet...

#
                    .entrySet()
                    .stream()
                    .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
                    .collect(
                            Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,
                                    LinkedHashMap::new));```
#

change "myMapData" to your map data.

paper pumice
#

How do I sent code in Discord?

#

Like you did

chrome edge
#

"```"

#

put this start and end of line

paper pumice
#

`
Map<Integer, Player> getPlayerFromValue = new HashMap<Integer, Player>();
Map<Player, Integer> getValueFromPlayer = new HashMap<Player, Integer>();

Map<Player, Integer> topList = getValueFromPlayer
        .entrySet()
        .stream()
        .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
        .collect(
                Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,
                        LinkedHashMap::new));`
frigid ember
#
code
paper pumice
#

So like this?

chrome edge
#

Yes

frigid ember
#
test
#

wait

chrome edge
#

You shouldn't use "Player" into hashmap

#

you should save their UUID

#

It's bad to save it.

paper pumice
#

It's okay because I save data in data.yml as their UUID

#

so it's good

chrome edge
#

Player can changable and huge data inside its. If you leave and join again, the hashmap will not work for this player

#

Save UUID trust me.

lament wolf
#

@tiny dagger Don't work. I had to use the Packet Head Rotation.

paper pumice
#

Okay Iwill

frigid ember
#
// This is test
paper pumice
#

I will use UUID

lament wolf
#

but ty anyway

chrome edge
#

@lament wolf what's your problem?

frigid ember
#

for example

lament wolf
#

I figured out

chrome edge
#

@frigid ember what are you trying to do xD

frigid ember
#

ah

lament wolf
#

when I did npc.setLocation(x,y,z, yaw, pitch); the yaw only affected the body of the entity

frigid ember
#

tell him how to send php code

chrome edge
#

@lament wolf NMS entitys has different yaw and pitch

#

it's upto 360 degree

#

so you have to convert it

#

and send head packet

tiny dagger
#

@lament wolf strange because for me it works

lament wolf
#

¯_(ツ)_/¯

#

Convert it in radians you mean ? blackone

chrome edge
#
        return (byte) ((int) (yawpitch * 256.0F / 360.0F));
    }```
paper pumice
#

@chrome edge
Like this?:
``

Map<Integer, UUID> getPlayerFromValue = new HashMap<Integer, UUID>();
Map<UUID, Integer> getValueFromPlayer = new HashMap<UUID, Integer>();

Map<UUID, Integer> topList = getValueFromPlayer.entrySet().stream()
        .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
        .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new));

public List<Integer> getTop(String crop) {
    List<Integer> top10 = new ArrayList<Integer>();
    for (Player pl : Bukkit.getOnlinePlayers()) {
        getValueFromPlayer.put(pl.getUniqueId(), getData().getInt(pl.getUniqueId().toString() + ".crops." + crop));
        pl.sendMessage(getValueFromPlayer.get(pl.getUniqueId()) + "");
        top10.add(getValueFromPlayer.get(pl));
        getPlayerFromValue.put(getValueFromPlayer.get(pl.getUniqueId()), pl.getUniqueId());

    }
    Collections.sort(top10);
    return top10;
}``
tiny dagger
#

oh nvm

lament wolf
#

```Java

Some code

```

chrome edge
#
        ((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutEntity.PacketPlayOutEntityLook(entity.getId(), getFixRotation(yaw), getFixRotation(pitch), true));
        ((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityHeadRotation(entity, getFixRotation(yaw)));
    }```
tiny dagger
#

i was doing in a head rotation packet too

lament wolf
#

😌 I sought it

chrome edge
#

@paper pumice Let me fix your code and send it.

paper pumice
#

Thank you a lot

chrome edge
#

@paper pumice


    public void showTopList(Player player) {
        Map<UUID, Integer> topList = playerSugarData.entrySet().stream()
                .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
                .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new));

        int n = 1;
        for (UUID id : playerSugarData.keySet()) {
            player.sendMessage(n+"- "+Bukkit.getPlayer(id).getDisplayName()+" value: "+playerSugarData.get(id));
            n++;
        }
    }```
#

try it then feedback here

wanton delta
#

spoonfeeding :ssss

chrome edge
#

@keen compass I've finished to make it. Take a look at it. It looks great xD I also add timeout so if data won't arrive, thread kill itself.

#

Also made already in progress feature for if there is same request.

paper pumice
#

@chrome edge
How do I use this to get different crop types?

#

Not just sugar

chrome edge
#

It's up to you. You may make another hashmaps for other sugars

#

playerSugarData, playerWheatData etc.

paper pumice
#

Is there not a way to use the crop type for params?

chrome edge
#

You can use classes

#

but I don't think you able to do it. You've to learn Java to make process on spigot

heady jolt
#

PersistentDataContainer is basically NBT, right?

tiny dagger
#

probabily

#

i never used it or looked into it but i bet it's an extension of the nbt to allow custom data storage for plugins

#

that persists after restart

heady jolt
#

Pretty useful

tiny dagger
#

yes it is

rigid trench
#

hi

#

do you guys know how to put kits in crates ? (im sorry if that might seem easy im just new to server managment and stuff)

heady jolt
#

depends. if you want dynamic then probably get someone to make it for you. otherwise just put static stuff into your crate

#

like Poop sword

rigid trench
#

k

frigid ember
#

ok

heady jolt
#

stop saying ok, i'm really mad right now

#

jk

solar sandal
#

Hello, I have an issue with WorldEdit and WorldGurd API.
I have two locations (b1 and b2) and I transform them to sk89q's Vector using getBlockX(), Y and Z methods

Vector min = new Vector(b1.getBlockX(), b1.getBlockY(), b1.getBlockZ());
Vector max = new Vector(b2.getBlockX(), b2.getBlockY(), b2.getBlockZ());

Then I create my region and my protected region with

CuboidRegion region = new CuboidRegion(min, max);
ProtectedCuboidRegion wgr = new ProtectedCuboidRegion(name, min.toBlockVector(), max.toBlockVector());

BUT I'm getting regions with random coordinates ingame, and the regions does not have b1 and b2 for bounds.

mossy zenith
#

sec

#

I think you want a diff method gimme a sec to look at my code

#

@solar sandal what exactly is the end result?

solar sandal
#

the end result is a region with the first boundary wrong and the second one with the right boundary

mossy zenith
#

@solar sandal I meant what do you want it to do

#

but

#

try

#
ProtectedRegion region = new ProtectedCuboidRegion("RegionName", BlockVector3.at(x1, 0, z1), BlockVector3.at(x2, 256, z2));```
solar sandal
#

I'm using World Edit and World Guard 6.. No BlockVector3

mossy zenith
#

oh WG6?

solar sandal
#

yes

mossy zenith
#

sry can't help you with that one. I only know 7

solar sandal
#

and i only wanted to create a region which goes from a specific pos to a specific pos

mossy zenith
#

good luck @solar sandal. Docs on this one are rather, well, not there.

sturdy oar
#

So I have a question about this keyword, should it be used to specify that I'm accessing as class variable?

#

Like it's not required but it better makes who read know that the variable I'm using is from the same class

brisk mango
#

No, this is used only if you have variable with the same name like in a method

#

private String name;

public ClassName(String name) {
this.name = name;
}
sturdy oar
#

Yeah I know about that but I also see it used very often even when it's not absolutely essential

vernal spruce
#

it doesnt rly matter

#

it will still point to the instance variable

brisk mango
#

How is it not essential

sturdy oar
#

I was doing something like this

vernal spruce
#

will still point to the right variable

#

you shouldnt have a problem

sturdy oar
#

ok thank you

brisk mango
#

if this wouldnt exist you would have to name the variables differently

frigid ember
#

anyone know of a plugin that i could say /claimtool and then i get a golden shovel?

vernal spruce
#

Doesnt the claim plugin already have this? Also most people just put golden shovel in the starting kit

frigid ember
#

i dont think so

#

let me look

narrow crypt
#

quick question, comparing blocks, == or .equals()

vernal spruce
#

equals..

frigid ember
#

yes..

#

= is irreverent.

tiny dagger
#

equals is for their inside

#

== is just for instance equality

sturdy oar
#

blocks or Material ?

tiny dagger
#

uh?

sturdy oar
#

nvm he said Block

ashen stirrup
#

My plugin seems to be crashing my server and I have no clue how

vernal spruce
#

there is always a error

ashen stirrup
#

There's no error

#

The server just goes unresponsive

vernal spruce
#

check crashlog in the folder

tiny dagger
#

there is always a trap error

frigid ember
#

@vernal spruce there is not a kit

vernal spruce
frigid ember
#

i will wait for 1.16x

vernal spruce
#

its not rly gonna be any difference

frigid ember
#

or just learn java my self lmao

ashen stirrup
#

@vernal spruce , I don't think it actually crashes, it goes completely unresponsive and players just time out

frigid ember
#

what does the plugin do

vernal spruce
ashen stirrup
#

Oh wait

#

Found it

#
[14:54:22 ERROR]:               java.lang.String.toLowerCase(Unknown Source)
[14:54:22 ERROR]:               org.spigotmc.CaseInsensitiveHashingStrategy.computeHashCode(CaseInsensitiveHashingStrategy.java:11)
[14:54:22 ERROR]:               gnu.trove.impl.hash.TCustomObjectHash.hash(TCustomObjectHash.java:94)
[14:54:22 ERROR]:               gnu.trove.impl.hash.TObjectHash.index(TObjectHash.java:168)
[14:54:22 ERROR]:               gnu.trove.map.hash.TCustomHashMap.get(TCustomHashMap.java:420)
[14:54:22 ERROR]:               net.minecraft.server.v1_8_R3.PlayerList.getPlayer(PlayerList.java:1028)
[14:54:22 ERROR]:               org.bukkit.craftbukkit.v1_8_R3.CraftServer.getPlayerExact(CraftServer.java:431)
[14:54:22 ERROR]:               org.bukkit.craftbukkit.v1_8_R3.CraftServer.getPlayer(CraftServer.java:405)
sturdy oar
#

update

frigid ember
#

did you make it for the right server version

vernal spruce
#

oh boy just noticed 1.8

frigid ember
#

yes update

#

-_-

vernal spruce
#

also paste the full crash log to pastebin

ashen stirrup
#

That's all there is

sturdy oar
#

nobody here really wants to time travel into 2014

frigid ember
#

2013

keen compass
#

@chrome edge nice

peak iris
#

lol how do i load a schem into my world?

sturdy oar
#

Assuming you're talking about Worldedit

vernal spruce
#

does getItemInHand on blockplacevent return the correct itemstack on both hands?

keen compass
#

I think you need to check each hand individually

#

the default is the left hand too if I recall

vernal spruce
#

yeah did that at first but then noticed

#

the method

dark shuttle
#

If the block is placed using left hand then left hand item it is, or right hand item if the block placed using right hand

sturdy oar
#

isn't there a getItemInOffHand

#

or something like that

vernal spruce
#

yeah already getting the item based on what hand is used

#

wished we had a getItem on it though

subtle blade
#

getItemInHand
Deprecated. Gets the main hand

#

Use event.getItemInHand() in BlockPlaceEvent

#

@vernal spruce

vernal spruce
#

Yeah thats what im asking about

#

does it return the right item no matter what hand?

ashen stirrup
#

How do you update the scoreboard for a specific player?

Objective pobj = player.getScoreboard().getObjective("test");
Score spacer2 = pobj.getScore(Formatting.colorize("&8 "));

Doesn't seem to work

#
java.lang.NullPointerException
        at me.straggly.minetropical.events.PlayerScoreboard$1.run(PlayerScoreboard.java:51) ~[?:?]
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71) ~[server.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [server.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723) [server.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [server.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [server.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [server.jar:git-Spigot-db6de12-18fbb24]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]
#

Score spacer2 = pobj.getScore(Formatting.colorize("&8 "));

subtle blade
#

Yes it does, Stellrow

#

It will return the item used in that event regardless of the hand used

#

Jeeb, that objective doesn't exist, it returns null

ashen stirrup
#

Oh wait

#

one sec lmao

ashen stirrup
#

o = board.registerNewObjective("test", "");

#

I'm assuming "test" is the name

#

Or the String s argument for getObjective()

#

Correct?

#

Any help?

frigid ember
#

does anyone know how i can get a superflat Nether world with multiverse?

marsh hawk
#

I was thinking- should I keep a cache of stuff I read from config files ? Currently im actively retrieving and instantly saving content from config and I feel it’s super taxing on the machine.

bitter kernel
#

When a player is in an inventory and I am adding blocks to it - they are not showing. What's an efficient way to update the inventory when a block is added?

sturdy oar
#

I was thinking- should I keep a cache of stuff I read from config files ? Currently im actively retrieving and instantly saving content from config and I feel it’s super taxing on the machine.
@marsh hawk depends

#

if you plan to often read stuff you should

marsh hawk
#

Player.updateInventory()

frigid ember
#

does anyone know how i can get a superflat Nether world with multiverse?

trail dust
#

@marsh hawk is that not meant for debugging?

bitter kernel
#

tried that

marsh hawk
#

Is it? I use it often lol

sturdy oar
#

does anyone know how i can get a superflat Nether world with multiverse?
@frigid ember I do know

trail dust
#

Its a common error

sturdy oar
#

just specify the ambient type upon generation

frigid ember
#

@sturdy oar what?

marsh hawk
#

Hmm interesting what is a good alternative then? Guess I have to update my code

trail dust
#

Well honestly I'm not quite sure, I never had to really use it. Just from a lot of things I read about Inventory Updating that .updateInventory is purely used for debug purposes. I don't tend to work with updating inventories because I find them a pain in the ass when it comes round to finding efficient ways

frigid ember
#

@sturdy oar i tried that it just loaded a normal nether world

trail dust
#

If it works for you then I'm sure it's okay as it is, in @bitter kernels instance he might not be using it correctly

keen compass
#

Player.updateInventory()
updates the players inventory, not custom inventories or other inventories

#

you are probably best off closing the inventory and then re-opening it @bitter kernel

#

or you can make it a chest inventory which should show blocks being added

bitter kernel
#

ah okay thank you very much @keen compass I will try those methods

calm shuttle
#

how do i make my sky block to start

marsh hawk
#

What

valid mountain
#

How do I access my spigot server from the outside of the server's network? I've enabled port forwarding for port 25565 (automatic port), I am using my network's correct public IP address, we tried to go to the forums (couldn't post because couldn't find the button), and looked at reddit.

#

The only thing that would hinder us would be a Double NAT, but I don't want to contact my ISP to put my modem into bridge mode.

#

What should I do? The server is running, but I can't connect to it.

vernal spruce
#

if you corectlly port forward all you need to do is connect through the ip

#

it should autofill your ip

#

also have the server open at that time..

valid mountain
#

It says the port is closed, but I already enabled port forwarding for that port in my router settings

marsh hawk
#

Have you reset your router?

vernal spruce
#

either firewall might be blocking it

marsh hawk
#

Sometimes it requires a restart to take effect

vernal spruce
#

or as usual your isp placed you behind a NAT

#

(second router from the isp wich has to be on)

valid mountain
#

yeah i was kinda worried about double NAT

#

i use verizon and we have two routers

vernal spruce
#

yeah ur behind a NAT..

valid mountain
#

firewall already dealt with

keen compass
#

if you don't want to set your modem to bridge mode to resolve double nat then your only option is to set the router in bridge mode and let the modem do the routing and the router acting as a repeater.

valid mountain
#

my router is a nighthawk AX4 tho, ig i have to say goodbye to wifi 6

keen compass
#

no you wouldn't

#

your wifi settings wouldn't change

valid mountain
#

so basically i just need to make the ax4 the bridge?

keen compass
#

yes

valid mountain
#

would that require physical access?

vernal spruce
#

or contact your isp and ask what to do

#

they most likely know..

valid mountain
#

i hate my isp

vernal spruce
#

ur still paying for it

valid mountain
#

but i might

#

true

vernal spruce
#

so dont worry..

valid mountain
#

do i need to physically access the router to change the modes?

keen compass
#

the isp would just say the same as I am, either the modem gets placed in bridge mode and their personal router handles that, or the router gets set as a repeater/bridge mode and gets its settings from the modem

vernal spruce
#

most of the time

keen compass
#

no, you just need to log into the router

vernal spruce
#

they put theyr own modem in bridge

keen compass
#

yes most of the time they will do that

vernal spruce
#

as they do it through a simple button..

keen compass
#

sometimes can be done like that

#

other times it requires physical access

valid mountain
#

hopefully I can just use the router settings because i am over 10k miles away from the server

#

tq for the help

#

however, if I put my AX4 into bridge mode, will the TV service get cut off?

#

or will it still work?

vernal spruce
#

i mean tv =/= internet..

#

also no.. the worst it can happen is needing to reset the router to default

valid mountain
#

ah ok

#

resetting is just the push of a button so should be fine

tawny crescent
#

who know a plugin: it makes a portal and when people are in the portal a command is sended (console command sender)

keen compass
#

@frigid ember as it says in the messsage, ask the viaversion devs

frigid ember
#

Hey guys, is there a wiki or something where I can see all the methods of Entities, like when I extend EntityPig or whatever, how do I know which method does what

final verge
#

look at the java docs

dusty topaz
#

is there javadocs for nms entities?

frigid ember
#

I couldn't find anything

dusty topaz
#

i don't think there is

#

are all the methods obfuscated

frigid ember
#

Yes

dusty topaz
#

check the mappings

lusty vortex
#

Lol Javadoc for nms

paper compass
#

How do I check if a player is gonna die with EntityDamageByEntityEvent?

#

So I can "respawn" the player

dusty topaz
#

check if the health < 0

lusty vortex
#

It should have the calculated damage

#

Lemme check

paper compass
#

I did avro

#

Still dies

dusty topaz
#

i usually respawn on the death event

#

with a 1 tick delay

#

though it's probably better to do it the other way, I'm just lazy

lusty vortex
#

if (p.getHealth() - event.getFinalDamage() <= 0.0D) {

radiant pollen
#

@paper compass Check if health - finalDamage <= 0

dusty topaz
#

will need to put it at highest priority

lusty vortex
#

I think even then, you might have instances where it slips by annoyingly

dusty topaz
#

will p.getHealth always be >= 0.5 if alive

#

because you could try < 0.5D instead

keen compass
#

why would you need to handle respawning the player o.O

lusty vortex
#

Tournaments/ect

dusty topaz
#

to put them into spectator mode for instance

radiant pollen
#

A minigame probably.

#

Skips the respawn screen.

lusty vortex
#

Turning them into a spectator

dusty topaz
#

auto respawn

lusty vortex
#

tons of reasons

paper compass
#

I'm creating OITC

final verge
#

oh he meant nms

keen compass
#

don't know what oitc is

final verge
#

yeah you're going to have to look into that yourself

dusty topaz
#

1 in the chamber

#

One in the quiver if you ever played mineplex

paper compass
#

I've already got the arena manager and arena

#

All I need to do is the events

dusty topaz
#

you basically get 1 arrow to shoot someone with a bow

#

and it will instant kill them, usually first to X kills

lusty vortex
#

@frigid ember What method you looking for?

dusty topaz
#

i think all of them

#

he's trying to extend it

frigid ember
#

Yeah I'm just looking to browse for interesting stuff

radiant pollen
#

@paper compass If you're doing OITC, you should just "respawn" on hit instead of damaging the player.

lusty vortex
#

That's easy. All you need after doing that is to register your entity

#

So the ID is binded

dusty topaz
#

there will be a sword @radiant pollen

#

if you miss your shot

paper compass
#

I already made the arrow shot

#

I just wanted to add meelee

radiant pollen
#

oh, I see

paper compass
dusty topaz
#

😎

lusty vortex
#

@frigid ember Register your new entity in the "EntityTypes" object

#

In the NMS package

radiant pollen
#

@paper compass You need to check that the target entity is a player.

lusty vortex
#

Use reflection to call those private functions

frigid ember
#

@lusty vortex , I'm not having problems with registering the entity, I'm just trying to add stuff to the class but it's hard to tell what all the methods mean

paper compass
#

oops

lusty vortex
#

That's NMS for you. Some of the functions are mapped, like damageEntity. You just gotta figure them out

frigid ember
#

alright

lusty vortex
#

Just follow the logic. It's pretty self explanatory

#

You on 1.8?

frigid ember
#

Yeah

lusty vortex
#

Yeah then it's super easy

#

t_() = base tick

frigid ember
#

The only reason why I'm staying on 1.8 is because 1.15 takes forever to load

lusty vortex
#

Don't try to start a debate 😆 . The people here HATE 1.8

radiant pollen
#

lmao...

tiny dagger
#

1.8 move tick is super weird, every entity has their own method name

silk nymph
#

Hi, how do I get a host name for a server?

#

So that I'm not giving out my ip?

hoary parcel
#

you need to buy a domain

#

but a domain can still be translated into your IP

paper compass
#

When my friend kills me, his body gets deleted?

tiny dagger
#

^^

#

lol

#

sounds like you use remove on him

silk nymph
#

Oh, how do big servers do it then, proxy? @hoary parcel

paper compass
#
            Player p = (Player) e.getDamager();
            Player target = (Player) e.getEntity();
            if (p.getItemInHand().getType().equals(Material.WOOD_SWORD)) {
                if (target.getHealth() - e.getFinalDamage() <= 0) {
                    target.setHealth(20);
                    User sUser = userManager.getUser(p);
                    User dUser = userManager.getUser(target);

                    if (manager.isInGame(p) && manager.isInGame(target)) {
                        sUser.addKills(1);
                        e.getDamager().remove();
                        dUser.removeLives(1);
                        p.sendMessage("§eYou killed §6" + target.getName() + "§e!");
                        p.getInventory().setItem(2, new ItemStack(Material.ARROW, 1));
                        if (dUser.getLives() <= 0) {
                            manager.removePlayer(target);
                            target.sendTitle("§cYOU DIED!", "§eYou are now out of the game.");
                            dUser.setAlive(false);
                            dUser.setInGame(false, null);
                            return;
                        }

                        target.sendTitle("§cYOU DIED!", "§e" + dUser.getLives() + " Lives remaining");

                        target.teleport(dUser.getGame().getRandomSpawn());
                        target.getInventory().setItem(2, new ItemStack(Material.ARROW, 1));
                    }
                }
            }
        }```
#

SHIT

#

I REALISED

#

e.getDamager().remove();

#

LMAO

tiny dagger
#

yup

#

ez bug fix

hoary parcel
#

they just don't hide their IP

#

it doesnt make sense

tiny dagger
#

what do people think of ip

hoary parcel
#

they instead put ddos protection in-between you and the actual server

tiny dagger
#

it's not the gateway to evil it's your internet address

frigid ember
hoary parcel
#

it's not the gateway to evil it's your internet address

#

I mean

#

its the gateway to the internet

#

so its the gateway to evil 😂

tiny dagger
#

which can be evil

inland depot
#

Does anyone know how to get the ID of a hologram using HolographicDisplaysAPI?

lusty vortex
#

@frigid ember That's a feature

#

Maybe delete your world folders 🤷‍♂️

silk nymph
#

Ok but if someone has my public ip what can they do with that?

#

Is ddos it? In which case I'm not worried

hollow obsidian
#

Erm....

#

Well... xD

#

It's nothing to worry.

silk nymph
#

but...

#

?

buoyant star
#

"erm well" doesn't sound assuring, lol

hollow obsidian
#

I mean... Depends who has it.

frigid ember
#

Well you shouldn't be hosting from your home computer anyways

hollow obsidian
#

As long as you secure your end behind a firewall and complex passwords and better yet SSH keys you'll be fine.

tiny dagger
#

depends on your opened ports tbh

silk nymph
#

I know nothing about networking really, what do I need to do be secure?

frigid ember
#

If your hosting from your home computer and streaming a movie then everyone on your server could lag

silk nymph
#

It's on a separate machine

hollow obsidian
#

MC don't use that much bandwidth xD

silk nymph
#

eks dee

frigid ember
#

Streaming movies might

silk nymph
#

Again, not worried about that

#

Is it easy to be secure?

#

Or is it really complex lol

hollow obsidian
#

I mean you leave your public IP everywhere so it's not something I would worry about.

tiny dagger
#

close ports

hollow obsidian
#

If you're home hosted it's likely to change every so often anyway.

tiny dagger
#

especially 80

silk nymph
#

I've set it to be static

tiny dagger
#

what are the sensitive ports btw? 🤔

silk nymph
#

Alright how do I close ports freestyler? If I was to google that what exactly would I google?

hollow obsidian
#

You don't just set a public address to a static address, that normally costs extra.

tiny dagger
#

your router does it for you

hollow obsidian
#

Settings on your router.

silk nymph
#

Ok, if my router does it for me why'd you saY?

tiny dagger
#

nice bios

silk nymph
#

I assume there's something I've got to do

hollow obsidian
#

If you haven't touched anything your end it'll be setup as default.

#

Port forwarding is your main concern at this point, only open the ports MC is using.

#

Example 25565 and what ever RCON is

silk nymph
#

What does RCON mean lol

digital sphinx
#

i have errors. Please Help

        at org.mcstats.Metrics.postPlugin(Metrics.java:336) ~[?:?]
        at org.mcstats.Metrics.access$4(Metrics.java:329) ~[?:?]
        at org.mcstats.Metrics$1.run(Metrics.java:224) ~[?:?]
        at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:81) ~[spigot-1.15.2-R0.1-SNAPSHOT.jar:git-Spigot-2040c4c-893ad93]
        at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) [spigot-1.15.2-R0.1-SNAPSHOT.jar:git-Spigot-2040c4c-893ad93]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

hollow obsidian
#

Don't worry about it then, you're probably not using it.

silk nymph
#

Alright my only ports open are 25565 on tcp and udp

hollow obsidian
#

@digital sphinx Paste bin the code mate.

digital sphinx
#

Huh?

hollow obsidian
#

Is this a plugin you're working on?

#

Or just something you've downloaded.

digital sphinx
#

Plot²

hollow obsidian
#

So it's a plugin you've downloaded ?

digital sphinx
#

Yes, i bought it. And then i downloadeded

hollow obsidian
#

I wouldn't be reporting it here, doesn't look like something you can deal with. I would submit a bug report to the seller, check his instructions first.

dusty topaz
#

Yeah, they have a support discord I think

rapid sand
#

Im getting errors like this every time i go to chunks near the corner of my pregenerated world:

> [18:33:49] [Spigot Watchdog Thread/ERROR]: net.minecraft.server.v1_15_R1.World.setTypeAndData(World.java:297)
> [18:33:49] [Spigot Watchdog Thread/ERROR]: net.minecraft.server.v1_15_R1.World.a(World.java:380)```
#

I have no idea what to do about it tho

chrome edge
#

@rapid sand As I understand from the 3 line error code it's about placing block in chunk and notify the chunk that block is places so chunk can do physic to it.

#

If you generate world another version, it can make those error or maybe block id problems.

rapid sand
#

If i were to run this through a chunk fixer program, would it fix it?

#

basically ive put a 1.12 singleplayer forge generated custom biome OTG world, deleted all the entities and put it into a 1.15 world by forceupgrading

chrome edge
#

So I've founded your error.

#

Fix it xD

hallow surge
#

anyone know why this code wouldn't be working its supposed to set sugar cane blocks mined to air and put them directly in the inventory of the player

        @EventHandler
        public void onSugarCane(BlockBreakEvent e) {
            Player p = e.getPlayer();
            Block b = e.getBlock();
            Material m = b.getType();
            if (m == Material.SUGAR_CANE) {
                int canes = 0;
                e.setCancelled(true);
                do {
                    b.setType(Material.AIR);
                    b = b.getRelative(BlockFace.UP, 1);
                    canes++;
                } while (m == Material.SUGAR_CANE);
                p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));

            }
        }
    }```
subtle blade
#

You don't ever re-assign m

#

That should technically crash your server lol

boreal tiger
#

whats the bukkit datapacks folder for?
Is there a way to load a datapack from within a plugin?

subtle blade
#

No there is not. Datapacks should be world/data or something like that. Whatever the vanilla per-world one is

hallow surge
#

But it isnt crashing my server so I'm happy 🙂

subtle blade
#

It should. If you're running that code, it will crash your server

#

It's an infinite loop

boreal tiger
#

ah right, there's a bukkit datapack folder though. The description says "datapack for resources provided by bukkit plugins"

subtle blade
#

That being said, change while (m == Material.SUGAR_CANE); to while (b.getType() == Material.SUGAR_CANE); and it will work

sleek ivy
#

so I haven't coded for spigot since bukkit died. it seems like the item IDs:sub ids have been fully replaced by Material entries, correct?

hallow surge
#

oh okay

subtle blade
#

Yes

#

1.13 flattened all of that

sleek ivy
#

sweet

subtle blade
#

Each block has its own separate material, states define how they interact with the world

sleek ivy
#

my old code was so hacky

boreal tiger
#

is that folder for future use with bukkit then choco?

subtle blade
#

PES_SadShrug I was unaware there was a folder designated for plugin datapacks

#

Mostly because plugins aren't data packs nor do they supply any lol

boreal tiger
#

I mean you could include one and move it to that folder I guess 🤷‍♂️

subtle blade
#

However they most definitely should be. It's a change that will inevitably have to be made so all data-based things can just be defined by files in the plugin

boreal tiger
#

right

subtle blade
#

Though I think md is hesitant because of two things. (1) That's a MASSIVE change. (2) What happens when you remove that plugin?

#

How should the server handle that? If at all

boreal tiger
#

yeah makes sense

subtle blade
#

that an other priorities, but yea lol

boreal tiger
#

I wonder if we can use a function from a datapack with nms

#

I was looking for a cheap way to play a midi xD

subtle blade
#

Do data packs support midi? o.O

#

I didn't think they did

boreal tiger
#

dont thnk they do, but the noteblock studio has a way to export

#

to datapack

#

not sure how it works

subtle blade
#

Likely a function to run playSounds

boreal tiger
#

yeah

subtle blade
#

(the /sound command)

hallow surge
#

Plugin still isnt working

#

in theory that code should work

boreal tiger
#

it uses scoreboard teams as well. weird lmao

subtle blade
#

Yea that should work fine. Is the listener registered?

hallow surge
#

yep listener is registered hmm

#

I tried something with the plugin yml

#

might have not been loading?

subtle blade
#

I would say run this bit a tick later:

                do {
                    b.setType(Material.AIR);
                    b = b.getRelative(BlockFace.UP, 1);
                    canes++;
                } while (m == Material.SUGAR_CANE);
                p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));```
#

Schedule a task for the next tick

hallow surge
#

so delay the action one tick

subtle blade
#

Yea

hallow surge
#

see I made base examples for all this stuff its all about digging it out of files to remind myself xD

subtle blade
#

Bukkit.getScheduler().runTaskLater(plugin, () -> {}, 1L);

#
Bukkit.getScheduler().runTaskLater(plugin, () -> {
    // the code here
}, 1L);```
hallow surge
#

Local variable b defined in an enclosing scope must be final or effectively final
Getting this error with 2 varriables now

subtle blade
#

Right. lol

#

Silly anonymous inner classes sadgery

radiant pollen
#

Would it be better to store information about a player in memory and then save to database when the player leaves or on server shutdown or use a task to periodically save the information that has been updated?

#

Seems like the latter would be safer, but would it slow the server down?

subtle blade
#
Bukkit.getScheduler().runTaskLater(plugin, () -> {
    Block block = b;
    int canes = 0;
    do {
         block.setType(Material.AIR);
         block = block.getRelative(BlockFace.UP, 1);
         canes++;
    } while (block.getType() == Material.SUGAR_CANE);
    p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));
}, 1L);```
#

(move canes into the runnable, re-define block)

hallow surge
#

I moved canes and block into the runnable

#

gets rid of that error

tiny dagger
#

i wish the compiler knows the value at that point would be final anway :p

subtle blade
#

Neither of them are though

#

They're both being modified. Compiler is right

radiant pollen
#

I think he means they're being modified by the inner class, right?

#

So it should be smart enough to realize it's fine???

subtle blade
#

Yep

#

No

#

lol

#

The fact that they can't be modified from the inner class is the reason it's yelling at him

#

The variables were defined out of scope

radiant pollen
#

Oh I see

#

Yeah, duh

hallow surge
#
        @EventHandler
        public void onSugarCane(BlockBreakEvent e) {
            Player p = e.getPlayer();
            Block block = e.getBlock();
            if (block.getType() == Material.SUGAR_CANE) {
                e.setCancelled(true);
                Bukkit.getScheduler().runTaskLater(plugin, () -> {
                    int canes = 0;
                    Block b = e.getBlock();
                do {
                    b.setType(Material.AIR);
                    b = b.getRelative(BlockFace.UP, 1);
                    canes++;
                }  while (b.getType() == Material.SUGAR_CANE);
                p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));

            }, 1L);
        }
    }
    }``` this should fix it?
subtle blade
#

As far as I'm concerned, yea. Indentation is off but it should work fine

hallow surge
#

yea not worried about making my code pretty atm

#

just trying to get it working

subtle blade
#

Never understood that justification

#

I always want my code to look good lol

radiant pollen
#

Yeah, it'll screw you up later.

#

Anyway... what should I do about my database changes?

subtle blade
#

Up to you. How time sensitive is that data?

radiant pollen
#

Should I create a PlayerInfo object and initialize it from database information when the player connects and edit everything there then save when player quits?

hallow surge
#

its still dropping on the ground?

radiant pollen
#

It's player level/exp data that gets changed frequently.

#

So I don't want to update the database every time.

#

I'm just wondering if I should do it on player quit, or in a task every minute or so?

#

I'm thinking on quit? Just because I can work with the information in memory until the player quits. It doesn't need to be in the database yet, no one else is using it but me.

hallow surge
#

no need to really keep constantly updating it until the player quits imo

#
package me.y2k.dragonstokencommand;

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack;

public class ScaneToInv implements Listener {
    DragonsToken plugin; 
    public ScaneToInv(DragonsToken dragonsToken) {
        plugin = dragonsToken;

        }
    @EventHandler
    public void onSugarCane(BlockBreakEvent e) {
        Player p = e.getPlayer();
        Block block = e.getBlock();
        if (block.getType() == Material.SUGAR_CANE) {
            e.setCancelled(true);
            Bukkit.getScheduler().runTaskLater(plugin, () -> {
                int canes = 0;
                Block b = e.getBlock();
                do {
                    b.setType(Material.AIR);
                    b = b.getRelative(BlockFace.UP, 1);
                    canes++;
                    }  while (b.getType() == Material.SUGAR_CANE);
                        p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));

                }, 1L);
            }
    }
}``` put it into its own class so its easier to read. still not working no idea why rest of the plugin is working fine gui's giving items etc this code should work it reads like its working no errors not sure why it just doesn't go straight into  the inv and items are still dropping
wraith grail
#

Is it possible to add some form of "selector" to indentify worlds besides just the world name? I plan to create a world for every player using their hashed + salted UUID as worldname, but there are certain things I need to do codewise. Think of it as adding a class to a div tag in HTML/CSS, but the div tag is the world instead. If not, is there some form of workaround I can do whereas I place for example a always loaded armorstand somewhere in the world and assign it a name as a selector (and consequently always keep that chunk loaded as long as the player is in the world)?

The thing is that I plan to play sounds that normally never occours from events seperately in these worlds.

hallow surge
#

depending how many players you have thats gonna fill up your storage fast

wraith grail
#

Ah, I already tought of that. Worlds are deleted when the player has finished the world.

hallow surge
#

like beat the ender dragon?

wraith grail
#

No, I am not going to give out that much information. (And we are getting away from what I asked.. 😦 )

hallow surge
#

true

#

just gonna say now depending on what your doing storage gonna be an issue

radiant pollen
#

There are events for chunk loading and unloading that you can work with.

#

Also, worlds should have a UUID.

hallow surge
#

still having that dumb issue with my code 😠 boutta give up

#

should take a break

wraith grail
#

I'll check it out. Thanks.

radiant pollen
#

@hallow surge Are the items put into the player's inventory?

hallow surge
#

no

#

they are dropped on the floor

#

my code's entire purpose is to have them put directly into the invenotry

radiant pollen
#

@wraith grail You should track the EntityID of the armor stand. When a chunk is unloaded, if its entities contain that entity, cancel it. Could get laggy if there are lots of entities in the chunk. There might be a better way to do it, but that's my first thought

#

Yeah, that's why I asked.

#

Seems like the code isn't running at all.