#help-archived

1 messages · Page 206 of 1

steep smelt
#

I just made a server and but I don’t know what the ip is how would I find out?

sturdy oar
#

how did you make a server without knowing the IP?

open ibex
#

localhost or 127.0.0.1?

steep smelt
#

You need a ip to make a server?

subtle wedge
#

Lol

open ibex
#

You need an ip to use the internet so yes

sturdy oar
#

no way man

#

if you're on linux use ip addr

#

or netstat -tulpn

steep smelt
#

I’m on Mac

sturdy oar
#

so you need your public ipv4?

subtle wedge
#

Go into Network settings

steep smelt
#

Yes

sturdy oar
#

ip addr should work since macOS is UNIX

steep smelt
#

Ok

subtle wedge
#

Where's the Spigot 1.15.2 API ?

sturdy oar
#

on their maven repo

subtle wedge
#

oh ok

rapid bane
#

What is the best way to manage player experience in Spigot/Bukkit ? Seems to be super unreliable no matter what I do - using standard methods + using custom methods. Like I mean especially when the player has bar experience it seems to start duping something and giving more

crisp widget
#

What methods have you already tried?

peak marten
#

For the functional guys out here, any idea what would be the best approach to store a player in another object? I have an object 2 Player properties in it. Should I store just the UUID of the player, or the full Player object? Important notice, the object doesn't need to be stored in a config or any database.

Seems a bit overkill to always retrieve just the UUID and then use the bukkit.getPlayer(..) and check if it is null.

crisp widget
#

Would depend on if the player instance has values that change dynamically & what would be referencing the information

opal adder
#

Why is spigot more restricting than forge? Like don't both just use minecraft to make their API?

peak marten
#

@crisp widget , what do you mean?

crisp widget
#

As in what would be your use case for having the players object stored and accessed?

#

@opal adder What do you mean by "More restricting"?

peak marten
#

The use case is to eventually get the location of the player, or any other data allowing me to send the player a message.

opal adder
#

Well, with forge as the API you can do more right? I've never used it though I could be wrong, I'm only assuming that because mod packs do so much. My only thought here is that, why can't servers do that many things via spigot, like what's the real difference? I understand the API's are different, I just don't understand why

crisp widget
#

Servers can't interact directly with the client, Forge can as forge has modifications directly on the client

#

Spigot can only use Packets which the client is told to accept

opal adder
#

So okay, I understand the difference, but why is there a difference? I mean there are forge/modded servers. Why aren't all servers like this. Why did spigot become a thing, rather than forge? I mean, it sounds like you can create so much more with forge. Not that I'm considering it at all, I'm just more curious

#

It seems odd to me

crisp widget
#

@peak marten So after reading a lil' on the forums, it doesn't appear to actually make a difference in code performance if you wanted to store the player object or if you got their player via UUID each time

peak marten
#

@opal adder , that is not true. In order to have forge working, you need to have all other required mods installed. The power of spigot is that all logic is decided on the server side. There are not requirements other then the correct minecraft version

crisp widget
#

@opal adder It is so that the client would not need to install any modifications for a server to still have a "Modded aspect" that is the key difference between the two, one is client side modifications the other is not

peak marten
#

Alright thanks @crisp widget

opal adder
#

Ohhhhhhhhhh

#

Now it makes sense

noble anchor
#

What is the Best way to synchronize data per servers?

crisp widget
#

Depends which kind of data & how often it's accessed

#

And if it needs to be stored for a long period of time

noble anchor
#

I wanna make a profile system for my bungeecord network

crisp widget
#

For that I'd recommend either SQL(Pick a variation) or MongoDB

noble anchor
#

like updating data every minute?

crisp widget
#

You'd probably want to pull the players data on join

#

And save each time they leave/make a change(Every change is not as recommended)

noble anchor
#

i think about bungeecord messaging

crisp widget
#

BungeeCord messaging channel could work for sending the data to each server, but wouldn't actually store the information

subtle blade
#

Why did spigot become a thing, rather than forge? I mean, it sounds like you can create so much more with forge
Spigot is a server mod while Forge is a client & server mod. Many opt to write server mods with Spigot because the user need not install a client mod in order to join the server. Because a lot of the logic is handled server-side, we can manipulate a lot with that's already available to us

#

Minigames for instance. You don't need to add anything new like items, blocks, biomes or really anything. You just need to change how the server responds to the client

crisp widget
#

psst Choco I got SlimeWorldManager working now 👀 had some extra contributions from other devs 😂

#

It's even more hacky than before 😄

subtle blade
#

Sounds pleasant

crisp widget
#

Super pleasant, there's a fun bug where the sun constantly shakes

pastel condor
#

Super pleasant, there's a fun bug where the sun constantly shakes
@crisp widget woah you actually got it working?

#

is it stable?

crisp widget
#

Yep

#

Sorta kinda

pastel condor
#

hmm

crisp widget
#

It's like 75% stable

pastel condor
#

I see

crisp widget
#

We got the first working build earlier today

pastel condor
#

oh cool

#

are the compiling errors fixed?

crisp widget
#

Yep

#

I fixed those second day working on it

pastel condor
#

oh cool

crisp widget
#

Mostly by putting nulls everywhere

#

But the nulls have been replaced now lmao

pastel condor
#

😑

#

lol

crisp widget
#

It's had a total of 34 commits since 1.16 version was started being worked on

frigid ember
#

is it posible to get the prefix out of a permission for example prefix.&cOwner ore Prefix.&eSup ?

stoic shell
#

alright...

#

is there any chunk generation plugin faster than chunky?

#

I'm concerned that my map pregeneration is gonna take weeks...

frigid ember
#

Chunky good

vocal widget
#

Hey! Quick question... I host the wiki for one of my plugins on another marketplace (not Spigot)... Is it ok to link to the wiki page on that marketplace?

#

if anyone knows

#

otherwise I could ask on the forums

stoic shell
#

well

#

I've been running it almost all day.

#

And the estimate stays around 200 hours.

#

And it's only at 1.82%

crisp widget
#

Would depend on your hardware Snoopy

#

It can only run as fast as the hardware it's running on

light coral
#

How can I delete the user cache? By deleting the file the server regenerates it

narrow pier
#

does anyone know how to set a person's maximum hunger?

crisp widget
#

I don't believe you can change the max food level

#

You can set their food level though

narrow pier
#

dang

crisp widget
#

And technically listen on the foodchange event to control how slow/fast it goes down

narrow pier
#

i thought that since you could set a person's max health you could set a person's max hunger too

#

maybe there is an event for when someone's hunger changes

crisp widget
narrow pier
#

oh cool ty

light coral
#

How can I delete the user cache? By deleting the file the server regenerates it

stoic shell
#

oh welp

#

uh, question...

#

When chunky says processed, does that mean generated?

glacial umbra
#

So, I'm trying to install a plugin into my server by using the server.pro free host. However, whenever I try running a command, this output shows up in the console

narrow pier
#

can someone help me my code is messed up and does not work

bronze acorn
#

@EventHandler above that

narrow pier
#

oh yeah

#

that might be the problem

#

lol

#

ty

#

it works when i drink potions, but not when i eat food?

peak marten
#

Is there any way without the usage of NMS to get a new Living Entity without actually spawning it yet?

#

Is it possible?

crimson sandal
#

How can I get the resource folder from inside the plugin jar? 🙂

tiny dagger
#

getresource

#

from javaplugin class

blazing burrow
#

Is it okay to have numbers inside the name of your program

#

command*

#

Is it ok to have numbers in ur command

#

like /target2

peak marten
#

@blazing burrow , as far as I am aware, there are not really naming conventions for command names

#

Even special characters like / would do (example World edit)

blazing burrow
#

Oh i see thanks @peak marten

peak marten
#

You're welcome

subtle blade
#

Is there any way without the usage of NMS to get a new Living Entity without actually spawning it yet?
There was a pull request for virtual entities a couple years ago now but the author went AWOL and the PR sort of died

#

So, no, not through API

