#help-archived

1 messages · Page 125 of 1

sudden current
#

let me see

sturdy oar
#

🤦

#

Give. More. DRAM

#

You sure can boot a server with 1024Megabytes of heap, but good luck keeping it on with even 1 player

sudden current
#

first i need to be able to connect to the port

barren yarrow
#

With .getTotalExperience, does that convert levels into experience points too?

sudden current
#

I am executing the command shift+right clicking then opening a powershell window and then executing the command "java -Xmx1024M -Xms1024M -jar spigot.jar" should i use another way to execute the command?

sturdy oar
#

make a bat script

#

you don't want to write the command each time lol

sudden current
#

i already tried that also and doesn't work

sturdy oar
#

it does work.

#

you did it incorrectly

sudden current
#

i mean the port thing

sturdy oar
#

ok

sudden current
#

the server works

#

with the .bat

sturdy oar
#

Well i have no experience with Windows 10 firewall because it's just trash

#

can't help sorry.

frigid ember
#

Whats the best way to check if a inventotry is the same as another?

sudden current
#

i'll try deactivating the firewall

chilly hatch
#

if (invA.equals(invB))

#

or by contents

frigid ember
#

ok

sudden current
#

it was the firewall ._.

chilly hatch
#

are you saying if they're literally the same inventory

#

or have the same contents

frigid ember
#

Its a invenotry i open a player and he clicks items in it.

#

?jd

worldly heathBOT
frigid ember
#

What does this mean? java.lang.NoClassDefFoundError: Could not initialize class me.alexprogrammerde.petsplus.config.LanguageManager

strange echo
#

The class was found during compile time but was missing during runtime.

frigid ember
#

How can this occur?

#

I just compiled it. How can i fix this?

strange echo
#

It depends on your setup

frigid ember
#

the library the class is referenced from isn’t on the classpath

strange echo
#

That /\

frigid ember
#

you might want to consider shading it if it is a standalone plugin

#

hm

#

e.g include it within the jar itself

#

I got this at reloading the config: [17:44:42 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'pets' in plugin PetsPlus v1.0

strange echo
#

What's the full error

frigid ember
#

obviously there are deeper issues than a npe if its not on the classpath

#

please send a pastebim

novel frigate
frigid ember
#

nvm

#

It worked fine before i restructured the code.

#

wait

#

are you using reflective access?

strange echo
#

There was a Null pointer exception at ConfigHandler.reloadConfig() line 32

frigid ember
#

Whats that?

#

okay, i need more context

#

What can cause this?

#

are you accessing an external library

#

or is this all one project

#

Or what do you mean?

barren yarrow
#

Is there a way to easily remove a specific amount of a players exp but only if they have enough?

frigid ember
#

What does this mean? java.lang.NoClassDefFoundError: Could not initialize class me.alexprogrammerde.petsplus.config.LanguageManager
@frigid ember

#

No its all in one package

#

me.alexprogrammerde.petsplus

#

public static FileManager config;
public static FileManager language;

public static void loadConfig() {
    config = new FileManager().createConfig(Main.getPlugin(Main.class), "config.yml");
    language = new FileManager().createConfig(Main.getPlugin(Main.class), "language.yml");
}

public static FileConfiguration getConfigFileConfiguration() {
    return config.getConfig();
}

public static FileConfiguration getLanguageFileConfiguration() {
    return language.getConfig();
}

public static FileManager getConfigFileManager() {
    return config;
}

public static FileManager getLanguageFileManager() {
    return language;
}

public static void reloadConfig() {
    config.reloadConfig();
    language.reloadConfig();
}
strange echo
#

@barren yarrow You can get the players exp, check if it's enough and remove it. Just a simple if statement.

frigid ember
#

where is languagemanager being referenced

#

package me.alexprogrammerde.petsplus.config;

import org.bukkit.configuration.file.FileConfiguration;

public class LanguageManager {
public static FileConfiguration language = ConfigHandler.getLanguageFileConfiguration();

public static String getText(String section) {
    String text = language.getString(section);

    return text;
}

}

barren yarrow
#

@strange echo Ive tried if (player.getTotalExperience > requiredXP) and it doesnt work and Im not sure why

frigid ember
#

jumpMeta.setDisplayName(LanguageManager.getText("items.jump"));

strange echo
#

' if(playerExp > amount_to_be_taken)
Then remove it

barren yarrow
#

Thats what I said though...

#

Im basically making mending in a command

strange echo
#

Pastebin the class

errant ledge
#

Hello i need to ask I have purchased a resource and haven't recieved it its been 2weeks the author for said plugin hasn't been on spigot for a year...

#

So this is the only place I can turn to

#

I am not sure where to go for this or if I should do a paypal dispute or

#

Found out he didn't claim the payment cause he is inactive so I have just cancelled with paypal

barren yarrow
#

Even when the player doesnt have enough exp it still executes

strange echo
#

Ok so it runs when the player doesn't even have the required exp.

#

Before the if statement output to the console the players exp and the required exp

#

Just to check the values of each

barren yarrow
#

and my mum just called me, great

strange echo
#

Lol

frigid ember
#

i am having a problem with the world edit plugin
it does not generate a config file
but is detected by /plugins

rotund hemlock
#

hello

eternal sandal
#

i was gonna send an image showing the scoreboard and the file but no. i cant use %vault_eco_balance_fixed% on my scoreboard or it breaks. i cant use any of the others, i just cant use balance on my scoreboard. basically when i use it 90% of the scoreboard unrenders idk y it happens but thats y im here so i can get help

#

i do have placeholder API

jaunty sundial
#

I have questions about between spigot and paper. Most of articles saying paper is better than spigot, but i think spigot is more better because plugins are mostly made on spigot, and plugin's performance is also better than paper's. Why articles saying and recommending to use Paper?

mellow wave
#

Paper is a fork of spigot which means that most plugins working on spigot should also work on paper. Paper is built to have faster preformance. As for better plugin preformance on spigot where did you get that from?

undone narwhal
#

Paper may remove some not noticeable "vanilla behavior" to imporve its performance. However you've to really know the game deep to notice it

#

All spigot plugins work on paper

gleaming helm
#

Paper makes additional performance enhancements on top of spigot (essential if you want any kind of larger player base), and then Tuinity actually makes even more enhancements on top of paper (plus it's much more stable because the dev doesn't push unstable patches to master)

jaunty sundial
#

Thank you for good informations. I read that articles which mean paper better than spigot on spigotmc threads. After reading the article, since then, I've wondered why they say so.

sturdy oar
#

tbh if you're running recent versions theres no reason to not user Paper

gleaming helm
#

tbh if you're running 1.15 there's no reason to not use tuinity

sturdy oar
#

🤷‍♂️ I have never tried SpottedLeaf's fork

wind dock
#

does anyone here know a player counter plugin that subtracts from the player counter when someone dies, to show how many people are actually alive?

#

also possibly a way to add the player back to the counter?

barren yarrow
#

Is this the correct function of this?

if (player.getTotalExperience() > requiedXP ) {//if yes} {//if no}

odd knoll
#

Looks so. Just use larger than or equals instead of just larger than.

barren yarrow
#

Thats >= right?

odd knoll
#

I can never remember, either >= or =>

#

Probably the first, what you said.

barren yarrow
#

ngl been at this for like a day now trying to figure out why I cant get this to work xD

dusty topaz
#

getTotalExperience is not all the exp a player has

#

it is the exp the player has had over a lifetime

barren yarrow
#

oop

#

Whats the one for current exp?

dusty topaz
#

i just tend to use that class

#

not sure where I found it

#

but has worked for me

barren yarrow
#

Im kinda new to this java plugin writing thingy, does all that -only- calculate the current exp and nothing else?

boreal juniper
#

Hey can someone tell me why this is happening
java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics

dusty topaz
#

The methods are commented with what they do

boreal juniper
#

I'm building a Kotlin plugin

dusty topaz
boreal juniper
#

Still the same error

#

[20:36:21 ERROR]: Error occurred while enabling DungeonSurprise v1.0-SNAPSHOT (Is it up to date?) java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics

dusty topaz
#

Then try the next solution

boreal juniper
#

Line 6 causes the error

#

And Yes I used this tutorial checked like 20 times

#

I can't figure it out

tiny dagger
#

this hurts my eyes

#

it's readable but jeez

barren yarrow
#

What does .getExpToLevel do exactly?

proper cairn
#

Any reason why i cant look at the raw source code of spigot in intellij

subtle blade
#

Most definitely can. Open one of the projects generated in BuildTools as you would any other Maven project

proper cairn
#

@subtle blade

#

Im pretty sure i used gradle not maven

#

Somebody recommended me to use maven though

subtle blade
#

Ah you just want to open it from a dependency

#

API you should be able to open so long as sources are being downloaded alongside your dependency. Implementation (CraftBukkit) is a different story. Because it can't be hosted on the repository and it's only local installed to your Maven repository by BuildTools, source isn't really included in the typical sense

#

Generally you can rely either on your IDE's built-in decompiler or, if possible, attach source to your dependency to that provided by BuildTools. Not sure how that would be done in IJ, I'm sure someone more familiar with it can assist

proper cairn
#

added it to dependencies and still having the same issue

#

Sources not found: Sources for 'spigot-1.15.2.jar' not found]

subtle blade
#

Sources not found: Sources for 'spigot-1.15.2.jar' not found]
spigot != spigot api. API sources are available on the repository, CraftBukkit & Spigot implementation are not for legal reasons

