#help-development

1 messages · Page 1293 of 1

thorn isle
#

they've mostly progressed in terms of better instruction following and are able to use tools/functions better

torn shuttle
#

I've extensively used pretty much every model for a lot of things, claude tends to be very considerably better at most things but it's just feeling like it's stagnating pretty badly

thorn isle
#

openai also fairly recently added support for encrypted reasoning contents which made their reasoning models much better at multi-step tasks

torn shuttle
#

but they're all still honestly nowhere near good enough to do any kind of production level programming beyond maybe the most boilerplate of boilerplate code, and even then it's hit and miss

thorn isle
#

they're not replacing a real programmer any time soon but they can do some relatively simple tasks autonomously and more complex tasks with oversight/feedback

torn shuttle
#

I think the most complex task it has ever done for me in a way that was actually pretty much flawless was me asking it to add lerp, slerp and a few other interpolation types as methods

#

oh and some regex

thorn isle
#

yeeeeah i haven't used sonnet at all but i've had pretty good experiences with more complex tasks with gpt4.1 mini, or even deepseek v3

#

e.g., uh

#

i have this nms based image map plugin

#

you place images like paintings, using physical items

#

i had it calculate the resulting size of the placed image in item frames and charge $50 per frame for the creation of the item

#

this involved making modifications to iirc 3 classes

torn shuttle
#

it's weirdly decent at math honestly

#

like

#

it sometimes feels like it is better at figuring out math as a part of programming than it is at programming in general

#

it could not figure out how to program a sane way of making two teleport points where it wouldn't get players stuck in a loop, but it can pretty much write all the rotation matrix systems I could ever want

thorn isle
#

i also had it set up placement limits per area in numbers of item frames, for which it added config entries, player feedback messages with placeholders, and refactored the item frame storage to support "get things in an area" lookups

#

what else did i have it do, uh

#

oh yeah

#

i had it send any downloaded images (for placement) to the openai moderations api and check if they're indecent, and give an error to the user if they are

#

all of these were basically 2-3 sentence descriptions of these features, took ~5 minutes to complete (deepseek is slow), and cost ~20 cents

torn shuttle
#

really teh only good thing about deepseek is how cheap to free it is

#

it's a truly bad model if you use it extensively

#

I guess it's slowly falling out of the collective consciousness but that thing still suffers from the problem where if the context gets to be too large it will just start spamming random words

thorn isle
#

there's a third thing, which is that you can see the reasoning contents, unlike for e.g. openai reasoning models

#

that is invaluable information for prompt engineering

#

and also helps fine tune prompts for non-reasoning models

torn shuttle
#

I recently removed my openai sub but I think that's still just a thing for the free tier

#

at least I was still seeing the reasoning when I was using it like two weeks ago

thorn isle
#

no, they don't let you see the reasoning contents even with the api; only "reasoning summaries"

#

the contents are hidden to prevent reverse-engineering the safety guardrails

torn shuttle
#

guess they changed then

#

doesn't really matter I use claude

#

that does expose the reasoning

thorn isle
#

that's pretty nice

#

well, assuming it's the actual reasoning contents and not a summary like with openai

torn shuttle
#

it is

thorn isle
#

i found one of my feature prompts

#

Implement image placement limits. Search within a X block radius of the attempted placement, and if there are more than Y total item frames used by image Panels within the radius, cancel the placement. Load these values from the config. Note that since we use packet/nms based item frame entities for images, you can't actually search for them through Bukkit: you need to use the PanelManager to find them. Display a friendly error message to a player if they go over the limit. Do this in the hanging place listener in PanelListener and decouple it from the API, as only player-placed images should be subject to the limit; also add a bypass permission node for admins.

torn shuttle
#

I guess that's reasonably simple enough, but I still find that more often than not the AI will do things that are horrendous in one way or another, like picking a horribly unoptimized way of fulfilling a task

thorn isle
#

yeah for complex tasks you need oversight

torn shuttle
#

you always do honestly

thorn isle
#

for those i usually look at the diffs after it's done and then just tell it to do things differently until it's up to my satisfaction

torn shuttle
#

there is one thing I like it for though, when I don't know the docs for something and I can just have it write stuff

#

pretty good for godot or unity

thorn isle
#

it's a decent way to crash-course into an ecosystem yeah

torn shuttle
#

not that I necessarily use what it gives but then I at least know where to look for what I need

#

for some lesser known stuff I tend to just feed it either the entire codebase or the api and tell it to do something for me

thorn isle
#

i do think with some smarter use of tools, functions, and context protocol, even the current small models can be very useful in doing code changes, with oversight

torn shuttle
#

I just wonder if we're starting to stagnate on real progress here

thorn isle
#

i think we have for a long time

torn shuttle
#

if we are then it's still well short of where it needs to be

#

definitely not, sonnet 3.7 with reasoning was a huge leap over models before that

thorn isle
#

reasoning models were kind of a bandaid, current research seems to show that they don't really use reasoning at all, just produce longer pre-learned predictions

torn shuttle
#

reasoning models in general are much, much better than what came before in my experience

#

even if they are a bandaid

thorn isle
#

it's a new dimension to scale the system along

torn shuttle
#

which I do agree with but that doesn't invalidate how good of a technique it is

thorn isle
#

but i'm not sure if "make it bigger" is working anymore, even if we add more dimensions to embiggen over

#

we sort of had "reasoning" even before reasoning models, with chain of thought and tree of thought methods, but the models weren't really trained to leverage them well since they were trained to keep their responses short

torn shuttle
#

can a system that is trained on how humans think even become better than humans at thinking without changing how it thinks in the first place

#

something to think about

thorn isle
#

probably

torn shuttle
#

hm

thorn isle
#

but language is a very small, keyhole-sized window into "thinking"

echo basalt
#

I don't really use chat models but I haven't really felt a decent update for copilot-like AIs

torn shuttle
#

AKTUALLY

thorn isle
#

i'm still waiting for them to train a model on like egr graphs or something

torn shuttle
#

I'll have you know I have a bachelor's in linguistics

echo basalt
#

I still use supermaven even though it's pretty much abandoned

#

I tried copilot a couple months ago and it's still ass

torn shuttle
#

and there's a whole field on how reasoning and language are intertwined

echo basalt
#

I heard grok4 is decent, we tried it at work yesterday and it made a website to visualize some formulas we made with sliders and stuff

torn shuttle
#

haven't looked at that yet

thorn isle
#

shore, but a lot of the shit that goes on in your noggin gets trimmed out on its way out of your mouth

torn shuttle
#

does it have api access yet

echo basalt
#

it's expensive as shit afaik

#

15$ per million tokens

#

no clue about api

torn shuttle
#

same as the rest then

thorn isle
#

that's not even expensive

torn shuttle
#

they're all price fixing at this point

thorn isle
#

the actually expensive models are like

torn shuttle
#

30

thorn isle
#

o1-pro at $600/million tokens

#

o3-pro iirc dropped it to "just" $300

#

or maybe that was 300 and 150

torn shuttle
#

man this is such trash

#

the api is unusably expensive for me

thorn isle
#

enroll in the data sharing plan so they can steal all your shit and you'll get 10M or something daily tokens free

