#help-development
1 messages ยท Page 550 of 1
Cheaters are sweaty
Jesus once saw a guy use a sound mod + a custom ambient noise for gold blocks to xray undetected by data scrapping the source of the noise from his debug log.
did they already have xray in jesus' time?
out sweat them
Lmao.
Exactly why I did the psa
there's so much we dont know
You joke but ong yeah.
How long did that crop modifier bug go unnoticed? 4 years?
This is almost impossible to believe. there is no point as using xray or sound woudl be purely client side. no server detection
poor jesus
using sound woudl just make it a little bit harder for him to find the blocks he wanted
jesus was cheating. Used hardware access to turn water into wine
thats why they let him die ๐ฅบ
banned for eternity
Lmao
There are sound physics mods that add more qol sounds, including custom ambience, along with source.
dude probably also had hardware backdoors
the point is: Why not just use xray?
and?
My point stands. Usign xray or a sound mod makes no difference in detection. Using sound would simply make his block finding a little harder.
Not getting caught. This one player has legit not been banned from any server as there is 0 proof he did it.
As who's gonna belive the dev who figured it out.
You won't get caught with xray either unless you use it too obvious. There's no server-side software that can detect it
Its all down to statistics for detection
Statistics my man
Yeah and the sound xray causes the same statistics if used in the same way
if he's not tripping the statistics then theres no harm
hmm isnt floor(837.0 / 100.0) supposed to return 8 instead of 9
i am somehow struggling with basic math when it comes to rendering
yes it should
shoudl we send you some learning blocks? 1,2,3,4
You can do it, what comes next? ๐
Dude Mined 9000 Ore on 3 days and admins let him off as there was 0 evidence of a hacked client lol
idk my stuff is supposed to render 8 textures then but somehow it does 9
Unless they see baritone xray bot9000 they usually dont wanna know
incompetent admins then
are you forgetting zero is a number?
just do -1 taps forehead
wonder how hard it would be to make an "ai" type thing to tell if someone is cheating
depends on the data you are able to feed
specifcally xray
For something like xray it would be kinda easy with enough data
it would have to learn with the server which would prob be the issue
Yup
bc the server could progress from 300p/h to 1000p/h
I used to love catchign xrayers
You would basically look at 100 players and their blocks mined/distance walked per diamond.
And if one player is like 4 times the average that's pretty sus.
That's obviously super simplified but it would be something around that
I'd follow them around invisible and spawn diamond blocks. Then watch them dig straight to them
sounds fun, cant say i ever got to doit
Granted thatโs probably less fun these days because baritone
I never banned though
some people are still dumb to hand mine
If you ban they just come back on a different account or get shitty and DDOS
I jailed. It worked wonders
I remember when I introduced parcours to the server I was coding for.
Players with fly mods were constantly cheating on those but it had a "best-time" list that also stored their movement during the parcour.
I banned dozens of players because they were flying straight to the finish line lol
DDOS with two megabytes per hour?
they can still log in and just get ridiculed by other players for being in jail
Its psychological. The fact they can still log in is enough to make them to want to get out of jail
reminds me of old russian mc servers where you can spend a bunch of money for real cool stuff
wait i think i actually need - 1
told ya
my x,y pos is a start coordinate so the texture is always wider than that
Although that was meant to be a very bad joke
even the best coders trip up now and then on indexing
nowe
You shoudl see my raw messages before I correct any typos ๐
me trying to create some overflow
to see if my camera is working
math.floor is atleast working lol
overflow? you should have a view frustum.
dunno what that means but im testing if im not drawing tiles where the camera cant see them
yes thats what its for
calculating yoru view frustum allows you to detect what is seen and what isn't
actually i can just ask the width to the texture lol, but me with my weird textures, its probably zoomed in ๐
copyright? never heard of
How I used to catch xrayers.
Core protect data is good when rendered right. Lol
looks worse than the graphs i make
It was a proof of concept
The left tone isn't a graph
It's the actual coordinates of every block broke
*you can change the view
storage will like that
Lmao that moment u forget minecraft already has a storage method for fitting millions of blocks into a few mb
*God I love palletes
Idiotic idea 7 of 2023, take the anvil file approach and apply it to log storage.
Bye 10gb file. Hello 500mb file
That is called compression
how can I make my own MapFont
https://grep.app/search?q=new MapFont(
okay found this
probably correct
Search across a half million git repos. Search by regular expression.
V1 - V2 is the final velocity you want to set
location 1 vectorized - location 2 vectorized
or the other way around
not sure rn
entity1.getLocation().toVector().subtract(entity2.getLocation().toVector)
depending on which entity you are throwign which way
?tas
oh my this is so usefull
we arent wikipedia
also by testing you learn the best
amen
Are the @s @p Username @a[something=aaa] built-in or i'd have to make them myself?
you'd have to make them yourself
sad
*if you are making a custom command
do I have to make a SmithingRecipe for my custom armor to work?
cause it works but I cant collect it
wdym in general
thats only prepare
not the actual smithing event
not sure if there is one.
if not you'd have to register the recipe if there is one
dont do two pdc lookups
because the server doesnt know that recipe
register your whatever as a recipe
and it will work
yeah
But I am confused how will I make the result?
I made this to make the result
yeah.. first of all, your recipes doesnt match
?
.
emmm I am talking about result
and you said something completly different
anyways any Ideas?
do you even know what you are doing
for what the preparesmithingevent if you have the recipe registered
i wanted to do something but im not sure if it is possible with java, a chatbot that learns from 4chan or some other website, i need only the AI, the only i can find are for AIML anyone have one that support this type?
i'll take that as a no
you dont want that
your chatbot will throw racial slurs at you after a day of learning
hi guys someone explain me nms ? nms is api ?
i need add nms to my java projects ?
how can i code with nms ?
i don't care, its just a fun little project
and that can help me with making my API more rich
how can i edit ?
if you dont know what NMS is, how do you know that you need it?
i found something like this https://github.com/robotnikthingy/AI-Core, but seems really not a chatbot but just a random phrase said
i need prevent to click inventory recipe book and they said me i can do this with nms
yeah no shit sherlock it needs some data to chat with
and since your request is very specific and there is sadly no "here, learn that" button, you'd have to impl that yourself
https://github.com/deepjavalibrary/djl worth a look
thanks
Also here is the Scoreboard plugin?
check https://wiki.vg/Protocol#Change_Recipe_Book_Settings or similar
is this protocollib ?
no NMS needed, take a look at protocollib
this is not protocollib. those are the packets
having fun i see
well i don't know how to code with packets
is like spigotapi ?
i need import some api for code with packets
why i can't add protocollib with maven ?
do you also have the repository
๐
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
NOOOOOOOOO
alright i recreate spigot project
<repositories>
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>```
i need add protocolliib to java build path ?
not only maven will not work ?
no
declaration: package: org.bukkit, class: Bukkit
oh thanks!
?nms
brev
Or is it a window? ๐คจ
๐
how can I calculate centered X and Y for MapView, so the text being rendered is centered?
I need to somehow calculate the width & height of the map
then it should be pretty easy
okay so for rendering centered text in MapView
you can use this code:
int x = 64 - font.getWidth(text) / 2;
int y = 64 - font.getHeight() / 2;
canvas.drawText(x,y,font,text);
took me way too long to figure it out :D I tried making it procedurall but hardcoding 64 works just fine
i wanna get this packet but does not here
How can I create a map which does not automatically update, but only when I send a ClientboundMapItemDataPacket?
Right now it just does this every few ticks .. โ
I've removed the default renderer, and even tried creating the CraftMapView and MapItemSavedData myself, nothing worked ...
Lock the map
coll can u help me for packets ?
According to the Spigot Documentation .setLocked(boolean ...) GETS if the map is locked... lol
odd name for that
You just described the whole javadocs
@young knoll or @worldly ingot GO
Most of the comments are just literally useless and could greatly benefit from a proper rewrite
coll should do that
I think they are fine, they've always helped me very much
they're fine but need more easter eggs
xD
They should explain what they are actually doing
I know that a getter method gets something, but sometimes it does a lot more that could potentially affect performance
pull requests welcome ๐
I tried. But honestly, working with the code is really devastating with all the patching stuff
imo we should deprecate the material enum for removal so no more plugins use it but retain backwards compat to not need updates for plugins that have nothing new to add for any reasojn
the javadocs dont need any patching
so no more plugins use it
Tf they supposed to use then
Yeahhhh
Black magic
I mean like generally. I had created a pr for something differently and it was soo much work that I have lost the pure will pretty quickly
no new plugins use it
if it's just javadoc it should be really easy, perhaps ask here where you run into issues
like its removed so i cant go and use Material.AIR, i have to use the block/item types
But they don't exist
Do I have to manually remove entities from collections that are getting nearby entities from a loc/entity? (e.g. player.getNearbyEntities(10, 10, 10);)?
You have to remove entities from arraylists that are managed manually by the code, but what about this?
Manually remove them for what?
Memory
?
Use unsafe ig
Words together sense they make not
IF you don't hold a refrense to the returned collection the entire thing will get GCd
But if you do then yes, you need to remove them for them to get GCd after death
Since the java garbage collector is not really designed for Minecraft, the gc doesn't remove lists that contain stuff
even if the entities for example in the list are dead
whats the point of boolean persistent data type now? we already have byte?
or invalid
Are you storing the list anywhere?
I do have a collection object stored yes
Use a WeakHashSet
Convenience
most people are too dumb for that
id unno how its stored internally so cant say anything about that
yeah I wrote my own booleandata helper but just some api is better because it probably easier to use
in combination with the other types and stuff
Hey guys I'm trying to make player to play custom totem of undying animation using item in resourcepack
is it possible?
I clearly have no idea how to set up for this kind of feature
There's an effect for this I think
It's like IRON_DOOR_CLOSE or something stupid. It's misnamed because the effect ids change all the time
why dont you pr a fix
deprecate it and make new names
player.playEffect(EntityEffect.TOTEM_RESURRECT) should work
It should use the item in the player's hand
is that what the queen did
but then just ran out of computing power
or did she run out of ram
probably ram
she was a 1926 model
hi, how to add the spigot.jar as a maven dependency ? (i know the difference between spigot and spigot-api and need to add it)
?nms
anything wich can relate to a maven repo for import net.minecraft.server.v1_8_R3.ChatComponentText; ?
You use the Spigot artifact in maven
Just replace spigot-api with spigot and you're done
other than running buildtools
didn't work well for me
assuming you've run BuildTools*
assuming everyone giving for only solution running buildtools, we can't just register the repo buildtools is registering in our pom.xml ? i search for a way where i can just git down my project and download deps by maven
?nms
or
1.8
?1.18
You can build 1.18.1 using BuildTools https://www.spigotmc.org/wiki/buildtools/
java -jar BuildTools.jar --rev 1.18.1
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
?
are you answering the question or doing commands i already see ? idk what i have to learn from your response
ok I'll not bother responding to you then
Just run BuildTools to build 1.8.8 and then change spigot-api to spigot in your pom
That's it
ur not bothering anyone boi
ok
lol boi
so no way where i can just git down my project and download deps by maven ?
No
ok if i am using NMS and ProtocolLib, how would i go about getting the actual ServerPlayer entity if I right click on an NPC?
You have to listen to packets as there will not be any fired events for interact from Spigot
right so i am listening to packets already, but i'm unsure what methods i need to use to actually get the entity
You have to keep track of any NPC's you created
so keep them in an arraylist or hashmap?
is there any specific reason you are going to packet route and not just NMS?
File file;
String filename = "players.yml";
FileConfiguration storage = new YamlConfiguration();
public OxygenStorage(Wolfxygen plugin){
this.plugin = plugin;
config = plugin.config;
oxygenMgr = plugin.oxygenMgr;
file = new File(plugin.getDataFolder(),filename);
if(!file.exists()){
file.getParentFile().mkdirs();
plugin.saveResource(filename,false);
}
try {
storage.load(file);
} catch (InvalidConfigurationException | IOException e) {
plugin.getLogger().info(ConfigMgr.format("&4Loading "+filename+" failed"));
e.printStackTrace();
}
}
Why isn't the custom config being created?
the file doesn't exist
is there a way i can do this with just NMS? afaik using packets to interact with NMS npcs was how you were supposed to do it
i wanted to create a plugin where you interact with an npc to open a gui menu, but also if you want to remove the npc you type a command and attack it to remove it
You also realize you have to update it for every version release
it would be much simpler
Yes, for almost a decade now
i was dreading it because it was simpler, but at this point if it works, it works
the main advantage is zero maintenance
are there any big disadvantages
if you nms yourself you haev to update for every version, or do some very fancy reflection
only disadvantage is waiting for them to update to a new version, if it breaks
np
sometimes i wonder why discord puts me in this channel when i click on #general lol
shoo
bump. anyone knows how?
nvm, the file has to be in the resources dir first
Hello here how find args if command is execute by command block or players please?
1.19
You check if the sender is a player with instanceof
or BlockCommandSender I believe for command blocks
```if (block.getState() instanceof CommandBlock) {`
if (sender instanceof BlockCommandSender) {
BlockCommandSender blockCommandSender = (BlockCommandSender) sender;
Yeah like that
Did you import it
declaration: package: org.bukkit.command, interface: BlockCommandSender
class exists
spigot version?
1.19
They probably didn't import it
yep
I think yes
if Eclipse press CTRL+SHIFT + O
let me test
Thanks
1.20 lol
declaration: package: org.bukkit.command, interface: BlockCommandSender
exists in 1.19.3
Sound nice
true
Does anyone know about NextAuth?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
can I use BuildTools.jar to install org.spigotmc.spigot into my local maven repository?
oh so it does that by default
Yes
perfect thank
I have seen it fail a couple of times worst case you just install the jar manually
I couldn't recall how I used to do it so I wasn't sure anymore, but I just hope this works now
Hello, I have a question, I'm in 1.19.4, I've cancelled the InventoryClickEvent for an item so that the player can't move it, but when I move it with my 1, 2, 3 keys, the event is no longer cancelled.
.handler(e -> {
System.out.println("Event call " + e.getEventName());
if (e.getCurrentItem() != null && isPickaxeSupported(e.getCurrentItem())) {
e.setCancelled(true);
((Player) e.getWhoClicked()).updateInventory();
}
}).bindWith(this);```
yup worked
Sign api appears to be broken in 1.20. It fails silently
?jira
^^ Time to report that
Signs have 2 sides now
The event should be called. Make sure you actually registered the event right
Most methods are deprecated, but they should be defaulting to the front side
actually i have more debugging on my side before i report it
didnt realize the setLine method I was using was mine not spigot's. It uses spigot's api further down
Hello! I'm working on a GUI Login plugin which works alongside authme. It's function is simply sending the clicked slots as a password to authme in order to login or register. The GUI title uses custom textures in order to display an image overlayed on top of the inventory so it looks fancy.
Currently trying to have a dynamically updating Inventory Title which shows which PIN is being pressed in real time to the player using packets so it's only visible client side. The problem i'm facing is that the title automatically recenters itself, causing the overlayed GUI image to be shifted when it updates. Is there a way to lock the initial inventory title's alignment so I can overlay the PIN which is being clicked on?
Offline mode ๐
You use offline mode to Play Cracked Minecraft i use it to not Depend on Mojang's Database all the time, we are not the Same
This event is register. The event right when i click on my item but when i move it whith numeric key it was does'nt cancel my event
Does the sysout trigger
Does https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/commits/ecfa559ae8821e3e2677fe168b536333f71149aa#src/main/java/org/bukkit/inventory/InventoryView.java works for inventories created with Bukkit API?
look
That does not show the sysout
yes
When you press a number its event.getSlotType() == SlotType.QUICKBAR
Awesome! Thank you for contributing ๐
Try registering the event normally with the API
when i'm press a numeric key, e.getCurrentItem() is null. the event take the current slot who is null not the slot after the item has moved
if you just want to prevent moving items into/from your inventory then cancel if the click is IN your inventory instance or a number was pressed event.getSlotType() == SlotType.QUICKBAR
look
Events.subscribe(InventoryClickEvent.class, EventPriority.HIGHEST)
.handler(e -> {
System.out.println("Event call " + e.getEventName());
System.out.println("Current Item: " + e.getCurrentItem());
if (e.getCurrentItem() != null && isPickaxeSupported(e.getCurrentItem())) {
e.setCancelled(true);
((Player) e.getWhoClicked()).updateInventory();
System.out.println("cancel");
}
}).bindWith(this);```
So it does fire
I just told you how to stop number button presses.
is there a reason for that Events.subscribe way of handling events? ๐
wait is that a spigot class?
so nothing to do with Spigot
I'm running into this error with BuildTools.jar, any ideas?
yea
I just want to disable the ability to press an alphanumeric key for my pick and not for other items
Im trying to play around with some packets and when I use the https://wiki.vg/Protocol#Look_At packet the first requirement on the site says VarInt Enum which looks like it just requires either a 0 or a 1 but when I use the 1 for an input it says the required type is Anchor not quite sure what its looking for
Messed up by using Dispenser as the inventoryType from the start since it was a straightforward 3x3 slot inventory. It will always center align the title, Only solution is to use chest as the inventoryType since it aligns to the left end of the inventory so you can overlay whatever icons you want without it shifting all over the place๐
event.getHotbarButton()will give you teh button that was pressed
can i edit block breaking speed ?
You can give mining fatigue and handle block breaking server side
can i hide this potion effect particles and icon ?
thx it's good i've make this
.handler(e -> {
if (e.getCurrentItem() != null && isPickaxeSupported(e.getCurrentItem())) {
e.setCancelled(true);
((Player) e.getWhoClicked()).updateInventory();
}
if (e.getAction() == InventoryAction.HOTBAR_SWAP) {
if (e.getClickedInventory() != null || e.getClickedInventory().getContents() != null) {
ItemStack itemStack = e.getClickedInventory().getContents()[e.getHotbarButton()];
System.out.println(itemStack);
if (itemStack != null && isPickaxeSupported(itemStack)) {
e.setCancelled(true);
((Player) e.getWhoClicked()).updateInventory();
}
}
}
}).bindWith(this);```
some nice rendering issue i had yesterday lol
trying to render some 2d world but the camera view goes kinda brr
Is there a spigot server 1.20 version? I tried downloading it with build tools but it said 1.20 didnt exist
how did you run the buildtools command
Try redownloading build tools and running java -jar BuildTools.jar --rev 1.20
Hello,
Did somebody know how to open a creative inventory, I need that the player choose the item that he want to store it. And the player must have the choice of every items of mc
You can open a paginated GUI with all the items
but I have to instanciate all the items one by one if I do that
its only a for loop
Do items have index ?
Material
really ? have you some documentation or snippets about that ?
Arrays.stream(Material.values()).filter(Material::isItem).toList()
Hello, i have been searching online why getOfflinePlayer is depricated and it is because you should use UUID, but like when making commands it wouldn't be user friendly to make the user put in the uuid, what would be an alternative then? Storing all joined players and getting their UUID seems bad because they can also change name
It's not deprecated for removal so you can use it
MapItemSavedData worldMap = (MapItemSavedData) FieldUtils.readDeclaredField(mapView, "worldMap", true);
FieldUtils.writeField(worldMap, "carriedByPlayers", ImmutableMap.of());
FieldUtils.writeField(worldMap, "carriedBy", ImmutableList.of());
What am I doing wrong?
at runtime the symbols are obfuscated
look up the obfuscated names and use those in reflections
ok ty
i dont remember the nms mappings site tho
but there is one
where you can look up symbols
?nms
Screaming Sandles something
It's not a command :(
does anyone know how to exclude patterns with ANT? i have a mod-0.0.1.jar and mod-0.0.1-sources.jar and i want to exclude the sources
this is the site
ANT ๐
ah thanks, was just about to ask
im using jenkins
Jenkins can doesn't require ANT??
im trying to get the generated jar file to archive
wait i think i figued it out
theres an excludes field
yes lets go
Why api version 1.2?
or is that just a typo
1.20
Is the server running 1.20?
Make a bug report I guess
?jira
How can i do it?
Code: FieldUtils.writeField(worldMap, "n", ImmutableMap.of(), true);
Map != List
Oh, i mixed them up... thank you xD
Didnt help tho. I think the error is caused by the final
No, i need an immutable map, so that bukkit cant add stuff into it
So you want to throw a bunch of errors?
ill just create my own immutable map later on, which doesnt error on insert
SnakeYAML being annoying tbh
so.. anyone know how i can overwrite that final variable?
If you could make a JIRA issue that would be super useful
See above, Olivo linked it
Thanks!
Now to think of how to fix that. It seems to be a quirk of YAML to treat those as decimal values rather than a string
is that even doable? or is final stuff unchangable, even with reflection?
guys, help please, when I restart server, it generates new armorStand and doesn't save it to variable. Code: main - https://paste.md-5.net/muluzisucu.cs
https://paste.md-5.net/rerekuwezu.cs - custom obj
I did that and it said 1.20 isnt valid
You need to set it to api-version: '1.20' or it will remove the last 0
Ok, and just for clarification, is changing it to 1.20 really important that just 1.19? Like would the plugin not work?
Set it to the lowest version you want to support
1.13 being the lowest available
since that option didn't exist in earlier version
oops
bro wtf
gradle just removes my command
๐
name: simple-staff-commands
version: '1.0-SNAPSHOT'
main: me.acatto.simplestaffcommands.Simple_staff_commands
commands:
newkick:```
->
```yml
name: simple-staff-commands
version: '1.0-SNAPSHOT'
main: me.acatto.simplestaffcommands.Simple_staff_commands```
help??? XD
nope still does the same thing
it still does not like it when being built
my brain
why does gradle not like commands
like it doesnt give me info, warning or anything
it "successfully" builds
how do i check if a player has operator
thanks
i think you can just get the location of the player
event.getPlayer().getLocation().
uhh
Hi guys, I have a problem.
The last 2 events are not "read" and therefore do not work ( I can do everything as if there were not ) . Can anyone help me with this?
https://paste.md-5.net/lubucitifa.cs
how do i make a "reason" argument for kick command
just get it from the args array
sry lol watching math video
Do you have other events of the same type?
Maybe you are cancelling the event somewhere else
if (reason == null) {
target.kickPlayer("You have been kicked from the server. Reason: No Reason");
} else {
target.kickPlayer("You have been kicked from the server. Reason: " + reason);
}```
is this the simplest way to kick
bruh
reason === null doesn't work
it just says Reason:
i mean ==
uhh
String reason = String.join(" ", Arrays.copyOfRange(args, 1, args.length));
``` this is my reason
it works if u have a reason
reason == null || reason.isBlank()
String finalReason = (reason == null) ? "No reason" : reason
oh yea thx :))
player#getLocation#getWorld but world#getEntity doesnt exist
just target.kickPlayer("You have been kicked from the server. Reason: " + finalReason);
si
String finalReason = (reason == null) ? "No reason" : reason;
target.kickPlayer("You have been kicked from the server. Reason: " + finalReason);
sender.sendMessage("Player " + target.getName() + " has been kicked.");```
this?
just try
nope if theres no reason it just gonna say "Reason: "
String finalReason = (reason == null || reason.isEmpty()) ? "No reason" : reason;
yes
this worked
ty
dumb
im dependency error help me
import dependency for no error
Omg yay
InventoryView#setTitle for changing title of open inventories.
oh wait
lmao nvm
still doesn't allow components
whatever then
ew components
next you are gonna tell me you want to like, send translatable components
Hey the PR is open
anyone know how to unban and ban
True
Merge soon plz

heard it has been afk for ages now?
right, next gonna tell you i want to use a feature supported by minecrafts every command & feature (json messages)
you are crazy
i need fonts >:(
that is not supposed to be possible
why are basecomponents there then
I was sarcastic xD
Hopefully the PR is merged as soon as 1.20 is stable
yea
๐
choco pr right ?
ye
yeah
im trying to use some of these methods from plotsquared https://github.com/IntellectualSites/PlotSquared/blob/main/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java no idea how to properly acess them their documentation doesnt say
yea but how do i check if he's banned
Your better denying them in the PreLoginEvent tbh
That way they dont ever actually get into the world
what ๐
declaration: package: org.bukkit, interface: BanList
how th you grab that so fast jeez
prolly dual monitors nvm
sorry but how does that help access the methods?
It shows how to get a plot area
I'm having trouble with signs, too.
Which you then you call the methods on?
it just shows the interface
So where do you want to access a plot area? At a location? Or do you want all in a world
im just trying to check if a location/player is in their own plot
so im trying to acess public @Nullable Plot getPlot(final @NonNull Location location) { so i can get the plot a location is in and check the owner of the plot
PlotSquared.get().getPlotAreaManager().getPlot(location)
Cannot resolve method 'getPlot' in 'PlotAreaManager'
getPlotArea*
alright ill try it ty
can anyone give me a example for ban command
Get ban list
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Bukkit.html#getBanList(org.bukkit.BanList.Type)
Unban
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/BanList.html#pardon(java.lang.String)
declaration: package: org.bukkit, interface: BanList
declaration: package: org.bukkit, class: Bukkit
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
? i only wanted an example
if (args.length < 2 || args[1].isEmpty()) {
p.sendMessage(ChatColor.translateAlternateColorCodes(
'&', "&dYou must give the name of the crate you want here!, /vc create <crate-name>"));
return true;
}
this works in 1 of my switch cases
but not in the other
Index 1 out of bounds for length 1
means there aren't enough arguments
flip your operator for length checking 
Thats not no ban command
nah like i do /vc create with no argument and it says You must give the name of the crate you want here!, /vc create <crate-name>
but in the other cases, exact same code it says index lenght out of bounds
so just check if the length is 0 in your if statement
you need to check lengths before accessing an index
First check length
hence IndexOutOfBounds
arrays start at 0 btw
can you just paste the entire onCommand you have?
would be easier to figure out whats wrong
?paste
@round finch that took a very long time to find that emoji 
i saw it flickering back and forth lmao
do you have the error as well?
lol
also switch statements needs breaks @silent steeple
thats actually ur issue
ur not braking and the switch is falling through i bet
weird isnt on the paste for me
Which line of code from the code you sent me is line 46
does sendPacketNearby not exist in 1.19 or am I tripping
nvm thx for help buchard
Its that from protocollib or a method on some object? could always javadoc it
i fixed it
does WorldUnloadEvent not trigger on server shutdown?
i dont think its the same method that im looking for, it requires a plot squared location for some reason...? Required type: com.plotsquared.core.location.Location Provided: org.bukkit.Location
im sure theres ways to convert between the 2
check the methods/constructors?
ctrl + click if ur in intellij for that, lets you view source of some classes
PlotSquared is abstracted in a way so it can be ported to other platforms easily
on a stair thing
You usually spawn an entity in the stair and mount the play on it
i checked and couldnt find anything
mmmm
ok
i dont understand why the made the api so hard to understand... they couldve made it very simple especially since its a paid plugin
The API is well made
Use the BukkitUtil class
It can convert the location for you
seems to work ty
What is the recommended way to write cross version compatible sign code?
sign code?
Signs have 2 sides now
ex: sign.setLine(0, "Cruise: ON");
I already had 7, I had hoped that wasn't the answer
why you had 7 modules if this is a 1.20 update
I'm sure there stuff you can do with reflection too
api, datapack, plugin itself, 1.16 compat, 1.18 compat, 1.19 compat, and now 1.20 compat
But that's not as clean
so the answer is that there really isn't a good method ig
is there is a diffrence between 1.20 below versions
can someone send the 1.20 spigot download idk how to use buildtools
?bt
then you need to have this modules and this is the cleanest way to do multi-version compat
yes I am aware, I'm just very unhappy that I need to add signs to the duplicated multi-version mess
Are you complaining about NMS ir wat?
or**
complaining that I need to write modules to handle <1.20 signs and >1.20 signs differently in the spigot API
ignoring my other needs for NMS
Don't rush into that. It might be a Spigot API issue. I opened an issue for it:
https://hub.spigotmc.org/jira/browse/SPIGOT-7371
I mean either way you need extra code to support the back side
right, but that's not bad
But the existing code should still do what it did on 1.19.
Also, when placing a sign, the client doesn't prompt for the text.
setLine wasn't working for me when I just tested
md_5 says the sign issues have been fixed. Not sure if the new code will be in a build yet (I'm not seeing 3767 yet).
3767 is out and 3678 will roll through in the next few minutes
tested and 3767 does fix the sign issue I was having, thank you!
Question: Is there anyway to make vault_rank capitalized?
So like where it shows the player's rank on the scoreboard instead of it being all lowercase the first letter is capital
I like my new Library ๐
nice password
Too late Iโve sold all your data
theres nothing there tho xD
I'm trying to make a @interface detect if its target field type is null, is it possible without a processor?
Example?
no
Sounds hard even with a processor
@Setting("host")
private String host;
this should warn
oh he means before runtime
you'd need to make a maven or gradle plugin no?
or you could just do native compile time thing like lombok
then you'd need to make an IDE plugin
that sounds complicated, so let's not do that, i'll just allow null values
i was just about to do the same thing lmao
Having a name like not null in a java programming discord is just asking for trouble
So looked more into lombok. I can see how you could slip up real easy.
But jesus getting rid of 100 lines of code made me weep like a baby
๐คฃ
Also wild take is there any inherent performance hit to making a single item stack POTION , grabbing the meta as a field, and just cloning it whenever ur factor needs to make a new Potion meta?
Seen 3 separate plugins make a new item / meta every call of the method now and its driving me nuts lol
I doubt it matters much
Eh when you have a server with 1500 brew recipies
Performance matters ๐คฃ
*I don't own the server but yeah. These guys are legit hitting the dreaded O(n) wall
Ngl I wouldn't be surprised if half the "NBT" problems out there with custom item plugins aren't actually caused by a wally storing the meta data in a damn list rather than a map ๐คฃ
Getting the same issue
anyone know a general java education resource about best practices
I just wanna know if there are computational costs to: (1) passing a reference to an instance of a class, 'A', which has variables in it 'B' and 'C', which can be obtained through A.getB() and A.getC(), to another class, or just (2) passing 'B' and 'C' directly.
I'd prefer to do (1) for readability + I'm trying to use an interface, the issue is some of the things the interface would be for would require only B, and others B and C.
Wouldn't this also be the case with 'version', ie version: 1.20 shows "incorrectly" in logs and /version? Worth looking
Plugin version? yes
So it's really just not understanding yaml / bad examples being provided
I know for sure I've seen people ask about it in the past though, however it's just not been as much of an issue
Well, yeah, not understanding YAML and the fact that 1.13 - 1.19 have all worked thus far
does anyone know why when i set a entitys velocity it doesnt really work in the y direction?
@celest sonnet what are you setting it to
And where are you setting it
It might be that thereโs a ceiling above it or something itโs catching on
Or itโs a player
i subtract the x y z of each of player from the mob
then mulitply by 0.45
then just setting it
Vector direction = new Vector( (playerlocation.getX() - moblocation.getX()) * 0.45, (playerlocation.getY() - moblocation.getY()) (times) 0.45, (playerlocation.getZ() - moblocation.getZ())*0.45);
event.getHitEntity().setVelocity(direction);
it works in the x and z direction just fine
however the mob wont shoot up at all
Well
Just do player.getlocation().toVector.subtract(mob.getlocation().toVector)).multiply(0.45);
This is better code for the vector math
But
Are you punching the mob from ground level
Like are you on the same level as it?
no its a trident that acts like a harpoon
and when it hits it just does that
so i am doing it from like 20 blocks above it and it doesnt do anything
if im directly above it, just stands still
You can always explicitly set the y to something
but i want it to act kinda like as if i was using a fishing rod on it
Do you cancel the event?
why would i do that
If you are setting velocity in a damage event the vanilla knockback will override it
Delay it a tick
^
weird so it only will override the y and not the z/x?
I think Col might actually be wrong
And itโs not that itโs overriding
And itโs just subtracting
But
Could be
Idk
whats the best way to do this
Just wrap it in a runTask
Since runTask runs a tick later
It does?
Yes
I did not know that lol
I just wanna know if there are computational costs to: (1) passing a reference to an instance of a class, 'A', which has variables in it 'B' and 'C', which can be obtained through A.getB() and A.getC(), to another class, or just (2) passing 'B' and 'C' directly.
@hybrid spoke
Well the first one means you need an extra method call
But thatโs basically nothing
Hm
The second one means you have 2 references instead of 1
Which is again basically nothing
What Iโm getting is definitely do the second thing and not the first
In Java, when you pass a reference to an instance of a class, such as class 'A', to another class, the actual reference is passed by value. This means that the reference itself is copied, but both the original and the copied references point to the same object in memory. Therefore, the computational cost of passing the reference is relatively low because it involves copying a memory address.
If you pass 'B' and 'C' directly instead of passing the instance of class 'A', it depends on the nature of 'B' and 'C'. If 'B' and 'C' are primitive types (e.g., int, double, boolean), then their values are directly passed by value, which is also relatively inexpensive. However, if 'B' and 'C' are objects, then passing them directly would involve copying the object's state, which could be more computationally expensive compared to passing just the reference to the object.
In summary, passing a reference to an instance of a class incurs a low computational cost, as it involves copying a memory address. Passing variables directly depends on their types; primitive types have low computational cost, while objects may have higher costs, as their state needs to be copied.
So I should make my variables primitives and pass them
I mean
what do i put as the long?
If they arenโt primitives they arenโt primitives
What is native
native.
runTask doesnโt require a long
is mine broken?
cant tell if you are serious rn
Some are vectors and I could turn that into three doubles
Aye
This is micro optimization territory
For thousands and thousands of particles
Iโd love to post video here but I canโt
Pretty sure you can spawn particles async
I do
no this is nothing
But it still gets up to 100% computer processor usage
And when I cut down the particle number it cuts down on processor use
runTaskLater takes a long, which is how many ticks later, but runTask doesnโt
Iโm doing lots of vector math
To like spawn a particle 1000x in the shape of a sphere
yeah i forgot that i had to include the ); at the end because i still dont really get the syntax of the runtask stuff
if you are concerned about your variables and passing them and their performance you should probably switch to C++
Lol
Is there a way to code in C++ for like a single class
this have to be rocket science then
The client can only render 16k particles at once anyway
Huh
So thatโs why
It wasnโt rendering the particle motion properly all the time
I didnโt know about that cap
Interesting
Hm
Maybe I should just divide the number of particles spawned
By the number of particles spawned in the last tick/1000
It probably already does some sort of particle throttling
So what Iโve got is: convert my variables to primitive types and pass them all
Do not pass objects
Or learn C++
Ugh this sounds like work
Especially since passing a location would have a world object anyway
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.Object java.util.Optional.value accessible: module java.base does not "opens java.util" to unnamed module @62ae095f
Has anyone ever got this error when working with serializing objects with Gson?
Trying to make something similar to a vault plugin and store items in the vault into a json file for the player and every time it supposed to serialize this happens.
Looks like possibly you have a type with an Optional field?
Which probably isn't serializable
Ideally you should never have an Optional anywhere other than as a return value
That's weird. When I serialize the item itself it works and the json file has all the data I want for it but it only occurs when serializing the item when it's in the vault..
is there a way to overwrite a recipe? e.g tnt recipe can that be changed? I have already searched couldnt find anything. Thanks.
How would you remove it or add one?
Use Bukkit.recipeIterator
so not Bukkit.removeRecipe ?
[17:37:46] [Server thread/ERROR]: Error occurred while enabling MCPlanes v0.0.1 (Is it up to date?)
java.lang.NoClassDefFoundError: org/eclipse/jetty/util/component/LifeCycle
so I'm using the libraries section in plugin.yml to load jetty
Oh is there a remove recipe method?
but now that I've updated to 1.20 it no work no more
Yeah by all means use that then
):
ahh alrighty, time to hit the docs
Is there an event for when the Sniffer digs up an item?
I believe the key for minecraft recipes is the same as their output
So itโs just minecraft:tnt
Mmmm, probably not yet? I can check though
i can just shade it for now but it'd be nice if it worked again lol
Weird, I know libraries in general is working
I didn't spot anything myself, that'd be great!
The only thing Iโve encountered before that didnโt work with libraries is bytebuddy
ill delete the libraries folder just in case
But yeah my 1.20 plugin is loading libraries fine otherwise
Maybe?
okay well I deleted the libraries folder so it's redownloading all of them
They do load plugins different these days
maybe it'll fix it
true
EntityDropItemEvent
I figured it would have called that but just wanted to double check md included it already with the 1.20 update
still getting noclassdef errors
Rip
has there been any commits since 4:33 pm?
Might be a spigot only difference then, canโt really tell yet
perhaps I need to run buildtools again
Beautiful, thank you!
4:33 est
ill try running my plugin on a spigot 1.19.4 server
I believe there have been changes then, yes
Nothing that should effect it but who knows
Weird
Prizes:
diamond_helmet:
chance: 20.0
display:
item: DIAMOND_HELMET
glow: false
amount: 1
name: '&6&lNoob Helmet'
lore:
- '&aChance: &e%chance%'
commands:
- give %player% diamond_helmet 1``` Hey guys how would I add enchantments to that helmet?
If only there was some place to report bugs
don't be reasonable why would anyone do that
sendBlockDamage flickers alot, how can I circumvent this?
It flickers if the player is mining said block
You can give them mining fatigue to stop them from making actual progress
where would i add enchantments.protection.name: PROTECTION_ENVIRONMENTAL enchantments.protection.level: 3 in this script? V # Crate Prizes Prizes: diamond_helmet: chance: 20.0 display: item: DIAMOND_HELMET glow: false amount: 1 name: '&6&lNoob Helmet' lore: - '&aChance: &e%chance%' commands: - give %player% diamond_helmet 1
did this, but its still flickering
they have -1 mining fatigue
Is this the correct code to calculate Y acceleration? I get a lot of random values jumping from -1 to inf
public double getYAcceleration() {
Vector currentVelocity = p.getVelocity();
double deltaYVelocity = currentVelocity.getY() - prevVelocity.getY();
double deltaTime = (System.currentTimeMillis() - lastVelocitySet) / 1000.0;
return deltaYVelocity / deltaTime;
}```
@worldly ingot Okay In game odd behavior with this lol
inventory = Bukkit.spigot().createInventory(null, 9,
TextComponent.fromLegacyText("Test Component", ChatColor.AQUA));
e.getView().spigot().setTitle(TextComponent.fromLegacyText("Test Component", ChatColor.GREEN));
Seems like a bit out of scope of your PR but I think TextComponet#fromLegacyText(String, ChatColor) is broken
I get correct coloring with
inventory = Bukkit.spigot().createInventory(null, 9,
new ComponentBuilder().append("Test Component").color(ChatColor.AQUA).create());
e.getView().spigot().setTitle(new ComponentBuilder().append("Test Component").color(ChatColor.GREEN).create());
Well, yeah, that's just because fromLegacyText() is doodoo
is their a shorter way than new ComponentBuilder()?
Not really. When you're dealing with components, you're dealing with components lol
also almost all the values are negative when jumping
I want to try and adopt MiniMessage standard for BungeeChat, but we'll see
Future PR
well in that case time to approve your PR i did a bit of fucking around other than fromLegacyText() sucking ass which isn't your fault it looks good
