#help-development

1 messages · Page 1798 of 1

torn shuttle
#

can you tell I'm getting tired of debugging this

ancient plank
#

oh shit I'm feeling it

torn shuttle
#

TACHYOOOON

ancient plank
#

TACHYOOOOOOON

#

BITCONNEEEEEEEEEEEEHHH

ember estuary
#

xD

lavish hemlock
#

most of the time my debug is just

#

"meme school"

#

or

#

"fuck"

#

I am very joyous when I see fucks

ancient plank
#

mine are just me counting up

torn shuttle
#

may your day be full of bliss and fucks

ancient plank
#

1 2 3 4 5 6 7 8 9 10 11 12 134 145

torn shuttle
#

i usually also count up tbh

ember estuary
#

wait, is spigot made ontop of bukkit?

lavish hemlock
#

yes

#

it's a fork

ember estuary
#

and md_5 didnt make bukkit?

lavish hemlock
#

nope

ember estuary
#

Oh, so then he just stole the characters

#

sorry for the ping

#

xD

lavish hemlock
#

not really

#

Bukkit is licensed under GPL

ember estuary
#

i mean took

#

he didnt make them himself is what i mean xD

waxen plinth
#

Have you never heard of open source

ember estuary
#

i have ofc

#

couldnt have forked it if it wasnt open source

#

anyone knows the @ of whoever made bukkit?

ember estuary
#

xD

#

good one

torn shuttle
#

now just picture a line of astronauts pointing guns at each other that spans over hundreds of astronauts because they keep forking each other

lavish hemlock
#

Bukkit should be deleted from this planet

#

the worse part of Spigot is Bukkit :p

ember estuary
#

xD

trail pine
#

Hey, it is possible to run 1.18. spigot server? Now?

trail pine
#

and how ? or link for server?

lavish hemlock
#

this conversation has been going on for hours in #general

torn shuttle
#

how's that 1.18 performance btw

#

do we have early reports?

lavish hemlock
#

eh it runs fine for me ig

#

oh do you mean server-wise?

ember estuary
#

lol in the bukkit discord they announce the new spigot versions

#

imagine announcing the new paper versions in the spigot discord

torn shuttle
#

we'd get a notification every couple of hours

ember estuary
#

x'D

torn shuttle
#

you think that's a joke, you just wait to see how quickly early builds get replaced

ember estuary
#

haha

lavish hemlock
#

I'm supposed to be working on things that nobody will use but I'm too busy reading this server's messages :p

torn shuttle
#

I'm supposed to be working on things that thousands of people will use but I am too busy memeing about my debug messages

#

I didn't even get console to print tachyon

#

today is a sad day

#

guess I need to review my quest queueing system

hoary pawn
#

isnt that just getLogger().info(something)

torn shuttle
#

what is?

hoary pawn
#

for the console to print stuff

torn shuttle
#

that's one way to do it

hoary pawn
#

it is

torn shuttle
#

I mean it didn't output tachyon because the code isn't running because I messed something up, not that getting console to print something is the challenge in the first place

hoary pawn
#

ahh

hoary pawn
#

simple

torn shuttle
#

what a novel concept, I was just going to put it in cold storage and see if it fixes itself

hoary pawn
#

that does sometimes work aswell

tender shard
#

it's on the overview page and so applies to every event^^

#

yeah but fortunately, they already fixed it. it was bug in their lib that set a player's maxhealth to 0 after they died

torn shuttle
#

oh that

#

honestly the death events are really weird and finnicky

iron palm
#

what are the nms installation steps
Im trying to import it to my pom.xml for 6 hours and i cant do that

iron palm
torn shuttle
#

not to be mean but if you couldn't figure out how to get nms to even get setup in under 6 hours maybe you should stick to the api for now, nms is one hell of a rabbit hole

timid spear
#

How do I compile against NMS with the 1.18 build? The jar file is totally different?

#

I don't want to rewrite the whole plugin to not use NMS

iron palm
quaint mantle
#

rewrite the whole plugin to not use nms

iron palm
#
   <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.16.5-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>```
timid spear
#

@quaint mantle No. I will not do that!

iron palm
#

I can only use
1.9
and
1.8

quaint mantle
#

If there's an api for stuff you did with nms you SHOULD really use the api

#

otherwise, just run buildtools like you did before

iron palm
timid spear
#

@quaint mantle The jar file is totally different. How do I make plugins like that? I can't just import the spigot-1.18.jar into my IDE.

torn shuttle
#

well you know my plugin, I'll tell you right now I do not use any nms @iron palm

torn shuttle
#

yes

#

you can read the source code yourself

iron palm
#

Ok

timid spear
#

@quaint mantle Any recommendation?

quaint mantle
#

Gradle or maven

torn shuttle
#

gradle > maven

timid spear
#

I do not make plugins with gradle/maven.

torn shuttle
#

now's a good time to start

timid spear
#

._.

torn shuttle
#

once you pop you can't stop

timid spear
#

Also I always use Eclipse and not IntelliJ or else

quaint mantle
#

ok

timid spear
#

All my recent projects do not rely on gradle/maven

quaint mantle
#

migrate them

torn shuttle
#

using eclipse is how you end up like Choco, do you want to end up like Choco?

young knoll
#

He has a girlfriend

#

So yes

eternal oxide
#

Eclipse and maven work well together

lavish hemlock
#

nobody wants to end up like Choco

lavish hemlock
lapis lark
#

since 1.18 all nms methods are obfuscated? Or i use incorrect import jar or something else?

quaint mantle
#

eclipse works with gradle aswell

#

oops

young knoll
#

I keep getting ads from jet brains

lapis lark
#

Whats that

quaint mantle
#

yes they're obfuscated

timid spear
#

I maybe have found a solution that works for me

young knoll
#

They were obfuscated in 1.17 too

quaint mantle
#

use a proper build tool
use a proper build tool

lapis lark
mortal hare
#

is the bug or what but whenever I add module in intellij project Maven files from Resources folder of main artifact are never included in output jar file

#

After removing module problem still persists

timid spear
#

I'll try using that jar file for making the plugin

mortal hare
#

it basically does not include plugin.yml

#

even if the file is already inside resources folder

quaint mantle
#

||use proper build tool||

lavish hemlock
#

Hey kids, it's time to learn the use proper build tool song!

use proper build tool
use proper build tool
use proper build tool

context: vocals slowly getting lower pitched every line

mortal hare
#

wdym im using maven

#

how is that not a proper build and deployment tool

lavish hemlock
#

not you.

#

X0R3

timid spear
#

I can't hear it anymore...

#

Don't expect me to change to gradle/maven. Just stop it.
I want "proper" help or at least an answer.

quaint mantle
#

how would we help you if you're doing things completely wrong?

timid spear
#

Not everyone uses gradle/maven, @quaint mantle :/

lapis lark
#

Come on

quaint mantle
#

everyone does, thats the common practice

lapis lark
#

All methods are obfuscated

#

java.lang.NoSuchMethodException: net.minecraft.world.item.ItemStack.getTag()

torn shuttle
#

everyone doesn't, but anyone can

quaint mantle
#

like, everyone who somehow decent at development

timid spear
#

wow.

lusty cipher
#

theres no reason not too switch anyway

timid spear
#

Atleast give me a quick startup on what I have to setup for the base of my plugin. For example the pom.xml file that I have to predefine. If you could be so kind and provide me with the content of that as a paste?

I am sure I can figure out the rest and pretty much copy paste my code inside.

#

As I want to use the 1.18 with Java 17 (for the plugin)

torn shuttle
timid spear
#

Dependency 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT' not found

#

<dependencies> <dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot-api</artifactId> <version>1.18.1-R0.1-SNAPSHOT</version> <scope>provided</scope> </dependency> </dependencies>

Is that wrong?

torn shuttle
#

slow down

#

we just got to 1.18

#

where are you getting the .1 from

timid spear
#

facepalm

#

okay xD

torn shuttle
#

damned zoomers, zooming at lightspeed through versions

spare marsh
#

Question, if I use a completablefutur and use the r .complete() method, would it block? Let’s say I apply A timer somewhere in there

timid spear
#

That should be correct now?

<dependencies> <dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot-api</artifactId> <version>1.18-R0.1-SNAPSHOT</version> <scope>provided</scope> </dependency> </dependencies>

#

As it does not throw out errors

torn shuttle
#

I, the human xml format parser, have concluded it is valid and therefore if it fails to work when you actually use it just let your computer know it is wrong and then set it on fire

#

that's how I do my code and it has never let me down before

timid spear
#

okay then

#

Excuse me: Thank you **Human XML Format Parser™ **!

torn shuttle
#

That's Human XML Format Parser!(TM) to you

#

better

#

don't tread on my trademark

timid spear
#

Your unregistered trademark? 😄

torn shuttle
#

I like my trademarks like I like my hypercam 2s, unregistered

timid spear
#

Can relate 😄

torn shuttle
#

here I spent so much time wondering why my quests were not tagged as accepted when I was pulling them from the database, kids remember to save things to the database AFTER you modify them

tacit drift
#

has anyone used vault to check permissions for offlineplayers?

eternal oxide
#

offline players have no permissions

timid spear
#

How do I add multiple spigot versions into that maven?

tacit drift
fast onyx
#

how i can launch a firework?

#

i tried that

#

but is not working

vernal sonnet
#

How do I get the org.bukkit.craftbukkit.v1_18_R1.* stuff for imports with buildtools? My .jar only has META-INF and org.bukkit.craftbukkit.bootstrap

#

I ran buildtools --rev 1.18

tardy delta
fast onyx
#

yes

#

what do you mean?

quaint mantle
worldly ingot
# fast onyx

You just have to spawn the firework. Though you also have to set its power so that it actually travels. Seriously advise making use of World#spawn() and the Consumer to edit the Firework before it spawns

world.spawn(spawnLocation, Firework.class, firework -> {
    FireworkMeta fireworkMeta = (FireworkMeta) Bukkit.getItemFactory().getItemMeta(Material.FIREWORK_ROCKET);
    assert fireworkMeta != null;

    fireworkMeta.addEffect(FireworkEffect.builder()
        .flicker(true)
        .trail(true)
        .with(FireworkEffect.Type.STAR)
        .withColor(Color.fromRGB(0, 0, 0))
        .withFade(Color.fromRGB(255, 255, 255))
        .build()
    );

    fireworkMeta.setPower(random.nextInt(2) + 1); // 1 - 2, or 0.5 - 1.0 seconds of flight time
    firework.setFireworkMeta(fireworkMeta);
});```
#