torn shuttle
#

3 in 15 out for grok 4

thorn isle
#

e.g. gpt-4.5 which is normally $150/million tokens

torn shuttle
#

the standard

#

same exact price as sonnet 4

echo basalt
#

just deepseek that shit

torn shuttle
#

crazy how they all independently decided on the price without looking at the price of others

#

hi claude

#

very nice price

#

remember when prices were lowered by 50% every 6 months? good days

#

we need another deepseek bazooka on this pricing

thorn isle
#

openai did drop them by around 30% i think between 4o and 4.1, and prompt caching prices halved from 50% to 25%, and they introduced the flex tier thing that iirc stacks a 50% discount on top of all those

torn shuttle
#

guess i might try gpt 4.1

thorn isle
#

in real world terms i saw my usage in dollars drop by about ~50% because i use a lot of prompt caching

torn shuttle
#

last time I tried it it was unusably censored

#

like

#

man what was it

thorn isle
#

they also introduced 4.1-nano which is half the price of mini but still enough for simple tasks

rotund ravine
#

Gpt has been feeling rlly censored for me

torn shuttle
#

oh I remember

#

I was generating a summary of my D&D session transcript

young knoll
#

AI is bad

#

That is all

torn shuttle
#

and it refused to because there was scenes of violence in it

#

you know, like you have in D&D

#

just guys fighting

#

great

#

some real pg 13 action too

thorn isle
#

mmm i don't think i've run into that ever

torn shuttle
#

well how many D&D transcripts have you fed into it and asked for summaries

thorn isle
#

i frequently use mini to translate chinese web novels with like 🍇 and proper violence and it never complains

#

the chinese are weird with that shit

young knoll
#

Why do you need it in English

torn shuttle
#

tbf I swore gpt off after that one and never tried their api again

thorn isle
#

i also use it 24/7 on my server to censor nsfw messages

torn shuttle
#

guess I'll go try out uh

#

4.1

thorn isle
#

i have more than a few hard n words getting thrown around all the time

#

and it never complains

torn shuttle
#

it is half the price of sonnet 4 at least

young knoll
#

Can’t you censor NSFW messages without killing the planet as much

torn shuttle
#

no

thorn isle
#

nah i want to keep the context coherent

torn shuttle
#

I used to kill the planet for no benefit before, I was doing it before just for the love of the game

#

this is just an amazing cherry on top

thorn isle
#

e.g. it will substitute restarted (as in mentally left behind) to dumb

#

i can't say the word here because your crappy non-substituting world filter stops me

young knoll
#

Alternatively

#

Replace it with ***

thorn isle
#

half of my chat will become unintelligible

young knoll
#

That sounds like an issue with your players

thorn isle
#

e.g. it's fairly frequent net lingo to say something is restarted

#

what they actually mean is that it's dumb

echo basalt
#

silly

thorn isle
#

but some people get their panties in a twist so i'm nice and filter it for them

torn shuttle
#

man I was about to say something really prescient

#

but now illusion ruined it

#

there's like a decade gap in not using that kind of language

#

people did when I was a kid, then it stopped for like 10-15 years and now it's coming back

thorn isle
#

i also use it for realtime translations

#

since it's much cheaper than any translation api out there

torn shuttle
#

aktually

#

not true

#

but not that it matters

thorn isle
#

oh yeah? what's cheaper

#

i went through 4-5 of the major translation apis including iirc amazon and google but all of them were 5 or 10x the price

torn shuttle
#

there's some professional tools that run entirely locally so basically just the price of your electricity but it doesn't matter because they're specialty stuff

#

I run a translation business

thorn isle
#

wouldn't i need a license for that

torn shuttle
#

uh for the good ones yes

#

kind of

#

they're not really made to be real time for the most part anyway

thorn isle
#

i mean i could probably find a free oss machine translation thing out there but i feel like it'd be kind of shit

torn shuttle
#

so it would be a bit janky

#

plus if you are doing in-game chat I would recommend ai instead because it has a better shot at understanding context and slang

#

people hardly type correctly in games in the first place

thorn isle
#

yeah it works pretty well

#

even with the dumbest nano model

torn shuttle
#

yeah translation is definitely a solved problem for the easy stuff

thorn isle
#

translations end up sounding a bit janky because in the middle of nowhere there's suddenly a perfectly capitalized and punctuated sentence, but it's more than understandable

torn shuttle
#

I see so many people accusing random posts of being written by AI when they're nonsensical and are written horribly when AI is so much better at typing and expressing ideas than the average random comment on social media

thorn isle
#

you can wrangle it to use incorrect language but it becomes very difficult with the cheaper models; most ai slop online is full of textbook grammar, oxford commas, and em dashes

#

unfortunately outside of chatrooms i write very similarly so i get accused of being chatgpt on the daily 🤡

torn shuttle
#

yeah same

#

it's like how people were making fun of the word delve during chatgpt 3.5

#

I like that word

#

I use it

thorn isle
#

my sin is the em dashes

barren quarry
#

Hello, could you please tell me what the issue is with the SpigotMC API when trying to get the latest plugin version? I’m getting a 403 error.

slender elbow
#

spigot infra shitting the bed rn

thorn isle
#

mojang authservers were down for a bit earlier as well

eternal night
#

I am trying to clone CraftBukkit, it is giving me a 403, pls help @slender elbow

slender elbow
#

that's good

eternal night
keen lake
#

Nothing can be fetched from spigot hub

eternal night
pure dagger
#

WHAT IS THAT EMOJI

#

cool

#

stupid question but i need to ask
if im making a plugin for someone, and they have another plugin - economy plugin (from someone else) and they want my plugin to check the money, add money etc. the economy plugin should have an api.

#

right?

mortal hare
#

my life is a lie

#

i didnt knew you can mark method with throws for unchecked exceptions and in this case compiler doesnt nag you to t it try/catch it use its unchecked runtime exception

#

acting like a javadoc @throws but embedded into method signature itself

#

eh its useless but cool

wet breach
pure dagger
#

Idk how you do it

#

But the method above has to try catch it or also throw

wet breach
#

when you use throws while the method itself doesn't need to catch it, anything that uses that method will need to though. It is more useful when you are making an API and you want the user to catch the exception instead of the API handling it

sturdy reef
#

So i saw that the only option to make a double jump functionality is by allowing flight to players, the problem is, im making a plugin on commission for a server that has 100+ plugins running on the same server, playing around with the player's flight status can mess up other plugins,
** is there any other way of doing it?**

#

PlayerInputEvent can be triggered if the player walked in any direction while holding spacebar, so it's out of the picture

echo basalt
#

uh

#

client-side the flight status?

novel kite
#

Did Spigot also transition away from using Maven Central or was that only Paper?
Paper has now broken the "libraries" system in plugin.yml for many dependencies since they're using a Google mirror that doesn't have everythinf

eternal night
#

spigot is on maven central

#

which, well, it'll work unless your plugin is run on a host with a lot of those ™

hard tangle
#