peak marten
#

That is unfortunate 😦

#

Any ideas on a work around?

#

I might have to change my data model to not require the entity by default

subtle blade
#

The closest you'll get to doing something before an entity spawns is the Consumer<Entity> in the spawn() method

peak marten
#

Ah nevermind, that is actually not even possible

#

@subtle blade , not quite sure what you mean with the Consumer. Any examples?

subtle blade
#

spawn(Cow.class, location, cow -> cow.setAge(100));

peak marten
#

hmm

#

it still requires a location

subtle blade
#

Well, yes. The spawn position. What are you doing?

peak marten
#

I have a class which has a LivingEntity in the constructor

#

As a parameter

#

The living Entity is kind of the parent of a series of other properties

#

Problem is, I need to create the instance already, and later on interact further with it. The spawning should only happen after the second interaction (which would be an inventory interaction)

#

the first interaction the creation is done in a command

#

So at first, the entity should be somewhere, not dead, or like ready to spawn

crimson sandal
#

getResource() returns an InputStream right? I want to get a specific folder in the resource folder and loop through all the files in there.

subtle blade
#

Yes though you won't be able to do that with an InputStream. Use the JarFile API

crimson sandal
#

Okay 🙂

subtle blade
#

Can copy/paste and use that method to your hearts content if you'd like, idm

#

Saves all files in the specified directory to your plugin's directory

#

Non-recurseively, but you can make it such if you want

crimson sandal
#

Amazing! Exactly what I needed! Thanks 😛

subtle blade
#

@peak marten You want to basically summon a copy of an entity and set additional properties on subsequently spawned clones?

#

I don't think I understand what your goal is here

inland oxide
#

any ideas?

#

I mean other than it being a "-aper" thing.

#

Context, some of my plugin users have been getting this component loop issue and we've been trying to narrow it down, but no luck yet.

subtle blade
#

idk against which version of paper that's compiled (y'know, this being spigot...) though there was an issue to do with component serialization that was fixed a couple weeks ago. If they're out of date, they should update

#

If it's a stacktrace not from Spigot, you shouldn't be asking here. I can't help you effectively here because I know nothing of how their versioning system works or whether or not they're out of date

remote socket
#

I'm used to using BukkitRunnable and runTask lambda's but what is the non bukkit way to do these?

#