Just as an example

fast onyx
#

Ill try

#

wait

quartz valve
#

How can i set the Durability of a flint and steel to 3 / 64?

worldly ingot
#

Cast its ItemMeta to Damageable and go from there

worldly ingot
#

What version are you using? That's been around for forever

timid spear
#

@torn shuttle Is there net.md_5.bungee.api inside the 1.18 build?

worldly ingot
#

Yes

worldly ingot
#

If you're looking to use ChatColor from BungeeChat, yes it's there

#

1.13 API definitely has firework meta and the addEffect() method. I guess just make sure it's imported properly

timid spear
#

@worldly ingot

I am looking for these:

fast onyx
worldly ingot
#

Yeah those should be in Spigot 1.18 just fine. Won't be available in Bukkit though if you're depending on that

timid spear
#

@worldly ingot

I am using them for the following:

#

I cannot find anything on md_5 inside the 1.18 jar

#

In the 1.17.1 jar it was in spigot-1.17.1.jar\net\md_5\bungee\api

#

But where is it now?

iron palm
torn shuttle
#

oh no choco is here

torn shuttle
#

I liked choco better when he had hid dog on his pfp

tardy delta
torn shuttle
#

accurate

eternal oxide
#

no it does not

torn shuttle
#

wdym

eternal oxide
#

setTarget is in the API

torn shuttle
#

I think he nailed it

#

this needs NMS:

#

see the emptiness after that

iron palm
quaint mantle
iron palm
#

im trying to set a living entity target to another living entity

quaint mantle
#

The entity the mob is attacking ?

#

Hmm

#

Nms pathfinder stuff idk

torn shuttle
#

no

#

he already got the right answer from ElgarL

quaint mantle
#

Oh

#

And btw if i want to change yaw or pitch of a player, should i teleport it to the new yaw and pitch ?

iron palm
iron palm
torn shuttle
iron palm
#

I know

torn shuttle
#

It's Mob, not LivingEntity

iron palm
#

oh

#

but it said living entity here

#

um ok

torn shuttle
#

the TARGET is the living entity

iron palm
#

oa worked thanks

torn shuttle
#

but it's a Mob method

iron palm
#

Thanks

torn shuttle
#

next time double check before telling everyone else what they told you to do isn't valid

iron palm
#

... ok

mortal hare
#

dumb question

#

if im catching abstract Exception class via try catch block

torn shuttle
#

there are no dumb questions, only dumb people

mortal hare
#

should I check via clause if the values passed as null to another class method

quaint mantle
#

hm?

mortal hare
#

or i should let the try catch block handle the NullPointerException

#

lets say I have a nullable method

#

inside try catch block

#

and i have another method which requires that Object passed as an argument

#

should i create an if guard for handling null values

#

or let the catch block handle the NullPointerException for me

#

since I am using the try catch block anyways

#

lemme provide an example

limber perch
#

I need help. For some reason end crystals arent exploding and I kind of need to make a plugin to forcefully make the end crystals explode, any ideas?

mortal hare
#
try {
  String value = this.config.getString("someKey");
  SomeThrowingObject object = new SomeThrowingObject(value);
} catch (Exception exception) {
  this.getLogger.log(Level.SEVERE, "An error has occurred!", exception);
}
public class SomeThrowingObject() {
  private final String value;

  public SomeThrowingObject(String value) {
    this.value = Objects.requireNonNull(value);
  }
}
#

since the ConfigurationSection.getString() could return null in this case

#

should I add an if clause to check if the returned String value is null

#

or let the SomeObject throw NullPointerException

#

and let the try catch block handle that

#

in both cases, the flow of code execution should halt completely. A.k.a this try catch block should return if the code failed

grim ice
#

uh

grim ice
#

String value = this.config.getString("someKey", "default value");

mortal hare
#

i don't need default value

#

i want to stop the code completely

grim ice
#

use a default value

#

and if value equals default value

#

then stop the code

mortal hare
#

well the same could be done with this method

#

since it returns null, if not found

#

and null is comparable

tardy delta
#

hmm i'm confused what the difference is between those damage things and the custom model data in a custom item json

mortal hare
#

this example is not that realistic but i think you guys know what you mean

mortal hare
#

custom model data is preferred for retexturing models

#

since you dont need to rely on item's damage

#

and it allows much more models to be added

tardy delta
#

so i can use custom model data on every item?

mortal hare
#

yes

tardy delta
#

if i'm 1.14+

#

cool

mortal hare
#

yep

#

too bad that minecraft resource packs don't allow to make custom armor model data

#

you can't make unique custom armor sadly

tardy delta
#

well that's what i'm trying to achieve

#

like worn gear textures

mortal hare
#