<Deleted and reposted here from help-server i got the wrong channel>
Hi guys, i wanted to ask a simple thing is there a world where i can actually set a velocity multiplied by higher than 4.5 in Spigot without it becoming imprecise? with a value of 4.0 it's super precise when i start going up from there it starts being precise only if the player is looking directly on a X or Z vector in the inbetween it deviates a lot

thank you 🙂

potent pecan
#

How do I add an update system to my spigot plugin?

grand flint
potent pecan
#

ye

worldly ingot
#

Or 4 on each axis, I can't remember

worldly ingot
#

If you're hosting on another platform, the first two steps will obviously differ, but generally speaking, whichever platform you upload to, it probably has an API to query for its update history or most recent version

hard tangle
echo basalt
#

TIL I'm a toml mixup

violet blade
#

whats the itemflag to hide the potion effect from tipped arrows?

wet breach
#

Yaml is a superset of json

wet breach
limpid furnace
#

Hello! I am using Spigot's 1.19.4 API and, for some reason, TrimPattern and TrimMaterial are null in 1.19.4. For example:

plugin.log(Level.WARNING, "Test: " + TrimPattern.SENTRY); // null

The exact same jar does seem to work (isn't null) in 1.21.7. I'm aware that 1.19.4 is old and that it's marked as experimental, but is it a known issue and is there a fix?

young knoll
#

Do you have the datapack enabled

limpid furnace
#

Which datapack?

young knoll
#

The 1.20 experimental one

limpid furnace
#

Oh, no. I guess that's the issue. Thanks

winter jungle
#

Is there a way to create a empty end world?

young knoll
#

Create a void generator and then set the environment to END in the worldcreator

#

Or use Bukkit.yml to replace the generator of the default end with your void generator

winter jungle
young knoll
#

Probably something in level.dat

winter jungle
#

Alright, that sounds like its easier to just add a schematic

mystic temple
#

Just realized my first plugin and was wondering if these downloads are legit or not

ivory sleet
#

i mean probably

#

why not

mystic temple
# ivory sleet why not

idk, I am new to the space and getting that many downloads in 12 hours just didn't feel right in my head for some reason

sullen marlin
#

That many?

#

It's 5

potent crescent
#

@mystic temple how u send a image?

#

oh alr

potent crescent
sullen marlin
#

About a day

potent crescent
#

alr thx

empty dove
#
[21:51:22 WARN]: java.lang.InstantiationError: io.lumine.mythic.bukkit.adapters.BukkitItemStack```
This is not a me issue right?
sullen marlin
#

Full stack trace

empty dove
#

I literally copied and pasted the code from the github and tried to run the example and it doesnt work

rotund ravine
#

?whereami

potent crescent
#

?whereami

rotund ravine
buoyant viper
rotund ravine
buoyant viper
#

Hmmm

potent crescent
#

Hmmmmmm

torn shuttle
#

you know

#

for the next april fools

#

definitely should switch that command to show you were in paper all along

#

that would be pretty funny

misty ingot
#

theres no such thing as a map with indexes right

#

id have to go O(N) for getting a value at an index if i use a LinkedHashMap
no better way?

misty ingot
young knoll
#

Yes

#

Or it should support the vault api

pure dagger
#

oki thanks

pure dagger
#
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("erete!"));

is this the right way to do it ?

sullen marlin
#

yes, but recommend ComponentBuilder

pure dagger
#

why?

#

TextComponent component = new ComponentBuilder(message).create()[0];

#

so like this?

#

do i create new component builder evry time

buoyant viper
pure dagger
#

whats that

buoyant viper
#

just sendMessage(ACTION_BAR, new ComponentBuilder("message").create());

pure dagger
#

so no [0]

buoyant viper
pure dagger
#

yeah the ... thing

buoyant viper
#

yeah no need for grabbing an index

buoyant viper
pure dagger
#

but it will be always size 1 ?

buoyant viper
#

theres .build method for ComponentBuilder if itd bother u that much passing an array

#

i believe that one returns a single BaseComponent

pure dagger
#

okay

pure dagger
#

im sending an action bar message to a player every tick, it works on a server without any other plugins. but it doesnt show up on a server with these plugins
anyone know what could happen ?

grand flint
#

delete half see if it happens

#

if it does then its that half

pure dagger
#

ohh

grand flint
#

if not its the other half

#

then keep repeating till u find it

pure dagger
#

this is not my server though

grand flint
#

also idk why u installrf player stats

#

u can just do /papi ecloud download

pure dagger
#

thats not me

grand flint
#

without dowbloading it a s plugin

#

anwyays r u developing for it?

pure dagger
#

for someone yeah

grand flint
#

just install the same plugins on hr own server

#

and do the same search to find it

#

then u can tell them what causes or maybe its in the config

#

antylogout, chemmicspawn, passky, ranking, simpleclans may do it

#

also u got 2 essentialschat jars

#

delete the older one

pure dagger
#

nah

keen lake
#

Is it possible to open writtable books with packets? Because everytime I try it the book is not editable :/

chrome beacon
#

It is not

daring light
#

Would there be a way to restore a custom world to it's original state using SpigotAPI?

#

I want a world that resets every week

#

Now I was thinking of having a directory with the original state of the world and just delete the world and copy that directory everytime, but was just wondering if there was a built-in way to do this

slender elbow
#

no, that process you mentioned is pretty much standard

mellow edge
wet breach
azure vault
#

can i force fence connections?

#

i want the fence to connect to the grindstone, even if it looks wonky due to the smaller block model

wet breach
#

according to the wiki, if the state is set to true in regards to the cardinal direction, it will extend it. So I suppose figure out which cardinal direction that grindstone is from the fence, and then on that fence set the blockstate cardinal direction you need to true

worldly ingot
#

Yeah you'll have to set the block state with physics set to false

#

So get data, cast to Fence, set the side, set the block data with no physics

winter crater
#

Hey there

#

I am looking for experienced developers for my server if u're work is good I will be paying you

#

Pls do dm me

winter jungle
#

?services

undone axleBOT
lilac zenith
#

Hello, I have noticed the method getForce() in the EntityShootBowEvent is now returning a float between 0 and 3, instead of between 0 and 1 as stated in the docs. Is this a bug or is it something with my plugin?

worldly ingot
#

Best to report that on the Jira, yeah

lilac zenith
potent heron
#

how can i upload a plugin in spigot? make me @ plis

slender elbow
#

you go to the resources section and click add resource

potent heron
#

@slender elbow

#

were

slender elbow
#

click Resources

potent heron
#

ok i see the button

#

thanks

pure dagger
#

how to make api

#

?

potent heron
#

@slender elbow

#

in source code what i need to put the git repository?

slender elbow
#

yeah like github or forgejo

pure dagger
potent heron
#

the api of spigot or what?

#

@pure dagger

pure dagger
#

your own plugin's api

hazy parrot
#

you can check on how other plugins are doing it

#

or even spigot

pure dagger
#

uhmm how

#

but how do i even do this

young knoll
#

Look at GitHub/stash

#

?stash for bukkits api

undone axleBOT
pure dagger
#

uhm

#

im creating an instance of class in the class itself

#

and... i can access private fields?

#

like its the same class but different instance.. im confused

slender elbow
#

i'm not sure what you mean

pure dagger
# slender elbow i'm not sure what you mean
public class SomeClass {
    
    private int someVariable;
    
    public void idk() {
        new SomeClass().someVariable;
    }
}

you can access the private variable, even if its another instance


slender elbow
#

sure

#

that is correct java behaviour

#

private means that only the class can access the class' own fields, regardless of instance

potent heron
wooden bay
wooden bay
potent heron
#

For not install more plugins

wooden bay
#

Mind blowing

#

Good good keep it up, you got this

potent heron
#

Hace you downloaded i only want to now

wooden bay
#

Yes I downloaded it

potent heron
#

Oh thanks

potent heron
#

@wooden bay

#

Do you create any plugin

upbeat hornet
#

Damn it works super well

components:
    minecraft:custom_name: {"text":"API Test Sword","color":"gold","italic":false}
    
    minecraft:lore:
      - {"text":"This item was generated by","color":"gray","italic":false}
      - {"text":"ItemsAPI!","color":"aqua","italic":false}
#

And I added nms support for lower versions, so my one API can support servers under and above 1.20.5

tender shard
#

Kotlin beats java in every single important ascept imho

#

Idk why people still hate it

worthy yarrow
tender shard
#

Java just lacks simple qol stuff hence shit like lombok exists

worthy yarrow
#

I mean I’m not gonna diss on kotlin, it’s very nice and the syntax sugar from what I’ve used is great… but I still cannot read it past a first grade reading level and I feel it’s because of all the inferred types

rotund ravine
tender shard
worthy yarrow
#

I like java because it’s extremely strict in its usage of syntax and because I always know what the hell im reading

rotund ravine
tender shard
#

And it became a non-issue very quickly because IDE tells you the type and names should be descriptive anyway

rotund ravine
#

Yeah usually the name sorta becomes a typedescriptor too

worthy yarrow
tender shard
worthy yarrow
#

Call it preference, like I said I don’t dislike kotlin but I enjoy java more

rotund ravine
#

Skill issue

tender shard
#

But after you typed IStorageManager storageManager = new StorageManager(…) enough times… idk you should know that a StorageManager is an IStorageManager

rotund ravine
#

Neverr

#

Rawr java

tender shard
#

val storageManager: IStoragemanager in the constructor. No need to repeat it thrice

#

Then let guice handle the rest

#

I am too tired to construct shit myself

worthy yarrow
#

Psh fine I’ll just use java records everywhere with util classes

tender shard
#

You are confusing object classes with data classes I think

worthy yarrow
grand flint
#

also as if it is relatively similar topic

tender shard
rotund ravine
worthy yarrow
#

I meant it in the way that kotlin has companion objects

rotund ravine
#

They are finee

grand flint
#

idk

wooden bay
potent crescent
#

I sent a report to delete my plugin two days ago and it has not been deleted

#

what should i do

#

should i spam report 😂

echo basalt
#

just wait

slender elbow
#

unless you mean val storageManager = StorageManager(...) ? but then the type is no longer IStorageManager

potent crescent
#

i want keep the plugin private

young knoll
#

Then why did you post it

chrome beacon
#

Insert ban gif

chrome beacon
#

Phone drops to spf when browsing gifs sob

potent crescent
potent crescent
chrome beacon
#

More like ban speedrun

potent crescent
#

ill keep the plugin gor my, servwr

#

e

sullen marlin
#

No need to break the rules

potent crescent
potent crescent
#

lol

sullen marlin
#

It does say on the signup page not to make more than one account

potent crescent
#

But I praised myself on his account 😂

potent crescent
#

Hmmmm

sullen marlin
potent crescent
#

md_5 ur a staff cant u delete my plugin?

sullen marlin
#

If you want it deleted, open a report

#

Why do you want it deleted

potent crescent
potent crescent
#

An hour after I downloaded it, I filed a report.

#

?howold 1.1

undone axleBOT
slender elbow
#

the fact that minecraft 1.0 is only two years older than gta v 😭

young knoll
#

When Minecraft VI

tender shard
#

Rockstar is either procrastinating

grand flint
#

well gta 5 is lasting good enough

tender shard
#

Or producing sth very very great

grand flint
#

i think its like just about time

#

for gta 6

#

its gonna be great no matter what 🙏

young knoll
#

What’s it got like

#

10 more months

earnest girder
#

if I have a Block can someone please show me the code to place an item frame on it on a given BlockFace? All my item frames are breaking

rotund ravine
#

Did u google it

earnest girder
rotund ravine
#

What have u tried

earnest girder
#

a lot of things bro

#

like 12 different methods

young knoll
#

?nocode

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.

young knoll
#

Just take the block, getRelative with the face you want to place it on, then spawn the frame and setFacingDirection to BlockFace#getOpposite

earnest girder
young knoll
#

Block#getLocation

earnest girder
#

ok, you sure?

young knoll
#

What else would it be

#

Might have to add 0.5 on all axis to centre it though

earnest girder
#

I cant believe ive been trying to place an item frame for 2 hours now

earnest girder
remote swallow
#

i feel like ive seen you send the same thing a few times and delete them all, be paitent

young knoll
#

Did you try adding the 0.5

earnest girder
earnest girder
earnest girder
young knoll
#

Idk, place an item frame there manually and take a look at its entity data

earnest girder
#

how?

young knoll
#

I believe F3 I copies entity data

earnest girder
#

F3 opens coordinates

young knoll
#

F3 i

earnest girder
#
/summon minecraft:item_frame -39.50 179.50 4.97 {Motion: [0.0d, 0.0d, 0.0d], Facing: 2b, Bukkit.updateLevel: 2, Paper.SpawnReason: "DEFAULT", Invulnerable: 0b, OnGround: 0b, Air: 300s, PortalCooldown: 0, Rotation: [180.0f, 0.0f], FallDistance: 0.0f, WorldUUIDMost: -6423573177640467344L, Fire: -1s, TileY: 179, Invisible: 0b, Spigot.ticksLived: 742, Paper.OriginWorld: [I; -1495604678, 2114143344, -2041178201, -978612150], TileX: -40, TileZ: 4, WorldUUIDLeast: -8766793615286759350L, Paper.Origin: [-39.5d, 179.5d, 4.96875d], Fixed: 0b}
young knoll
#

Dangit Mojang why is the facing direction just a magic byte :(

#

Okay place it and setFixed(true)

#

That should at least stop it from being destroyed so you can see what’s wrong

earnest girder
#

ok

#

the problem is that its 1 block in front of the block and facing backwards

young knoll
#

Okay so switch the facing direction around and move it back a block

slender elbow
#

you're so right

young knoll
#

Yep that’s code

blazing socket
#

For some reason this isn't working. It prints the block being damaged but doesn't cancel it. Keeping in mind I am new to Java and Plugin development just started today but I have a very big programming background. Any help would be amazing thanks!

//Runs when a block is being broken.
    @EventHandler
    public void onBlockDamaged(BlockDamageEvent event) {

        //Getting the player.
        Player player = event.getPlayer();

        //Getting the block.
        Block block = event.getBlock();

        //Checking if the block is obsidian.
        if (block.getType() == Material.OBSIDIAN) {
            //Returning.
            return;
        }

        //Checking if the player is in creative.
        if (player.getGameMode() == GameMode.CREATIVE) {
            //Returning.
            return;
        }
        System.out.println("Block damaged");
        //Canceling the event.
        event.setCancelled(true);
}
remote swallow
#

did you register the event

blazing socket
#

Yes.

#
//Registering event listeners.
getServer().getPluginManager().registerEvents(new PlayerEventListener(), this);
remote swallow
#

did you try adding some souts above your returns to check where its getting to?

blazing socket
#

Yea it gewts all the way down to the setCancelled method but it doesn't cancel the action.

#

I am wondering if setCancelled is like for a specific version cause I am using 1.21.1

#

Or is canceling the event not doing what I think it should do. Because what I got from the docs is that it cancels you attempting to break the block. So it would be like bedrock were you cant even attempt to break it.

#

Am I correct on that or?

drowsy helm
#

or packets, but that is a lot more work

young knoll
#

Does the event being cancelled just not update the client

#

Rip

blazing socket
drowsy helm
#

the way the client handles block breaking can sometimes be funny, wouldnt be surprised if it cancels server side but not client side

blazing socket
#

Ill try that.

blazing socket
#

Thank you for the help.

young knoll
#

Better than mining fatigue would be the attribute

#

But I think that was 1.21.2? Idk I don’t remember

drowsy helm
#

didnt even think of that, good shout

young knoll
#

The new game drop updates make it hard to keep track

blazing socket
#

Cause I am willing to update if it means that.

young knoll
#

block break speed

blazing socket
#

And were would I find that in docs?

young knoll
#

It’s for the player

#

It’s in the Attribute class

earnest girder
#

what is the best way to put a map of your world in item frames (I have a 5k x5k world and want to put it on a 3x3 grid of frames)

earnest girder
#

how do I even load a map of the world?

fresh timber
#

How can I add a fake player to the tablist. (I am making a feature to hide all players but I want players to still be able to see other players in tablist)

echo basalt
echo basalt
#

with some packet magic or something

fresh timber
#

I don't know how to do that though, do you?

earnest girder
echo basalt
#

Not necessarily, no

#

might be beneficial to use NMS as bukkit's map stuff is slow

#

Either NMS or PacketEvents or something

echo basalt
#

Removing a player from the world and removing them from the server are separate actions

#

As a player can be in the same server but in a different world

#

You basically want to send out the same packets (remove entity) as changing worlds

fresh timber
#

I know like nothing about sending packets. How do I do that?

earnest girder
#

is there a good plugin for getting a map item with an image on it?

sullen marlin
#

You’re in the dev channel

empty dove
#
        Block blockType = e.getBlock();
        if(!blockType.equals("Obsidian") && !bde.getInstaBreak()) {
            e.setCancelled(false);
            bde.setCancelled(false);
        }
        e.setCancelled(true);
        bde.setCancelled(true);
    }```
#

This is what you should do

worldly ice
#

that is not a valid event handler

empty dove
#

LMAO, Yeah. I was providing an example

#

on mobile

#

Its not the exact but its similar to that

#

You would just seperate it

worldly ice
#

block damage event does get called when damaging a block but the visual is client-sided, so cancelling the event would only cancel the event on the server

empty dove
#

Well, what do I know lmao. I just started aswell. I figured since its insta-breaking, it didnt call the damage event

worldly ice
#

im not entirely sure if block damage gets called if the block is an insta-break, probably something to test

#

but either way the block is obsidian so it wouldn't apply

empty dove
worldly ice
#

they are cancelling if the player isn't in creative

empty dove
#

Ah, nvm

#

you right

mellow edge
#

if I stored an instance of an entity in a collection (like I did now), assuming that I only care about it in a minigame without any restarts, is there a way for the instance to become invalid if the chunk reloads?

sullen marlin
#

Think so... Store their IDs

drowsy helm
#

sounds like a lot of risk to save 1 line of code

mellow edge
#

entity id or uuid?

drowsy helm
#

uuid

mellow edge
#

yeah, thought so, basically I am refactoring some old code and I came across this

#

then I could do this?

    private IronGolem cachedGolem = null;
    @Nullable
    public IronGolem getBukkitInstance() {
        World world = game.getWorld();
        if (cachedGolem == null || !cachedGolem.isValid()) {
            return (cachedGolem = world.getEntitiesByClass(IronGolem.class).stream().filter(golem->golem.getUniqueId().equals(this.golemUUID)).findAny().orElse(null));
        }
        else return cachedGolem;
    }
#

instead of always iterating

chrome beacon
#

Use the getEntity method instead of looping

thorn isle
#

And don't bother "caching" it, getting an entity by uuid is very cheap and boils down to just a map lookup

mortal hare
#

project valhalla when

#

give me c# null safety in java!!!

mellow edge
eternal oxide
#

depends

mellow edge
#

assuming no other plugins interfere with it

eternal oxide
#

if no other plugins interfere, yes

mellow edge
#

it's a custom world manually loaded into the server...

young knoll
#

Define manually

#

Any world can be unloaded (except the main world)

mellow edge
#

unloaded by the server automatically?

#

I am just wondering for safety to not hold invalid instances of something, I could also always just call getWorld

young knoll
#

No, but a plugin can unload it

#

The server doesn’t unload worlds

mellow edge
#

so basically I have my plugin that manually loads and unloads it:

    private static void unregisterWorld(String filename) {
        for(World world : Bukkit.getWorlds()) {
            if(world.getName().equals(filename)) {
                Bukkit.unloadWorld(world, false);
            }
        }
    }

    public static World registerWorld(String world) {
        WorldCreator creator = new WorldCreator(world);
        System.out.println("world registered");
        return creator.createWorld(); //loads a world from disk
    }

if no other plugin unloads it, it is safe to store World instances?

alpine solar
#

ion think .createWorld() actually loads the world?

eternal oxide
#

it does

mellow edge
#

it does, that does not matter now

alpine solar
#

since when 🤔

eternal oxide
#

since forever

alpine solar
#

o

#

the more you know

#

yeah this should be fine

#

without other plugin doing the thing

mellow edge
#

I mean if I understand how that works, spigot won't randomly decide to change the instance unless the server is reloaded / restarted or it is intentionally unloaded

young knoll
#

Why do you loop through worlds to find the one with the right name

#

There’s Bukkit.getWorld(name)

mellow edge
#

that is a good point

#

changed

thorn isle
#

the World instance is tied to the world "instance", as in, it being loaded

#

a world that gets unloaded and then reloaded will produce a different World instance representing it, and the previous one will be invalid and shouldn't be used any longer

mellow edge
#

thanks

thorn isle
#

same principle as with entities; when they unload, their Entity instance becomes invalid, and when they load back in again, they produce a new Entity instance to represent them, and the old one remains invalid

mellow edge
#

for all entities I use UUIDs, but for world I assume I don't need to call getWorld each time if I know the world is valid

thorn isle
#

should be safe yes as long as you don't unload that world

mortal hare
#

is there any way to have jspecify annotations working with vscode?

thorn isle
#

if some other plugin randomly unloads it, that's more like an issue with that plugin and not strictly your fault

mellow edge
#

specifically for my minigame that happens in the same session anyway...

mortal hare
#

they do work in intellij but i cant find a way to make them work in vscode

brazen obsidian
#

Hi, how do I make the Bend Sinister Banner pattern? I can't find a PatternType for it.

#

It is basically a line which goes from the top right corner of the banner to the bottom left corner

mortal vortex
#

Patterns have internal names which differ from their pretty names

#

Compare the two

weak wasp
#

Or is it DIAGONAL_UP_RIGHT?

mortal vortex
#

That would be Per Bend Sinister

weak wasp
#

Alright, alright

mortal vortex
brazen obsidian
mortal vortex
fresh timber
#

How can I use packets or something to hide a player from another player without hiding them from tablist/from command arguments. This always messes up tablist and stuff.

wet breach
#

if you are not looking to hide from tablist

fresh timber
#

I'm looking for other ways to do it on bukkit docs but I don't see other ways to do it 😔

#

how do I use the api that way?

wet breach
#

this method will not alter the tablist. Hence it being perfect for your needs 🙂

fresh timber
wet breach
#

Player.hidePlayer() is the method

#

and is part of the Player classs

fresh timber
#

Ah okay

#

I will try it out

fresh timber
#

e.g.

player.hidePlayer(Timelords.getPlugin(), loopedPlayer);
wet breach
#

interesting, maybe it finally got changed on that 🤔

#

anyways, I am assuming the hiding is causing issues with other things?

#

like knowing who is hidden or something?

fresh timber
#

uhh not really I could just make a command to figure out who is hidden if I needed, I just want to be able to see other players on tablist & auto complete them in command arguments even when they are hidden

#

all I want to hide is their actual player like model not from the server completely for that person

wet breach
#

I wonder if the deprecated method of hiding players would work. First for me that this method completely hides them now lol

trim quest
#

i dont understand that how can i fetch spawns as a List<List<Object>> or List<List<Integer>>

wet breach
#

Is simply 2 two lists

#

List<Object> would ideally be your coordinates which is then stuffed into another list to hold all those lists

#

so its a list of lists

trim quest
#

i know but still dont work for both.

wet breach
#

you make the first list which is the List<Object>

#

and then you add that to the second list

#

Alright lets see if I can walk you through in how you would make such a thing.

trim quest
#

then this should work

wet breach
#

so with the link I gave, I have there TutorialConfigs

#

which we can consider as the Object

#

I could make a bunch of TutorialConfigs and then toss them into a list

#

and then lets say I make a bunch of lists of those tutorial config lists

#

this would give us List<List<Object>>

#

Object being there is just that it is not imposing a specific object type

trim quest
#

I just want a small code snippet, I don't want to go through tons of code

#

pseudo code is also ok

wet breach
#

do you know how to add objects to a list?

trim quest
#

I know Collection Framework

#

so

#

i just dont know how this configuration api works

wet breach
#

it isn't complex really. List.add(Whatever you are trying to add)

#

so that is how you add something to a list

#

now you add stuff to the first list right?

#

The second List, is just going to hold objects that are Lists themselves

#

once again using the add method but this time we don't just add individual objects, but instead we are adding the list to a list

trim quest
#

how you would fetch those spawn datas :

worlds:
  world-uuid:
    spawns:
      - [ 0, 64, -100 ]
      - [ 1, 64, -101 ]
#

with spigots configuration api

trim quest
#

There are too many unnecessary details, what I want is simpler.

wet breach
#

what is not simple in what I showed? it is just a for loop and I gather up all the stuff I want in that loop and create my objects or pass the data along

trim quest
#

max 5 line of code could solve my problem

wet breach
#

since you are having problems with multi-dimensional arrays here is a link that will show you how to make them and access them

trim quest
#

no thanks

wet breach
#

then I have no further reason to help 🙂

#

have fun I suppose

young knoll
#

Location is directly ConfigurationSerializable btw

#

You can just get/set a List<Location> to the config

wet breach
#

its Not Marven

trim quest
#

What is the main purpose of posting this tutorial because I don't see any problems with my code that are related to anything in this tutorial.

trim quest
wet breach
#

I showed you how I would fetch data from a yaml file, which that code does indeed do

#

at present it seems you are having issues in creating/accessing multi-dimensional arrays

#

thus why I sent a tutorial on them which is related to your issue

trim quest
#

my issue is related to Configuration api

#

not arrays

wet breach
#

i dont understand that how can i fetch spawns as a List<List<Object>> or List<List<Integer>> Verbatim what you said

trim quest
#

from Configuration api *

wet breach
#

the things you said you had an issue with, are multi-dimensional arrays

trim quest
#

bro i even know Concurrent & Syncrhonized Collections.

wet breach
#

and that proves what?

trim quest
#

i have problem with spigot apis features mostly.

#

not the java basics

trim quest
wet breach
#

so then you should know how to create and access multi-dimensional arrays then?

trim quest
#

yes

wet breach
#

then you would know you couldn't just simply cast the way you were right?

#

well I suppose you could, but it would present some issues lol

#

also casting is not the same as creating either

trim quest
#

It sounds like you're writing just for ego masturbation, and you're not being helpful.

trim quest
#

ok i solved

worlds:
  world-uuid:
    spawns:
    - - 0
      - 64
      - -100
    - - 1
      - 64
      - -101
  c4c74322-3d45-478f-9393-91a69af16286:
    spawns:
    - - 18
      - 89
      - 64
echo basalt
echo basalt
#

code is ass btw you shouldn't use it as an example

echo basalt
#

I'd just do it manually tbf

ConfigurationSection worldsSection = getConfig().getConfigurationSection("worlds");

for (String key : worldSection.getKeys(false)) {
  UUID worldId = UUID.fromString(key);
  ConfigurationSection worldSection = worldsSection.getConfigurationSection(key);

  List<String> encodedSpawns = worldsSection.getStringList("spawns");

  // eh streams sure ok
  World world = Bukkit.getWorld(worldId);
  List<Location> locations = encodedSpawns.stream().map(this::parseVector).map(vector -> vector.toLocation(world)).toList();

  ...
}
thorn isle
#

This isn't really bukkit config api's fault, deeply nested generic types are a nontrivial matter in serialization

#

We can't really have typed getListOfListOfListOfInts() in the api to an arbitrary depth

#

You'd have to start fucking with like gson style type tokens

#

And that honestly goes well beyond what the config api is supposed to be

#

The expectation is that you can always grab it raw as a Map<String, Object> and do whatever parsing/casting you need to do

misty ingot
#
PacketContainer packet = new PacketContainer(PacketType.Play.Server.WINDOW_ITEMS);
packet.getIntegers().write(0, 0); // Window ID 0 pour l'inventaire du joueur
packet.getItemListModifier().write(0, Arrays.asList(items));

// Envoyer le paquet au joueur
ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet);