(I learnt java for spigot only, and now I'm not sure how to use it normally)

subtle blade
#

ExecutorServices

little dock
#

How can I make a plugin use one sound with 1.8, another sound for 1.9-1.12, and a different sound for 1.13+ servers

subtle blade
#

Version abstraction, though we just advise working with latest

little dock
#

And how do I do that? 🤔

amber crest
#

Does anyone know the period potion throwing plug? IMPORTANT

little dock
#

Oh cool, thanks

inland oxide
#

@subtle blade, yeh, that was my standard response - update Spigot/Paper and ProtocolLib to latest. Just wondering if there was anything you guys came across, thanks.

amber crest
#

Does anyone know the period potion throwing plug? IMPORTANT
@amber crest @subtle blade

subtle blade
#

idk what that means

bold anchor
#

period potion throwing plug hmmm

#

dafuq is that

frigid ember
#

Choco, do you know how to create a boat which is invisible?

#

The player has to be able to use it when it is invisible

#

Or someone else if they know a way?

#

You cant set a potionEffect/setInvisible because it's not a livingentity

#

And I tried doing it by making it a NMS Boat so I could make it invisible, it just spawned visible

#

Also with 10ticks of delay after placement to make it invisible does not work

woeful veldt
#

I have someone on my server who has a permanent effect applied to him and no matter how many times I run /effect clear, it won't clear the effect...

#

I don't have any plugins (that I know of) that mess with effects...

ashen stirrup
#

Likely to be from a client.

#

Afaik, clients can give users affects which aren't removable from in-game commands etc.

frigid ember
#

Does anyone know how much dedotated wam I need for a server?

crimson sandal
#

Does anyone know how much dedotated wam I need for a server?
@frigid ember As much as you can download :Kappa:

frigid ember
#

xD

#

That video is the best

opal heron
#

dedotated wam?

crimson sandal
#

How come scheduleAsyncRepeatingTask() is Deprecated what's the alternative to repeating a task Asynchronously?

marsh hawk
#

If i TLS proxy my dynmap does it have to be on 443 or can it be any port

frigid ember
#

for worldedit to work do i need to the chunks to all be loaded?

knotty karma
#

No

#

It directly edits the region files

frigid ember
#

?paste

worldly heathBOT
frigid ember
#

my server doesn't start up

graceful vigil
#

that has gpot to be the most useless amount of information ever

quick arch
#

that paste doesn't help at all

#

It just shows that it was killed and then the server attempts to start again

frigid ember
#

well there isn't a crash report

chrome lark
#

killed

#

Something externally killed the process

#

You'd need to speak to your host for specifics

subtle blade
#

How come scheduleAsyncRepeatingTask() is Deprecated what's the alternative to repeating a task Asynchronously?
@crimson sandal runTask() methods are the alternative

#

(there are ones for async and timers and whatnot)

crimson sandal
#

Nice one, I didn't release they were a thing 😄

narrow pier
#

is there a way to detect when someone kills the ender dragon or to detect when someone gets the acheivement for killing the ender dragon?

narrow pier
#

ty

subtle blade
#

The latter will obviously check more than once, but the advancement will... well... listen for the advancement

narrow pier
#

ok

#

what minecraft version is it for

#

my test server is 1.15

subtle blade
#

Whenever advancements were added lol

narrow pier
#

ok

#

would if(e.getAdvancement() == "Free the End") work?

#

nope its getting an error

subtle blade
#

You can compare the advancement key

#

if (event.getAdvancement().getKey().toString().equals("minecraft:whatever_the_advancement_is"))

narrow pier
#

advancement key?

#

oh

#

ok

#

there seems to be no error message

#

thank you

balmy sentinel
#

in PlayerCommandPreProcessEvent do I have to check aliases for commands or will it automatically check for those?

ashen stirrup
#

You need to check for aliases too.

ashen stirrup
#

Afaik, /plugin is a Spigot command so I assume you'd have to look into the SRC code which I have no clue if it violates and TOS etc etc.

subtle blade
#

If it makes you happy, I recently PR'd to Spigot to have those plugin names be hoverable

#

Shows version information, authors, website, etc.

#

Should be available on more recent builds of 1.16.1

#

(if you do want to do this yourself though, you can find that code in org.bukkit.command.defaults.PluginsCommand)

quick arch
#

e.e

ashen stirrup
#
    private String getPluginList() {
        StringBuilder pluginList = new StringBuilder();
        Plugin[] plugins = Bukkit.getPluginManager().getPlugins();
        Plugin[] var6 = plugins;
        int var5 = plugins.length;

        for(int var4 = 0; var4 < var5; ++var4) {
            Plugin plugin = var6[var4];
            if (pluginList.length() > 0) {
                pluginList.append(ChatColor.WHITE);
                pluginList.append(", ");
            }

            pluginList.append(plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED);
            pluginList.append(plugin.getDescription().getName());
        }

        return "(" + plugins.length + "): " + pluginList.toString();
    }
#

Uhh I assume you'd need to make a custom build of Spigot to make the changes.

#

Looked a bit deeper, you'll just want to add pluginList.append(" (" + plugin.getDescription().getVersion() + ")"); to get the version of the plugin.

quick arch
#

Should make it show json messages

#

Hover over it, shows author, version, description etc.

ashen stirrup
#

I assume that's what Choco PR'd for.

lilac gorge
#

Does anyone know how to make custom resource pack sounds work with crackshot+ I can really use the help if anyone knows.

inland oxide
#

Should a plugin that sends a chat message expect that formatting is reset to begin with? In other words, if a plugin changes prefix and add formatting that overflows onto other plugins using the chat, should the expectation be that problem is with the prefix plugin or do you thinkg all plugins that send messages should have to reset formatting??

narrow pier
#

Does anyone know how add a delay between chunks of code? i want to post some messages to a few players in my plugin and i want a delay of about a second in between each broadcast

lyric cypress
#

How would I get the block entity tag from an itemstack

subtle blade
#

Should make it show json messages
Hover over it, shows author, version, description etc.
Yeah that's literally what I added the other week. It's in 1.16.1 😛

quick arch
#

oh

#

pog

#

now my long plugin description can go off the screen!

subtle blade
#

Nah, client wraps it

quick arch
#

._.

#

Well, it can go vertically then

subtle blade
#

I want to say there's a limit to descriptions?

quick arch
#

o

#

how long cause mine's somewhat long

#

mine's currently 113 characters, planning to be bigger

subtle blade
#

Nope, turns out there isn't

#

Thought there was

pastel condor
#

mine's currently 113 characters, planning to be bigger
113 characters or plugins?

quick arch
#

o

#

characters

pastel condor
#

😐

quick arch
#

the plugin description e_e

pastel condor
#

my server used to have 100+ plugins, but I cut back to 80

#

ah

#

lol

quick arch
#

Gradle dumb sometimes

#

Nevermind, found the issue ._.

lyric cypress
#

How would I get the block entity tag from an itemstack

#

a chest specifically

#

in item form

narrow pier
#

how to set items in a person's inventory

subtle blade
#

BlockStateMeta, @lyric cypress

#

@narrow pier player.getInventory(), Inventory#setItem()

#

or addItem(), depends on what you want to do

narrow pier
#

i want to give them a stack of diamond blocks

lyric cypress
#

How do I get BlockStateMeta from ItemMeta?

#

can I just cast it?

narrow pier
#

i have asked this loads of times and have not gotten an answer yet, how do i have a delay between lines of code!

graceful vigil
#

you tried google?

narrow pier
#

yes

graceful vigil
#

First answer

#

It isn't difficult

narrow pier
#

oh i figured it out

graceful vigil
#

wow how convenient you figure it out right after I sent the link..

narrow pier
#

another person told me

#

i wasnt looking here

#

they said to do Thread.sleep();

subtle blade
#

That depends entirely on what you're doing

#

because more often than not, Thread.sleep() is not the answer

quick arch
#

sleep no good

open ibex
#

Yeah that's probably not a good idea as it might freeze the server

#

The better alternative is to schedule a task x ticks in the future. This won't sleep but it can be used to achieve a similar result

wanton delta
#

is there a way to initialize bungee with 0 servers? i have servers managed with something else

frigid ember
#

i have a ~2000 line class to store all my custom items, there's got to be a better way of doing this right

quick arch
#

~2000 line class 🤔

wanton delta
#

🤔

frigid ember
#

yea its pretty bad lol

quick arch
#

Couldn't they just be serialized to bytes and then stored in a database

#

That's ~50 lines?

wanton delta
#

show

#

what are these custom items

frigid ember
#

oh god

wanton delta
#

are they fields

quick arch
#

^^

wanton delta
#

are they classes

#

what are they

frigid ember
#

like ItemStacks

quick arch
#

Are they randomly generated

frigid ember
#

no

quick arch
#

oh

#

So they're fields?

wanton delta
#

oh dear they must be static then

frigid ember
#

no theyre not

quick arch
#

oh

wanton delta
#

oh

frigid ember
#

basically i have a CustomItem enum

quick arch
#

Is it a builder or something

#

oh

#

yeah that's scary

wanton delta
#

oh,,,,, child

frigid ember
#

and then i have a method to get the ItemStack from that enum

#

and this is the method

wanton delta
#

are these items... required globally ... ?

frigid ember
#

theyre basically used everywhere

wanton delta
#

hmm

frigid ember
#

its basically repeated chains of this

#
else if (item.equals(CustomItem.ZOMBIE_SOUL)){
            ItemStack zombie_soul = new ItemStack(Material.COMMAND_BLOCK);
            ItemMeta zombie_soul_meta = zombie_soul.getItemMeta();
            zombie_soul_meta.setDisplayName(ChatColor.WHITE + "Soul of Decay");
            zombie_soul_meta.setCustomModelData(109);
            zombie_soul.setItemMeta(zombie_soul_meta);

            return zombie_soul;
        }
wanton delta
#

oh DEAR

quick arch
#

oh god

narrow pier
#

can someone help fix my code it did not work

frigid ember
#

lol

wanton delta
#

oh dear oh dear oh dear

quick arch
#

that's a mess

frigid ember
#

whats the better way

wanton delta
#

well first of all

narrow pier
#

?paste

worldly heathBOT
wanton delta
#

switch/case is better for enums

#

SECOND of all

#

you should use an item builder

#

THIRD of all

frigid ember
#

item builder?

wanton delta
#

you should make them fields

quick arch
#

Item Builders are amazing

narrow pier
#

i found the problem with my code

wanton delta
#

item builder... like make a class that 'builds' items

quick arch
#
new ItemBuilder(Material.STONE).setName("Test").setLore("Test", "test").setCustomModelData(1).build();
#

etc

wanton delta
#

new ItemBuilder(Material.SAND).setName("Cool name").addLore("cool lore").build();

#

yea

#

what he said

quick arch
#

I'm too lazy to make an array out of that "Test", "test" string

wanton delta
#

welll

frigid ember
#

hmmm

#

that does seem better

wanton delta
#

the parameter could be String... lol

frigid ember
#

thats something i ahve to make myself right

#

its not in Bukkit?

quick arch
#

yes

wanton delta
#

correct

#

or you could find a gist or smt online

frigid ember
#

hm ok thats a good start

wanton delta
#

you will thank yourself later on

frigid ember
#

and what did u mean by fields?

wanton delta
#

fields are

quick arch
#

I can give you my basic abstract item builder class

frigid ember
#

no im pretty far into this lol

wanton delta
#

declared in the class body

frigid ember
#

wdym

wanton delta
#

those are all fields

frigid ember
#

instance variables?

#

wait

wanton delta
#

well theyre called fields

#

any variables that are declared in the class body

frigid ember
#

yea

wanton delta
#

not in the method body

frigid ember
#

i learned them as instance vars

#

but thats besides the pt

wanton delta
#

mmm

#

so these items are for inventories or what

frigid ember
#

just like, u know how in like modpacks there are new custom items

wanton delta
#

yea

frigid ember
#

basically in this i mimic that by giving command blocks and other unobtainable items custom model data. combined with a resource pack, and code, its basically a custom item

little dock
#

Anyone know if intelliJ does any sort of backups? I accidently deleted my entire main class and can't get it back with ctrl+z

graceful vigil
#

giant F right there

little dock
#

Yup :/

wanton delta
#

unless you use git

#

nothing u can do i dont think

little dock
#

dang rip

wanton delta
#

so if i were you i would make an itemmanager that contains these items as private fields that are instantiated

#

and use getters to retrieve them

#

and pass the itemmanager to where you need it

#

but thats just me

#

but one things for certain

#

make sure you get an itembuilder

frigid ember
#

yea

#

thanks ill try that

wanton delta
#

the reason why i dont recommend static is because your jvm may never let go of them

#

which can lead to unecessary ram usage

quick arch
frigid ember
#

oh this isnt static lol

quick arch
#

that's my basic abstract item builder class

#

Abstract because I have two types of item

wanton delta
#

The way you get the item meta is kinda unecessar

#

Bukkit does that all for you

quick arch
#

the item meta can be null which is dumb

#

Choco make a PR for it 🔫

frigid ember
#

thats only if its from Material.AIR or nms itemstack i think

wanton delta
#

Looking at the source idk how that can be true

#

Because it does the same thing youre doing lol

quick arch
#

o

#

I got it on my first iteration of my plugin which was 1 year and 4 or so months ago 😬

#

Better safe than sorry 😄

heavy trail
#

any can help me?

pastel condor
#

you're using paper, you should ask for help in their discord @heavy trail

buoyant path
#

consumers kinda nice doe

frigid ember
#

I'm trying to set up Hibernate for my db operations with mysql. I have a hibernate configuration file to do this. However, when I run my plugin, I get the following error:

Caused by: java.lang.ClassNotFoundException: org.hibernate.cfg.Configuration
        at java.net.URLClassLoader.findClass(URLClassLoader.java:436) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:167) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:96) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:588) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