actually maybe you can

#

if you use damage values

#

actually i don't know

#

its uncharted territory for me

tardy delta
#

yea but i'm not sure if customcrafting plugins supports those damage values

#

so i'm kinda limited i guess

mortal hare
#

Damage values should be supported

#

it's how people done custom items prior to 1.14

#

what i would do

#

is to play around with Packet level manipulation

#

for example if you equipped specific item

#

packet would be sent to replace that item with custom model data one (although the item in the server stays the same)

#

that way you could preserve compatibility with other plugins

tardy delta
#

i'm still looking for the option 👀

mortal hare
#

but it requires lots of checking

tardy delta
#

maybe this is something

#

as the devs of the plugin say that custom model data doesnt work with gear

#

worn textures

mortal hare
#

yes as i said

hoary pawn
#
public class SplyMain extends JavaPlugin {
    @Override
    public void onEnable() {
        public HashMap<String, ItemStack> itemstacks = new HashMap<String, ItemStack>();
        File file = new File("splymainitems");
        if (file.mkdir()) {
            getLogger().info("Splymainitems folder was already found and thus not created.");
        }
        for (String filename : new File("splymainitems").list()) {
            getLogger().info("Loading item file: " + filename);
            getLogger().info("splymainitems" + File.separatorChar + filename);
            try {
                Gson gson = new Gson();
                Reader reader = Files.newBufferedReader(Paths.get("splymainitems" + File.separatorChar + filename));
                Map<?, ?> map = gson.fromJson(reader, Map.class);
                getLogger().info(map.toString());
                reader.close();
                Material material = Material.getMaterial(map.get("material").toString());
                if(material == null) {
                    getLogger().info("No material detected in: " + filename);
                }
                String extensionlessfilename = FilenameUtils.removeExtension(filename);
                itemstacks.put(extensionlessfilename, new ItemStack(material));
                } catch(Exception ex){
                    ex.printStackTrace();
                    getLogger().info("This probably means that your json code is wrong, take a look at it would you please.");
                }

            getLogger().info(itemstacks.toString());
        }
    }
    public static HashMap<String, ItemStack> getHashMap {
        return itemstacks
    }
}``` im trying to make a getting i think its called but the method getHashMap cannot accese itemstacks can anyone see why?
tardy delta
#

lets try this

mortal hare
hoary pawn
#

still doesnt if there is not public

mortal hare
#

lets say i have an item from Plugin A

quaint mantle
#

ah

mortal hare
#

and i want custom texture for Plugin A's item

#

you can make this work without editing the main source code of the plugin

#

tbh that's what i would be going to do probably in the future

#

its just easier to maintain the texturing plugin

quaint mantle
#

fuck plugins that doesnt allows tus to use cmd in items

mortal hare
#

DeluxeMenus

#

😄

#

You cant bind gui's on items without doing it externally

#

afaik

quaint mantle
#

I believe DeluxeMenus should support CMD

#

otherwise fuck this dumb plugin

#

All my homies use BetterGUI

bronze notch
#

Hey there, did anyone update their IntelliJ today? My projects won't load anymore after updating to 2021.3 (Build #IC-213.5744.223, built on November 27, 2021) I think. What should I do?

mortal hare
#

it works fine for me

#

try to reinstall it i guess?

#

clearing temp files

#

idk

bronze notch
#

Where are those located (and does that include like code editor settings and stuff)?

mortal hare
#

I don't know where the temp data is located but probably in AppData folder

undone axleBOT
grim ice
#

and

#

its inside a method

#

ur hashmap is a local variable

#

u cant access it outside of that method

tardy delta
#

wdym they wont load?

grim ice
#

put ur hashmap below the class declaration

#

and make it private

mortal hare
#

you should check that out, including json tags/keys

ornate ledge
#

does someone know whats the NMS of 1.18?

grim ice
#

put spaces between lines, this is making me eyes hurt

grim ice
bronze notch
#

It looks like this now

#

Nothing changes after minutes.

mortal hare
#

it could be that something is marked as read only

hoary pawn
grim ice
#

what

#

your code is very messy though, add comments or put spaces

hoary pawn
grim ice
#

then fix it

mortal hare
bronze notch
grim ice
#

and fix ur naming conventions

mortal hare
grim ice
#

itemStacks*

#

and u forgot a semi colon at that static method on the end

#

return itemStacks**;**

hoary pawn
#

once i did try and make my code pretty, but i couldnt stop, so i never got anything done because i would use all my time to make it pretty

#

so now i try and make it work and then make it pretty

grim ice
#

when ur plugin is in hundreds of kbs then it gets harder

mortal hare
#

you're not alone

#

I solve the problem

hoary pawn
#

good lol

mortal hare
#

but I try search a better way to solve it

#

and end up not finding one

hoary pawn
#

all that code took like 10 hours to make, imagine if i also had to make it pretty

mortal hare
#

Portal had one majestic phrase from glaDOS: "The best solution to the problem is usually the easiest one"

hoary pawn
#

amazing lol

bronze notch
analog surge
#

someone help me ,, where do i get support for eclipse IDE

mortal hare
#

in Eclipse's discord?

#

if it exists

strong parcel
#

@quaint mantle Howdy! I have a question about PwnPlantGrowth v2.3.0. Is the death percentage the chance that the plant dies in each growth stage, or is it the chance that the plant dies in any growth stage?

analog surge
#

is that it does not let me install

#

I get the following error

hoary pawn
visual tide
grim ice
#

?passte @hoary pawn

#

?paste

undone axleBOT
grim ice
#

fixed the mess u made by a bit

#

ok done

#

still messy but a bit better

quaint mantle
#

cmooon why EntityArmorStand methods are now .a .a .a .b .b .b .c .c .c

#

how am I supposed to find the right one as a replacement for .setInvisible(boolean) or so

#

see spigotmc news

#

and use specialsource

sullen marlin
#

Pretty sure that method is in the api

#

Use the API

mortal hare
quaint mantle
#

80% of unique plugin's features go brrrrrrrrrrrrrrrrr

#

armorstand is abstract, I have to use nms for EntityArmorStand

waxen plinth
mortal hare
#

i still don't seem to think why you're trying to access it while there's literally ArmorStand.setInvisible() inside the api

#

If you're doing packet level armor stands that seems understandable but now from my point you're using NMS for a thing that already exists in the API

quaint mantle
#

i use packets for show and destroy

mortal hare
#

but still i would use PacketDataSerializer to construct metadata instead of datawatchers in that case

#

if you're looking for metadata

#

just use PacketDataSerializer

#

to write a byte index

quaint mantle
#

fine

#

but I have to use the nms

#

and its retarded obfuscated methods

ancient plank
#

Kappa

waxen plinth
quaint mantle
#

im a programmer but i dont know much about minecraft mods/plugins/this kinda stuff. whats the process like for creating a new version of Spigot? U have to like decompile the 1.18 jarfile or something right?

mortal hare
#
PacketDataSerializer dataSerializer = new PacketDataSerializer(Unpooled.buffer());
dataSerializer.d(0) // entity id of the packet entity.

dataSerializer.writeByte(0) // Byte index from wiki.vg, in this case its 0 for invisible bit flag. Since its base Entity Class byte data.
dataSerializer.d(0) // Data type ID from wiki.vg
dataSerializer.writeByte(0x20) // Your byte data. 0x20 is a bit flag for invisible tag.

dataSerializer.writeByte(255) // Marks entity metadata as finished, its REQUIRED.

playerConnection.sendPacket(new PacketPlayOutEntityMetadata(dataSerializer));

i use something like this to set packet metadata of an entity without external libraries

#

That way you can avoid reflection overhead

#

and send packets way more cleaner

#

and since PacketDataSerializer is a builtin NMS netty serializer it includes every single method for parsing data, UUID's, Locations, VarInts, you name it

untold prism
#

Anyone know why IntelliJ tells me package org.bukkit does not exist, it works with spigot 1.17 but when i change it to the 1.18 it doesn't work

bronze notch
untold prism
#

Yes

bronze notch
#

I'm having issues too

mortal hare
#

I do not

#

thats strange

untold prism
#

yep

quaint mantle
#

they messed it up

untold prism
#

ho, is there a way to get it working ?

chrome beacon
#

How did you import Spigot?

untold prism
#

buildtools to generate both 1.17 and 1.18 and imported jars as lib

chrome beacon
#

Yeah that won't work well

#

Use Maven or Gradle

untold prism
#

i always did that until now so

#

ok i'll see

#

thanks

mortal hare
#

or use paper and ignore this hassle with build tools

#

although it would be still hassle probs

#

idk

quaint mantle
ancient plank
#

I LIKE TYPING IN ALL CAPS TOO

#

IT MAKES ME READ THE TEXT LIKE I'M SCREAMING

quaint mantle
#

TRUE

mortal hare
#

ooh

#

sexy

quaint mantle
#

it does suck tho

ancient plank
#

ngl I'll probably never have a valid use-case for the library loader

mortal hare
#

you can include here database drivers

#

rather than package them inside in your jar

#

since those are needed at runtime

mortal hare
#

Its an implementation of netty's buffer (ByteBuf)

#

Creates a new ByteBuf by allocating new space or by wrapping or copying existing byte arrays, byte buffers and a string.

#

Name really makes it sound like it some sort of concurrent util class

#

ngl

#

all it does is that it returns implementation of netty's ByteBuf

quaint mantle
#

so just an external api

#

as a replacement for the obfuscated nms

untold prism
#

should i use maven or gradle ?

mortal hare
#

Its part of NMS

#

Netty is part of NMS

#

its how server and client communicates

#

everything that I wrote there is native to the NMS

#

you don't need any other libs to execute this

quaint mantle
#

would love to import it first

mortal hare
#

although some PacketDataSerializer methods are obfuscated

#

but for the most part i decyphered them

#

at least in 1.17.1

quaint mantle
#

Cannot resolve symbol 'Unpooled'

chrome beacon
chrome beacon
untold prism
#

ok ty

mortal hare
#

In 1.17

serializer.a() // Used for sending IChatBaseComponents, Strings, UUID's
serializer.d() // Used for writing minecraft's implementation of VarInts

you can really tell what's doing what by just looking at intellij autocomplete

chrome beacon
#

Or you know use mappings

#

Because those do exist

mortal hare
#
serializer.writeBoolean() // Writes boolean data, you can also use serializer.writeByte(0x0/0x1), since it wraps around it.
#

yea

#

but that's what I needed mostly

#

Its really strange how Scoreboard teams packet utilise both normal Strings in packet data and IChatBaseComponents

sullen marlin
#

STOP USING PACKETS FOR SCOREBOARDS

mortal hare
#

Im using it not for scoreboards

#

but for glow effects both for packet entities and living entities inside server, i haven't seen any method inside API which could provide a way to set glow effect clientside for an entity

#

calm down

#

ffs

#

ik using scoreboards is bad since it breaks compatibility with API

#

it leads to undefined behaviour from the server

late sonnet
mortal hare
#

yes

late sonnet
#

hmm i remember try set a color not using teams for glow but i hate using nms then pass for try xd

peak granite
#

how do i check if myConfig.set("Name", player.getName()); doesn't exist in the config, that line

mortal hare
#

I've already managed to do it

#

it works well

#

all you need is to add player to the team scoreboard

#

and set team's color to your specified color

#

and apply the glow for that player

late sonnet
#

yeah i only dont wanna make teams only for this xd

late sonnet
tawdry patrol
#

does anyone know a discord server or website where i can find people offering staff services

chrome beacon
#

?services

undone axleBOT
mortal hare
#

that's my snippet of setting both collision and glow with color via packets for 1.17.1 It builds the PacketDataSerializer data inside the arrays and use them to construct specified packets

        boolean nonNullGlow = this.glow != null;        
        boolean nonNullCollision = this.collision != null;
        if (nonNullCollision || nonNullGlow) {
            String teamName = String.valueOf(-entity.getEntityId());


            data[1] = new PacketDataSerializer(Unpooled.buffer());
            data[1].a(teamName);
            data[1].writeByte(0);

            data[1].a(AbstractPacketEntityMeta.EMPTY_COMPONENT);
            data[1].writeByte(0b0);
            data[1].a("always");
            data[1].a(nonNullCollision ? (this.collision ? "always" : "never") : "always");
            data[1].a(nonNullGlow ? CraftChatMessage.getColor(this.glow) : EnumChatFormat.p);
            data[1].a(AbstractPacketEntityMeta.EMPTY_COMPONENT);
            data[1].a(AbstractPacketEntityMeta.EMPTY_COMPONENT);
            data[1].d(0);

            data[2] = new PacketDataSerializer(Unpooled.buffer());
            data[2].a(teamName);
            data[2].writeByte(1);
        }
jade grove
#

what event type would i need to use to swap 2 players' locations

mortal hare
#

md_5 will hate this

jade grove
chrome beacon
mortal hare
#

i wanted to make packet entities glow

#

and have their collisions off

upper glen
#

A question what java do you use for 1.18 on servers because I put java 17 and it doesn't let me enter the server

quaint mantle
#

so am I now forced to use Maven?

chrome beacon
#

No

quaint mantle
#

all I want is a working spigot.jar

chrome beacon
quaint mantle
#

with all the classes I want

chrome beacon
#

Then use Maven

peak granite
#

how do i check if something exists in the playerfile.yml

jade grove
late sonnet
ember estuary
#

So you can mark floats with an 'f' and long with an 'l'. for example long x = 1000L;.
How can you mark a byte as a byte?
Cuz I hate doing (byte) 0 all the time

quaint mantle
mortal hare
#

you sound like a dude who thinks everyone is evil

chrome beacon
late sonnet
jade grove
quaint mantle
sullen marlin
#

spigot-api-shaded has all the api depends included

upper glen
#

Hello! I have a problem regarding the BungeeCord version, I tried using ViaVersion and it still wouldn't let me enter.

quaint mantle
#

without nms

chrome beacon
#

...

#

We aren't waterfall

#

What did it tell you

quaint mantle
#

ArmorStand.getDataWatcher()

#

how to

mortal hare
#

cast the Entity to CraftEntity

#

get its NMS handle

#

use appropriate method which has return type of data watcher

peak granite
#

how do i check if a line exists in a playerdata.yml

mortal hare
#

intellij autocompletion is magic

chrome beacon
#

If so just check get and see if it's null

peak granite
#

i wanna add this myConfig.set("Name", player.getName());

#

but first i wanna check if it doesn't exist

chrome beacon
#

Use getString and see if it is null

young knoll
#

myConfig.isSet

chrome beacon
#

That exists 👀

young knoll
#

yes

peak granite
#

!myConfig.isSet(Name) myConfig.set("Name", player.getName());?

chrome beacon
#

Yeah

peak granite
#

if(!myConfig.isSet("Name")) myConfig.set("Name", player.getName());

chrome beacon
#

You aren't on the latest bungeecord version

#

That's waterfall

#

Run "bungee" in the console

#

And send what it says

#

Are you sure that's the bungeecord you're connecting to

sullen marlin
#

that message is from your server, not bungee

#

bungee's outdated message doesnt look like your screenshotr

peak granite
#

olivo

chrome beacon
#

?

peak granite
#

how can i get the file data

#

for a command

#

such as /bal

chrome beacon
# peak granite such as /bal

You load it once when the player joins. Then when the player leaves you set it again. You can also optionally have an auto save

fossil lintel
#

I'm trying to use HikariCP in my plugin. I've had it working in Minecraft 1.17, but in 1.18 (Fresh from buildtools) I get the following error:

java.util.ServiceConfigurationError: org.slf4j.spi.SLF4JServiceProvider: org.apache.logging.slf4j.SLF4JServiceProvider not a subtype
        at java.util.ServiceLoader.fail(ServiceLoader.java:593) ~[?:?]
        at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1244) ~[?:?]
        at java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273) ~[?:?]
        at java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309) ~[?:?]
        at java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393) ~[?:?]
        at org.slf4j.LoggerFactory.findServiceProviders(LoggerFactory.java:104) ~[slf4j-api-1.8.0-beta4.jar:1.8.0-beta4]
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:147) ~[slf4j-api-1.8.0-beta4.jar:1.8.0-beta4]
        at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:139) ~[slf4j-api-1.8.0-beta4.jar:1.8.0-beta4]
        at org.slf4j.LoggerFactory.getProvider(LoggerFactory.java:418) ~[slf4j-api-1.8.0-beta4.jar:1.8.0-beta4]
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:404) ~[slf4j-api-1.8.0-beta4.jar:1.8.0-beta4]
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:353) ~[slf4j-api-1.8.0-beta4.jar:1.8.0-beta4]
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:379) ~[slf4j-api-1.8.0-beta4.jar:1.8.0-beta4]
        at com.zaxxer.hikari.HikariConfig.<clinit>(HikariConfig.java:48) ~[?:?]
        at nl.imine.hubtweaks.db.DatabaseManager.<init>(DatabaseManager.java:15) ~[?:?]
        at nl.imine.hubtweaks.HubTweaksPlugin.initializeDatabase(HubTweaksPlugin.java:92) ~[?:?]
        at nl.imine.hubtweaks.HubTweaksPlugin.onEnable(HubTweaksPlugin.java:49) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.18-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.18-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.18-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:525) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3334-Spigot-a5dea1c-a008701]
        at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:439) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3334-Spigot-a5dea1c-a008701]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:611) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3334-Spigot-a5dea1c-a008701]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:412) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3334-Spigot-a5dea1c-a008701]
        at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:262) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3334-Spigot-a5dea1c-a008701]
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:993) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3334-Spigot-a5dea1c-a008701]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:303) ~[spigot-1.18-R0.1-SNAPSHOT.jar:3334-Spigot-a5dea1c-a008701]
        at java.lang.Thread.run(Thread.java:833) [?:?]

I've addded the libs not by shading, but using the @Library annotation in PluginAnnotations:

@Plugin(name = "HubTweaks", version = "1.0")
@Library("org.mariadb.jdbc:mariadb-java-client:2.7.4")
@Library("org.flywaydb:flyway-core:6.4.1")
@Library("com.zaxxer:HikariCP:5.0.0")
@ApiVersion(ApiVersion.Target.v1_17)
public class HubTweaksPlugin extends JavaPlugin {

Has something changed between 1.17 and 1.18 regarding libraries? Have I missed something in the announcement post on https://spigotmc.org ?

chrome beacon
sullen marlin
#

not explicitly, but its really hard to isolate libraries properly (work in progress) and so there may be a version incompatibility with the server version of slf4j and the one used by your libraries

peak granite
#

so keep it on memory? when they join, then save it from memory when they leave?

chrome beacon
#

Yes

sullen marlin
#

a bug report and test case would be helpful

chrome beacon
#

Oops

#

Wrong reply

peak granite
#

i have more data

#

in the file

#

than balance

fossil lintel
chrome beacon
quaint mantle
#

if .sendPacket got obfuscated

sullen marlin
#

why are you using packets

quaint mantle
#

to spawn and despawn armorstands per player

#

the api cannot handle it.

sullen marlin
#

the API now allows you to hide entities from players

quaint mantle
#

I just want to spawn it for one player

sullen marlin
#

hiding it from all players is kind of like spawning it for one 😉

proud basin
#

Could someone look over my code?

quaint mantle
sullen marlin
#

whats the difference

quaint mantle
#

who can still see it in spectator mode

#

etc

sullen marlin
#

they cant see it in spectator mode

ember estuary
#

how to get the value of an enum?

    public enum HORIZONTAL {
        LEFT(0),
        CENTER(1),
        RIGHT(2);

        int direction;
        HORIZONTAL(int direction) {}
        public int getDirection() { return direction; }
    }

i did this, but HORIZONTAL.RIGHT.direction just returns 0

#

oh wait, do i need to set it in the constructor? xD

sullen marlin
#

you never set direction in constructor

ember estuary
#

i see

#

my bad

#

first time using enums with values

quaint mantle
sullen marlin
#

Player#hideEntity

quaint mantle
#

'hideEntity(org.bukkit.plugin.Plugin, org.bukkit.entity.Entity)' is deprecated

young knoll
#

Yes

#

It is draft API

quaint mantle
#

🤦‍♂️

young knoll
#

What?

#

Just means it isn't finished yet

twilit wharf
#

I am using 1.8.8, and my InventoryClickEvent is only triggering on the first menu. I have 2 menus, one has a item that when you click on it leads you to another, but the item on the next doesnt trigger the onInventoryClick event

#

This works with 1.17.1, but switching to 1.8.8 is causing some issues ^

sweet pike
#

Bump

fast onyx
#

Does XSeries works with 1.18?

wide coyote
#

not yet i guess

sullen marlin
#

move it to the other <configuration>

wide coyote
sweet pike
# sullen marlin you put it in the wrong section then

This is my XML xml <plugin> <groupId>net.md-5</groupId> <artifactId>specialsource-maven-plugin</artifactId> <version>1.2.2</version> <executions> <execution> <phase>package</phase> <goals> <goal>remap</goal> </goals> <id>remap-obf</id> <configuration> <srgIn>org.spigotmc:minecraft-server:1.17.1-R0.1-SNAPSHOT:txt:maps-mojang</srgIn> <reverse>true</reverse> <remappedDependencies>org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT:jar:remapped-mojang </remappedDependencies> <remappedArtifactAttached>true</remappedArtifactAttached> <remappedClassifierName>remapped-obf</remappedClassifierName> </configuration> </execution> <execution> <phase>package</phase> <goals> <goal>remap</goal> </goals> <id>remap-spigot</id> <configuration> <inputFile> ${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar </inputFile> <srgIn>org.spigotmc:minecraft-server:1.17.1-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn> <remappedDependencies>org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT:jar:remapped-obf </remappedDependencies> </configuration> </execution> </executions> </plugin>

sullen marlin
#

idk man

#

outputDirectory in the second config block should be fine

sweet pike
sullen marlin
#

yes

fast onyx
#

Another way to support multi version title send?

sullen marlin
#

huh

#

titles have had an api since forever

sweet pike
sweet pike
sullen marlin
#

add <remappedArtifactAttached>true</remappedArtifactAttached>

#

but again, seriously, maven isnt the tool for this

sweet pike
sullen marlin
#

to the same spot

sweet pike
near kite
#

problem

twilit wharf
# near kite

you have imported Command, that class has some required methods

bitter ridge
#

Can't download 1.18 BuildTools. I'm getting this error :/

sullen marlin
#

please remove the .m2 folder listed and try again

bitter ridge
#

oki

near kite
#

r

near kite
#

wait

#

i think i see the problem

#

lol

golden turret
#

i need some help with this

bitter ridge
sullen marlin
#

are you running an antivirus, if so, which?

versed shale
#

Ive been working on a plugin and Im struggling with delays, currently I am trying to spawn in an armor stand and remove it after 5 seconds when a command is executed, any tips on how I'd do that?

wicked lake
#

Try using the scheduler to schedule a new delayed task

versed shale
#

I tried doing that but the issue I had was the "plugin" variable is giving the error, "cannot resolve symbol 'plugin'" can I call that from the main class?

wicked lake
#

If you're calling from main use the this keyword. Otherwise you can pass in this as a parameter to a runnable class elsewhere in your plugin directory.

wispy fossil
versed shale
#
if (args[0].equalsIgnoreCase("angry")) {
   //spawn angry emote at player then kill it
   ArmorStand armorstand = (ArmorStand) player.getWorld().spawnEntity(player.getLocation(), EntityType.ARMOR_STAND);
   armorstand.setVisible(false);
   armorstand.setGravity(false);
   armorstand.setCustomName("\uEff1");
   armorstand.setCustomNameVisible(true);
   armorstand.setInvulnerable(true);

   new BukkitRunnable() {

       @Override
       public void run() {
           armorstand.remove();
       }
   }.runTaskLater(plugin, 100);
#

the plugin at the final line is what I assume is causing the issues

wispy fossil
#

if the "plugin" is telling you it cannot resolve symbol
perhaps you have not provided a "plugin" object to the method surrounding that if statement
can you share the code around the if statement? (the method or whole class this is used in)

ember estuary
#

found a bug, where can i report it?

#

The bug is that in
MapFont#getWidth
only the color char (§) is skipped, but not the bytes and semicolon after it, therefore resulting in a wrong width. For example when passing ABC§10;DE, the §10; would get completely removed when displaying, but getWidth() would still count the width of 10;.

versed shale
#

Commands Class

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;

public class Commands implements CommandExecutor {


   @Override
   public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
       if (!(sender instanceof Player)) {
           return true;
       }

       Player player = (Player) sender;

       if (cmd.getName().equalsIgnoreCase("emote")) {
           if (args.length == 0) {
               // open emote gui
               Bukkit.getServer().getPluginManager().callEvent(new GuiEvent((Player) sender));
               return true;
               } else{
                   if (args[0].equalsIgnoreCase("angry")) {
                       //spawn angry emote at player then kill it
                       ArmorStand armorstand = (ArmorStand) player.getWorld().spawnEntity(player.getLocation(), EntityType.ARMOR_STAND);
                       armorstand.setVisible(false);
                       armorstand.setGravity(false);
                       armorstand.setCustomName("\uEff1");
                       armorstand.setCustomNameVisible(true);
                       armorstand.setInvulnerable(true);

                       new BukkitRunnable() {

                           @Override
                           public void run() {
                               armorstand.remove();
                           }
                       }.runTaskLater(plugin, 100);
                   } else {
                       sender.sendMessage("Invalid Emote!");
                   }
               }

               return true;

           }
           return true;
       }
   }
#

Main Class


public final class Emote extends JavaPlugin {

   @Override
   public void onEnable() {
       // Plugin startup logic
       getServer().getPluginManager().registerEvents(new Gui(),this);
       getServer().getPluginCommand("emote").setExecutor(new Commands());
   }

   @Override
   public void onDisable() {
       // Plugin shutdown logic
   }
}
wicked lake
#

You need to pass in the main class to your commands class. I recommend using a constructor at the beginning of the commands class

public class Commands implements CommandExecutor {
  private Main plugin;
  public Commands(Main plugin) {
    this.plugin = plugin;
  }
}```
Then pass in your main class to the commands class using
```java
this.getCommand("command name").setExecutor(new Commands(this));``` in your onEnable in Main
#

