#help-development

1 messages · Page 255 of 1

languid flare
#

I have this:

#

e.getPlayer().getInventory().setItemInHand(new ItemStack(Material.COMPASS,1));

#

How can I set Item in especific slot?

jade perch
#

you can use e.getPlayer().getInventory().setItem

#

there is a picture of the item slot numbers

languid flare
#

Thank you man

#

That's great!

quiet ice
#

Mainhand vs offhand or what?

echo basalt
#

inventory slot you dingus

rare rover
#

So how would i make an armor stand face towards a location?

#

Because i suck at math

#

And couldn't find it on google

quiet ice
jade perch
# rare rover So how would i make an armor stand face towards a location?
private Vector getDirection(Location from, Location to) {
    double dx = to.getX() - from.getX();
    double dz = to.getZ() - from.getZ();
    double yaw = Math.atan2(dz, dx);

    double dy = to.getY() - from.getY();
    double pitch = Math.atan2(dy, Math.sqrt(dx * dx + dz * dz));

    return new Vector(yaw, pitch, 0);
}
wary harness
#

best way to compare if item is same with same meta data

#

to sell it in shop

#

any suggestions

#

?

wet breach
#

probably could just do ItemStack.equals(ItemStack)

undone axleBOT
jade perch
#

Might want to use isSimilar instead

#

if you are fine with the stack sizes being different

quaint mantle
#

is it normal for my plugin to use 13M bytes

#

or should I NOT shade my plugin

hazy parrot
#

depends on what is your library

quaint mantle
#

im using JDA

hazy parrot
#

iirc you shaded jda, so its pretty normal

quaint mantle
#

ah ok

jade perch
#

isn't max size on spigot like 4 megabytes

#

Gonna have to host the plugin on github or something if you plan on having it on spigot

quaint mantle
#

i mean

#

its working on my server fine

#

im using shockbyte so maybe thats why idk

jade perch
#

If you're not redistributing the plugin it doesn't really matter it'll run fine

#

you just can't upload it to spigot

quaint mantle
#

ok so then how do i specify what NOT to shade

quaint mantle
jade perch
#

Then you're fine

quaint mantle
#

i was wondering if it will run on my server fine

#

ok

neat jetty
#

()

graceful harbor
#

hay spricht jemand deutsch

#

no speak englisch

ivory sleet
#

google translate maybe?

shadow gazelle
#

Alright I must not be seeing a method somewhere or something, why doesn't ConfigurationSection#getMap exist?

shadow gazelle
ivory sleet
shadow gazelle
#

what

ivory sleet
#

well you have getValues

#

which basically returns a map

shadow gazelle
#

Oh

#

OH

ivory sleet
#

yea

#

:>

shadow gazelle
#

moment

graceful harbor
#

kann jemand programmieren

shadow gazelle
#

bruh

graceful harbor
#

weil ich brauchte developer die mir helfen mein netzwerk wieder auf zu richten was gelöscht würde

shadow gazelle
#

Use a translator

onyx fjord
#

4 years of learning German doesn't help

shadow gazelle
#

College German class?

onyx fjord
#

We have a different system

#

But something similar yes

onyx fjord
shadow gazelle
#

The only language my school has is Spanish and the teachers aren't very good, I'm glad I got my two years done and never have to do it again

undone axleBOT
shadow gazelle
#

Discord API moment

onyx fjord
#

No problem

quaint mantle
#

Is there any way I can use components inside ItemMeta without needing to touch Paper API?

#

I would like to stick with Spigot 🙂

worldly ingot
#

You would have to shade the Adventure Platform for Spigot into your plugin

sterile token
#

Could someone give me a small hand with my tab completer code because everything is working as it should, but when i have the command or argument permission it should tab complete me the completations from the argument, which are not tab complete. I have tried debugging but i still havent success understanding what its happening https://paste.md-5.net/idonixedol.coffeescript

gleaming grove
sterile token
#

I will try that

gleaming grove
#

And IMO this is better way of forrmating lamda code ``` public List<String> tabComplete(CommandSender sender, String alias, String[] args) {
if (args.length == 0 && hasPermission(sender, permission))
{
return arguments.stream().map(BukkitArgument::getName).collect(Collectors.toList());
}

    BukkitArgument argument = getArgument(args[0]);
    if (argument == null)
    {
        return arguments
                .stream()
                .filter((arg) -> hasPermission(sender, this.permission) ||
                                 hasPermission(sender, arg.getPermission()))
                .map(BukkitArgument::getName)
                .collect(Collectors.toList());
    }

    if (hasPermission(sender, permission) ||
        hasPermission(sender, argument.getPermission())) {

        return argument.tabComplete(sender, alias, Arrays.copyOfRange(args, 1, args.length));
    }
    return super.tabComplete(sender, alias, args);
}```
sterile token
#

ook

#

So Jacek, i have tried mocking it but i couldnt

#

So i will give a 2nd round to primary debug

gleaming grove
obtuse flame
#

Hay alguna manera de recuperar mi cuenta? Perdí el generador de códigos del 2FA.. Tengo todo excepto eso..

river oracle
#

?support

undone axleBOT
obtuse flame
#

Thanks!

shut field
#

I am doing a mvn clean package to generate the plugin

#

but plugin.yml isn't getting outputed? smth about invalid plugin.yml

#

what does the correct project structure look like?

atomic swift
#

anyone know what this means

dusk flicker
#

The plugin.yml should be in the resources folder

shut field
dusk flicker
#

Can you upload your pom.xml to a paste please?

#

?paste

undone axleBOT
shut field
dusk flicker
atomic swift
shut field
#

so my recourses folder is not in the main directory

dusk flicker
atomic swift
#

its not starting with it tho

dusk flicker
shut field
shut field
#

I just had my recourse folder in the wrong spot

dusk flicker
#

ah got it

wet breach
#

the creator snakeyaml while you could say it is them, really they are only implementing the spec, and the spec says that tokens can't start with a special character

clear granite
#

So i was trying to do a check on if the last instance of damage was a player but it wasn't working so i got rid of the check to see what was wrong and its saying that the last instance of damage came from an entity "CraftZombie" even though a player killed it?
all i did was
Player player = (Player) event.getEntity().getLastDamageCause().getEntity();

#

does getLastDamageCause not work the way i think it does?

warm mica
#

Where are you checking that

clear granite
#

in the console log after i killed a zombie in a test server

wet breach
#

first you need to check if the entity is a player before casting, and second you just said you were killing a zombie

#

so it makes sense that the last damage came from a zombie o.O

clear granite
#

nononono that wasnt the check

#

sorry im explaining this badly hold on

