#help-development

1 messages · Page 762 of 1

cursive kite
#

So not like this


    private int x, z;

    private World world;

    public SimpleChunk(int x, int z, World world) {
        this.x = x;
        this.z = z;
        this.world = world;
    }

    public class Test {

        static HashMap<SimpleChunk, Claim> claims = new HashMap<>();

        static {
            claims.put(new SimpleChunk(1, 1, Bukkit.getWorld("world")), new Claim(null, Bukkit.getWorld("world"), 1, 1));
        }

        @EventHandler
        public void onMove(PlayerMoveEvent event) {

            Chunk chunk = event.getPlayer().getLocation().getChunk();

            Claim claim = claims.get(new SimpleChunk(chunk.getX(), chunk.getZ(), chunk.getWorld()));
        }

    }
}
lost matrix
thin iris
#

which direction

storm crystal
#

top

thin iris
#

up?

river oracle
#

ahh yeah forgot about that

thin iris
#

Entity#setVelocity(new Vector(0, displacement, 0));

storm crystal
#

and then gravity would do it's stuff

lost matrix
storm crystal
cursive kite
#

That is the issue I am trying to resolve unfortantuely

thin iris
#

what

cursive kite
#

The chunks create new objects on load/unload

thin iris
#

new Vector(x, y, z); takes x y z values

lost matrix
#

Acceleration would mean that you increase the velocity over time (so several ticks)

storm crystal
#

does it take friction or drag into consideration

thin iris
#

umm

#

you’re thinking too deep about this really

storm crystal
#

I mean okay you set velocity to an entiy

#

I get it

#

but how does that velocity decrease

thin iris
#

you just want to send them up tho

#

gravity?

lost matrix
storm crystal
#

okay but what if the entity was moved in X or Z axis

thin iris
#

are you setting that velocity continuosly every tick or just one tick

thin iris
#

1 tick essentially

storm crystal
#

and .05s is one tick

thin iris
#

unless u set it continuosly

#

like in a runnable

storm crystal
#

can I change this value?

thin iris
#

what do you want to so

#

do

lost matrix
#

Which value

thin iris
#

you want to make them levitate or sum?

storm crystal
thin iris
#

a bit?

cursive kite
#

Is this good for equals

    public boolean equals(Object obj) {

        if(this == obj) {
            return true;
        }
        
        if(obj == null || getClass() != obj.getClass()) {
            return false;
        }
        
        SimpleChunk otherChunk = (SimpleChunk) obj;
        
        return x == otherChunk.x && z == otherChunk.z && Objects.equal(world, otherChunk.world);
        
    }```
#

and hashcode i hjave no idea about why edit that

thin iris
#

this?

lost matrix
thin iris
#

so u just want them in a small boost upwards

storm crystal
#

yeah

thin iris
#

we told u this from the start

lost matrix
#
        if(obj == null || getClass() != obj.getClass()) {
            return false;
        }
        
        SimpleChunk otherChunk = (SimpleChunk) obj;

->

        if(!(obj instanceof SimpleChunk otherChunk)) {
            return false;
        }
thin iris
#

set it in one tick

cursive kite
#
    public boolean equals(Object obj) {

        if(this == obj) {
            return true;
        }
        
        if(!(obj instanceof SimpleChunk)) {
            return false;
        }
        
        SimpleChunk otherChunk = (SimpleChunk) obj;
        
        return x == otherChunk.x && z == otherChunk.z && Objects.equal(world, otherChunk.world);
        
    }
storm crystal
#

okay but im just asking generally now

#

can you set the amount of ticks manually

thin iris
#

yes

storm crystal
#

or is it just 1 tick always and you cant change it

thin iris
#

i want you to take a step back and think about this now

storm crystal
#

im fine with it being 1 tick

lost matrix
cursive kite
#

Ive never seen that before ;o

thin iris
#

pattern variable

#

java 13?

#

is it

lost matrix
strong parcel
#

Is there a way to trigger a player’s background music?

cursive kite
#

If my equals ok though?

#

Do i need to edit hashcode

lost matrix
lost matrix
strong parcel
strong parcel
#

Fantastic!

cursive kite
#

I haven't edited it before tbh not sure on hashcode

thin iris
#

7smile do u know any other langs than java

lost matrix
ivory sleet
#

last 2 💀

lost matrix
#

And a bit Assembly with low instruction sets

lost matrix
#

But i generally dont touch Ruby, Java and Typescript.
And i mostly replaced C++ with Rust for my compiled binary projects.

cursive kite
#

I looked up hashcode and i think it should be somethiung lioke this?

@Override
public int hashCode() {
return Objects.hash(x, z, world);
}

lost matrix
cursive kite
#

    private int x, z;

    private World world;

    public SimpleChunk(int x, int z, World world) {
        this.x = x;
        this.z = z;
        this.world = world;
    }
    
    @Override
    public boolean equals(Object obj) {

        if(this == obj) {
            return true;
        }
        
        if(!(obj instanceof SimpleChunk)) {
            return false;
        }
        
        SimpleChunk otherChunk = (SimpleChunk) obj;
        
        return x == otherChunk.x && z == otherChunk.z && Objects.equal(world, otherChunk.world);
        
    }

    public class Test {

        static HashMap<SimpleChunk, Claim> claims = new HashMap<>();

        static {
            claims.put(new SimpleChunk(1, 1, Bukkit.getWorld("world")), new Claim(null, Bukkit.getWorld("world"), 1, 1));
        }

        @EventHandler
        public void onMove(PlayerMoveEvent event) {

            Chunk chunk = event.getPlayer().getLocation().getChunk();

            Claim claim = claims.get(new SimpleChunk(chunk.getX(), chunk.getZ(), chunk.getWorld()));
        }

    }```
#
  • the hash code oops
lost matrix
#

Ah and Kotlin

cursive kite
#

this will match the objects?

echo basalt
#

why it static woe

cursive kite
#

for testing lol

storm crystal
#

is there any way to set character in custom poses? like with armor stands?

wet breach
lost matrix
tribal wraith
#


            blockDisplay.setDisplayHeight(0.15f);
            blockDisplay.setDisplayWidth(0.15f);

How do you change the size of a BlockDisplay ? This won't change the size for me

lost matrix
lost matrix
tribal wraith
#

Bank u

lost matrix
storm crystal
#

How can I scan if there are entities in range of player? Like 1 tile in front of him

#

1x1x2 rectangle basically

lost matrix
#

2 ways:

  • Use a BoundingBox in front of him
  • Use a RayTrace with a broad BoundingBox
echo basalt
#

I was going to say dot product + distance check but that isn't really a box and more like an fov

sage patio
storm crystal
#

?

potent atlas
#

Does anyone know how to use code from a repository on github in an existing project? (using Eclipse)

#

I have been googling for an hour

rotund ravine
#

Though you’ll also need to copy paste the dependencies

potent atlas
#

I downloaded it with git bash and imported it into eclipse by configuring the build path of my project and clicking on add external class folder. it seemed to work but I still can't use the methods

rotund ravine
#

Oh so you mean like that

#

Build the project first

#

Then import the jar i guess

#

Or add it to your maven config