i am sending fake items to the inventory of a player, items is an ItemStack[]
slots 9-35 are working fine and putting items inside the inventory but i also want to put some items in the hotbar (slot 0-8), i do everything correctly but the items in the hotbar never show up and i dont get any errors

wet breach
#

your example literally is what my code does basically.

echo basalt
#

yeah but it's properly styled and looks readable

#

Just because they achieve the same result doesn't mean they're as good of an example

wet breach
#

its styled properly o.O

echo basalt
wet breach
#

just because someone has a differing opinion doesn't mean it is not styled properly

#

it follows conventions last I checked. As for readability, sure I probably could have spaced the lines apart

echo basalt
#

not falling for the ragebait

wet breach
#

its not rage bait you said it was not styled properly

#

never clarified what wasn't all I said is that it follows conventions 🙂

#

Anyways if the only two issues is that though, then functionality wise what I had given them was correct as it works.

#

therefore it is an acceptable example since they did ask me how I would do it

#

seems they were happy with what you given them though, so a non-issue at this point lol

slender elbow
#

if writing dogshit code that functionally works means I can throw it as a tutorial example …

grand flint
#

yeah after years of making the best projects

#

u realise nobody ever gave a shit

wet breach
#

so....not sure what you mean by this

grand flint
#

now i just write, safe and runnable code