#
    public void onMobDeath(EntityDeathEvent event) {
        if (event.getEntity().getLastDamageCause() == null || !(event.getEntity().getLastDamageCause().getEntity() instanceof Player)) {
            System.out.println(event.getEntity().getLastDamageCause().getEntity().getType());

            return;
        }

        if (event.getEntity().getType().equals(EntityType.ZOMBIE)) {
            final Player player = (Player) event.getEntity().getLastDamageCause().getEntity();
            System.out.println("It was a zombie");
        }
    }```
#

so what im saying is the event.getentity.getLastDamageCause() is returning a zombie when a player kills the zombie,

#

i thought the getlastdamage.getentity returns the person or entity that killsed the entity in entity death event

warm mica
#

Yes

#

That's supposed to happen

#

That method returns EntityDamageEvent

#

getEntity() is always the entity that got damaged

#

To validate whether another entity caused the damage, use instanceof to validate whether getLastDamageCause() is a EntityDamageByEntityEvent

#

and within that casted object you may retrieve getDamager()

#

Alternatively you may also simply use event.getEntity().getKiller()

#

Keep in mind that if you want to continue to use getLastDamageCause(), that there are things like Arrows and other Projectiles

#

You'd also have to validate whther the damager is a Projectile and if the shooter of the Projectile is a player

clear granite
# warm mica To validate whether another entity caused the damage, use instanceof to validate...

wait so if i do event.getEntity().getLastDamageCause().getEntity().getType() it should return zombie if a player kills it
(i accidently sent event.getEntity().getType)
but either way it both returns zombie which is why im confused
getKiller() works tho thanks alot its just i thought the entity in get last damaged cause was the damager itself not the one who got damaged thanks tho appreciate it

warm mica
#

I am not exactly sure what you mean, but I am sure that the interface is just wrapping and invoking NMS methods and not by itself actually implementing those enchantments

warm mica
#

You may read into that docs

#

The entity could also have been damaged because of falling or whatever

clear granite
#

OHHHHHH thats why ok yea that makes alot of sense

quaint mantle
#

I have a system setup to send a command from our shop thats: "commandname storecode username pricepaid" but im having an issue as its not registering the pricepaid part.

Player player = Bukkit.getPlayer(args[1]);
player.sendMessage("You paid: "+args[2]);
Long ltl = Long.valueOf(args[2]); <--- this is where I am getting my issue
int ecosend = ltl.intValue()*100;
player.sendMessage("Recieving: "+ecosend+" coins");
return false;

Caused by: java.lang.NumberFormatException: For input string: "0.01"
Can anyone point me in where I can understand how to fix this issue?

chrome beacon
#

0.01 isn't a long

quaint mantle
#

I have also tried int

chrome beacon
#

That's a floating point number

#

So it's either a double or float

quaint mantle
#

I appreciate the info, will adjust my code

muted crest
#

@river oracle i never used Maven/Gradle so how i can solve my problem ?

river oracle
#

learn maven/gradle

#

its a standard and its useful as fuck

#

using the standard java build system is 💀

muted crest
#

Thanks for no help

river oracle
# muted crest Thanks for no help
sterile token
# muted crest Thanks for no help

Yeah bro, sorry for the word but its stupid trying to do fix something that you havent learnt it. Its the same as me trying to fix a ciber security issue without learning the basics things from ciber security, doesnt make sense

#

So if you want to fix and issue, atleast learn how maven or gradle works, depeding which building enviroment you want to use

wet breach
#

second, after it is determined it is a valid number, what kind of number

#

if you are accepting numbers that can have decimals, just automatically assume it is a double then

summer scroll
#

How can I achieve a command like this?

/cmd player c: eco give player 1000 m: &aCongrats, you got 1k

ionic dagger
#

this doesnt work

#

you cannot LivingEntity shooter = (LivingEntity) arrow.getShooter() because getShooter returns the Source@2db596f0 from that message

jade perch
#

I literally said another method if you scroll down a bit

ionic dagger
#

oh!

#

oops!

#

lemme see 😄

#

thats so awk

#

im sorry! thanks then 😄

#

sorry, could you explain this? what am i checking specifically?

#

i see that theres a BlockProjectileSource in the docs, but im unsure of how to get that value

#

i dont know what id check to see if its a dispenser

#

the only things im seeing would check if something is an entity, but a block isnt an entity

sullen marlin
#

Just cast to BlockProjectileSource

#

I think such a source is always a dispensed though? What other blocks fire projectiles

muted crest
ionic dagger
#

well im trying to check what an arrow was shot by

#

either an entity or a block

ionic dagger
sullen marlin
#

instanceof Entity?

#

?jd

ionic dagger
#

if (!(arrow.getShooter() instanceof Entity))

#

cause then itd have to be a block

#

i see i see

ionic dagger
sullen marlin
#

Shooter ?

ionic dagger
#

i see

#

alright

#

thanks!

river oracle
#

Its on github

#

And it uses maven and Alex is amazing

#

@tender shard ^ youre amazing

muted crest
river oracle
#

Just look up spigot maven

#

?google

undone axleBOT
muted crest
#

For people who having the same problem you only need to download bungeecord through this link: https://ci.md-5.net/job/BungeeCord/ and add it to your java build path

you dont need maven or gradle

#

thnx Y2K to make me loose my time

ionic dagger
#

should i use .getDamage() or .getFinalDamage() when checking to see if enough damage was dealt to kill a player

#

since ik getfinaldamage returns the damage value after damage reduction, but does it really matter?

river oracle
quaint mantle
#

How would i create a custom tab in my server for players to see?

#

None of the tutorials online work; they are outdated.

worn perch
#

Creating a invsee command

worn perch
fading spindle
#
                        getServer().broadcastMessage("if detected 3 ");
                        Player nearplayer = (Player) player.getNearbyEntities(6, 6, 6);``` 

i debugged it and it doesn't get into the if statement anyone know why?
sullen marlin
#

Because that method returns a list

fading spindle
#

oh a list of players?

ionic dagger
#

So would u j have to go thru the list and output the amount of player entities found in that list?

fading spindle
#

that's what im thinking

fading spindle
#

oh ok thanks

ionic dagger
#

Could check .equals() or instanceof each value in the list and j output that amount

fading spindle
#

oh yeah that makes sense thanks

desert loom
fading spindle
sullen marlin
#

What do you want to do

fading spindle
#

check if the nearby entities are players

sullen marlin
#

Pass in a predicate that checks instanceof player and then check .isEmpty on the returned list

fading spindle
#

ohh ok

#

that makes sense

#

thanks

summer scroll
#

How can I achieve a command like this? Like actually get the c and m string. I know I need to use regex but I'm not familiar with regex.

/cmd player c: eco give player 1000 m: &aCongrats, you got 1k

gleaming grove
#

How to properly stop Async Task? At now I'm calling task.cancel() when OnPluginDisable event is triggered but task is still running, what can I do to kill task???

wet breach
#

generally the server automatically kills tasks

gleaming grove
#

does Server wait unitl task execute its body? for example when task contains infinite loop, will server kill it?

wet breach
#

yes server will kill it

azure gate
#

i sant to create pagination menu

#

any idea how to do it

wet breach
#

when the server is stopping, it will give a small bit of time to allow plugins to save but it will force stuff to stop

icy beacon
icy beacon
#

yeah

wary kettle
#

Is there a way to stop chunk ticking of a specified chunk

hybrid spoke
#

cancel everything that happens in there probably

wary kettle
#

cancelling wont stop the chunk from ticking though

chrome beacon
#

Why do you need to do that?

hybrid spoke
wary kettle
#

I basically need to stop cactus from ticking in specific chunks

hybrid spoke
#

or unload it

remote swallow
hybrid spoke
wary kettle
remote swallow
#

check if its cactus, if it is, stop it

wary kettle
#

I dont need to stop the stuff from growing I need to stop it from ticking

#

for lag reasons

#

basically /gamerule randomTickSpeed 0 but only in the chunk

chrome beacon
#

Cactus doesn't cause much lag since it's handled by the random tick

wary kettle
#

it does if you have a huge player base spamming millions of cactus

hybrid spoke
#

*cancel*

chrome beacon
#

The items can but not the cactus block itself

hybrid spoke
#

canceling the event wont stop the tick, but the action which most likely causes the lag