celest bramble
#

is it possible to take a pressure plate and assign a function to it when stepped on?

frigid ember
#

I checked the jar export and it the configuration file doesn't appear to be part of the exported files. It doesn't even show up in the wizard ui

solid sundial
#

Hey, I'm coding a NPC plugin. I've just been wondering how I would be able to add multiple lines of text to the NPC. Does anyone know how to do this?
@solid sundial (I ping myself to remind me I asked)

frigid ember
#

@solid sundial It requires the use of armorstands (or some other non-moving entity)

solid sundial
#

hmm

#

could i depend on holographic displays

tulip anchor
frigid ember
#

same thing pretty sure

tulip anchor
#

Plugins that used to work on pigZombies no longer work with zombified_piglins

inland oxide
#

should reset code be preserved through TextComponent.fromLegacyText()

#

seems to be removed and causes a split in the components

#

If I take the components then toLegacyText and concatenate it has no reset.

#

something is off.

#

When i'm using ComponentBuilder to append these components after toLegacyText, i end up with an additional fomatting as well as bold being added to components

quick turtle
#

Quick question, say I have an object with a method called getName and that returns a string, how can I go from Set<thatObjectClass> to Set<returnOfGetName>

#

I'm pretty sure there's a way to do it with stream map and collect, but idk the specifics

glossy stump
#

Hi, i am looking for the plugin that blocking protocol in bungeecord (only for bungeecord) thanks!
i've searching for a long time but i can't find 😦
Bungeecord for 1.8-1.16 but i want to block 1.18/1.19 version

inland oxide
#

you can use versionconnector i believe

#

have only specific protocols going to a specific server

glossy stump
#

oh thanks!

inland oxide
#

Why would you expect backporting a plugin to a earlier version it was not designed for would work in the first place? I mean, some of the dependencies are simple, probably easily fixed if you know what you are doing, the others, well shouldn't try to do something way over your pay grade and ask for help getting it done.

#

That being said, should look at the pom file for the dependencies and check if some are on the authors local repo. Might have to change those to ones available on mavencentral. As for the missing methods, probably due to version of ChatAPI.

solid sundial
#

so does anyone know how i can implement Holographic displays?

frigid ember
#

Hey anyone know why i get stackoverflow when i try #setpassenger(); 1.15.2

inland oxide
#

@solid sundial download it?

solid sundial
#

yeah

#

but then how do I add it to my code. <- this is wrong. I more meant how do I make it so that my plugin uses it to have multiple lines on an NPC

inland oxide
#

@frigid ember you would have to show the code for EnderdragonPet.java. Is this someone elses plugin?

#

@solid sundial So, are you asking how to use the API or how to get multiple lines?

solid sundial
#

multiple lines

frigid ember
#

@frigid ember you would have to show the code for EnderdragonPet.java. Is this someone elses plugin?
@inland oxide no i am making

inland oxide
#

Well it's pretty well explained in the tutorial

solid sundial
#

ok thanks!

frigid ember
#
        this.setpassenger(p);
    }```
#

nms

solid sundial
#

also, for future notice, if I have more questions in the next hour or so, feel free to ignore me if you are working with other people. I get it is annoying having to deal with multiple people

inland oxide
#

would need to see more code than that.

frigid ember
#

!pastebin

#

!hastebin

#

@inland oxide you know why this happen

#

version 1.15.2

inland oxide
#

Usually a StackOverflow is due to stack being exceeded, typically because of re-entrant code.

frigid ember
#

So will sending ride packets will help me?

#

i think this is the problem with client

inland oxide
#

not sure what the issue is

keen yoke
#

I cannot get featherboard working for the life of me? Anyone mind looking at my config and telling me whatsup?

#

and god i chose a terrible name for my spigot

inland oxide
#

would need to see setpassenger method as well

frigid ember
#

Well its the spigot #setpassenger buged off in 1.15

inland oxide
#

I don't know what you mean

#

i don't know what 'this.setpassenger' is referring to.

#

are you trying to do this.addPassenger(p) ?

#

@phnx isn't featherboard one of those premium plugins with support?

keen yoke
#

yes i just dont know how to get it plus its probably an error on my end i am not catching

sage summit
frigid ember
#

are you trying to do this.addPassenger(p) ?
@inland oxide yes,i want player to ride dragon

inland oxide
#

Well, check your logs, console for errors or exceptions. Usually if you fail on a config file it throws an error, if not try running the config.yml through an online YAML parser

keen yoke
#
lines:
  title:
    frames:
    - '&c&lS&4&limplyBuild'
- '&4&lS&c&li&4&lmplyBuild'
- '&4&lSi&c&lm&4&lplyBuild'
- '&4&lSim&c&lp&4&llyBuild'
- '&4&lSimp&c&ll&4&lyBuild'
- '&4&lSimpl&c&ly&4&lBuild'
- '&4&lSimply&c&lB&4&luild'
- '&4&lSimplyB&c&lu&4&lild'
- '&4&lSimplyBu&c&li&4&lld'
- '&4&lSimplyBui&c&ll&4&ld'
- '&4&lSimplyBuil&c&ld'```
#

thats what i do

#

and my output says

inland oxide
#

spacing is important

keen yoke
#

29/07/2020 05:24:29 [WARNING] The scoreboard group 'default' contains no lines! This will prevent the scoreboard from showing! Check if you have spaced the lines correctly. They should be under the 'lines: ' YAML section

inland oxide
#

need those spaces before the - on lines 5+

#

so they "line up"

keen yoke
#
lines:

  title:
  
    frames:
- '&c&lS&4&limplyBuild'
- '&4&lS&c&li&4&lmplyBuild'
- '&4&lSi&c&lm&4&lplyBuild'
- '&4&lSim&c&lp&4&llyBuild'
- '&4&lSimp&c&ll&4&lyBuild'
- '&4&lSimpl&c&ly&4&lBuild'
- '&4&lSimply&c&lB&4&luild'
- '&4&lSimplyB&c&lu&4&lild'
- '&4&lSimplyBu&c&li&4&lld'
- '&4&lSimplyBui&c&ll&4&ld'
- '&4&lSimplyBuil&c&ld'
interval: 3```
#

i did this

#

ill try it

inland oxide
#

if anything it's like this...

#
  title:
    frames:
    - '&c&lS&4&limplyBuild'
    - '&4&lS&c&li&4&lmplyBuild'
    - '&4&lSi&c&lm&4&lplyBuild'
    - '&4&lSim&c&lp&4&llyBuild'
    - '&4&lSimp&c&ll&4&lyBuild'
    - '&4&lSimpl&c&ly&4&lBuild'
    - '&4&lSimply&c&lB&4&luild'
    - '&4&lSimplyB&c&lu&4&lild'
    - '&4&lSimplyBu&c&li&4&lld'
    - '&4&lSimplyBui&c&ll&4&ld'
    - '&4&lSimplyBuil&c&ld'
interval: 3```
keen yoke
#

does everyone of my - have to line up?

#

i only sent the first quarter of it

inland oxide
#

YAML has a specific format so the spaces (indentations) are very important

keen yoke
#

want me to put my entire yaml in this chat?

inland oxide
#

each line will be indented appropriately for what level it's on. Items in a list denoted with the '-' are all on the same indentation level

#

no

#

?paste

worldly heathBOT
inland oxide
keen yoke
inland oxide
#

so throw it in the YAML parser, it will tell you where the errors are.

#

like line 7. It has

#

settings:

#

but probably should be

keen yoke
#

