#help-development
1 messages ยท Page 383 of 1
cant you go to a void world and just list all events
and it might just be entityinteraceevent
what would you call a drop chance of between 60% to 20%
what
wide error margin
Is someone here that is minecraft Sounds master, i have a sound on video, but i don't know how it's called in MC. i know it's neither server or dev help but if anybody has wide knowledge about it, please DM me
did webhooks change the way they work?
for some reason when im sending webhooks from server, its updating previous messages sent
๐ค
i know this aint spigot or bungee itself, but just curious if anyone also noticed if doing something alike.
update?
i dont see the update tag in the message, in teory webhooks only send a new message they cannot edit
yeah its updating previous messages details for some reason, in this case the author name
and no error on console ๐ค
ohhh the author of all messages?
try test this manually using postman and another webhook if happen then is a discord "feature" or bug not announced..
after i sent message, it updated all to Miau_
but
if i click on them, it shows what they were actually supposed to be
๐ค
this is weird
my guess is there was an update that changed that ๐ค
not my client
some player 7 hours ago noticed this
now we cant see since they all got changed to Miau_ ๐ but yeah... it was 12 hours ago
so its not just my client ๐ค
well then try like i said about using manually a webhook to test if change the name, if so then report with discord.
https://github.com/discord/discord-api-docs/
im not sure what you mean by manually
i mean using postman and recreate the messages sent by webhook to test... but i see in the discord of developers another person asking the same thing about the name updating in all messages
If I do player.damage(...); will it deal damage ignoring all damage reduction? There is no setFinalDamage but I need to deal damage that ignores all damage reduction...
setHealth
player.setHealth(player.getHealth() - damage)
I want to make a player ignore other players armor, but it should look like a normal attack, just setting health may be unwanted, moreover killing by that would not be counted as killing by this player...
main:
public final class Main extends JavaPlugin {
@Override
public void
getCommand("hi").setExecutor(new TestCommand());
}
}
TestCommand
package com.wolfyxon.playerdatamgr.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class TestCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
sender.sendMessage("wasup");
return true;
}
}
plugin.yml
...
commands:
hi:
description: Test command
usage: /<command>
aliases: [hii, hello]
it just prints the command name when I run it
omg i have my old username
are you sure you are using right jar
yes
because your usage should be returned only if onCommand returns false
which is not true in your case
here's a proof
[15:09:15] [Server thread/INFO]: [PlayerDataManager] Enabling PlayerDataManager v1.0-SNAPSHOT
[15:09:15] [Server thread/INFO]: [PlayerDataManager] PlayerDataManager has started
oh wait
when I remove it, errors appear
can you add some logging before sendMessage and check again
?
nevermind
change return true to return false at the end of the command.
why is yours true?
return false will return usage from plugin yml
true means that command is successfully executed
I saw on a tutorial that it must be true
hm
(im new to plugins)
just add some log message before sendMessage to ensure you are using right jar
what is that main class btw
:Kappa:
did u delete things or does it actually look like that?
that wont compile lol
that code won't even compile so you either sent wrong code or you are ignoring your ide being whole red
it should look something like this @half bane
I know
your code doesn't look like that ^
package com.wolfyxon.playerdatamgr;
import com.wolfyxon.playerdatamgr.commands.TestCommand;
import org.bukkit.plugin.java.JavaPlugin;
public final class Main extends JavaPlugin {
@Override
public void onEnable() {
// Registering commands
getCommand("hi").setExecutor(new TestCommand());
////////////////////////
getLogger().info("PlayerDataManager has started");
}
@Override
public void onDisable() {
getLogger().info("PlayerDataManager has stopped");
}
}
well, you didnt send that first time
ah ok
.
as i said, just add log message on your onCommand, because i think you are not using right jar
theres no logs
are u using eclipse jar imports or maven?
maven
add log message
i did
on onCommand
public class TestCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
System.out.println("RUN");
sender.sendMessage("wasup");
return false;
}
}
yeah, run command now
see if RUN gets printed
if it doesn't get, you are not using right jar
>hi
[15:22:22] [Server thread/INFO]: /hi
but i still get the logs from onEnable
send your maven
because your og jar probably have that
package jar again, and put it into plugins folder
oh true, maybe hes not updating plugin ๐คฃ imagine
that is most likely the case
ofc i am
[15:25:54] [Server thread/INFO]: [PlayerDataManager] Enabling PlayerDataManager v1.0-SNAPSHOT
[15:25:54] [Server thread/INFO]: [PlayerDataManager] PlayerDataManager has started
[15:25:54] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
[15:25:54] [Server thread/INFO]: Done (13.821s)! For help, type "help"
>hii
[15:26:03] [Server thread/INFO]: /hii
>hello
[15:26:06] [Server thread/INFO]: /hello
Yeah, are you returning false?
he is not
pom.xml?
yes
that is why i said he isn't using right jar
?
well if he send the wrong shit
he needs to send the correct shit.
.
We already concluded that he send something false.
package com.wolfyxon.playerdatamgr.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class TestCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
System.out.println("RUN");
sender.sendMessage("wasup");
return false;
}
}
?paste
false or true it should work
including plugin.yml
public void??
he already said he deleted some stuff
lol
well why doesnt he send the correct and up to date stuff then
the code isnt too big
make him upload him on github instead
@tall dragon
we want you to put everything properly
so we can diagnose it properly.
You are pasting incorrect code attempting to get an answer.
We can't give you one without the proper code.
now im pasting the full code
oh
NOW you do
after you wasted everyone's time already
great
upload it to github
bruh
alex being salty today.
alex woke up and chose violence
I only just joined and read the previous chat