wary kettle
#

I've ran timings with cancelling the items

#

the ticking is what causes the lag

#

well the items lag more but even with them being not spawned

#

the ticking is still contributing alot

chrome beacon
#

Could you send that timings report? I'd like to see it

wary kettle
#

okay

#

this is just on my test server

#

vanilla cactus

#

not vanilla cactus

#

with 162,000 cactus

#

so relatively small in comparison to real cactus farms on a live server

chrome beacon
#

Could you use spark so we get a more detailed report

wary kettle
#

whats spark

remote swallow
#

?flags use these too, might help somewhat

undone axleBOT
wary kettle
#

okay give me like 10 minutes to retest both vanilla and not vanilla

#

should i just use the spark command instead of timings

remote swallow
#

yes

#

that is just what olivo said

hollow pelican
#

I'm trying to intercept the Tab Complete/Command Suggestions packet for vanilla commands to remove my username but it just keeps kicking me with this error: io.netty.channel.StacklessClosedChannelException (I have no idea what this means and I'm trying to avoid using ProtocolLib)

chrome beacon
#

Show your code

#

?paste

undone axleBOT
hollow pelican
#

This is the code inside of my intercept function.

chrome beacon
#

And how are you intercepting the packet

hollow pelican
#

By checking if the packet is an instance of ClientboundCommandSuggestionsPacket in my listener.

chrome beacon
#

Show your listener

hollow pelican
#

The file is 130+ lines long.

chrome beacon
#

I have a feeling you're causing an infinite loop or smth

hollow pelican
#

Probably.

remote swallow
#

?paste just past the whole class then

undone axleBOT
hollow pelican
#

All searches I've done on the error just show that I might be sending the packet at the wrong time.

#

The listener method is the same one that I'm using to modify chat log for clearing announcements etc.

#

That works fine, it's only this that breaks.

hybrid spoke
#

cool

#

?paste it anyways

undone axleBOT
chrome beacon
hollow pelican
#

How do I avoid that?

chrome beacon
#

By locating why it got closed

#

Start by sending the listener

#

?paste

undone axleBOT
hybrid spoke
#

all good things are 3 huh LUL

wary kettle
#

first is vanilla

misty ingot
#

hey is there a way that say a player has vaults.5 vaults.10 and vaults.20 permission nodes, then I get the maximum one (vaults.20) and then put 20 as the value of a variable?
all I can think of is to just put if conditions for every number but even that would just catch the lowest one

remote swallow
#

didnt someon tell you what to do

crimson terrace
#

and then you could split it at . and check for Math.max

topaz cape
#

hello, im having mental breakdowns during the use of md5's specialsource-maven plugin

it's configured so far correctly and it should work on compiling.. it just doesn't do anything

remote swallow
#

?paste your pom

undone axleBOT
topaz cape
remote swallow
#

how are you building

topaz cape
#

mvn clean install

remote swallow
#

try mvn clean package

topaz cape
#

aight let's see

#

nope

#

still not

remote swallow
#

what part doesnt work

topaz cape
#

it doesn't do anything it compiles with the mapped code

#

aka mojang's code

remote swallow
#

ah, idk what else could cause it i dont use maven

topaz cape
#

😦

eternal oxide
#

Sounds like you are just using the wrong jar

topaz cape
#

why

eternal oxide
#

the pom you linked is fine

topaz cape
#

then I don't use the wrong jar

#

because the pom also includes the dependency which works fine

eternal oxide
#

whats the full name of the final jar you are using?

topaz cape
#

there's no other jars than the main one and the source one

#

also this is a multimodule project so it should also compile in that jar

#

idk if that's the case though

#

in here md5 mentioned the version 1.2.2 which i use

#

however

#

ymm

#

why is 1.2.2 even on my pc..

eternal oxide
#

?paste

undone axleBOT
topaz cape
eternal oxide
#

works fine

misty ingot
topaz cape
#

well it doesn't work for me 😦

#

what command do you use to build your project

eternal oxide
#

clean package

topaz cape
#

ugh that's what I just used

#

then what's wrong smh

eternal oxide
#

why are you building 1.18.2 with java 8?

topaz cape
#

because the project is supposed to work for lower versions as well

eternal oxide
#

it doesn;t work like that

echo basalt
#

uh...

#

yeah no

topaz cape
eternal oxide
#

you build EACH module for it's relevant java version

topaz cape
#

well when i do that spigot doesn't load it unless it's java 17

eternal oxide
#

the main plugin you build for 1.8

#

relevant modules you build for the correct java version they require

#

your internal API controls what classes are loaded depending on your server version

topaz cape
#

honestly imma try that cuz fuck it

topaz cape
#

all of those will be loaded

eternal oxide
#

No, your API shoudl manage what classes are loaded via it's imports/class loading

#

you can't load ALL classes or your plugin will explode with a java version error

hybrid spoke
#

i mean, if they only require java 8 stuff then its totally fine

topaz cape
#

i use jdk17 and it compiles to java8+ bytecode

#

it should be fine

#

even java 17 didn't change anything

#

just tried

#

still didn't work

echo basalt
#

you can stop being a clown and just force everyone to update :)

#

It's a bit more than a version change

topaz cape
#

"you can stop making this cookie and force everyone to drink your tea"

echo basalt
#

p much

#

or just... use obfuscated NMS

#

It's not even that difficult

topaz cape
#

that's my last plans for now because I don't want to move to the obfuscated version that fast

echo basalt
#

Just saying like

#

if you do a multi-java-version project

#

with multi-module and all

#

You're going to be doing a lot of dirty work

#

Some libraries don't like java 8

#

so you're either forced to use outdated versions, or to duplicate your code to handle both

#

Example: HikariCP

topaz cape
#

well it seems to not like java 17 as well

topaz cape
remote swallow
#

im getting java.lang.NullPointerException: Cannot read the array length because "elements" is null at java.util.List.of(List.java:1037) ~[?:?] at me.epic.epicpresenthunt.PresentClickListener.onInteract(PresentClickListener.java:32) ~[EpicPresentHunt.jar:?]l on https://paste.md-5.net/ozojipeban.cs and line 32 is List<Location> locations = List.of(pdc.get(plugin.getStorageKey(), DataType.LOCATION_ARRAY));, anyone know why

echo basalt
#

bruh moment

#

thought this was gonna be great

#

your pdc thing returns null

remote swallow
#

to alex's server to complain i go

topaz cape
#

also still java 17 doesn't fix it

chrome beacon
#

It's not like every cactus or crop is ticket every single tick like tile entities are

wary kettle
#

I mean this is an extremely small sample on a single player server

chrome beacon
#

Again it's not a problem

#

Things like mobs are 100 times more performance intensive

#

You should focus on those

wary kettle
#

have you seen the magnitudes of cactus farms on big servers

#

im talking like 10s of millions of cactus blocks

#

this is a sample of 100k

chrome beacon
#

You can load in how much cactus you want. Other things will be more intensive

#

Cactus performance is negliable

#

You will be bottlenecked by other things before it becomes a problem

wary kettle
#

there are already lag measures for mobs and other things

#

cactus is the only thing left hence my problem

chrome beacon
#

Cactus isn't a problem though

wary kettle
#

Obviously in my small sample it doesnt look like its a problem

#

it was just because you wanted to see it

#

I just needed to know if its possible to cancel chunk ticking of specific chunks, wether i do it or not and if its a bad idea or not is besides my question

hybrid spoke
#

