#help-development
1 messages ยท Page 2269 of 1
It will answer all of your questions
:c
You want spigot for this:
package index
Search BukkitScheduler
Find the class
Go to the method you're trying to find info on
It will tell you everything you need to know
ticks?
oh
ok
thx
why my IntelliJ doesn't detect PacketPlayOutPlayerListHeaderFooter?
:V
you need spigot not spigot API
Because you dont have nms on your classpath
?bootstrap read the posts it links to, AND the 1.17 post
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
ah shit you need to explicitly close a preparedstatement
i thought that happened when you close the connection but it seems to depend on impl
?bt
If you don't use a build system
Use one
It will make your life much easier
you are going to take your own life if you attempt to use NMS without a build tool like maven
It took me too long to start using gradle and I lost a lot of productivity because of it
So, my development team doesn't know how to use BTs and they ban me to use them
gradlew gradlew gross gross
that ain't a dev team thats a bunch of nobodys
Then sack your "team"
leave and run as fast as you can
xD
you gain nothing by working with a team who is unwilling to work efficently
they only know java by tutorials
then they aren't a dev team they are ammetures who need to learn how to learn properly
maven is REALLY easy to use, once you get started
Then your development team is shooting themselves in the foot and dragging you down with them
That's like saying "yeah my team doesn't let me use a mouse at work, they just forbid it, everyone has to use a trackpad"
Chad
hello I tried to make my own changes to spigot, with the plugin I managed to do it, but I have no idea what file to use to run the server. when I was using the generated file this error showed up
what exactly did you attempt?
You are trying to run CraftBukkit not spigot
Did you modify the spigot jar or what?
Even if it were CB (which is very unlikely) it shouldn't fail like that
yes the spigot jar i added simple method to send message
How did you do it?
That error is because you are trying to run the spigot-1.19-SNAPSHOT.jar in the \bundler\versions directory
first I added this method in api and then in the server I added this one
๐ค
I did a commit and ran a maven command
I use 1.18.1
this is my start.bat file, I think I'm running the correct file
the jar BT creates is placed in teh root BT folder
you took your jar from \Spigot\Spigot-Server\target
yes
If you are taking yoru jar from that directory you need to use spigot-1.18.2-R0.1-SNAPSHOT-bootstrap.jar
Honestly, if I were to try to make custom spigot I'd rather use recaf
or whichever version you are building
Let's make a troll spigot version that deletes your root directory โ ๏ธ
The convoluted system employed by spigot is a bit disorienting
don't joke about that - it could get you to jail
it shoudl be the same level as your src folder
it works, thanks
It isn't
is it a maven project?
haha makePatches go brrrr
yea
Hm, could you show us what the contents of the root directory of your project is?
I've been writing my own mod loader for a while now and I can say that patching stuff is a task only the devil himself would attempt. On the other hand ASM Transformers are the best shit out there. Sadly spigot does not support these for coremod-like plugins
gotta make a java agent for spigot the :^)
thats not a maven project
thats an intellij project
I've added Maven support
eh, there are a few applications already there with the mind of doing something like that
how?
no clue what that does
This article shows how to convert a Java project to a Maven project in IntelliJ IDEA.
perhaps you forgot to tick maven?
Guess you could just throw in a maven.pom file manually but given that I'm using eclipse mainly I cannot say if that is the right course of action
if u dont have pom.xml then its not maven
refresh
I haven't used maven that much lately
o? using gradle instead?
how
close ide and restart is simplest
if it then doesn;t show a pom you didn;t correctly add the framework
nope, either JDT or semi-custom build tools
hmm
I did and only appears this right now https://prnt.sc/g8XtnmLQcGqN
My goal is to migrate away from gradle entirely eventually. Maven will still be a bit of a strange place however given that it does many things greatly
is maven even available? https://mkyong.com/wp-content/uploads/2021/05/idea-convert-project-to-maven-4.png
then you have not added maven
removed the pom?
no
oh i removed my dependency reduced one and got a bunch of issues
First, make sure you have enabled maven plugin in
File -> Settings -> Plugins and add search the maven plugin and activate
Restart the IntelliJ.
Go and check the tool window to make it visible
go to View -> Tool Windows > Maven Projects to open it.
I'm just googling here
Nop. My book is already signed
probably not then for an already signed book. it likely just closes it client side
looks cursed lol
may look cleaner if you java TABLE_SETUP.forEach
still need a try and the execute method
Maybe setAutoCommit false
Do the queries and commit
can you simply not assign it and use(conn.prepareStatement(query).execute())
No one uses forEach but lazy you
i did
nah expects a code block
shame
And also somehow in my block list
what do you prefer
for (String str : list) { System.out.println(str) }
or
list.forEach(System.out::println)?
The one taking less time
smh
enhanced for
for(int i = 0; i < list.size(); i++) {
System.out.println(list.get(i));
}
i prefer forEach
switch the language please
go code in C or C++
some native shit for the best speed
Yeah i will code plugins in that
cursed, but without adding /excessive lambda usage/ idk how i would improve it either
Which is the minium player life amount before he died because i need to check something
if the players health is <=0, they die
if its >0, they live
in theory, yes
undead
in practice, no real clue
Allright i ill test thanks
Because i need to do something with the player before dieying so i need to know that
Thanks
what happened to withConnection
was that just a shorthand for the try with resources?
Lombok got an annotation named SneakyThrows
ik
looks better without now lolz
could be worse, could be a....Guava user
average Guava user vs DIY programmer chad
still need to close resultset manually so that witConnection method goes kinda brr
guice ftw
isnt guice an event bus
becomes even worse when i ad more paraemeters to the method
or is that just me giving the guava event bus a name
hi
ig ill use some jdbc lib
I have a question
OH WAIT GUICE IS THE DEPENDENCY INJECTOR
so do i
if I teleport a player from while falling it will die or damage a lot
how can I prevent that
without putting a person in a creative
set the fall distance
my friend used guice once years ago so i was like why do i know what that is
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
tf is guice
What is guice
google bs
oh as usual
set their velocity before or after teleporting
What guice does
hacks
just like using guava
or make them invulnerable for a few ticks after teleporting https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/LivingEntity.html#setNoDamageTicks(int)
You know what i hate the most?
yourself?
ur mom
Sets.newHashSet
godcipher said something about fall distance
woah there
smh
hating ur parents isnt cool
true. unnecessary bs
unless they did u wrong
That works
do u mean player.setFallDistance(0);
player.setFallDistance(0);
player.teleport(map.getSpawnLocation())
can fall distance even be negative lolwtf
-100
?stash
would that work
I remember it was
ive started to unironically enjoy going through spigot stash
same
Yes
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java#205 i take it back im never fucking looking at stash ever again
best thing i saw was
boolean equals(obj) {
try {
ThisClass casted = (ThisClass) obj;
return true
} catch (ClassCastException e) {}
return false;
}```
what happened here
damn 200 lines
thanks @small current @hybrid spoke
do they get a cookie now?
๐คค
u can change the handle of a CraftEntity, that sounds like recipe for disaster
heheh
If only there was a better way
everything i try seems to go brr
it is the fastes way of doing this, give them credit where it is due
Factory-style patterns would also look a bit strange
are you actually closing teh connection when you are finished?
people use modulus while I use & bitwise ๐
ClassValue<BiFunction<Server, Entity, Entity>>
well i tried to do some fancy stuff with da method but i still need to close preparedstatements smh
im sorry im not such a professional ๐ฅบ
https://twitter.com/winnpixie/status/1288791130717528064 pls like my banger tweet guys pls ๐
though you'd ideally not use BiFunction but rather a custom interface for that
the fact that its python makes it even worser
thats the point
However either way this approach would result in doubling the lines of code needed
i mean True and False wtf
perhaps even trippling
what were they on
it's them
probably bit by a snake and suffered from poison damage
ig ye
basically an IdentityHashMap<Class, T>
if i wanted to expand the withConnection function to close all stuff that would go more brr
jdbc frameworks idk
Hi, I'm having trouble with PersistentDataTypes and generics. Basically, I want to make a method to retrieve data from a PersistentData container, and return the value. How would I do this while allowing the return of any type?
Type is required to use the PDC. generics will not apply
is there a way around it?
ie, you can;t fetch data from a PDC without knowing its type
why do you need to get around it?
^
How would I stop players getting advancements in certain worlds? not just hiding chat like I have seen other plugins rather make it so they don't get it but still can in other worlds later.
are you trying to get all values from a pdc or something? i dont see why else you would need to get it without knowing the type
No way around it. You can get the NamespacedKeys but without a data type you can;t not retrieve the data
I want to get info from the pdc, yes. I'm wondering if there is a way around making a method for each key/value
*will you guys forgive me when i use lombok ๐ฅบ *
no
No
smh @Cleanup seduces me
mmmh
yeah I hate it
running SQL queries like that
at the same time I'm storing everything as POJO
Maybe you could abstract it a bit
or make a constructor for home that passes resultset
ehhh
maybe a method instead of constructor
like Home.from
pair that with an empty constructor
static factory method
fromQuery 
just Home.from Keep it standard. just teh arg will vary
this is the best i can do
https://paste.helpch.at/woyifogeyu.java
goes kinda brr to include only the connection n the try with resources and not the statement which needs to be closed too
hey how can i scale up a string to another string?
e.g. the wanted string length is
and i only have 5, but 5 is the maximum, should. i just do maxStringLength / 5 ?
oh no no no
exceptions?
@Sneakythrows makes even more sense to me rn
lombok
@Cleanup ๐คค
SQLHelper time
??
wheres that sqlhelper?
BlueLib SQLFactory when?
BeepLib
try and catch kinda sucks in general
im wondering what the difference is
connection.prepareStatement().execute(sql);
connection.prepareStatement(sql).execute();```
yall rockin wit da Map#putIfAbsent or da Map#computeIfAbsent fo today
wha
sql pain
just like my Butt after we
my lawyer has advised me to not finish that sentence
same
what version of java should i use for my public plugin
Wait does 1.19 use Java 18
no idea
Hey guys, I wanna make a listener for when water flows towards a magma block, that in between cobblestone will be generated (basically skyblock) just wanna make it for me and a friends private server and we only need this functionality to this is why i am asking.
Is the correct way for that to use the BlockFromToEvent and check if block from is water?
Itโs 17
But you are welcome to use later versions
I encourage it
someone was complaining that my plugin didn't work on java 17
Tell them to update or fuxk off
Lol
lmao ok
rude
pulse too agressive today
Always
what's the best os for developing anything
the one youre familiar with
tbh, mac os for the fact that it feels like linux but then you don't get gnu utils 
question
how bad is it to create an object every time a player right clicks
๐
don't worry about that xD
I'm trying to fix this guy's plugin
and I'm just crying
at how much he complicates some stuff
does anyone here use github copilot
I know a few people use it
if you code properly you don't repeat yourself 
man
Nah I use it too
tell it to this guy
why u bring this up
There are some stuff like constants that are very repetitive and itโs useful
constants are repetitive ?
The only annoying part is when it tab completes when you donโt want to
Let me give you example
bitch if statement doesnt exist or wat
lol
so you're telling me there is a better way to do this without copying+pasting
armor:
helmet:
material: DIAMOND_HELMET # Item to use as the helmet
name: "Diamond Helmet"
lore:
- ""
chestplate:
material: DIAMOND_CHESTPLATE # Item to use as the chestplate
name: "Diamond Chestplate"
lore:
- ""
leggings:
material: DIAMOND_LEGGINGS # Item to use as the leggings
name: "Diamond Leggings"
lore:
- ""
boots:
material: DIAMOND_BOOTS # Item to use as the boots
name: "Diamond Boots"
lore:
- ""```
i honestly don't know
Hmm I guess not
but it did it in 1 tab complete
and you paid 10$ for it
that's 1 minute more added to my lifespan
what ๐
Copilot auto completed it all
no
Pretty sure it is
So before I used reflection to do the constants but
They changed it not too long ago
Hey guys, how can I get the block which is infront of the water in this case?
@EventHandler
public void onWaterFlow(BlockFromToEvent event) {
Block toBlock = event.getToBlock();
if (toBlock.getType() == Material.WATER) {
}
}
I am not sure how to use Blockface in this case
I donโt want to do that
Cause I lose inlining
I just end up manually doing the constants
But copilot does it all
hol' up
that's right
damn i got it for free during the beta testing
Idk itโs sorta creepy that it sometimes can read my mind lmao
what do you mean "in front"?
I want to get the block, which comes next after the water. Basically the water floats into the direction south, and I want to get the closest block to it in that direction
ngl still kind of excited how the concept plays out the second copilot suggests you code that already exists and which licence requires mentioning
Copilot is free if you are a student or you are a maintainer of a popular open source project (you would need to apply)
wait no it's gonna expire
I'm technically a student 
is it free to those who was accepted before it became open to the public?
yes
what is considered a large project
because they helped beta test and provide feedback
like if I post a commit to paper
(i did not)
is it considered a large project
event.getBlockFrom().getLocation().subtract(event.getBlocTo().getLocation()).toVector();```
alr then im good
only temporarily tho
You have to be like a maintainer
ehhh
until august 22nd
alr then im good temporarily
easier to just pay the 10$
xd
lmao
that will give you a unit vector, you can add to or subtract from either Block location to get teh block infront or behind
I use github copilot to google for me 
yo guys my video is doing so well ๐ฟ
type a question into a comment and it returns a stackoverflow answer
So the x,y,z I get from that vector represents the next block?
no
what is a gist
GitHub paste
Thats just a vector difference between the two blocks.
so java Vector direction = event.getBlockFrom().getLocation().subtract(event.getBlockTo().getLocation()).toVector(); Block next = event.getBlockFrom().getLocation().add(direction).getBlock();
use more variables as thats ugly as hell, but you should get the idea
ah I see, thank you
you can add or subtract it from the to or from block location to get the Block in front or behind.
Not a coder so not exactly looking for code, but just wondering as a server owner if it's possible to make a bow shoot arrows further with a plugin, with it feeling natural ofc.
yes
o mb
yes
but ty
More oompf
what's the best version numbering scheme
idk isn't there a few of them
1.2.3 where 1 is a major rewrite, 2 is breaking update changes and 3 is for minor patches with no breaking changes.
the one u use the most
so TempleOS
(which ofc, should be a Linux distro)
Time to learn some HolyC
how do i make a config automatically upgrade between versions
if i change a few things
huh
You can add a config version and check that. Then simply run your update code that sets the values if it's outdated
honestly why did they make configs in spigot yml and not json
is there a reason for that
if you're taking about readability, json's readability is very fine
if you have a parser that is
and all text editors have json parsers nowadays
Cause yml is easier to read for non coders
just write your own configuration implementation in json then ๐
why do you want it to be easy to read for non coders
you should have a way to see the config in commands anyways
plus even if ur not a coder u can read json
easily
You answered your own question
But no json is not easy to read, especially for a non coder
the only advantage yml would have is a tiny bit better readability as far as i know
i would pick json for both myself if the data stored should be editable
Toml ๐
What does RenderType mean?
lord save me
if I just want to display text do I have to pick either one?
Controls the way in which an Objective is rendered client side.
declaration: package: org.bukkit.scoreboard, enum: RenderType
I assume it's made to render hp of entities
how to add NMS to maven?
?bt puts spigot (with NMS) in maven
then depend on spigot not spigot-api
its all in the post I linked you to
?bootstrap
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
https://prnt.sc/mCFLLjF6ECiZ this like?
nop
then do it
idk where to download
?bt
or
yea, but the download link for the jar file
scroll down to point 5 on windows (if using windows) use that bat file to download and run your buildtools
I found
IF you have curl installed
tbh if i were someone who had never touched a PC before, i wouldnt want yaml or json, id want .ini (typically key=value)
are you on Windows?
yup
https://www.spigotmc.org/wiki/buildtools/#running-buildtools and copy the bat file
- (optional)
i set api-version to 1.19, but i wanna support earlier versions
how would i go about doing this?
you also have java 18
i have both
you most likely have set your java_home to 18
you have to run buildtools with java 8
specify the java 8 binary
how?
you could just use the path to your java 8 javaw.exe instread of java in the buildtools command
locate the java.exe binary for java 8
right
what version r u building 
what's the difference between javaw and java
1.12.2
bump ๐
set teh api version to the earliest version you want to support
the javaw.exe has no console window
with a 1.19 plugin?
the api version is the minimum version you rplugin requires to work
ideally i'd want to support 1.8 but i'm afraid that likely won't be compatible
should i just try it out?
there is a LOT you can;t use on older versions
then api version to 1.18 then
isn't 1.17 also java 17?
api version is spigot version not java version
none require it
i uninstalled java 18 and worked
yeah i know
:p
but what spigot versions would be compatible with java 18 plugins
they should all run on it
Failed to delete *\target\maven-status\maven-compiler-plugin\testCompile\default-testCompile\inputFiles.lst
what is this
lol maven
lol, using a outdated build tool from the 90s.
how is it outdated lmao
it's still maintained
Uses up 5 lines instead of one singular clean line.
Nah, I just want maven to stop being used by beginners.
who says i'm a beginner
What are u suggesting then?
that's great to know
okay
id rather take a few more lines of text than the unjusitifiable, unholy size of gradle wrapper
You using maven is big stand out.
huh?
It's... Not even that big?
doesn't spigot use maven
It does
It does
Every beginner does
Damn every beginner breathes air
who cares if you are a beginner
gradles not that big until u have multiple projects and they all have their own wrapper version downloaded
It is almost like the system is intuitive
Because md_5 doesn't know what gradle is
Beginners use freaking eclipse dependency loading
I'm sure he does
Nah, that's one above maven
He does
that statement just makes little sense
bro
Daemon annoys me
maven is the most used build tool
DevBukkit is the most basic name ever ๐
tf you on about
for better or for worse
Using Rick roll in your profile is basic too.
Rap battle?
Not really, in modern java dev environments gradle is much more pervasive
it sounds like something someone who really wanted to validate themselves in a programming community would call themselves
Gradle easier for beginners
Literally less boilerplate?
what
for a basic java hello world maven and gradle are equally as simple
Indeed
This is hurting my brain cells
are you sure you are not a Gradle marketing representative trying to take over Maven
by convincing a Minecraft community to use it
Just use whatever you want
Itโs sad to see the amount of misconception concerning gradle
its actually a funny split
Please use my referral code.
in MC, server software tends to use maven
client software tends to use gradle
Use the one you like more
Like. If your build tool works for you that is all that matters
granted forge and fabric run for both servers and clients
What is the point of this discussion
theyre more typically used for client
I for example prefer maven syntax, but gradle configs look cleaner
But yea I'm used to XML
maven seems more readable
i prefer gradle overall, but i dont like breaking changes on non-major updates
i've only ever used gradle once though so i'm not one to say that
It is almost like it is very subjective
It's not lol
You can't be objective about it
maven poms can go south very quick
I'm trying to horrify someone on my team, what's a good 1-5 liner that will put hair on their chest? Ideally spigot specific.
why does there always have to be a discussion on whats better maven or gradle. who cares man. whatever feels best for you
Readability tends to be subjective in regards to earlier experiences with all due respect
Maven poms reminds me of arrow code
Ideally something really terrible for practice
You can become arrow-y with gradle also
if u enjoy reading XML by all means go ahead but i will judge u from a distance

