#help-development
1 messages · Page 784 of 1
oh I bet its because I need to install bukkit first
I'm learning MIPS assembly language! I can't wait to never use this and use C instead 
yes sir!
don't forget that
get fucked
omg new package
new package guys
I agree but MD doesn't pay :p
unfortunately :(, but it doesn't matter cuz its fun!
PR all of morepdc when
you get paid in exposure :p
when the sun absorbs the earth
nah we get payed in hugs from choco
meh
sounds horrible
I find I use my UUID and NamespacedKey adapter a lot
ill give u 2 exposures, me and my alt
So maybe they would fit
Well
NamespacedKey maybe
UUID, well
you can store that as an int[], a long[], a String
I'm so confused hte past two weeks in my assembly class the lectures have had nothing to do with the assignments, for example this week he talked about Finite State machines, but the assignment is how to add in assembly?
but less readable with e.g. /data commands than a string
True
Yeah
bold of you to assume there would be a reason
anyone wanna do this challenge activity for me
pls and thx
I mean they changed it a few versions ago to 4 ints
Don't remember what it was before, but they must have changed it for a reason
Not just for funz
ig its about time i make my own REST api for PAPI and learn java while at it
they should change it into shorts
So I am inconterin small problem need to track if block was placed by players
and save it on server shutdown
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
currently I had just one hashset
Or a full on database
wait let me finish
Never!
Type in one message then
Like I was saying I use to store it just in HashSet and then on server shutdown data was lost
So now want to upgrade and store it per chunk
Would it be ok to have one file per chunk and save it on chung unload and load it back on chunk load
is there a internal java structure for tuples of things? in this case, NAME - MATERIAL - MATERIAL, no order, elements may not be duplicated? i dont think hashmap works here
nope
F
and should I do this id = chunk.getZ() ^ (chunk.getX() << 32) for chunk ID's
A set of tuples ? 
I mean actually if you think about it
Object[] tuple = new Object[3];
boom
no
tuple with 3 elements
Record's ftw
No generics?
Generics too limiting fr
I mean
specially in this case
Everything must be generic
worrying statements
Maybe I can convince MD to add a kek emote here
no
yes
Could just make a smaller gif
True
like this one
But effort
I could also just use a client mod
its not like you cant just copy paste the emjoi 🙄
Yeah you can paste the url
Hello,
Im not sure if this is possible, I find mixed answers in the internet but with no actual solutions, so I wanted to ask here.
Is it possible to get how many entities are rendered for a player? Like, in f3 the E: value at the top left? Is there any packet for that?
But that requires having it in my clipboard :c
Don't think so
prs created, time to finally get back to paper work 
nein. I mean you could do a lot of raytracing and math, For example using Player#getNearbyEntities() or World#getNearbyEntities. Then use which way they are looking to calculate the amount of entities they can actually see
hey wait come back
you have more spigot work to do
haven't figured out what it is yet, but trust me
oh wait I know now. Lynx you're in charge of async chunk loading on spigot, have fun!
Actually, I do need to chat up machine again for coll's pr
One must imagine Sisyphus happy...
Boo downstream
the one where we don't need generics
idk why but I just imagined you rowing down stream in a kyak, maybe that comes from my love of kyaking



lynx-chan 
lynx IRL
I had a feeling that you were actually secretly a piece of art
this building looks like an evil person lives there
uh... can i obtain the item used to place a block in the blockPlaceEvent
It looks ai generated
or is the description here just dumb
getItemInHand babyyyy
It has the 6 lines that are used to draw the funny S that we would draw when we were young
so description dumb gotcha
the whole game is about AI
Fair enough
I mean it's correct
The item in the player's hand when they placed the block must have been the block item
tis correct since the event hasn't actually happened yet
Could you place a block with a sword
'whe the block is placed' might mean if you place with offhand that it returns the sword in your main hand
dunno if this is the right channel, but how would I put my resource to private?
this should rather be described as 'gets the item in hand USED TO place this block'
its the right channel and there should be a button
private resources? that doesn't exist on spigot
Since it's "the player's hand" it's implied that a concrete hand was used, and the hand is implied to be the one used to place a block
it's either public or deleted
report it and say delete my plugin
Maybe the phrasing is not perfect but definitely understandable
see, the lynx is just that cool
well it clearly didnt do what i expected it to so debug time
wait
i forgor to register teh event
oh so there isnt any buttons I can click to remove it?
report it and enter "please delete"
alright then xD
this reminds me of mirror's edge catalyst
what was that building called again
ah the shard
idk but it reminds me of the citadel in half life 2
now it looks like a mixture of gta 5 and far cry 1
and now it reminds me of the train levels in half life 1
WHEN DOES IT FINALLY GO TO THE PUZZLE SOLVING LEVELS D:
is there some special way to tell if a given item is worn by the player or is just checking slot.equals(item) good
Grab the item in the armor slot and use isSimilar
dont' think tihs is ideal
isSimilar takes into account durrability
we really need isSimilar without durrability
isSimilarNoDurability
since all items technically have durrability
isSimilar(ItemStack, boolean)
every item has durrability
true
for some reason bukkit separates it out
itemstack.compare(other, b -> b.durability(false).pdc(false))
What is b
Smells like paper
Ah
more like adventure
they have a replaceText method on components that does it similarly
get to work buddy, I'm already head first in Inventory PR so I can't have the time yk
nor is like, item comparison really that useful imo
like
it should just always be a PDC identifier
True
how can i make an item not burn while in lava? setFireTicks(0) doesnt remove the flames
hello
guys i have question
how can i hide particles with protcolLib?
anyone have idea?
stop the particle packets from leaving the server, if youre talking about hte particles you see on the client like when walking etc I don't think you can pretty sure those are client side
is there a spigot equivalence to ItemRemovedFromWorld or do i have to track the damn things?
You can as well check their setting and simply not send them particles if they have this disabled
i want to teleport items to world height when they fall into the void
yea i know but my question how to not send the particles
do u think i can do that with protcolLib?
Dont call player.spawnParticle
Why is that?
Doesn't that just send a particle packet?
because there is no such method lol
Context:
If you dont want to send particles to a player, simply dont call player.spawnParticle
there’s a good ParticleEffect utility class if you’re on 1.8
you could just iterate through every item and check if it’s at void height
idk if there’s a better way
welllllllllllllll
theres this thing called overhead
i'd rather not lag a server cuz someone blows up a tnt
Does a damage/death event not get called?
nope
Wasnt the EntityDamageEvent fired for when items get damaged?
Hmm
once it falls below some height
Ill... test that out myself
Probably should call a death event
Ah
well i tested that
Could also call ItemDespawnEvent
damage aint called for void
despawn also isnt
im trying to work around it but im running into other road blocks
like
Damage isn't called for void specifically with items?
no
im trying to track the item specifically right now but
BlockDispenseEvent doesnt give me the item entity, only the item stack, and idk how to obtain the entity afterwards
scanning around the block with a 1 tick delay sounds janky asf
@eternal night your unit test covers the list types right?
I'm assuming it just runs through the registry
right idea, wrong execution, the data's attached to the item, but this should work. i hope.
ohg
wtf
where are my tests
yeah I don't see them
lmk when you post them then I'll switch to approved
Omg code is being contributed upstream
lgtm besides that
It's a miracle
I think he may be the only one
teeth
lol
🦷
owen has 7 3 of them just aren't accepted :P
Okay so 2 people :p
hmmm lets see
yep
I'll have you know, I have the 12th highest commit count since 2016
Hm ok the damage event was called for cacti and lava but not void
Probably
how tf do you find that out
didn't doc have something for this
maybe?
git log ? xD
oh xD never used
soo trying the dispenser it works but showed me a new bug in my code
how do i check if a clicked bloc has a container?
yall have a mud tag but not a container one wtf
Vanilla
Those match vanilla tags
@smoky oak Just check if it's a instance of container
you can check if getState instanceof container
Tags are great but Mojang only adds to em when they need em
👍
aaaalright, lemme rephrase that
how do i check if a block has interaction with the player
ie, conainer, redstone, etc
What type of interaction
right click interaction with any item
PlayerInteractEvent?
well yes but no
im in that
i need to know if the clicked block has an interaction
you can right click anything
doesnt guarantee something will happen
maybe check if the block has variations?
Best you have is Material#isInteractable
Let's find out
Not really
?jd-s
Oh god
lol
wtf why dont i have that
The # is to specifically show its an instance method
because...
😢
😭
Checks if this Material can be interacted with. Interactable materials include those with functionality when they are interacted with by a player such as chests, furnaces, etc. Some blocks such as piston heads and stairs are considered interactable though may not perform any additional functionality. Note that the interactability of some materials may be dependant on their state as well. This method will return true if there is at least one state in which additional interact handling is performed for the material.
ah wrong button
it needs to be a .
it'd be Material:: to see that
Heh
Yep
I dont see a way of detecting removal of items in the void.
Thats a hole in the api imo.
Already on it
Yeah idk if the damage event is fitting
Since you can cancel it
Which would result in the item just falling forever I assume
Yea
Not sure. Maybe its time for an EntityRemovedFromWorldEvent and EntityAddedToWorldEvent 😄
you could mvoe the item upwards
Minecraft moment, can't wait until air
Although I guess you can do the same for normal entities
sounds like it :3
That is already an open PR :p
But it probably should fire for void if it fires for lava and cactus
does anyone know the current item fall speed and item death barrier?
is there a way for me to save a server to a sql database ( i want certain code to only react if its a specific server )?
dafuq
save servername
give serber UUID
why dafuq :(
Ahh, ur not trying to actually save the whole server to sql
cause you arent saving the server only a Unique Identifier
Well dont say you want to save the server
cause that
is gonna be rather complicated
How would i differentiate between the servers that the plugin is currently being run on?
i meant how many blocks/second is terminal velocity and what layer in different dimensions the items get destroyed lol
@river oracle done
How can i assign a server an ID i can call up later and compare?
idk why the fuck spigot wants static imports at the TOP of the imports but sure
server names?
I just remade his question
alr lgtm :D can't wait to abuse this
What is the definition of "a server" to you. What are your referring to?

Google is my friend
List of ItemStacks within an ItemStack
ultimate PDC storage
I was recreating a question :{
literally free real estate
Aj
Reminds me of the book kick things people made
Or the chunk dupe glitch
Tis why you must be careful with PDC
Cant wait for nbt bombs because someone didnt check if one of the ItemStacks already has data itself
@inner mulch well to answer your question on startup create a config file (if not existing yet) and save a uuid in it then save that to the databse. Next time the sever starts and the file is already there you can get the uuid from the file and find the wanted data in the database
you seem like the type of loser to use a database I just store an Item at 0,0 in a chest and use it's PDC as my database. NBT bombs? I think not. Its called efficent data storage
okay
Tis the datapack way
I acutally thought of doing that ages ago ahaha, a protection plugin that used the world as a storage. Though that was in the age where i thought books might be a good idea.
the item entity has nothing to do with durrability
he means the entity
How can i merge this stream<? super List<Entity>> into one List / Stream Entity?
Bukkit.getWorlds().stream().map(World::getEntities)
flatmap?
googling intensifies
oh alr
This looks like something you dont really want to do...
got any better ideas?
runnables get eaten on server reset
i need to track items past server restart
Add a PDC tag to them and pick them back up when they load
is there a specific event for entity load or is it just chunkload?
There is now
how to mark PR on stash as draft
hehe just say [draft] in the title
?
ChunkLoadEvent does not have the entities anymore
fr ?
yeah lol
LUL
Use EntitiesLoadEvent
don't tell me you're making your beautiful PR draft
Man where the heck do we even call the damage event for items
is there a way to see interact entities?
Eyes usually
f3+g I think it is
Ah thats what he means
idk whatever hotkey shows hitboxes is useful
I mean those were invisible rectangular things right?
or did I remember them wrong
f3 + b
f3+b ^^^
okay
event.getEntities().stream().filter(e -> e instanceof Item).map(e -> (Item) e) there a way to merge the filter and map here?
no
lemme guess, only for livingEntity
No idea, this damage event code is a mess
Doc has a PR to redo damage stuff since damage types are now data driven
Hopefully that gets merged soon :p
doubt
;c
no
itemFortuneKey = new NamespacedKey(getServer().getPluginManager().getPlugin("HypixelCustomItems"), "fortune");
will this even work?
im trying to acces a Namespacedkey from another plugin
Does the plugin not offer the key somewhere in their api?
But yes, that would work.
oh alright
why shouldnt i do that
like getting it from pluginManager
There is probably a reason, i just feel like it looks bad, and the HypixelCustomItems should instead offer API that in some way allows you to utiliize their system
aas long as it isn't being changed or removed it should be fine for reading purposes
might cause issues if you modify it or tamper with it since most plugins don't design for such things
HypixelCustomItems is my shitty plugin that i coded like 5 months ago and then i lost the code and i had to decompile it now it looks like shit and im not doing anything that realates to scalability with that plugin
should utilize github XD
I agree
how to convert a double to int
Round or convert
reading from string
yeah generally reading is fine 🙂
did you insult it?
I'm about to
find anything?
Anyone know how to register custom enchantments in such a way that you can view them and apply them via the enchantment table?
I've always wondered what if you had a custom texture pack
Then how does EcoEnchants do it?
nope
The enchantment is sent by id
ahhh I forget
The client would need to have an enchantment with that id registered
can you do that with datapacks yet?
Yep PDC is the way to go with custom enchantments
no
lame
blah I have an event firing for entities going into the void
But teleporting them in the event causes them to vanish on the client
So enchantments are all client side technically
naw
if it was we can just send the client any enchants we want
like how we already send it the commands it can use
all their logic is server side though, the translations aren't though it seems
translations != logic
the fact that I can't send it a custom enchant implies the client already as pre-defined some enchants
translations?
thats the issue, even if you add your custom enchant to the enchantment table the name won't pop up seeing as it has no translations
thus this comment
you mean converting the id to a name yes?
Minecraft stores Enchantments as an ID and sends that to the client, if it doesn't match any enchantment on the client the client can't use the lang files to provide a proper translation
right
so we're in agreement
both server and client have a hardcoded set of enchantments. Server sends client an id and the client performs a lookup and shows it in the enchant table
I was interested in at the very least if I could manipulate the name
or cannibalise an existing enchantment to do that
but if it's sending an id, nothing will work :/
yes and no, the enchantments enum is hard, but you can make custom server-side enchants using reflection
but they probably wont display on the client
Enchantments aren't actually an enum its a registry
ah
Kind of pointless
isnt there a list of enchants somewhere?
which is why the server can add to it, mojang has yet to allow the server to send enchantments to the client though
it's in the Enchantment.class
which is why his plan won't work
Well at least I don't have to use the bizarre enchantment and wrapper infrastructure anymore,
Pointless registering a command on the server when it's not even recognised at the client end. Might as well just be a book with some lore on it
do the latter with a UUID
yeah and use some PDC to find your enchantment
Player can have many attributes that will change over time
a UUID is constant and non-changing
well former will be fine as long as its in a WeakHashMap
but latter is more optimal
yeah but then it's going to keep disappearing from the map lol
ye that was my plan if this didn't work out reee
There is though?
if the player does so much as move an item in their inventory the gc will remove 'Player' from the weak hash map
the hash of it has changed
wat
wat
that is neither how weak references nor CraftPlayer hashcode works
do I split my code into methods even if I am not really gonna reuse it anywhere else?
yet again the same missunderstanding that resulted in that Inventory UUID PR
it is
and any field changing inside the reference does not invalidate the weakref
the player ref is the same
it doesn't magically disappear
It does if any strong references go bye bye
it's good to use as a cache
there are also no guarantees that'll ever happen
but that isn't magic, that's how the weakref works and the player would need to log out for that to begin with, fields nor the hashcode changing won't invalidate the weakref
not really needed unless it'd be easier for you to use
splitting up into multiple methods what could be done in 1 is just really not worth it for the sake of "clean code" It really depends on the situation and whats going on, but the pursuit "clean code" isn't worth if its not being re-used anywhere and has no other applicable uses
nope, the player could log out but that just changes the isOnline() state
and the server cleans up the refs
the player instance stays in there
xd
atleast it should
If it does that, why does it have isOnline()
because you would be keeping a reference
a pointless method if the player instance magically goes bye bye
that's inherited from OfflinePlayer
not the server
not pointless, just not really useful for Player
Aight so offline players are all players
just like Player#getPlayer seems useless but its actually just inherited from OfflinePlayer#getPlayer
huh
the underlying implementation does not get gc'd
wat
The CraftPlayer would get GC'd but again not worth the debate
if you're interested in internals you can find them on stash
?stash
How is it getting Gc'd if the plugin dev holds a reference of it in a map
WeakReference
That's the whole point of a WeakReference
who was it that gave me code for removing and caching armorstands spawned by player's actions?
tried looking for it with keywords in search but didnt succeed
Illusion
UUID still better than Player as a key for a map
😔
Prob
ill check
Agreed
So if I did Map<Player,Object>
and a player left the game. Their map entry goes bye bye? Or does it turn into a offlineplayer?
You'd experience memory leak here since you aren't using weak reference afaik
Neither. It just keeps the Player object and leaks memory this way.
....
the map implementation would need to use weak refs for keys
You just said it get gets gc'd
such as a WeakHashMap
a Map<Player, Value> doesn't tell anyone anything about how the key is handled
that is handled in the impl, if it's a regular HashMap then yeah, not cleaning it up manually would be bad
if it's a WeakHashMap then it's "fine"
I feel like the longer I spend in here, the more confused I'll get
I would use Map<UUID, Value> because you can always get the player as from doing Bukkit.getPlayer(uuid);
You're misunderstanding WeakReference and Non Weak references
I'll let smile explain he's smarter than me anyways :P
The general rule for any game-linked object in spigot is:
Dont keep any hard references to them. Dont use them as fields and dont use them in collections or other data structures.
Always use an indirect reference like a UUID for Entities, Players, Worlds or xyz for Blocks and Chunks.
is uh BlockPhysicsEvent not the correct way to prevent a noteblock note change
Yup been following this principle pretty much since day 1
whats a weak reference for an item?
What's the best way to get the values from this 2d3h4m thank you
ItemStacks are cursed in any regard.
I can only assume a weak ref is a variable that has the same ref as the strong ref
like ItemStack weakStack = someItemStack
Yes they are dear god
Cus cancelling this shit ain't cancelling the note change
References of ItemStacks should only be used as templates.
If they are moved into an inventory then .clone() should be called beforehand.
Custom ItemStacks should always be referenced using a PDC tag in their data container.
PDC is also cursed
wdym .clone
stack.clone()
otherwise you're editing the same reference of the item
To that item?
Sometimes
Ik
PDC isn't cursed its actually pretty nice
Providing raw access to nbt would be dumb
Never had any real problems with PDCs
for example, I can't check if PDC has a key without also needing to give it a data type
which is dumb because the code underlying doesn't even need to check for type
PDCs are not backed by json
doesn't NamespacedKey need DataType?
No
I remember sometimes needing a DataType for annoying reasons
cough paper
Caught lacking

wtf
PDC is def not json at all
yeah why is it like that
but that would be nice
no
what is PDC tho
ohhh it's a paper method
like underlying
hahaha can't do that
NBT
You can actually create an AnyPersistentDataType which can just store any object in json 🙂
Spigot pr incoming
basically the modern version of raw NBTs lol#
but it just wraps NBTs I think
PDC is great tho
It exposes a NBT tag BukkitValues
PDC is great but could be better
code owner in chat 🏃♀️
I rip into the code and use this for spigot plugins:
// Use faster method first
Map<String,NBTBase> tags = getCustomDataTags(data);
if(tags != null)
{
if(tags.containsKey(NSKey.toString())) { return true; }
return false;
}
private static Map<String,NBTBase> getCustomDataTags(PersistentDataContainer con)
{
try
{
CraftPersistentDataContainer container = (CraftPersistentDataContainer) con;
Field f = CraftPersistentDataContainer.class.getDeclaredField("customDataTags");
f.setAccessible(true);
@SuppressWarnings("unchecked")
Map<String,NBTBase> customDataTags = (Map<String, NBTBase>) f.get(container);
return customDataTags;
}
catch(Exception e)
{
e.printStackTrace();
}
return null;
}
Lynx wrote it in his prime it's ashame he's old and frail now
lynx 💀
Get idk about that but has definitely
I want easy boolean checks
basically what I implemented myself :p
Lol
well but that still requires you to set a boolean
you cannot just add no DataType
I wrote a DataUtils class that forced PDC to behave like json when you add, remove and check
Why would u do that
because trying to access, manipulate, and check PDC in code is cancer
PDC is like 10x easier than any other way of doing such thing lol
I remember back in the days where you had to use NMS to access your average plugin with NBT Tags
I'm talking from a code verbose pov
Can I get example of your util lol
yo the devs should update 1.8 api
mod devs should continue working on 1.12.2 more
Nah
yes.
DataUtils.set("SomeKey",DType.INTEGER,2,itemStack);
DataUtils.has("SomeKey",itemStack);
DataUtils.remove("SomeKey",itemStack);
1.8 needs to die
🤓
I'm not writing PersistentDataType.INTEGER it's too long
looks like you need to stop using java sir
my nostalgia does not want me to let 1.8 die
it is already half dead
someone needs to put it out of its misery
whole minecraft scene is half dead / rusted
// This
DataUtils.set("SomeKey",DType.INTEGER,2,itemStack);
// Over this
ItemMeta itemStack = stack.getItemMeta();
PersistentDataContainer pdc = stack.getItemMeta().getPersistentDataContainer();
pdc.set(new NamespacedKey(Pugin.instance,"SomeKey"),PersistentDataType.INTEGER,2);
itemStack.setItemMeta(meta);
Yes
kotlin 🤮
What if I throw one tho
Only if you are using kotlin wrongly, u will get npe
not unless minecraft is going to change languages anytime soon lmao
I mean exception exist of course lol
you should really be throwing IllegalArgumentException if you get an invalid argument
But you just cany get it if u use kotlin correctly
void myVariable = void;
var idkWhatThisIslmao
idk why void
like why void
what if they just did something like nothing
public nothing setText(String text);
That would be a wild update
And what if they renamed the String class to Text
java edition will probably stick around for a long time, it wouldn't surprise me if they came up with another version for the PC but I doubt it considering there is large communities that keep it alive
without the large communities mc wouldn't be as popular as it is
Oh, every programming language is garbage :D
thing is, if Mojang stops supporting the java edition, it doesn't mean the community will drop support of it
yeah ig
I mean, rust is perfect, it's blazingly fast /s
mojang is kinda trying to move the playerbase to bedrock, but im glad that that does not work
bedrock is garbage
how can I get a null value from a config? When the config is loaded, the key is not there
Honestly community edition would be based af. No more code obfuscation! NO MORE NMS!
it can be, but if there is an API to be used its actually a lot easier
Who wants to code a minecraft plugin in fortran? 💀
assembly
the issue that will arise is which community to follow because withoutt mojang everyone is free to start making all the changes they want
could make it an empty string I guess if null values are ignored
I'm sure just like with resource packs, there will be a team that carries on a 'faithful' continuation of it
null can't really exist in the config. It can be empty, but if its null it means the key is not there at all
we can start by adding all the mobs from previous mob votes
so you either fix it or you just remove it and move along
well what I mean is changes where you would need custom clients. Part of the reason no one really does custom clients or messes with it because of updates etc
it would indeed be interesting nonetheless when Mojang stops supporting the Java edition
and thus the long quest of deobfuscating everything can begin :)
well we already get mappings for quite a bit
true
and then the rest of the stuff is either dependencies or mojang already provides it in their repo's
where do i get spigot-api jar? compiled binary if possible, otherwise ill compile myself
theres no 1.20?
nvm im blind
You can't have my eyes
i dont want to run that proprietary piece of garbage on my machine raw
what if it gets pregnant with some malware?
theres like
ALOT
Maven ftw
Do u need libraries?
yes
why shaded tho?
It's the libraries
i dont use any IDE
idk if its possible
im new
use an ide
2GB? Can that even be called a laptop?
Vscode
ah yes, the web browser code editor
its from 2010 🥔
does vscode support maven
idk
but srsly instead of trying to do it with no ide js find a lightweight one
itll save a ton of time
which is better, maven or gradle
probably maven idk doe
now fight
whats the difference
Maven for Spigot
gradle for?
maven for me is the thing that adds the compile button and nothing else
haha
is there an event for when a player presses cntrl + middle click? (used in vanilla to get a chest with the nbt data for example)
gradle for multi-dev projects (possibly)
i thought that was the entire point of maven 😭
pls dont kill me im new
Probably some creative scenanigans
Sorta is
SAME
how can I get the highest y point and the lowest y point of a chunk (16x16x16) from the resulting objects the chunk itself is available
why is it being sorted like that?
cuse you hase bug
?
you use translate too?))
no I just type like shit
oh
Hello, does anyone know why I can't use the player's connection in 1.20.1 ? I keep getting an error "java.lang.NoSuchFieldError: c"
EntityPlayer serverPlayer = ((CraftPlayer)player).getHandle();
System.out.println(serverPlayer.c);
I have a keyboard for a VERY small amount but it somehow continues to live
omg NMS
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
I've already checked the mappings and it says that c is the player connection
here
first off you should be using ServerPlayer on 1.20.1 for mojang mappings
not EntityPlayer
?nms
use Mojang mappings, its much easier
The thing is that I am on gradle and I am already kind of too far to go back to maven, I am trying to send packets to players through entityplayer
so does anyone know how to cancel a noteblock note change
because cancelling its BlockPhysicsEvent does not prevent it changing
does PlayerInteractEvent not work?
isnt there other ways noteblocks change apart from player interact
i mean
sure ill try
I don't think so
declaration: package: org.bukkit.event.block, class: NotePlayEvent
ideally we'd be looking for like NoteChangeEvent vs the play event no?
yeah i want the note change not when its played, if its played and the client sees it its too late
ideally, but its the better event because you have to record what the note was before. I believe notes can change via some redstone mechanisms
not just player interactions of the block itself
someone should probably make a pr to add such an event
not sure if its doable though
sounds like a fun PR for you
do you even have a stash account
yes
technically yes
This is why you don't manually edit patches
Editing patches is ass
this is why you don't manually edit patches
they're so easy to work with I never got how its hard
sure dealing with merge conflicts is a pain, but besides that idk
I once tried editing patches, nothing worked and I hated it
did you applyPatches?
then do makePatches?
they're just sh files
Idk what I did, it was from some app I downloaded
I mean, it's patch files for a certain thing which I defined as an app
Thank god
The patch files were in some weird format, but they definitely were patch files
what
https://paste.md-5.net/efiluyakew.java - Is it normal to have 4-5 nested loops when creating your own BLockPopulator?
i gess no
Any heads up on why this could be happening?
Getting this error when opening a GUI with a skull in it
send output of /version
sec
I know it right now if its latest coll is going to rip his hair out
uh, client is using paper so I wont bother posting the /version output here lol
Anyone know how to make a simple 10 minute timer? I am confused on it currently
Use bukkit scheduler
Thank yous!
Im still new do i need to import that or no?
import org.bukkit.scheduler.BukkitScheduler;?
Yeah ask paper iirc spigot patched that issue
I am confused on the timer do I need a class for it or some input since all I have right now is BukkitTask.runTaskTimer(this, new Runnable() {});
Just () -> {}
It's called lambda expression
Or make anonymous class which implements runnable (sorta what u did there)
Or normall class which implements runnable
Choice is yours
do you fellas™️ have any examples on how to shade a submodule with gradle
or is it just
shadowJar {
relocate("submodule","submodule")
}```
although i doubt it
Does the PlayerSpawnLocationEvent trigger even on a player's first join?
Yes
It just tells you where the player will spawn
declaring an implementation/api dependency is enough (as long as you have the shadow plugin applied)
that specifies a package root to relocate (from -> to)
And allows for a more efficient location set, instead of, for example, a much slower Player#teleport in join event
Does a netty channel handler stay on the same netty thread?
ah okay
okay well now it broke lol
Or is it in a multi-threaded env?
i added gradle dependencies { compileOnly "api" }
Because even if there are more netty threads, not all of them are necessarily used
implementation project(':api')
> Could not find method implementation() for arguments [project ':api'] on root project 'CustomBlockAPI' of type org.gradle.api.Project.
ah wait
i probablky placed it in the wrong place
in the dependencies block
yea i did
now i get CustomBlockAPI:main: Could not resolve project :api.
lol
i mean
i have an api submodule
does it work if you remove the colon?
it actually still appends a colon
does my submodule gradle build need something more than ```gradle
plugins {
id 'java'
}
group = 'test.test2'
version = '2023.1.0'
repositories {
mavenCentral()
}
dependencies {
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
test {
useJUnitPlatform()
}```
yeah that just sounds like the subproject is not actually named api
what's in your settings file
uh which settings file
settings.gradle
> Task :prepareKotlinBuildScriptModel UP-TO-DATE
Could not resolve: project :api
Could not resolve: project :api
BUILD SUCCESSFUL in 740ms
with the structure being this
and what's in the api folder
I think you might need to set the source and target java compatibility for the subproject
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
uh
is there any way to like
namespace it
bc
now its not shaded under api
its just
in the main folder
or is it what i sent earlier
huh




)