reduce the chunk ticking size in your spigot.yml then

chrome beacon
#

If you want to disable the chunk ticking other things will break

wary kettle
#

thats why i said specified chunk

#

I don't think its possible anyways so ill just try to find another solution

topaz cape
#

@eternal oxide i figured out the problem

chrome beacon
#

You can make your own patch then

topaz cape
#

i was too blind to see it

eternal oxide
#

it was?

topaz cape
#

i put the plugin inside <pluginManagment>

wary kettle
#

Originally if it was possible I was going to cancel the cactus from ticking and count the cactus in the chunk and manually calculate how much cactus you should get per hour

#

but ill try something else

chrome beacon
topaz cape
#

I really am blind

eternal oxide
#

I did notice that and wondered. Didn;t know it made a difference as I had seen profiles in that block

wary kettle
#

The cactus counting would be done once

topaz cape
#

im so sorry to waste your time

#

i don't ask for help except when im desperate

#

XD

wary kettle
#

10 million cactus ticking vs 1 time adding a number is not more intensive lol

hybrid spoke
wary kettle
#

actually

#

I think i can just disable cactus entirely and manually count the cactus on chunk load

#

yeah that should work

#

the only issue is finding the correct hopper to move it to

#

without chunk hoppers i mean

#

my current plugin tracks where the first cactus goes to and marks the hopper

#

then transfers all new cactus from that chunk to the hopper

chrome beacon
#

Every cactus doesn't tick

acoustic widget
wary kettle
#

which there are 15

#

so yes that is how they work

chrome beacon
#

They are not ticked every tick and thus the load is spread out over time

#

Causing no lag

wary kettle
#

i didnt say they tick every tick

#

if they ticked every time thatd be absurd

#

cactus does not need 15 crop stages though thats whats dumb

chrome beacon
#

What you're worried about is a few random calls and a block update

#

It's not intesive what so ever. You're just wasting your time

glossy venture
#

anyone know why this event is not being called?

// Event Handler Code

    @EventHandler(priority = EventPriority.LOWEST)
    void scoreboardPlayerJoin(PlayerJoinEvent event) {
        plugin.getLogger().warning("JOIN EVENT CALLED: " + event.getPlayer().getUniqueId());
        boards.put(event.getPlayer().getUniqueId(),
                ScoreboardBuilder.newBoard("kitpvp").title(displayHeader));
        updateScoreboardFor(event.getPlayer());
    }

// Event Register Code

    public ServerModule(ServerPlugin plugin) {
        this.plugin = plugin;
        Bukkit.getPluginManager().registerEvents(this, plugin);
    }
#

it does not show the line in console

#

it should be one of the first things called too

#

because of the lowest priority

#

right

remote swallow
#

lowest is called last iirc, highest is first

summer scroll
#
Listeners with lower priority are called first will listeners with higher priority are called last.

Listeners are called in following order: LOWEST -> LOW -> NORMAL -> HIGH -> HIGHEST -> MONITOR
remote swallow
#

i thought that was the other way round

humble tulip
#

Nope

#

Higher priority means their effect are more important so shpuld be done later so less plugins can affect them

#

If higher priorities are done first, then other plugins are able to undo modifications to the event that the higher priority listener did

remote swallow
#

ah makes sense

smoky oak
#

cuz well, they're supposed to 'monitor' and logging stuff

tough field
#

Hello, is there any chance that spigot has archived old resources?

eternal oxide
#

old webpages?

tough field
#

yes

remote swallow
#

wdym by that

smoky oak
#

the old javadoc is available if search for something including version number

tough field
#

resources sorry

smoky oak
#

also u can still build the old servers using the --rev arg on buildtools

remote swallow
#

as in version or no longer on the site resources

tough field
#

So is it possible to find it somewhere?

remote swallow
#

might be that

tough field
#

Nope

#

That is something completely else

#

You won't find it on the net that's why I am asking if spigot have archived resources

remote swallow
#

no idea then, the staff might have old versions but probably wont give them out

tough field
#

I don't take might and probably as an answer

ionic dagger
#

Are there any in depth explanations on how to do config files w spigot that anyone knows of?

remote swallow
tough field
#

Who should I contact?

remote swallow
undone axleBOT
ionic dagger
#

🫶🫶

remote swallow
ionic dagger
#

Ooooohhh

#

I was j looking at the docs originally

#

Thanks! 😄

smoky oak
quaint mantle
#

Hey Guys, which version pdc support version?

echo basalt
#

1.14+

smoky oak
#

if u compile a nms plugin for one version, how likely is it to break if ran one major version later? I'm aware that recompiling has an almost 0% chance of working, but what is with compatability mode?

remote swallow
#

atleast 90%

tacit quartz
#

Quick question, maybe someone happens to know right away: In BungeeCord, is the ServerDisconnectEvent called in all cases in which a player disconnects from a server? Including in cases in which also the PlayerDisconnectEvent , the ServerKickEvent , or the ServerSwitchEvent are called? I.e. is it sufficient to listen for the first event to detect cases in which a player disconnects from a server for whatever reason?

kind hatch
smoky oak
#

guess its time to look into writing libraries lol

remote swallow
#

you can import multiple versions of nms and enable them based on server version

acoustic widget
#

Any way to remove displayed name from an item in inventory ? I tried blank or space, but it shown something

remote swallow
#

you cant, best you can do is have it blank

acoustic widget
#

ok thanks

smoky oak
remote swallow
#