I never expect spigot people to be sane.
i bet hes updating plugin on his pc server and asks "are you sure you want to replace this file" with the same name and he put to "always use same option" and probably picked "ignore this type of files" before ๐คฃ so its never updating
im not that stupid
did you meanwhile upload your project to github
idk man, u asked for coding help and deleted part of the code.
@frank kettle
oh yeah i read it.
im in that server as well
ty for letting me know its not just me, i even changed some part of the code tryign to fix it.
i will just wait till discords fixes it.
i did check the github and doesnt seem like anyone added it as a bug ๐ค
but might be me who never uses githubs issues part, maybe i saw it wrong
yeah.. you can be the first.. for track news
this code wont even work
Looks fine to me.
it wont be enabled in your server
i dont know how to add issues so i will just wait someone to do it ๐คฃ
new Main().getLogger().info("AAA");
Other than that ๐
i tried this since System.out wasnt giving any output
ignore how weird my debugging methods are
that will error in your console as you cant init another instance of main class
you are not using right jar then, for 100th time
i tried both
they work the same
new ClassThatExtendsJavaPlugin() will always throw error in spigot
Well all of them will send back the command name due to it returning aflse.
bad xd
its only create a issue like any other in github
ig something must be wrong in getCommand("hi").setExecutor(new TestCommand());
naming conventions go brrrr
well, if you don't want to listen to suggestions. ig you are on your own
i want
It is not.
the IDE can tell "this can be null" or if you dont register the command in the plugin.yml
it's registered
code you pushed to gh is not same code you are using on your server
theres some gitignored stuff
code
its generated by Minecraft Development plugin
git in the server?
I created a plugin with the exact same code from github and works for me.
?
so... whats wrong
@EventHandler(ignoreCancelled = true)
public void onPlayerInteract(PlayerInteractEvent event) {
if(event.isCancelled()) {
Bukkit.broadcastMessage("Cancelled"); return;
}
Bukkit.broadcastMessage("triggered");
}
So if i right click the air with an item it won't trigger the event at all. But if i remove "ignoreCancelled = true", it will trigger the event and event.isCancelled() gets true. If i right click a block it works without any problems
hm i removed the usage and now the command does completely nothing
...
and the old class was still compiled
chatGPT really has some talent creating minecraft plugins D:
please end me
its useless if u cant check its code
since its far from always correct
yeah right
also don't name your main class Main pls
okay
i dont feel like explaining why just do it ๐ญ
how do i make it end work ? ๐
wdym
can i do that?
sure
oh i can do that ๐
at this point i would use command api or make a array of pairs that i iterate to set executors for each command
itl probably tell you sorry and try to finish it xd
it can do some handy things for u
but if u cant actually verify what its doing its not all that usefull
is it truth that chatgpt stoles code?
so if you know what you can do with API, but want to use it to "make quicker" code. it seems handful
what about it in the future
it probably does take code from github repos
well "stole" it learned from code publicly available
there aint no stealing in the world of coding
its learning
๐ฟ ๐ท
yeah right
there is a good chance that it will get better at being right. but the problem will probably persist
Probably?
intresting
yea well maybe something revolutionary gets invented. but i doubt it ๐
problem is it takes code from whatever place it finds and doesnt have a way to verify it. sometimes it will take code from different APIs and put them together.... which makes it wrong. but the logic itself will be there, so be careful about it.
Is someone here having issues with Paper's itemMeta#lore method? I'm trying to set the lore to a list of components, none of which have italics
but no matter what I do they are all always italics
"this is spigot"
That is the kind of answer I expected from this discord
?spigot
xD
I know it is spigot, I know how to read
i mean at paper they will just tell u stop being dumb and fuk off
so eh pick ur poison i guess
you mean Paper's API or the Material paper?
possibly
But a decent chunk of people who make plugins for spigot also make plugins for paper, because surprise, paper is a spigot fork
wrong
Paper's API
we use spigot api for plugin, but maybe we use papers jar for server version
well show us what ur doing then maybe we know idk
maybe show code when asking for code help
try setting a color at the beginning?
List<Component> lore = new ArrayList<>();
lore.add(Component.text("test").color(TextColor.color(255, 255, 255)));
lore.add(levelComponent);
lore.add(blocksRequiredComponent);
lore.add(Component.space());
lore.add(enchantmentsHeaderComponent);
lore.addAll(enchantmentComponents);
lore.add(Component.space());
lore.add(gemsHeaderComponent);
lore.addAll(gemComponents);
lore.add(Component.text("test").appendSpace().append(MiniMessage.miniMessage().deserialize("<reset> test")));
lore.add(MiniMessage.miniMessage().deserialize("</italics> test"));
itemMeta.lore(lore);
I hate dumping code and telling people "go find the error" but yeah this is basically what I'm trying to do
i know lore will be set as italic by default if u dont put any color
maybe its that what u mean?
It doesn't matter what I do, it's always in italics. Tried mini message, component builder, everything
Nothing seems to work
is this how yours looks?
default lore formatting is italic dark purple lore
Yep
"nooo dont use strings please" @deprecated -paper
I only use TextComponents for chat stuff that requires hover/click events
well, thats a paper thing
Paper deprecates those things for literally no reason afaik
I'd use strings but since I have mini message added I'd like to use it and allow gradients
Yep, literally so just people get an annoying warning
on spigot setLore Strings isn't deprecated
of course, and it will always work for compatibility reasons
why do you use paper api btw?
Becasue the server is running paper and I want to add gradients and so on
doesnt paper api only add few extra "time saving" things like instead of doing getWorld.getChunk() you can do like getWorldChunk() right away?
yeah there are a couple of "shortcuts" like that
well it also includes minimessage by default iirc
wdym by gradient?
I'm using it to set item names and lores with components
and most things String related are components there
exactly
yep
What is in the lore() method anyways, honestly that and the Component class are the only things I could see that's adding the italics
But Components doing it seems odd unless it's some weird default behavior that you aren't overriding 
lore() without args is a getter and lore(List<Component> components) is a setter
The setter what's in that
let me take a look
Well, it just takes me to the itemmeta interface
no actual implementation there