potent atlas
#

Tried that

#

what's maven?

rotund ravine
#

It’s a build tool

#

Most newer and proper developers will use either maven or gradle for java projects

#

?maven

undone axleBOT
rotund ravine
#

@tender shard do u have some sort of intro to maven in your blog

potent atlas
#

hmm. ok I'll take a look at that. thanks

fervent robin
#

Can someone send the link for bungee 1.8 maven dependency?

worldly ingot
#

Latest should work fine

#

It supports 1.8+

vagrant stratus
#

Look at these nerds

potent atlas
#

I am 100% lost on using repositories :/ any more tips?

#

I got as far as the project telling me the package I was trying to import from was inaccessible

rotund ravine
#

Which github repo are you trying to import

potent atlas
#

LibsDisguises

rotund ravine
#

Got a link?

potent atlas
rotund ravine
#

Just download the jar from their jenkins and import that i guess

#

Oh it’s mds jenkins nice

potent atlas
#

I tried that but I will do it again

#

it's saying the type is not accessible

rotund ravine
#

Are you using it properly and not following some old tutorial?

potent atlas
#

well, if I go to one of the class files it says source not found. so... I think that's maybe an import issue?

silk mirage
#

do anyone u guys have a eval or some kind of script engine implemented plugin that you use for testing in runtime or something?

#

I am lazy and I thought some people over here might have it

silk mirage
#

Evaluating dynamic code on runtime

rotund ravine
#

I can see the appeal, but it isn’t really needed.

silk mirage
#

Huh?

#

I mean

#

It's far more practical then having to launch your IDE

#

compile a plugin

#

put it in

#

restart the server

#

and then test what u were tesitng

rotund ravine
#

IDE
1 click to compile, put it in, start the server.

silk mirage
#

ehhh still a long task

rotund ravine
#

Not really

silk mirage
#

Maybe not really because like my plugins are automatically deployed to remote development server

#

and I test remotely

#

however still

#

Would just prefer to hop in game and type /evalulate sometuff

rotund ravine
#

Here u go, from our boy Rubba

#

No clue if it actually allows u to run anything haha

#

I just remembered it being funny

silk mirage
#

Uhhh

#

I don't think this allows you to run on Server Thread?

rotund ravine
#

Well just gouge it for your used

#

Uses*

silk mirage
#

Ahhhh

#

Still an overkill

#

I want a REPL not an full IDE

rotund ravine
#

Not that much work to implement it into a command instead

silk mirage
#

Ahhh let me see what he is upto

#

Why tf is my github dev on light theme

ivory sleet
#

lol

silk mirage
#

Because like

#

the classes being loaded

#

aren't being loaded by Bukkit class loader

#

or whatever it was called

#

He's compiling, and loading it through reflection and URLClassloader

#

It might still work

#

But litterely I can't wrap my head around what he is doing

rotund ravine
#

@tardy snow Go support ur years old plugin for this guy

potent atlas
#

Still no luck with the import

slate tinsel
#

Is it possible to make a display block look like someone has carved it

#

Like this ^^

smoky anchor
#

Not without a resource pack I think

short raptor
#

Hey I was searching around, and most recent thread I could find, from 1 year ago, said that API does not support setting Goat Horn type (ponder, sing, seek, feel...)
Has the function been added since?

pseudo hazel
# slate tinsel

idk how display blocks work, but if it was possible without resource pack, it would be near impossibly annoying

shadow night
#

Probably packets

pseudo hazel
#

packets? to what?

smoky anchor
#

well if you really don't want to use resource packs... you could use Text Displays
Just change the background color, move them precisely pixel by pixel :D
Unless you want the 3D effect, that one needs resourcepack

shadow night
#

Maybe like mining packets

smoky anchor
#

it's a display entity... can't mine that one

pseudo hazel
#

well it depends on what they mean by carved

#

from the image it looks like a 3d model

pseudo hazel
short raptor
#

I'll just fake it then lol

#

Play the sound myself

smoky anchor
#

I'm sure you could use NMS to change the nbt data of the item
OR make a PR for spigot :D

#

How is that PR looking ? :D

rough drift
smoky anchor
#

I wouldn't bother with that, not even vanilla supports this from what I know.
just make teleportAnEntityWithPassangersWithinASingleDimension method :D

true dragon
#

Does plugin create new listener for each player or is one listener "listening" to all players?

true dragon
drowsy helm
smoky anchor
drowsy helm
#

didnt see the display block bit

old cloud
low marlin
#

I'm trying to save an inventory and load it after it upgraded (from 9 slots to 18), after upgrading the saved items in the chests are null

#

any idea why?

smoky anchor
smoky anchor
undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

low marlin
#
    public static void loadPartyInventory() {
        
        
        for (String party : inventoryConfig.get().getConfigurationSection("inventories").getKeys(false)) {
            
            int Invslots = inventoryConfig.get().getInt("inventories." + party + ".inventoryslots");
            Inventory inv = Bukkit.createInventory(null, Invslots, messageManager.chatColor("&8&l" + party + "'s inventory"));
            
            ArrayList<ItemStack> test = (ArrayList<ItemStack>) inventoryConfig.get().getList("inventories." + party + ".inventory");
            
            Bukkit.broadcastMessage("test:" + test);
            
            MainClass.partyInventories.put(party, inv);
        }
        
    }
    
    public static void savePartyInventory() {
        for (HashMap.Entry<String, Inventory> entry : MainClass.partyInventories.entrySet()) {
            inventoryConfig.get().set("inventories." + entry.getKey() + ".inventory", entry.getValue().getContents());
            inventoryConfig.save();
        }
    }
old cloud
smoky anchor
old cloud
#

What tf is a Display block

smoky anchor
#

well I assumed they meant Block Display Entity

#

an entity added in some 1.19.x I think, allows you to show a block and give it arbitary transformations and it has limited interpolation options
Also exists for text and item

old cloud
#

Ah ok, Never heard of it

#

Probably because i don’t play minecraft 😂

smoky anchor
#

then why are you here

onyx fjord
#

Some people quit playing and just develop stuff

#

Including me

smoky anchor
#

oh you mean it in that way
I'm about the same, I don't really play the game

old cloud
#

Ye ye

halcyon hemlock
#

what the fook is a block display

quaint mantle
#

Fake block

#

Thats it

smoky anchor
#

an entity that can look like a block
but can be given arbitary transformations

quaint mantle
#

No need to summon falling blocks

#

Also have text display

#

Better holograms

halcyon hemlock
#

I see

#

also I got banned from minehut @quaint mantle

#

😂

quaint mantle
#

Backward compatibility is the reason why text displays are not used by anyone.

spare hazel
#

how can i add a .jar library to my maven project

quaint mantle
#

If you have source you should use jitpack for it. If you not have any source use maven local repo.

misty rivet
#

How use timeditem in kit

onyx fjord
#

Use artifacts from repos instead

#

Or publish stuff to your local repo

nova bolt
#

How can i make a /title message when i enter a specific region?

smoky anchor
#

what exactly are you struggling with ?
detecting the region or showing the title

shadow night
#

or both?

fallen lily
#

mavenLocal can be used for both those cases…

