#help-development
1 messages ยท Page 378 of 1
that's because there you think that magically the value returned by getItemInMainHand() got saved into a variable called "ItemInMainHand"
there is no variable called "ItemInMainHand" so it fails to compile. why don't you replace that non-existing variable with the actual method call?
so i have to do something like. ItemInMainHand = player.getINventory().getItemInMainHand()
if you need it more than once, yes
if you only need it once, just use the method directlry
and your variable names should have lowerCamelCase, so it should be "itemInMainHand" instead of "ItemInMainHand"
@remote swallow have you ever seen this before?
this is my first time writing tests in gradle
yeah but you have another huge mistake in your code, you compare strings using ==
do never do that
String Comparison in java. There are the three ways to compare the strings. Let's see the three ways with suitable examples.
using the .equals() method
uuid.equals("The uuid here")
String firstString = "a";
String secondString = "a";
firstString.equals(secondString)); // will always be true
// but
firstString == secondString; // This will only sometimes be true, expect to get some random behaviour, NEVER do this unless you know exactly what you're doing
although both strings are "a", they are usually NOT ==
they are two different strings that just happen to randomly have the same "contents"
np
(it would probably work for the first 1000 comparisons or so, because the JVM caches strings, but after that you'll just get weird results)
well i think i fixed it
yeah
or is it actually an UUID?
String uuid =
and it's usually not needed to check the "cmd"'s getName(), unless you register the same CommandExecutor for different commands
(but it's no problem, just something that'd annoy me)
but it works?
i only have one command
how could i make it "less" useless
just get rid of the "if(cmd.getName()..." line
the name will ALWAYS be equal to "recieve"
so no need to check it
oh
7.6
try 8.0
I can't D:
why not ?
because I am doing an IntelliJ plugin, using the IJ builtin "IJ plugin template", and it uses 7.6, and it also says I'm using "deprecated API and my plugin will fail to build in 8.0"
well I could try 8.0
how would I change the version? I am very new to gradle
thanks, will try
twice? o0
erm ok
ah yeah it's downloading
let's see :3
hm now I get this
using 8.0.1
running it from CLI shows this
it now says my build file is corrupted or sth, however it's the same as what I sent earlier ^
here it is again https://paste.md-5.net/ijarezeqeg.cs
(IJ btw doesn't complain about this file)
can I downgrade it again using the same command as earlier?
there's probably a reason why IJ defaults to 7.6 instead of 8.0.1
are you using junit?
ugh I also can't downgrade anymore, it keeps showing this msg even when just running ./gradlew wrapper --gradle-version 7.6.0 D:
this error
why is gradle such a pain
https://github.com/mfnalex/SpigotPluginGeneratorPlugin here's the full repo in case anyone can help, would be appreciated โค๏ธ i just want to get the tests running lol
Hey, I am stuck at a problem. I am creating a chest shop plugin and how do I get the amount in a whole inventory at a certain block type? For example if the amount, you want to sell is 100: How do I remove a stack of the type and then 36 from the other stack?
I managed to downgrade gradle again, editing the gradle-wrapper.properties, however I'm still looking for answers regarding this "test" stuff ๐ฅฒ
loop over it, then count it yourself
Thanks ๐
just a tiny example
public static int getAmountOfBlocks(PlayerInventory inventory, Material material) {
int amount = 0;
for (int i = 0; i < inventory.getSize(); i++) {
if (inventory.getItem(i) == null) continue;
if (inventory.getItem(i).getType() != material) continue;
amount += inventory.getItem(i).getAmount();
}
return amount;
}
yeah that basically does the same
morice can you help me with my gradle issue D:
np, me too
but this time I have to use it
wdym with "anvil combine system"?
can't you just loop over the enchantments of the left side, enchantments of the right side, then check which enchantments are present in both things, then ++ that level?
did you manually extend the bukkit enchantment class? because you are usually not supposed to do that
it should but IIRC it doesnt. extending that oneself also is not supported, as explained on the overview page of the javadocs
using a custom PDC tag to detect your enchantment
e.g. a boolean "hasMyEnchant" or an int "myEnchantmentLevel"
the anvil should keep your custom PDC tag intact. to however "stack" the enchantments, you gotta code that yourself
np
you are always free to submit a pull request lol
I agree however that this should be builtin, yes
only takes 20 seconds to do it
Seems like a purpur thing to add
you could also send me your pull request, then I'll submit it haha
I don't recall it completely
but isn't it my source when someone sent it to me and told me I could use for whatever I want?
No
I want to make custom items in items.yml
- How can i detect how many items to create ? (Loop over every key and create ItemStack?)
- How to tell apart which item is which, I mean when it comes to Events, how do I know which custom_item I am holding? (PDS?)
what is "items.yml"? your own custom yaml file?
for example
usually you wanna assign a custom PDC tag to each of your items, e.g. a PDC tag like "my-item-id": "MY_AWESOME_RUBY_SWORD"
then you can just use that to detect your custom items
oh, yeah, that's smart to give PDC a special line in config
hm I wouldn't make this tag configurable, but you do you
maybe you can share how you imagine your items.yml to look like, then people would give you suggestions on how to do it
also, can somebody answer my gradle question pls ๐ฅฒ
ya, sure, one sec pls
gradle traitor
i HAVE to use gradle for this
it's an IntelliJ plugin
I would use maven if I could
I would also not use kotlin for my build.gradle lol
oh my, can it get any worse
yeah it's called "gradle 8"
that one stops to read my build.gradle completely haha
gradle gets worse with every new version they release
The intellij plugin isn't compatible I presume
how can I enable that i can break Bedrock and dupe Tnt with spigot
items:
item_tier1:
item:
name:
lore:
material:
materialData:
customModelData:
glow:
itemFlags:
typeName:
settings:
cooldown:
dropchance:
recipe:
Something like that
What local gradle version do you have installed
yeah probably
Not the wrapper
I'll check in a second
I'd just apply a pdc tag like "my-item-id":"item_tier1" in the case, or sth
and u suggest making it directly in plugin and not in config file ?
yeah, otherwise admins will have to care about it, and trust me, they'll forget it
I already downgraded the wrapper in the repo to 7.6
Ah kk
but still got the issue that it complains about NoClassDefFoundError when running tests
how can I enable that i can break Bedrock and dupe Tnt with spigot
is there a maven shade plugin that works with java 19
or you just returned false after processing your command
but what's the fix? ๐
I mean it can't be possible that gradle 7.5+ doesn't work with junit anymore
3.4.1
How do you access 3.4.1? Latest I can seem to find is 3.3.0
you just set the <version> to 3.4.1 in your pom
it's on maven central, it should then automatically download the newest version
๐
your plugin failed in onEnable() or onLoad()
did it work?
Yeah thanks
check the server startup log
np
I was under the assumption that intellij was listing all the stuff available haha
yeah no, you gotta click the "maven reload button" for intellij to recognize the changes you did
this one
intelliJ is a bit stupid
It's a regression with the 7.5 and intellij plugin plus junit
uuugh
Prior works later works tho I guess intellij plugin isn't 8.0 compatible?
Well 7.4 maybe
Hey,
I started using ProtocolLib and tried the given example code on their GitHub Readme (github.com/aadnk/ProtocolLib).
Somehow the example is failing for me. Does someone have experience with Lib and could help me?
This is my error: "Caused by: com.comphenix.protocol.reflect.FieldAccessException: Field index 0 is out of bounds for length 0"
hm 7.4 is now stuck infinitely at "instantiating tests" D:
(I just ran ./gradlew test using the same build.gradle.kts as above, with an empty @Test annotated method
hm now it finished after a minute:
Starting Gradle Daemon...
Gradle Daemon started in 1 s 674 ms
Download https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib/1.5.31/kotlin-stdlib-1.5.31.jar, took 814 ms (1,51 MB)
> Configure project :
[gradle-intellij-plugin :SpigotPluginGeneratorPlugin] Gradle IntelliJ Plugin is outdated: 1.8.0. Update `org.jetbrains.intellij` to: 1.13.0
> Task :setupDependencies
> Task :patchPluginXml UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :setupInstrumentCode
> Task :generateEffectiveLombokConfig
> Task :compileJava
Note: C:\Users\mfnal\IdeaProjects\SpigotPluginGeneratorPlugin\src\main\java\com\jeff_media\spigotplugingeneratorplugin\dependency\RepositoryList.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :classes
Download https://cache-redirector.jetbrains.com/intellij-dependencies/org/jetbrains/annotations/20.1.0/annotations-20.1.0.pom, took 70 ms (1,35 kB)
Download https://cache-redirector.jetbrains.com/intellij-dependencies/org/jetbrains/intellij/deps/jdom/2.0.6/jdom-2.0.6.jar, took 163 ms (339 kB)
> Task :generateTestEffectiveLombokConfig
> Task :instrumentCode
> Task :postInstrumentCode
> Task :processTestResources NO-SOURCE
> Task :jar
> Task :prepareTestingSandbox
> Task :compileTestJava
> Task :testClasses
> Task :instrumentTestCode
> Task :postInstrumentTestCode
> Task :test
> Task :classpathIndexCleanup SKIPPED
BUILD SUCCESSFUL in 1m 37s
15 actionable tasks: 13 executed, 2 up-to-date
no clue whether this is something good or bad
seems like it actually ran the tests I guess
hm seems like it didnt. I now edited my test to do assertNotNull(null), but gradlew test runs without throwing any errors, UUUUGH D:
thats why i dont use gradle
I have to use gradle for this
forked a gradle project and ij needed 10 minutes to download stuff
thats why
I'm now at the point where I'd pay someone 20โฌ to fix this for me
or 50
whatever
I just want it to work
TL;DR:
Gradle 7.4: it just skips all my tests
Gradle 7.6: It claims "no class def found" error when running tests
gradle 8.0.1: It complains about my build.gradle being corrupt without explaining what exactly the problem is
is it possible to get a list of another plugins commands
making a "build mode" thing rn. i want to block worldedit commands for the player if their build mode is disabled
reflections ig
why don't you just revoke their permissions
im generally doing too much reflections and unstafe stuff so no clue if theres an api way
not the same thing. i want to prevent "accidents"
hm weird, but okay: Bukkit.getCommandMap() returns the commandmap
which version is that
it has a method getKnownCommands() that is basically just a HashMap<String,Command>
what is your version
16.5
it existed in 1.16
it says The method getKnownCommands() is undefined for the type Bukkit
Bukkit.getCommandMap().getKnownCommands()
btw when 1.16.5 came out, I was still straight and not gay lol
huh
hm I could have sworn that getCommandMap() always existed
you can still get it easily:
- cast Bukkit.getPluginManager() to SimplePluginManager
- call getCommandMap on that one
Don't you need reflection to access the commandMap?
not in 1.19.3
/**
* Gets the CommandMap
*/
public static CommandMap getCommandMap() {
CommandMap commandMap = null;
try {
if (Bukkit.getPluginManager() instanceof SimplePluginManager) {
final Field field = SimplePluginManager.class.getDeclaredField("commandMap");
field.setAccessible(true);
commandMap = (CommandMap) field.get(Bukkit.getPluginManager());
}
} catch (final NoSuchFieldException | IllegalAccessException | IllegalArgumentException | SecurityException e) {
e.printStackTrace();
}
return commandMap;
}
this should do in outdated versions
The method getCommandMap() is undefined for the type SimplePluginManager
this ^
ok thanks
yeah because it's private
thanks
i think thats a Paper api thing
?jd-s
What data structure could adequately represent TabCompleter?
That's what I was thinking
ik some plugins that just use a List<Function<List<String>,String>>
like luckperms iirc
well a bit more sophisticated than that nested type
but ye
why skull?
:C
I highly doubt that, I NEVER use paper api
its actually a fairly nice way of handling it given bukkits functional interface api for it
oh wait
in this single project, where I tried it, I actually do use paper api
my bad
fuck paper api
wtf even is that
"lol we added a single method but nobody of us dared to sign the cla to contribute it" like wtf
list that holds lambdas?
yes essentially
why are paper contributors always afraid to sign a contract that simply states "I didnt steal it from somewhere else"
so for first argument, there's a function that takes the entire command line and produces a token of it
paranoia
that they might stole it accidentally
you cannot steal sth accidentally
Alex my bre
you either wrote it or you didnt
wdym? They have to start or end in Test
no you should name it like in baeldung's tutorials
๐
Omeglul
I mean wtf
why does this not run
and why does gradle never output its version when it gets run
wdym
?
here's my cli output of ./gradlew test btw @eternal night. still not running any tests D:
Issue #1 is that it's not maven โ ๏ธโ ๏ธโ ๏ธ
is there a way to use another Component as placeholder for another one?
liek Component.text("some text: %s", other)
I would use maven if I could, but this is an intellij plugin
translatable supports that syntax but idk if thats how im supposed to use it
basically like printf() in c/c++ ?
ya
no
TranslatableComponents are only needed to support locale inside clients
looks like im abusing it then
Ehm
@tender shard are you usipkg the right test annotation
you cant just change the component and abuse it
declaration: module: org.junit.jupiter.api, package: org.junit.jupiter.api, annotation type: Test
just use string.replace()
is this not the correct one?
Try the linked one
ok1 sec
MiniMessage
no no no that looks even more awful
ok that indeed now runs the tests in gradle 9.4.0. but it still fails in 9.6.0
> Configure project :
[gradle-intellij-plugin :SpigotPluginGeneratorPlugin] Gradle IntelliJ Plugin is outdated: 1.8.0. Update `org.jetbrains.intellij` to: 1.13.0
> Task :setupDependencies
> Task :patchPluginXml
> Task :processResources
> Task :setupInstrumentCode
> Task :processTestResources NO-SOURCE
> Task :generateEffectiveLombokConfig
> Task :compileJava
Note: C:\Users\mfnal\IdeaProjects\SpigotPluginGeneratorPlugin\src\main\java\com\jeff_media\spigotplugingeneratorplugin\dependency\RepositoryList.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :classes
> Task :instrumentCode
> Task :postInstrumentCode
> Task :jar
> Task :prepareTestingSandbox
> Task :generateTestEffectiveLombokConfig
> Task :compileTestJava
> Task :testClasses
> Task :instrumentTestCode
> Task :postInstrumentTestCode
> Task :test FAILED
> Task :classpathIndexCleanup SKIPPED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///C:/Users/mfnal/IdeaProjects/SpigotPluginGeneratorPlugin/build/reports/tests/test/index.html
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
15 actionable tasks: 15 executed
Lol
soooo
- thanks for telling me that I used the wrong annotation, that was indeed very helpful
but
- I still want it to work on the actual gradle version IJ's template wants me to use
I really don't get it
how can "latest junit" be compatible with gradle 7.4 but not with gradle 7.6 and in gradle 8.0 it fails completely lol
yeah it fails in gradle 8.0.X but the plugin itself works fine in 7.6
fuck gradle, everything always only causes problems
how can people use it on purpose
It's a lot of moving parts
adventure components?
So thinks break
yeah I also found that issue, but it got closed without any reply
Well it got fixed
and how? what do I gotta do? I only created this IJ plugin today, using the builtin "new IDE plugin" wizard
Check if their GitHub has anything about 8.0 support
or
minimessage 
but using 8.0.1 won't read my build.gradle at all
Well check why not
ah, Gradle.
Check the plugins GitHub
it says the error is "line 1, column 1"
which I highly doubt
how can anyone, in the history of anything, ever came to the conclusion that gradle would solve any issues
Venting won't help you here
I have been spending hours now, getting a simple thing to work
Lol
I just would like some explanation
Spigot components will prevail!
You can do things in gradle that just aren't as nicely possible in maven
Especially caching
u mean bungeecord chat?
yea :(
yeah for example "spending 4 hours to get it to work"
Sure that too
wish they would integrate some sort of components directly into Bukkit
like this, for example
(using version 8.0.1 - do not ask me why gradle thinks it shouldnt output its current version)
could totally go the Paper route, just without Deprecating the old
integrate bungee chat 
BaseComponent[]
or yet another component api

spigot's components are the worst shit ever invented, everyone knows that
Is there a raytraceentities that gets multiple hit entities?
no
its just a little convoluted...
There should be an api for that
Just recast the Ray
now please create an inventory with that component
haha, no
haha
then contribute it:
But it's going to stop at the first entity every time
?stash
thats what ComponentBuilder#create returns 
No recast it from the hit entity
anyone who complains about missing API features should contribute those "missing features" instead of just complaining
I will
CLA scawy 
CLA not scary
i still have some server api stuff i needed to PR actually
CLA just says "I hereby say that if I copy/pasted other people's code, it's my problem and not md5's problem"
i should probably make an outline of all the stuff i think could be edited on the fly
no clue why anyone would be hesitant to sign it
and possibly some stuff from paper, reimplemented in my own way
unless you regularly steal other's people's code, you can sign it without problems
some people just dont want to give legal information
thats usually all it boils down to
and inb4 "my full legal info is on my website <links website>" not everyone is U
hm idk but if someone wouldnt even tell their name/address info, I also wouldn't want to accept their PRs
also, I wanna add that whatever someone puts into the CLA is not public
only md5 can see it
true
and he also doesnt check whatever you fill in there
I could have said "123 Whatever Street", he wouldnt have noticed
Whst is cla and md5 as in the hashing algorithm?
?stash
?cla
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
What the best way for creating a custom editable menu?
If bukket.world is just an interface where us the actual location?
Pf the implementation
CraftBukkit
Bukkit is just an api, all the implementations are done over CraftBukkit if im not wrong
?stash
Thanks. I don't really see why you wouldn't kust directly use the craftbukkit?
because you want your plugins to work in both 1.18 and 1.19 and 1.20
and that's why you are supposed to use bukkit instead of CraftBukkit
because you don;t want implementation directly accessible
exactly
you should not rely on implementation, but only on interfaces
this may seem like a silly question but how do i use a library from github
Ah gotcha. So there is a lot of versions of craft bukket,but you can use onr api for them all?
You'd have to release a new plugin build per version
depends. do they provide any "maven dependency" information? like, do they got any information about a "repository" and "artifact id"?
not that i can see
also do you, yourself, use any build tool, like maven or gradle?
can you send the repo?
yeah sending a link to the repo would be helpful
hello im tryna remove 0,5 level from a player but i cant seem to do it
yes maven
https://github.com/domisum/CompitumLib
its a path finding thing
you can just clone that repo, then manually "mvn install"ing it
im using player.setlevel but it removes 1 level instead of half
are you using IntelliJ?
or add it using jitpack
Hey guys, question about minecraft sessions... Its possible to a pirate user fake their uuid?
yes
- File -> New Project -> New Projhect from CVS -> Insert the github link of that lib
- Run "maven install"
- In your other project, use the dependency, groupID: de.domisum, artifactId "CompitumLib", version "2.0.0-SNAPSHOT"
Looking through the source code is actually pretty fun some times
Gives me inspiration on how to do certain things
i learned coding by mostly reading other people's codes and tryna understand what they do and why they do that
while that does work, it's probably the most annoying way of doing it
usually you can just read the docs instead
yeah but on legacy or bad docs its bad, better to read other people when its the case
yeah true, but tbh everyone who didn't get a huge shit pile in their head DOES write proper docs
md5 is a person
/ md_5
he owns spigotmc
maybe that's the reason why maven is more popular than gradle
yeah but sometimes they write it, but u cant understand anything from it
yes
if the docs are more complicated than the source code, maybe the library itself isn't worth using
yeah probably but on some cases its the only u can find
my javadocs are usually on point, just an example: https://hub.jeff-media.com/javadocs/morepersistentdatatypes/ if the javadocs would be any less descriptive, I'd be very ashamed lol
package index
So... to check if a player is a original client i need to use https://wiki.vg/Protocol#Login packets, right?
and verify the tokens?
oooooh protocollib
to check if a player is real, use online mode
protocollib is known to have the shittiest docs EVER
its possible to check without the online mode, right?
if you can, try to avoid using protocollib at ANY costs
i have 8gb ram rn and it crashes when i have my server + mc and intelli j open if i get 8gb more will it work?
you cant really check if player is using vanilla client or not
since it can be spoofed easily
not server its my pc tho
possibly? u could try referencing their account to a minecraft account with mojang api, but i doubt that its any more reliable than just allowing the player in
thats pretty likely. 8 gb isnt that much for intellij + server + client
intellij often uses 4 + on its own
i think the UUIDs still end up different, so it just might not work in the end
yeah its bad in that way vs vscode , so if i get to 16gb ram total it will not crash right?
With the mojang API i can use their Nickname or UUID, but as you said, its possible to fake the UUID, so...
8gb is usually not even enough to stream netflix
but it should be enough for IJ
cracked or premium
well i woulnt say bad. its also alot smater
16 should be enough yea
just use online mode :P its much less of a hassle
yeah i said in that way of using that much ram its so good for java tbh i coudlnt get my java to run on vscode
i dont wanna use the online-mode, thats out of question
generated server-side or client-side?
how can people still survive on 8GB? I mean... even my laptop got 64gb of ram
serverside
offline UUID is based upon the players name
server
check usercache.json
on a bad country people survive with 4gb
yea i always want enough ram as well i also have 64
in that file player UUID's are being stored
i sometimes have like 3 servers and 3 clients with intellij open so
by debloating windows
wow, thats good
i think its literally generated as "OfflinePlayer:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
i have to close im intellij when testing the server and client cuz of crashes
Ok, but a Premium player will have the same UUID as a cracked player with the same nick?
at least it was in like 1.8 lol
thats such a pain lmfao
idk anything about those "windows" comments, just use a proper operating system like macOS and you won't have to complain about "I got too little ram" anymore
get yo self some more ram
yeah gonna do it soon i wish
What
No matter if player is premium or cracked one, in offline mode they will both get serverside generated UUIDs which do not collide with other player uuids in usercache.json
Im from Uruguay and i have 64gb, its a really expensive country for living and also there are none self produced about pc components, so you have to paid them really expensive prices. So i dont think that is so true
I wanna know if the UUIDs will be the same (both nicknames are same too)
well, im from turkey.
man, people get to see sun in southern countries more
in whole January my city only got 5 hours of sunlight lmao
5 hours each day? or month?
5hours per month
i think january
btw since somebody said sth about "no proper docs" earlier: if your library doesn't have at least have proper javadocs, it's a shitty lib and you shouldn't use it in the first place. this is how proper javadocs looks like:
LOL how thats posible?
its measured in cloudiness
basically whole january was cloudy
and only 5 hours there was sunny weather
coincidently also written by you eh? hahaha
+1, javadoc style javadocs are genuinely the best pieces of text ever written
yes, obviously
I would never publish some library without writing proper javadocs
if you can't even manage to write javadocs, you shoudln't publish your stuff
that's my opinion at least
i dont write docs 
same opinion as you
that is probably the reason why no plugin uses any me.winnpixie libs
i started java for minecraft i had experince with javascript its kinda near syntax , but other stuff is very diffrent
true, i also dont any libraries 
the greatest difference between JS and java is that java forces you declare proper typies, while JS just htinks "lol let's just see what happens"
completely different languages after all
javascripts greatest feature and its most awful pitfall
yeah i love that part
yeah, lose typing is so stupid haha
but the most thing i hate about web development is styling
oh yeah fuck css
pretty dope
cant stand responsive design
yea CSS is cancer
i love it, but i dont love trying to write it
That's why you don't write normal css. Use SASS or tailwind.
i simply write for Desktop first, fuk mobile devices
those are helpful but
lol then mobile devices f
dw, my pages still look /fine/ on most mobile screens
lol good
how does coal write like is it "Coal" or "coal"
@tender shard did you get your testing thing to work btw ?
id("org.jetbrains.intellij") version "1.12.0" seems to work with gradle 7.6
at least judging from the MinecraftDev plugin ๐
just change width var and make sure u include <meta name="viewport" content="width=device-width, initial-scale=1.0" /> in html 
which is usually my go to "imma be inspired by an intellij plugin" repo
no, it still claims to have no "ClassDefFound" stuff
Vector startPos = player.getEyeLocation().toVector()
Vector dir = player.getEyeLocation().getDirection().normalize().multiply(8);
BoundingBox ray = BoundingBox.of(startPos, startPos).expandDirectional(dir);
Collection<Entity> entities = player.getWorld().getNearbyEntities(ray);
``` Does my vector math to get all entities in a players line of sight seem reasonable?
Am I in the ballpark?
apparently the workaround might be testRuntimeOnly(libs.junit.platform.launcher)
its so weird that you can return primitive arrays
in java
since in cpp its black voodoo
magic
to do that
unless you use std::array,vector,list or pointer
Pointers in java is not a thing right?
Thank god
that results in the same error, but not surprising - isn't "runtimeOnly" meant to be what maven's "provided" scope does?
1 sec
Please!! I need help to design a simple menu system for editable menus? I cant the propaper logic
what gradle version are you on ?
also, your interllij plugin seems outdated af
might wanna fix that
8.0.1
have u tried prospigot logic? badum tss
I never heard about it, can u explain me?
MinecraftDev uses:
gradle 7.6
intellij plugin 1.12.0
and then also includes the junit launcher as a runtime dep
was just poking fun at what i assume was a typo, u probably meant the word proper if i had to guess
might wanna try that combination
hm ok lemme try
oh right, i know, i just want to fix my issue
that why i type so fast cuz im running out of ideas
why dont you just use minecrell's plugin.yml generator instead
i use it in gradle
it works fine
funny thing though, how it's a common for gradle users, to just downgrade to fix issues
yeah
well
looks like you downgraded yopur intellij plugin
1.13 seems to have gradle 8.0 support
but you are on an ancient version
Yes
I did not, I today did File -> New project -> IDE plugin
mate
and then just used what it came up with
intellij wizards are
trash
everyone knows that
they ship like, angular 2
lmao
no clue what they do, their official docs told me to do that
i use 7.5 currently
ofc you wouldnt know, they arent called wizards for nothing
idk, don't use intellij native creation wizards
they are basically guaranteed to be outdated af
if the intelliJ docs tell me do exactly this, then the only person to blame is the dudes who wrote the docs, not me
whats the best spigot version to run a barebone server litterly just they join and i kcik them with a code
I mean, keeping docs up to date is a task not very easy to acomplish
1.19.3
Why
if the docs are always outdated, there's a problem in the general workflow
idk but maven somehow manages to not have this problem
this is literally not gradle
you are getting shitty docs from intellij plugin peeps
ยฏ_(ใ)_/ยฏ
also you don't need to update maven docs because maven has not seen any actual changes in eternity
I am getting the docs from the jetbrains website, which is the company that releases IntelliJ. I have also checked the official gradle docs and what they claim also doesn't work.
so, if
- the intelliJ intelliJ plugin template doesn't work, and also
- the official gradle docs don'T work
then... I wonder where else I should get proper information from
me
/s
for maven I just always use their website and it always works
easy fix, dont use gradle
idk what exactly you checked on a gradle doc
cooncerning that all of your issues (except the wrong @Test annotation) were caused by the intellij plugin
I already explained this 20 times today already. I would not use gradle if intelliJ wouldn't force me to use it
I would go for maven anytime
well I wasnt there for those 20 times ๐ฅฒ
just, upgrade your shit to latest versions
1.13 is the latest gradle intellij plugin
either go with 7.6 gradle that should be a safe bet
or 8.0
on 7.6 you might need the previously mentioned junit laucnher as a runtime dependency during test
Graven*
we all love gradle
He should've named it Gravel
look
even papermc
uses gradle
cool dudes
big win
I would do that, if only gradle would tell me how
fastutils all the way
i heard goldman sach's libs are good too
in bungee, how do you get the player/proxiedplayer from a connection
didn't I link the upgrade wrapper command ๐ค
or are you asking how to upgrade the plugin
gradle currently only tells me "lol there's a problem in line 1 line char 1 in your current build.gradle"
I doubt that there is any problem in my line 1
encoding?
everything's utf8
Hey I am currently working on a hide and seek plugin. But I want to spawn a falling block that gets teleported to the player on the PlayerMoveEvent. However it is very slow and only teleports every X ticks, anyone happen to know how to fix this ๐
I also have to add, it works fine in gradle 7.4, it fails to run tests in gradle 7.6 and it completely fails to parse the build file in gradle 8
Hey does anyone know why in the latest build of intelliJ I can no longer compile my project?
send the whole stacktrace that you get
nothing on google knows what this error is about
are you using maven? or gradle?
maven, my debug list is like 1k lines long, I'll post a paste bin
code?
PlayerMoveEvent is not slow at all
it gets called hundreds of times after invoking it
show the output of mvn compile clean package -X
falling blocks are only ticked iirc, every 5 ticks ?
@EventHandler
public void onPlayerMove(PlayerMoveEvent e) {
e.getPlayer().sendMessage(String.format("You're at x:%s y:%s z:%s", e.getPlayer().getLocation().getX(), e.getPlayer().getLocation().getY(), e.getPlayer().getLocation().getZ()));
if (!fallingBlockHashMap.containsKey(e.getPlayer().getUniqueId())) return;
FallingBlock fallingBlock = fallingBlockHashMap.get(e.getPlayer().getUniqueId());
fallingBlock.setTicksLived(100);
fallingBlock.teleport(e.getPlayer());
}
can't you just use a packet? to bypass that if its only visual
I've included a log, just to display how often it gets called but it is very fast, but the teleportation is not
^
Player move gets called when they look as well
hastebin and pastebin think its spam cause its like 1.5k lines xD Heres a log file I copy/pasted
Yea, but the issue is the block only seem to follow every X ticks, like 20 ish ticks it seems :?
Well, that's how many ticks are in a second.
why are using strings in sendMessage (bungee) deprecated?
send your pom.xml
becauese you use paper api instead of apisog tapi
use spigot, then you can stop worrying about this shit
im talking about bungeecord
bungeecord does NOT deprecate all the string methods
SongodaCore ๐
That's something I haven't heard of in a good while.
please show your build.gradle or pom.xml fle
sendMessage("any string") is deprecated (as in you are supposed to use a textcomponent)
but what is better about textcomponents
sounds like a chinese ripoff
Oh.. you don't know do you?
Just woke up, thanks.
if ((item.getItemMeta() == reviveToken().getItemMeta())) {
So this is what I did, I also made sure they had the exact item meta.
I'll test it.
Yikes, it made the beacon
Several things can affect the item meta. Just a simple character addition or color change will cause it to be different. You might want to use the PDC instead and compare values from that.
Yes.
ok
Even frosty was struggling on this lol
How so?
Is it a hassle*
if ((item.getItemMeta().isUnbreakable() == reviveToken().getItemMeta().isUnbreakable())) {
Boom
I'll try that
You should probably use #equals instead of == then.
Oh
Or #isSimilar
that makes no sense
booleans dont have .equals?
ItemStack does though.
should be using isSimilar with itemstack yea.
but he really just should be using pdc tags
I already mentioned that. :/
should i use rebuild or build
build
In what?
okay
idk what Provider me.lucko.helper.plugin.ap.PluginProcessor not found would mean, why would it start to error out?
Show full error @marsh burrow
Packets probably. I don't think you can otherwise since the crafting grid shows the result of valid recipes. The next best thing to do is to just cancel the craft event.
Alr.
sure its here https://pastes.dev/NITzrsTvwF
u might be able to set the result slot here when it matches ur recipe in this event https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/PrepareItemCraftEvent.html
declaration: package: org.bukkit.event.inventory, class: PrepareItemCraftEvent
Im pretty sure hypixel had this same error, i'll just leave it.
You're using paper.
That's why.
Please use ?paste.
?paste
whats wrong with using a different paste tool xd
Syntax
Yeea
me like color :0
Also you have like 20 plugins.
Try disableing all of them but your plugin to find the correct error.
Why people from Paper ask support on Spigot ๐
I dont think its difficult to understand that they are diferent plugins apis, which means they are totally diff communities
bruh like its hey burger king wheres mcdonalds
Agree
its like using bungeecoord for a bukkit server
alr but I did have one more questino
I have this arraylist: public static ArrayList<UUID> custombans = new ArrayList<>();
How can I make a gui with all of the players that are in this and if multible pages, add pages
i'm not that good with guis
lmao, asked on there first cause Im using their api for async chunk calls. Here you are https://paste.md-5.net/suricakeza.pl
not really
since paper is build on top of spigot
that does make some difference
because there are more active nerds are on this discord channel
๐
I mean if u're knowledgable regarding paper, you can still use that knowledge here
indeed
but obv, papermc's discord is more suitable
its nothing to do with paper though, my project just straight up no longer compiles
any idea?
Didn't you literally ask on paper
And got an answer
try making an ew project and putting your code in
Specifically about you using http instead of Https
And getting clapped by the maven blocker
LMFAO
no ones answered me yet
Use InventoryFramework API or you need to implement pagination system on your gui
What
why, is maven banned on there?
pagination? that's a word? lol
yes its a word
english be like
Lmfao
Ye Pagination is keyword of what are you tring to achieve
idk, just seemed like I got ignored xD
static abuse ๐คฎ
so?
i dont want to duplicate code
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
how can i make cooldown(for each player)
scheduler
u dont need a scheduler for cooldowns
im using if statement i need cooldown there that is need to be set for each player
i want to know too
when u add a cooldown store the time it started & how long it takes, when u check for the cooldown check if that time has passed
remove the cooldown if enough time had passed
ohh
I think part of your issue is using profiles instead letting the compiler plugin do all the work.
hmm
Wrong reply
very smart
or Map<UUID,List<CooldownObject>>
hm i think it can work
@marsh burrow <#help-development message>
is there a player rightclick event?
Index 16 out of bounds for length 0, what means that while working with menus? Its related to title right?
or is it just itemconsume
or evenMap<UUID,Map<String,Cooldown>> so u can store a map of cooldowns identified by a string for each player
can i just make a function instead of map
vernano the 15's slot
pretty sure
how would u do that. u need to store data
Okay weird
what else would it be
check 16
Yes i have on slot 16 an item
it adds to array then pops when it ends ?
But why the exceptions?
how big is the gui
6 rows, which means 6 * 9
hmm
that array would then have to be stored on some player object then tho
check the name of the gui
oh so its more complicated, i should just go check how to use maps lol
1 rows = 9 slots
they are rather easy to use
Maps that is
1row is 8 slots because starts on 0
does ur inv have 2 rows?
yes
6 rows
try * 8
ok
nah * 9 is right
who tf mentioned
Hmn ok
that sendMessage is deprecated
So doesnt make sense
I will send full code Epic, because im in a nightmare
mate the only thing I found was this on the forums, but I already have this dependency installed https://www.spigotmc.org/threads/error-when-building-plugin-in-intellij-idea.429885/
I think he was using bungee
is it in a event?
yes
check if the entity is player
bruh its made for toddlers
haha
i hate it
mylife
its way more cleaner
crap dont hate on my class names
everything is hidden away
like why
its an ide
its supposed to be functional
https://paste.md-5.net/eniwabasir.java - Menu
https://paste.md-5.net/uhusuzutam.cs - Testing code
Oh im an idiot
I realized the issue
๐ก
fff
sorry LMAo, im really idiot
oh thanks cuty
tee hee
others will swear me
i know that feeling
LFMAO
Imagine telling paper this isue, they ban you directly
oh god
๐
I went to bukkit as a joke and asked for help on a spigot plugin