if (Bukkit.getVersion().equals("1.19.2") trigger 1.19 module stuff

smoky oak
#

probably better to do a switch lol

remote swallow
#

yeah

hushed pawn
#

can a variable refer to two BukkitRunnable objects at the same time?
so i would be able to do var.cancel(); and cancel both of them?

eternal oxide
#

write a wrapper object

smoky oak
#

read variable = reference here

smoky tinsel
#
ShapedRecipe recipe11 = new ShapedRecipe(new ItemStack(modularbow)).shape(new String[]{"*&%","@#$","^+^"}).setIngredient('*', new RecipeChoice.ExactChoice(r6)).setIngredient('&',new RecipeChoice.ExactChoice(trident))
                .setIngredient('%', new RecipeChoice.ExactChoice(r5)).setIngredient('@', new RecipeChoice.ExactChoice(r2)).setIngredient('#', new RecipeChoice.ExactChoice(bow)).setIngredient('$', new RecipeChoice.ExactChoice(r3))
                .setIngredient('^', new RecipeChoice.ExactChoice(potion)).setIngredient('+', new RecipeChoice.ExactChoice(r7));
hushed pawn
#

alright il try

smoky tinsel
#

why this did not work

quaint mantle
#

How do I get protocollib 1.19?
Right now im receiving a ClassNotFoundException for WrappedChatComponent

#
<dependency>
            <groupId>com.comphenix.protocol</groupId>
            <artifactId>ProtocolLib</artifactId>
            <version>4.8.0</version>
            <scope>provided</scope>
        </dependency>
#

not im unsure if this is the correct version or not

acoustic widget
#

No way to get an instance of Player with someone offline ? Should I only use OfflinePlayer ??
If user is online, I can use Player instance and if not offlineplayer ? Is there something easiest to use for having not to check if player is online or not ?

smoky oak
#

also whats ur full stacktrace? pls paste it

#

?paste

undone axleBOT
quaint mantle
#

infinite loop of this

smoky oak
#

hm

#

do u have the protocollib in ur plugins folder

#

cuz if ur using provided thats required

quaint mantle
#

ah

#

ill remove that scope rq

smoky oak
#

u cant

#

u have to say how u include it

#

or well

#

dont include it

#

if u say compile (?) it puts it into ur plugin

quaint mantle
#

so do i just add the protocollib jar into my server than

smoky oak
#

if u say provided u say 'its in the plugins folder'

#

yea

#

best option too

#

buncha plugins use the same libraries

#

including them multiple times is stupid and just increases file size for no reason

quaint mantle
#

That seems to have worked

#

now my tab list appears

#

ty

smoky oak
kind hatch
acoustic widget
#

Thanks for clarify

primal goblet
#

whats the event that handle when i put a water removes a flower?

#

i want to disable it

midnight quarry
#

what is the default number of in-love ticks does the animal get when you feed them?

smoky oak
midnight quarry
topaz cape
#

any idea why this happens when players disguise and try to chat?

smoky oak
#

long as you allow disguises theres only two ways around it

#
  1. disabling chat reporting
#
  1. echoing messages via the server
eternal oxide
topaz cape
#

but I didn't change the skin at all

eternal oxide
#

same for name change

topaz cape
#

i changed the name fine

eternal oxide
#

anything using a fake profile requires you copy the signature

smoky oak
#

is that even possible

#

wasnt the signature linked to the name?

eternal oxide
#

yes

smoky oak
#

then how

topaz cape
#

yes how o.o

eternal oxide
#

one sec I'll have to open my ide

#
ServerPlayer nmsPlayerToAdd = new ServerPlayer(nmsPlayer.server, nmsLevel, newGameProfile, nmsPlayer.getProfilePublicKey());```
topaz cape
#

hmm?

eternal oxide
#

You have to copy the getProfilePublicKey() or you have the issue you found

topaz cape
#

i just modify the name with reflections

smoky oak
#

ur using remapped right?

#

Elgar i mean

eternal oxide
#

yes

topaz cape
#

yes

smoky oak
#

i just realized i forgot again how to cast from api to nms 😓

smoky oak
#

uh thats how to add remapped

#

what im talking about is casting BukkitPlayer to nmsPlayer

remote swallow
#

isnt it just normal casting

eternal oxide
#

no

smoky oak
#

they arent extending each other

#

so theres some other method necessary but i forgot it

dapper scarab
hybrid spoke
#

getHandle dankfingers

smoky oak
#

ah yea that

#

thanks

eternal oxide
#

ServerPlayer nmsPlayer = (ServerPlayer) NMSUtils.getServerPlayer(player);

#

?paste

undone axleBOT
eternal oxide
hybrid spoke
quaint mantle
#
FileConfiguration pdata = PlayerData.getInstance().getData();
String c = String.format("%s.Crates."+name, p.getUniqueId());
pdata.set(c, pdata.getInt(c)+amt);
PlayerData.getInstance().saveData();
topaz cape
quaint mantle
#

For some reason when I save this, it saves it as '02'

#

Any reason why?

topaz cape
#

i just change the name with reflections

quaint mantle
#

I want it to just save as a straight number

topaz cape
#

why should i use a whole new player

#

oml

remote swallow
quaint mantle
#

I am, it does save to the file

#

its just, when I run it and use the amount of to

#

*2

eternal oxide
quaint mantle
#

it sets it as '02'

smoky oak
quaint mantle
#

and if ran again goes to 04 and so forth

eternal oxide
smoky oak
#

kthx

remote swallow
quaint mantle
#

hold on i see the issue

topaz cape
quaint mantle
#

its how im saving

topaz cape
#

except it changes it when needed only

echo basalt
#

with a private constructor

#

no point in making final methods in utility class, there's no hierarchy

#

~~I wonder if anyone ever made an NMS abstraction that provides all the methods but in a universal format ~~nvm bukkit is a thing

smoky oak
#

yea but it aint complete or we wouldnt need nms

tacit night
#

Hey im coding an gui plugin. so i have an enum with entrys for head ids out of the headdatabase api.
I try to fetch entrys out of the enum and check if they are exists. if not set the unknown head. But the enum says every time when i check if the value is "null" that this is everytime null

ServerTypes serviceType = ServerTypes.valueOf(service.getServiceId().getTaskName()) != null ? ServerTypes.valueOf(service.getServiceId().getTaskName()) : ServerTypes.UNKNOWN;

This is the line with the error. But idk how to check otherwise the valueOf is null

The service ist the cloudnet service, idk if this is needed

tardy delta
#

Value of is notnull

#

It throws An error instead

tacit night
#

so i must throw with exception?

tardy delta
#

Catch them

tacit night
#

ah okay thanks :D

glossy venture
molten hearth
#

Mild 200 character indentation

kind hatch
molten hearth
#

Why 2 doe

misty ingot
#

why in the hecc does it say "unexpected return value"?
it has to return a bool and its returning a bool

#

am I going crazy?

tardy delta
#

cuz youre returning as a lambda

#

youre not returning something outside of the lambda

#

welcome to async programming

misty ingot
#

oh for f-

tardy delta
#

make it return a CompletableFuture<Boolean> or use callbacks whatever

worldly ingot
#

If you want something asynchronous to return a value, you'll want to look into CFs, yeah

tardy delta
#

concurrency is a bitch

worldly ingot
#

but can be super fun with CFs if you know how to use them

tardy delta
#

true

worldly ingot
#

There's nothing more satisfying than chaining together CFs lol

tardy delta
#

you mean like multiple instances? .. never done that tho

#

i usually let all my stuff run sync and then wrap one cf around it

worldly ingot
#

No, with thenCompose(), thenApply(), etc.

misty ingot
#

ah, well its not that hard

worldly ingot
#

Will pull an example

#
dysonFan.connect()
    .thenCompose(DysonFan::requestEnvironmentalSensorData)
    .thenAccept(data -> {
        double temperature = data.getTemperature(); // Measured in Kelvin
        int relativeHumidity = data.getRelativeHumidity(); // Measured as a percentage from 0 - 100%
        int particles = data.getParticles(); // The amount of particles in the air, from 0 - 9999
        int volatileCompounds = data.getVolatileCompounds(); // The amount of volatile particles in the air, from 0 - 9999, or -1 if initializing
        SleepTimer sleepTimer = data.getSleepTimer(); // The active sleep timer, or SleepTimer.OFF if none
    })```
#

This is my Dyson fan library

tardy delta
#

:o thats not hard

#

thats your code?

worldly ingot
#

mhmm

tardy delta
#

:>

tender shard
#

i never heard of thenCompose lol

worldly ingot
#

It basically accepts the result of the last future and returns a new CompletableFuture

tender shard
#

ah oki

#

thx

#

I think the javadocs for futures are way too complicated

tardy delta
#

kinda like map

worldly ingot
#

Sort of but not quite. thenApply() is more like map()

#

Think of thenApply() as sync, thenCompose() as async

#

thenApply() converts from T to U, thenCompose() converts from T to CompletableFuture<U>

tardy delta
#

:o

ivory sleet
#

thenCompose is more like a flatMap

tardy delta
#

never understood flatmap so get out

ivory sleet
#

basically
<T,R> Stuff<R> flatMap(Function<T,Stuff<R>> f){
return f.apply(someValue);
}
i don’t know if it makes it easier to understand, but under some circumstances a flatMap takes the function argument, invokes it on some value and returns the result, but not always (for instance you have Optional::flatMap which only does it if there’s a present value)

tender shard
tardy delta
#

let me guess, conclure was typing on phone again

ivory sleet
#

Yes

#

(:

tardy delta
#

flatmap just flattens some nested collections :§

#

smells like my parser

ivory sleet
#

Well, a finer name for the pattern is monad Ig

tardy delta
#

i think ii heard of that

ivory sleet
#

Yeah “a monad x is just a monoid in the category of endofunctors for x” or sth iirc nerd1

tardy delta
#

\😵‍💫

smoky oak
#

mate i just code

#

i dont know how im doing it

faint sedge
#

Hey, do you know if when noone is connected to a server some classes can be emptied ?

smoky oak
#

bad idea imo

ivory sleet
#

Mind elaborating?

faint sedge
#

Cause I have a command that's working when i'm connecting for the 1st time, I disconnect and then it doesn't work

ivory sleet
#

Sounds like a bug more like, mind sharing some code?

smoky oak
#

well all player related objects are either deleted or put into the corresponding offlineplayer

faint sedge
#

And as I don't want to use a DataBase for now, i was wondering if the private attributes were deleted

smoky oak
#

so u might get some npe issues

#

yea

faint sedge
smoky oak
#

if u dont have handling for savving data it gets deleted when disconnecting

#

but conclure is right that this is a bit ambiguous

faint sedge
#
public class Main extends JavaPlugin {
    private static FServer fserver = new FServer();

    @Override
    public void onEnable(){
        System.out.println("Le plugin de faction est lancé ! :)");

        getServer().getPluginManager().registerEvents(new PluginListeners(), this);
        getCommand("sell").setExecutor(new Shop());
        getCommand("bal").setExecutor(new Shop());
        getCommand("fPlayers").setExecutor(new FCommands());
    }

    public static FServer getFServer() {
        return fserver;
    }
}```
#

this is my main

#
public class FServer {
    private Set<FPlayer> fplayers = new HashSet<>();

    public void addFPlayer(FPlayer fPlayer) {
        fplayers.add(fPlayer);
    }

    public boolean firstConnexion(Player player) {
        for (FPlayer fplayer: this.fplayers) {
            if (fplayer.getPlayer().getUniqueId().equals(player.getUniqueId())) {
                return false;
            }
        }
        return true;
    }

    public FPlayer getFPlayer(UUID uuid) {
        for (FPlayer fPlayer: this.fplayers) {
            if (fPlayer.getUUID()==uuid) {
                return fPlayer;
            }
        }
        return null;
    }

    public Set<FPlayer> getFPlayers() {
        return this.fplayers;
    }
}
#

FServer class

smoky oak
#

?paste

undone axleBOT
smoky oak
#

use that

faint sedge
#
public class Shop implements CommandExecutor {
    public Set<ItemShop> shopBlocks = new HashSet<ItemShop>();
    private FServer fServer = Main.getFServer();

    public Shop() {
        this.shopBlocks.add(new ItemShop(new ItemStack(Material.IRON_AXE, 1), 100, 20));
    }
#
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String msg, String[] args) {
        if (!(sender instanceof Player)) {
            return false;
        }
        switch (cmd.getName()) {
            case "bal":
                if (args.length > 0) bal((Player) sender, args[0]);
                else bal((Player) sender, "");
                break;
        }
        return false;
    }

    public void bal(Player sender, String name) {
        int bal = -1;
        String targetedName = "";
        if (name=="") {
            FPlayer fSender = this.fServer.getFPlayer(sender.getUniqueId());
            System.out.println("Données corrompues");
            bal = fSender.getBalance();
            targetedName = fSender.getDisplayName();
        } else {
            for (FPlayer fPlayer: fServer.getFPlayers()) {
                if (fPlayer.getDisplayName() == name) {
                    bal = fPlayer.getBalance();
                    targetedName = fPlayer.getDisplayName();
                    break;
                }
            }
        }
        if (bal == -1) {
            sender.sendMessage("§cIl n'y a pas de joueurs s'appelant ainsi.");
        } else {
            sender.sendMessage("§2Argent de " + targetedName + ": §7" + bal + "$");
        }
    }

}```
#

And this is my Shop class

#

I was just trying to run the /bal command

#

I've done messy stuff in order to see if I could avoid to get the errors haha but it should be understandable i guess

faint sedge
#

or writing it into a file but 🤮

smoky oak
#

not necessarily, u could save it in the player pdc

#

but the player object itself gets deleted when the player leaves the server

quiet ice
#

Could you give us a TLDR of what you are attempting to do?

#

I highly doubt that either step is necessary

faint sedge
quiet ice
#

Too long; didn't read

kind hatch
#

Too Long; Didn't Read

quiet ice
#

The issue I assume is that you are using identity comparision on non-interned strings

faint sedge
#

Oh, well i'm creating a HashSet of the players that has already joined my Server, and when someone uses the /bal command (which tells how much money they got), i'm going throught the Set of players looking for him, and returning the money he has

quiet ice
#

You should use Obeject.equals() for string comparisions

faint sedge
#

The thing is that when I disco/reco it's null

kind hatch
#

Why not just use a Map<UUID, BigInteger>?

quiet ice
faint sedge
quiet ice
#

Example:

       if (name.equals("")) { // <-- here
            FPlayer fSender = this.fServer.getFPlayer(sender.getUniqueId());
            System.out.println("Données corrompues");
            bal = fSender.getBalance();
            targetedName = fSender.getDisplayName();
        } else {
            for (FPlayer fPlayer: fServer.getFPlayers()) {
                if (fPlayer.getDisplayName().equals(name)) { // <-- and here
                    bal = fPlayer.getBalance();
                    targetedName = fPlayer.getDisplayName();
                    break;
                }
            }
        }
faint sedge
kind hatch
faint sedge
quiet ice
#

That is actually the case

#

Common symptom of non-interned strings: They seem interned until they are not

kind hatch
topaz cape
faint sedge
quiet ice
#

In your case if (fPlayer.getUUID()==uuid) { in FServer:getFPlayer(UUID) would also be a blunder and probably is the actual root cause of your issue.

kind hatch
faint sedge
#

And do you guys know if I have to pay to implement DataBases or can I get some basic access to it freely ?

faint sedge
smoky oak
#

persistent data container

#

stores anything and is uniquely identified for each plugin storing data

#

look it up

fluid river
#

hello comrades

#

where are noobs

#

show me

tardy delta
#

do you have to init it or smth?

zealous iron
#

What is the best and easiest database for storing LARGE amount of playerdata

torn shuttle
#

anyone know off the top of their heads what mojang changed about 1.19.3 that broke custom icons I was using for menus?

kind hatch
#

Custom icons?

#

You talking about resource packs? @torn shuttle

kind hatch
#

That mostly applies to blocks and textures, but maybe it screwed something up for you.

torn shuttle
#

Uh ill check but real quick is it not backwards compatible?

kind hatch
#

Doubt it, but cannot confirm.

torn shuttle
#

Ah i think i see the issue

worldly ingot
#

Don't think it's backwards compatible, no, but the short of it is that any assets outside of ../models and ../textures aren't loaded unless specified in a texture atlas

torn shuttle
worldly ingot
#

Don't think that 1.19.2 clients will understand a pack version < 1.19.3's version

kind hatch
#

I mean, in theory, so long as the structure hasn't changed and the only addition is a config file, then anything below 1.19.3 would likely ignore it.

torn shuttle
#

that was my thinking, I'm trying to find out how I can make / generate a texture atlas

kind hatch
#

Choco has a point though. I'm not sure if the game would be able to parse things correctly with a newer pack version on an older version of the game.
You can use older resourcepacks on newer versions, but I don't think you can do it the other way around.

#

Then again, I haven't tested that. I don't have a reason to go back to older versions of the game.

torn shuttle
#

historically you have been able to run resource packs from future versions on old versions

#

boy I sure wish mojang provided an example atlas to see how they can work

#

also I sure hope you can have multiple atlases on a single resource pack or else this is going to further complicate the merging process

raw prairie
#

How might I use advanced slimeworlds

#

To make a map reset system

torn shuttle
#

hey what's up fellow kids, anyone have an atlas configuration file I can copy look at?

raw prairie
near citrus
#

Hello how can i get vanilla name of a minecraft item in 1.19.2 like "String name = nmsStack.getItem().a(nmsStack);"? this method doesn't exist in 1.19.2 or any newer version and i can't find anything on google

topaz cape
#

is messing with the chat format possible to cancel mojang encryption

quiet ice
quiet ice
onyx fjord
#

is it possible to get an event after one event?

#

basically i can only access BlockBreakEvent but I need to handle BlockDropItemEvent

eternal oxide
#

the drop item event has a reference to the block it's for

#

event.getBlockState()

quaint mantle
#

hello guys

undone axleBOT
#

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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

quaint mantle
#

I have a question so if I put seperatly an block x and a block z loop in a async task would that be more effective ?

sullen marlin
#

You can't do that safely unless you work off a chunk snapshot

tardy delta
#

async better /j

molten hearth
#

hmm I have a question, im working on some survival games, is it better practice if I register my own events and fire them from other events or should I just execute my code from within the event? eg if someone has the kit assassin and eats an apple I want some stuff to happen, is it better practice if I do checks within PlayerItemConsumeEvent and register something such as AssassinTriggerAbilityEvent and do custom logic there or is it better practice to just do it from the PlayerItemConsumeEvent?

faint sedge
#

Hey, could someone explain me what's the 'msg' field in this command ?
public boolean onCommand(CommandSender sender, Command cmd, String msg, String[] args) {

#

But this is the 'cmd' field, isn't it ?

#

for instance if i'm runnin /giveApple me 2

#

Well, i don't get something then

#

i've used this until now

#
 @Override
    public boolean onCommand(CommandSender sender, Command cmd, String msg, String[] args) {
        if (!(sender instanceof Player)) {
            return false;
        }
        switch (cmd.getName()) {
            case "bal":
                if (args.length > 0) bal((Player) sender, args[0]);
                else bal((Player) sender, "");
                break;
            case "pay":
                


                break;
        }
        return false;
    }```
#

and while running /bal

#

it works :')

#

i haven't started to code it yet

plush shore
torn shuttle
#

anyone have documentation on the atlasses that are new with 1.19.3?

#

it's giving me a hard time

faint sedge
#

I'll read more doc, but do you suggest i should edit it like this ?:

@Override
   public boolean onCommand(CommandSender sender, Command cmd, String msg, String[] args) {
       if (!(sender instanceof Player)) {
           return false;
       }
       switch (msg) {
           case "bal":
               if (args.length > 0) bal((Player) sender, args[0]);
               else bal((Player) sender, "");
               break;
           case "pay":
               


               break;
       }
       return false;
   }```
faint sedge
#

K, tysm for your help !

quaint mantle
#

guys you like nms?

torn shuttle
#

even the microsoft documentation doesn't seem to mention atlasses, this is some bs

quaint mantle
undone axleBOT
quaint mantle
#

whats that

#

is this some security something?

quiet ice
#

?bootstrap are you aware of the bundler?

undone axleBOT
#

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

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

topaz cape
#

how do you guys add a player to the tab in 1_19_R2

quiet ice
quaint mantle
quiet ice
#

arcane magic?

eternal oxide
#

ClientboundPlayerInfoPacket

topaz cape
#

maybe UpdateInfo one you mean?

quaint mantle
eternal oxide
#

it was there in 1.19.2, not looked in .3

topaz cape
quiet ice
# quaint mantle ?

Sorry, but I am not someone that has any knowledge of using mojmap in standard setups. For nonstandard setups though ...

quaint mantle
#

k i am going to google it

quiet ice
#

For gradle you'd have to use paperweight and for anything else it's arcane magic

quiet ice
quaint mantle
#

is it possible to do mappings with eclipse build path

#

instead maven

quiet ice
#

Well then, obscure magic it is...

#

And uh, unless you are willing to use something ontop of JDT such as an alternate buildchain (that may translate to JDT) or a JDT plugin (which you'd need to develop yourself), it's a big no

#

It's easier to just use eclipse's great maven integration through m2eclipse

faint sedge
#

Another question, what's -in ur opinion- the best way to define errors to be sent ?
I mean, when I have to send a lot of times the message 'User not found' to a player, should I define some errors in an enum rather than in an interface ? I've seen both on the internet

eternal oxide
raw prairie
#

This is the code I have currently to use slimewords to make a map reset system

#

Would this work

quiet ice
#

At least for that purpose

raw prairie
#

// Check if the game has ended
if (gameHasEnded()) {
  // Get a list of all online players in the current world
  List<Player> players = Bukkit.getOnlinePlayers();

  // Iterate over the list of players and teleport each one to the lobby
  Location lobby = new Location(Bukkit.getWorld("lobby"), 0, 64, 0);
  for (Player player : players) {
    player.teleport(lobby);
  }

  // Unload the current world
  Bukkit.unloadWorld(Bukkit.getWorld("currentworld"), false);

  // Delete the current world folder
  File worldFolder = new File("/path/to/world/folder");
  worldFolder.delete();

  // Import the template world from the plugin folder
  WorldCreator creator = new WorldCreator("templateworld");
  creator.copyFrom(new File("/path/to/template/world"));
  World world = Bukkit.createWorld(creator);

  // Load the imported template world
  world.load();
}
#

I'm relatively new to bukkit

#

And slimeworlss

#

I've been getting an error on that

quiet ice
#

That should compile.

raw prairie
#

Yea meant that

quiet ice
#

Shouldn't that be the same?

#

Eh, outdated javac I'd guess

raw prairie
#

So best fix is to extend as player

tardy delta
#

getOnlinePlayers doesnt that return a Collection<? extends Player>?

raw prairie
#

K

tardy delta
#

it does

quiet ice
#

Ah right

#

But it has nothing to do with the generic signatures

raw prairie
#

So do I change it to collection or list

#

I'm confused

quiet ice
#

I'd rather kill myself than accept that generics would cause that sort of issues

#

new ArrayList<>(Bukkit.getOnlinePlayers());

tardy delta
#

have fun

worldly ingot
#

It shouldn't compile. You can't assign a method result of Collection to a List (without a cast)

raw prairie
#

Ah

#

I haven't put this in an ide

#

I just used notepad

#

Cauee I'm on my phone

#

Sudo code

#

Psuedocode

#

How might I create a folder with a template world?

#

Would it be like

#

File.create

#

Or smth

quiet ice
#

mkdirs

raw prairie
#

Wut

#

Its gonna be in the plugin folder

#

Not the regular direcotry

quiet ice
#

Folder = createDirectories/mkdirs depending on what you use

raw prairie
#

Kk

quaint mantle
#

Hi, I tried plugin buildsystem which can be obtained from github but it shows me there

  • What went wrong:
    Execution failed for task ':buildSrc:compileKotlin'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction

https://github.com/Trichtern/BuildSystem/releases/tag/2.20.6

quiet ice
#

And don't expect the plugin dir to be present - common noob mistake

quaint mantle
#

Help Please

topaz cape
#

jd-gui > recaf /j

quiet ice
#

I have little involvement over Recaf outside of emotional support

raw prairie
#

Wait can I not put the world folder inside plugin resources

#

And then link the path from there

quiet ice
#

Uh sorta? But no, don't do that if you have no experience with ZipInputStream

raw prairie
#

Yea

raw prairie
#
File f = new File(plugin.getDataFolder() + "/");
if(!f.exists())
    f.mkdir(); ```
#

Would that work

quiet ice
# raw prairie ```java // Check if the game has ended if (gameHasEnded()) { // Get a list of...

Would this work? In order to be able to answer that I would need to know what you want and what you do not want. Furthermore I would need to know all parameters of your environment, including operating system and installed userpace applications.

Since evidently I cannot know that since I am not a fortune teller and do not have the patience nor time to caclulate all possible outcomes - including all quantum fluxiations that could cause charged particles to hit the computer's working memory - it is not possible to answer this question without guess work.

The degree of aforementioned guess work depends on how many parameters are already known and how many parameters are safe to ignore. In this circumstance it should be rather safe ignore charged particles, as well as the operating system (although I've seen quite a few people using the wrong tool for the wrong task, so I shouldn't be assuming too much too early).

Ignoring charged particles is only something a fool would perform and while it having an effect on the outcome is rather slim - given enough time it is almost certain. Needless to say that the so-called technology of "Error-correcting-code" (ECC) is also rather pointless here too, while it certainly reduces the aforementioned chances drastically - they will never be 0. In the event of a solar storm a fatal failure is almost to be exepected. If it isn't the memory that breaks it is the power grid that will fail. Even if you use something that is worthy of being called an uninterruptible power supply (UPS), it would fail eventually anyways. If it isn't the power supply then it is the test of time.

Nothing, nothing truly escapes the heat death of the universe. Not even your puny question.
Thus the answer is a clear no with all currently known parameters about the laws of physics, and perhaps everything else too.

I know, underwhelming - you expected something more cheering - but really, what is the point of it all? There is no point. Go outside; enjoy life.

raw prairie
#

Nice

quiet ice
#

I had to do it eventually. this was just the final straw

#

Nah I wrote it on my own - copypasta style

raw prairie
#

I have pterodactyl panel

quiet ice
#

I would've written a longer nonsensical text but alas discord has a message size limitation

river oracle
#

Chunk it into 2 messages

quiet ice
#

Eh, this suffices. Back in my IRC days I had to contend with ~220 characters

torn shuttle
#

not even a real irc user

#

my irc client just split those messages up for me

river oracle
#

I never even used an irc

raw prairie
#

Same

river oracle
#

Alas being a youngling

quiet ice
torn shuttle
#

let me try again, NOT EVEN A REAL IRC USER

quiet ice
#

The only real IRC client is irssi - and perhaps sic

torn shuttle
#

hexchat

quiet ice
#

Big security vuln

raw prairie
#

Well

torn shuttle
#

live fast die young

quiet ice
#

It can leak your system specs

raw prairie
#

I answered your questio

torn shuttle
#

I even share pictures

raw prairie
#

Crazy

torn shuttle
#

I love flexing specs

quiet ice
raw prairie
#

Ah

quiet ice
#

If I had any knowledge about slimeworld I might answer, but I do not

torn shuttle
#

I wonder if the other devs that rely on resource packs are also waiting for someone else to figure out atlases for them lol

quiet ice
#

Good thing I don't use resource packs I suppose

river oracle
#

Resource packs are semi nice but overused sometimes for trivial reasons

raw prairie
#

Is it like some custom model thing

restive mango
#

Anyone able to tell me the differences between the spawnParticle method available through world and the one available through player?

#

If you are spawning more than one particle at one place, is it generally more efficient to run through the player list to get all the nearby players and just use the spawnParticle method on all of them instead of spawning a particle using world?

#

Also ping me

wet breach
#

the main difference is that the one available through player will spawn the particles at the player

#

where as the one through world will spawn them at a location you specify

restive mango
#

I know that

wet breach
#

then not sure why you asked if you already knew

restive mango
#

But every time you use world spawnParticle, is it checking through every player to see who it should send a packet to?

sonic goblet
#

Doesn’t the player one only display those particles for that player?

restive mango
#

If I use world spawn particle 100 times, is it running the player list 100 times to check for people being within render distance of the particle?

#

Compared to myself running the player list once and adding all those nearby players to a list which I think iterate through with the player spawnParticle method

wet breach
#

packets are not something you really should worry about

restive mango
#

I mean I should when I’m sending 100 packets a tick to 100 players

#

It’s like 10000 extra packets

wet breach
#

its not

#

and no it isn't running through the player list

#

it checks the nearby chunks of where entities were spawned

#

if no players nearby then no it won't send a packet

#

if there is, it only sends it to the players that are nearby not everyone

#

unless everyone is near it, but it isn't extra packets

#

because without the packet, obviously a player won't see it spawned

#

but packets are small in size, and unless you have player with shitty internet to begin with, like latency of 500+ it won't really have much affect

restive mango
#

I mean I get server lag when I spawn lots of particles

wet breach
#

that isn't from packet lag

#

that is FPS lag

#

two different things

restive mango
#

No.

wet breach
#

yes

restive mango
#

Ticks per second goes down

#

My own screen lags, sure

#

But /tps shows a drop

#

Too

#

Which is the actual problem

wet breach
#

if your TPS goes down, then probably should look into why your server is lagging on particle entities

restive mango
#

But it’s not the packets which cause it, you think?

wet breach
#

no

restive mango
#

Kk

wet breach
#

as I said packets are extremely small

#

each packet sent is at most 56bytes

restive mango
#

Maybe I could just send the actual packets

wet breach
#

times that by 1000 and we are only at 56kb

#

56kb is something a dialup modem can handle

#

so, no odds are the server is lagging on the entities itself and not the packets needing to be sent

restive mango
#

So when you spawn a particle you create a particle entity

wet breach
#

also packets are queue as well, so it isn't like all 1000 packets get sent at the same time

restive mango
#

Is the issue it sounds like

#

So I should really just send the particle packet

wet breach
#

so that isn't 56kb all at once, that would be 56kb spread out over a few hundred milliseconds

restive mango
#

Ugh

#

Particle packets

wet breach
restive mango
#

Kk

#

Shame I can’t send pictures here

wet breach
#

if you verify you can

#

!verify

undone axleBOT
#

Usage: !verify <forums username>

restive mango
#

I’ll use that

wet breach
# restive mango Kk

glad I was able to clear up or clarify where your issue is most likely at and not where you thought it was at 😉

restive mango
#

Yes you’re very smart

#

Now answer my next question

#

How much more taxing do you think it will be to make every projectile a trident

#

I hear they send entity updates 8x the frequency of arrows

wet breach
#

probably more taxing then spawn particles because tridents have more to them that they do lol

#

probably wouldn't spawn 100 tridents and if I had to choose that or spawning 100 particles

#

I would go with particles lmao

restive mango
#

Nah I mean I want to use them to replace other projectiles

#

I spawn a trident projectile and intercept its spawn packet and replace that spawn packet with a packet for another projectile or entity