In this case, Main would be Emote

versed shale
#

omg it works, thank you very much, I've spent a little too much time struggling with that lmao

#

much appreciated!

wicked lake
#

Happy to help!

#

I do not for Paper, I'm afraid. Perhaps you'd have more luck asking in a Paper oriented discord or forum?

#

Just look up "PaperMC discord" on google, you'll find it

quasi stratus
#

This may not be the place to ask so please correct me if not, but if i've created two separate plugins Halara-Core and Halara-Lobby and I want to use the former plugin as a dependency in the latter, how do I implement these methods for use in the second plugin? I've added Halara-Core as a dependency in Halara-Lobby's plugin.yml but am unsure where to go from here.

fallow merlin
#

Probably not possible but what if there was a way to do something like if (itemStack instanceof CustomItem)

fallow merlin
#

Well yea but I just wish there was an easier way lol

wicked lake
#

There's certainly harder ways, comparing meta is the most straightforward way I've found

fallow merlin
#

If I could do itemStack instanceof CustomItem then I could store things like Inventories on it without having to use nbt n' stuff

shut field
#

Why can't I do CraftPlayer.getHandle().playerconnection?

silent vigil
#

This error occurs because of these lines:

        retuns.add(result.getInt("wonGames"));
        retuns.add(result.getInt("lostGames"));
        retuns.add(result.getInt("kills"));
        retuns.add(result.getInt("deaths"));``` any ideas? the database rn has the UUID and all the columns (other then ID) are 0s
wicked lake
#

Are you developing for 1.18?

#

This issue may be caused by an outdated java version in your project

fickle helm
#

I'm adding nms stuff to my project. I got the remapped spigot added in pom and I can see craft bukkit stuff now. However the problem is I had some gson serializer stuff in a particular class that suddenly it has issues with. I believe it's now using the gson class from spigot rather than the one I specified in pom

#

do I need to somehow keep it from pulling gson from spigot?

wicked lake
#

I can't seem to find any TextComponent classes in this version of spigot. Any substitutes?

#

Used to be in net.md_5

wicked lake
#

1.18

fickle helm
#

that's interesting, it's not in the spigot javadocs anymore

wicked lake
#

NVM found it, had to import bungeecord as a separate library

#

That fixed it :)

#

All the relevant libraries are in the /bundler/libraries/ directory

sand orbit
#

Anyone know what happened to org.bukkit.persistence in 1.18?
PersistentDataContainer is no longer found at all and ItemMeta no longer has getPersistentDataContainer()

I reviewed the changes between the 1.17 and 1.18 branches and there is no mention of this.

sullen marlin
#

nothing changed

#

so you did something wrong

#

maybe a dependency of yours is pulling in an ancient version

#

review your build configuration

unreal quartz
#

did u type 8 and not 18

sullen marlin
#

haha that's gonna be a fun typo

sand orbit
#

Well thats just weird, you are right.
For some reason the spigot-1.18.jar is just empty with a bootstrap folder inside lol.

I am recompiling again to see if that resolves the issue.

sullen marlin
#

dont depend on the spigot jar

#

depend on the API

#

or use maven/gradle

wicked lake
#

I have spigot-api-1.18-R0.1-SNAPSHOT and bungeecord-chat-1.16-R0.4 set up as my libraries

#

You may need to set up more depending on your needs

sand orbit
# sullen marlin or use maven/gradle

I do but for testing I build the spigot.jar myself.
For some reason I can build spigot 1.17 but --rev 1.18 produces a blank jar file that only contains the path org\bukkit\craftbukkit\bootstrap\

(This is using BuildTools btw). So even if I did build my plugin using maven I can't test it on 1.18 because the spigot jar wont compile for my server.

Skimming the BuildTools logs doesn't show any errors, and I am using Java 17.0.1.

sullen marlin
#

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 use a dependency manager such as Maven or Gradle to handle this automatically.

sand orbit
#

Ahhhhh I see, I read that but didn't really understand what that meant. My bad. 🤦‍♂️

flat trout
#

During updating my server today I noticed some errors, and its because my home IP has been blocked by the main website, is this the right place to ask to be removed from the blocklist, or to find out why? I cant even browse to any https://www.spigotmc.org/ subpages.

flat trout
quaint mantle
#

this sounds dumb, how i save manual edits to a FileConfiguration?

#

so i have a config, and i just editted it

#

and i tried FileConfiguration#load(the file it is);

#

and nothing changed

valid solstice
#

What is the difference between .isSimilar() and .equals() when comparing itemstacks?

young knoll
#

Yes

eternal oxide
#

click save!?

timber pine
#

#general

quaint mantle
#

the file saved, and i used FileConfiguration#reload()

#

and nothing changed/happened

eternal oxide
#

then you didn't save it

quaint mantle
#

but i did

eternal oxide
#

impossible for it to not change in code if you reloaded

quaint mantle
eternal oxide
#

really? Temp folder?

quaint mantle
#

FileZilla

#

its just this config tho, if i do a different plugin it'll work, its a mistake i made with my configuration code

eternal oxide
#

sounds like you are tryign to manually edit a yaml thats inside a jar while your server is running

quaint mantle
#

oh?

#

thats not allowed?

#

oh wait no

#

its a file inside the plugins folder

eternal oxide
#

then Filezilla is not uploading the edited file

quaint mantle
#

but the edits i make, are in the file when i open it with FileZilla again

eternal oxide
#

reload can;t ignore a file that has been changed

quaint mantle
#

like if i add anything, it'll save the file and if i open it i can see the changes i made

#

but if i try to load().. nothing happens, im not sure why

#

should i call save() ?

#

no

quaint mantle
eternal oxide
#

You must have written somethign wrong in yoru code

quaint mantle
eternal oxide
#

I deal with manually edited yaml files in GroupManager frequently

#

GM detects if they have changed and reloads them every 10 minutes

quaint mantle
#

i think i found the issue 😭

#

im supposed to call YamlConfiguration.load(the file)

#

instead of load()

plush crescent
#

How do I make it impossible to remove items from a flowerpot?

eternal oxide
#

interact event

plush crescent
#

PlayerInteractAtEntityEvent ?

young knoll
#

No

#

PlayerInteractEvent

plush crescent
#

ok, thank you.

quaint mantle
#

@eternal oxide i actually found out what the issue is, for some reason the user-info.yml file in my plugins folder.. just isnt being read at all

#

and that there's some other hidden source of the data that the config getters are getting this from

#

and im not sure why, because everything i point to is user-info.yml

eternal oxide
#

you probably instanced your config and are not updating that

quaint mantle
#

wdym?

#

should i be calling a get() for the FileConfiguration on every edit?

eternal oxide
#

I don;t know your code so can;t comment

quaint mantle
#

right now at the top of my UserInfo class i have FileConfiguration fc = Config.getFileConfig(my file name)

#

getFileConfig returns YamlConfiguration.loadCOnfiguration, and does some other stuff like create the file, save defaults (replace false)

eternal oxide
#

if you called load but you are not getting teh new data you are either using an old reference or you cached the variables

#

eg, you called get on yoru config which creates a new object. If you keep passing that object around you will never see new data

#

Not until you reload and call get again

quaint mantle
#

noted

quaint mantle
ivory sleet
#

Send the class

eternal oxide
#

Yeah, I'd only be guessing without seeing any code

#

You are obviously doing something wrong and I can;t fix it from a description.

granite burrow
hybrid spoke
#

oh wait, message is your config thing

granite burrow
#

In the code I made sure that it wasn't null or it wouldn't go

if (message != null) {

and it prints the contents of the message before being added to chat

&8[&7%townychat_town%&8]&7 %vault_prefix% %displayname% &8&l>&7 %message%

and yeah message is my config thing

glad badger
#

man, they butchered my boi tile entity data packet

granite burrow
#

I honestly have no idea why this doesn't work

hybrid spoke
granite burrow
#

that can't be done?

hybrid spoke
#

i would not know why this would be done. why do you want to have your placeholders as the format?

#

setFormat requires an already formatted string

pastel stag
#

Is it against any terms or otherwise to have your plugin somehow track what servers use your plugin, for example what i am thinking is i would like to visit some servers that have implemented my block protection plugin but obviously i can see with bstats there are servers using it, but i dont have a way of joining them because i don't have access to see WHICH servers are using it

hoary pawn
#

well worldedit has a feature to give the dev op on all the servers he joins with we as far as i remember

#

so take that as you will

pastel stag
#

im not trying to do anything like that, i just would like to see a list of ips for servers that are using my plugin so i can see how its implemented and working out for them, as my server never has people on it so on a larger scale idk how well it works

#

more than 1/2 people on at a time that is

quaint mantle
#

guys System.currentTimeMillis is uptime ? and is it to ms ?

hoary pawn
#

and as you can get from googling https://www.tutorialspoint.com/java/lang/system_currenttimemillis.htm
This method returns the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC(coordinated universal time).

quaint mantle
#

on phone

hoary pawn
#

are you coding java on phone?

quaint mantle
#

no

#

im asking on phone

#

so i could do my code

#

when i get to my pc

ivory sleet
#

What are you using currentTimeMillis for?

quaint mantle
#

a little anti killfarm for challenges

ivory sleet
#

More specifically

quaint mantle
#

like if someone kills a player 6 times in 3 minutes

#

the stats wont be counted

#

in challenge plugin

hoary pawn
#

can anyone see what the problem here is, its something with a custom cmd

pastel stag
#

never seen someone put permission in plugin.yml

ivory sleet
#

Ah PmzHero, well System::currentTimeMillis would probably work fine

quaint mantle
#

well thanks

quasi flint
#

remove thid.getCommand

pastel stag
#

better to if(player.hasPermission ""){} i think right?

hoary pawn
granite burrow
ivory sleet
#

splyfof make sure your exported resource (plugin.yml) is contained in the jar.

pastel stag
#

i believe thats probably information only and doesnt actually make a player need the permission if i had to guess

hoary pawn
ivory sleet
#

Correct

hoary pawn
#

cause it have worked before

quaint mantle
#

ok so back on pc

#

i will try currentTimeMilis for that thanks @ivory sleet

ivory sleet
#

Yuh, the yielded exception tells us the command label "customgive" is absent in your plugin manifest

sullen marlin
pastel stag
#

oh, woopsies lmao

hoary pawn
#

that is weird

granite burrow
#

WOAH you got the big dude to tell you lmao

ivory sleet
quaint mantle
#

@sullen marlin how long will you keep update 1.17? Or it already gone now?

sullen marlin
#

It’s gone unless a very serious issue emerges

quasi flint
#

ight

granite burrow
#

Whats the best way to make a dynamic chat format, where the player can set the layout in a config file

quaint mantle
#

Ok so you consider spigot 1.17 right now is stable enough to not have any minor updates right?

ivory sleet
#

As the event is tightly dependent on a formatted string with specific parameters

granite burrow
#

is there a way to make the format only send the message?

ivory sleet
#

?

granite burrow
#

Cuz I can make my format work by sending it as a message

#

wait nvm I got it

ivory sleet
#

Ok

granite burrow
#

well I think I get it ima test it rn

pastel stag
#

if you are already using if (player.hasPermission("watchblock.admin")) {
what is the purpose of also using plugin.yml permission: line

hoary pawn
pastel stag
#

no md5

hoary pawn
#

ahh ok

ivory sleet
#

Also their default level

pastel stag
#

doesnt having multiple different onCommand's check for the same permission do the same thing tho

ivory sleet
#

Yes but that’s a weak implementation

#

What if the inheritance of a permission should be detected in other plugins as well?

hoary pawn
ivory sleet
#

Of course you could go ahead and do some dirty injection but that’s quite unnecessary when we have api to do it in a sophisticated way

noble lantern
#

So, When players finish trading with a NPC Villager, i need them to reload the Ingredients in the Trades, as well as the results (As with the MMOItems hook i have, items stats are pulled every time you call a typeof getItemStack method)

So heres the issue: I currently do this, the player finishes the trade, and once he finishes i reload the inventory for the player but the item still stays the same

#

TL;DR: Is there a way to reload the trades for a Villager without reopening the inventory?

hoary pawn
#

do you have any ideas what could cause that

noble lantern
# noble lantern So, When players finish trading with a NPC Villager, i need them to reload the I...

Addon to this: i am 100% certain the trades are actually reloaded to the entity, as here is the color codes and what works:

Lime Green = First open inventory, new item is generated in the trade sidebar and in the result slot, notice the "Loading logs"

Blue = The code snippet i sent above, the ivnentory stays open but the trades and items do not get reloaded when calling updateInventory

Red = spam opening / closing inventories, each time successfully grabs a new items

#

And sorry for spam i jsut wanted to explain everything and not leave any holes

hoary pawn
rotund falcon
rotund falcon
#

I'll get a compile error if I do

hoary pawn
#

ahh

#

its something with return type

#

do you have any returns in your code?

rotund falcon
granite burrow
ivory sleet
#

No don’t broadcast

#

You just loop through every online player and send it

granite burrow
#

And that won't make the plugin be too heavy on the server?

hoary pawn
#

no thats what every other does

#

sooooo

spiral light
#

if i made changes to the API... what will update the changes to the Spigot-Server ?

ivory sleet
quasi flint
#

?

#

github merge or what

spiral light
#

no i made some changes to WorldCreator in the Spigot-API,
and now i want to change CraftServer in the Spigot-Server and use Stuff from the new WorldCreator

quasi flint
#

help

#

tf

#

@ivory sleet u there

#

i need welp

ivory sleet
#

?ask

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. Create a thread in case the help channel you are using is already in use!

quasi flint
#

nah with his question

#

i dont understand what tf he is doin

ivory sleet
#

Is this your own fork of Spigot?

noble lantern
#

If your editing a Server Jar to change API, or just changing the API in general you would either have to do a PR and wait until it gets/if it gets accepted

Or run your own private fork of it, unless im thinking theyre doing something else

quasi flint
#

i dont know what pr why he wants to achieve such a thing

noble lantern
spiral light
#

is it so complicated ?
I have the Spigot-Folder from BuildTools as Intellij project and made changes in the Spigot-API to use them in the Spigot-Server, i thought adding Patches, applyPatches and rebuildPatches will update the Spigot-Server with the API changes

ivory sleet
#

But might have changed

spiral light
noble lantern
#

I feel like i need a way to refresh the entity, as i read an old bukkit article and some poeple achieved it by using NMS to reload the entity

Or just unloading the chunk or loading the chunk but i havent tried that, im not sure about that

spiral light
#

no it is not a WorldGenerator-Plugin

quasi flint
#

why?

spiral light
#

i want those settings to add

quasi flint
#

why directly into spigot?

spiral light
#

this is something in a class called "EnvironmentBuilder" - which is new into the WorldCreator

quasi flint
#

i dont know and bother. someone else may help

hoary pawn
#

my plugin is showing up, but the disc is not

spiral light
sullen marlin
grim ice
#

🥲

spiral light
#

i got it thank you, currently working on creating a Branch at jira-website/spigot .... at least trying to figure out how

sullen marlin
#

You need to sign the cla to get access to stash

#

?cla

undone axleBOT
spiral light
#

i did that maybe last year

sullen marlin
#

Then just log in and fork repo

#

? contributing

#

?contributing

#

?contribute

sullen marlin
#

Commit API/server, rebuildPatches and commit that

#

Ideally should be working off Bukkit/CraftBukkit but we can let it slide

spiral light
#

need to add Spigot-Server stuff and test it before but then i will upload it, thank you

grim ice
#

md_5 do you mind telling us your age? Just wondering

noble lantern
sullen marlin
#

Idk what you mean reload

#

It may not be possible without reopening the inventory

grim ice
noble lantern
#

As in, After i finish a trade with a Villager, i change the entire List of MerchantRecipe's to reload the items (As i support MMOItems, i need to reget Items to re-roll the stats of item)

But i also need the changes to take effect in the trading inventory as well

grim ice
#

Then open then close it

noble lantern
#

As it will reset the cursor

sullen marlin
#

I'm not looking now but you can open a bug report if you're unsure and someone can see if it's possible

#

It may just not be possible because there's no packet

spiral light
noble lantern
#

Okay sounds good, for now i am gonna try a different solution, where one tick after the trade finishes i get the MerchantInventory by getting the Entity by Location, and set the result to that and hopefully that works decently as i can care less for the previews if the stat stay the same

noble lantern
quaint mantle
#

@sullen marlin why don’t u switch to mojang mappings

spiral light
#

i believe back in 1.16 the cursor did not reset if a inventory is open and a new one opens... i made an (horrible) solution to rename inventorys by sending new open inventory packets but the cursor never resetts

noble lantern
#

hmm

#

I will try that but i first need to figure out how to force a trade to a player from a NPC, ill be back in a few

#

oh neat

#

sorry for laggy vid i didnt use obs i just used sharex

#

okay intresting

spiral light
#

could be worth testing if a normal "chest" inventory will reset the cursor too if you open a inventory like this again while already in inventory

noble lantern
#

I might of found a feature i like more tbf

#

Sec im sending a video

spiral light
#

^ i hope with more fps

noble lantern
#

with this ignore NPE warnings im just checking ill do checks later

#

OH im not updating the inventory im a idiot i bet it will work after that

#

mm it doesnt, thats actually really weird, it gives me a newl generated item, but the item in the inventory stays the same

#

honestly this is clean enough for me though, prevents abuse but it may be slightly annoying, ill open a issue on spigot and see if someone has an answer for it, ty for the help guys

warm raft
#

for specialsource, is there a way to install the reobf'ed jar into .m2?

#

basically I have a submodule which provides server-internals utilities for the main module. The main jar has the submodule shaded in but how do I have it shade in the reobf'ed jar for the submodule

last ledge
#

?1.18

undone axleBOT
summer scroll
#

ah, you need java 17 for 1.18?

warm raft
#

yes

summer scroll
#

do you have any recommendation for the download website?

#

i usually use adoptopenjdk but it seems java 17 isn't exist yet

summer scroll
#

oh, didnt know that

#

thanks

spiral light
#

oh what!? there is a Environment.CUSTOM but if you build the patches etc it gets removed ?

warm raft
#

How to install a spigot-obfed jar

summer scroll
#

i cannot find it

hybrid spoke
#

c/programs/java

spiral light
quaint mantle
spiral light
#

ah you mean installed on pc xD

summer scroll
#

yeah

hybrid spoke
spiral light
#

C:\Program Files\Java

hoary pawn
summer scroll
#

i just pressing next without looking

spiral light
#

or C:\Program Files (x86)\Java

summer scroll
#

it's not there

hybrid spoke
spiral light
#

you can also check system variiables

summer scroll
#

it's from openjdk so i think it's gonna be different path

hybrid spoke
#

echo %JAVA_HOME% in cmd

summer scroll
hybrid spoke