#help-development
1 messages ยท Page 113 of 1
Lombok on the other hand ...
Asking me to use lombok is like asking me to use kotlin gradle. I wont.
lol your loss
There might be some concurrency inconsistencies but I can send 2k item frames and my mspt will still be 0
There's a bunch of processing though
its super convient ๐คทโโ๏ธ @Getter @Setter save so much time
though if you use github copilot that essentially fills the use its just slower
uses eclipse
eclipse has a lombok extension iirc
muhuhaha, my IDE can generate methods
You act like ALT + ENTER ---> Create getter and setter isn't essentially the same thing.
oh yeah lol
... which is just an annotation processor that barely works
Used it once, bricked my eclipse install - never again
sadge
Hence it is on the same level of kotlin gradle
I've never used kotlin gradle whats wrong with it ๐คทโโ๏ธ i see now reasont o use kotlin
While kotlin gradle does also support eclipse in theory, their integration is even worse
Or gives much pain
does nms 1.19.2 exist?
also don't forget that my goal now is to optimise bandwith, nnot server perf, as its already great
it exists in every version
with that I mean completly bricking gradle groovy support
hmmm okay then thanks. back to trouble shooting ๐ฆ
?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
probably your issue
(also applies to 1.19)
It might be better to provie the full stacktrace
In case of doubt use if (stack == null || stack.getType().equals(Material.AIR)){
does anyone have a working maven file with nms I can't wrap my head around maven
public class AttackEvent implements Listener{
private MagicMayhem plugin;
@EventHandler
public void onEntityDamaged(EntityDamageEvent event){
double damage = Math.round(event.getDamage());
Entity EventEntity = event.getEntity();
Bukkit.broadcastMessage("Damage done " + damage);
Bukkit.broadcastMessage(String.valueOf(EventEntity));
EventEntity.setCustomName("โ" + damage);
BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskLater(plugin, () -> {
Bukkit.broadcastMessage("Mooooo!");
}, 20L * 30L /*<-- the delay */);
}
}```
what is wrong with this scheduler
do you want it to be 30 seconds delay?
well i was testing different delays to see if that was the problem
i want it to be 2 seconds
2 * 20L then
is there a reason you're creating a variable for the scheduler?
Are those broadcast messages above the scheduler being broadcasted?
/ did you register the event?
yes
im basically following the spigot offical guide
i just have the variable there for now
Bukkit.getScheduler().runTaskLater(plugin, () -> {
Bukkit.broadcastMessage("Mooooo!");
}, 2 * 20L /*<-- the delay */);
wow wtf
gradle's "maven migration" thing is total bullshit
it ignores all the plugins and settings and only takes into account the dependencies ๐
private final MagicMayhem plugin;
public AttackEvent(MagicMayhem plugin) {
this.plugin = plugin;
}```
and add a "this" when registering your event class
oh i forgot to actually set the plugin
:)
gj gradle
I mean
are you switching to gradle?
is there an event for a non-redstone block being powered
for example glass gets powered
Can non redstone blocks be powered? lol
no, I just wanted to try it once
idk it's just so ugly
no no no
I'm having trouble trying to import FastAsyncWorldEdit-Core 2.4.4 the IDE doesn't give any problem but when try to compile: is giving cannot find symbol in
ClipboardFormats.findByFile(file)
cannot find symbol->.load(file)
its just kotlin xD
who the fuck thought "yeah I definitely need code to describe my build"
I mean, "x as code" is getting more and more popular for everything
well... hitler also became popular once...
also just makes a lot of sense for builds in my opinion
like, if you are maintaining anything as code you can create completely custom build logic in a matter of seconds
idk to me it just looks like gradle is maven with less features
but who ever needed that?
wat ?
I mean I guess your projects aren't complex enough ?
In the normal use case you don't
they are complex enough for gradle to not understand anything
but like, I half the time end up with a "I'd like to do this specific thing pre-build"
?paste
I have a config.yml with a string named BLACK_STAINED_GLASS_PANE, how can I pass that as argument in a function to be a Material object?
https://paste.md-5.net/kanuqonadi.xml pom
https://paste.md-5.net/acosedupis.m what gradle understands
erm
it got rid of everything
where's the jar plugin part? where's the javadoc config? where is anything?
wheres the shade config
gradle docs claim that gradle init can migrate your pom.xml
I mean, the basics of it yea
what ?
the appropriate plugins to build your code
literally with the "limited to" part right there
are we reading different things
the specialsource plugin is needed to build my code
they LITERALLY list what they can convert
and its next to nothing
Then don't use this feature ?!?
its a nice addition that they try
it is not the core of the build system
well i dont know, it looks pretty useless to me if it ignores 99% of the pom and then congratz itself for being able to extract the repositories and dependencies
I don't try maven and my judgement is "oh well it could not migrate my entire gradle build layout automatifcally"
Yes, the migration is absolutely useless
hence why I stated to please not use it
and just do a propper fresh creation
well my opinion is simply - if there is a migration tool, it should work. and if they say "we cannot possibly create a migration tool that works", then why did they make one the first place
here is what happens because of this https://media.discordapp.net/attachments/968178366442242089/1016090703136301217/unknown.png?width=1201&height=676
idk I've never seen any project that doesnt at least define one or two plugins in the pom
I mean, compiler plugin is not needed on gradle
it is of course needed
no
but it's defined in the archetype thing
the java plugin you got is everything that is needed there
getting hung up on a migration tool is such a weird thing
also believing that lossless conversion from maven to gradle would be possible is just
like, what is it going to do with maven plugins ๐
magically invoke them ?
yeah that's another thing
gradle doesn't even have most of maven's features
e.g. the official maven-shade-plugin
there simply is no official equivalent
I mean, the shadow plugin exists
and yes, I know, some random person on github wrote something similar, but it's not even officially part of gradle
please
oh no, using open source software 
I dont like my buidtool to depend on random third party people's plugins to be halfway usable
especially one that is as maintained as that one
that software is so far from random
its wild
but why isnt there just an official plugin for this, its just so weird
I mean gradle just feels like a half-finished of maven
like, nothing is perfect
yeah sure
how does gradle feel half finished o.O
like beyond the fact that the shadow plugin is not an official plugin
for example because it has literally no plugins and everything relies on third party people to add features that maven had since 10 years
that is a literal design decision
same reason why spigot does not have a fully fletched command framework
yeah and I don't like this decision, so I'm talking about it
or inventory api framework
like, you are using stuff from the community anyway.
beyond that, what other plugin is third party
that you would actually need
looking at your pom, shadow is the only one
well
many things
first thing that comes to my mind is e.g. wagon-webdav-jackrabbit
a deprecated plugin ? xD
oh didnt know, they moved it into the default http provider
so yeah now maven even has it built in without needing ANY plugin
huh am I stupid? where is this error coming from lol
Love how everyone put the taskbar to the left again on windows 11 xD
eminem
it says "cannot find symbol" while the declaration is literally exactly there?
hm?
having it in th emiddle is just weird
because all icons are at a different location all the time
like, if you open more windows, then explorer will move to the left
smart compiler ๐ค
System.out.println(config.get("menu.normal.color"));
ItemStack item = config.getItemStack("menu.normal.color");
menu.setItem(1, item);```
Why it isn't setting as RED_STAINED_GLASS_PANE
Do you set that before or after you fill the inventory with those black panes?
i'm using pterodactyl and my plugin cannot connect to a database hosted on the same machine
"Communications link failure"
Show the whole method @terse ore
It's already solved but ty <3
not even PS4 supports 1.8 anymore
i didnโt ๐ฌ
Lol, wasn't PlotMe the standard back in 1.8?
That wasn't his question
there is no plotsquared version for 1.8
It used to be, yeah. I think it was abandoned recently
and?
I am not
and its still used more than newer versions (in servers at the very least)
all I say is there is no PS api for 1.8 since there is no PS for 1.8
false
6% of servers are 1.8
yeah 1.8 is dead
ah yeah sure
and we go by playerbase
name one 1.8 server besides hypixel
hypixel is a modified 1.7
wtf is wrong with those people
1.8 is actually dying, and has no little kids anymore either.
they use 1.7 nms because they already had a massive codebase around then
Good luck trying to run a profitable community on 1.8
Hey Illu
and it was quicker to write your own 1.8 nms impl
Source: interviewed for hypixel, even their code challenges are written in 1.7
Hello
How you been man
so Thunderin is there ANY "major" 1.8 server that you know?
because I don't know any
Minecadia
.
Viper, Cave, Palm, etc
never heard of that
well currently 622 players online, that's not "major" i guess
wtf is EOTW
ofc there is nobody on the map is ending
end of the world
the map is gonna reset
๐คฆโโ๏ธ
Smh Alex just maintain 1.8
how am I supposed to know when some random outdated server resets their map lmao
It's the best version
:kappa:
if you only have dev experience in minecraft dont comment on server popularity or how to grow a playerbase
I dont think I'm an idiot for not simping on some outdated server
You are 1.8 is the best version
im not simping for it im being realistic
pro tip
I prefer modern versions
I didnt tell anyone on how to grow a playerpase
charge 20% more for 1.8 plugins
I'm just defending the reality of the situation
ong the api sucks
you're just being unfriendly all the time and Imma block you now I guess
50% min.
just for the extra time thinking about how janky the old api is
LOL
You are a child
I mean hourly, you'll still waste more time
ik ong
aren't you like 17
you cant even set entities invis
dont you work for me
haven't done a single commission for you lmao
Charge 25% more each year it gets outdated.
just on the team, chilling
LOL
its massive my boy
it had 2k on start of the map
Hey just installed for myself not for a server. for it to work, I just drag the file into the .minecraft right?
I have more to do with my life than being a nerd
Massive
dont try and insult me if you are still a contractor under my company which makes more money than you
what are you talking about? o0
The point is massive
for example, being depressed in a corner of my room
sorry whats a big 1.19 server?
origin realms
crazy
mcmmo
2k players?
hypixel hiring resource pack devs ๐
finally
ask on mcmmo's discord
link pls
Lmao, what company do you own?
didnt you buy mcmmo? the discord link is on the plugin page
I own AbyssDev an industry leader and the fastest growing minecraft service team
Industry leader lol
lol
Hundreds of servers use our plugin, Spoof.
https://spoofmc.com you can find it here if you're interested! ๐
I haven't heard of either ๐
never heard of
๐คทโโ๏ธ
"hundreds of servers" is basically nothing, isnt it?
LOLOLOL
when these are active servers with an average playerbase of 100-150 yeah
I'm sure quite some people here made plugins that hundreds of servers use
Honestly the term industry leader doesn't mean anything when it's not exactly an industry
considering its a monthly subscription for the plugin as well
You are flexing with a plugin that spoofs the player count ?
monthly sub
We are a legal registered company in the state of florida
๐
Lmfao, it's just a product that fakes player numbers by using bots. You have to be fucking kidding me. This is the funniest shit I have ever seen.
I am dying ๐
I mean, even my first plugin is used by 3400 servers
Gratz, means nothing tho
Your plugins are german quality my friend
Got anything open src im able to shit on rq?
"i am a legally registered company in <somewhere>" lol
I am a legal tax evader
fbi open up
Wait so in other words an industry leader is here among us plebs talking about how they're an industry leader we've never heard about. Indeed.
alex you are 27 years old man what are you doing with your life
in the spigot discord
https://github.com/JEFF-Media-GbR/JeffLib here, have fun shitting on it
oo roasted
Man for an industry leader you're super unprofessional
chatting with friends and jerks like you
guys drop this non sense right now thanks
Awwww
Conclure you should honestly just get rid of Relocation LOL
All he does is be a dick here
I mean at this point you guys are just throwing shit at each and another
Guys, I think I figured out why 1.8 still the "larger playerbase". These mfers are using bots to inflate their numbers. xD
This has been the funniest discovery ever.
haha
literally drop this rn
Probably best to just drop this for sure
sysdm
Why do you annotate finalized classes with @UtilityClass if the annotation already finalizes the class?
yeah for sure
thanks
because it doesnt hurt to do so
no point in doing it
and because then intellij will stop complaining about "utility class is not final"
Relocation you as well
at least not for me
me as well what
if you wanna debate code design choices, go to #general
it does that for me
2min seen this guy here and he already being annoyoing lol
Hey don't insult the industry leader who attack people based on age and income.
sry my bad
guys I wont mention it one more time
you know what's weird
if you dont make at least 6 digits a year dont mention my name ๐ฅฑ
that calling blockState.update() breaks inventory changes
?kick @cosmic pelican
Byeee
Done. That felt good.
okay relocation
Thank god
cringe guy
Conclure 
ty conclure
lol
Best conclure
Relocation has his head 8 lightyears up his ass it's insane lol
on a side note, I've been working on making an image templating and caching backend for my canvas system
mfn says Y
One of those people looking down on others
the entire logic is loaded from a yml file
Ohhh that looks cute

But can it play Youtube?
probably
True it needs a type: Youtube
was thinking on making a html5 browser
How would you do audio?
Does the minecraft client accept audio buffers from the server in some way?
this is just a test
no
not really but we can make some magic
Yeah, so you wouldn't be able to play audio lol
by stacking frequencies
I wanna watch twitch in Minecraft make it ๐คญ
I hate you but ok
I wanna watch minecraft lets plays in minecraft
Is MC capable of playing the raw frequencies?
That would sound weird and probably lag on low resource servers/clients.
no
Oh, wait, that's smart.
well I wonder what you could manage using noteblock packets
code-wise, it's simple enough
Maybe ask the plot square peeps
yeah okay but that's unsupported and dead
I meant there is no supported version for 1.8
brother just use whatever you want
Is anything even remotely maintained for legacy ?
it's your server, unsupported regardless
pvp plugins ig
Ig
most plugins I know dont even support 1.16 anymore
your own api idk
.
well first, this is spigot
then fix your networking
2nd, use the ptero network interface IP
Itโs a spigot plugin I made
it's not a spigot related question though
It doesn't sound like an API issue thouhg
it's related to docker networking and / or your firewall
ask in the ptero discord, that gets asked every day
use the network interface, whatever that IP is
Pjng me
ping you
probably just anticheats
or lifesteal plugins ๐
most primarily(hopefully) target latest mc but will still backport to old
@kindred valley pong
poof
Essentials shit
essentialsx my beloved
we and wg yea
Is there a difference between getPluginManager().disablePlugin(plugin) and getPluginLoader().disablePlugin(plugin) ?
fuck around and find out
๐ช
just check stash @iron glade and see what does what
?stash
ty
What does this do
best case one is a shorthand to the other
worst case... idk they do stuff differently
That's what I'm thinking rn
yes and no
PluginManager#disablePlugin calls PluginLoader#disableplugin
ahh gotcha
So on the player screen i want to display some text
is there anyway to render this?
use Player.Spigot#sendMessage + ChatMessageType.ACTION_BAR
What is the best way to despawn enderpearls after a player has died? Would it be to loop through all entities in the world and then kill the entities that are ender pearls that are thrown by the player, or should I look into PDC and give the item metadata to then determine whether I should kill it once it lands?
Or if any of you know a better way, what would you do?
no need to use PDC
just use the thrower
and I wouldnt loop over all entities, I#d just store them in a HashMap<UUID,Set<Entity>> or sth like that
uhh it says you cant + ChatMessageType.ACTION_BAR
So, when entity spawns and it is an enderpearl, store it together with the thrower in hashmap. Then when it lands remove from said hashmap. If the player dies, loop through hashmap and kill all entities thrown by player?
public static void main(String[] args) {
Player player = null;
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("Text to show"));
}
kinda like this, yeah
i mean you could also just loop over all entities everytime when a player dies, it probaby doesnt change much
But performance wise it would be better to use the hashmap?
probably it would be a tiny bit better
you imported the wrong TextComponent class
you need to use the net.md_5.bungee.api.chat.TextComponent one
oh yh bungee
I'd probably just do it like this, then don't worry about it ๐
@EventHandler
public void onDeath(PlayerDeathEvent event) {
event.getEntity().getWorld().getEntitiesByClass(EnderPearl.class)
.stream()
.filter(pearl -> pearl.getShooter().equals(event.getEntity()))
.forEach(Entity::remove);
Oh right. That would effectively do the same lol but looks a lot cleaner
Does getEntitiesByClass return all Entities or only those in loaded chunks?
only in loaded chunks
the server only can see loaded entities, if they ain't loaded the server doesn't know they exist
Thought so. It's not mentioned in the javadoc
^
all != in loaded chunks imo
yeah okay that's indeed a bit misleading
"currently residing in this world" is kinda not true
yeah should be changed to "currently residing in loaded chunks of this world" or something along those lines
it's also kinda weird that it returns a Collection instead of a List
I mean I guessed that it would be loaded chunks only but with that description it sounded weird
That is weird. Especially since getEntities() returns a List
yeah and the javadocs also says "it returns a list"
and it DOES return a list, but it declares it "only" as collection lol
didn't even notice that lol
I added this to my plugin and it stopped working. Their were/are no errors and everything appears to be fine(I changed only two other lines and I already verified that they are correct, this is the only one I am iffy on).
if (event.getPacketType() == PacketType.Play.Server.ENTITY_EQUIPMENT && (p.getScoreboardTags().contains("shadowhuntactive") || p.getScoreboardTags().contains("shadowsneakactive")))(there is more to the if statement but I didn't change anything else in it.)
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
am I stupid, or are these kotlin docs talking about "data classes" not explain at all on how to declare fields?
I mean you cannot really call it "data class" without any fields right?
Sorry I guess I should have clarified. This plugin adds abilities to items that activate on right click of the item. Before modification of the system(basically remove everything past the && in the if statement) it was working but I needed to get the system integrated with my item abilities so I added that segment. When I compiled the plugin and then loaded it onto a server it gave no errors but it did nothing either. I double checked that I had the correct activation and it wasn't doing anything. I am in the development phase so I basically have a logger that tells me anytime anything is activated and nothing was being activated. It wasn't detecting item right clicks(whether or not they were the correct item) and it wasn't doing anything.
copilot is meant for stuff like this
couldn't agree more lol
https://kotlinlang.org/docs/data-classes.html
looks weird. But here's some useful documentation about them tho
thanks but I already switched back to java ๐
kotlin just adds nothing useful for me so it's useless to learn this weird new syntax
Lol
Sad. Kotlin can do some great things. Data classes, extension functions, better lambdas, default finals, no checked exceptions, no setters and getters to name a few
hm well
data classes and extension functions, I can do with lombok. better lambdas? what is different there? I dont know. No checked exceptions, I see this is an absolute downside. No setters and getters? Yeah that's also a horrible decision imho
also extension function sare basically just static methods that take in some arg
yes but you can use them like you would actually change the class it belongs to
public class Person {
public void kill();
}
I mean an extension function would just do it like this:
public class MyClass {
public static void killPerson(Person person);
}
not really any difference imho
yeah I dont like the whol eidea of this
Lambdas are just cleaner
it should either be declared in the actual class, or just be a static method
but how are they different from java?
but calling
person.kill()
feels more natural imo
but person.kill() suggests that kill is part of a person
seems very weird to me to do those dirty hacks
e.g. "lets pretend kill is part of Person even though it isnt and that's also the reason why I have to pretend this in the first place"
Java better imo
I#d rather do PersonUtils.kill(person)
I mean yeah a bad example in this case. Lets take person.eat() then
this way, it's obvious that I wrote kill myself and it's not part of the provided Person class
if it's not declared in Person.class, it should not be called using Person.methodName() imho
it should just be ClassName.methodName
I mean there's certainly a lot of personal preference in those differences. I use both
Kotlin at work
Java as a hobby
I just dont like all those design decisions that kotlin made
for me, kotlin is like java with a weird syntax lol
with additional inconsistencies
And I prefer java. But I feel like that's because I'm using java since 7 years and Kotlin since 6 months
Kotlin is the .Net of Java
kotlin is just quirky and nothing more
nah, .net is precise, kotlin is always "lets guess waht happens"
I mean just imagine you have a class with an "age" field as int
it's a public field, but you also declared a setter (because, e.g., for historic reasons, idk)
and now you do this:
MyClass.age = 3;
does it call the setter now?
or not?
in java it's straightforward. If you call the setter, it calls the setter, if you set the field, it sets the field
kotlin however does some "guessing" and calls this "conciseness" and that's just weird imho
is there any way to set an entity to be in a riptide state?
well but public field with setter is just weird
that is true, but it COULD happen
or lets say, it could be a protected or private field
if it's a private field it would call the setter
yeah and isn't that extremely stupid?
idk what it does when it can access the field.
Means when inside the class it won't use the setter. When outside it would
I guess
Most of the time we just have data classes anyway since we are in Spring context and that's mostly Entities
public class Person {
int myAge;
public Person(int age) {
this.myAge = age;
}
public void setAge(int newAge) {
if(newAge > myAge) throw new IllegalArgsException("You cannot become younger");
this.myAge = newAge;
}
}
So this would never work when doing new Person with an age above 0?
because obv the setAge method is meant to be used from outside, but not from inside
Yeah I would guess (again, only guess) Kotlin takes the field when it can access it (protected, public or inside the class) and the setter when it can't
yeah that's what I think too, but that's the issue
we both don't know it, we literally have to guess what a programming language does, although programming languages should be desidned to do exactly what they are told to
and not just randomly insert their own logic
I mean if we would know it would do exactly that
and that's what I don't like about kotlin
So if it does how I say it will always do how I said
then it isn't 'we don't know' anymore
but then someone might change the field from private to public or so, and what would then change the behaviour in other classes
that is also so weird
like, imagine someone else does this
myPerson.age = 3;
and now I suddenly make the int field public
and now the behaviour of the other class changes
so weird
That's true but usually you don't want public fields. And if you want a public field you don't want a setter and would remove it.
You still might run into it with private vs protected but ye idk how you would resolve those issues. Never ran into that.
it's literally not possible to explicitly say "I wanna use a method" or "I wanna set a field" in kotlin unless maybe with reflection
ofc, usually that's a shitty idea, I just wanted to show that kotlin is quite "random" in its behaviour. You're right that normally, this situation would not happen
idk if i can ask help for protocalllib here but how can i set the MetaData for a npc? basically set it to swimming
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
PacketContainer packet = manager.createPacket(PacketType.Play.Server.ENTITY_METADATA);
packet.getIntegers().write(0, npcEntity.getEntityId());
packet.setMeta("18", 3);
do you really need ProtocolLib for this?
imho PLib just makes everything much more complicated
cant use nms
lol wtf is this supposed to mean
well
EasyMetadataPacket metadata = new EasyMetadataPacket(npcEntity);
packet.write(18, Whatever);
packet.getWatchableCollectionModifier().write(0, metadata.export());
ok after a short research on Stackoverflow it seems that
Kotlin always uses the setter and never accesses the property directly.
are you sure?!
even when I do it in the same class?
e.g. my Person "setAge" example above?
That's what the guy on SO said. Looking for something official atm
because that would mean that the setter is limited to accepting values that are valid during constructing the object and cannot limit it further (e.g. not allowing a "younger than previous" age)
"I think your plugin is great! Now give me your skype id"
oh I really didnt understand the first part of the sentence lol
uhh
yeah I'm an idiot
but you get the flow of it
metadataPacket.getWatchableCollectionModifier().write(0, metadata.export()); // Exports and writes metadata into packet
I should add that it always uses the setter UNLESS it's during initialization
another example about "when copilot can be useful" ๐
oh ok
so you can add other values during class generation but not after that
but yeah, this is so many random things, I'd rather just use java and know what it does exactly ๐
alex you seem to really struggle
I can imagine your brain just going like
public, no wait, private, int? actually it's a character
yeah haha
like this?
EasyMetadataPacket packet = new EasyMetadataPacket(npcEntity);
packet.write(18, 3);
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
PacketContainer packet1 = manager.createPacket(PacketType.Play.Server.ENTITY_METADATA);
packet1.getIntegers().write(0, npcEntity.getEntityId());
packet1.getWatchableCollectionModifier().write(0,packet.export());
try {
manager.sendServerPacket(player, packet1);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
}```
i did-
I also still prefer java but I suppose that it would be the same when I changed perspective. I would probably prefer kotlin when I got 7 years of experience with kotlin and only 6 months in java
You get used to specialties of languages
how are playing card suits called again? I only remember the german names lmao
e.g. spades, heart, and... the other two?
wrap it with EntityPose
diamond, clover
thx
I struggle to remember sometimes because the only deck I got is a minecraft deck
packet.write(18, EnumWrappers.EntityPose.SWIMMING);?
that has gold bars, hearts, diamonds and shovels
yeah something like that
lol
You should probably rename some stuff
hm copilot claims it's called "clubs" ant not "clover"
then it's not entitypose grr
but anyway, both is a C and thats good enough lol
try passing null on the metadata constructor
java.lang.IllegalArgumentException: No serializer found for class com.comphenix.protocol.wrappers.EnumWrappers$EntityPose```
ahh
uhhh
pass the entitypose#getHandle
idfk
actually now that I think about it
you might need to add your own serializer for that
just add into the WriteData method
just copypaste but change the registry
I could've made it a lot better honestly lol
dawg what-
this stuff
that's just copypaste
add into it
for entity poses
nvm there's no entity pose serializer
sending the NMS packet would be so much easier
if i can get java to work :')
wdym?
I dont remember
I write many, many, many messages here every day ๐
or were you the person who used ANT instead of maven?
wait nvm it was from someone else
nop
wow wtf, some people really have a weird coding style lol
huh what happens if you run buildtools?
have you tried to install another JDK? E.g. switching from oracle JDK to Adopt-OpenJDK or whats it called again?
the messages from before
uh
yeah
hmmm
whomst
well I'd probably try to get rid of java completely, then reinstall it from scratch. I mean it sucks anyway if your java doesnt work properly, not only for not being to run buildtools
yeah well
if(v.isEmpty()) return true
why didnt they just return v.isEmpty()
Im asking whomst the hell
i did that
is writing such cursed code on this land
banger pfp
lol yeah
I've looked at their Solitaire repo
because idk I wanted to code some card game
I like how my github activity is just an indicator of how depressed I am
when I do many contributions, then my life is good. When I suddenly stop doing pull requests or commits, then Its because I got alcohol addicition problems again lol
yeah that
for real why did this dude code so weird
public Card popFirst()
{
if (!this.empty())
{
Card c = this.getFirst();
v.remove(0);
return c;
} else
return null;
}
why not just like this? lol
public Card popFirst() {
return !isEmpty() ? cards.remove(0) : null;
}
ugh how can I have "deprecated features" in my build.gradle.kts when I literally just created it with gradle init like 20 minutes ago
is there someone here who's good in reading bytecode? I have this very weird problem and have no clue why it happens
Did your code even compile? lol
yes sure ๐
the decompiled version also looks fine
no idea why it's crying about "Object cannot be an entity" since obviously I don't use any "Object" declaration :/ kinda weird
i don't even use Entity
what's weird is that line 115 tries to assign an EntityArmorStand to a variable that's defined as EntityAreaEffectCloud
but this error gets thrown even when I not call createHologram at all
I actually declare it as "entity" and not as AreaEffectCloud or whatever
probably I gotta message allatori support again ๐
damn I got it fixed
the best pretending programs are fueled by depression
Why would you return Object when creating a hologram?
because the returned object is an NMS entity
otherwise I couldnt declare it in the interface
I cannot make it return net.minecraft.....
Ok but createHologram is not exposed, is it?
it kinda is
HologramManager.createHologram returns an "object" which is the actual hologram, and that calls my NMSHandler's createHologram method, shown above
So the api user calls createHologram and gets an Object...
yeah well not exactly
they do new Hologram(...) and ofc get a hologram, but it also has a method like getNMSEntity() or similar, and that one returns the actual NMS entity
You have a Hologram interface which is returned to the api user.
my whole hologram code is pretty shit. I wrote that when I only started to learn about how to do maven modules etc
I think it's a leftover thing from before I started to use modules and yeah that's why it returns an Object
Ok weird... and it actually spawns entities and doesnt work through sending packets.
it's total shit ๐
it spawns NMS entities, yes, because IIRC I have to pass in an entity into the packet
At this point i would consider using BetterHolograms...
the ClientboundAddEntityPacket indeed needs an entity instance
Ah ok so they are not spawned. Nice.
yeah I'm actually not even using my own hologram API. I just wrote it because I once thought it might be useful but yeah
it's now part of JeffLib without anyone using it lol
XD
anyway, I got this weird "bad type on operand stack" thing fixed by telling allatori about the spigot dependency
adding those .jars to the classpath made allatori understand to not mess with this kind of things lol
I have added my dependency into a module of mine, with the shade plugin, but it for some reason isn't getting added to the final jar. I have done this 10 other times in the same way and it has worked... what could be the issue?
I'll share my POM
?paste
The dependency in question is the Commons one
there are no issues in the pom itself syntax-wise or dependency-wise
adding the compiled scope doesn't help
Are you using those classes?
yeah
How are you using them?
If you're using reflection your classes probably got minimized
In a variety of ways... But to sum it up, they're vital for any version of my plugin to work. They contain interfaces for command registration, they contain common GUI code, reflection in a few, they contain enums, etc etc
In my main file I use one that handles my commands
I don't use it everywhere, so that can't be it
Besides, it worked just fine in my other 10 versions
your problem is maybe minimizeJar
minimizeJar will get rid of everything you not explicitly access
I use filters to avoid this from happening
Are you using a custom nms mob?
Define explicitly access?
Oh I see
well lets assume you shade a Hologram class but you never access it in your code, then it won't get shaded
if you do new Hologram(...) once, then it knows that you access it
but since you probably don't wanna do stuff like that, filters are the way to go
e.g. my com.jeff_media.jefflib.internal.nms.... stuff is only accessed by reflection, so I just add a filter for this
remapped:
nms.Creature#getNavigation().setTarget(nmsPlayer, speed) iirc
Yeah that's fine, I use every every class inside there, directly or indirectly
So it shouldn't be an issue...
hm then maybe run maven with the -X flag and then check the log to see why it doesn't shade it
type deal
or, better:
try to set minimizeJar to false, and see if it works now
if it still doesn't work, the problem is something else
Then just add ai goals
you can add AI goals for targetting a player
but you still gotta use navigation to make it move
JeffLib also has a wrapper for goals so one could use them without any NMS, just wanted to mention ๐
so does my paper fork
it also wraps the navigation things
for sure
well paper has pathfinding API anyway
Atrocious...
whut
I mean mine has a wrapper for goals
you shouldnt check canUse in your tick method
not just pathfinders
tick() only runs when canUse() returns true anyway
the server will NEVER call your tick() method when canUse returns false
Nope, doesn't work without minimizeJar
Ehh, i'll figure it out tomorrow. It's 2AM now
well then show all your pom.xml files pls
too early
continue coding
still hateful
tick() only gets called if canUse() returns true
and it stalls operations for all other following pathfinder goals
internals look like something basic like
List<Goal> sortedByPriority = ...;
for(Goal goal : sortedByPriority) {
if(!goal.canTick())
continue;
goal.tick();
break;
}
probably with timings code on top and all
when you register a goal
it has a priority
that's just a sorted list based on priority
And as soon as a goal is available to be ticked the rest arent ticked anymore.
the registry stores it as a Set<WrappedGoal> where a WrappedGoal is just a Data Class (goal, priority)
I'm too mentally deranged to explain it with simple words
wasted like 3 hours coding a .yml -> imageboard parser
that caches images and stuff
yeah it just loops over all registered goals, sorted by priority, and then executes the first one that returns canUse() == true
it makes the mob move
you normally shouldnt call this yourself
moveTo basically sets a "destination" / "path" to the mob, and tick() checks every tick() whether there is any destination set, and if yes, it makes the entity move there
moveTo should better be called "setTargetDestination" or so
the server basically does this every tick:
for entity : all entities
if entity has destination set (using navigation.moveTo... )
make entity move towards destination
so it's pretty pointless to call tick() yourself
you set flags on the mob to influence him. It then checks those flags in its tick()
you try to make mobs move to the nearest player, right?
Or you just use ai goals and tell the mob to follow its target. Take a look at tameable animals and how they follow someone that has food.
normally,. to make mobs move to the neearest player, you'd just do something ilke this:
in canUse()
check if a player is nearby, if so get the nearest player. check if the mob is already "near enough" that player. if they ar enot near enough, return true
in start() (optional)
get the nearest player's location and save it somewhere
in tick()
check if there's already a target location saved, if so moveTo(there). Otherwise, get the nearest player again and moveTo() there
probably not the optimal solution but should work fine
e.g. this
public class MoveToPlayerGoal extends Goal {
private final Mob mob;
private Entity nearestPlayer;
public MoveToPlayerGoal(Mob mob) {
this.mob = mob;
}
@Override
public boolean canUse() {
nearestPlayer = mob.getLevel().getNearestPlayer(mob, 100);
return nearestPlayer != null;
}
@Override
public void tick() {
mob.getNavigation().moveTo(nearestPlayer, 1);
}
}
everything there is NMS
package com.jeff_media.test;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.ai.goal.Goal;
public class MoveToPlayerGoal extends Goal {
private final Mob mob;
private Entity nearestPlayer;
public MoveToPlayerGoal(Mob mob) {
this.mob = mob;
}
@Override
public boolean canUse() {
nearestPlayer = mob.getLevel().getNearestPlayer(mob, 100);
return nearestPlayer != null;
}
@Override
public void tick() {
mob.getNavigation().moveTo(nearestPlayer, 1);
}
}
full class with imports ^
yes
i think everything in minecraft is measured in "blocks"
wtf is this new?
I've never seen this "notification" thing before
not that new
it might be in meters alex
true but one block is one cubic meter, soooo
yeah
I somehow fucked up my whole stuff lol
i got like fucking 10 windows defender notifications today for some stupid reason lol
oh really lol
yes, that should work fine
it was yelling at a file I had and finally I just said remove it
if it breaks my pc idc
but @quaint mantle
you hardcoded 1 as speed now
1 is pretty slow for some mobs and pretty fast for others
I also have no idea
you wont find anything useful in the API I guess
I also looked for hours
you'd have to check in the NMS classes and see what speed values they use
Sometimes movement is applied as a percentage of the movement speed attribute.
So passing 1.1 sometimes makes the mob move at 110% speed.
I think villagers use 0.5 as speed
for normal stuff
wdym?
you have to remove the already existing goals to stop that, I guess
yeah that will remove all other goals and only make the mob do what you tell it to
np!
yeah the whole goal logic is extremely simple
it basically just runs the tick() method of the first goal that returns canUse() == true
true
if you got everything working, you can start to put some logic into the start() method to not do math everytime in tick()
well normally entities have more than one goal
e.g. usually, mobs will just "stroll around". But if they were attacked, they run away, so canUse() for the runAway goal is only true when they were hit within the last 2 seconds or so, etc. And then they will also have some kind of "go to player if they have wheat in their hand" goal, etc, bla bla
so yeah the canUse() thing makes sense
you mean, go away from you?
or stop "going to you" if they are already close?
you return false in canUse() if they are already within 3 blocks to nearest player
@Override
public boolean canUse() {
nearestPlayer = mob.getLevel().getNearestPlayer(mob, 100);
double distance = mob.distanceTo(nearestPlayer);
if(distance <= 3) return false;
return nearestPlayer != null;
}
oh ofc check whether nearestPlayer is null befoirehand
mfw not just returning distance > 3 && nearestPlayer != null
yeah
I just coded this as example
obviously it's not perfect ๐
@Override
public boolean canUse() {
nearestPlayer = mob.getLevel().getNearestPlayer(mob, 100);
double distance = nearestPlayer == null ? 0 : mob.distanceTo(nearestPlayer);
return distance > 3;
}
sth like this
oh yeah zombies etc will burn
but I dont know how to prevent this
You can just not make him burn in the sun... lol
Just overwrite the method which makes the zombie burn in the sun. I think there is also a property for that.
there's isSunBurnTick()
declared in the NMS Mob class
no idea if there's some better way but you could just override this and return false all the time
every months I wish that hetzner forgots to send the invoice but they never forget to do so D:
yeah, only your comment is wrong ๐
"Return true if the mob is within 16 blocks but not nearer than 3 blocks" lolz
but yeah, looks good
I just ctrl+B into the classes in intelliJ
ctrl+B shows the source
e.g. just write "Mob" somewhere, select it, then do Ctrl+B
then you have the source for the whole Mob class in IntelliJ
probably netbeans can do it doo
too*
oh that looks like the builtin decompiler is a bit shitty
the community edition is free and perfectly fine to use for 99.9% of things
it only lacks some special features like MySQL stuff
what
yeah I also didnt understand this sentence
that's not an IJ ultimate feature
this whole "tab thing for 2 projects" is a macOS feature
yea
on windows, neither IntelliJ CE nor ultimate can do it
on macOS, both CE and ultimate can do it
๐
I might buy a m1 macbook just because I want a decent laptop for coding
2013 mba ๐ช
still got a year of school left and my laptop got like 6 bit color and it's awful
AND THE BATTERY LIFETIME
it's so awesome
but there's no point in buying an M1 now
it's still good
either wait for the M2 to be released and buy an M2, or wait for the M2 to be released and buy the M1 for cheaper
I don't care about the battery life
but I'd like to tell the difference between the gray tones on intellij
it's going to be released this months or next month or so
so yeah don't buy an M1 now
yes, but the code I sent will set distance to 0 anyway if nearestPlayer is null
I don't think that's gonna work
specifically because
people don't update every year here
half the mfs I know are using their laptops from like 2014
the laptops on the school's cisco-certified computer lab are IBM thinkpads
thinkpads are quite expensive, arent they?
I was literally tasked with grabbing mediocre pcs, stripping parts and upgrading existing pcs
not if they're older than the students
true lmao
I hate this so much
just look at the attack code for zombies smh
THEN, get the distance
not the other way around
right now, nearestPlayer is always null
yeah that looks good
np
btw when something doesn't work - just add a ton of debug statements
@Override
public boolean canUse() {
// Return true if the mob is within 16 blocks but not nearer than 3 blocks
nearestPlayer = myMob.getLevel().getNearestPlayer(myMob, 16);
sout("Nearest Player: " + nearestPlayer);
double distance = nearestPlayer == null ? 0 : myMob.distanceTo(nearestPlayer);
sout("Distance: " + distance);
sout("Distance > 3: " + distance > 3);
return distance > 3;
}
imagine using debug msgs that make sense
(where sout is System.out.println(...))
lmao imagine
how do you do it? lol
this
add those debug statements
and check what it says
real chads throw IllegalStateExceptoin in such cases lol
the return null is supposed to worky as a feature
yeah
I don't want to force people to use trycatch everywhere