#help-development
1 messages Β· Page 766 of 1
Doesnt that apply to any questions here, kind of break the point of help channel existence
It doesn't
Practically yes
Depends
But usually its not too shabby to partition it per functionality
Like
can playerInteract cause bugs?
yeah, like the double interact
here's a list
- Can trigger twice
- Sometimes does not trigger
- The way around it (ArmAnimationEvent) cannot distinguish left and right click
- (only reported to me, couldnt verify) sometimes right click gets read as left click
It triggering twice isn't a bug. It's called for each hand and you have to account for that :p
That's very much intentional
Aight, are the instances when it sometimes does not trigger documented ?
Never had that problem
ik but thats not the issue im having lol. relevant for both of u i guess
theres a specifici distance where neither interact nor entitydamage triggers when you left click
- maybe cuse this player can click 2 times
i know that, it's just is a bug for older plugins
That sounds like the fault of older plugins not updating after 7 years π
yeah plugin authors should awaken from their decade old slumber to update their abandonware
But 1.8 -> 1.20 support π
MethodHandles lol
1.7 to 1.20.2 take it or leave it
Though speaking of updating, I should check whether EnchantmentsPlus still works on the newest versions
But eh, not so much should have changed between 1.19.2 and whatever the current version is now
Only nms stuff
Which I use oh so much
Although the codebase is still largely the same as it was 1.16
1.21 the update of change!!!!
The first decision I made was to ditch it - a good idea
If I don't see registries merged in 1.21 just gonna run off the experimental branch and code for that until it runs l ok l
Maybe inventories in 1.21 too who knows:3 need commodore though for it to not break things
Well I'll probably will make my own spigot artifact so I do not have to update all my switch statements
Uhm so
The PR handles all of that :3
Don't you worry
Well for bytecode
You shouldn't be using switch with material anyways
Or most of the enums tbh thats cursed
You cannot switch on non-enums
Actually nvm it's not
At least at compile-time. So naturally you know where I am getting at
Yeah, but what is the point of updating if you still use deprecated APIs?
when are we getting bukkit v3.0
When are we depreciating spigot and moving to cb
when craftspigot
god CB is dead, and we killed them.
Well no one really prs spigot though only cb
Well at an actual source level
Though there are some fairly notable exceptions such as components
what would the wierd material update break anyways
no, a cb killed itself
Nothing until you open uo your ide
spigot just reborn it
Then anything you do with the enums pretty much that non enums can't do
what
i thought the new material will be in different classes?
Well there is a shit ton of byte code fixed at runtime that prevent it from breaking
Well material isn't the only thing moving to a registry while this is true
Pretty much the death of enums
I've got a PR to kill InventoryType too
why
arent those inventory types the only ones the vanilla client can interpret anyway
real talk though its not easy to explain if you kinda don't have a semi bearing for internals
For now
see this is my problem without digging into it one would assume this but its not even true
do you have a pr to make spigot multithreaded
damn fr?
someday maybe I'm not skilled enough to do something like that
thats wacky
class DedicatedServer {
void tick() {
// tick logic
new Thread(this::tick).start();
}
}
there are less that can InventoryTypes, rather than more
that's my server impl
wait, doesn't this create too many threads and die?
Looks good to me
lgtm merged
it works on my machineβ’οΈ
@opal carbon
Basically, I'll try to make this less complicated. InventoryType is really a combination of two things. 1. an inventory which only stores items. 2. a Container aka MenuType which is what is displayed to the player. As you might imagine this is really fucking amibguous. If you're curious what can be expressed just look here
https://hub.spigotmc.org/stash/users/y2k_/repos/bukkit/browse/src/main/java/org/bukkit/inventory/MenuType.java?at=refs%2Fheads%2Fcontainer-api
ah okay
for example InventoryType.CRAFTING which is the players inventory can't be opened, neither can the CreativeMenu those are client side only
https://hub.spigotmc.org/stash/users/y2k_/repos/bukkit/browse/src/main/java/org/bukkit/event/inventory/InventoryType.java?at=refs%2Fheads%2Fcontainer-api even more showing each InventoryType that is associated with a MenuType will have a non null enum parameter
well, there is a registry for the creative menu nowadays π
it isn't network synced, but maybe one day
one can hope
There are many registires I would rather have first :p
why does composter even have an inventory lol
because
an inventory isn't what the player sees
its just a slot
like thats it
better than like 7 block states lol
the composter has a slot you can put items in technically under the hood
Its for hoppers mostly
java - jar BuildTools.jar --pr BUKKIT:926 CRAFTBUKKIT:1282
Did you provide a test plugin
no I should do th at though my test plugin is kinda ass
I use the same plugin for every test :p
I just slap code into a /test command or an event
really this plugin has like 4 commands
That's way too much effort
I also have tab completion for arguments
final Inventory inventory = Bukkit.createInventory(null, type);
inventory.setItem(0, new ItemStack(Material.DIAMOND_AXE));
TestPlugin.thenLater(() -> {
player.openInventory(inventory, "UwU");
}, 1);``` UwU
titles are nolonger bound to inventories
UwU
UwU
Ew
@eternal night lurker

ew
I thought youi were typing for a second
Why does inventory.setTitle not exist anyway
it actually got me π
π
uhm because Inventories don't have titles
that's stupid API
smh
You can with nms
Inventories do have titles
no not in NMS
Yes
;
really I'd love to see the IInventory impl that's not CraftInventoryCustom with the title methood
Hey if I can pass a title when making it
CraftInventoryCustom isn't NMS its a terrible patch job for a bad api
Then I want to be able to change that tile
Yea exactly
It's using some private class as inventory
you don't pass a title when making an Inventory with my change, and if you do CraftInventory handles the legacy createInventory and assigns the title
So can't access it
Or a suplier for title
That would be nice too
I don't like rebuilding my inventories when the lang file is reloaded
:c
Huh

well moving the title to where it belongs
fixes all of this
in the InventoryView
not the Inventory
How does the legacy stuff work

I use the new backend with a few work arounds
AnvilInvetory specifically is very hacky
.
but there is not much that can be done about that. Bad API addition bad lognterm consequences
adventure$title ποΈ
πβπ¨
π§Ώ
Ideally I would do all my translating on the packet level
Deleting CraftContainer was the happiest moment in my life (wow i have a sad life)
But
- I don't want to use a packet api
- Translating a string to 1 or more components sounds kinda painful
fair
just don't allow people to reload your lang files
protocol lib is the enemy

NMS is easier change my mind
and way less laggy
pappa packetevents
really i just use NMS events much easier
honestly don't even use the bukkit api anymore
you have to
no I made my own pluginloader for NMS much easier than using whatever tf bukkit is
unless you're okay with changing your code at mojang's whim
(I'm joking if it isn't obvious)
sorry, i can't see jokes today haha
I mean we have api methods for a lot of packets
But not everything
The virtual entity/snapshot PR will open a lot of possibilities
I gotta test that one still
I need to test it more too
I didn't hab issue wif pwotocowwib and sending pwackets
And fix some final stuff
It's just very verbose
I mean, I know why it's verbose, but still
I saw there's no way to make an entity without spawning it right?
Da onwy issue I had was wif da pwotocow website an twying to figuwe out if I couwd even do wut I wanted
Meant under the pr I didn't see anything about that
thing always worring about the "lets do virtual entities by just reusing the entity interfaces" is the general assumption that held till now that well, you should only really have an instance of Entity if it is alive and well
so plugins doing wild stuff with that "premise" are gonna get fucked
There is world.createEntity iirc
It shoudln't break plugins too much
Since they likely will never recieve a virtual entity
Yea I mean that is kinda the gamble π
I'm trying to think how they would get it
I mean, API ?
Ah
plugin D passes it to N
its not gonna run into it from world querring yea
?
Well like, Entity still exists
Yes
The somewhat implicity contract of the entity type is the one that is getting mutated
retconned into existence that it can also represent an entity that is not in a world
So far I haven't seen any issues from mutating virtual entities
Well yea most things should be fine, hopefully ?, that just needs a lot of going through methods
i mutate some parts of my nms entities no problem
it depends tho on some methods that might require the entity to be bound to a world
I suppose I could probably remove the virtual entity part altogether and just rely on snapshots
idk
it is
Entity is always bound to a world, just might not be spawned in said world
idk, I mean, there is 100% a need for something along the line of a fully fledged interface for setting this
snapshot is useful too 100%
actually, wait let me see what your snapshot concept was xD
e.g. fun side question, what happens with addPassanger ?
On a virtual?
yea
Not too sure yet
I imagine a virtal passenger on a virtual works as one would expect
True
which, if no, I guess that is fine maybe ?
If yes, oh god now we have virtual entitys in an event
now we don#t even need plugin A to pass to plugin B

Although it may just be fine for old plugins to recieve virtual entities
If they behave the same
I need to remember to make that jira ticket for direct byte serialization of certain objects
Doesn't that use ConfigurationSerialization
Hello wizard
Aka it turns it to strings first and then byteifies that
ehh, it throws the Map at the object output stream iirc
?paste
I imagine that is less compact than direct NBT serialization
like yea, depends completely on the format
Emily's a network developer I can tell
Plus direct nbt serializtion can work on stuff that isn't ConfigurationSerializable
Sure, idk its introducing a new binary format to the API
those are always fun
and people tend to go over board
doesn't paper have a fucking PDC to blob method ?
i mean they're just different formats, e.g. with jvm serialization you can have cyclic references, A has field B has field A, if you throw something like that to a CompoundTag it'll blow up lol
Yea idk, I mean you can certainly throw a bunch of random toByte helpers everywhere, that is pretty much just what paper does
or you can dream up a new way to serialise stuff
which might be nicer down the line maybe but maybe not
pack that shit up
8 bytes per byte
free real estate
Yeah basically I want what paper does
lmao

Someone link the Jira issue about "just pull all paper patches"
Who uses longπ
I'm smart and I screenshot the preview window
No clue why they never considered that
damn
Twas a fun ticket
lmao that was so good
if it's so good then why didn't you pull all paper patches
Checkmate
I mean
*mid
If it wasn't for the CLA
The patches are mid
where link, let other ppl have fun as well
And, you know, morals went out the window 
java or kotlin
And then you wait for leaf to return because now your world border kills people
The price you pay for paper atches
python or java
Javascript
both
J#
π€ guys lets implement spigot API with rust
it'll be so much faster, and the project won't die within 1 month
and code flow would be water flow
kinda nice
methods could be waves
i think im onto something
import minecraft from minecraft
minecraft.run() ????
(minecraft.run is implemented in c)
yep
precisely as one would write any python program
just simply implement it in C
everybody knows python is just as fast as C if you write it in C
I can see the drama now PYTHON IS NOW FASTER THEN C!
I did work on a minecraft in python impl once - never again.
whoever wrote that needs to step back and realize they need to learn another language
I have written a plugin that adds new blocks like solar panel, controllers, electric furnace. They currently transfer electricity between them only when they are placed close to them. I want to make wires between them. Wires are a fence block π
sry for the cyrillic in pictures, no more screenshots π
now I need to think how to realize the wires
maybe someone has seen it somewhere?
I just need a starting point
Just do wireless transfer \s
you should use leads
I think that'd look neat
you can probably gett away with hooking them to display entities maybe?
that way they aren't as bulky
or you could use display entities themselves
hmm
Is there something like vault for vanish plugins? Or do I need to look for all existing vanish plugins and try to hook into those?
yeah no, Vault is an oddity in plugins
there really aren't many standards as constant as vault
So I guess the latter then?
you are really right
I will try to implement it this way
/**
* Return true if the player is vanished. We check for "vanished"
* metadata value which is supported by most plugins (CMI, Essentials, etc.)
*
* Does NOT return true for vanish potions or spectator mode.
*
* @param player
* @return
*/
public static boolean isVanished(final Player player) {
final List<MetadataValue> list = player.getMetadata("vanished");
for (final MetadataValue meta : list)
if (meta.asBoolean())
return true;
return false;
}
for example
you can also consider just checking Player#canSee
Metadata

I can't go to class today cuz my car broke down :( time to just fuck around with NMS and bukkit all day
oh no wut happen to car
true, considering that battery is old as fuck
I don't think its been replaced for many years
I honestly can't remember the last it was replaced
Hi guys I want to write a plugin with custom damge, how can I get started?
What type of damage
items
??
Please speak in full sentences with a proper overview of what you are looking to create
Instead of whatever that is
based on the damage displayed on the item ig
Is that custom?
What
like this dmg on the item
I cant use this in my case, but I'll take a look at the meta data for popular vanish plugins.
You mean like this

That is pretty hot
Are you spawning an invisible lead entity and an invisible armour stand or something?
Not sure. Never tested it
I believe you can ride them though. I know you can ride interaction entities. I specifically tested that
Armor stands tick too much :P
you can ride them
fs
``
Entity entity = this.getVehicle();
if (entity != null && entity.isRemoved()) {
this.stopRiding();
}```
they tick
so
wonder why this can't be done lazily
like I wonder if the entity can be removed on the server if the remove method is not called, otherwise you could probably just override remove and do this
how do i git ignore a file again
go into your gitignore and type in its path
you can also ignore by extension
for example
# intellij
*.iml
*.ipr
*.iws
.idea/
/src/main/resources/achievement
/src/main/resources/lang
if ur using maven/gradle why dont you have a main
bc im weird
errr
otherwise
which would just be weird asf
Definitely recommended :p Lets you separate out your source sets, like for tests
i use maven
you should have a main then
ye
@worldly ingot I'm still a bit confused on this does this mean this stuff doesn't happen on the server?
if (this.level().isClientSide) {
okay I see
I wonder how you would go about not ticking an entity
I'm just trying to fuck around right now no important meaning to this lol
ye
dots in packages are just a directory separator
choco did you know coll is jira staff
Yeah a few of us are
ofc choco would know :P
I am as well
when did you find out
When I requested that he get it 
fuck
choco do you know if entities have to tick?
do you also know what the slime offered him
interstingly enough TileEntities don't but it seems like mob entities can
do you know what the slime offered him recently
Why what did he break?
What does that mean "have to tick"
im surprised you dont know choco
And what would that be?
guess
for example, once an entity is spawned its automatically put in the tick loop on the server
I think atleast
Even I know something choco doesnβt? :>>
And why would an entity not be ticked?
idk I'm just fucking around right now
trying to figure things out about the server
its shocking choco doesnt know
Anyways more importantly I'm going to get side tracked on something I've wanted to do for a while now
anyone know of any good resources online to learn C with

yeah, one of them is to skip C and C++ (sorry all C++ lovers) and go all Rust
no
like really :3
how can one appreciate rust without knowing the problems which it solves in depth
the other one (how I sorta learnt the basic C i know of) is to do a simple project in C, like XOR cipher for instance
just to sorta get to know the semantics
really need to just learn syntax
myea
do some small projects you know how to write in other languages
that usually helps :)
I think I'll do code academy for like basic stuffz to start if I get bored I'll start some projects
wats jira
bug report
eww I have to use an account for code academy nvm
Just will start coding and figure it out later
y2k def start with a project immediately
u wanna try to practically apply w/e u learn somewhere
wouldnt go all in just theory
how would i stop the player from having multiple of the same item in their inventory
yeah, im not a c master so idk how to explain it nicely, i know @ Emily is pro cpp so hit her up if u dont understand sth I suppose :P
@slender elbow hehe I'm not going to ping you a lot, but by pinging you this one time I'm going to leave you uneasy to whether or not I might just be extremely annoying
How do i get rid of nullpointerexception
don't dereference nulls lol
Check your objects if they are null
I prefer to guess
though I always make sure my code is within an if statement that gives it a 50% chance to work. This reduces the nullpointer errors I encounter by >=50%
And what if its null or air
a 50% improvement to some is a significant improvement worthy of a raise
I've never pushed a bug to production because I've never pushed to production so there could never be a bug. 1000% raise 10x developer
If its null, then you cant use it
someone?
Check for duplicates when he gains an item
Nope
:/
?ban @atomic totem Spam/Scam bot
Done. That felt good.
ty
Spam em then scam em
doesnt seem to work
it can be null cuz nullpointerexception but apparently is never null?
null checks are always done using the ==operator
Also .getDisplayName() will never return null
so what now
No need to check the display name for null
But you'd do it with == null, as he said
And?
Jeez people come on
okay I get that it doesnt help with nullpointerexception
do I just check if item.getItemMeta()) is null?
I mean if its air then it would be null?
Yeah you would have to check if the ItemMeta == null after getting it.
But dont call getItemMeta() multiple times. You always get a new copy of it
Not quite. The type and name declarations can be shifted down, after your condition.
And dont call getItemMeta() multiple times.
You can also simply check if an item is air by calling .isAir() on the type.
dont getitemmeta multiple times -> I check it after declaring it just once -> it gets nullpointer exception -> I set it like that -> dont getitemmeta multiple times
idk
Dont call
.getItemMeta()more than once.
ItemMeta meta = item.getItemMeta();
I need to call it once for if and then another time to make a variable
You're welcome
Look at the short code above your msg
idk what that is supposed to mean
okay I get item meta and check for meta being null
but what about name then
if I cant declare it again
You declare your name variable after your if condition
doesnt really change much, but I guess its better for memory if you dont always create the string if you dont need it
that good?
Better. You could replace the material check with item.getType() == Material.NETHER_STAR
Whats the difference?
better lol
you're sure to get the right material
Checking against Material is compile time safe
less prone to typos
also legacy support
craftlegacy whatev
also isn't it better to just use pdc in this case?
doesnt the displayname also work for renamed items in anvil?
yeh
yeah then thats probably not what you want
Its a fucking test plugin to learn stuff for god sake π
I know im gen z but i cant multitask that well
One thing at time
so how to use pdc
?pdc
how many pdc can I have in item
a lot
How many keys? basically infinite
until your server is full
do I just make instance of plugin within plugin class or what
where do I put this pdc stuff then
Hey I try to make it so if I right click I glide with the chicken as a like parachute but when I try to give the chicken velocity again it throws this error: https://paste.md-5.net/malapuhawo.cs
java.lang.UnsupportedOperationException: Use BukkitRunnable#runTaskTimerAsynchronously(Plugin, long, long)
why the hell
are you using the BukkitRunnable
the most cursed and broken class of them all
Runnable also dont work :/
you just need to change the syntax
?
how do I make commands?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
?
no
yes
you need to wrap them into something
Union π
is this how to use pdc
it doesnt get any errors in ide
Try to run it
that... doesn't mean anything
same, no errors
to run it on a server
xD
That code will 100% throw error
You have to pass down your main class instance, not create new one
its my first time doing pdc tags
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Look at this for info how to pass down main class instance
okay im a little lost with those tags
or you can create a static one and add instance = this; in onLoad
Or getPlugin(Class) π
Isn't there like JavaPlugin#getPlugin(...) or something
wait, what's the difference between the two?
getPlugin requires the plugin to be a JavaPlugin
and the other one doesn't
wait no
wat
Wasn't the JavaPlugin one static or am I high
getPlugin does not require casting but requires a known Class Type
and the inverse for the latter
whats wrong with this?
"Class must implement the method onCommand..."
ALT + Enter -> implement methods
how about this one
Is there a way to save packages (such as PacketPlayIn... etc.) in a config and get them again?
getCommand(String) is a method of JavaPlugin.
You cant call this method in any other class than JavaPlugin
Or if you have a plugin object, plugin.getCommand
I mean
sure
but
Always do that in my init classes
are you copy pasting code from somewhere else without understanding what you're doing?
Sure, you can serialize packets to bytes and store those bytes
But why?
no
it looks like that
For a replay system
well yes I am using a tutorial but doing what it says step by step
People have made such plugins before
And you don't save dat shit to config lol
packet class name:parameters etc.
cuz packet names can change on different versions
so byte serialization won't probably get you far
also their constructors also change
I dont get what might be wrong, I set command in plugin.yml, I registered it in onEnable in main class, I wrote actual command in another class
show it
Those are warnings
now plugin.yml
You can ignore if you did everything right
same
I wish I could disable certain warnings in certain places
thx
those are warnings
I do forge capabilities and it loves telling me: mf this is 100% null
Even when it's annotated
okay but my plugin doesnt load either way
Having your permission as a * might definitely fuck up luck perms
@SurpressWarning
And other permission plugins
but now when I write ```java
if(array.length == 2) {
String s3 = a[2];
}
Can I put it on some variable so it'll supress certain warnings always when I use it?
I also get this
Not sure, probably not. You can put it at method level
Well crap
there's a built-in way to disable those for only certain places y'all
okay apparently setting permissions to * fucks up entire plugin
maybe you're using constant without creating a string each time, however saying that would also be wrong
so there's no real advantage
Yo I love coding in
holymoly
new YourMainClass() <- This is not allowed
if I delete it then it doesnt work either
don't create random new instances of your plugin
You clearly didn't read link I sent u
I was busy doing something else, but I still dont get how to do it in my case
im not doing playerstats plugin
yeah it just doesnt work
fix the related problem
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
this does not work, literally what is on the screen
it says this
but on tutorial nobody put anything in here
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Dont bother. He was hit with that 20 times already
I would kindly advise to look at fundamentals first, would make your job much easier
He doesnt want to learn
kk thx then I can stop wasting time, gΓΌnther jauch starts in 20 minutes anyway
U 40 or sth
who is gunter
gΓΌnther jauch is a german journalist and tv moderator, gunter is the dude who works in the museum in stardew valley
right
yeah ill just skip the pdc part for now
so they are the same person right?
just remember to use it in later plugins
idk man people literally days ago told me its fine to learn java while making plugins but apparently it's not, would appreciate if some of you made your mind
you declared a constructor to take in an instance of "Kazuya", whatever that is, but you pass none
the error message also tells you that it expects one argument but you passed 0
you just jumped in with the "?" commands so I doubt you actually want to help lol
because you said "it doesn't work" without actually explaining your issue
You often need a reference to your main instance (the instance of your class that extends JavaPlugin) in some of your other classes. Thereβs two basic concepts for this. Choose whichever you like more. Method #1: Static Getter First way is to create a static method called getInstance() or similar in your main class. You...
omg
then I did, and then you went with "?learnjava"
because the error is so obvious that everyone who spent more than 30 minutes learning basic java knows what the issue is
DuskTaler drop the attitude, they tried to help you, if you gonna be like that then dont ask for help in the first place
brother
it's like if you declare a "Person" constructor that takes in a name as string and you just do new Person()
dont you use python or something @storm crystal
Attitude?..
I wrote 3 plugins so far which took me ~10hrs in total, while reading spigot and java documentation, asking around here as well, but I never encountered that kind of problem yet
maybe it was just bad luck?
This?
my first language that I learnt yes, I have to learn it cuz of uni classes but that's a bit besides point I think
as already mentioned, if you declare your constructor, in this case "OtherClass" to take in a parameter "MyPluginMainClass" then you cannot just do "new OtherClass()" without passing in a MyPluginMainClass
The command wants an argument, not familiar with spigots syntax right this second, but if you made "Command" you made it to take in an argument, you have to pass something to it
Woohoo
idk I just dropped making command and pdc for now I guess thats too much
at least I fixed nullpointerexception problem thats some progress
Works for me, doesn't mean it has to work for you. I possess enough braincells to see nullability regardless of the annoying warning
Responding with a java tutorial to everything doesn't help someone with spigots syntax π
spigot has no syntax
yes
Hm?
idk if this is the right chat, but should I update my plugin to api version 1.19.4 and leave out 1.18? before this I have included 1.18 but I am interested in using the new features.. I am basically asking for an opinion
regex is the lazy yet easy way out lol
is there any way to fix this problem? entity isnt being thrown upwards and I suspect that's because of damage
yeah drop 1.18 support imo
if u use git or sth just create a new branch for newer stuff
anyone know what this warning means in C
Make the type of this parameter a pointer-to-const. The current type of "array" is "int *".sonarlint(c:S995)
int binary_search(int *array, int size, int key)
so in case a bug appears u can fix it for the 1.18 users
right
that is java syntax tho lol
Proved his point by sending java syntax
Yah
java syntax != spigot syntax which is non existent
Add a debug statement and see if this is even executed
"How a program is written in java"
spigot has no syntax
is it not better to do new stuff on main branch and keep a separate branch for older support?
it works
I mean
hi i have a question :p
both messages before and after it work
Alright. For kittech and ofluffydev spigot is a programming language with its own syntax.
For the rest of us its a framework/api written in java.
Lets settle there
and what are you on about again? didnt read message history as per usual?
if i for example have this boolean , and i set it to true in :
here , so next time the method run , it will be false?
then why would you just drop random comments that make no sense whatsoever
hey thats usually what im saying xd
yes
itsa boolean = false;
so i need to store it as false when its finished :p?
alr
kittech im gonna take those comments in the future as trolls, this is really a warning...
you know exactly what I mean, else start to read message histories
int binary_search(const int *array, int size, int key)
?ban @quaint mantle trolling
Done. That felt good.
oh my
ahh thanks
did it work? π
what is the main difference
const int *
between const int *array and int *array
const
const int * is a pointer to const int value
(int or an array of ints, simplifying)
ahhhk
if you have a const int, you can't have a non const pointer to it
const in C++ is fun (no π )
even worse π (Have fun!)
Send me your C/C++ questions if you have them (I LOVE C/C++ questions)
will do
I mean... you can?
does anybody know what's the listener of lightning spawning with channeling enchantment or how to disable the lightning spawned only spawned with the channeling enchantment?
do correct me.. I am very likely to be wrong
const is an illusion
just don't tell him about const cast
why does this work even to obtain size of an array
sizeof(array) / sizeof(array[0])
what does sizeof measure
Ok so lets declare this const int
const int myConstInt = 42;
And now get a ref to that address and get a pointer to it
int *ptr = (int *)&myConstInt;
Boom. non-const pointer to const variable.
I'm pointing a const pointer to a non constant variable
any solutions to this problem?
probably the size of the pointer vs the size of the first element
so many questions
how tf does that work to get size
though
I mean, if you have 12 bytes of array and each int is 4 bytes
I want to say, that sizeof is a compile time way to get memory size of a variable/type/structure
you put on your wizard hat and guess, welp, this would have 3 ints
i don't know, it just uses the information you gave
ohhh wait I get it now
and assumes
I was confused what sizeoff measured at first
it measures the size of bytes
so ofc the devision would work
?
declaration: package: org.bukkit.event.weather, class: LightningStrikeEvent
Thank you
speaking of wizzards,,, π§ββοΈ
what should my first C project be
now that i know how a pointer works
cursed
Mandelbrot set
wtf is a Mandelbrot set
π
do a pointer pointing to a pointer that points to teh first one
And use the png format but write the header by hand
wait... why does that work?
can someone explain what a connection pool is and if or why i should use it?
i think modifying ptr is now UB if you cast const away like that
does set cancelled true make any code below that not execute?
or just cancel original event?
or rather, modifying value pointer to by ptr
int x = 42;
int* plsDereferenceMe = &x;
plsDereferenceMe = (int*)((uintptr_t)plsDereferenceMe ^ (uintptr_t)&x);

int main(void)
{
int src = 5;
const int * ptr = &src;
const int ** ptrr = &ptr;
const int *** ptrrr = &ptrr;
printf("ptrrr, %d", ***ptrrr);
}``` I was worried I wouldn't know the value of ptrrr
pls no
Creating connections isn't free.
Passing around a single connection for multiple things on multiple threads isn't optimal.
Lets have a pool of connections we open at the start.
You can take a connection from the pool, use it for a bit and give it back
try const int* const* * const* const
now you a) don't have to create connections all the time and b) can have an individual connection per thread/future/whatever
in C++?
how do i implement such thing, i always did it by just connecting in the main class and taking the connection from there
you don#t implement it
Sounds quite interesting actually
you use hikaricp
With a TCP lib you can make a limbo server in a day or so
(In C++ that is)
implementing your own connection pool is pretty not smart 
is the minecraft protocol very well documented? i.e, what the client sends/expected, and in what order?
documentation in my minecraft?
what is hikaricp (sorry im noob)
the entire protcol is doccumented
Id say so
Someone wrote connection pool code for you so you dont have to
woa
https://www.baeldung.com/hikaricp
I like their guides honestly
baeldung π₯°
method structure is a part of syntax. Syntax is the set of rules that govern how a language is used to construct sentences and programs. Method structure refers to the rules that govern how methods are defined and used in a programming language.
anyway
time to figure out how tf to make a server I've never done this before. I always pick the most beginner friendly tasks
I know I'll probably need some form of socket
lol
yep
Maybe start actually helping instead of saying "learn java" that'd be nice, this is the only server on discord I've ever seen have this problem to this level π
what's the easiest way to send custom biomes to players (for fog/sky colours) these days?
Just... Generate a Mandelbrot fractal. Its not too hard and you will have fancy results to look at.
I don't know if you care much about books, but Unix Network Porgramming is an incredible reference for network programming in C
I have a suspicion there are multiple pokemons working at baeldung some writing good articles, others just write the most un understandable stuff
still don't know what a mandelbrot fractal is lol
Ig I'll lookk into it
in my experience, it's nice to get started with some simple stuff using snippets from baeldung, but the moment it becomes slightly more complex it's all ogre
just random code without explanation as to why you need to do what they do
I mean, code to get started is like
Nope you just have a function(x, y) and calculate if the point (x, y) diverges.
And you do that for every pixel (x, y)
the whole reason I like to link them
you really don't need to know more about like, hikaricp than, This is how you create it, this is how to use it. Done
but how would you display pixels without graphics
also this calls deprecated methods and the docs don't tell me what else im supposed to do
Idk what that means (its all ogre)
Yeah some of them are slightly outdated since the pokemons writing the articles probably donβt really go back and up date them but rather just produce new articles all the time
I by sincerely mistake signed up to get mails from them
And oh god what they deliver articles
You write it to a png and save it π
oh lord I've never written a png before
I think I should start with some basic IO first then
how should I structurize my plugins?
should I put several classes in one .java file?
should I put methods in separate class and use them in listeners and event handlers in main class or can I dump them into that class as well?
out of curiousity, why C and not C++?
why C and not Rust? :)
1 class per java file
Rust all the way
And create quite a few classes. Think about how you can reuse your code in different places.
don't say rust in discord, the rust foundation will come for you
lul
lol
how do I access method from a class that's in other plugin


You have a teleporting world border?