#

and i get players for it 💃

wet breach
#

oh

slender elbow
#

I'm not saying it is dogshit, although it could do a little cleanup, we are all guilty of unreadable code, but that there's definitely more value to a presentable example

orchid brook
#

Hi What is the best way to get the position of the fishing bobber when a player throws their fishing rod?

orchid brook
#

Actualy im listening to the PlayerFishEvent with event.getHook().getLocation(); but by doing this i need to wait a BITE.

sly topaz
#

but I am curious, what are you using fake items for?

sly topaz
#

though I was under the impression the fish event also triggered when the player just threw the fish hook into the water and not only when a fish bites

orchid brook
#

Do I need to add a short delay after the player casts the fishing rod to wait for the bobber to land in the water?

#

because i want the location of the bobber when he land in the water

sly topaz
#

why do you not just check whether the PlayerFishEvent's state is FISHING, that should be exactly when the hook is in the water

orchid brook
#

Im gonna check

fresh timber
wet breach
fresh timber
#

yea it makes it worse lol

#

(well I mean it would have fixed it if it worked)

wet breach
#

if only you needed this in the past

#

because in the past it didn't remove players from the tablist XD

#

would using the scoreboard method achieve what you are wanting? Not even entirely sure if it removes you from tablist either

pure dagger
#