#

Again, it's local installed to your Maven repository without sources. You would have to attach sources from BuildTools but I'm unsure how to do that. I use Eclipse

barren yarrow
#

Could someone help me out here? So the main aim of this is to act like youre draining your exp from your levels and putting it into your mending gear but my problem is that even when the player has less than the required amount, it still completes the command, heres the pastebin;

https://paste.md-5.net/yacepusoje.java

#

I keep getting "Total experience points must not be negative (-772*)"

#

*This changes depending on tool damage

#

But I have -

if (player.getTotalExperience() >= requiredXP );{
player.setTotalExperience(player.getTotalExperience() -requiredXP);;

in place and it doesnt work

frigid ember
#

you have a weird ;

rotund orbit
#

My Minecraft Development plugin seems to no longer be working...
The configuration next to the build UI is gone and I can't build my project anymore. Do I need to make a new project and copy the files over? Edit: made a new project and it seems to be working now

barren yarrow
#

@frigid ember I do?

frigid ember
#

yup I think that stops it

barren yarrow
#

Which one? Theres alot haha

frigid ember
#

in the if

#

don't think it's needed here

barren yarrow
#

now the command is just appearing in chat .-.-.

frigid ember
#

you also need only one, not two ;; below

barren yarrow
#

I just rolled it back to previous version where /mend coming up in chat didnt happen but if one semi colon has caused me 8 hours of pain Im gonna jump off a bridge

fading owl
#

Does spigot have a 1.16-pre'X' in development?

#

@sturdy oar I swear if this is some sht answer

sturdy oar
#

I've already answered that in general

fading owl
#

Oof

barren yarrow
#

Now its saying I dont have enough exp .-.

#

//Current Damage On Tool
short DamageOnTool = (short) (helditem.getDurability());

                //Required Exp To Mend tool
                //this is a positive number
                int requiredXP = ((DamageOnTool/2));
                
                //Total exp
                short TotalXP = (short) (player.getTotalExperience());
                
                
                
                
            if (TotalXP > requiredXP ){
                
                player.setTotalExperience(TotalXP - requiredXP);
sturdy oar
#

bro do you know that discord formatting exists

barren yarrow
#

Idk how to do it .-.-.

fading owl
#

It's called markdown

#
final class MyCoolClass {

}
sturdy oar
fading owl
#

255

#

ayy

barren yarrow
#

'''test'''

#

oop

fading owl
#

close

#

so close

sturdy oar
#

no it's not quotes

#

it's ``

barren yarrow
#

test

sturdy oar
#

gg

barren yarrow
#

woooo

#

nope

#

Ill stick to pastebin xD

sturdy oar
#

🤷‍♂️ yeah

fading owl
#

why pastebin

#

just take images of ur code

#

200iq

sturdy oar
#

pastebin, or pastegg they both fine

barren yarrow
#

Its the line for Current Player exp > required XP to repair pick

#

Like if your exp points are bigger than the damage/2 (mending rate)

#

Now it just says not enough xp

#

No matter the exp level it skips it

#

Please can someone help, Ive literally spent a day trying to get this to work .-.

light geyser
#

Since PlayerPickupItemEvent is depricated, whats a good replacement?

proper cairn
#

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000047b800001bb4, pid=10092, tid=0x00000000000027cc

#

Never seen this error in my life

light geyser
#

seems like a kernel error

#

something linux would throw, not the jvm

proper cairn
#

Im on Windows

light geyser
#

uhh yeah windows could prob throw it too

proper cairn
#

hmmmm

#

Any way around it

#

ive looked it up multiple forums is saying that it is a RAM isse

#

issue

sturdy oar
#

where did you get that exception from?

#

seems more like a JVM issue

#

than a spigot one

buoyant path
#

Is it possible to use armorstands above a player’s head to show their health and not lag?

frigid ember
#

yes

#

for not lag part: get better processor

#

you could also use clientside armorstand to reduce lag

slim burrow
#

anyone can help me with hiding nametags above players heads when they drink invisibility potions, this is for a modified bedwars with scorboards, so i cant add any more scoreboard or anything like that so

#

and this game is in 1.8.9

rotund orbit
#

Non-technical question here. Someone just asked if I do commissions and wants to pay me to alter a plugin of mine to his specifications. I wanted to ask how much do people normally charge for commissions?

undone narwhal
#

Depending on the work time. Decide on an average €/hours and count your hours

rotund orbit
#

Good idea. Thank you.

sturdy oar
#

I've done few commissions in the past, i usually charge depending on how much time i'll plan to take for that software, and how complex it will be.

#

You also usually want to have some sort of legal sheet when you do commissions usually

#

you never know when people decide that they won't pay you 🤷‍♂️

barren yarrow
#

Can I pay one of you guys to help me with this plugin then xD

sturdy oar
#

bruh

frigid ember
#

sure pay me

barren yarrow
#

Its just one line of code that needs looking at xD

sturdy oar
#

ok sure it's 50000€

#

or an Audi R8 is fine as well

barren yarrow
#

Ah okay, I was thinking two?

bronze marten
#

3, I know my standards

barren yarrow
#

Well for you Frank Ill see what I can do haha

bronze marten
barren yarrow
#

This if command isnt working how I intent it to, they are if (thing) {if yes} {if no} right?

sturdy oar
#

wut?

bronze marten
#

eh

#

if (sth) {
//yes
} else {
//no
}

#

that will be 10$ then

#

paypal?

sturdy oar
#
if (statement) {
//do your stuf...
return;
}
//do other stuff

or this

barren yarrow
#

Do I have to put return after everything?

bronze marten
#

only if you want it to stop reading

#

and move back to the caller

sturdy oar
#

returns; completes a void method

barren yarrow
#

Because I have if statements within if statements

#

Like so basically as one big and statement

bronze marten
#

nested ifs nice

sturdy oar
#

if possible nested 'if' statements should be avoided

barren yarrow
#

How would I go around that?

sturdy oar
#

show full code and I might help

#

have no idea of your context

barren yarrow
#

Yeah no worries

#

Im still on that thing where Im putting mending on a command

#

So if an item has mending, it drains your exp and puts it "into" the tool/armour

subtle blade
#

(1) onEnable() and onDisable(), if not used, do not need to be there. Override if you want to do something
(2) Invert and return
(3) Checking for == true is redundant. Just compare against the returned value. if (player.hasPermission("whatever")), for instance
(4) There is an ItemStack#containsEnchantment() method
(5) Please fix that indentation :(( If you're in Eclipse, Ctrl + A and Ctrl + Shift + I

#

(or Ctrl + I, I can never remember)

#

Example of invert and return:

// Before:
if (foo) {
    bar();
} else {
    example();
}

// After
if (!foo) {
    example();
    return;
}

bar();```
#

If you can invert and return without interrupting the flow of your code, do it. Avoid unnecessary indentation

sturdy oar
#

it's not the whole command, but you get the idea

barren yarrow
#

Yeah I get you

#

Its my first plugin so I knew it wouldnt be the best thing ever haha

sturdy oar
#

don't worry i've seen worse things

#

also I suggest you use the text-formatting feature of your ide

#

because your brackets are kinda messed up

subtle blade
#

It's not that it's inherently bad. It's at least readable. Though as you progress in learning Java, you'll find that it gets messy when 50% of your code is spaces or tabs

sturdy oar
#

I've learned about this code style very late as well to be fair

#

i used stuff like 4 nested switches as well before lol

#

it did hurt my brain after all

dusty topaz
#

I use google code style

#

But 100 line width was too thin

knotty surge
#

What's the proper way to send a single message with multiple lines?

dusty topaz
#

You can use \n except at the end

sturdy oar
#

doesn't "\n" work

knotty surge
#

I thought it was broken on bukkit

dusty topaz
#

evidently not

sturdy oar
#

oh i think it only works inside components

dusty topaz
#

no, it works in sendMessage

subtle blade
#

What's wrong with multiple sendMessage() calls?

dusty topaz
#

thats what I usually do

knotty surge
#

why should you need multiple sendMessage calls

dusty topaz
#

to send multiple messages

subtle blade
#

lol

knotty surge
#

it's a menu, thus should be sent as one message

dusty topaz
#

message in minecraft terms is a single line that will wrap

#

thus, multiple lines is multiple messages

sturdy oar
#

Isn't item lore an array of strings'

knotty surge
#

that's 2014 speak

sturdy oar
#

where each string is a newline

dusty topaz
#

ok then im a boomer confirmed

subtle blade
#

You're arguing the difference between

System.out.print("Hello\nWorld");
// and
System.out.println("Hello");
System.out.println("World");```
#

They're equivalent

sturdy oar
#
public static void sendMessages(final Player player, final String... msgs) {
    for (final String msg : msgs)
        player.sendMessage(msg);
}
``` Nothing is wrong with something like this
subtle blade
#

Fendi, lore is a list of strings. So, yes? Technically

dusty topaz
#

But with sendMessage

player.sendMessage("\n\n")
player.sendMessage("\n")

are equivalent

#

iirc

#

you can't have trailing newline

knotty surge
#

Yea but it's also good to consider that another plugin might be sending a message at the same time

subtle blade
#

Between the nanosecond of time that you're sending your message? Unlikely

dusty topaz
#

not like processors can perform billions of operations / second

subtle blade
#

Latency has to be taken into consideration I think is what he's getting at

#

because a sendMessage() is nothing more than a packet

#

(logging, yeah yeah, client sees it as a packet though)

#

I wouldn't rely on \n anyways. There's no guarantee that it will always be supported

#

Especially with the rise of text components

knotty surge
#

text components work just fine with \n right

subtle blade
#

They do but they also work just fine with the section symbol. As far as I'm aware, it's a remnant of legacy chat

knotty surge
#

🤷‍♂️ other server softwares fully support \n

subtle blade
#

That's fine but what we're concerned with is the vanilla server

#

Who may at any given time decide that legacy chat may be removed

#

What's important here is the client which may no longer support that character

#

What's done on the server is irrelevant

#

(unless it's parsed on the server and sent as individual messages - which would be strange lol)

barren yarrow
#

How do I fix cannot convert int to boolean?

knotty surge
#

what are you trying to do?

barren yarrow
#

if (player.getTotalExperience());

knotty surge
#

really should learn java before you make plugins

#

you have to compare the int to something

barren yarrow
#

Like thess than greater than kinda thing?

knotty surge
#

equals, greater than, less than, etc

frigid ember
#

@barren yarrow Not trying to criticize but i'd recommend learning at least basic syntax of java before making plugins.

barren yarrow
#

I tried that and it didnt work which is why I was asking

solar prism
#

wdym int to Boolean?

#

like 0 to false and 1 to True?

#

oh nvm

#

I just read above

#

ok then, show what you did

barren yarrow
naive goblet
#

Well idk but does both return an int ?

timid valley
#

if anyone wants an easy pr for spigot, public void runTaskTimerAsynchronously(Plugin plugin, Consumer<BukkitTask> task, long delay, long period) needs a fixing. it doesnt work due to period being ignored

naive goblet
#

It doesn’t?

gleaming helm
#

Wtf

subtle blade
#

Aikar, you know that you too can make PRs, right?

#

😅

#

Especially one with as trivial of a change as that

gleaming helm
#

What the fuck causes that and doesn’t fire a unit test

odd knoll
#

Aikar really do be helping people's GitHub stats 💜

dusty topaz
#

if only spigot was on github

odd knoll
#

Oop

#

Forgot

subtle blade
#

Bukkit was on GitHub for some time

#

Then the DMCA. I believe that's the reason it's no longer there. To avoid any potential DMCA issues from GitHub

#

(the latter of which was included in the DMCA for obvious reasons)

odd knoll
#

Yh. I read about it a couple months ago.

#

I just forget every so often 😭

subtle blade
#

BungeeCord is still on GitHub, and the Stash still hosts the projects much like GitHub would, only it's under a different domain

#

(and PRs are behind a CLA, but that would have been done on GitHub as well tbh)

steady osprey
#

so i have a class where if a certain block gets place it stores the blocks location in a file which works but im trying to make it so when the same block breaks it removes the location from the file and it doesnt even get to the first if statement

@EventHandler
    public void onDestroy(BlockBreakEvent e) {
        Player p = e.getPlayer();
        Location blockLoc = e.getBlock().getLocation();
        FileConfiguration config = Main.getInstance().getConfig();
        if(e.getBlock().getType() == Material.getMaterial(config.getString("Summoners.Ores.Material"))) {
            if(Utils.oreSummonerLocs.contains(blockLoc.toString())) {
                Utils.oreSummonerLocs.remove(blockLoc.toString());
                e.setDropItems(false);
                blockLoc.getWorld().dropItem(blockLoc, Utils.OreSummoner());
            } else {
                System.out.println("Not in array");
            }
        }
    }
#

actually it doesnt store it in a file, it stores it in a String list then when server restarts it saves the list to a file and loads it

#

Utils.oreSummonerLocs is a String list that contains the locations as a string

odd knoll
#

Try printing out the value of config.getStringetc.. and also what it then is when you do Material.getMaterial.

#

Also, you probably don't need to get it from the config file every time so as a general practice, it might be better to have it as a variable in the class.

steady osprey
#

i was thinking of having a class to store all config variables but i wasnt sure if it was even worth it

final verge
#

I mean having a utility class like that is one of the few cases of where public static and final could all be used together properly

steady osprey
#

true

odd knoll
#

The only class where I really "centre" a lot of stuff is my lang class lol.

final verge
#

I’m working on cleaning up my two year old code base

#

It’s nice learning things as you go

#

But it leaves you with hella tech debt

gaunt cliff
odd knoll
#

There's shortened versions if you take a look at the placeholder page.

#

I'll get it up quickly.

#

%vault_eco_balance_formatted%

gleaming helm
#

bigint REEEEE

odd knoll
#

Love big integers.

gaunt cliff
#

You are a legend thank you

#

What site did you get that from?

gaunt cliff
#

ty

gleaming helm
#

What retarded eco plugin isn’t using bigints

steady osprey
#

ctrl and arrows dont work for me anymore tf happened

odd knoll
#

Imagine not using a BigDouble 😮

gleaming helm
#

Just store cents

#

Don’t need a floating point number system

odd knoll
#

Smh.

final verge
#

We had a bug at competitive programming where the number was too big, so the internet overflowed and went negative. So I was like “I wonder if there’s like... a big int”

#

And there was

#

And so that’s how we solved that problem

subtle blade
#

the internet overflowed

#

oh no

final verge
#

😂😂 we laughed for like half an hour cuz man was that int a BIG BOI

subtle blade
#

poor internet

final verge
#

Integer 😭

gleaming helm
#

Or like be smarter about how you handle numbers so they don’t overflow

#

I’ve never seen a competitive programming problem where numbers were too big for a 64 bit integer

subtle blade
#

long

gleaming helm
#

I say 64 bit integer because it’s more generalized

#

😐

subtle blade
#

No :(( long

#

Curious. Does Java actually support long int?

#

Never really tried it lol

gleaming helm
#

No

#

I don’t think...

#

(Interviewers this is a dumb question don’t ask this lol)

subtle blade
#

It doesn't, no. lol

#

Yells at you for being stupid

#

*glares at C++*

final verge
#

Yeah it was a really weird question

#

No one other teams from my uni got it

#

Because they didn’t know how to handle the overflow

gleaming helm
#

So it was literally just a question to cause an overflow

#

That's stupid

#

Wait how did NOBODY else know how to deal with that

#

The best competitive programming problems are difficult even with small numbers

steady osprey
#
public void loadLocs() {
        dataConfig.getConfigurationSection("data.OreSummonerLocations").getKeys(false).forEach(key -> {
            String loc = key.toString();
            Utils.oreSummonerLocs.add(loc);
        });
    }

is returning null
specifically this line
dataConfig.getConfigurationSection("data.OreSummonerLocations").getKeys(false).forEach(key -> {
heres the config section in the file

data:
  OreSummonerLocations:
  - Location{world=CraftWorld{name=world},x=-107.0,y=92.0,z=573.0,pitch=0.0,yaw=0.0}
  - Location{world=CraftWorld{name=world},x=-107.0,y=92.0,z=575.0,pitch=0.0,yaw=0.0}
odd knoll
#

Those aren't keys.

#

dataConfig.getStringList("data.OreSummonerLocations")

#

Utils.oreSummonerLocs.addAll(dataConfig.getStringList("data.OreSummonerLocations"));

steady osprey
#

o

#

thanks

odd knoll
#

I need to sleep. It's 3 AM.

steady osprey
#

da,m

#

damn

odd knoll
#

Bad life decision #IDK

final verge
#

@gleaming helm yeah it’s fun. No one on the team knew about streams or anything my freshman year

#

The profs didn’t even know what they were

#

So that was fun teaching them

#

And teaching about functional interfaces 😦

gleaming helm
#

streams are quite... slow... in some situations

#

But they can be really really cool

#

just don't use them for iterating every block in a chunk (MOJANG!!!)

final verge
#

I always do scanner.nextLine() and split it and parse the info as I need it and will sometimes stream it to map it to an int list but I’m like the only person who does that on the team 😂

#

I had one bad experience using .next and .nextInt so I stick with what I’ve used for years 😂

#

(Can blame spigot plugins for that habit)

gleaming helm
#

streams are fine as long as you aren't creating a shitton of new streams and your streams don't have tons of elements

rapid yacht
#

Hey, I use a plugin called crackshot to manage guns on my server, and wanted to increase the radius of a bazooka blast (fireball) to damage minecarts, I found that regular tnt blocks can destroy a minecart like 6 blocks away, but the bazooka makes the minecart shake (not even destroy) 3 blocks away... So do you think it's a minecraft thing or plugin thing? I found nothing in the crackshot documentation about this

frigid ember
#

Is there a Skyblock server with the Auto Pickup plugin? I wanna find one so I don't lose any valuable blocks

steady osprey
#

i wanna make a random thing where based on percentages in config the item will be selected
heres the config

    Chances:
      Coal: 30
      Gold: 20
      Iron: 20
      Diamond: 15
      Emerald: 15

I want it so 1 will be selected

#

how would i do it

final verge
#

So you want it to be 30% chance of coal to be selected?

steady osprey
#

by default yeah

final verge
#

depends on how you wanna do it. I usually go the Crazy Crates way where I have a List of all valid options, and I loop through all options, do a random number check, so like get a number from 0-99 (random.nextInt(100) is less than equal to 30, then I add it to the list. Do this for all values. Then check if the List of valid options is empty, if so repeat. Finally once it's not empty, pick a random value out of that list

#

using String value = validList.get(random.nextInt(validList.size());

#

sorry if that's a bit confusing @steady osprey xD

steady osprey
#

i think i got it but not really

gleaming helm
#

Thing about that algorithm is it’s never guaranteed to complete.

#

The better way is to do an algorithm like this -

steady osprey
#

true

gleaming helm
#

First take your list and divide each item by the sum of all of them (normalization, they will now all sum to 1).

final verge
#

Yeah you run into that issue, normally I add a sanity check and then force pick the most likely prize after x amount of iterations

gleaming helm
#

Then pick a random double from 0 to 1.

#

For each item

final verge
#

I like it cuz it "double randoms" but it's not always the best

gleaming helm
#

Subtract the weight for that item from the random double

#

If at any point the number is negative, you have your answer

#

If you hit the end and the number is still not negative, it’s the last one

wanton delta
#

I use EnumeratedDistribution from math3 if youre lookin for an easy way but requires libraries

gleaming helm
#

Always completes after only a single random number generation

#

Yeah that does the exact logic I described @wanton delta

final verge
#

marriage

#

lmao

wanton delta
#

mhm

final verge
#

assume you're on mobile? xD

gleaming helm
#

Autocorrect lmao

wanton delta
#

Its personal preference

#

I use math3 for other things so it makes sense

steady osprey
#

i am so lost rn

wanton delta
#

May not be worth the trouble to use for one thing

gleaming helm
#

I usually prefer to not include deps, but if i already have a dep shaded or in my path I’ll use it

wanton delta
#

Thats a code sample darth

steady osprey
#

alright

gleaming helm
#

Don’t look at mine the solutions are all retarded and overly complicated

final verge
#

mood

steady osprey
#

how would i do step 3

calculate the sum of all the weights

pick a random number that is 0 or greater and is less than the sum of the weights

go through the items one at a time, subtracting their weight from your random number until you get the item where the random number is less than that item's weight

gleaming helm
#

For loop, add up all of the item weights.

#

Divide each of the individual weights by the sum.

#

This effectively normalizes everything so the sum of all of the weights is 1.

frigid ember
#

Hey guys, how many name changes do I get for a donation?

gleaming helm
#

Then pick a random double between 0 and 1

frigid ember
#

Can I change my name only once?

gleaming helm
#

And then do the whole subtraction thing

#

So

#

Start with your random number right

#

For each element, do the following:
Subtract the weight of that element from the random number (rand -= weight).
If rand < 0, return the current element.

#

At the END of that loop (the random number was bigger than all other weights) then just return the last element.

#

It’s important to note - pick a random number and save it as a double type. Then subtract using -= from that variable that you created with the single random number.

#

This is one of the most efficient and simplest ways to do it for small numbers of elements like you have

#

For large numbers of elements you will want a different approach.

#

(By large we’re talking >100)

steady osprey
#

how would i loop over each element

gleaming helm
#

Use a for each loop or use an indexed for loop

#

If you don’t know how to do either of those things you need to learn more about java.

quaint sinew
#

ok so i'm having a problem where my server randomly crashes for seemingly no reason, https://drive.google.com/file/d/1uPVLaWmCpVAAPbh_LXvx1DeTjeLCL0lv/view?usp=sharing here is a google drive link to the part of the log where it crashed, it would be nice to know what's causing it as it happens completely randomly sometimes, even when not a single person was online for hours. The specific log I included was when me and my friend were both online however we were both just sitting still in a house we were building. CPU: I5 2500
5G allocated
plugins:
CoreProtect
LuckPerms
Multiverse (core netherportals portals and signportals)
dynmap
essentials
worldedit

steady osprey
#

ik how to do them i just cant think today for some reason

quaint sinew
#

I know the 2500 isn't the most powerful cpu but it can run it at 20 tps with a bunch of ppl on

#

i've only had this problem in the last few days

gleaming helm
#

Paper fixes a lot of that stuff afaik

#

Worth a shot to switch to paper or Tuinity

#

And that’s not a problem with CPU availability

quaint sinew
#

when I used paper for some reason we had more tps problems somehow

gleaming helm
#

Try Tuinity. Some builds of paper are really terrible

quaint sinew
#

i switch to spigot from paper and saw an increase in performance for some reason

#

aight

#

u think it's a spigot problem or what?

gleaming helm
#

Tuinity is by far the best server fork for performance.

#

I’m not entire sure I’m not finished reading through the log

#

But it does look like it got stuck on something to do with achievements

final verge
#

Is this the newest spigot build?

quaint sinew
#

Spigot version: git-Spigot-800b93f-8160e29 (MC: 1.15.2) honestly not 100% sure but this is straight from the logs

gleaming helm
#

Maybe this is the weird tab complete crash exploit

#

I’m on mobile so this log looks like puke

quaint sinew
#

f

gleaming helm
#

Yeah this looks like a spigot bug

#

Odds are this is patched in paper

#

But definitely go with Tuinity if you have any choice whatsoever

quaint sinew
#

yeah, considering it was the same exact server just ported to spigot from paper and I never had this problem before i'd agree

final verge
#

let me boot up the spigot i built yesterday to check versiono

quaint sinew
#

i'll check out tuinity but I never would've switch from spigot to paper if tps didnt seem to drop using apper

#

paper

gleaming helm
#

Here’s a bug tracker on paper for it

quaint sinew
#

hmm

gleaming helm
#

Stack overflow due to a recursive call in getting achievement progress

final verge
#

might be a minecraft issue then

quaint sinew
#

damn

gleaming helm
#

Yeah. Likely is

final verge
#

so probably doesn't matter the fork

quaint sinew
#

anyway I can fix it? cause it gets in the way quite a bit

gleaming helm
#

Just do me a favor. Switch to Tuinity (your mspt will be cut in half anyways). If you still have problems then report it there

#

The dev there is extremely fast on this stuff

hearty frigate
#

Hello. I have read online that spigot has a built in anti x-ray feature, but I can't seem to find it. Was it removed, or am i looking in the wrong place?
@ me if you know. Thank you.

quaint sinew
#

i'll check it out,

#

thx

#

i'll stick with tuinity so long as performance is good lol

gleaming helm
#

10x better than spigot

#

All the large 1.15 servers use Tuinity or a custom fork of it

quaint sinew
#

sounds good, I might need more performance soon too considering I might have some new people joining the server soon

gleaming helm
#

(No offense to md_5 here, he does an insane job and all the forks are really based on spigot so)

quaint sinew
#

plus we're planning on building some massive stuff

final verge
#

sad some of the changes don't make it back downstream

hearty frigate
#

Have I asked a stupid question by accident? I don't want it to get buried under the chat, but I also don't want to spam.

final verge
#

I think it's something called Orefuscator? I'm not sure thou

hearty frigate
#

I see. From what I could tell that hasn't been updated in years (although I may have found the wrong plugin) and I can't find this integrated version of the x-ray that spigot apparently comes with.

gleaming helm
#

It’s in spigot.yml

#

Use mode 2

hearty frigate
#

Is it? I can't find it.

gleaming helm
#

Thought so let me check

hearty frigate
#

I've used ctrl+F to go through and search for the words x-ray, xray, mode, etc etc

#

and nothing flagged up

gleaming helm
#

Oh oh

#

Anti X-ray is paper

hearty frigate
#

I'm a bit of a brainlet at this sort of thing and basically winging it so far for this server I am running. Is paper another plugin, or something else?

gleaming helm
#

Paper is a higher performance fork of spigot

#

That also includes a number of other changes

quaint sinew
#

paper is good lol

final verge
#

*not always the most stable thou

gleaming helm
#

If you want to go a step further, Tuinity is an even higher performance fork of paper which has even more stability and performance

hearty frigate
#

Ah, right. Well I'm using a remote hosting site to run my server and I'm not sure I can change over from spigot to paper now it's already set up.

#

What is the next best thing for anti-xray I could do?

gleaming helm
#

Tuinity is more stable than paper because the dev for it actually reverts the buggy paper patches (that for some dumb reason go straight to master... what the fuck)

gleaming helm
#

The best thing for anti X-ray you can do is not using a plugin

final verge
#

xD

gleaming helm
#

And using paper’s built in anti X-ray

#

Go through your host’s support, if you can’t change it yourself they’ll be able to

hearty frigate
#

Right, but I can't use paper as my server is already running on spigot and I don't think I can change it. What is the next best thing?

#

Plus I have a massive amount of plugins already and I assume they require spigot.

gleaming helm
#

You can change it, it’s just a matter of swapping out the jar

#

Any plugin that runs on spigot will run on paper as well

#

Most will actually run better on paper due to async chunk loading abilities and such

hearty frigate
#

Alright. While I do more research into paper, is there something in the meantime that would cover my bases regarding x-ray?

gleaming helm
#

No. Don’t. For the love of god PLEASE don’t install an anti X-ray plugin.

#

The only good anti X-ray that exists is the one built into paper (and it’s derivative forks)

hearty frigate
#

How much is paper paying you? 😆

gleaming helm
#

Nothing

#

I’m telling you this for your own benefit

hearty frigate
#

I know. I was kidding.

gleaming helm
#

It sucks that I’m pointing people away from spigot but the patches aren’t making it downstream and I have no other choice

final verge
#

it's sad no patches ever make it back downstream

wet ferry
#

Hey, could anyone help me? I'm trying to add a plugin where the /nosleep command toggles you on and off of the nosleep list

                if (nosleep.contains(player)) {
                    nosleep.remove(player);
                    player.sendMessage(config.getString("RemovedFromNoSleep").replace("&", "§"));
                } else {
                    nosleep.add(player);
                    player.sendMessage(config.getString("AddedToNoSleep").replace("&", "§"));
                }

it seems to work just fine for the most part but for one player on my server, everytime they use the command, another instance of their player gets added to the nosleep list. What is happening? Would it be safer to just do nosleep.add(player.getName());?

final verge
#

you should a) use their UUID b) use a set

wet ferry
#

Ah yeah, thanks I hadnt thought of a set

gleaming helm
#

Do both of the things he said and you’ll be fine

final verge
#

a set is like a list, but it can only have one of the same thing in it at a time. So you can have 50 UUID's but my UUID can only be in there once

wet ferry
#

why doesn't the list work with the player though?

gleaming helm
#

A set is also unordered (and a hashset in particular can check things like contains in O(1) time)

final verge
#

as opposed to O(n) from a list

wet ferry
#

Yeah, thanks. I know about sets. Just havent used them in a while so I didnt think about it

final verge
#

and because player objects arent the same through play sessions I don't believe

#

I could be wrong

gleaming helm
#

I think they are but

final verge
#

but I always use UUID's to be safe

gleaming helm
#

It’s weird to store player objects around

final verge
#

no reason not to

wet ferry
#

I have a onquitevent method which removes them from the list when they log off

final verge
#

that would be why

gleaming helm
#

Use a UUID

final verge
#

because they never get added back

#

well

#

i might be confused

#

idk

#

it's midnight

#

xD

wet ferry
#

well the problem is for this one user,

                    nosleep.remove(player);``` isn't working, even when they log off
final verge
#

I'd just recommend using UUID and a Set and see if the issue still happens

wet ferry
#

ok i'll try that thanks

frigid ember
#

Hey guys, for a name change before I request a new name I just wanted to ask if Poseidon or Ares would be allowed?

buoyant path
#

Why does event priority not work?

#

I set mine to lowest and am cancelling it in higher priority events but it says that it is not cancelled when I use #isCancelled()

dark shuttle
#

lowest priority goes first, and then low, normal, high, highest, and then monitor

buoyant path
#

so Im doing it backwards? @dark shuttle ?

#

highest priority would be the last called?

dark shuttle
#

the last, no, monitor is the last, but at least its called after lowest priority

buoyant path
#

ok

soft ferry
#

helloo

#

Is someone able to help me installing BungeeCord with Multicraft? I had problems alone and was not able to fix it alone. Never installed BungeeCord or anything before...

#

Basically, I want someone to support me through the installation of BungeeCord and everything...

pastel condor
#

Spoon feeding 2.0

#

?ask

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

soft ferry
soft ferry
#

DM me if you think you can help me ;)

torn robin
#

I'm being told I shouldn't use system scoped dependencies, isn't this the only option if the library I want to use doesn't have an online repo?

sturdy oar
#

you can setup a local repository

#

in your computer

torn robin
#

sounds like a thing to google

#

thanks for letting me know

hollow crystal
#

Someone knows why @p @a doesn't work on my server?

storm sparrow
#

try running /minecraft:(whatever command) , some plugins don't support @p and @a

subtle blade
#

Most don’t. There is api for it but it’s newer and developers insist on supporting 9 versions

torn robin
#

@subtle blade api? where?

subtle blade
#

Bukkit#selectEntities(String). Returns a Collection<Entity>

#

Or a List, can’t remember

storm sparrow
#

That's my main gripe about essentials, it takes over too many commands like tp without adding useful features, and it removes @ selectors

torn robin
#

interesting

fleet crane
soft locust
#

Hey, If I want to run something every night at midnight (real time), should I use a BukkitRunnable that checks the time like every minute, or is there a better way ?

fleet crane
#

Sure, just make sure to keep track when it runs because it’ll never be exactly midnight

soft locust
#

Ok thanks

#

And it should be async right ?

fleet crane
#

Probably not

soft locust
#

ok 🙂

torn robin
#

probably shouldn't check the time every minute

#

you could calculate the ticks until midnight pretty easily

hoary parcel
#

anyone here every played with the loottable api? it seems to be kinda broken. I want to use a loottable that requires a block pos, I provide lootcontext that I created via the builder while only providing the location, but nms still throws the exception that it requires the pos

#

oh, looking at the code, it only passes the block pos if the context has an entity? that doesnt seem to make much sense

#

since bukkit requires you to provide a pos for a loot context, shouldn't craftbukkit always pass that location down to nms as block pos?

umbral shoal
#

uh im trying to connect to my bungee proxy but i cant: "Connection refused: no further information"
however i always could connect before without issues.

#

no errors are being logged

odd knoll
#

What does come up in the console when you try to log in?

umbral shoal
#

no errors are being logged
nothing is being logged actually

umbral shoal
#

anyone?

naive goblet
#

Are you using the right ip and port?

slim burrow
#

How can i make nametags invisible using protocollib?

umbral shoal
#

i was literally using the right info, i copy pasted my ip again anyway and it worked

#

that was 30 mins ago btw

tiny dagger
#

the only good way to do it is to put the player in a scoareboard team and hide him from the others @slim burrow

pure pasture
#

Can someone help me with Intelli

#

(I'm too stupid to export Stuff)

#

Pls

limber summit
#

Hello, some players have a graphic bug which appears randomly : when they drop an item, it is not dropped and it disappears from his inventory, he has to reconnect to see again the item in his inventory. Does anyone has already experienced this kind of issue? How to solve it

strange echo
#

the server lagging maybe?

#

really high ping also may cause it.

#

if a player reports it next time ask them what their ping is.

limber summit
#

no it's on a private server

#

look

#

when he reconnects items reppear

umbral shoal
#

plugins list?

hard crane
#

hey does anyone know if the persistent data container stays for an arrow or another projectile after it has been fired

languid pewter
manic jewel
#

@hard crane I don't think item nbt transfers to an arrow when firing, (at least it didn't when I last tried to use that in 1.10 so it may have changed) you might be able to use the event API to detect a bow firing then get the arrow entity from that and re-add the persistent data

hoary parcel
#

@languid pewter pretty sure yguard is allowed, yes

#

But like, just don't

#

It's stupid

languid pewter
#

yeah, but that's a intellij plugin

hoary parcel
#

Proguard is allowed too

#

Its just a wrapper

languid pewter
#

wdym?

#

You think it's better to use the app instead of the plugin?

hoary parcel
#

That plugin literally says "Seamless integration of yGuard in Intellij IDEA"

#

I bet it makes no difference

#

And I wouldn't use any of that

#

Since obfuscation is stupid

languid pewter
#

Yeah, but It's needed

#

I'm working on a VPNBlocker and I want to obfuscate the API access

#

so in that way, if you have a token you cannot like "crack them"

#

or something like that

hoary parcel
#

Well, you still can tho

#

If your API requires you to hide shit in code, it's just not secure

#

Security by obscurity is a dum concept

manic jewel
#

Obfuscation to make something secure, basically just means in order for someone to crack it they need to sit down for 2 hours and write down a list of API functions

#

Not to hard, boring but not to hard

languid pewter
#

yeah, the API is secure, its blocked by IPs, so if someone buy a token, it can be used only with his IP

#

anyway, thanks for the help

hoary parcel
#

2 hours? I bet I could find out the API in 10 minutes

tidal sierra
#

Hey, I have a question about how to setup the PrivateMessages plugin. The players on our server dont have permission to use whisper commands (for example /w /msg /tell). This happened after we installed the plugin to the server, so how do we fix it?

I cant find anything about how to set up the permissions on the website. Pls help

hoary parcel
#

The last plugin I properly reverse engineered (because it had a backdoor), it took me like 15 minutes to find a discord bot token. And that was heavily obfuscated with string and flow obfuscation

#

It's just pointless

still pulsar
#

Hello everyone 👋
Does anyone know what this is? There are 4 unknown worlds with names like UUID that were automatically generated. As far I know, it's the same map but in 4 different worlds. Latest 1.15.2 build.

limber summit
#

@umbral shoal

umbral shoal
#

o-

wraith dew
#

how do you make a custom entity?

umbral shoal
#

is it happening globally? (so not in a specific world)

limber summit
#

Yes globally

#

I think so

frigid ember
#

How do i delete my spigot account

manic jewel
#

I believe it is somewhere in the user options on spigotmc

#

never had to tho, so I'm not sure

undone narwhal
#

@still pulsar What's inside these folders?

still pulsar
#

File structure like in a simple world.

#

I still try to find reason of it, but I'm sure that isn't Spigot issue

undone narwhal
#

@wraith dew What do you mean by "custom entity" ?

#

@still pulsar Maybe from a plugin... Like a backup system or somthing like that I guess

still pulsar
#

Yes, maybe, I have easybackup, but it not include such feature.

undone narwhal
#

Yep

wind dock
#

hey guys

undone narwhal
#

Hey

frigid ember
#

@manic jewel

wind dock
#

u know how plugins have that prefix next to commands

#

like for example

#

/essentials:help

#

is there one of these prefixes for bungeecord?

frigid ember
#

@manic jewel could you find out where ive had a look and couldnt find it

wind dock
#

or no

manic jewel
#

I also gave it a look and don't see it, gonna need someone who knows more than me

undone narwhal
#

I don't think so GeometryPro

frigid ember
#

ah k thanks for trying through

wind dock
#

so its just /send or /server and no prefix?

frigid ember
#

is tagging forums staff allowed

undone narwhal
#

Depending for what

#

Yes Geo

frigid ember
#

a question

wind dock
#

oh oki

#

ya know you could ask the question he @frigid ember

frigid ember
#

?ask

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

frigid ember
#

okay,

#

How do i delete my spigot account

undone narwhal
frigid ember
#

is that the olny way

wind dock
#

why would u even want to delete it lol

frigid ember
#

i want to rename it

#

using the same email

limber summit
#

hey guys

#

how to fix the scoreboard error

#

Idk where it comes from

hearty frigate
#

@gleaming helm Hello again mate. So, funny story, I'm already running Paper. Could you give me the quick rundown on the anti x-ray stuff? I think I found the settings for it in paper.yml

pure pasture
#

Can someone tell me why when I have a RepeatingTask it doesn't change a value that it gets from a config when I edit this config?

naive goblet
#

Maybe the value is getting cached

undone narwhal
#

You have to reload the config file

#

YamlConfiguration cache fetched data

pure pasture
#

It's fine we're discussing it in #general

undone narwhal
#

Okay sorry

pure pasture
#

My bad

sturdy oar
#

So, i'm working with some spigot config files, however i get a "Unhandled IOException" when using method reference, but I'm running that inside a try with resource with an IOException catch

#

is someone able to help me figure out why is it saying that

#

I can provide code if required

quaint sinew
#

question, back when I was running paper on 1.14.4 I had a bug where someone would enter the end portal to go home and they would get stuck in a black dimension basically forever

#

and the only way to fix it would be to reset playerdata

#

I looked into and never found out what the cause was, do you think it's safe to re open the portal considering it's been months and im running on different software?

undone narwhal
#

@sturdy oar Code appreciated and errors too 🙂

sturdy oar
#

like I'm not getting it, all of that is inside a try and catch

undone narwhal
#

Hum strange

#

Maybe you have to put a try catch inside the forEach lmao

sturdy oar
#

but this is kinda weird

#

like the catch was already present outside

undone narwhal
#

What do you mean by getting stuck in a black dimension? @quaint sinew Any plugins editing the teleporting / worlds behaviors?

#

@sturdy oar In this case I would prefer a for loop

quaint sinew
#

at that point i dont believe we had plugins, and I guess I could've worded it a little different, it's like we were stuck on a black loading screen

#

but forever

#

luckily I had backups so it wasnt a problem but still

undone narwhal
#

Never saw that :/ Maybe you should update paper

sturdy oar
#

oh yeah, i totally forgot i was inside a consumer

#

i'll go for the for each

quaint sinew
#

I use tuinity now, I saw a post for it on the paper forums but it seemed to be a fairly unknown issue

undone narwhal
#

Okay

quaint sinew
#

I just dont know if it's safe to try it tbh, i'd like to re open it but i'm a little nervous of having my top tier gear erased

#

if I do i'll probably backup every players playerdata first

quaint sinew
#

can someone explain to me why I get 14 tps going from one house to another through the nether on tuinity with 2 ppl on, yet on spigot it never really drops much if it all

#

I dont really get it

undone narwhal
#

What's your server hardware?

quaint sinew
#

i5 2500 with 5 gb allocated, it's not great but i got it for free and it worked pretty well with spigot (forgetting the weird crash i occasionally have that i mentioned last night)

gleaming helm
#

Are you using plugins that are circumventing async chunk loading?

#

Paste a timings report

#

I’ll take a look at it in a few minutes

quaint sinew
#

i'm not really sure

#

how do i do that?

gleaming helm
#

/timings paste

quaint sinew
#

ok

#

you gotta give me a minute lol i closed the server right when you said that

gleaming helm
#

Oof. Trigger the tps drop again and then run timings

quaint sinew
#

im trying lol

#

we got it lol

#

the server just died

#

neither of us were moving lmao

ebon siren
#

yep

#

I legit walked up the stairs and opened a book

quaint sinew
gleaming helm
#

Worldedit is doing a dumb thing

#

Looks like it's sending metrics on the main thread (???)

quaint sinew
#

is that the problem?

gleaming helm
#

Well ok

#

Here's your other issue

#

Use EssentialsX

#

Essentials has a massive sync load problem

frigid ember
#

How do i delete my spigot account

gleaming helm
#

Essentials blocks the main thread while chunks are loading. If you have slow disk or CPU, then you'll end up blocking for a while because loads can take quite a bit of time.

#

(EssentialsX properly supports async loads so all of that heavy chunk loading logic doesn't block the main thread and drop your TPS)

#

You also have a large garbage collector problem

#

If you 1. use EssentialsX, and 2. Use the proper JVM flags, you'll have no TPS issues.

quaint sinew
#

aight, i'll try it out but it might not be until later tonight until i can tell you whether it works well or not as i have to work at 4

gleaming helm
#

Also the "crash" you experienced was due to the garbage collector stopping everything for 11.5 seconds to clean up.

quaint sinew
#

so basically

#

our low tps is due to essentials and garbage collector stuff

gleaming helm
#

Yes

#

Correct

quaint sinew
#

I wonder why it wasnt having that specific problem on spigot tho

gleaming helm
#

Don't use essentials (it's unmaintained anyways) use EssentialsX, and follow the guide that I linked to fix the garbage collection

quaint sinew
#

tbh, i swear I used essentialsx lmao but it doesnt seem like it

gleaming helm
#

I really don't know why this doesn't happen in spigot

#

But I mean

#

I know for a fact that Essentials is horribly optimized for Paper, EssentialsX doesn't have the sync load issue.

quaint sinew
#

alright, i'm downloading essentialsx now and im gonna try and get it running asap

gleaming helm
quaint sinew
#

before I gotta go get ready and stuff

#

acutally

#

hold on

#

it seems I was in fact using essentialsx

chrome lark
#

that CPU is defo not happy

gleaming helm
#

mm no

#

You were not

quaint sinew
#

my plugins folder begs to differ ig, it says essentialsx, i'll re install everything with the newest but still

chrome lark
#

that's an EssX version

#

They didn't change the original name

gleaming helm
#

How old is that version...

#

Feburary

#

They fixed the sync chunk loading problem after that date

quaint sinew
#

aight

#

i added it and im fixing the garbage collector stuff now

gleaming helm
#

I always remembered EssentialsX showing as EssentialsX in the plugin list and timings...

#

huh

#

Sorry about that!

quaint sinew
#

lol

wind dock
#

anyone know what plugin these commands are from? there are also apparently commands like /event count /event revive /event start

quaint sinew
#

it's fine, if it was fixed after that then it still was the problem anyways

wind dock
#

im trying to find out where its from

chrome lark
#

would suggest that the plugin was called events, unless they're hijacking

#

.g whatplugin

#

Do we not have a... bleh

wind dock
#

oh

#

hmmm

#

this is from another server not mine :/

quaint sinew
#

it seems fairly stable from me going at flyspeed 10 traveling from dimension to dimension, I believe alot of my problem with it rn is dynmap rendering, which is a good thing tbh

gleaming helm
#

So it's fixeD?

#

Try teleporting around to random locations

quaint sinew
#

when i entered new areas not in the dynmaps range

#

it lagged down to 17

#

im gonna get rid of it and test it when i can today

flat pelican
#

Current EssentialsX builds do async teleportation but it's effectively nulled by the fact teleport safety loads chunks sync

#

Full async chunk loading for teleport safety should be in within the next couple weeks

storm sparrow
steady cedar
#

ye might be down

gleaming helm
#

Take out the https

#

Use http, it works

frigid ember
#

no ssl

#

kid

#

i don trust dat

gleaming helm
#

are you an idiot

#

Well technically their sysadmin is an idiot

#

And clearly doesn't know how to properly set up SSL

frigid ember
#

lol

flint venture
frigid ember
#

yes

#

sir

flint venture
#

not the one for Essentials back in 2014

frigid ember
#

LOL

#

ok zoomer kevin

frigid ember
#

how can i fix a blank line upon join / leave???

#

i want to change it to some text, but i don't want blank lines AND text.

bleak meadow
#

Have any of you guys ever experienced an issue like this?

One of the players is getting this message https://prnt.sc/sritqv

They can join other servers on the bungee. And they can join the server on an alt with the same ip.

frigid ember
#

how can i fix a blank line upon join / leave???
i want to change it to some text, but i don't want blank lines AND text.

subtle blade
#

Fun fact: Discord has a chat history where you can see messages that have been sent. Copy/pasting the exact same message will not make anybody reply any quicker

#

Are you writing a plugin or are you a server owner?

frigid ember
#

I need some help. Recently we don't see any water animals spawn whatsoever, what could be culprit of that?

#

We run a very minimalistic server, so not spawning plugins or etc.

#

We use the default bukkit.yml as well.

ripe ledge
#

Someone knows how to add tags to a item?

naive goblet
#

nbt tags?

knotty surge
#

does LivingEntity#getEyeLocation return a copy? javadocs don't specify

safe coyote
vocal breach
#

I'm having a weird issue in spigot, I setup my plugin to use mcspring-boot by Alan Gomez and replaced the spring-boot-starter-logging (which uses logback) with spring-boot-starter-log4j2, since spigot uses log4j2 (at least, spigot.jar contains a log4j2.xml file, so I assume that is the case). One reason that I had to do this, is because PaperMC only supports log4j2 (see: https://github.com/PaperMC/Paper/issues/3532).

It works fine in PaperMC now and in spigot it works fine in the logfile and logger gui, but in console every log line is printed twice. Anyone got any idea why this happens?

Using the latest 1.15.2 spigot server.

wraith dew
#

how do you create custom entities

#

?

hoary parcel
#

whats your code @vocal breach?

#

I use spring on paper without any issues

vocal breach
#

It works fine on Paper. the issue is only with spigot

hoary parcel
#

I didnt do any custom shit to logging iirc

#

lemme check

vocal breach
#

I also didnt do any custom logging apart from removing the logback logger. (Not removing it causes issues in Paper with there being 2 loggingfactories for Slf4J)

subtle blade
#

does LivingEntity#getEyeLocation return a copy? javadocs don't specify
Any Location, if pulled from the server, is a "copy" so to speak

hoary parcel
#

I dont even include spring-boot-starter-logging

vocal breach
#

I dont anymore either. I also tried without spring-boot-starter-log4j2 and just used slf4j loggers, but that gives the same issue.

hoary parcel
#

this is my pom

vocal breach
#

And I have tried without the log4j2 starter

#

The logging is normal, until the spring context is loaded. All logs after that are printed twice in console. Even logs that have nothing to do with my plugin.

#

You got any idea, @hoary parcel ?

wraith dew
#

anyone know how to make custom entities?#

knotty surge
#

ah alright thanks choco

#

all these mutable locations and vectors are hard to keep track of

wise gate
#

how do i actually add the plugins into my server

knotty surge
#

put the jars in the plugins folder

wise gate
#

there is no plugins folder

wraith dew
#

run the jar

sturdy oar
#

,.,

#

yeah the plugins folder only gets generated after the first time you've ran the server

#

if that's the case

wise gate
#

anyone know how to make a server for free where i can put plugins

upper hearth
#

You're not gonna get anything worth while for free unless you localhost and portforward. But then it's not 24/7

#

And you have to give people your IP for them to connect

worthy lava
#

Heya boys, i got a question about ASync tasks. But in what instances do i use these? I have read that for example, these tasks should be used for Database gathering since it can freeze the server because it's on the main thread and can take a while. So, does this basically mean, you use a ASync task when you need to have a java loop every 15 minutes that doesn't use bukkit methods? (Single thread methods)

viscid grove
#

How i can create a server with SPIGOT and add mods?

worthy lava
#

@viscid grove spigot is an API that let's you add PLUGINS, not MODS. If you want to add mods to a minecraft server, i recommend you search 'minecraft forge' on google.

viscid grove
#

@worthy lava I want to create a server, and add mods to the server

worthy lava
#

Yes, but this channel is for plugins, not mods.

subtle blade
#

Spigot and Forge mods are not compatible

#

There have been attempts to merge the two projects in the past but they never succeed

#

Nor should they, really. The Bukkit API was designed strictly with vanilla in mind

worthy lava
#

Wut, seriously? Fat ooof

#

Btw Choco, do you have an answer to my question about ASync BukkitRunnable tasks?

subtle blade
#

Cauldron, for instance. Only made it up to 1.6.4 iirc. There is also another one being worked on at the moment but I have no idea where it's at and I forget its name

#

Asynchronous tasks should be used for processes that would otherwise halt the main thread (generally, IO - file reading, database operations, http, etc.)

#

Or strenuous tasks. But yeah, avoid the Bukkit API in asynchronous tasks. Some will work - such as sending messages and particles which are just queued packets - though more often than not they will not work

gleaming helm
#

I think you're talking about sponge

worthy lava
#

Yes, but i need to implement a loop method to remove boosters from a list. Would this be applicable for a ASync tasks? My BoosterManager and Booster class use no methods from Bukkit. Only pure Java

#

That could be it Kevin

subtle blade
#

No, not Sponge. Sponge doesn't use the Bukkit API. Unrelated

worthy lava
#

Gotcha

gleaming helm
#

Oh ok

subtle blade
#

Wiebe, at that point it comes down to an understanding of concurrency, thread safety and data races

gleaming helm
#

I'm really not familiar with the project so I really don't know

subtle blade
#

If your booster manager class is designed to be thread safe, you're probably fine

#

Though if you wrote it without any knowledge of such a concept, it's safe to say that it's not ;P

gleaming helm
#

^

subtle blade
#

You may run into occasional issues but 9 times out of 10 it should work

worthy lava
#

Il google real quick, no more explanation needed because im clearly uneducated at ASync, thread safetly as such. So im gonna do some investagation first before i actually delve into it.

gleaming helm
#

If you don't understand concurrency, locking/deadlock, and race conditions, your code is probably not thread safe.

subtle blade
#

It's just that 10th time that you can't be certain

#

Thread safety is very difficult to wrap your head around

#

I still struggle

worthy lava
#

As what issues? An excption or something?

subtle blade
#

Logical issues moreso than runtime

gleaming helm
#

I still guarantee I have some race condition somewhere in my code just waiting to become an issue, and I've been doing this for many years

subtle blade
#

i.e. a collection may contain different things at any given time if two threads access the same collection at the same time

worthy lava
#

That would be unlikely in my case, but i do get your point.

lusty vortex
#

99.99999% of the time, people end up using Async threads for stupidly simple tasks anyways.

worthy lava
#

As you said, 9 out of 10 cases it would work, but sometimes

subtle blade
#

99.99999% of the time, people end up using Async threads for stupidly simple tasks anyways.
This. Unless you have a specific reason (again I mention IO here), you likely don't need one

gleaming helm
#

Take this example:
Two threads share a single variable, a. At the beginning we set A to 0.
Thread 1 wants to increment the value of A by 10. Thread 2 wants to increment the value by 20.

  1. Thread 1 reads the value of A. The value is 0.
  2. Thread 1 computes the new value of A to be 10.
  3. Thread 2 reads the value of A. The value is still 0 because Thread 1 has not yet updated A.
  4. Thread 1 updates the value of A. A is now 10.
  5. Thread 2 computes the new value of A to be 20 (0 + 20 is 20)
  6. Thread 2 sets the value of A to 20.
#

What see here is two threads each incrementing a number by a sum of 30

#

But at the end, the value is not 30.

lusty vortex
#

AtomicInteger. Wtf? Solve

#

Another example!

gleaming helm
#

Atomic integer don't work when you have two processes acting on a database

#

You either need to do direct database actions (which, themselves, are thread safe) or use some other locking tricks

lusty vortex
#

Depends on the database

gleaming helm
#

Correct

#

That's why I included "some other locking tricks"

subtle blade
#

Basically, multi threading is a headache

#

lol

gleaming helm
#

It can be if you're inexperienced

#

Things can easily go wrong.

worthy lava
#

Ok, so kevin, take this scenario in mind:
My BoosterManager starts an ASync task. This ASync task checks if the System.currentTimeInMilis(); is past a certain point. If it is, then remove it from the boosterList. The ASync method is the only method that removes boosters. What issues could arrise here?

lusty vortex
#

Eh, there's just better concepts with Async operations. Everyone tries to apply them to basic ideas

#

Like using a consumer for example, with a queue to insert into a database

#

Basic shit, but can be async

gleaming helm
#

If you have other threads that updating that booster information, you could have some race condition problems.

lusty vortex
#

Copying stuff before reading it on another thread, Once again, basic, but async

gleaming helm
#

If all of your other threads only read that data you're probably okay

#

BUT

worthy lava
#

Booster information cannot be updated, it's static (In the sense of it never changes, they are not literally static).

#

Booster information is only retrieved, not changed

gleaming helm
#

If your threads are iterating that data, and then another thread changes it. Then you get a CME and that's no fun at all to debug

#

If you're concerned, look into object locks

#

And how to PROPERLY use them while AVOIDING deadlock.

#

Long story short never hold 2 locks (unless you absolutely know what the fuck you're doing)

worthy lava
#

Alright kevin, thanks for answering my questions! Same goes to you choco!

gleaming helm
#

np bud

#

A note on deadlock - If each thread only ever can hold one lock at a time, you will never deadlock.

#

If a thread can hold more than one lock at a time, then you could run into a deadlock scenario, whereby two threads each are trying to acquire a lock that the other thread holds.

tidal sierra
#

Can someone help me? The players on our server don't have acces to the whisper command anymore and the permisions command doesn't work either.

bronze marten
#

You can prevent deadlock by 2phase lock protocol

#

Never lock again after u start first unlock

viscid grove
#

Spigot is sooooooooooo [NOT FREE]

subtle blade
#

Most definitely is. Free and open sourced