#help-development
1 messages Β· Page 207 of 1
I would go with a module design since maven allows modules π
and then you can make modules depend on each other if need be
yea that does indeed sound good
Yeah maven is so great, than you can have modules inside of modules inside of parent project
alright. thanks for the insight guys
Na dont worry mate
Epic once i finish the library i will send it to you
So you can have mor ideas
that would be great. thanks
I added you to remember
see, I have this plugin setup as modules to separate the implementation from the api
this allows me to compile just the API and lets developers who want to only depend on the API a smaller jar as well
and then when I compile the actual implementation it compiles the api and implementation, then shades the api in π
yea. makes perfect sense, thanks
feel free to use it as reference if need be, it is open source after all
I even make use of a plugin in maven to update my plugin.yml version numbers automatically too π
so I am not always cluttering my commits with just updating that file XD
can't you just use a variable in ur plugin.yml?
I have issues sometimes of maven not always picking it up
so I make use of a replacer plugin which comes in handy with other files
also the nifty part of modules the way I have it
if you have a dependency that is needed by multiple modules
just specify the dependency in the parent module
all the modules below the parent will be able to pick it up even though you didn't specify it in their pom
Hi, I can't build Spigot 1.8.8 using BuildTools because https://s3.amazonaws.com/Minecraft.Download/versions/1.8.8/minecraft_server.1.8.8.jar returns 403. Any idea on what's happening?
download from here
It's used by BuildTools to compile Spigot. (BuildTools is giving me an error about that)
Is there a way to query with a Java code who all has bought a plugin?
not through spigot, no
Is there any other way?
What?
i didnt understad what you were meaning
You want to verify who is using the plugin? Or want to generate then a code which allow using the plugin?
yikes my tutorial plugin is a lot more different to this one
I want to know the list of my PremiumPlugin buyers
Does anyone know how to check if a mob was spawned naturally (not by plugin or command)
iirc theres an EntitySpawnEvent you can listen to for when an entity spawns
not sure about just grabbing a random mob in the world an checking tho, you can store a meta data key on the entity tho so that you know it was spawned by something or natural
Thatβs what I need tho :/
i edited the msg re-read 2nd one sry
idk if theyre a method for this now a days, but this is what we did many years ago
Iβll do it that way then ig, thanks a lot
paper has a org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason();
iirc spigot has something similar
how can I check if a field's type is an array/list of an Object?
depends
but usually not possible to check the type passed to the type paremeter
as it gets erased
Hii guys, this is not exactly a problem I'm having, but rather something I'm trying to understand. I'm learning Java as I learn minecraft programming
@Override
public void onEnable() {
// Plugin startup logic
System.out.println("Starting my plugin!");
}
what is the "@Override"
I mean, what does this "@" do?
what is Its name in Java?
@ is for annotations
They're called annotations, and Override in particular is more or less a compiler hint that lets your IDE know to give you a warning if there's no parent method that matches its signature
@Override annotation says that method is from parent class and it is overriden
public interface MyInterface {
public void foo();
}
public class Example implements MyInterface {
@Override
public void foo() { } // This is fine
@Override
public void foo(String value) { } // This will give you an error
@Override
public void bar() { } // This will give you an error too
}```
you can code without annotations tho
nobody gonna hurt you if you remove @Override
that's more like a comment
for your level
It's a compiler hint, not a comment. For beginners especially you should be using it
It's difference between figuring out why onEnable() vs onenable() will and won't work
ooooh, I think I got It now!!
right now i'm doing this
if(!ItemStack.class.isAssignableFrom(field.getType())) continue;
and i need to do something similar for lists and arrays
Why will "bar" give you a warning? Because the parent class doesn't have the method "bar"?
Correct
yep basically, but it must be a list of ItemStacks
Generic types are non-existent at runtime so you can't exactly check for them
You kind of just have to assume
List<ItemStack> out = null;
if (obj instanceof List<?> list) {
if (list.isEmpty()) {
out = new ArrayList<>(0);
}
else if (list.get(0) instanceof ItemStack) {
out = (ItemStack>) list;
}
}
if (out == null) {
throw new IllegalArgumentException("obj must be a List<ItemStack>");
}
code i made a while ago
close enough right
lol
i don't have the actual object, I have the field tho
i guess i could read the field but that would slow down the code most likely
You can get the object from the field
That's really your only way of going about it
it will give error
and your code won't compile
you shouldnt be doing reflection every millisecond anyways
iirc
This is happening every second!?
oh, ok
at least in eclipse
No im just saying
it is not
if he has to worry about a small performance change in this case then its probably a design issue
FREE JAVA LESSONS
checkmybio
Just any compiler. Hence, "compiler hint" π
i am tryna intercept packets and modify ones that contain some specific itemstacks
I'd strongly advise the use of ProtocolLib
That's its whole purpose is catching and monitoring packets
It's not a huge burden either. It's practically an auto-install on most servers
i don't really see what would the benefits be compared to using nms
Multi-version compat (for the most part) and ease of use
i don't need multi version compatibility, i'm testing something for a private project of mine
and also i find nms easier to use when dealing with packets
i have used protocollib in the past but the experience was pretty bad, especially with more complex packets
even with wrappers, that were often not updated or wrong
You're bending over backwards to get the generic type of a field, but I mean y'know, sure. Easier
i meant in general, i've always found protocol lib pretty painful to work with
also i don't think protocollib has a way to listen for any packet and check if the packet has an itemstack, itemstack array or itemstack list field
Guys, I have a question that is gonna sound silly, but here we go
when I create a project, where exactly the "main" method is?
I mean
every program in Java must have a "main" method, right?
hmmm, I see, but like
I only see one class in my project
and It doesnt have a "main"
When you start .jar program, JVM basically goes to your main() method
yes, that makes sense
but still, I can compile my plugin even if I don't see a main method
show your project structure
ooh
Bukkit goes to your plugin .jar
looks for plugin.yml
in plugin yml should be your main class which extends JavaPlugin
and well Bukkit loads this class
runs it's onEnable() and there you go
ooooh, thats amazing
so Its like the program takes my changes and use it in the game files
like, I'm not exactly writing an executable program, but rather something to be used π€
yes
I see... :O
or Paper.jar
it's loading classes and resources from your jar
and using as it wants to
idk never coded mods
ooh, ok ok
i guess they are working same way tho
oh :O
I see
and other stuff
thats great
and here is the link to Craftbukkit's main() method
thanks
Hey, does anybody here program minecraft mods, as well? I want to know If It's similar to programming plugins or way harder
because I'm kind of interested in It as well :o
Slightly more difficult because you have to understand sidedness
That and Minecraft's resource structure
Definitely doable, but Bukkit plugins are far more approachable than Forge or Fabric mods
ooooh, I see
I want to understand Minecraft's resource structure very badly, hehe, so that may be fun!!
I'll try to learn more about spigot and bukkit, going along with my java learning before I do that tho
also while working on spigot plugins you only work on the server, when modding you also work on the client
You'll definitely want a stronger grasp of Java before approaching mods
but It will me amazing for me to learn how the game I love since a child works
a lot more options but more stuff to learn
ah, ok!
oh, ok
If you have a strong understanding of language concepts then you should be fine for the most part, but you really want that foundation first
I see
even looking at nms is a fun way to understand how does a simplistic game like minecraft work and also how complex its structure is
but as choco said, you need to have a good knowledge of java
one of the problems I have as a beginner coder, is that I feel like I already now a lot about the very basic stuff, conditions, basic OOP, loops, data structures, etc. But if you asked me to make a GUI for something, I wouldn't know how to π what do you think is necessary for me to learn so I can have sufficient knowledge in the foundations of java (or programming, in general)? Sorry, I'm kind of lost in my journey, right now
I see :o
this sounds more like a lack of knowlegde of spigot's api
you can easily find guides on that
anyways you can create an inventory and then open it to a player
then to make stuff clickable you need to listen for click events
one of the first things i'd learn if i were you is how to create commands and listeners
oooh, thanks, but I was referring to Java in general, not only spigot, like GUI interfaces for simple programs (not minecraft related). I was trying to show that I lack skills in java, even though I know the basics
ooooh, interesting
I see, that makes sense
I can actually create plugins, but sometimes I don't understand why something works, just that It works and I know how to do it π€
if that makes sense
oh
so swing and such you meany
XD ok ok
that's also pretty easy, bro code has a very well made java course covering that
do you mean you don't know what do the methods you call do in the backend?
Yes, exactly
reading nms classes can answer those questions
it has its downsides
oh, I see
Interesting, thanks
life stopped being fun
i actually have even more fun now that i know how to mess with mc's code
Just one more thing. How does a listener work? I mean, I know It makes so the game detects events and when they happen, the method in my program executes, but how does It know that event happened in the first place. Do the main minecraft program runs a while loop checking for every event, or something?
nms classes are modified to include event calls when a certain action happens
i'll send you an example gimme a sec
The event processing code just loops through all RegisteredListeners (listener wrapper that is made when you register listeners)
this is a piece of a method called when a player starts to mine a block
or skeleton horses :)
CraftEventFactory is an utils class to call some events more easily
^ That being said, not all events go through CraftEventFactory
I feel like I'm learning a lot with you guys, thank you
this code is inside PlayerInteractManager that holds most of the methods handling player interactions (mining, clicking and so on)
I see
yep, i should've specified some
are you guys usually here? I'm going to have a lot of trouble learning in this journey haha
after a while you just learn what class does what
ServerGamePacketListenerImpl contains most of the packet listening and processing code
i chat here sometimes, yes
nice
I'm quite active here
depends if i'm in the phase where i code often
awesome
like rn
And I believe we're from the same country just seeing your bio
so timezones shouldn't be an issue
Really???
i alternate between gregtech modpacks and developing
Haha, awesome
I alternate between having depressive episodes and coding
oooh, man, sorry to hear that :(
I have depression as well. Not saying Its the same pain, of course, but I can understand how painful It is
I hope you get better
nobody deserves to be depressed
It doesn't bother me
here you can see an example where CraftEventFactory is not used to call the event
sorry to hear that
Life goes on
Do you guys have any book recomendations for java, or programming in general?
I really like to learn using books
CraftEventFactory is a pretty massive class
Uhh
I wouldn't say books are the best for teaching programming
neither are schools
i haven't read any tbf
ah, I see
I'm reading a book about java right now and It's helping me a lot to understand the foundations
ooooh
because they teach you about the basic functionalities of the language rather than the code quality and oop principles themselves
I see
Awesome :)
nop
high school / vocational type deal
i hope i'll learn something
school aint teaching me shit
php
i havent coded much outside java
In my college class I started learning python
be prepared to have a 29:1 anime addict to girl ratio
and scratch when i was younger lol
never watched anime
I originally did C# bots for flash games when I was... like 6?
congratulations you're part of the group of like 3 people that will hate their classmates
apes together strong
lol
make sure you have either the shittiest thinkpad or a baller gamer laptop
right now i have a PC
yeah good luck
2 years is a long way to go still
not sure if i should be excited or not
doesn't even have 8 bit color
lol
should arrive thursday
let's hope I won't regret not paying 500β¬ more for the 4k option over 2k
hahaha, amazing!!!
this reminds me so much of the banner exploit on hypixel skyblock
I hope I can become good like that, so I can mess around and have some fun too
yeah about that
this is a mess
i'm still working on registering custom items
I'm still happy I managed to make a multithreaded floodfill algorithm to process abstract shapes
and i'm tryna edit all item packets to a valid item so the client doesn't commit suicide
shit has a mad compression ratio too
Mans just said random words here
not sure what is that
managed to convert about 360k blocks into 10k objects
but i'll act like i understood
basically a way to store just the orange blocks efficiently
with a contains method
You mean like a HashSet? ;p
This is Java
360k objects
You get all the memory you want
sure but like

I managed to lower it to about 7k objects
and been thinking of a new algorithm to compress it to ~800-1000 objects
I also gotta read all the blocks and match the type
all I have is a single Location
So, another silly question π but I have this simple event I'm handling, and I have a few doubts
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Bukkit.broadcastMessage("Welcome, " + event.getPlayer().getName() + " to the server!! :)");
}
First, what is the @EventHandler annotation for? Does It like, give me a warning if I try to implement a method that is not an event?
Is It like "@Override", but only for event methods?
@EventHandler is an annotation that indicates that the given method receives events
I see
The parsing algorithm just goes like
for(Method method : clazz.getMethodsAnnotatedBy(EventHandler.class)) {
...
}
type deal
It's basically a way for Bukkit to identify a listener, that's all
Otherwise it would have to just assume that all methods are listeners
one tiny inconsistency that pisses me off
Which may or may not be the case
override doesn't exist at runtime, it's there only for the developer to know the method overrides a method
and now that choco is here this is probably gonna be dealt with
is that on bukkit you can make eventhandlers private
because bukkit calls method.setAccessible(true)
+1
but bungee doesn't
It doesn't? lol
eventhandler is used instead to identify the method as a listener
nice, thanks
it throws a fuckin accessibility error
Well that's mildly annoying. I'd assume that it would
I'd rather them be private >:((
Another question I have, so that method called "broadcast", from the Bukkit class, what does It do? Does It send a message to every player on the server?
is that the same as making a for each loop containing every player and sending each one individually a message?
does the client know by itself what armor is it wearing or do you need to send it a packet to modify it? Right now i have a pickaxe on my head slot and it doesn't render there
oh nevermind 1.8 just doesn't render items on ur head
fuck it, github works nicely
no need to run buildtools
Ok, now last question, for real: Do you guys have any Java course I can follow? Udemy/youtube, doesnt matter, just looking for recomendations, hehe
Jetbrains academy works fine
me
also google Java coding roadmap
choose any random one
and go google each topic from the roadmap
Didn't know you had one
Anyone know how you do custom colors in hover text in the text component?
Im using a legacy formatting
and I assume that I can't without changing, but I don't know how to change it
Yeah, you need to use components for that
Im using text components but the HoverEvent accepts only a constructer with the Action and if its the HoverEvent.Action.SHOW_TEXT, then a new Text(String input)
said text input when given a custom color doesnt actually use it, shown in the photo
You can't use legacy colour codes when using components. It's just bound for breakages
If you're making use of components, you'll need to use the ComponentBuilder to construct components more easily with colour
BaseComponent[] message = new ComponentBuilder()
.append("Hello").color(ChatColor.GOLD) // net.md_5 package, not org.bukkit.ChatColor
.append(" world").color(ChatColor.GRAY)
.create(); // Can't remember if it's create() or build(). One of the two```
I saw that but if i do the HoverEvent and I use the constructer using the ComponentBuilder it tells me its deprecated
Shouldn't be. Just have to wrap the builder with a Text instance
new Text(new ComponentBuilder()/* blah */.create())
It colours that component, yeah
Think of .append() like the start of a new component
Anything following it will affect that component. Any .append() calls after that will be a new child component, which inherits the format and events of its parent component. Unless you supply a FormatRetention to state otherwise
The example above for instance, if I hadn't specified the colour to use for "world", it would have inherited the gold colour because it's a child of the "Hello" component
explain
why can't you do this in java
if ((int i = obj.getMyInt()) == 1) {}```
but can do this(pattern matching)
if (obj.getMyPlayer() instanceof Player player) {}
is there any language where first construction is available
the second one is relatively new to be fair
but the top line only saves 1 line of code so its not a massive deal
Hey Guys, Is there an event for player's minecraft nickname change?
no
Hmm
that woudl take a relog anyway
yeah i know pattern matching is new
but since MC jumped from java 8 straight to java 16
not a big deal
So When I save the data of player should I save with player displayname too?
same does second one
oh thanks
like i see that you can do this:
int i;
if (i = obj.getMyInt() == 1) {}
why not just combine into 1 statement
like bruh
well i guess the difference is you already have the variable as the given type
whereas the instanceof one you dont have it
but yeah java has heaps of things they should add
you can cast it manually
in if statement
or if it's already same type just ignore
or just use var
if (i = obj.getMyInt() == 1) {}```
doesn't look very 'java-ie' tbh
var i
or int i = (int)...
i mean it's the only reason
why we have ==
just cuz we can assign value inside the if statement
the only reason languages have ==
is because you can use = in if statement
where it's gonna assign value to the pre-declared variable
boolean a = number1 == number2;
vs
bolean a = number 1 = number2;
second just doesnt make sense
yes
boolean a = (number1 = number2) == 2;```
both assigned and compared
in one line
so just as i said
the only reason languages need ==
thats a completely different scenario
is because = is also used in statements
== is used as a comparator, not only because = couldve been used
it's not could've been
it already took it's place
if language doesn't support = for assigning values IN A STATEMENT
language woudln't need ==
cuz well, = would be a comparator
that just isnt true lol
let's discuss then lol
this example disproves that
π
how would you do this
boolean a = number1 == number2;
in a language that doesnt have comparators
its a statement
how else woudl you do assignment then?
it's an assignment statement
it's declaration + initialization, which takes statement in it
i mean
because by java's official definition thats an assignment statement
so the expression
yeah i get where you're coming from now
we just had differing definitions
you are correct
my english kills me second time
But I think syntactically speaking that would go against javaβs conventions
pattern matching doesnt
Never seen a language that uses = for both
basically cuz every language supports assignment inside the expression
even c
Couldnt you just do new Human.Head()
no
you can also do
Human h = new Human();
Head head = h.new Head();
π
syntax weirdness
what about
() ->
i1 ->
(i1, i2) ->
is (i1) -> even possible
hey guys, How to set NPC's skin? I found the class NPC So I tried to spawn it like ```java
org.bukkit.entity.NPC npc = (org.bukkit.entity.NPC) player.getWorld().spawnEntity(player.getLocation(), EntityType.VILLAGER);
@quaint mantle you can't cast a villager to a NPC
Oh
you'll need to use the api of citizens @quaint mantle
or cast it to Villager instead
Hmm
if that's what you wanna achieve
How do I fix this problem?
[HELP please]
I'm trying to save blockdata to config and get blockdata from config and place it.
You can do BlockData#getAsString() but how do you get blockdata from string? (From BlockData#getAsString())
You look at the Github I sent you. and you can criticize or not
Hi I want to code a quest plugin. But I don't know exactly how to implement an architecture. Can anyone share their thoughts on this subject?
What do you mean by architechture?
I need help
so im trying to make it so that pvp damage is increased by 15% but it isnt really working, im making it display damage in the console and regardless if i have the plugin or not its still the same. Can someone please help me?
the damage output logger works but not the damage multiplier
i tested it on a zombie and i lost 1.5 hearts per hit with and without the plugin
the damage it outputed was 2.785
if this is just for pvp. you might wanna switch to EntityDamageByEntityEvent and just use this https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.html#setDamage(double)
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent
aight
but do u have any idea why it doesnt work?
Tell me how to make the plugin check with the player when entering the game whether a certain mod for the game is installed
You will need to listen to the information packets that the client sends
wiki vg should have the Forge format documented. Not sure how fabric sends the data
You should be aware that this can be easily spoofed
Hey, I'm trying to setup my Eclipse to make my first plugin, but I'm having trouble adding spigot to my libraries, I'm doing it the same as tutorials I've seen but for some reason the library is like, empty or something? It's really weird and I don't know what to do next
Most people use intellij so you'll need to wait till someone who knows eclipse comes online
I mean I can probably switch to Intellij too if that speeds things along, I just want to start learning really, not too invested in what IDE I'm using to do that
Depends on the build system you use. Does your tutorial use maven or gradle ?
It hasn't covered that, so I assume Eclipse handles it itself?
you might want to look for a different tutorial then o.O
a build system like maven or gradle is a pretty essential part of developing a plugin
you'll either have a pom.xml or a build.gradle.kts file
what tutorial are you using?
Hey guys this is a video on How to setup Eclipse for Spigot/Bukkit Plugin Coding!
Soon I will be making a lot of videos showing how Dream, George, etc.. have made their challenge plugins that they have used in their videos, so stay tuned!
I see it's 2 years old, probably out of date
Oh god reading π
i wonder what its like for the people that dont use minecraft development making a project
Easy
I mean Uml diagram
I'll have a look at that tutorial, thanks!
I cant prepare the uml diagram of the project
Ah this is very handy, I'll bookmark it because I always forget things like this π
@eternal oxide Do you have an idea
@sick ermine
Ah nvm
So you just want to know where to put your code so it's structured neatly?
Or do you actually want to draw an UML Diagram
I'm having trouble thinking of code structure
exactly this
how do u detect the new location of the dragon egg if u left click it and it teleports?
hmm when i delete the world files for the overworld, does that world still have the same uuid as before?
The region files you mean ?
the files within those folders
looks like the newly generated world gets a new uuid when i delete those files
how can I decompile modify and recompile a jar file using intellij?
wondering what i should do then when some player has a home in a world that doesnt exist anymore
?
declaration: package: org.bukkit.event.block, class: BlockFromToEvent
oh tysm
Make one global variable for quests and store each custom quest objech there
then you can control them
getBlock is the from block?
hey! i want to teleport 2 players to different locations without teleporting to them same location. im kinda stupid rn so yea xd
so what is the problem with that
When the server is enabled, it will create quest instances from the file. But that's not the point. It looks like I need the Requirement class, I couldn't decide how to implement it.
oh, i see i didnt explain it,
basically i have a list that contains some locations, and i want to teleport 2 to the locations, problem is sometimes it happens that both of the players get teleported to the same location.
check if its the same and if so pick the next one?
when you loop through the players to teleport simply add the chosen location to a list
then on the next iteration check if its in the list
if it is. its already picked
IntelliJ is probably the best for spigot/bukkit plugins
personal choice
if I have a private organisation repository on GitHub and I want a way for people to make push requests how would I do it without making new branches?
oh I forgot you can make clones of private repositories
objective choice
I used both
IntelliJ is superior if you have the specs
otherwise eclipse
(You can improve Eclipse autocompletion manually if that's your prob)
I disagree. I've used both. I prefer Eclipse, unless it's a multi dev project
Got Eclipse to work, but it says I made a legacy plugin, will try Intellij to see if that works better
biased much?
Netbeans is probably on par with it π
just set api-version in the plugin.yml
Used netbeans a bit as well
My ranking is
IntelliJ
Eclipse
Notepad
Netbeans
Mostly due to tab completion
otherwise eclipse is just better
Oh I did have like 3 warnings yeah and that was one of them
like good tab completion
and extendable
Mine is Eclipse, Netbeans, Intelij
it is good
For Java anyway
Well all those IDE's are primarily for java anyways
Hmm how would I do this actually
I was going off Eclipse for it's poor implementation of multi project support, but that was improved a while back
api-version: 1.19
Ah alright
or whatever minimum version you want to support, back as far as 1.13
just put 1.17
Yeah that fixed it
I dont think so
In my opinion i think that using 3rd party sites for selling is really limiting
Because you cannot obfuscate, implement your own metrics tracking, neither buyers, etc
I mean its like Spigot is okay in terms of simplicity but if expect more it would be best to use your own site and apis
@trail basin dont know if it is possible
Is there any way to send a click packet before canceling an open gui packet?
I'll just paste it here, doesn't seem possible but maybe I understand it wrong
Like preventing a gui from closing?
I think I'm misunderstanding it
Livid why do you want to do that?
I was wondering if you could change items in chest without having gui open
just use the tile entity lol
you dont need to use a gui to edit the contents of a chest
WHY!!!!
wdym?
just do it in-line π‘
no lol
lol
this visualizes it better
haha that thing cause me anxiatiy
exactly
Well any gui but I wanted to start with chest
i know what u mean but....
?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.
Okay im the weird bro which dont like using lot of lines of code
@hybrid spoke
thats just one of the things requested
wdym?
I dont imagine myself coding without Streams
Lines donβt matter as much as character count ;)
Please describe what exactly is not working, what you expect it to do, and what actually happens.
it doesnt point to the location that i set... and it should point there
the crafting and everything else works tho
well it should set the target not to every single compass...
just that one
thats why i used lodestonemeta
ahh
?
anyone ever had the problem that files could not be dragged into intellij anymore?
so can u help me?
No
Atleast ultimate allow it
can any 1 plz help??
ok
I dont think u will want to reinstall it but that is the only option i can see now
also have a drag&drop view in one of my projects and if i start it with intellij, i cant drop anything in there xD
switched now to EAP and installing the update
maybe that fixes it
if not i will continue in text editor
how i reload Maven service?
what exactly do you mean?
lookin horrible
I need to reload it cuz it not finding/resolving any remote dependency when the repos and everything are setup correctly
mvn clean install -U
if (conditon) return;
isnt smth like has nexus restart but for maven?
Any idea why mongo shity logger is ignoring me?
Its like he doesnt care im stoping the info and warning loggings
fun thing about me working on a db is that it breaks every time i change smth
Haha i having some issues with haha, but with mongo for some reason it not even adding anything into db
should learn mongo too
ik that i need to learn more about mongo
i dont have much relation based stuff so might be useful
Hmn could be spigot task not working correctly on 1.19?
Because the async task im running thru PlayerJoinEvent is not executed cuz nothing is inserted into db
Hi, am I stupid?
I am trying to add a cooldown to an event, which works fine but not when I try to format the cooldown.
I use System.currentTimeMillis().
to set the Cooldown I have a hashmap public HashMap<UUID, Long> cooldown = new HashMap<UUID, Long>();
In the hashmap I add the cd period: this.cooldown.put(player.getUniqueId(), System.currentTimeMillis() + 86400000);
So far so good, then I want to display the time left on the cooldown. which i do by:
SimpleDateFormat style = new SimpleDateFormat("HH:mm:ss");
Date date = new Date(remainingTime);
player.sendMessage(style.format(date) + " remaining"); ```
This does work, except it doesn't display the correct time.... 68.400.000 should be a day, but when I run the command it outputs: `00:59:59`. this should be `23:59:59` right?
Am I missing something?
Hey so I was looking through and was wondering if anyone has an idea to do add any item to an armor stand head slot without commands, aka by right clicking on the armor stand with the item
ok its not a data corruption issue lol
What's causing my server to ping slow?
my code fucking up
Sometimes it's not really serious π
LMAo java is always trolling me
I dont know
I only code
Hi so my ip adress was banned from spigot and I don't know why
?support
ah thanks
alr
Either support or a staff members
ok
Your welcome my mate
Java Its fucking amazing because its telling me that smth is null, when in first checking
if (smth == null) stm create it; do actions with smth; // gives null
LMAO
π
SIGSEGV (0xb) at pc=0x00007fc4f4650830, pid=4951, tid=30564
I mean java is really idiot
Calling attention
Current thread (0x00007fc4842b6040): JavaThread "Craft Scheduler Thread - 2605 - CapeEsle" [_thread_in_Java, id=30564, stack(0x00007fc28d0fd000,0x00007fc28d1fe000)]
Stack: [0x00007fc28d0fd000,0x00007fc28d1fe000], sp=0x00007fc28d1fa590, free space=1013k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x691830] forte_fill_call_trace_given_top(JavaThread*, ASGCT_CallTrace*, int, frame)+0x180
V [libjvm.so+0x69215c] AsyncGetCallTrace+0x1dc
C [spark-103b6c5fb1675-libasyncProfiler.so.tmp+0x16619] Profiler::getJavaTraceAsync(void*, ASGCT_CallFrame*, int, StackContext*)+0xe9
C [spark-103b6c5fb1675-libasyncProfiler.so.tmp+0x3138f] Profiler::recordSample(void*, unsigned long long, int, Event*)+0x27f
C [spark-103b6c5fb1675-libasyncProfiler.so.tmp+0x31a74] PerfEvents::signalHandler(int, siginfo*, void*)+0x74
C [libpthread.so.0+0x12730]
v ~StubRoutines::call_stub
C 0x0000000000000002
what the heck are u doing?
lets not print threaddumps ig
today my server crashed due to an error that i have never encountered before due to my plugin
that is a sever error
Not caused by plugins
Does anyone understand this hs-error log?
I think its generally happens when sever crashes
Current thread (0x00007fc4842b6040): JavaThread "Craft Scheduler Thread - 2605 - CapeEsle" [_thread_in_Java, id=30564, stack(0x00007fc28d0fd000,0x00007fc28d1fe000)]
Stop spamming please
if the jvm crashes i dont think your plugin can do much about that
CapeEsle is my plugin
JVM!!
now, how can i fix this
That a problem with the JVM which have crashed
any idea what code would be causing this?
How are you so sure
if this is the first time you have this just ignore it
I think it is from jvm, but the name of the thread where my plugin is running is written so I doubted it
yep first time
What does your plugin do?
Does your plugin run smth asychonisly thru bukkit main thread?
yes, async has to work as my plugin is linked to discord
Can u send your code?
I thinking you are running something async thru bukkit main thread
if so, wouldn't the spigot fail?
that is lots of code
i'm not sure which code is giving an error
whats that supposed to mean π€
Probably just "are you blocking main thread with expensive operations"
sure but i can't give all code
whats mean
imagine crashing the jvm thro heavy operations
only thing i achieved with computing large things on mainthread was all threads throwing an outofmem
jvm is so cute and so delicate
JVM is actually pretty durable. Try C
sounds like someone who has no gf
yeah so durable'
Yeah well if you write code so bad it crashes it then that says more about you than java
I wish you knew the reason for the collapse, u would talk like that
me doing hacky stuff again, lets just implement a proper deleteHome method ig
Do you have the code somewhere for me to see? Or a full paste of the error
purpur kekw
How would i summon a pig with a saddle?
Man
That's a very hilarious error. Are they running it with a bunch of experimental args or something
@vocal cloud got an idea of how to obfuscate forge mods
Yes, don't.
No, the server is constantly happening with +100 people.
So it's an issue on your end?
the server is getting this error first time
looks more like a jvm bug
I don't know if the problem is in jvm or my plugin
Cause that's an issue with java itself. So either you're doing something you shouldn't or they are using a weird version of java
i wanted for the java version of the server i'm waiting
thx for helping
Are they using openjdk?
idk i asked
tyty
Lol I just realized that the paste has the args and it's a kilometer of junk. Try running the server using the exact args they have. They also appear to be using java 17 oracle so as long as you have that try that too.
any particular reason you are giving it 18G?
This is from their client
Is there actually a plugin that simplifies the coding of inventories? For example, that you design an inventory in the game and then it is covendiert to Java code and it is then in a txt of the code to see? I hope I have explained this in a reasonably understandable way.. :9
also any particular reason you have told it to not sharememory via command line?
the client doesn't default 18G
Client as in person he's working for
ok well the question still stands then
I recommend removing all the extra arguments as they are doing more harm then good
re-organize them to be proper
reduce the ram to about 10GB and no more then that unless you have a specific reason for assigning more
yes i didn't realize i was surprised to see xd
18G so strange
u can code
Try copy pasting their args with native oracle jdk
so there is none yet?
i will tell him
the problem is that GC is trying to collect from both sides of the heap but both sides of the heap are blocking the GC
I guess
which is not a surprise given the arguments used on the command line
this is what happens when you mis-configure the GC arguments π
and why you need a profiler to know how some of those should be tuned
So what happened, is eden space filled up, but so did the survivor space
gc started on eden, but then it needed to take care of survivor and so forth until the JVM decided it must be locked and was like welp lets kill this
he using java17
not sure why that would matter
That is my synopsis of what happened without digging further into the binary stuff
the easy fix is to replace the arguments with the appropriate ones from aikar's flags
and set the memory to no more then 10G π
Oracle java 17. It says everything on the log. The arguments are what's causing the issues as frosty is saying
Also if you're causing this issue your plugin might be using too much memory
that is also possible to, but I mean with the current arguments it really wouldn't take much for that to happen
generating some chunks would have set it off eventually lmao
eden space is where new objects and stuff go, survivor space is where the new objects that haven't died off go
I have many clients and this is the first time I have met this error.
generate enough new surviving objects and it would cause that to happen with the current configuration
My point is that the only reason your plugin crashes it is because you reached that memory threshold. Either your plugin uses more memory than is reasonable or you got unlucky and your plugin pushed the unstable server over the edge
basically this ^
Either you make your plugin more memory efficient or they fix their args
I think both should be done π
Indeed
Hi, i've some troubles trying to add a git into eclipse, i dont know how to import spigot.jar x')
can someone help ? thx
i have a folder containing the git with eclipse projects files (only .yml and .java)
My client is saying 'when setup your plugin after night server got the crash and server's latency was increasing by 200 300 ms from time to time.
Again, either your code is garbage or the args are causing instability
Mhm. Tell them to fix the args
i told
hmm ?
?maven
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Isn't git integrated into eclipse like intellij?
I don't know, I do recall there being a git plugin for eclipse of sorts
Another reason to not use eclipse I suppose
have no idea if they have finally integrated it or still require that. In either case eclipse has their own custom thing with git and maven lol
how do i get a block from block name like grass_block
Using the material?
ty
You can parse a material using a string unless that's changed
That's what I thought
import
In port. You need to plug in your git cable
lmao
Yep but i'm new so :/
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.
these should help with some java learning while you are at it
Important to learn about the ide you use. Too many people mess up their intellij config and complain about it later
not to java, to spigot and theses kind of stuff x')
I prefer VS but its doesnt support java, so i went to eclipse
it does support java
VS supports almost every language on the planet
Or rather VSC
VS is awful bloated garbage
I have visual studio pro 2019 and 2015 π
Why
because it is the best in terms of compiling natives and creating natives as well
also I gain access to the MSI package stuff
MSI is super awesome and one of the best compression utilities if you know how to use it, Microsoft ironically doesn't know how
you can if properly tweaked compress 1GB down to like 200mb sometimes lmao
VS doesnt support the import with pom.xml, like eclipse until now x')
VS or VSCode
VS is basically VSCode but like with way more options and utilities then you would ever need out of the box
VS on its own if you install everything, takes up like 100GB
VS
Ugh
they probably didn't install everything π
huh x')
there is only 2 things i didnt download on vs
when im checking for a custom armor piece using getHelmet(), do i use .equals() or what?
my dad just farted and the room sells radioactive help
Anyone there to analyze this?
is it safe?
A user with 4 repos and 98 stars on it with a proton mail. Idk
what do you need to check for?
if an itemstack equals another?
ye
kinda
if(player.getInventory().getHelmet().getItemMeta() == Crown.getItemMeta()){
runningTasks.put(player, new TrailsTask(8, 0.5, 1));
}```
isSimilar
No, isSimilar will check the meta for you
mhm
ok thx
Hello.
what does this mean?
src/main/me/lucasgithuber/kingdoms/listeners/TrailsTask.java:[36,57] double cannot be dereferenced
Location particleLoc = player.getEyeHeight().add(x, y, z);
getEyeLocation() not EyeHeight()
When you have that type of doughts you can use the javadocs. That why they are for
For checking what classes, methods, fields, parameters, etc has a class
ok