.equals or == with Player?

wet breach
pure dagger
#

yeah what else?

sly topaz
#

equals, though I would rather check if the uuid is equals

pure dagger
#

oh okay

echo basalt
#

== is the technically safe approach

#

.equals will work

#

ideally yeah compare uuids

#

if .equals passes and == fails you have a memory leak

wet breach
#
==
Compares if two references point to the same memory location.
    
.equals()
Compares the content of objects.
sly topaz
#

ah, CraftPlayer's equals checks for UUID equality anyway

#

well, it checks for uuid and network id, I wonder why

echo basalt
#

uh

#

npcs?

echo basalt
#

would be incredibly cursed

sly topaz
#

NPCs aren't CraftPlayers though, they're just nms.ServerPlayer if they implement it that way

#

but could be, who knows. Maybe it is a leftover from ancient times

misty ingot
sly topaz
#

for documentation on the protocol, you should check the minecraft wiki. In your case specifically the Set Container Content packet documentation

fresh timber
wet breach
#

well, hopefully it works for you

wet breach
echo basalt
#

every entity has its craftwrapper

#

that gets lazily initialized when calling .getBukkitEntity or whatever

sly topaz
#

even if they do, I imagine it'd end up falling as a CraftEntityHuman or NPC

misty ingot
# sly topaz try using window id -2