#

and usually (100% of the time), mavenLocal is faster than having jitpack build it on their 2mhz cpu

wooden hearth
#

Anyone have a link about using timestamps thank you

wet breach
#

Why cant you just google that?

#

Unless you want mc time? In which case mc time is in ticks

wooden hearth
#

I'm trying to find it on google can't find anything good

upper hazel
#

Is it possible to create your own event and call it as usual through the method?

hazy parrot
#

yes

upper hazel
#

thf

pastel axle
#

I'm noticing that calling the following in order

Sign.getSide.setLine
Sign.update
Player.openSign(Sign

The sign on the ground correctly updates, but the contents of the sign the user is editing is incorrect. What would be the correct way to do this?

pseudo hazel
#

hmm

#

maybe try delaying opening the sign by like a tick or smth

#

maybe its not saved in the sign fully

pastel axle
#

would that just be a...

            getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
                @Override
                public void run() {
                    p.openSign(s, sSide);
                }
            });

It's been a few years so I'm quite rusty.

#

Or is this better?

           new BukkitRunnable() {
                @Override
                public void run() {
                    p.openSign(s, sSide);
                }
            }.runTaskLater(plugin, 1);
dry hazel
#

the Runnable in the first example can be a lambda, but yea, it's essentially the same thing

pastel axle
#

ah, cool. good to know.

#

it seems 1 tick wasn't enough. let's try 10 I guess?

glad prawn
#

just runTask 🙂

short raptor
#

How can I cancel the sound effect from a Goat Horn use? I tried this, but it doesn't work, I assume because the sound is not specific to this one player

#

Can I cancel it for everyone without doing stopallsounds on everyone?

pastel axle
#

10 ticks worked, will try just runTask

blazing ocean
#

i am not sure if this fits here but I currently have a resource pack which contains custom font characters (12 to be exact): \uE000 up to \uE011. everything up to \uE010 works, but stuff above that doesn't. there's no errors in the client console, so it just looks like this:

nova bolt
#

I use 1.19.4

lost matrix
young knoll
#

api should be the same then

young knoll
#

Remember those characters are in hexadecial

nova bolt
#

What does this mean

blazing ocean
young knoll
#

It means E010 is not right after E009

blazing ocean
#

oh wat

young knoll
#

E00A

wet breach
blazing ocean
#

well E010 works

#

but just E011 doesnt

wet breach
#

E009 = ee8089(encoded byte) E010 = ee8090(encoded byte)

young knoll
#

Do I not know how to hexadecial

wet breach
#

in UTF letters are used first, then numbers, however when counting up in numbers it doesn't reset on the right with letters instead it sets the left with a letter and then resets back to letters first

eternal oxide
#

01 02 03 04 05 06 07 08 09 0a 0b is hex sequence

#

in UTF char sequencs vary between 1 and 4 bytes

#

0-128 is a single byte

#

129+ are two or more bytes

blazing ocean
#

ok but which one do I use instead of E011 then?

eternal oxide
#

after E009 comes E00A then E00B etc

wet breach
eternal oxide
#

hex is 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f then 10,11,12,13,14,15,16,17,18,19,1a

wet breach
#

the range you are using is designated as private use

#

you could technically use it, but no guarantee that all systems will support it

blazing ocean
young knoll
#

Private use is basically perfect for this

#

I've used the E000 range fine in the past

#

Tho that was before the unicode changes to fonts

wet breach
#

well you can use it, just no guarantees of systems supporting it

slender elbow
#

private use is literally designed for "use this for whatever you want"

wet breach
#

sure, no guarantees for systems to support it

#

its not standardized and other software may cause those fonts to not appear or appear as something else

young knoll
#

Well the system here is minecraft

wet breach
#

no

young knoll
#

And minecraft does support it

wet breach
#

the system is the OS

blazing ocean
#

can somebody just tell me what else I should just use?

wet breach
#

anyways, they are free to use it. Never said they couldn't just saying you have to be cautious in using the private ranges and can't expect it to work on all systems

lost matrix
#

Just start at 0001 and replace your way from there PES2_SmugSmirk

wet breach
#

not sure if you can replace that one

#

that is a control character

lost matrix
#

You are a control character

eternal oxide
#

if this is for a resource pack (not used one myself) but MC "Should" be able to replace any you choose

slender elbow
#

and it will, it will pick the glyph from the font source for that codepoint

young knoll
#

^

eternal oxide
#

If yours is not then I guess you have an issue with your resource pack setup/format

lost matrix
#

my guy

#

Eh whatever, he'll find out

young knoll
#

I mean if it's a custom font

#

It's fine

blazing ocean
#

wdym lol

wet breach
smoky anchor
#

I do believe you can with a custom font

eternal oxide
#

you may find the first 128 can;t be replaced but I expect they can

slender elbow
#

i mean that's what custom fonts do?

#

if you want to replace A with a funny looking A you need to replace it

eternal oxide
#

is this an actual custom font? or just UTF-8 replacements?

blazing ocean
#

just replacements

eternal oxide
#

if its replacements then nothing is guaranteed. so experiment

wet breach
#

0x00–0x1F control characters belong to C0

#

then you have C1 ranges for control characters

slender elbow
#

do you now how crudely minecraft prints characters?

#

it's not your OS's font system lol

wet breach
#

0x80–0x9F are also non-printing characters and are in C1

wet breach
#

java implements the UTF standard, so while you are free to do quite a bit, some things you are not

slender elbow
blazing ocean
slender elbow
wet breach
slender elbow
#

so you don't

wet breach
#

go change how java implements UTF 🙂

slender elbow
#

not gonna change something minecraft doesn't use

wet breach
#

oh mc doesn't use java?

slender elbow
#

not the font system

wet breach
#

yes it does

slender elbow
#

please go look at the client code

wet breach
#

mc uses UTF8

#

you can't claim to support something if you don't use it

wet breach
#

it uses UTF8, feel free to prove that incorrect

#

while MC does provide glyphs, it doesn't need to provide or replace all glyphs

#

because it uses utf8, anything mc doesn't override whatever font is on the system will take the place

slender elbow
#

sure, but it will still grab it and try to display it, and given how badly mc handles fonts control chars are replaceable

wet breach
#

this is why when some people type using a character set of say chinese and someone else doesn't have their OS setup for multilingual character sets, whatever MC doesn't replace, gets either question marks or square boxes

slender elbow
#

okay man sure

wet breach
#

well, this is why we have standards, and Java does implement standards

#

if you don't like it, I guess use something else or make your own JVM

slender elbow
#

and it isn't true utf8 either, that modified bs

wet breach
#

anyways, this is why I keep you blocked. I seriously doubt you can assign glyphs to the non-printable characters. The best you probably could do is redirect to another character point in terms of displaying.

#

as I said, you are free to do a lot, but sometimes the standard doesn't always allow free complete control either

blazing ocean
#

ok but what do I actually do now?

wet breach
#

well you can use other character points to replace the glyphs, just don't recommend choosing the characters from the control character ranges lol

#

less likely to encounter more problems

blazing ocean
#

ok so from 32-126?

lost matrix
wet breach
#