I had made my own code as well, but I went with paper once I knew they had all of this already integrated
You're using the latest version of Paper right
Yep, updated 15 minutes ago
nothing adds italic
but a paper plugin wont work on spigot servers right?
the client does
yep
if you use a component method you have to actively set itallic to false
spigots legacy "fakes" that automatically
Well I was kinda right then, that is weird lol
it sucks if you make a plugin in paper u will basically lose 50% servers compatibility
unless u make then different versions
wtf is that stat for
And you can't post on spigot too
bStats
It's a private plugin anyways
The .3% running bukkit ๐ฅฒ
yeah thats understandable
one of my plugins
it must be a little different for other plugins but around the same no?
for spigot-paper %s
Yeah you still end up losing g abt 50% of the share
spigot is at ~25%
thank you so much
np ๐
itemMeta.lore(lore.stream().map(c->c.decoration(TextDecoration.ITALIC, false)).toList()) this did the trick
Yea I usually have a util method for that
concerning that applies to any lore / item display name yoU'll interact with
glad this issue was fixed here instead of the usual "this is spigot" :kappa:
?whereami
That is goofy that it makes you do that
Ban vanilla
but if paper is a fork of spigot, why dont they make it like that as well?
It can be vanilla and still be goofy 
paper does to
yeah me too
if you use legacy
but with components you directly describe how you want it to look
so overwriting a style on your component automatically is meh
kinda weird that paper doesn't explicitly tell the client not to apply italics if the component it receives doesn't have it
I mean paper can't
you'd have to modify the component
unless specified explicitly it is up to the client to decide how to render it
and sadly the client auto applies itallic
how do i delete project in intelij
I hate it too dw xD
mojang should have just explicitly made renamed items italic in like, an anvil or something
delete the folder?
doesnt intellij read the projects depending on the folders inside the workspace?
hm?
i usually just close the project & delete the project directory
yep that'd probably be the best option
If i want to make customConfig let's say items.yml and on first plugin launch it should create a File with already done/example config I should use saveResouce and getResource ? Am i right?
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
I'm starting with Gardle and I have a problem:
Gradle does not install bungeecord
compileOnly('net.md-5:bungeecord-api:1.18.2-R0.1-SNAPSHOT') <-- this lines does not work
am i creating restrictions object for my duels plugin correctly?
public class DuelRestrictions {
boolean bowAllowed;
boolean notchAllowed;
boolean potionsAllowed;
boolean goldenAppleAllowed;
boolean shieldsAllowed;
public DuelRestrictions(boolean bowAllowed, boolean notchAllowed, boolean potionsAllowed, boolean goldenAppleAllowed, boolean shieldsAllowed) {
this.bowAllowed = bowAllowed;
this.notchAllowed = notchAllowed;
this.potionsAllowed= potionsAllowed;
this.goldenAppleAllowed = goldenAppleAllowed;
this.shieldsAllowed = shieldsAllowed;
}
public boolean isBowAllowed() {
return bowAllowed;
}
public boolean isNotchAllowed() {
return notchAllowed;
}
public boolean isPotionsAllowed() {
return potionsAllowed;
}
public boolean isGoldenAppleAllowed() {
return goldenAppleAllowed;
}
public boolean isShieldsAllowed() {
return shieldsAllowed;
}
public void setBowAllowed(boolean yesornot) {
bowAllowed = yesornot;
}
public void setNotchAllowed(boolean yesornot) {
notchAllowed = yesornot;
}
public void setPotionsAllowed(boolean yesornot) {
potionsAllowed = yesornot;
}
public void setGoldenAppleAllowed(boolean yesornot) {
goldenAppleAllowed = yesornot;
}
public void setShieldsAllowed(boolean yesornot) {
shieldsAllowed = yesornot;
}
}
field access modifier where
what is that
is that your entire build.gradle.kts
you might be missing the java plugin which defines the compileOnly configuration
do i need to use private on every boolean or something?
you better
id make that thing a bitset wrapper but that doesnt matter
or atleast use flag encoding
what
google it if youve never heard about it
a BitSet is just a datastructure and the other is some binary logic
how can i create a SIMPLE object?
this is fine
Hi.
i usually make shit protected so internals and subclasses have access
thx
what about variables in it
do i need to use "private"
or something?
nah
ok
dont need to
Right now I have a Plugin called DraksLib that i usually import as files, classes.
How do I make it a Library so IntelliJ imports it, makes my project depend on it, instead of having to copy and paste the DraksLib Classes inside my project?
I didn't find anything helpful in the IntelliJ Docs, can someone walk me through?
what does return true; and return false; thing do in the onCommand? what will happen if i change true to false?
false implies the command failed and it will show the usage
Jitpack&maven
nvm fixed
I'll take a look. Thanks.
I suggest you to use lombok
Btw do not forget to compile your project on jitpack website before importing it.
Hey, how can I add a license to my plugins?
how do i send clickable message to a player?
take a look at textcomponents
Maybe minimessage instead
How can I generate an UUID for offline players like this website does? https://minecraft-serverlist.com/tools/offline-uuid (it's accurate with playerdata)
I have this function:
public String str2uuid(String string){
return UUID.nameUUIDFromBytes(string.getBytes()).toString();
}
but it doesn't generate the correct UUID
thats string to string not string to uuid
doesnt OfflinePlayer#getUniqueId provide what you need?
but i want to GENERATE it
in case the player is offline
i dont want whole message to be clickable. this is what im trying to do. "player sent you a duel request click ACCEPT to accept click DENY to deny on this message"
get the offline player from bukkit with username
and get its uuid
with the method said above
ig
is this sql
then idk
net.minecraft.world.Item and i call getDeclaredFields and map it to their name it returns A, B, C why are the mappings such as d(maxStackSize) not in there? What am i missing?
they dont seem to be existent anywhere
SELECT * FROM TABLE WHERE ID='ChunkID(x=10:z=-23)';```?
how do i
componentbuilder
thx
anyone got any ideas, These should be printed but its printing 3 declared fields, Nothing seems to make sense. kotlin private fun build(item: ItemStack): ItemStack { val itemstack = CraftItemStack.asNMSCopy(item) val jClass = itemstack.o().c() println(jClass.n()) println(jClass::class.java.declaredFields.map { it.name }) println(jClass::class.java.declaredMethods.map { it.name }) println("SUPER CLASS" + itemstack::class.java.superclass.declaredFields.map { it.name }) return CraftItemStack.asBukkitCopy(itemstack) }
hm thats fine, looks like the error thing did
wdym not hardcode the table?
what would you do otherwise?
im still wondering why you are saving json in a db based on the toString return values
also i dont really understand why you are joining the future
that defeats the whole point of it
your method should do one thing but it looks like its doing a bunch
how do i make code executable in clickevent?
read the method signature
and whats this for? you could probably load the db into memory?
already did
congrats
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
what are you trying to do?
ah
i dont have the docs or an ide
what is this crap ๐
.event()
how do i make code executable in that????
you dont
Execute a fake command and listen on playwr pre command event or whatever its called
why
cuz theres no other way
cannot spigot just make method for it
no
why
you just make your own command
and then listen for when it gets executed
vanilla restrictions I assume
You are free to contribute as spigot is opensource
call it ahhagagjagaiosiugtyuiojhgfa and nobody will use it
so what logic
it will execute that command as if by a player
The logic
Yes, if its a not real command and you listen to the command pre process thwy cant findit
Use a map monn
ah i was thinking about overriding some method ๐
use minestom if you think this is shit
how can player possibly know my random keyboard command?
xD
they cant
look it up

the whole point is that the player doesnt see the actual command
i know
how can player possibly search for that command?
If you dont register it and listen to command pre process they will never know it
like can he scroll up using arrow keys on keyboard?
no cuz he didnt type it
so who did
your pluing should still prevent wrong usages
what
"okay a command has been executed by this player"
isnt this command executed by player?
yes when they click it
Yes but they dont get to see the command
Run a random command and catch and cancel on player command pre process
wouldnt they receive /help message or something?
non registered command?
I mean unless your command send them a help message ig ;P
If you cancel it on player command pre process they wont
can i just do it by returns?
You dont register it or handle anything
ik
cant you hook in the commandmap and make sure it doesnt show up as a tabcompletion?
No, you need to cancel it or they will get an unknown command message
okay, so how does one "cancel the player command pre process"
More of just dont register it
Hmmm i just realised i just dont need to hide the command
ah you are just going to listen for the cmd pre prcs?
lol
lol
what does the command do
denys duel request
why would you want to explicitly hide that from the player
idk
i dont rember
why was i
xd
does args in onCommand contain the main command too? (spigot api)
no
Is there a way we can set keybinds?
the command is the parameter named "label" by default
not really no
set keybinds?, that depends on what way
Like "z" does a thing
for example u can use F as a useable key by cancelling the ItemSwap and performing ur own code
but no u cant do custom keybinds
yea and the client does not send its input
it just sends whatever actions its peforming
overkill
For custom keybinds the only thing you can do is listen to OFFHAND_SWAP and do stuff
you can also just cancel the thing and it won't swap
and the packet is still fired if both hands are empty, so it's convenient
for youtuber commissions I just tell them to remap the key
Can I listen to two events like shift and ofhandswap
for the text click to run a function, I've already given a solution to this in the past
Player#isSneaking ๐ค
At the same time it is doable right
yes
Can we cancel the sneak event too?
but you need to keep track of what has been pressed by what player I think
results in jittery behavior
Oh then I'll just use sprint + offhand
I've got some strange bug, I have this code, it runs every tick
yea here
My health isnt regenerating at all
and usage here
anyways
what's the best way of making an itemstacker?
just loop all entities in a radius?
ItemBuilder type thing
Trying to figure out scoreboard nametag visibility behaviour,
two players are on the same team with visibility set to never and they cannot see each other's nametags โ
one player is on another team with visibility set to always, and he can still see the other two's nametags ๐ why?
Guys it's possibile to create a cooldown for the name of inventory ?
When , for example , after 5 sec , it change
You can't easily change Inventory name without packets
Because i want to create a animated gui
With pure bukkit you'd have to make a scheduler for everyone in the inventory and create a new inventory with the new title every 5 seconds
Personally I'd use packets but you can do whatever you think is easier
how do i create custom named config
What is the difference between the Arrow and Snowball projectiles?
Is there any difference in how I determine its damage, speed, and direction?
thx for googling for me
if you want to separate them
use "instanceof"
My question is not about it
I am asking what is the difference between an arrow class and a snowball class cus they both seem to behave very similarly,
I would like to know if determining the speed, direction, and damage for both classes can be set in the same way(method?).
Although i haven't tested it, i believe so yes
But the best way to figure that out is testing it i guess
Is right clicking with an item the air not triggering PlayerInteractEvent anymore?
will this work ArrayList<UUID> uuids = (ArrayList<UUID>) Duels.ignoresConfig.getList("Ignores."+target.getUniqueId());
config:
Ignores:
someuuid:
- uuid
- uuid
?paste First use this, then ask an actual question
already did
Sorry wasn't replying to you, there was a post between us which they deleted
Is it possible to wrap primitive java array to let say a Collection or a list?
Arrays.asList
No
You could write your own I suppose
None in the stdlib though that I'm aware of
what if i want to use internally primitive array just because i know its initial dimensions and expose it as a collection
why is this not a thing
inside std lib
Frozen arrays were a JEP for a while but ultimately people just end up using Collections
You can create an initially-sized List as well
what does jep stand for
jdk*
Same thing >:((
Trying to figure out scoreboard nametag visibility behaviour,
two players are on the same team with visibility set to never and they cannot see each other's nametags โ
one player is on another team with visibility set to always, and he can still see the other two's nametags ๐ why?
you'd be auto boxing on every damn access
better than copying the whole damn thing
why would autoboxing be so expensive
I mean you are allocating on the heap everytime ?
doesnt array copying allocate space on heap too
yea but a single time
a single long block
iirc arraycopy of like an int[] with size 1 million was like 2ms ?
Could not find org.spigotmc
1.19.3-R0.1-SNAPSHOT.
Hello,
why I have this error? ```gradle
plugins {
id 'java'
}
group 'fr.program'
version '1.0'
repositories {
mavenCentral()
mavenCentral()
}
dependencies {
compileOnly 'org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT' // The full Spigot server with no shadowing. Requires mavenLocal.
}
sourceCompatibility = targetCompatibility = '17'
compileJava.options.encoding = 'UTF-8'
setLibsDirName('../server/plugins')
plugin.yml: ```
name: LoupGarou
version: 1.0
api-version: 1.19
main: fr.program.LoupGarouMain
you are missing the repository
remove duplicate mavenCentral() too
and spigot is not in any repository 
only spigot-api
(unless you are codemc and don't give a shit)
you need to buildtools
for this to work
and as the comment says mavenLocal() inside repo block
Not if it's a primitive collection :)
IntList <o/
plugins {
id 'java'
}
group 'fr.program'
version '1.0'
repositories {
maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
// As of Gradle 5.1, you can limit this to only those
// dependencies you expect from it
content {
includeGroup 'org.bukkit'
includeGroup 'org.spigotmc'
}
}
/*
As Spigot-API depends on the BungeeCord ChatComponent-API,
we need to add the Sonatype OSS repository, as Gradle,
in comparison to maven, doesn't want to understand the ~/.m2
directory unless added using mavenLocal(). Maven usually just gets
it from there, as most people have run the BuildTools at least once.
This is therefore not needed if you're using the full Spigot/CraftBukkit,
or if you're using the Bukkit API.
*/
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
// mavenLocal() // This is needed for CraftBukkit and Spigot.
}
dependencies {
// Pick only one of these and read the comment in the repositories block.
compileOnly 'org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT' // The Spigot API with no shadowing. Requires the OSS repo.
compileOnly 'org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT' // The full Spigot server with no shadowing. Requires mavenLocal.
}
sourceCompatibility = targetCompatibility = '17'
compileJava.options.encoding = 'UTF-8'
setLibsDirName('../server/plugins')
``` https://www.spigotmc.org/wiki/spigot-gradle/ ๐ญ
LoupGarou:main: Could not find org.spigotmc
1.19.3-R0.1-SNAPSHOT.
Searched in the following locations:
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.19.3-R0.1-SNAPSHOT/maven-metadata.xml
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.19.3-R0.1-SNAPSHOT/spigot-1.19.3-R0.1-SNAPSHOT.pom
- https://oss.sonatype.org/content/repositories/snapshots/org/spigotmc/spigot/1.19.3-R0.1-SNAPSHOT/maven-metadata.xml
- https://oss.sonatype.org/content/repositories/snapshots/org/spigotmc/spigot/1.19.3-R0.1-SNAPSHOT/spigot-1.19.3-R0.1-SNAPSHOT.pom
- https://oss.sonatype.org/content/repositories/central/org/spigotmc/spigot/1.19.3-R0.1-SNAPSHOT/maven-metadata.xml
- https://oss.sonatype.org/content/repositories/central/org/spigotmc/spigot/1.19.3-R0.1-SNAPSHOT/spigot-1.19.3-R0.1-SNAPSHOT.pom
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
I am with groovy.
lol
for me, if ignorecancelled is set true it is only triggered when i right click a block, if ignorecancelled is false its getting called but instantly cancelled
have you run Buildtools?
well i dont think autoboxing of arrays would be so bad, its not as if you dont do this with Lists or maps when you add primitive values to it (it autoboxes primitives)
The Spigot jar is not distributed due to licensing, the API is. To depend on Spigot you must run Buildtools to build it locally
?bt
oh lol
i mentioned primitive array right
my bad
i was used to cpp naming
when i meant primtive array i mean fixed sized array
The uri is blocked in country caused to DMCA
not primitive valued fixed array
Then?
?bt
I installed it.
so if I lets say used Object[] array
run it
follow the wiki, they explains you everything
Well everything you put into that array would get boxed
.3
And if you ever wanted to take it out and access it as an int, it would have to be unboxed (less expensive than having to box, but yeah lol)
say objects[0].intValue(), that's an unboxing operation (and if you didn't explicitly use intValue(), it's just implied)
yea but lets say i use class objects
not primitives
in the array
i get it when you use ints or chars or other primitives
How I find it???
Yeah like an Integer[] or something. You can do Integer[] array = { 1, 2, 3, 4 }; but you're still boxing 1, 2, 3, and 4
Boxing just means primitive -> wrapper
Nvm.
read the page I linked for Buildtools
Second time, i wouldnt use any primitives in the array
new Integer(5)? lol
You've lost me
MyClass[] instances;