expected '<document start>', but found '<block mapping start>'
  in "<unicode string>", line 116, column 1:
    settings:
    ^```
inland oxide
#

settings: []

#

since it's a section, and empty.

#

do yourself a favor and read up on YAML formatting.

#

it's used in all the config files for plugins.

#

Its time well spent.

sage summit
keen yoke
#

thing is, right.. i know most of it and can do it for other plugins this one is just very confusing

inland oxide
#

@sage summit yeh, if I can't read the problem in 10 seconds from a link, you are making it hard for anyone to help you with your issue. Don't expect them to read a long post to solve your problem. If you can't concisely explain your problem here in Discord, perhaps you need to do more work on your end.

#

?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.

sage summit
#

whats long about it?

#

the post is very short

keen yoke
#

What is your issue

sage summit
#

i keep getting this error in my console when i run a command

keen yoke
#

im assuming youre trying to reload a plugin?

lone fog
#

No?

#

It looks like a command to reset a prison mine

sage summit
#

no, its just to reset a mine

keen yoke
#

hmph

sage summit
#

It looks like a command to reset a prison mine
yup

inland oxide
#

That probably means the PrisonMines plugin is not updated to use the API of the latest WorldEdit

keen yoke
#

or dosent even have an api

inland oxide
#

Or you don't even have WorldEdit

keen yoke
#

ok well i went to your plugins page on spigot.. you need to put a space between mine and reset the correct format is /Mine Reset <Name> - Reset a mine or every mine

lone fog
#

It’s throwing an illegalAccess error

keen yoke
#

so do /Mine Reset <NameHere>

sage summit
#

i have worldedit-bukkit-6.1.jar in my plugins folder

lone fog
#

And what version are you on

sage summit
#
<dependency>
            <groupId>com.sk89q.worldedit</groupId>
            <artifactId>worldedit-bukkit</artifactId>
            <version>7.2.0-SNAPSHOT</version>
        </dependency>
<repository>
            <id>enginehub-maven</id>
            <url>http://maven.enginehub.org/repo/</url>
        </repository>

thats in my pom file

keen yoke
#

sorry, mistake.. /Mine Reload

inland oxide
#

what version is that plugin expecting?

lone fog
#

That’s version 7

#

You have version 6

sage summit
#

oh

lone fog
#

Version 7 is 1.13+, version 6 is not

inland oxide
#

doh!

sage summit
#

🤦‍♂️

keen yoke
#

well now i feel like an idiot.. sorry i am very new to servers

sage summit
#

im new ish

inland oxide
#

yes, but at least you are entertaining.

sage summit
#

so just put 6.0.0 in my maven?

keen yoke
#

but you did /minereload not /mine reload for the record

#

just uhh. puttin.. puttin it out there

sage summit
#

its a command to test the mine reset

#

so just put 6.0.0 in my maven?

keen yoke
#

try it and reload.. let us kno

sage summit
#

k, also whats better, maven or gradle?

keen yoke
#

try maven since the repo says maven

#

update us @sage summit

sage summit
#

reloading the maven thing now

lone fog
#

I’m pretty sure they know the command syntax

#

Since they you know... made it

keen yoke
#

just uhh.. puttin- puttin it out there

sage summit
#

Putin

inland oxide
#

Putin on the Ritz

sage summit
#

Vladimir Putin

keen yoke
#

I was watching family guy today and i opened mc to test plugins cause im terrible at it and it said peter griffin as the splash text and i got creeped out

sage summit
#

lol

inland oxide
#

spash text is AI tied into google.

keen yoke
#

wait fr

sage summit
#

no

#

it gets the text from a file

#

you can edit it in texture packs

keen yoke
#

ooh so i can make it say offensive stuff

sage summit
#

yup

inland oxide
#

its client side

keen yoke
#

so did you get your problem fixed?

sage summit
#

i rick rolled my friend with a texture pack once

inland oxide
#

no

lone fog
#

I mean technically you can send a texture pack on your server

#

But it’ll be unloaded before you get back to the main menu

sage summit
keen yoke
#

no. i meant for myself.. why would i make it say offensive stuff and possibly lose my playerbase

lone fog
#

That’s fair

#

I just send it to everyone with /title instead

inland oxide
#

ok, back to being a help channel

keen yoke
#

@sage summit are you by any chance. hear me out.. running a bukkit version of w/e and a spigot version of the prisons? vise versa

lone fog
#

It’s the same thing

#

All bukkit plugins will run on spigot

keen yoke
#

WAIT so i can use spigot and bukkit plugins..

#

my life... is forever changed

lone fog
#

Yes

sage summit
#

paperspigot server and spigot plugin

lone fog
#

I mean we don’t support paper

#

But I doubt it matters in this case

keen yoke
#

not tryna buy a $8 plugin that ill never use..

#

doom. is your server open to the public?

sage summit
#

yes

keen yoke
#

does it autoreset mines?

sage summit
#

no

#

its just the code i sent

#

might just use an already made plugin for mines for now...

keen yoke
#

you should probably autoreset your mines rather than having to manually go in and reset them

sage summit
#

the command is just for testing...

keen yoke
#

kluge typing out the holy bible rn..

sage summit
#

lol

inland oxide
#

TextComponent.fromLegacyText takes a String and breaks that string into an array of BaseComponents that are json formatted. Since color formatting codes would be equivalent to json those get converted into json color tags. But the problem is that if you break it into BaseComponents it seems to strip out any resets and causes a break at that point. Say I have some legacy formatted text with a reset in the middle, then it would make two components and remove the reset. So is it safe to assume that each component is standalone from a formatting perspective when this method is used?

keen yoke
#

ill pretend i know what that means and agree

sage summit
#

ok so now when i change the maven dependency it just says "Cannot resolve com.sk89q.worldedit.worldedit-bukkit:worldedit-bukkit:6.0.0-SNAPSHOT"

inland oxide
#

Furthermore, say I take all those components and append them in a new ComponentBuilder. Then later I'm converting them back with toLegacyText, the issue is that without the reset in there, it's considering each part of the BaseComponent[] as inheriting the format from the previous. So, the reset is removed, and if there was a bold in the first component, it's now showing up in the second component as well when converted with toLegacyText.

#

So, fromLegacyText is treating reset as a place to make a break, implying that breaks are same as reset. But toLegacyText does not have that same behavior.

#

This in my view is a bug.

pastel condor
#

anyone know how I can clone an item stack? ItemStack itemToTest = item.clone(); doesn't seem to work.

#

I get a npe

inland oxide
#

?paste

worldly heathBOT
inland oxide
#

show the code and the NPE

#

npe usually means your item might be null.

sage summit
pastel condor
inland oxide
#

so test item is not null

pastel condor
#

it shouldn't be

#

but kk

#

oh it actually might

inland oxide
#

then somewhere else in the code it's possible for it to be passed as null

#

which for ItemStack is pretty common

strong lantern
#

is there a way to send a message from the spigot server to the proxy bungeecord server?

#

so I can warp players when they trigger an in game event

#

PLS HELP

#

?help

inland oxide
#

@sage summit is it private?

strong lantern
#

like wat do u mean by that

inland oxide
#

Is it public in the API?

strong lantern
#

oh nvm

#

oh

#

wait u answering my question?

inland oxide
#

Yes, you can send a message from a spigot server to bungeecord with the Plugin Messaging if there are users

sage summit
#

is what private?

inland oxide
#

well info

strong lantern
#

how

inland oxide
strong lantern
#

wait how can I send a message to the proxy?

sage summit
strong lantern
#

oh wait

#

🤦 I'm dumb

#

tysm

inland oxide
#

Suppose BukkitAdapter is pretty common

sage summit
#

I think the problem was that i was making a 1.16 plugin go into a 1.8 server though

#

so was making the plugin on 1.16, code was for 1.16 minecraft and server was 1.8 with 1.8 worldedit

#

...

inland oxide
#

Your end result is for 1.8?

sage summit
#

yup

#

completly forgot it was 1.8

inland oxide
#

Also, typically you check the plugin manager if the plugin exists and make it a soft dependency

#

then if it exists, you try to get the WorldEdit instance.

sage summit
#

would it still work though?

inland oxide
#

1.8 is really old. So, newer versions of WE don't support

#

You have to target for an earlier version of WE

#

and the API has evolved too.

sage summit
#

yeah, 1.14+ or whatever though is to laggy and takes to much ram

inland oxide
#

First part is to make sure you are building the plugin with the proper WE dependecies

sage summit
#

i could do 1.12 max

inland oxide
#

Lemme look in my bag o' plugins for older versions to see

#

1.8.8 would be WorldEdit 6.1.9, WorldGuard 6.2

#

might be newer that supported for 1.8.8, but lets say 6.1.9

#

Wait, might be even earlier

#

1.12.2 had WG 6.2.2.

sage summit
#

might just do 1.8 for now

strong lantern
#

wait so pluginMessages can be used to send data from spigot to bungeecord

sage summit
#

might just start from the basics again with the plugin

#

so basically i just want to spawn a pattern in a certain area, what is the best way to do this? 1.8 btw

inland oxide
#

Yeh, 6.1.9 was last to support all up to 1.12.2

strong lantern
#

WorldEdit 6.1.9

inland oxide
#

of blocks?

sage summit
#

pattern example, 50% stone, 10% diamond, 20% gold and 20% iron?

pastel condor
inland oxide
#

um, write some code that sets the block at the location?

#

literally could iterate over the x, y, z and based on randomness, place from those items.

#

or is there an actual layout pattern?

sage summit
inland oxide
#

@pastel condor did you try taking String out of new ArrayList<String>(); ?

pastel condor
#

My bad, I forgot to say I solved the problem. I had to provide a specific array type in .toArray() (I did .toArray(new String[myList.size()]) )

inland oxide
#

Oh, maybe my issue is in how ComponentBuilder is appending.

#

fromLegacyText will strip &r and force a component break, so maybe I need to specify FormatRetention.NONE when appending.

#

ComponentBuilder() is not a constructor?

#

what if I want to start with nothing and append?

#

That has to be a bug.

frigid ember
#

hey how to save resource folder world desert to server worlds container?

inland oxide
#

weird and no remove in ComponentBuilder either, is the one is Spigot limited?

#

or did those get added since 1.13?

rare prairie
#

ComponentBuilder is bungee related, so you should add bungeecord-chat as a dependency to your project

#

or atleast a bungeecord-api

inland oxide
#

one would think that having spigot as a dependency would solve that problem

#

I mean most of the methods are showing

#

oh, Bungee is on 0.4 now.

raw light
inland oxide
#

doesn't sound too fun.

river cradle
#

Hi there, I'm failing to import WorldEdit using Maven, I've asked in the WorldEdit discord and everything seemed to be right, but still I'm getting a "missing artifact" error...

<dependency>
  <groupId>com.sk89q.worldedit</groupId>
  <artifactId>worldedit-bukkit</artifactId>
  <version>7.2.0-SNAPSHOT</version>
  <scope>provided</scope>
</dependency>
rare prairie
#

do you have repository added to maven?

river cradle
#

You mean my repository? Erm, I don't think so?

rare prairie
#

no, the worldedit repository

#
<repository>
  <id>sk89q-repo</id>
  <url>http://maven.sk89q.com/repo/</url>
</repository>
river cradle
#

Oh no I don't think I have that in there

#

Where do I add that?

river cradle
#

Ohhh thank you, I think that worked!

#

Just curious, why can I add other plugins just by a <dependency> and do I have to use a <repository> specifically for WorldEdit?

open ibex
#

Which other plugins?

#

Most plugins need their own repository unless you use jitpack

river cradle
#

Really? Perhaps I have been doing something really wrongly this entire time

#

And it seems like it because it can't find half of my bukkit references and now I have 80 errors...

open ibex
#

Bukkit needs a repo too

river cradle
#

Yeah, I just added it... But I don't think it did anything?

open ibex
#

Did you refresh

river cradle
#

Yeah, I did

dusky sigil
#

So.. Can I do this?

#
   MemberNamesAll = cfgtotal.getStringList("players");
   MemberNamesAll.remove(p.getUniqueId().toString());```