that is what I normally do XD

slender elbow
#

or, hold up, use private use area

#

it's almost as if it will work given how minecraft handles fonts!!

lost matrix
round hemlock
young knoll
#

Pretty sure that packet is gone

#

It just uses AddEntity now

blazing ocean
lost matrix
blazing ocean
#

that is very much what i wanted

#

ok no thats worse than before

#

yea

young knoll
#

I'm fairly sure you have just set something up wrong

lost matrix
young knoll
#

The original pack should have been fine

lost matrix
#

img tells me otherwise

blazing ocean
#

thats my resource pack default.json

young knoll
#

Any errors in the client log?

lost matrix
blazing ocean
#

in the plugin or pack?

#

no client errors

lost matrix
#

In the json file

young knoll
#

Can you provide a copy of the pack

#

You can remove everything but the font stuff

blazing ocean
#

thats where the plugin pulls from

young knoll
#

what mc version are you on

blazing ocean
#

1.20.1

scenic onyx
#

?paste

undone axleBOT
blazing ocean
#

ok

young knoll
#

Looks good here

blazing ocean
#

weird

#

its still chinese for me

hasty prawn
#

Did you reload the resource pack after you changed it

blazing ocean
#

yes

young knoll
#

Yeah all fine

#

Do note you skip some characters in there

lost matrix
# blazing ocean yes

btw, if you receive the resourcepack from the server then you should restart it and not reload it

blazing ocean
#

the plugin provides the pack

young knoll
#

Do you have the original version with the e000 characters

lost matrix
#

Did you reload or restart the server?

blazing ocean
#

i restarted

hasty prawn
#

Weird. You might look at the serverpacks folder and see what resource pack it's actually using from the server.

blazing ocean
young knoll
#

I'll just manually swap them back

#

See if it works

lost matrix
# blazing ocean i restarted

Hm you might have the problem with scuffed hashing. Delete all server resourcepacks from your minecraft folder

eternal oxide
#

did you delete it on the client> updating is not reliable

lost matrix
#

I always dynamically create a random new folder with a UUID when my resourcepack changes.
That forces an update on the client for some reason.

blazing ocean
#

works now

#

thank you

hasty prawn
#

So if you use the same URL Minecraft just thinks its the same pack

young knoll
#

You can provide a sha-1 for the pack

blazing ocean
#

yeah im using the method without the hash right now

young knoll
#

Ah

blazing ocean
#

its on my todo list

young knoll
#

Yeah then it will only update if the name changes

#

Also using E000 - E00B works fine too

hasty prawn
#

I always just appended the hash of the zip file to my URL and that seemed to get Minecraft to update it PeepoShrug

young knoll
#

            in game:

slender elbow
#

square square square

young knoll
#

indeed

#

Private use go brrr

blazing ocean
#

[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []

upper hazel
#

how to delete a key with a value in a file? if I use “section.set(path+key, value) then only the value is deleted but not the key

lost matrix
young knoll
#

Yeah you set it to null

sacred prairie
#

dont forget to save it after edeting it ;)

orchid trout
#

cat translaet

slate tinsel
#

Hello! Is it possible in some way to simulate the shooting of an arrow, i.e. through "ProjectileLaunchEvent", because I want the arrow to travel different distances depending on the bow's charge, how can I do that? 🙂

wet breach
orchid trout
#

understood

wet breach
#

o.O

ancient plank
#

undewstandabwe

median berry
#

What is better for optimizing MSPT? Synchronous event or the same event using async Bukkit runnable?

eternal night
#

ehhh

#

smacking everything into an async runnable is certainly not a good idea

#

most stuff should be fast enough to do on the main thread

echo basalt
#

the best way to optimize mspt is to figure out what's slowing it down

median berry
#

I just want to use a more optimized approach

chrome beacon
lost matrix
#

That is a weird abbreviation

lost matrix
median berry
#

Just my two cents, but it seems to me that in a synchronous event, the MSPS (milliseconds per server tick) load is less when entering compared to an asynchronous Bukkit runnable.

lost matrix
#

You shouldnt load any data in the PlayerJoinEvent anyways

echo basalt
#

new 7smile guide

#

:o

lost matrix
echo basalt
#

oi smile you idiot

lost matrix
#

Huh?

echo basalt
#

you didn't annotate your onQuit method with eventhandler

#

Rookie mistake

lost matrix
#

F

median berry
echo basalt
#

ow using yml for data

#

But no you're doing it backwards

median berry
#

This is local data that I do not want to store in mysql or ram

echo basalt
#

Also smile, I'd probably just make my DAO exclusively use completablefutures to avoid the possibility of doing it sync

lost matrix
median berry
#

This data should be stored from the nickname, because it is stupid to disable local functions to the player and does not cause any harm

lost matrix
echo basalt
#
  • don't nest, guard clauses will help you out
median berry
#

What's wrong with me shortening event to e?

lost matrix
#
    @EventHandler
    public void onPreLogin(AsyncPlayerPreLoginEvent event) throws IOException {
        String player = event.getPlayerProfile().getName();
        if(player == null) {
            return;
        }
        if(!quit.contains(player)) {
            quit.set(player, "");
            quit.save(quitfile);
        }
        if(!sticks.contains(player)) {
            sticks.set(player, true);
            sticks.save(sticksfile);
        }
    }
median berry
#

Thx for help

echo basalt
#

Also @lost matrix One more suggestion for your IO guide - AsyncPlayerLoginEvent is fine to use, but sometimes the player disconnects during that stage and never ends up logging in. Adding this data to your "handler" would be a little icky and result in a memory leak sometimes

#

The quirky solution I've found to this problem was like

#

AsyncLogin -> load data, put it in a 20 second cache (keepalive timeout)
PlayerJoin (LOWEST priority) -> get data from cache, if null kick player -> set it on your handler

lost matrix
#

Yeah i thought about that. But all solutions i came up with kind of made this no longer an entry level guide

echo basalt
#

If the player doesn't end up joining the cache invalidates the temporary data

slender elbow
#

uh kicking in the join event is iffy

#

should at least deny the regular Login event

echo basalt
#

What I did at work was just have a UserLoadEvent and doing all the logic based on that

#

And I'd just start loading the user onJoin

#

Sure it'd result in a bunch of scenarios where player data wasn't loaded

ivory sleet
# echo basalt The quirky solution I've found to this problem was like

Not actually a quirky solution, this is sort of a known problem, a lot of auth plugins and general log in plugins make this pretty much required if you wanna avoid that plausible mem leak. Tho as emily said. It should be done in login, if its done in the join event, I believe once the player is kicked past that, then the quit event fires (which presumably speaking you’d unload the player just fine).

lost matrix
#

When AsynPlayerAcceptedLoginEvent?

#

Wait that wouldnt change much. The player could just disconnect there as well...

ivory sleet
#

I think a classic solution is to listen to APPLE on highest, then the PLE on monitor/lowest (i might confuse lowest highest now)

slender elbow
#

but i mean, if your data takes 30+ seconds to load, i think you have bigger issues than clients timing out, lol

upper hazel
dry hazel
#

you can't touch bukkit api async, but you can do database queries async

