#help-development
1 messages ยท Page 1508 of 1
oh, i don't use intellij :p
NetBeans ๐
o.O
if i compile against java 16, does that mean the plugin wont work with lower versions?
no
aight
java is good at compatibility :)
but what if you use a java 16 specific function, what happens when java 11 executes the plugin?
i actually dont know
it might just throw a error
U get whats called an Error
my guess is you'd get a ClassNotFound error
yup that one
ClassNotFoundError is not even a thing
so you can compile to 16 long as it also compiles to 11 or 8 without errors it appears
no
if u compile to j16 then it wont work on anything lower
from my experience its only forwards compatible
i meant like java 16 can run code from java 8 without issues
well u can run a server with j16 and then have plugins compiled against j8 or smtng yeah
can u run a mc server made with java 8 with plugins made with java 16 and u have java 16 :)
that made little to no sense
ik
its meant to confuse u
did u get confused
You successfully didn't just make me confused but I might have lost some braincells also xD
ok, so to clarify, that means I cannot compile a plugin with java 16 and use it on a 1.12 server, correct?
i think u can
if ur 1.12 server runs java 16 then its fine
the person gotta have java 16 tho
1.12 server cant run on 16
it can
iirc it struggles with some outdated lib
Pretty sure it cant, unless you successfully run it using java jar spigot-1.12.jar with java 16 installed
u can
that also made little to no sense
ofc u need java 16 to run the server with java 16 right?
as in
if it doesnt run try to turn use-native-transport to false in server.properties
if you can run the command with java 16 installed, then the server runs on java 16
but
if you click on the jar file
doesn't mean it is running on 16
u can im sure run java 16 in mc 1.12.x
pretty sure that depends on some environment variable or smtng (which java version should be used when clicking an executable jar)
1.8 might have struggles without turning use-native-transport to false
cuz i done that on a 1.8 server to run java 11
๐ฅฒ
does anyone know what its called when you have like a web page but its like a direct list of downloads on the server? with directories and stuff? i have no idea what its called... does this make sense?
Using reflection to change the modifiers of a field was 100% safe and good
this makes little to no sense
like a real budget download page
i believe its just a file list lol
do you know the thing im talking about tho?
blog
(i have no issue making any kind of page or whatever)
i just very specifically am trying to figure out what this thing is called lol
i think "web file list" or "web directory" might be accurate, im asking google...
"Downloads Page"
lol
actually TheRealDan I get what u mean
yeah its weird, i am trying to find an example also
something like this?
hm
essentially its ur browser which has that ugly interface when u browse directories
is it called docker or sth
i downloaded a newgrounds thing
its not called docker, thats a very different thing
uh docker is sorta smtng else
but its kinda broken
not secure idkidk 
cuz its not actually https:// cuz it hasnt got a ssl thing
well docker basically lets u pack ur app with deps and then u can deploy it wherever you want
certificate
sus
its apache
well its not apache, you can setup the same with IIS
no im talking about what im using
ah
it sure looks ancient
yeah if you don't have ssl cert just access on http
but if you want free ssl cert you should look into letsencrypt
or cf
i can encode ur name 50 times if i wanted to
but i can only encode it 18 cuz thats the max i made it
;-;
its php
btw
all php
show code
everything is php
and I'll show you my php encoder
except the html in the php?
.toString(2)
its liek 56 lines and then theres another file that has more
i just used a website api
this is an outdated version, lost the old one ages ago
the old one encoded hex values to a random string of characters between 0 - 4, put each character's length into a mini key in the front, split it with $ or something and then put the code and it would decode the key from the lengths and then str_rot the key, then base64 decode it
and then that key would be used to decode the actual message
really old version i have a jar of
Encrypted: cwYemhemhHKVeIOcuFurM
Key: cwYaFcjRKJGiurMjgliWEHKVxjDsbRWTncuFMBynOSeIOeBcYQbDKPemhzHcxqDJoqczUHSVmACkgpWuaWmRfoUldCqxHuojJlAkIEfEArTwSKYVnuposEjwEJcNTGnVJpTppbwTvETFJBMETowcLnmsmmhkCXuZnJHHvMfBeCArlQuvvOoasVPQkMuwfeebPULIKZIyONAsKtZ
means asshole
๐
look at my code its shit
i refuse
whyyyy
its not shit
it is
some js is used lol
and idk js so idk why i used it
im like the worst a css styling
imagine if we would have react rn
i always make 1980s style websites
lol
Imagine not bootstrapping
ah yes lol encOded into base64 18 times is Vm0wd2QyUXlVWGxWV0d4V1YwZDRWMVl3WkRSV01WbDNXa1JTVjAxV2JETlhhMUpUVjBaS2RHVkdXbFpOYWtFeFZtcEJlRll5U2tWVWJHaG9UV3N3ZUZadGNFZFpWMDE1VTJ0V1ZXSkhhRzlVVmxaM1ZsWmFkR05GWkZSTmF6RTFWVEowVjFaWFNraGhSemxWVm0xb1JGWldXbUZrUjFaSFYyMTRVMkpIZHpGV2EyUXdZekpHYzFOdVVtaFNlbXhXVm1wT1QwMHhjRlpYYlVaclVqQTFSMWRyV2xOVWJVcEdZMFZ3VjJKVVJYZFdha1pYWkVaT2MxZHNhR2xTYTNCWlYxWmtNR1F5VW5OalJtUllZbFZhY2xWc1VrZFdiRnBZWlVaT1ZXSlZXVEpWYkZKSFZqSkZlVlZZWkZkaGExcFlXa1ZhVDJOc2NFZGhSMnhUVFcxb2IxWXhaREJaVmxsM1RVaG9hbEpzY0ZsWmJGWmhZMnhXY1ZGVVJsTk5XRUpIVmpKNFQxWlhTa2RqUmxwWFlsaFNNMVpxU2t0V1ZrcFpXa1p3VjFKWVFrbFdiWEJIVkRKU1YxZHVUbFJpVjJoeldXeG9iMWRHV25STlZFSlhUVlV4TkZaWGRHdFdNV1JJWVVac1dtSkdXbWhaTW5oWFl6RldjbHBHVW1sU00yaFlWbXBLTkZReFdsaFRhMlJxVW0xNGFGVXdhRU5UUmxweFUydGFiRlpzV2xwWGExcDNZa2RGZWxGcmJGZGlXRUpJVmtSS1UxWXhXblZVYkdocFZqTm9WVlpHWTNoaU1XUkhWMjVTVGxaRlNsaFVWbVEwVjBaYVdHUkhkRmhTTUZZMVZsZDRjMWR0U2tkWGJXaGFUVlp3VkZacVJtdGtWbkJHVGxaT2FWSnRPVE5XTW5oWFlUQXhSMWRzYUZSaE1sSnhWV3RXWVZZeFduRlViVGxyWWtad2VGVnRkREJoYXpGeVRsVm9XbFpXY0hKWlZXUkdaV3hHY21KR1pGZFNWWEJ2VmpGYWExVXhXWGhVYmxaVllrWktjRlZxUmt0V1ZscEhWV3RLYTAxRVJsTlZSbEYzVUZFOVBRPT0
i dont use boOtstraP
As I can see
lol
I know this is probably very inefficient atm, but idrc right now. How would I turn this back into a item stack so I can add the enchant and edit/add lore (using the last line)?
Player player = (Player) Bukkit.getOnlinePlayers();
Material pick = item.getType();
for (Entity entity : player.getNearbyEntities(3, 3, 3)) {
if (entity instanceof Item) {
if (pick == Material.NETHERITE_PICKAXE || pick == Material.DIAMOND_PICKAXE || pick == Material.IRON_PICKAXE) {
Item i = (Item) entity;
for (Entity e : i.getNearbyEntities(1, 1, 1)) {
if (e instanceof Item && item.getItemMeta().getDisplayName() == ChatColor.LIGHT_PURPLE + "Telepathy Core") {
e.remove();
Item pickNew = ;
}
}
}
}
}
from an item entity? i think it has getItemStack()
IntelliJ does this when I try to use that
Item pickNew = (ItemStack) ((Item) entity).getItemStack();
looks like your casting to ItemStack but using Item type
should use ItemStack type, if thats what you want
Which gives incompatible types
note the difference between Item and ItemStack right
I want to get the singular item and add the enchantment to it
also getItemStack from Item entity should return ItemStack type anyway
ItemStack example = item.getItemStack();
ItemStack singularItem = example.clone();
singularItem.setAmount(1);
example.setAmount(example.getAmount() - 1);
ItemMeta meta = singularItem.getItemMeta()...
singularItem.setItemMeta(meta);
item.setItemStack(example);
item.getLocation().dropItem(singularItem);
Item != ItemStack
I know
If you want to get an enchantment, you need the itemstack not the item, and casting an item to an itemstack will not work
They are not the same
Wdym item.getItemStack()?
You can't get the ItemStack from item
item is an Item which is an entity
Oh my God
Well, if I had known that before, my life would have been 300x easier
Wait, no
I tried that
Wait
w h a t
Why does that work now?
cuz I'm pretty awesome
is this where i get xampp https://www.apachefriends.org/download.html ?
Download XAMPP for Windows, Linux, and OS X. Older versions of Solaris are also available.
yes
I got it with wamp
Okay, now that that issue is figured out, is there any way to make that more efficiently?
how is the item dropped? where does it come from
the part where it buffles me the most is casting getOnlinePlayers() to Player
cant believe that compiles actually
Meant to fix that
Basically, if it finds the items needed somewhere near the player, both on the same block, the pick will get the enchant
may wanna check if getNearbyEntities include item frames' items
Google your question before asking it: https://google.com/
lol
where did that come from
?google :)
Google your question before asking it: https://google.com/
why are you calling .getNearbyEntities() inside the loop
does the spigot API not provide a way to make endermen attack a player?
hm I need to see if setting the target automatically makes them aggressive or not
also I've created another monster class ๐
?paste
gj
Okay. Is there a spigot method to force send the teleport packet rather than the relative move packet? I'm dealing with very minuscule armorstand movements that are not properly updating to their correct positions.
packets is normally a nms thing
rip
Need an answer to this
unless it's @worldly ingot , you can ping @worldly ingot to make fun of @worldly ingot
github logo :)
is this github 2.0
hey it's me microsoft I want to pay 10 bn usd to buy your github 2.0 website
<i class="bi-github" role="img" aria-label="GitHub"></i>```
To find the pickaxe that is on the ground and is going to get enchanted, would there be a more efficient way to do it?
Doesnt the first get nearby entities already do that
Oh, you're asking about the second one?
The second one checks for the book in the same position as the pickaxe
@hardy swan ^
Ahh
in emmet for vsc this div.header>header>nav.nav-menu>ul>li*3>div>img.nav-icon+p.nav-text gets turned into html <div class="header"> <header> <nav class="nav-menu"> <ul> <li> <div> <img src="" alt="" class="nav-icon"> <p class="nav-text"></p> </div> </li> <li> <div> <img src="" alt="" class="nav-icon"> <p class="nav-text"></p> </div> </li> <li> <div> <img src="" alt="" class="nav-icon"> <p class="nav-text"></p> </div> </li> </ul> </nav> </header> </div>
Any other ideas for optimizing?
No lol, think thats the best way
I knew a person who developed their websites and only used childs to find divs
like almost no divs had classes and i was so fucking confused looking at the source code
lol
use scss
๐คฎ
what
XAMPP
xampp?
shame on you
whats wrong with xampp
whats wrong with xampp??????
apache is the option you go with when nginx doesnโt work
lol
do u think this looks good?
XAMPP is okay but I donโt see any use case
development and testing
Is the white line on the top part of the website or just there bc if the ss
thats the search bar
XD
Right okay
Looks good but Iโm not a fan of the GStudiosX font
Just looks super uninteresting lol
Also
Archive of freely downloadable fonts. Browse by alphabetical listing, by style, by author or by popularity.
i need to change the icons
i dont really like them
the home one is okay
its just the other two
https://fonts.google.com/specimen/Ubuntu this is the font i used i kinda like it
This website looks old.
lol
i only have icons from https://icons.getbootstrap.com/ ;-;
also im trying to add a background but it isnt going well
its mostly cuz i have a div for all the content and i cant expand it to the bottom
When website will have enough content that should fix your problem
nah i need to expand it at the bottom
everything
not sure if there is anything wrong with xampp anymore @granite stirrup but it wasn't super great a while back lol
lol
the only bad thing i see with it is the ads of there other softwares while trying to install it
the menu used to be bugged sometimes. Like not opening your php.ini file so you had to go find it. Sometimes it wasn't able to restart your apache server.
italics dont look good in nav bars imo
i didnt make it italics so idk why it is
๐
lol
mm
what did you think that was for?
i just used it since i had it i didnt know it modified the text
i kinda never really touched <i>
wo
i is one of those old tags from HTML 1 days that just managed to make it to modern time ๐
ezz
lmao
what did you do, have the style set for <i> tag ?
idk
well should check your css file
idk why it breaks it
because theres nothing specific to that
does inline-block even work with p?
yes
ah i fixed it
thought about commas? ๐
cya later
hi all Who understand how deobf Paramorphism?
do what to what
why doesnt this working
motd=&e&l&m--&9&8&l[&r=&6&lThe Deathpixel Network &8&l]&e&l&m--&8&l[ &c1.8-1.16 &8&l]&e&l&m-----&e&l&m ---&8&l[ &eNEWS:&8&l ]&e&m----&8&l[&r &e &l Sleef Soon &8&l]&e&l&m-
& isn't a vanilla color code symbole
i use spigot
nothing
Hey quick question: I'm programming a villager who, when I do a certain thing, gets teleported up 3 blocks and falls back to the ground. I have already created a variable which contains the Y location of the villager, but I don't know how exactly I could teleport the villager. Can someone help me with this? Thanks in advance
Just call the telport method on the villager
motd
hello
in server.properties?
yes
put quote around it
what is quote
"
ok
where is he
@wraith rapids we have a new winner for class names BinderOfWorldsPhase3EndermanReinforcementConfig
holy fucking shit
wtf is that
it's the configuration file for the enderman that appears in phase 3 of the binder of worlds boss
ok
Bruh first of you're in the wrong channel, second don't be so rude
can you even blame them
what else do you name that
BinderOfWorldsPhase3EndermanReinforcementConfig there's got to be something longer
public class BinderOfWorldsPhase3EndermanReinforcementConfig extends CustomBossConfigFields {
public BinderOfWorldsPhase3EndermanReinforcementConfig(){
super("binder_of_worlds_phase_3_enderman_reinforcement",
EntityType.GHAST.toString(),
true,
"$reinforcementLevel &5Reality Slayer",
"250");
setDropsVanillaLoot(false);
setDropsEliteMobsLoot(false);
setTimeout(2);
setFollowDistance(200);
}
}
cleaaaaan
tight
isn't that amazing
wasn't that worth like 12 hours of my life
actually way more, I'm just counting the latest refactors
Yes, but how exactly should I do that? I would have thought that you do it like this: Villager.teleport(Villager.getX(), Villager.getZ(), Location The variable Location in this case corresponds to the Y coordinate of the Villager + 4
that's awful
i lied
that's a terrible class name
when the longest name in your class is the header
ta calado
It's litterally villager.teleport(villager.getLocation().add(0, 4, 0))
ohh ok good thank you
hi all Who understand how deobf Paramorphism?
#teleport() takes either a location, vector, or three coords
so i have now written the following:
Villager.teleport(Villager.getLocation().add(Villager.getLocation().getX(), Location, Villager.getLocation().getZ())); however, when that runs, the Villager is no longer there.
yeah because you teleport him from his location to his location x2
x2?
Wat
Bro
Just copy paste what I did
yeah, you are adding his location to his location and teleporting him to that location
hey kids I heard you like configuration files
powers:
- summonable:summonType=ON_COMBAT_ENTER_PLACE_CRYSTAL:location=80,10,0:lightningRod=true
- summonable:summonType=ON_COMBAT_ENTER_PLACE_CRYSTAL:location=-80,10,0:lightningRod=true
- summonable:summonType=ON_COMBAT_ENTER_PLACE_CRYSTAL:location=0,10,80:lightningRod=true
- summonable:summonType=ON_COMBAT_ENTER:location=80,20,0:filename=binder_of_worlds_phase_3_ghast_reinforcement.yml:inheritLevel=true
- summonable:summonType=ON_COMBAT_ENTER:location=-80,20,0:filename=binder_of_worlds_phase_3_ghast_reinforcement.yml:inheritLevel=true
- summonable:summonType=ON_COMBAT_ENTER:location=0,20,80:filename=binder_of_worlds_phase_3_ghast_reinforcement.yml:inheritLevel=true
- summonable:summonType=ON_COMBAT_ENTER:location=0,20,-80:filename=binder_of_worlds_phase_3_ghast_reinforcement.yml:inheritLevel=true
- summonable:summonType=ON_COMBAT_ENTER:spawnNearby=true:inheritLevel=true:inheritAggro=true:filename=binder_of_worlds_phase_3_enderman_reinforcement.yml
haha typing go brr
ok and how could i do it right?
@chrome beacon just gave you everything
oh oh soo now I understand. I thought this would set the location of the villager to 0, 4, 0.
The moment when you spoonfeed for once and they don't even understand how to use it .-.
yeah getting his location and ADDING 4 y to it sets the location to 0 4 0
ok ok thank you very much ๐
how can I be getting an IllegalStateException when removing an element from an iterator?
all it does is go through a list of gold nuggets
oh I get it
I tried removing it multiple times is why I think
Is there a way to disable player collisions for 1.17?
There is no collidewithentities field
(I only want specific players to not collide with entities/players)
Didn't work when tested :/
Thanks
time to mathematically define a tornado
Well the server needs to have that dependency
Include that in your jar
Send full POM
?paste
Send it all
Anyone know why the material is null? https://paste.md-5.net/topazamamu.cpp
The item.getMaterial() is BLACK_STAINED_GLASS_PANE
tornadoEye = eliteMobEntity.getLivingEntity().getLocation().clone().add(new Vector(6, 0, 0)) .toVector().rotateAroundY(ThreadLocalRandom.current().nextDouble(0, 2 * Math.PI)) .toLocation(eliteMobEntity.getLivingEntity().getWorld()); ah yes setting a location
oh oops that's not even right, I still have to adjust for the floor
anyone wanna scope my screen, and help me implement placeholders into my plugin? It's already implements just not working, will pay you for your time. Weird request ik, i can talk you can listen, or can just type. Will pay $20
What is a RubyItem
That would do it
Out of curiosity - why are you using the string of material rather than just the material
just to make it more customizable
for example if i want to use base64 head
material: head;eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODY1MmUyYjkzNmNhODAyNmJkMjg2NTFkN2M5ZjI4MTlkMmU5MjM2OTc3MzRkMThkZmRiMTM1NTBmOGZkYWQ1ZiJ9fX0=
split the ;, set the itemstack to PLAYER_HEAD
here's the method https://paste.md-5.net/sugugimiwo.cpp
Ok - that makes more sense
What event should I listen when Player moved item from their Inventory to the custom inventory?
Like I want to do something when they place the item on the custom inventory.
InventoryClickEvent maybe?
yea i'm gonna try that i think
idk exactly when the drag event called
When you drag around items in the inventory
with holding left/right click?
(When you have a stack and hold left click and drag around slots)
Why
so, 1.17 needs java 16 does that mean plugins are not backwardly compatible?
not sure what nms would have to do with it
You can have a separate module with Maven with Java 16 and 1.17 NMS
Well actually it's the entire 1.17 jar
oh, so running 1.17 nms implies the java is 16
Yeah
so, wait, means that a plugin running on 1.17 that uses nms must just run on jvm 16
but that code can't it still be java 8 if it's not accessing nms?
I don't get where there is the issue is then
or are you saying can't compile 1.17 nms module using java 8 because it can't understand something?
if I don't use java 16 specific features and compile using java 8, then can be backwardly compatible as a plugin? except when using NMS which then links in the craftbukkit which includes NMS that has java 16 features so would not compile, but can get around that by compiling that module using java 16, is this correct?
ugh. so what is everyone doing then, yet another specific version for 1.17 onward?
Well what I did was just split all 1.17 things in to a different module
And then just shade that
anyone know why this is happening?
https://i.imgur.com/vWRHSs5.png
CODE: (in main calss)
boolean ifConfigValueIsSet(String ConfigValue) {
return this.getConfig().isSet(ConfigValue);
}```
- Learn Java
- You're trying to call an instance function from static context.
i have no clue what you mean by the second one and i am already learning java
Main is just referencing its static context. You don't have a instance of it, e.g. Main main = new Main() (don't do this with plugins btw).
So you would have to make a function static for you to be able to call it like that
i didn't understand the first two sentences but i can't make it static
cause then this would have a red line below it
yes because you can't call this from static context
then what else can i do?
Well I'd suggest you read up on what static means in Java
but otherwise, this is what I would do
i tried, i didn't understand
mmmh tornado
noice
class Plugin extends JavaPlugin {
private static Plugin instance;
@Override
public void onEnable() {
instance = this;
}
boolean static isConfigValueSet(String value) {
return instance.getConfig().isSet(value);
}
}
if that makes any sense to you
i don't understand that
could you explain it?
also wouldn't instance be a reserved keyword?
You know what instances are in Java?
the issue here is that you're using an object oriented language but don't know what objects are
i do not :/
The following creates an instance of X.
X x = new X();
i don't follow
i have
you haven't properly then
it was mostly about the math part of java tho
you need to find an oop focused java tutorial
oop being object oriented programming
that is the thing you are having issues with
i'm also learning by 3 things: trial and error, asking people here and codeacademy
most java tutorials completely ignore oop and then this happens
but again i'm only a beginner
try to search up and understand what each keywords means, like what is static
i have, i did not understand
that is one of the most important things to understand
then study access modifiers, generics, wildcards
inheritance
seems like BungeeCord javadocs don't build for Java 11
polymorphism
I think he should wait with generics for quite some time
Yeah generics are a much more complex subject
oh no why did you spoon feed him. We've been trying to get him to learn Java but he refuses
guys, is there a reason for plugin enable to fail because of NoClassDefFoundError: com/comphenix/protocol/events/PacketListener without even calling it
Oh he's a known offender, nice
I thought about it for a second
And decided to try it
But eh, they don't understand anyway
So idc
Yeah he's been here a while
He refuses to look anything up and learn Java
He wants us to write for him
wait, is that the "i'm blocking you" guy or is that someone else
so i did what spnda told me and uh
https://i.imgur.com/2lZ2Gk3.png
someone blocked elgar and like 4 other people the other day because they refused to spoonfeed him
could someone help?
this is due to sth missing or wrong in your plugin.yml
dun paste your plugin.yml here tho, wont help
was just about to lol
Well I think I know what the issue is, but I honestly don't want to see it
under main:
locate your main class properly
before that you might have to know what are packages too
learn bukkit
aren't packages just folders
not just
no I think they just copy & pasted what I sent earlier as an example, which had the javaplugin class called Plugin
so oof
I'd rather kick it
no i ignored the first line and put the 3 lines i needed in my main class
i'm dumb not an idiot
Java 17 is bae, https://openjdk.java.net/jeps/406
go back to assemble
so can anybody help?
what package does the class belong to? what is the public class's name of that class?
it's just the com package and idk what's a public class name of a class
class name
Main and ChatColorFunction
of which is the one declared public
and that means...?
public class MyPlugin extends JavaPlugin
the word public
declares the class to be public
allows users outside the package to access the class
which is the one that extends JavaPlugin?
Main
so what did you put under main field in plugin.yml
Does anyone know if CMI has a maven repo?
i have this in the plugin.yml:
main: com.floofsy.wootoo.WooToo
Well that's not your main class is it
this is where you are wrong
what do you think should be the right class to write there
It does not
you said that the package name of Main is? just com right?
so is it in a directory that looks like com>floofsy>wootoo
no it's just this:
https://i.imgur.com/DP6GCqO.png
it's great when you're stuck diagnosing why a method isn't working when you haven't hooked it up yet huh
@lean gull What's at the top of your .java file where it says package x.y.z; or something. From there you'll know what package do put in your plugin.yml.
that's not how you name a directory
it's correct, intellij flattens the directories/packages
with fullstops?
yeah
Yes. That's how package paths are represented
damn
nested directories with no other contents are concatenated with the . delimiter
imagine not having a good java linter, formatter and code completer in your ide
linter is installable extension >:)
and a shit extension at that (yes ik this is kotlin)
intellij keeps trying to get me to update the kotlin plugin even though I have it disabled because I never use it
what's so bad about updating it lol
it isn't
I just don't feel like updating it if I don't use it
Just annoying coz then it'll reanalyze all Ur code when the plugin reloads so Ur ide will freeze for a while on a large project
guys, real question here, I receive this error without even calling any relevant methods
java.lang.NoClassDefFoundError: com/comphenix/protocol/events/PacketListener
at com.blahblahblah.MyPlugin.onEnable(MyPlugin.java:69) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
...
Caused by: java.lang.ClassNotFoundException: com.comphenix.protocol.events.PacketListener
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_231]
at ...
oops that's a big chunk
That's why I avoid updating lots of my plugins rn
what's so bad about that? and i personally have never really been bothered by that
it's like 5-10 secs at max
There's nothing bad, it's just annoying. I'm not gonna volunteer a 20 second freeze for 0 benefit
intellij is gay
Also with my projects since they're p large, use lots of dependencies and frameworks it takes a bit longer
that's pretty hot @wraith rapids
and at line 69 I have a constructor
look at the stacktrace under
Caused by: java.lang.ClassNotFoundException: com.comphenix.protocol.events.PacketListener
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_231]
at ...
reading helps
it is a trace of plugin enabling
yeah, read it and youll get your answer
Caused by: java.lang.ClassNotFoundException: com.comphenix.protocol.events.PacketListener
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_231]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:135) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:81) ~[spigot-1.14.4.jar:git-Spigot-9de398a-9c887d4]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_231]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_231]
... 10 more
yes that what I thought I would too
Firstly this will make you think I called sth related to PacketListener
What should I do if I want to know for example how many creeper eggs player has in his inventory? Im creating a inventory full detector system, where it gives the player enough and the rest what didnt fit in the inventory will be dropped on the ground
but this line clearly doesn't do anything more than calling a constructor
yes I indeed included ProtocolLib as a soft-dependency, but I didn't call its methods or get its class at all in onEnable()
not even an import in the main class
does ExternalPluginSupport extend something, or is it maybe in the init method and the line num is wrong?
Idk, you should try and get a better and more extensive stacktrace to help you here
PacketPlayOutTitle isn't in 1.17, with what it was replaced? (where could I check)
this is all ExternalPluginsSupport does, doesn't extend anything
it is, the package just changed
where could I find the changes?
search for PacketPlayOut with the search function in this discord and you will find 200 other people asking the same question
and also an answer, probably
How can I set the head of a player to an item named profile? I know how to set the displayname of the item but I dont know how to set the texture to the players head
danggโฆ ๐ณ๐ณ me too bro๐๐
anyone know off the top of their heads what the default downwards vector is
was it 7 or smth
hang on can't be 7
0.09 or something? i don't remember
oh fuck i know what's the problem lmao
but wasn't shown in stack trace
think it is sth about an anonymous class
is there a way for plugin loader to ignore anonymous classes onEnable other than using reflection?
@worldly ingot Is it possible to support maven toolchains so we don't have to make a systemwide dependency on java 16 just to manually build spigot?
something like
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
<configuration>
<toolchains>
<jdk>
<version>1.16</version>
<vendor>openjdk</vendor>
</jdk>
</toolchains>
</configuration>
</plugin>```
that way can define the toolchains in toolchain.xml in the .m2 folder and allow maven projects to use different jvms?
Who understand how deobf Paramorphism?
this java 1.16 stuff is wreaking havoc on my jenkins server
can anyone help?
https://i.imgur.com/0kX0kcn.png
(tell me what code you need, if you need any)
suppose i could set JAVA_HOME in the environment
You've not added the config to the jar file properly.
this is my code tho, isn't it supposed to create the config?
public class Main extends JavaPlugin {
private static Plugin instance;
@Override
public void onEnable() {
instance = this;
ChatColorFunction command = new ChatColorFunction();
getCommand("chatcolor").setExecutor(new ChatColorFunction());
configSet();
}
public void configSet() {
this.saveDefaultConfig();
if (this.getConfig().isSet("chat-color")) {
this.getConfig().set("chat-color", true);
}
}```
well i mean it's a part of my code
Have you added the config.yml to the resources folder. For the project.
dont use 'Plugin' (or JavaPlugin) for instances, use your actual class in your case "Main"
so, this? private static Main instance;
yep
Dependency Injection would be better.
saveDefaultConfig would create the folder right?
what's dependency injection
They are a newer developer and thats why I didnt mention it
according to that article it should make the config file if it doesn't exist
so instead of checking that something is set, just use a default
getConfig().addDefault("chat-color", "#a1ffb0");
then call
saveDefaultConfig();
after you have added all the defaults
then saveConfig();
and reloadConfig();
public void configSet() {
getConfig().addDefault("chat-color", "#a1ffb0");
saveDefaultConfig();
saveConfig();
reloadConfig();
}
Adds a default value to the file.
like that ^^
tAkE a LoOk At ThE aPi
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
i had already given him all the code so ๐คท
i actually am lol
then stop spoonfeeding him even more
i like spoons ๐
Sorry - but i was there once and i hated it when people just gave ellusive hints at the idea
I teach how i like to be taught
smort
if you add a default it will add the value if it doesn't already exist but if it does it just doesn't do anything
it basically combines checking it is set and setting it in one method
how do i just add a label doe
its a method under config options iirc
i want to add the label if it's not set and then add sub-labels with values later
i think this is the correct one
not sure what i'm supposed to do with this doe
read it 
Well - what are you trying to do
also what's header
The comment
i'm tryna make a chat color thing
i asked for a simple challenge in #general and apparently that wasn't simple enough
cause i have no clue what i'm doin
๐
Ok - so what is the chatcolour thing doing?
changing the colour of all chat messages?
well multiple colors is too hard for me so i'm just doing a toggle thing for red chat color
no it's per person
so i wanna set a sub-label in chat-color in config to true, or delete it
and then read from it on AsyncPlayerChatEvent
Hey guys I am trying to make clickable links in chat. This is the code I have:
TextComponent link = new TextComponent("<my link>");
link.setColor(ChatColor.GOLD);
BaseComponent[] linkHover = new ComponentBuilder()
.append("Click to go to ")
.color(ChatColor.GRAY)
.append("https://<my link>")
.color(ChatColor.BLUE)
.underlined(true)
.create();
link.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, linkHover));
link.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "<my link>"));
but my IDE says that the HoverEvent constructor is deprecated. This was the only thing I could find online so I was just wondering what the "correct" way to do this would be. Thanks
i mean the hover event constructor works fine for me
i am using it in my project rn
no - it isn't deprecated for me
oh i know what it is
the second arg is not just a string
ye i need it to be more formatted text
new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("Hello"))
use the bungee chatcolour of() method
ok
i think you can do &x&F&F&F&F&F&F
ty
is there a java equivalent of the javasript
`${/* insert a varible right into a string */}`
ChatColor.translatetoAlternateColors('&', "&fText to translate") ?
String.format?
or printf
no i dont think so cause it is a bungeecord colour
oh idk
._.
There ya go ^^
welp ok
concating is as good
i still need help btw
:/
dis
wait no
oh nvm it is that
did you make a config.yml?
i don't understand
no, i did the code to make it from a tutorial
i think you prob should not touch config files at this stage yet
you have to create it yourself
a default one
and then your code adds something to it
i don't understand, sorry
the tutorial was pretty straight forward, idk why this isn't working
@lean gull i think you shouldn't touch conf files, unless you have pretty good knowledge of maven
maven? wat dat
or the build tool that you are using
what's a build tool
even after you create the yml file, you need to know how to include it in your final jar
i did watch a bukkit tutorial series
but you definitly need java knowledge to start coding
i also watched a java tutorial and i'm learning with codeacademy
i would appreatiate if you would stop saying "you can't do this at this stage" or "learn java"
because i am trying my hardest
๐
didnt work
do they need to all be uppercase?
it is good that you are tryin hard but you may want to start with simpler programs to understand how java works
i didn't know chat color can be this hard
it will greatly accelerate your learning
what are you trying to do?
custom hex chat colors
he's trying to do hex colors
on a hoverEvent?
Is ther an event that gets triggered when players econmy gets updated
Like for vault
i did it like this
TextComponent message = new TextComponent("Discord");
message.setColor(ChatColor.DARK_PURPLE);
message.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://discord.gg/"));
message.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("Click HERE to get a link to ")));
instead of enum ChatCOlor you could use something else
He does not. And he refuses any Java tutorials
yes ik i can do this buts thats rly verbose
im trying to use translateAlternateColorCodes
vault doesn't provide events, most likely have to look at the implementing economy
fuck it i'll just go back to the ComponentBuilder
https://github.com/MilkBowl/VaultAPI Can you show me where
I just replied lol
So i am like stuck
it links me to some very undocumented library hahahaha
Well let me explain why i need it in the first place
so maybe you can give me an advice
I need to send a post request to my backend api, that will then display/update that balance on peoples linked with outh discord proffiles when they are on the server (the part when they are on the server is done, its a post request with uuid in the path, already used for join leave notifications on discord and whatsoever)
so i just want to avoid a bukkit runnable that loops all the time for all players, that is like super super bad worarround
"loops" means its timed for example on every 10000 ticks
So looping is my best bet i suppose then hahhahaha
it's the only way you can check for changes to players balances
plugins such as essentials provide an event for balance changes, but there isn't one in vault itself (which is very annoying)
if you want full compatibility then you'll have to compare balances before/after time to see if there is a change
anyone know why this sends an internal error? (pls no spoonfeeds, but explanations would be nice)
if (Main.chatColorHashMap.containsKey(uuid)) {
Main.chatColorHashMap.put(uuid.toString(), null);;
player.sendMessage("true");
} else {
Main.chatColorHashMap.put(uuid.toString(), "&c");
player.sendMessage("false");
}```
it's internal error
also static abuse
How can I hide this?
yes, it spits that error into your console
yeah that doesnt mean a lot
ctrl + h
F3 + H i think
it's client-side doe
yup, i didn't know until now
Anyone know like a head database api that does't require a Plugin API - maybe just an api?
Cause i found this:
https://github.com/Arcaniax-Development/HeadDatabase-API
but i dont really want a plugin depend
Best bet is to write the method yourself tbh
steal their database and add it to yours
It isn't public afaik
yeah ><
nah
because you can just write one yourself
its a wrapper for this website afaik
https://minecraft-heads.com/custom-heads/miscellaneous/889-united-states-of-america
is the NMS code no longer under a version specific container?
try {
ItemStack item = api.getItemHead("7129");
getLogger().info(api.getItemID(item));
} catch (NullPointerException nullPointerException) {
getLogger().info("Could not find the head you were looking for");
}```
catching an npe? hmm
Yea
not quite sure how that's more beneficial than just making a web request for MHF_IronGolem or somethign like that
It is not net.minecraft.network.sth
admittedly i avoid nms like a plague
isn't that going to break a lot of stuff needed for multi-version plugins?
i still need help btw
i have no experience with heads thats all
Wait are you saying nms doesn't have like 1_17_R1 or whatever????
we still need your error btw
i told you, internal error
That is craftbukkit right
it spits an error to your console
yeh, no v1_17_R1 folder in the namespace
That's awesome
it's a giant stacktrace you can't miss it
Is there a guide / a repo that you can link? I have never done this stuff b4
yeh, so seems like that will completely break any ability to have multiple spigot NMS in a plugin
it is actually the opposite
das the error
It tells you what's wrong
1.17+ nms prob stays unversioned
dunno of any guides but here's the protocol wiki https://wiki.vg/Mojang_API#UUID_to_Profile_and_Skin.2FCape
So stuff like
return Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
}``` still works
?paste ;/
pretty sure that still works, that is how my plugins identify the server version and it returns the correct string for 1.17
oh, so saying that it's not needed and you can still use interface to access multiple versions
Yes, as I said it still works
ah, i interpreted it as a question
well then, less customizing each NMS file
sooo... can anyone help?
should of probably told u i dont know how to code
it's not null doe
wrong channel then
public static HashMap<String, String> chatColorHashMap;```
well it cl4early is
that is null if you don't assign it
That is null
lemme guess right now
you can use the meta-inf as well to determine the server version just fyi
You didn't initialize it with new HashMap<>();
my fault
meta-inf?
are these texts used to put in a jar file or sumn?
uh sure
tbh, haven't been here over the last year
@echo saddle yes in the meta-inf directory in the jar, the server version and stuff gets put there
fixed it but now it's broken
then it's not fixed lol
can yall link me a good video so i can implement this thing pls
the first reaction of it being broken should not be this channel dear
no i mean i fixed that error but now something else is broken
specified or populated?
yes
description..?
1 sec i wanna see i if i can fix it alone
but the first thing you should do is not ask here
you want to learn to code? or you just want to find a plugin to disable those messages
if i can implement it without a third party plugin itd be amazing
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
jawaa
well that is typically how you code
last one best, 100% recommend
ayo i fixed it bymself
nice
guys, can I ask if there is a method in the main JavaPlugin class that contains an anonymous or inner class extending a class not found in runtime, will the server just throw an exception on enable? Even when the method is not called on enable
in a java file
https://paste.md-5.net/ifinequguk.java
This with durability dosen?t work, could somone help me please?
๐ญ
ima just copy and paste it in a txt file and change it to jar
does that work?!
Please help me :c
isn't that method deprecated? the durability
also explain how it doesn't work
nope
Yes it is, but idk an alternative :c
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
java file is a document you write code in, jar is a compressed folder containing your compiled packages
It dosen`T repair the item, it makes taht the items stays in your inventory with out break, but you have to do everything with your hand.
Tysm!
But when i try to setDamag, idk there isn?T that :c
Did you cast your meta to Damageable
again 'doesn't work' isn't very descriptive
the method you're probably looking for ia getItemInMainHand
players have two hands now
does getItemInHand() return a copy or the item itself?
Okay ehm in the code it gets red when i put that in instead of durability
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
idk, i don`T think so o.o
but yea now you actually need to get inventory before getting item in hand, and possible just a copy too
get equipment or inventory i forgot
getItemInHand returns the item, not a copy
and for its updated equivalent methods, the same is true
Itโs equipment
o.O
Idkkkk
Ok :C
I will try to do something else, maybe this is to complex O:
but I was pretty sure it at least only return a shallow copy