#

lets say that the ArrayList "players" contains the players UUID

#

This doesnt work though

river cradle
#

@open ibex It seems like the things it can't find are mostly NMS stuff, could it be that I have to add this to maven too?

sage summit
open ibex
#

You can't include nms from online but you do need to include it from the files buildtools made

#

Not sure how to do that in Maven since I use Gradle

river cradle
#

Man I wish I just stuck to a default Java repository, Maven is just such a pain

open ibex
#

Maven central is the main Maven repo but it doesn't contain everything

dusky sigil
#
int xvalue = ThreadLocalRandom.current().nextInt(min, max + 1);
int zvalue = ThreadLocalRandom.current().nextInt(min, max + 1);
GeneratedLoc = loc.clone().add(xval, 0, zval);
(spawn an entity)
``` repeat this for how much mobs you have. @sage summit . Thats my way of doing it anyways.
#

Or.. you dont wanna use mobs

#

I think you would need to use worldedit

#

or something

sage summit
#

not exactly what i was asking sorry, my fault, should have been more clear

#

could be useful for another plugin though

inland oxide
#

Why is it that the jar for spigot has the ComponentBuilder() constructor, yet, can't seem to use it when I have spigot as a dependency?

river cradle
#

Help, does anyone know how I can add NMS via Maven?

#

I've succeeded adding Spigot but all my NMS things are giving errors now...

inland oxide
#

oh, seems like the constructor is a 1.15+ spigot thing

#

makes me want to shade in the chat api

tough kraken
#

why is this still giving a nullpointer? lol

if (Main.getPlugin().getProxy().getPlayer(args[0]) != null) {
                        ProxiedPlayer target = Main.getPlugin().getProxy().getPlayer(args[0]);
                        Main.config.set(args[0], target.getName());
                        player.sendMessage(ChatMessageType.CHAT, new TextComponent("§aDu hast §7" + target.getName() + " §aden Rang §b" + args[0] + " §azugeteilt"));
                    } else {
                        player.sendMessage(ChatMessageType.CHAT, new TextComponent("§cDieser Spieler ist nicht online!"));
                    }
rare prairie
#

you sure? can we see that NPE line?

tough kraken
#

fixed it, this did it:

try{
                        ProxiedPlayer target = Main.getPlugin().getProxy().getPlayer(args[0]);
                        Main.config.set(args[0], target.getName());
                        player.sendMessage(ChatMessageType.CHAT, new TextComponent("§aDu hast §7" + target.getName() + " §aden Rang §b" + args[0] + " §azugeteilt"));
                    } catch (NullPointerException exception){
                        player.sendMessage(ChatMessageType.CHAT, new TextComponent("§cDieser Spieler ist nicht online!"));
                    }
#

btw im so dumb, why am i setting the player the rank "target.getName" wtf

rare prairie
#
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
if (target != null) {
  //here your code
}
#

would better than ignoring exception

tough kraken
#

thanks

frigid ember
#

anyone help me

sturdy oar
#

Anyone knows how do i set keepalive packet timeout millis on spigot server?

#

It usually defaults to 30000ms but I'd need to lower it for developing purposes

chrome lark
#

you can't

sturdy oar
#

bruh

chrome lark
#

it's basically hardcoded in spigot

sturdy oar
#

so i need to fork Spigot?

chrome lark
#

Yes

sturdy oar
#

does pa***r allow to modify it?

tiny dagger
#

doubt

sturdy oar
#

rip me

chrome lark
#

yes

frigid ember
#

kicked

#

Poper is not cool

fading frost
#
ItemStack item = new ItemStack(Material.SKULL);
net.minecraft.server.v1_8_R3.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
```this code is compiled against spigot 1.8.8. How come that in newer versions (i.e. with legacy materials) the nms copy is of type air?
bold anchor
#

Only use that on 1.8

fading frost
#

the obfuscated package thing is not the issue. I have a solution for that

#

(and this solution works)

grim halo
#