lost matrix
upper hazel
lost matrix
#

There are no bukkit methods to access a database

upper hazel
#

Oh, yeah, I'm confused.

#

i mean getting

#

data

#

from database

river oracle
#

CompleteableFuture

#

minecraft doesn't need to "support" anything for you to use asynchronous programming

#

what you can't do is operate on minecraft's feature set ascynhronously

#

this is where CompleteableFuture comes in hande as you can wait for your data then do something synchronously

#

with proper cacheing you can get very fast response times for the data you need

lost matrix
#

Any of those really

upper hazel
#

if i use it main not be stoped?

#

flow

lost matrix
river oracle
# lost matrix Any of those really

tbh one should probably be using CompleteableFuture imho its the best API for something like a database. The BukkitScheduler leaves quite a bit to be desired

upper hazel
upper hazel
#

just for some reason it worked for me

orchid trout
#

men why are ther e only 3 colors

upper hazel
#

In 1 plugin I worked with the lacation search and did it separately

lost matrix
orchid trout
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
lost matrix
orchid trout
#

i import from eclipse

rotund ravine
#

Looks fine ti me

orchid trout
#

project

lost matrix
thin iris
#

ah

lost matrix
thin iris
#

cant u just run it on a diff thread?

rotund ravine
lost matrix
thin iris
#

oh

orchid trout
deep herald
#

anyone know how to get a list of server in bungeecord

#

or like

#

check if the list contains

#

ProxyServer.getInstance().getServers().values().contains(hub)

upper hazel
#

@lost matrix how i undestand i can do sync logic in async metod lol

lost matrix
upper hazel
#

But does it give optimization?

#

doesn't a synchronous thread neutralize an asynchronous thread?

#

or not log error

smoky oak
#

calling a sync task in a async task just makes it run at the next possible frame, back on the main thread. you can pass the data from the async task

#
Player player;
//Task:
{
  Location loc = player.getLocation();
  new BukkitRunnable(){@Override public void run(){
    Bukkit.broadcastMessage(loc.toString());
  }}.runTask();
}.runTaskAsync();
#

here you pass the player to async, grab the location from async, and then call a sync task using the location value

upper hazel
upper hazel
#

all shold be in sync

#

?

smoky oak
#

its meant as an example but afaik read operations can be run async

#

you cant teleport players in async but u should be able to read out their values

upper hazel
#

you mean i can getting all but not use it in async?

#

just for read

lost matrix
deep herald
#

i need to check if a server is in it

lost matrix
#

Then call containsKey

deep herald
lost matrix
#

If 'hub' is a String, then yes

deep herald
lost matrix
deep herald
#

?

#

im checking if its a thing

lost matrix
# deep herald

Print out 'hub' after the first line pls.
And then think about what you could improve in your code.

deep herald
rotund ravine
#

?

echo basalt
#

Those are the registered servers in bungee

#

If you want to check if they're alive, well good luck

#

You can try just checking their motd

#

If you want to see if hub is registered, containsKey("hub")

echo basalt
deep herald
#

my head is on fire rn

#

my brain hurts

#

there it works

quaint mantle
#

please help with solving the error "java.lang.NoSuchMethodError: 'net.minecraft.server.level.ServerPlayer org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer.getHandle()'"
I understand that it says that the getHandle() method does not exist in the "CraftPlayer" class, but I don't see how it can be solved

mortal hare
quaint mantle
mortal hare
# quaint mantle NMS

i believe your NMS code is designed for minecraft version 1.20/1.20.1 if your server is running on 1.20.2 it wouldnt work since the package name for OBC of that kind would be 1_20_R2

river oracle
#

you either need to use reflection or have multiple modules to support multi-version NMS

mortal hare
#

or just cut curners like me and support only one version, if you're doing a private plugin

quaint mantle
river oracle
mortal hare
#

unless your building separate versions

river oracle
#

when I reference reflection I mean the mad lads who do literally everythnig with reflection

mortal hare
#

how do you include craftbukkit implementation inside your project

river oracle
#

its possible they aren't following

#

?nms

quaint mantle
#

I realized my mistake when I read this article. I didn't connect the NMS correctly xD

worldly ingot
#

TECHNICALLY there were

#

They're gone now, but they certainly existed!

chrome beacon
#

👀 there were?

worldly ingot
#

Yeah, Bukkit had native Ebean database support

fluid river
#

what about getting player profile tho

ivory sleet
#

lmaoo

#

noway

fluid river
#

doesn't this thing access like mojang db's or smth

worldly ingot
#

No it created a local database for plugins

ivory sleet
#

sadge it got yeeted

worldly ingot
#

I mean nobody used it lol

ivory sleet
#

well.. understandable :,)

subtle folio
#

built in orm when

quaint mantle
#

Ah yes. Yaml as db

subtle folio
#

it’s so meta

young knoll
#

People love using it for that

subtle folio
#

why use a solution built for mass data like json or sqlite

#

we have yml

young knoll
#

I mean

#

Yaml is just posh json

silk patrol
#

You can help write plugins? but there is no money, help voluntarily. Write in private messages if you help)

pseudo hazel
#

?services

undone axleBOT
young knoll
#

?servicez

#

Doh I typoed

lost matrix
#

?zerfiezhess

#

oops type as well

young knoll
#

I will fight you

lost matrix
young knoll
#

Ah good he doesn’t have netherite

river oracle
solar mortar
#

Question, should I have a Data Table class to represent my database tables, and then a separate class for database operations, like DOA?

pseudo hazel
#

why not

kind hatch
river oracle
#

I shouldn't have to override the plugin itself all shade has to do is shade dependencies

#

why it would work for only 1 profile but not the others is what is strange to me

desert tinsel
#

When I create a potion effect, the duration is in seconds or in ticks?

kind hatch
#
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-help-plugin</artifactId>
  <version>3.1.0</version>
  <executions>
    <execution>
      <id>show-profiles</id>
      <phase>compile</phase>
      <goals>
        <goal>active-profiles</goal>
      </goals>
    </execution>
  </executions>
</plugin>
lost matrix
#

Never seen this plugin before

quiet ice
#

But uh, 1.13 (I think it got removed in that version) is a long time now so might be understandable at this point in time

eternal oxide
#

I noticed Ebean years ago but never looked into what it was

slender elbow
#

even if it was still in bukkit, most people probably wouldn't even know that nor what it is lol

dry hazel
#

something with beans

slender elbow
#

britain

desert tinsel
#

is there a way to push mobs some blocks with code?

smoky oak
#

why tf is a + a legit path symbol

lost matrix
smoky oak
#

well yea but its a legit java path if its not the first char

dry hazel
#

except <>:"/\|?* and non-printable ascii control characters

#

linux filesystems usually forbid only / and the null byte

deep herald
#

anyone know how to set the max players in a proxy ping event?

lost matrix
wooden hearth
eternal oxide
#

timestamps in what context?

wooden hearth
#

Like adding and removing time and storing it in YML

eternal oxide
#

the simplest timestamp is just a long value of milliseconds

#

so you can add or remove time by adding or subtracting 1000

wooden hearth
#

I wanted to show the dates aswell

eternal oxide
#