And MyClass holds an int or something? lol
no
but you said you want primitives
You're still allocating to the heap so you're delegating the problem
I'm so confused
i named it wrong
the entire point was about primitive and boxing ๐ญ
Once I runned it, what I do?
build your plugin
when i said primitive array i meant fixed array data type
not fixed array data type with primitives in it
Well
afaik java doesn't have Array object
Object[]
what's this then ๐
so you want an immutable view of a normal Object array
Then we loop back to the frozen array JEP and people just using Collections
Ok I will try thanks.
yes
cmon
lol
:/
yea something along those lines
there is a package private method to create one of those arrays
you just don't have access to it 
i guess reserving initial list capacity would work for now
and then using Collections class to make a view of it
i dont have it as my dependency
ik its in spigot
but i tend not to use
doesnt fastutil have smth like this
empty paste
if you have it as a dependency, go for that I guess
If I cancel this event, will players still have a way to obtain items from their inventories?
you have not run buildtools for 1.19.3
fastutil 
I did...
nope, not successfully
I will redo.
?paste your buildtools.log
Constructors are for those that haven't learned the prettiness of hiding the new keyword
Down with the new keyword
imagine the perfect world we'd be in
if people chose ItemStack.of(Material)
instead of new ItemStack
???
thats not buildtools.log
thats better
ok it build
now ensure you have local maven as a repository in your gradle
Execution failed for task ':compileJava'.
Could not resolve all files for configuration ':compileClasspath'.
Could not find io.netty:netty-transport-native-epoll:4.1.82.Final.
Searched in the following locations:
- file:/C:/Users//.m2/repository/io/netty/netty-transport-native-epoll/4.1.82.Final/netty-transport-native-epoll-4.1.82.Final.pom
- https://oss.sonatype.org/content/repositories/snapshots/io/netty/netty-transport-native-epoll/4.1.82.Final/netty-transport-native-epoll-4.1.82.Final.pom
- https://oss.sonatype.org/content/repositories/central/io/netty/netty-transport-native-epoll/4.1.82.Final/netty-transport-native-epoll-4.1.82.Final.pom
Required by:
project : > org.spigotmc1.19.3-R0.1-SNAPSHOT
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
repositories {
mavenLocal()
}```
Ok now it's good!
your mavenLocal() is commented out
I just forgot to add mavenCentral().
Gradle wooooo
can someone confirm you're not on weed again
No i quit them months ago
whats so weird about it apart that they use a newline for brackets
oh right
Because chat gpt given another way of implementation which looks more like bungee one
I mean im first time using velocity because the bungee plugin doesnt work there, and makes sense tho
Does Reference in fastutil means a view of container?
or what
there's literally no definition on naming
of fastutil classes
at least in javadocs
does ReferenceList copy values or uses passed collection or array to display
@eternal night
well for your defined class ReferenceImmutableList constructor does not copy the objects
public ReferenceImmutableList(final K a[]) {
this.a = a;
}
i wonder if this is the case for other Reference based lists
note that constructors using an array will not make a defensive copy.
so ImmmutableList.of() doesnt not work
or it actually does
Note that this method does not perform a defensive copy.
@mortal hare refernec means it compares via reference not equality
if you want to use .equals you can go with ObjectImmutableList
i think ObjectImmutableList would suit me better
really depends on your setup ยฏ_(ใ)_/ยฏ
since i would return List interface
both implement that
List interface should not make any assumption about comparison method used
but yea
ObjectImmutableList is probably the safer bet and does not create a copy either
yea
Hello. Is there a way to ignore the region protection when a player places or breaks a block in WorldGuardAPI?
Like with the flags block-break allow and block-place allow
I mean Collection has a bunch of nice extra methods ?
if you return me an Iterable<Something> and for a simple contains call I have to loop over that damn iterator I am not using your lib lol
Can I make arrows go through blocks?
in paper iirc you have dedicated event for that
Iterable<T> allows you to use a for each loop
yea that is the use of that interface lol. If you want your type to be usable in a foreach loop
Prefer returning neither. Collections at least have immutable implementations. Iterator does not.
If you want to iterate then write a method which passes a Consumer<T> and iterates for you.
eh
Consumer for iteration is meh
like, you are now stuck in effectively final land
so getting any information for that iteration back up is rough
Do you know this event name?
Was just an example. But exposing an iterator breaks the encapsulation of your mutable objects which i dont like at all.
declaration: package: com.destroystokyo.paper.event.entity, class: ProjectileCollideEvent
and obviously @UnmodifiableView, thank you jetbrains
Hm? Never seen that. Is it any useful?
allows your IDE to be smart
my object is immutable, and im returning immutable list
I found ProjectileHitEvent, gonna try to cancel it
Ah makes sense. Inferred annotation...
how did i not know this
gets you that
idk, jetbrains annotations don't actually get you safety just make user experience so so so much nicer
But their example is a very interesting choice because Arrays.asList already returns an immutable List...
i hate people that use notnull and nullable annotations everywhere

why
one case where nullable is not actually null and i gotta suppress warnings everywhere
Can you PR their wiki? I wanna add "Jetbrains source contributor" to my github XD
idk ๐
Ttoally agreew ith you
so you hate people that write incorrect code
I dont like using apis who uses @urban grotto and @Nulleable because then i need to supress the shity warnings
I like the null annotations
IDE annotations > Useless heap objects
^
whenever i call player.getInstance().X() in minestom i gotta suppress the nullable warning even though it can never be null ๐ข
tho valhalla might change that
Specially when you use Config#getString() its yell you telling that the string can be null
that doesnt have an annotation
then minestome might be either poorly designed or wrong there
Yes it has
well it can be null, but whenever a player spawned their instance cannot be null
I had to write a micro service where everything that got in was immediately wrapped in an optional and no null values
or unpacking where allowed. Never had a NPE
cant it be null?
yeah a Player object "should" never be null, The getter can return null though
therefore the object can
That can be null
If the path doesnt exist
only for InteliJ ๐
wtf
does anyone by any chance knows a site which explains entity behaviour in detail?
that fandom stuff doesnt say much and wiki.vg is only about packet stuff
bump
programatically?
if this question is for me, then yeah
I want to ignore that protection somehow with some specific conditions
if that's possible
you could listen late to the event, if it's cancelled you coudl query WG to see if it's blocking. Then handle it manually.
yeah, but still u will get the message
that u can't build, for example
if that's what u mean
then you need to listen early and query WG, then cancel the event before WG gets it and handle it yourself
that means you have to listen to every place/break
WorldGuard ignores the fact that u cancel an event
iirc world guard has some internal events
you could use
just, well, they are highly subject to change
which might be a problem for you
that is the public one
and it's about pvp
which is API contract
as stated, there are internal ones
which are not API contracted, hence might change a lot
yeah
hence why I stated, you could use them just, might explode without notice
might be worth just asking in their discord btw
oh i also hate people that use @ApiStatus.Internal

yeah, probably, ty
more warnings to suppress
me reverse engineering entity ai with chatgpt ๐
heh isnt there a generic.movement_frequency?
stupid ai is explaining stuff to me, convincing me that it exists and then it doesnt ๐
I'm a Never Nester and you should too.
Access to code examples, discord, song names and more at https://www.patreon.com/codeaesthetic
Correction: At 2:20 the inversion should be "less than or equal", not "less than"
oh i also hate people that dont write a toString
toString is overrated 
Whats your IDE erroring about? Wrong parameters?
Oh yeah i see whats wrong. Your method expects a Player but you pass it a String
Dont do that.
Your getIP requires a player object when you are passing a String
Whats your IDE erroring about? Wrong parameters?
I think he is using eclipse ๐
I know that, but how do I fix it?
switch statements
either use a Player object or create a method which accepts a String
Pass a Player object instead of a String one
But then the command no longer works
Pass your target