Show us your abstraction layer and how you implement them in both nms versions.

fading frost
#

my abstraction layer?

#

I replace the nms types at runtime

#

I can do the same in a non-legacy version by giving it LEGACY_SKULL directly, if you'd like

grim halo
#

So... you get the classes via reflections?

fading frost
#

No

#

This is my actual code

#

I use a java agent to manipulate the bytecode

sage summit
#

What's better, gradle or maven?

fading frost
#

Anyway, this isn't related to the question, really. This should be equivalent:

ItemStack item = new ItemStack(Material.LEGACY_SKULL);
net.minecraft.server.v1_15_R1.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
grim halo
#

Ok. So i think your problem could be the specified API version. This decides if the server uses legacy materials.

bold anchor
#

Don't use legacy skull

#

If you are compiling against 1.15 you should use the appropriate material

fading frost
#

I am compiling against 1.8.8, as I said

#

This is just a demonstration of what it's like at runtime

#

Ok. So i think your problem could be the specified API version. This decides if the server uses legacy materials.
@grim halo I don't specify an API version because I'm using the legacy stuff

#

do I have to use SKULL_ITEM instead of SKULL?

#

I just tried that, that always gives me a skeleton head though and seems to ignore the texture nbt tags I've set

grim halo
#

@sage summit It depends on what you are doing. Forge modding is impossible without gradle and in the spigot plugin community maven is more common.

fading frost
#

And how did you solve it @proud furnace ?

sage summit
#

So maven is better for plugins?

mental girder
#

hi I´m looking for someone who could help me test something really quick

tiny dagger
#

maven is a build tool

#

why would it be better for plugins? 🤔

fading frost
#

yeah but were you able to set custom textures

mental girder
#

I think you need to set the pwner in the meta data

fading frost
#

there is no owner

mental girder
#

that´s why shows as a skeleton skull

fading frost
#

yeah ok this is not what I'm looking for

grim halo
#

You can also use gradle for maven dependencies. But i would recommend maven if you write spigot plugins.
Especially since mcdev uses Maven.

sage summit
#

Ok thanks

fading frost
#

that´s why shows as a skeleton skull
@mental girder no, the same code works when I compile it against a non-legacy version and use PLAYER_HEAD

#

But I want it to be compatible with legacy

bold anchor
#

You gotta set the data of the legacy shit

#

ItemStack(SKULL_ITEM, 1, 3) or smth

mental girder
#

so does anybody here have a minute to help me test something on my server really quick?

#

I don´t have two accounts so i can´t test this alone

#

nobody?

#

😭

fading frost
#

You gotta set the data of the legacy shit
@bold anchor that did the trick, tysm!

chrome lark
#

mcdev supports gradle too, and even pushed it by default

#

Why are you trying to use legacy crud on 1.15?

fading frost
#

because I want the plugin to be compatible with all versions

frigid ember
#

hey how to save resource folder world desert to server worlds container?

bold anchor
#

Zip it, and then saveResource(myZip.zip)

#

then unzip it afterwards

vernal spruce
#

so does anybody here have a minute to help me test something on my server really quick?
@mental girder friendly unofficial reminder,i hope you know some of us dont have enough accounts to test some things yet we still do

mental girder
#

what do you mean?

vernal spruce
#

not gonna go further with that

mental girder
#

I have no idea what you´re talking about

#

I made plugin and I want to see if it´s working for which I need two minecraft accounts

#

I tried to make colors of others teams change depending if it´s the same team as the player is in

fading frost
#

I have another question. In 1.16.1, uuids in nbt tags aren't encoded as strings anymore it seems, but like this:
[I;-881931878,-2050407983,-1710726587,1666472278]
Am I correct in assuming that the 4 numbers are 32 bit each, going from most significant to least significant bits of the uuid?

frigid ember
#

@bold anchor it creates it in the plugins folder and I need to world container folder (main folder server)

bold anchor
#

use the javadoc

mild nebula
#

Good morning! How long does it usually take for a spigot plugin to get approved?

mellow wave
#

@fading frost

Int-array: A separation into four 32 bit numbers. Each part is stored in an integer array ordered from most significant to least significant.
An example of this representation would be [I;-132296786,2112623056,-1486552928,-920753162]

Quoted from the minecraft wiki

grim halo
#

@fading frost Yes. Its actually a int array. The order should be msb->lsb

bold anchor
#

There is a method that is literally named getWorldContainer

fading frost
#

All right, thank you

grim halo
#

So you can just use the UUID constructor that takes two longs and do a bit of byte shift/ bitwise or. You probably know.

frigid ember
#

@bold anchor how to move it directly there and not in the plugins folder?

fading frost
#

Yeah, thanks.

bold anchor
#

Just move it afterwards

grim halo
#

@frigid ember You can traverse a jar file just like a regular file system

frigid ember
#

@grim halo example pls

grim halo
#

Wait a min i got something that builds my resourcepack from my jar... brb

fading frost
#

Isn't there a saveResource method?

#

Oh you mentioned it

grim halo
#

Yes but he wants it directly copied into the worlds folder

bold anchor
#

he can just move it after

#

tell him to stop being dumb¨

grim halo
fading frost
#

I would also zip it and unzip it after saving

frigid ember
#

@grim halo what is class?

grim halo
#

Here. This way you can save a folder from inside your jar to a new path

frigid ember
#

FileUtils ?

fading frost
#

The writeToFile method is somewhat redundant

#

There is Files.copy

grim halo
#

No thats my personal IOUtils class

spring arch
#

the heck

alpine yoke
#

hey, can anyone tell me why this doesnt work?
String motd = ProxyServer.getInstance().getServerInfo(entry.getKey()).getMotd();
entry.getKey() is a string with server

spring arch
#

provide the error?

alpine yoke
#

well, its nothing

spring arch
#

nothing what