window id -2 made it so now none of the items are appearing

// Créer le paquet WINDOW_ITEMS
        PacketContainer packet = new PacketContainer(PacketType.Play.Server.WINDOW_ITEMS);
        packet.getIntegers().write(0, -2); // Window ID 0 pour l'inventaire du joueur
        packet.getItemListModifier().write(0, Arrays.asList(items));

        // Envoyer le paquet au joueur
        ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet);
sly topaz
#

window id 0 should work for the player inventory in the set content packet, however are you pointing to the right slots? Hotbar slots should be from 36 to 44

misty ingot
#

yeah i just figured that out

#

its fixed now

orchid brook
#

This is fired when we right click with the fishing rod

sly topaz
#

ah so same as entity spawn event then

orchid brook
#

yep

#

so i should add a delay

sly topaz
#

if you're using paper, you could take advantage of the FishHookStateChangeEvent or whatever it was called

#

if you are not, then I'd just put a while loop or repeating task in the event that checks for the FishHook state until it is BOBBING or whatever it is when it is in water

orchid brook
#

Witch fishHook state should i use so ?

buoyant viper
sly topaz
sly topaz
buoyant viper
#

PR time

regal cairn
#

yo we need a minecraft dev for our server , mic included and youll will get something in return ,dm pls

buoyant viper
#

whats minecraft

grand flint
#

ur love and friendship?

sly topaz
#

?services

undone axleBOT
regal cairn
worldly ice
#

that doesn't sound suspicious at all

regal cairn
#

well im just the helper of the owner and i cant really make decisions

grand flint
#

so are u gonna stuff my ass or something wtf

#

"i cant just say it on discord"

#

my bad mr taliban

young knoll
#

It’s actually 10 tokens in my new cryptocurrency

#

It’s surely going to moon

nova notch
potent crescent
vocal cloud
regal cairn
#

nah we already got a developer that we paid for

#

myf though ill take full blame

potent crescent
#

u can tell me that u just blocked me

#

go away bro

regal cairn
#

well im in a rush and im sorry that it made you feel some type of why but im prolly not gon talk you so jus ended it you could have block me to

#

i wouldnt mind

potent crescent
#

really idc about that for all

#

lol

young knoll
#

Always good to hire people in a rush

regal cairn
#

exactly

potent crescent
#

all good

austere cove
#

does the bukkit scheduler guarantee tasks are executed in the order they were posted

lilac dagger
#

I think it's a linked map

#

But to be sure check the craftscheduler impl

sullen marlin
lilac dagger
#

Yeah, If it's not documented the behavior can change at any time

#

Effective java talks about contracts and what they mean

summer scroll
#

Hey guys, is there any specific event that gets fired when Bukkit.dispatchCommand(Bukkit.getConsoleSender, ...) being called?
I've tried ServerCommandEvent and nothing comes up. This is how I debug it.

@EventHandler(ignoreCancelled = true)
public void onServerCommand(ServerCommandEvent event) {
  System.out.println("event.getCommand() = " + event.getCommand());
}
sullen marlin
#

What are you trying to do

summer scroll
sly topaz
# summer scroll Logging commands.