Not as easy
I enjoy XML
I like gradle groovy
I assume maven to be more intuitive for these older devs that are so used to xml configs for logs, dependencies etc
oh i fucking cry when i do webdev
But i hate gradle kotlin
Kacper you are literally a mystery box with your opinions XD
Well gradle groovy doesnโt give good hints nor completions else Iโd say itโs fine
what is the Field type?
i dont understand gradle kotlin
like why does it exist
Like IntelliJ just throws unknown variable name at me all the time
because groovy is terrible
For kotlin boys
Hence gradle kotlin dsl superior ๐
kotlin dsl is way better
does anyone use 1.10
and kotlin is the successor? ๐ฌ
Java > kotlin
scala supremacy
bump
Clojure
Haskel DSL next I hope
oh wait scala DOES have a build system
kacper??
Haskell dsl lol
literally SBT
Yessir
real chads use ant
agreed
thats just mavens older cousin
You mean makefiles and javac
bump for bump
dont remind me makefiles work with basically everything
can respect that too ye
You can use make in java?
Wym what is Field type?
That's cool af
You can use make on anything
javac best compiler
can i Make ur mom?
Probably not at your age
like Field header; what is the type Field?
Others try to copy it and fail
Just go ahead
I mean that looks like a variable so the type is Field?
^^
Assuming you mess with reflection nowโฆ
so can you register an event after the servers starts? For e.g you call a GUI classes constructor which has listeners from inside from the command executor class, how can i get it to cancel click/drag events?
I mean, like: Field header = packet.getClass().getDeclaredField("header")
well what is the real header field
You can
Because im making a report menu. The menu shows up but i can click and drag shit. Too much perms maybe?
But it isnโt ideal unless you bake the event listener
Because i just started to work
Report menu ๐๐๐
Which well can lag
what, hard?
1.19.1
@elder blaze
u can also just call Field#getType btw
the header field of the TabList
Donโt mind him
Hey
?stash
@idle pier mojang wants to add chat reporting to the game , basically you can get banned from Minecraft for X time
oh.
So ya better be politically correct
oh
what a fucking joke
and its not mojang, it's microsoft. Notch days were the good days
I actually started playing notch game called wurm
Notch person himself questionable tho
Notch is in pirates political party
Aka anti DRM party
Everyone who uses Twitter for posting shit is kinda questionable
Twitter is a big ? Mark
for worse
With Notch, this type of decissions would not happen
Twitter is a shit hole
Notch doesn't want EULA even
EULA is sh*t
ofc, he would get reported and banned for transphobia
why I can't do ranks with extra perms for selling? EULA
Lmao
is there a way to make a command just execute another?
I want to give all recipes to everyone and make a command for it so they can use it for when I add new recipes. is there a way to make a command like /grecipes and it would execute the vanillia minecraft command /recipes give @s *
half the issue with EULA is that they don't even enforce it most of the time, so if you do violate EULA even slightly, you are at risk of your server getting in trouble for it, but the risk isn't high enough to deter the hundreds of prison servers that are copy paste versions of each other, just straight up selling OP armor and such
Bukkit#dispatchCommand it was I thonk
yes, cant rmemeber what the method is tho
?jd-s
https://prnt.sc/d9vIv_nZZTDD would this code work?
?tas
yes this is what i needed, thank you!
xD
what api version r u on
1.12.2
ah
๐
what type of problems would be your server?
was gonna say bc newer versions have methods in the Player interface
for the tablists?
Either have EULA and enforce it or don't have it if you are not capable of enforcing it
Reports will have the same problem
yeah its like setTabHeaderFooter idk
On larger scale
but it's annoying as a server actually following EULA and then tons of servers are going around functioning as if EULA doesn't exist
@misty kayak
``` wtf
Ur java old
declaration: package: org.bukkit.entity, interface: Player
change ur target version to java 1.8 in maven or gradle
Why not use 1.19
public void showTabList() {
new Runnable() {
PacketPlayOutPlayerListHeaderFooter packet = new PacketPlayOutPlayerListHeaderFooter();
@Override
public void run() {
try {
Field header = packet.getClass().getDeclaredField("header");
Field footer = packet.getClass().getDeclaredField("footer");
header.setAccessible(true);
footer.setAccessible(true);
header.set(packet, ChatColor.YELLOW + "TopoNetwork");
} catch(Exception e) {
e.printStackTrace();
}
}
};
}
``` why doesn't work? 1.12.2
Hi sorry for bothering but i was started with making a plugin for spigot 1.19. But when i use the (extends JavaPlugin) in the main class it dont works i looked into the spigot 1.19.jar and it has no JavaPlugin in it. Do someone knows how i can fix this ?
?bootstrap
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
u dont run the runnable
u call .run()
ae
so like java new Runnable() { @Override public void run() {} }.run();
java.lang.NoSuchFieldException: header
mappings issue, most likely
i didn't understood
He wont even play rocket league with me
It's broken. I use this one instead https://nms.screamingsandals.org/1.19/
It's a bit better anyways
i think we need 1.12.2
I mean, vanilla mappings didn't exist for that version
Sorry i read it but where can i find that correct jar file i only get the 1.18 and cant find the 1.19
odd I didn;t get notified 1.19 announcement was posted
https://github.com/bspkrs/MCPMappingViewer this works?
if ur writing a plugin, use the spigotmc repo and add spigot-api as a dependency in ur build system
i make my plugin in java eclipse
but i find those a little difficult and its like eclipse works easiest for me ๐
read teh bootstrap message properly and you'll see why your import is no longer working
?bootstrap
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
so, @buoyant viper what mapping is the one for header?
and footer?
Can not set net.minecraft.server.v1_12_R1.IChatBaseComponent field net.minecraft.server.v1_12_R1.PacketPlayOutPlayerListHeaderFooter.a to null value
where can be found?
in ur version json
a
yeah
xd
public void showTabList(Player player) {
CraftPlayer cPlayer = (CraftPlayer) player;
IChatBaseComponent header = IChatBaseComponent.ChatSerializer.a("{text: '" + ChatColor.GREEN + ChatColor.BOLD + "TopoNetwork'}");
PacketPlayOutPlayerListHeaderFooter packet = new PacketPlayOutPlayerListHeaderFooter();
try {
Field fHeader = packet.getClass().getDeclaredField("a");
fHeader.setAccessible(true);
fHeader.set(packet, header);
fHeader.setAccessible(false);
} catch(Exception e) {
e.printStackTrace();
}
cPlayer.getHandle().playerConnection.sendPacket(packet);
}
``` doesnt work
:c
Ladies, how do i overwrite a scoreboard line?
yuck is there like modify or smt?
while (incombat.contains(player.getName()) && incombat.contains(target.getName())){
player.setFlying(false);
player.setAllowFlight(false);
target.setFlying(false);
target.setAllowFlight(false);
}
When using this, if the player gets out of combat these will all be able to come back to true right? or do I need to add something after this... It's been awhile since i've used while
when you setAllowFlight to false automatically the player stops flying
btw, yes, you can set to true only if isn't in combat
else, it will be false again
someone sent me a really good website for mappings the other day
so im updating the players name with GameProfile but #getPlayerExact returns null when you put the new name does anyone know how to update that?
does anyone know what that website is
I use setDisplayName setPlayerListName and setCustomName
ok thatdoesnt answer my question
oh, that will make this look a lot cleaner, and thanks for the conformation..
:c
:p
https://prnt.sc/GkLDF6OBSgPz when running this throws me this error Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 3 path $.
Use scoreboard teams
if youโre using scoreboards
bump
nolol
bump
how do i use persistant data holder
yes :)
?pdc
whats the json?
public void showTabList(Player player) {
CraftPlayer cPlayer = (CraftPlayer) player;
IChatBaseComponent header = IChatBaseComponent.ChatSerializer.a("{\"text\": \"TopoNetwork\"}");
PacketPlayOutPlayerListHeaderFooter packet = new PacketPlayOutPlayerListHeaderFooter();
try {
Field fHeader = packet.getClass().getDeclaredField("a");
fHeader.setAccessible(true);
fHeader.set(packet, header);
fHeader.setAccessible(false);
} catch(Exception e) {
e.printStackTrace();
}
cPlayer.getHandle().playerConnection.sendPacket(packet);
}
When player joins to the server: java.lang.NullPointerException
that's solved I think
you need to either show us more of the stacktrace or give us a line
ideally tell us the line
because that doesnt have line numbers
so how can you be sure its happening in that method?
https://prnt.sc/u7ow21s96tAd only does this
when I delete the method it works
?paste teh full stacktrace you get in console
yes
malformed json
open your player log
there may be a more detailed NPE
otherwise, my guess is that you also need to set a footer
TabList.java:18
IChatBaseComponent header = IChatBaseComponent.ChatSerializer.a("{\"text\": \"TopoNetwork\"}");
that is right
yup
1.12.2