alpine yoke
#
                            String motd = ProxyServer.getInstance().getServerInfo(entry.getKey()).getMotd();
                            msg += ChatColor.GREEN + "online (" + motd + ")";
                        }```
#

i have this

#

and it shows online ()

#

in game

spring arch
#

well motd is empty

#

iirc it's set in bungeecord's yml

#

and it does not ping the server

heavy steeple
spring arch
#

if you want to get actual motd - you need to ping it

alpine yoke
#

however if I do getPlayers and make the motd thingy a collection then it shows players

#

ok, let me try

#

any ideas how? xd

spring arch
#

ServerInfo#ping?

#

even tho api is terrible with all these callbacks

#

@heavy steeple may be clientside bug?

#

@alpine yoke plus please use StringBuilder

heavy steeple
#

@heavy steeple may be clientside bug?
@spring arch Any ways to solve ?

spring arch
#

uhh i don't know lol

frigid ember
spring arch
#

how did it happen it the first place?

#

@frigid ember what do you want to do

#

unzip or?

frigid ember
#

@spring arch first, I want to move it to the server folder

spring arch
#

and then?

frigid ember
#

unzip

grim halo
#

@frigid ember If you want to do it this way you should use JavaPlugin#saveResource()

spring arch
#

you don't need to move it to server's folder

frigid ember
bold anchor
#

...-

spring arch
#

if you want to copy

    public void copy(String resource, Path dest) {
        try (FileSystem fs = FileSystems.newFileSystem(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI(), Collections.emptyMap())) {
            Path source = fs.getPath(resource);
            Files.copy(source, dest, StandardCopyOption.REPLACE_EXISTING);
        }
    }
#

if you want to unzip

#

well gimme a sec

crimson sandal
spring arch
#
    public void copy(String resource, Path dest) {
        try (FileSystem fs = FileSystems.newFileSystem(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI(), Collections.emptyMap())) {
            Path source = fs.getPath(resource);
            try (FileSystem zip = FileSystems.newFileSystem(source.toUri(), Collections.emptyMap())) {
                Files.walkFileTree(zip.getPath("/"), new SimpleFileVisitor<Path>() {
                    @Override
                    public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
                        Files.createDirectories(dest.resolve(source.relativize(dir)));
                        return super.preVisitDirectory(dir, attrs);
                    }

                    @Override
                    public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
                        Files.copy(file, dest.resolve(source.relativize(file)), StandardCopyOption.REPLACE_EXISTING);
                        return super.visitFile(file, attrs);
                    }
                })
            }
        }
    }
#

That will unzip everything without copying to the disk

#

ofc you can do like

frigid ember
spring arch
#
    public void copy(String resource, Path dest) {
        try (ZipInputStream zip = new ZipInputStream(Test.class.getResourceAsStream("/" + resource))) {
            ZipEntry entry;
            while ((entry = zip.getNextEntry()) != null) {
                Files.copy(zip, dest, StandardCopyOption.REPLACE_EXISTING);
            }
        }
    }
frigid ember
spring arch
#

try the code above

#

prev one works for me just fine

#
    public void copy(String resource, Path dest) {
        try (ZipInputStream zip = new ZipInputStream(Test.class.getResourceAsStream("/" + resource))) {
            ZipEntry entry;
            while ((entry = zip.getNextEntry()) != null) {
                String name = entry.getName();
                Path path = dest.resolve(name).toAbsolutePath();
                Path parent = path.getParent();
                if (parent != null && !Files.isDirectory(path)) {
                    Files.createDirectories(parent);
                }
                Files.copy(zip, path, StandardCopyOption.REPLACE_EXISTING);
            }
        }
    }
frigid ember
#

Hey I Have an basic question how can i make plugins suppport for a plugin

spring arch
#

provide an API?

frigid ember
#

@spring arch expection

spring arch
#

that's clearly explains the error

frigid ember
#

this code is correct?

grim halo
#

@frigid ember Your question could be interpreted in numerous ways
Do you want to support other plugins or do you want to provide something that other plugins could hook into?

spring arch
#

yes

#

even tho you can do File#toPath()

frigid ember
#

smt like modules

spring arch
#

oh ofc

frigid ember
#

do you know how to get classes from jar.

native frost
#

Sorry for the interruption, but I have a simple-ish question that I don't know the answer to: To check if a player has flint in their inventory, I'm using plr.getInventory().contains(Material.FLINT). Is there a way to get the ItemStack that was picked up by contains()?

frigid ember
spring arch
#

@frigid ember
add this check

        while ((entry = zip.getNextEntry()) != null) {
                if (entry.isDirectory()) {
                    continue;
                }
#

╧ЁюЎхёё эх ьюцхЄ яюыєўшЄ№ фюёЄєя ъ Їрщыє, Єръ ъръ ¤ЄюЄ Їрщы чрэ Є фЁєушь яЁюЎхёёюь

#

are you russian or something

frigid ember
#

@frigid ember Your question could be interpreted in numerous ways
Do you want to support other plugins or do you want to provide something that other plugins could hook into?
@grim halo i want to make diffrent modules for my plugin.

#

@spring arch maybe

spring arch
#

well me too

#

we can go dms

#

lol

native frost
#

anyone got an answer for my q .w.?

frigid ember
#

@grim halo Do you know how can i do that

#

Like how spigot runs plugins.

spring arch
#

@native frost no iirc

#

but

#

you can do Inventory#first(Material)

#

it will give you the slot if there is any, otherwise -1

#

and then u can get an item from a slot

native frost
#

Oo a'ight that works. thanks

grim halo
#

@frigid ember Thats a buit vague. You can write your own classloader and load them on startup for example,

frigid ember
#

I dont know this deep english "buit vague." but okey

spring arch
#

can't you just add them to a classloader of your own plugin

#

lol

#

so they don't stay loaded when ur plugin gets disabled

grim halo
#

Thats probably better. You can also unload them yourself in the onDisable

spring arch
#

if you use another class loader - other plugins wont be able to access it

frigid ember
#

thanks for the idea i will try

spring arch
#

that's how bukkit works

#

¯_(ツ)_/¯

grim halo
#

I thougth he wanted to have smaller sub plugins for himself.

frigid ember
#

one more question do you know how i can do for each for files in a folder.

spring arch
#

File#listFiles()

frigid ember
#

okey thanks.

spring arch
#
        File dir = null;
        dir.listFiles(pathname -> pathname.getName().endsWith(".jar"));
inland oxide
#

ok, well today's been quite the learning experience.

frigid ember
#

How do you add text when a player hovers over a message?

#

I forgot

#

:/

rare prairie
#

json

spring arch
silver basin
#

Hi ho spigotans, question regarding iteminteractevents specifically when placing a book on a lectern - the item interact event fires .... and I assume if successful follows with a block place event. the questio is when you interact the item in your hand is a book - but wierdly the item.type is AIR?

bold anchor
#

use minimessage or minedown

silver basin
#

is that a bug

#

here is a quick snip of a debug paused at the interact event

#

Why is the type air at this point

bold anchor
#

Did you specify api-version?

silver basin
#

you mean in the plugin.yml yes ...1.16

#

also mine is the only plugin running - its a test server

#

you can see in the debug as well the qty is 0

#

its like the handle hasnt been populated into the parent itemstack

bold anchor
#

Post it on jira

silver basin
#

I am listening at the highest priority

#

...yeah ok

bold anchor
#

unless some other event is setting it of coruse

silver basin
#

Prism is a pure monitor - its just suppose to log actions

#

...so it doesnt modify events at all

bold anchor
#

Highest runs first

#

wait nvm

silver basin
#

bugger thought I might have had it

#

....I checked the event.getItem() as well - it suffers the same problem

frigid ember
#
        Inventory inventory = Bukkit.createInventory(null, 54, "HelpopGUI");
        plugin.getGUIHashMap().
        player.openInventory(inventory);```
So I need to get info out of the hashmap cuz I need to store all Helpops into a gui
I thought .get(player.getUniqueId) but that doesnt make sence, it'll only get the info of that player if present
but I need to get all info of all players
#

hashmap is storing UUID, String

wise flame
#

just do a for(Entry<UUID, String> entryName : plugin.getGUIHashMap().entrySet()){
}

#

@frigid ember Dunno if you took that advice, but I meant for, not foreach

frigid ember
#

ikr

#

:p

#

thanks

#

in bukkit, how to make falling block pushed to air ??

wise flame
#

Can you explain exactly what you mean?

frigid ember
#

nvm got it sorry for the ghost tag skyy

#

Does anybody know why my Hibernate ORM classes can't be found?

#
[08:04:15] [Server thread/ERROR]: Error occurred while enabling nationsatwar v1.1 (Is it up to date?)
java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
        at net.mcnations.nationsatwar.PluginMain_Load.onEnable(PluginMain_Load.java:31) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:351) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-1.16.1.jar:git-Spigot-0509002-6b95d59]
        at java.lang.Thread.run(Thread.java:830) [?:?]
Caused by: java.lang.ClassNotFoundException: org.hibernate.cfg.Configuration
#

apparently the Configuration class can't be found? I have it defined in my maven dependencies... so it should be able to see it

grim halo
#

Whats the dependency scope?

frigid ember
#
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.4.18.Final</version>
            <scope>provided</scope>
        </dependency>```
grim halo
#

Provided means that someone else provides it on runtime. Use shade to shade it into your project

frigid ember
#

ugh

#

I have to download its jar?

sturdy oar
#

No

#

You need to use maven shade plugins

grim halo
#

No. Maven does it for you.

frigid ember
#

I'm not familiar with shading then

#

I thought that was simply adding the jar to your project & referencing it through the build path

grim halo
#

Thats why you use maven. So you dont have to downlaod anything yourself.

sturdy oar
#

ANT 🤢 🤮 🤮 🤮 🤮

frigid ember
#

Well let me look up Maven shading then

#

Is there an easy way to do this?

grim halo
#

Yes. Wait

#
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.2</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createDependencyReducedPom>false</createDependencyReducedPom>
            </configuration>
          </execution>
        </executions>
      </plugin>

This in <build><plugins>

#

Then remove the scope. Shade is the default