you would be better off listening to the chat packets for that, the dispatchCommand method seems to bypass minecraft internals (except for vanilla commands I guess, since there's a wrapper for them) so even if there was an event injected somewhere, it wouldn't be triggered

#

I wonder how it handles brigadier commands being registered directly, I guess whoever do this would also have to register them in Bukkit's SimpleCommandMap for it to stay in sync

mortal vortex
#

This might seem so novice, but I cant remember the last time I worked with placed blocks... ahem...
when doing #setType() on a bed, how do you prevent like half of it being left?

#

The result of performing setType(Material.PURPLE_BED), where a green bed once was.

sly topaz
worldly ingot
#

That's the default state. You have to retain the block data

mortal vortex
#

it breaks lol if i put a block where the head should be

#

oh

sly topaz
#

I would've expected setType to handle this type of thing tbh, given there is no setType for bisected blocks specifically

mortal vortex
#

Ja

worldly ingot
#
Bed oldBed = (Bed) block.getBlockData();
Bed newBed = (Bed) Material.PURPLE_BED.createBlockData();
oldBed.copyTo(newBed);
block.setBlockData(newBed);
mortal vortex
#

Choco you a skibidi

#

Thanks

worldly ingot
mortal vortex
#

What makes you think I'm not a pesky TOS violator with a message logging plugin?

sly topaz
#

I love how in the forums people choose to do this instead:

Block bedBlock = p.getLocation().getBlock();

bedBlock.setType(Material.RED_BED);
Bed bedData = (Bed) bedBlock.getBlockData();
bedData.setPart(Bed.Part.HEAD);
bedBlock.setBlockData(bedData);

Block footBedBlock = bedBlock.getRelative(bedData.getFacing().getOppositeFace());

footBedBlock.setType(Material.RED_BED);
Bed footBedData = (Bed) footBedBlock.getBlockData();
footBedData.setPart(Bed.Part.FOOT);
footBedBlock.setBlockData(footBedData);
mortal vortex
#

LOL

#

maybe old work around?

worldly ingot
#

Well that's if you were setting the bed in the world

#

You're just replacing a bed, right?

mortal vortex
#

Yeaa

worldly ingot
#

Then yeah you only need the simple part. But if you were setting the bed in the world, both parts, with no parts to replace, you would have to do that ^

#

Could probably simplify it a bit by pre-creating the block states, but yes, same principle

mortal vortex
#

I'm imagininginging this is the same principle if I wanted to replace a collection of 4 candles as well without overwriting them to 1?

worldly ingot
#

Yes

#

You could honestly generalize that a bit. You don't have to cast to Bed at all. In fact, I'm not entirely sure why I did lol

mortal vortex
#

ur a sigma das why

worldly ingot
#
private void replace(Block block, Material material) {
    BlockData oldState = block.getBlockData();
    BlockData newState = material.createBlockData();
    oldState.copyTo(newState);
    block.setBlockData(newState);
}
mortal vortex
#

🗣️

#

this guy knows whats up

young knoll
#

Man I wonder what genius added copyTo the API

worldly ingot
#

Yeah if only we knew

sly topaz
#

runs

young knoll
#

I'll copy you to the API

sly topaz
#

I wonder if this is something that should be handled by setType tho, I doubt anyone wants the default behavior what it is right now

#

I guess it is too late to change it now

worldly ingot
#

If you wanted a really fancy way to do it, this would also work I believe:

private <T super BlockData> void replace(Block block, BlockType.Typed<T> type, Consumer<T> changer) {
    BlockData oldState = block.getBlockData();
    T newState = type.createBlockData();
    oldState.copyTo(newState);
    changer.accept(newState);
    block.setBlockData(newState);
}
#

(changer is optional, I just threw it in there for fun)

#

omg I'm going to typo every fucking message I send today, aren't I?

sly topaz
#

it happens

young knoll
#

he's using experimental API!

#

Get him

worldly ingot
#

They are internal types for the time being lol, and the snippet I sent earlier works totally fine. I'm just getting excited for fancy new APIs PES3_SadCat

sly topaz
#

they've been experimental for a while now, but they look solid to me

#

don't know what else is missing to just ship them as non-experimental

worldly ingot
#

Not even experimental. They're internal so Material can work better

#

They're internal because you can't really use them anywhere in the API

#

You still need a Material practically everywhere

eternal night
#

tl;dr presumably being, at some point Material just semi dies and is replaced by Block/ItemType. Instead of like, overloading every place that takes Material

sly topaz
#

just change every instance of Material in the API and then fix all plugins with Commodore 😎

eternal night
#

Yea pretty much

sly topaz
buoyant viper
#

dam

#

Set<String> EVIL LOL

sly topaz
buoyant viper
#

i like the RENAMES map whose first entry is a typo

buoyant viper
#

id like to report inconsistent code by mixing Map.of and Map.ofEntries

#

ApiVersion.ABSTRACT_COW 😭😭😭

mortal vortex
#

Aligment 🙏

acoustic galleon
#

Does anyone have a multi-version inventory framework api?

slender elbow
#

what's wrong with the Inventory interface?

acoustic galleon
grand flint
#

this is how u become rich ong

slender elbow
#

what becomes easier?

#

the Inventory interface has been the same for the past 10+ years

acoustic galleon
slender elbow
#

just for GUIs?

acoustic galleon
#

yes

slender elbow
#

people seem to like triumph-gui, or IF

acoustic galleon
#

IF from devnatan?

slender elbow
#

no clue, from stef I think?

acoustic galleon
slender elbow
#

idk I've never used it

#

try it out

echo basalt
sly topaz
misty ingot
#

why isnt Block#getType just BlockType
every single time i use it i see Material as the return value and i have to recheck what i just typed

trim quest
stray loom
#

Hello

#

The GadgetsMenu plugin isn't working for me. What can I do?

grand flint
worldly ingot
pure dagger
#

how do i get player names, and get players by name when they offline

alpine solar
#

There was a depricated method iirc

#

Server#getOfflinePlayer() or smth

grand flint
#

yeah

#

Server#getOfflinePlayer(String)

#

you can use name or uuid pretty sure

#

and u can do OfflinePlayer#hasPlayedBefore

pure dagger
#

should i use it if its deprecated?

alpine solar
#

nop

pure dagger
#

so...?

alpine solar
#

just use hasPlayedBefore and getName

pure dagger
#

oh okay

alpine solar
#

@grand flint that'll work right?

#

wait holdon

pure dagger
#

???

alpine solar
#

nvm

pure dagger
#

so

alpine solar
#

I was thinking

#

it should work

orchid brook
#

Hello im using buildtool to build 1.20.3-R0.1-SNAPSHOT. All work i can see the folder 1.20.3-R0.1-SNAPSHOT in my maven repository folder local.

But when i do

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

He can't find it and that doesn't work is anyone have an idear ?

alpine solar
#

OH wait

#

dont you need mappings for this?

pure dagger
#

if ishouldnt use deprecated

orchid brook
#

Idk i just download a plugin source code and i see that i need 1.20.3-R0.1-SNAPSHOT
so i just run java -jar BuildTools.jar --rev 1.20.3 but i still can't compile it

alpine solar
#

?mappings

undone axleBOT
alpine solar
pure dagger
#

other plugins do that

grand flint
#

why does he need to get the name

#

if he is getting the player by name

#

💀

grand flint
grand flint
pure dagger
#

but its deprecated so should i use thta

white crescent
#

can anyone help me how to get gui moved to left?

alpine solar
pure dagger
white crescent
#

I need it to left

orchid brook
alpine solar
#

I'm extremely rusty with bukkit

#

Dont believe whatever I say

grand flint