System.CurrentTimeMillis()

#

is a long for the current time

#

its the time since 1970

#

you can use many types of formatter to display that however you like

wooden hearth
#

Alright thank you

eternal oxide
#

google will have everything you need for java time formatting

wooden hearth
#

they wanted me to use Calendar

eternal oxide
#

god no

#

you only want a time to save to yaml and display

#

you don;t need to edit the yaml manually?

wooden hearth
#

Yeah because I need to compare the time for /mute <duration>

lost matrix
wooden hearth
#

Okay thank you

eternal oxide
#

current millis is fine for a mute command

lost matrix
eternal oxide
#

you can however Duration has no origin

#

Instant would be better if it's time/date

wooden hearth
#

I've never really touched time within mc so yeah

eternal oxide
#

using Instant your mute would be a specific point in time. So if the server goes offline it will still be counted towards teh mute timer

#

eg java Instant mute = Instant.now().plus(20, TemporalUnit.SECONDS);

#

woudl give you an Instant for 20 seconds in the future

orchid trout
#

can you convert an instant to a string?

#

is there a method

eternal oxide
#

you then have things likejava mule.isAfter(

#

yes you can convert

orchid trout
#

how does it look

eternal oxide
#

if you want secondsjava mute.getLong(ChronoField.INSTANT_SECONDS)

sterile token
#

And what is the difference of creating the current millis + amount of mute and then just compare that long against the current millis? Is it different, why / why not

eternal oxide
#

its no different, just Instant has a lot of helper methods

sterile token
#

oh right, thanks Elgarl

#

I will start using Instant so, i have done it with currentMillis all time

eternal oxide
#

simpler to display in a readable format and no math involved

sterile token
#

and what about units? Is there something for parsing

eternal oxide
#

units? its just a ChronoUnit or TemporalUnit

#

there is parsing

#

there is a parse method, check the link I gave

sterile token
#

Something like a format, where i told them use time like: /mute <duration>, for example /mute 10:00:00

eternal oxide
#

Instant instant = Instant.parse("1980-04-09T15:30:45.123Z");

#

you can parse all kinds of formats

sterile token
eternal oxide
#

yes

sterile token
#

right thanks

#

to conclude any format (avalaible of course) will work when using Instant#parse()

eternal oxide
#

section 3

minor granite
#

looking for a plugin developer, dm me

rotund ravine
undone axleBOT
minor granite
#

ty

lethal coral
rotund ravine
#

Yes an interface in java is quite distinct

lethal coral
terse pumice
#

Any ideas what I've done wrong here?
I am running ./gradlew build publishToMavenLocal, I have no issues when running the shadowJar task

Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find org.spigotmc:spigot:1.20-R0.1-SNAPSHOT.
glad prawn
chrome beacon
terse pumice
#

I have indeed

terse pumice
# chrome beacon Have you built 1.20 using BuildTools

I have it in my project and am able to work with it perfectly fine, building with gradle works, but publishing to maven doesn't work.

I re-ran BuildTools a little while ago to check I hadn't messed something up regarding it

chrome beacon
#

How are you building with Gradle

terse pumice
#

I use shadowJar

chrome beacon
#

Could you send your build file

terse pumice
#

For sure!

chrome beacon
#

?paste

undone axleBOT
terse pumice
chrome beacon
terse pumice
reef flower
#

Hi ! I have some issues with my plugin, idk why but when i access to a string stored in the lang.yml (i create), some character like "é" have some issues and looks like cursed char, i thinks it's problem of decoding because the file in my .jar is encoded on utf-8 and it's not a problem of my server because it work with others plugin.
can someone help me ? (btw already search on Google and find any help)

chrome beacon
#

Make sure the file is saved in utf8

#

You can also set that in maven/gradle

reef flower
#

the file is save in utf-8

#

and the encoding is defined in my pom.xml <properties>:
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

terse pumice
chrome beacon
#

If you're not planning on using nms you can use the spigot-api artifact instead

terse pumice
#

I am using nms currently

chrome beacon
#

Then you can't use Jitpack as far as I'm aware

terse pumice
#

Ahh, that's a pain

chrome beacon
#

Github Actions should be able to build it though

young knoll
#

Yeah GitHub actions can run buildtools

chrome beacon
#

It can run BuildTools

gleaming grove
#

How long does It takes actions to perform BuildTools tasks?

#

10min or more?

terse pumice
#

I didn't realise that Github Actions had publishing support

chrome beacon
terse pumice
#

Do you happen to know of an example workflow?

chrome beacon
#

Not atm

terse pumice
#

Ahh ok, all good, thanks nonetheless!

grim ice
#

Listen for a damage event

#

then do the math for entity dmg that mc does

#

but with half the armor lvls

mortal hare
#

yea there's no way i can write plugins on this machine

#

it takes a minute to compile one class plugin

solar mortar
#

hey, I tried shading hikariconfig and dataconfig in my pom, and clean, rebuild and install, so I could import to something like
import sombreshadedpackage.hikari.HikariConfig; import sombreshadedpackage.hikari.HikariDataSource;
This is my pom https://paste.md-5.net/oquteriyox.xml
But for some reason, it does not want to recognize my import

mortal hare
eternal oxide
#

use a different IDE

solar mortar
#

who me?

eternal oxide
#

no

solar mortar
#

okok

mortal hare
#

but i'll try

#

another problem with this pc is that it has a slow ass HDD

west prairie
#

Hi, I'm trying to put an open source plugin one day but the basic Maeven doesn't work.

I can't recover the dependency for these three imports

  • import net.minecraft.world.entity.EntityType;
  • import net.minecraft.world.entity.animal.Fox;
  • import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;

And here is my Maeven file

        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>codemc-snapshots</id>
            <url>https://repo.codemc.io/repository/maven-snapshots/</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.20.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>```

Any idea how to add the missing dependencies?
mortal hare
#

it takes 5-10 mins to boot up

quiet ice
#

How exactly (that is, with what flags), I am afraid I cannot tell as I am a strict anti-NMS guy

mortal hare
#

its a shitty laptop ngl, i5-4210U processor which caps at 2.4 ghz max, 8gb ram and slow hdd, not gonna even mention 1366 X 768 res

#

it sucks

west prairie
mortal hare
#

i've had worse, but the hdd is killing the performance it feels like

quiet ice
#

Yeah then seek help from those that have active experience with buildtools.

#

Uh, you need to build 1.20.2 FYI.
And if you net connection isn't working there is nothing you can do

young knoll
#

If you just want NMS that’s all you need

#

If you’re using mojmap you need to add --remapped

lost matrix
#

And you should def use those mappings

young knoll
#

^

west prairie
solar mortar
#

hey smile how can I access my shaded import? I added it to my pom and it wont work :/

echo basalt
#

damn smile has a lot of time today

bold parcel
#

heya, I am trying to change a glass pane from one color into another, is there some way to do that while keeping the connections of the glass to neighboring blocks?

lost matrix
quiet ice
lost matrix
echo basalt
quiet ice
#

Although we are already on saturday, depending on your timezone

lost matrix
quiet ice
#

Yes.

lost matrix
#

Yeah im watchin the rest of the south park special and then hitting the hay. See ya guys

solar mortar
#

When I go to import my shaded package, it says it Cannot resolve symbol 'sombreshadedpackage'

quiet ice
#

See ya!

quiet ice
eternal oxide
#

you don;t import the shaded path

solar mortar
#

yeah because I was having issuse with hikaricp not loading

quiet ice
#

You generally only import the "normal" package

eternal oxide
#

you import the original. when you build it changes all the references to the shaded version

solar mortar
#

ooooooh

#

so I would use the shaded jar to test the plugin now?

#

and not the regular jar?

eternal oxide
#

no

quiet ice
#

exactly

eternal oxide
#

the one with the short name

quiet ice
#

Depends on the config

eternal oxide
#

the longer jar names are just steps in the build process

#

the shortest name jar is the one to deploy

quiet ice
#

under maven that is the case, yes.

wet breach
#

even then it depends

#

in maven, shaded and one with final name are typically the same jar

#

just one has a different name

quiet ice
#

Though I believe the shaded artifact replaces the non-shaded one. Unless explicitly told not to do so

torn oyster
#

rn I use pterodactyl + its api for on-demand creating/destroying minigame servers but i saw someone using kubernetes for this and I was wondering if it would be any faster or provide any benefits over ptero

dry hazel
#

ptero is basically a glorified docker frontend, so benefits would be accessing the rest of the api + better reproducibility now that you can make the entire image yourself

torn oyster
#

alright

#

is there a way to link proxies together?

#

like proxied proxies idk

ivory sleet
#

like a super proxy?

river oracle
#

@kind hatch I figured out my issue lol. All of my versioned packages have the same package path

#

can't shade every version into the same path

rotund ravine
#

?paste

undone axleBOT
rotund ravine
#

Ignore me

river oracle
#

no

umbral ridge
#

hey

#

in jetbrains ide

#

how do you set up a minecraft project that it exports the jar file also in specific dir?

drowsy helm
umbral ridge
#

I'm getting pissed off because i always gotta drag the jar from the project target dir to minecraft server plugins folder

#

and its repeating process over and over again

#

how do you automate this?

torn oyster
eternal oxide
#

I add a copy command to my servers startup bat file

drowsy helm
umbral ridge
eternal oxide
torn oyster
drowsy helm
#

depends on your setup, nginx, kubernetes theres many

umbral ridge
# eternal oxide yes

what do you mean with copy command? I start the server via batch script as usual.. You add a copy command in project? or how

drowsy helm
#

kubernetes is good but super complex to set up

eternal oxide
#
if NOT exist "plugins" mkdir "plugins"
@echo Updating GroupManger...
copy /B/Y P:\eclipse2020-workspace\GroupManager\target\groupmanager.jar plugins```
drowsy helm
#

but it's far better than ptero

torn oyster
#

yeah i tried to set it up and i kept getting something to do with specifying the right host or port so I gave up on it 🤷

drowsy helm
#

you could use something like rancher

#

makes kubernetes alot easier

umbral ridge
eternal oxide
#

its at teh top of my server startup bat file

umbral ridge
#

hm

eternal oxide
#

eg```bat
@echo off
if NOT exist "plugins" mkdir "plugins"
@echo Updating GroupManger...
copy /B/Y P:\eclipse2020-workspace\GroupManager\target\groupmanager.jar plugins

@echo Updating Regen...
copy /B/Y P:\eclipse2020-workspace\Regen\target\Regen.jar plugins

@echo Updating Planter...
copy /B/Y P:\eclipse2020-workspace\Planter\target\Planter.jar plugins

for /f "tokens=" %%a in ('dir spigot.jar /b') do set p=%%a

if defined p (
echo Starting Server... %p%
java -Xms1G -Xmx1G -Dlog4j2.formatMsgNoLookups=true -jar -DIReallyKnowWhatIAmDoingISwear "%p%" nogui
) else (
echo No Spigot found!
)

pause```

umbral ridge
#

you have to restart the server everytime you build the project?

drowsy helm
#

thats what you should be doing

eternal oxide
#

yes, you always should

wet breach
#

unless you are doing some hotswapping

#

which I doubt you are

torn oyster
umbral ridge
#

It is advised to do it yeah but reload works just fine in most cases. Whenever i do big changes I usually restart it though

drowsy helm
#

yes it does

umbral ridge
#

In eclipse, you could export the .jar directly into the selected folder and it would override the existing one

#

In jetbrains ide, I don't know how to specify the dir to where the .jar should be exported

wet breach
#

java doesn't magically just release loaded class files

eternal oxide
#

replacing a jar on a running server should not be done. Not unless (as frostalf said) you setup hotswapping

umbral ridge
remote swallow
#

If you’re using maven for your Spigot plugins (which you should do), it’s easy to make maven automatically save your plugin’s .jar in your plugins folder. There’s two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...

torn oyster
#

since 443 and 80 are both in use by pterodactyl panel

night copper
#

can someone tell me how can I use gradient colors

#

I saw them being used in newer plugins

drowsy helm
torn oyster
#

the best I could think of was changing this command
$ sudo docker run --privileged -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher to other ports but those didn't work either

drowsy helm
#

it'll have a config somewhere

#

oh you're using docker

torn oyster
#

i clicked get started on their website and clicked on deploy rancher

drowsy helm
#

do you have docker installed?

torn oyster
#

i just couldn't reach the web panel

#

i mean i use pterodactyl on this machine so you'd hope docker is on there lmao

drowsy helm
#

which side of the ports did you change

#

should be able to just change the exposed ports

torn oyster
drowsy helm
#

left side is exposed

#

so 81:80

torn oyster
#

still can't seem to reach it

#

docker ps says this
a33152a27328 rancher/rancher "entrypoint.sh" 13 seconds ago Up 12 seconds 0.0.0.0:81->80/tcp, :::81->80/tcp, 0.0.0.0:444->443/tcp, :::444->443/tcp serene_chaum

river oracle
#

How can I setup my sonatype account to use my domain. I don't get adding hte TXT DNS record. I tried following the tutorial but it makes legit 0 sense

remote swallow
#

did you make the jira ticket

river oracle
#

what

#

Idk what you even talking about

remote swallow
#

to get ur domain you make a jira ticket

river oracle
#

where

#

what do I say lol just gimme my domain you idiots

river oracle
#

they killed their jira

#

Sonatype concluded use of most of our public-facing Jira projects on May 25, 2023

remote swallow
#

what

river oracle
#

oh I got in finally

remote swallow
#

you got me worried there

river oracle
#

wait what do I even say in the issue

#

oh I need to have a specific project

remote swallow
river oracle
#

how long do I have to wait

remote swallow
#

like 15 min or so

river oracle
#

thx epic

remote swallow
#

i have use sometimes

river oracle
#

yes you do :3

glass mauve
#

I've got some problems with ProtocolLib 5.1.0 on spigot 1.19.4:
I get this error: https://gist.github.com/SquidXTV/d726b42fd185c6bbe2cce2e972e28143
I can provide full log, but its probably not needed.
I tested a bit and found out that its caused by this method:

public void setInvisible(boolean invisible) {
    WrappedDataWatcher dataWatcher = new WrappedDataWatcher(getWatchableCollectionModifier().read(0));

    if (invisible) {
        dataWatcher.setObject(0, WrappedDataWatcher.Registry.get(Byte.class), (byte) 0x20);
    } else {
        dataWatcher.setObject(0, WrappedDataWatcher.Registry.get(Byte.class), (byte) 0);
    }

    getWatchableCollectionModifier().write(0, dataWatcher.getWatchableObjects());
}

but there is no hint for the cause

#

also I can prob simplify the if statement with some math?

echo basalt
#

Already talked about this before

echo basalt
# glass mauve I've got some problems with ProtocolLib 5.1.0 on spigot 1.19.4: I get this error...

Illusion Search Index - ProtocolLib Entity Metadata

Pre-1.19, setting a packet's entity metadata values requires setting the desired fields on a (Wrapped)DataWatcher, and assigning that datawatcher (or the packed values, if doing with NMS) to the packet.

With 1.19, the entity metadata protocol changed. Instead of a (Wrapped)DataWatcher, you should create a List of (Wrapped) data values.

ProtocolLib example (new)

PacketContainer container = ...;

List<WrappedDataValue> values = List.of(
  new WrappedDataValue(0, Registry.get(Byte.class), (byte) 0x40)
);

container.getDataValueCollectionModifier().writeSafely(0, values);
glass mauve
#

ah ok they changed it, thansk

#

anywhere to read about that?

echo basalt
#

Nope

#

These are the changes

#

skip the datawatcher, set the values directly

glass mauve
#

ok thanks

potent atlas
#

hey guys remember that one tutorial where you can launch yourself into the air in any direction? I can't seem to find it any more

echo basalt
#

you just need to set a positive y value on a vector

#

and know your direction

#

for example, grab the player's direction, add a bunch of Y to it and set the player's vel to it

glass mauve
echo basalt
#

ye

glass mauve
#

ok that fixed it :D

river oracle
#
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R2.inventory.CraftInventoryStonecutter cannot be cast to class org.bukkit.craftbukkit.v1_20_R2.inventory.CraftInventorySmithing (org.bukkit.craftbukkit.v1_20_R2.inventory.CraftInventoryStonecutter and org.bukkit.craftbukkit.v1_20_R2.inventory.CraftInventorySmithing are in unnamed module of loader java.net.URLClassLoader @7a07c5b4)

Genuinely don't get what is wrong here

        containers.put(MenuType.SMITHING, (int syncId, PlayerInventory playerinventory, CraftInventory smithing) -> new ContainerSmithing(syncId, playerinventory, ContainerAccess.create(playerinventory.player.level(), playerinventory.player.blockPosition()), (CraftChangeDetectingSubContainer) smithing.getInventory(), (InventoryCraftResult) ((CraftInventorySmithing) smithing).getResultInventory()));
        containers.put(MenuType.STONECUTTER, (int syncId, PlayerInventory playerinventory, CraftInventory cutter) -> new ContainerStonecutter(syncId, playerinventory, ContainerAccess.create(playerinventory.player.level(), playerinventory.player.blockPosition()), cutter.getInventory(), (InventoryCraftResult) ((CraftInventoryStonecutter) cutter).getResultInventory()));
``` it's gotta be one of these two lines but I see 0 error
#

fuck I even decompiled the jar and there are 0 issues with the code

#
this.containers.put(MenuType.SMITHING, (syncId, playerinventory, smithing) -> new ContainerSmithing(syncId, playerinventory, ContainerAccess.a(playerinventory.m.dL(), playerinventory.m.dl()), (CraftChangeDetectingSubContainer)smithing.getInventory(), ((CraftInventorySmithing)smithing).getResultInventory()));``` 😭
#

I found the error and its so confusing what

halcyon hemlock
#

this is messy

river oracle
#

🤦‍♂️ I figured out my damn bug anyways

halcyon hemlock
#

ok well imma go eat, good luck mate

river oracle
#

adding this many methods is more bloat then conciceness

river oracle
halcyon hemlock
#

what the hell

signal kettle
#

How I can archieve that if crate contains a word then make another string and then use it to add up to another string?

        if (crate.contains("default")) {
            String crate_type = "default";
        } else if (crate.contains("oak")) {
            String crate_type = "oak";
        } else if (crate.contains("spruce")) {
            String crate_type = "spruce";
        }

        if (heldID.equals("apple")) {
            OraxenFurniture.remove(baseEntity, null);
            String crate_type;
            OraxenFurniture.place(baseEntity.getLocation(), "food_crate_red_apple_" + crate_type);
        }
river oracle
torn oyster
#

how would i cancel right click block for things like trapdoors and doors and levers etc but not blocks

river oracle
#

check the block type

torn oyster
#

i also have this code

#
                Location loc = p.getEyeLocation().toVector().add(p.getLocation().getDirection().multiply(2)).
                        toLocation(p.getWorld(), p.getLocation().getYaw(), p.getLocation().getPitch());
                Fireball fireball = p.getWorld().spawn(loc, Fireball.class);
                fireball.setYield(5.0f);
                fireball.setVisualFire(false);
                fireball.setShooter(p);

                p.getItemInHand().setAmount(p.getItemInHand().getAmount() - 1);```
#

but the player isn't getting knocked back much

#

its meant to be a throwable fireball

river oracle
#

check when the player gets hit with the fireball then

torn oyster
river oracle
#

then apply velocity

halcyon hemlock
quaint mantle
#

not a questionable but simply old and shitty

river oracle
#

@lone jacinth hey, I know you alluded to this in my Inventory PR, but what exactly is the solution to fix the breaking change I introduced. I know you said you had a PR on the way to help with it, but what does the fixing include.

upper hazel
#

why can a dupe occur when trying to take an item from the inventory after the event is canceled?

ocean hollow
#

what's better? save to the database in a column with JSON format or create a new table for each object and set up connections.

I need to save a list of chunks, and then when loading a chunk, restore the information in the object

upper hazel
#

I used to save the object sheet with {}👍

#

or object,object,object

#

but I can't guarantee it's the best way

echo granite
lone jacinth
hushed spindle
#

is there a packet i can read whenever a block is destroyed for any reason

#

whether it be from an explosion or water breaking it or a player or whatever

#

BlockBreakEvent isn't doing enough because its only if a player does it

#

and i guess there's blockfadeevent and fromto and burn but that likely doesnt cover all use cases

devout tartan
#

Hi all, any idea why i can't concatenate strings and ChatColor anymore? I think i used to be able to do that

  Bukkit.getLogger().info(ChatColor.RED + "Hello world!")
eternal oxide
#

your first object is not a String

devout tartan
#

That worked, but why...

#

Thank you!

eternal oxide
#

it tries to guess

devout tartan
#

I see

eternal oxide
#

and as it's not a string it gets very confused

devout tartan
#

Thank you

#

Now to figure out, why my terminal output isn't red :p

hushed spindle
#

you should log severe if you want red console output

#

or i mean i guess it depends on context

#

if you're wanting to just output a generic message to console you might as well just message it

devout tartan
#

I want it colourful potentially