#help-development
1 messages · Page 1208 of 1
it is fixed basically for all versions
the initial hotfix was editing a config file
the true fix was later updating the log4j version I believe
He used client with exploit on
Truly "don't try this at home" moment
all the nms entity tutorials are outdated too (╯°□°)╯︵ ┻━┻
Then why exists plugins for fix it
Just work at mojang for latest info 🗿
Nah. I'm trying to do NMS stuff w/ 1.20+ lol
I'm using mojang mapped 😎
Everything's 1.11 or below KEK
How it if you say this was fixed
Start fix version is..??
in 1.18 you could change the config file to enable the exploit
also, that tweet is years old
1.12?
public static final EntityTypes<EntityZombie> ZOMBIE = register("zombie", EntityTypes.Builder.of(EntityZombie::new, EnumCreatureType.MONSTER).sized(0.6F, 1.95F).eyeHeight(1.74F).passengerAttachments(2.0125F).ridingOffset(-0.7F).clientTrackingRange(8));
Mobs are registered like this nowdays, rendering everything useless.
Can't directly call register either 😐
Should've used "enabled" instead of "on"
Lool
This exists in SETTINGS
yes, that was done for all versions
no custom command either
scammed
@tender shard get yo ass in here.
Guide for registering custom NMS entities for 1.20+ pls
everything's outdated lmao
I want see nms API
Plugin nms API))
I don't think that makes any sense
I can use it in plugins?
that's just the spigot-api
Why
NMS API is literally the spigot api lol
I think there are some projects that allow that
But don't...
unless you mean using NMS directly, which is also possible (but stupid usually)
But not allowed all
Ngl api covers 90% of use cases
Yea, but I want isSunSensitive D:
and the ability to spawn hostile mobs during the day D:
Where 10℅
just give mobs an item as hat to prevent them from burning durng day
and recreate mob spawning algo smh
No thanks. I try to do things w/ pure vanilla specifically so I'm not recreating stuff
I want create "custom" entity
just use a dapatack zzz
Lol
AnimatedJava ftw!
datapack's not an option for what I'm wanting to do, at least not without making it more difficult for devs and server owners
I remembered doing rust in minecraft and there were so many datapacks there
For inventity, items
This crazy
"how can I do X?"
"with a datapack"
"no"
ok :D
I think 60-70℅
Because I'd be mixing code and datapacks. That's too messy
I disagree
It would be convenient if the client would load datapack without the possibility to choose when going to the server
Invisible loading
Or just kick
If not want
I disagree with your disagreeing because it means server owners have to modify both a plugin config and datapack, or everything has to be rewritten to work within a datapack.
I'd prefer just doing everything w/ full code since that's what is already happening
Large enough datapacks are already a bitch and a half just to modify as well
Question. How hard is it to register a fake player to the server ?
Like he will real player
That already happens partially
not everything can be sent to the client tho (like functions or worldgen) 'cause they need server-sided context
stuff like tags or enchantments do get sent to client
cool
The library I'm using is also code only w/ 0 datapack support too 🙂
assuming you only need to enable mobs spawning during day
can you not use reflection to change the light level setting of a dimension definition ?
Depends on how it's setup 🤔
Nvm, it's a record, not even reflection can touch that
public static boolean checkMonsterSpawnRules(EntityTypes<? extends EntityMonster> entitytypes, WorldAccess worldaccess, EntitySpawnReason entityspawnreason, BlockPosition blockposition, RandomSource randomsource) {
return worldaccess.getDifficulty() != EnumDifficulty.PEACEFUL && (EntitySpawnReason.ignoresLightRequirements(entityspawnreason) || isDarkEnoughToSpawn(worldaccess, blockposition, randomsource)) && checkMobSpawnRules(entitytypes, worldaccess, entityspawnreason, blockposition, randomsource);
}
There's ignoresLightRequirements. Can't set that though 😐
oh that's just a TRIAL_SPAWNER check lmfao
clients don't need to install data packs
actually I have a dumb idea on how I can do this. Question's are
- How big's the compiled jar gonna be and
- will this even fucking work
?tas
time to do that thing
ok now I'm really curious to see what you're cooking
stg if this works
Knowing my luck, probably not?
But if I can make it work for other things that'll be nice lol
Compiled. Will it run and work properly though 🤔
Oh the suspense
gonna be waiting. I don't have a non-remapped 1.21.4 jar to test with lol
over an MB though. Gonna have to hope the libraries plugin yml option will save this lmfao
loaded
no errors
will it do the thing
(probably not, but we can hope)
oh :O
answer: no
I wonder why 🤔
Damn, sadge
And I wonder what the frick you cooked 🤔
okay might know why, if this doesn't work I can't do exactly what I want D:
No, purely because of the way mapping works KEK
I'd have to add the mapped server jar to maven & figure everything out that way which isn't necessarily bad just annoying
Trying to figure stuff out cause there's nothing in the spigot api & I can't override methods and shit D:
I don't think i can do what i want (yet), but I have some ideas on ways I can use this lol
What do you want to do
Well for NMS a few things.
Allowing hostile mob spawns during the day (unless there's a way to do this with base spigot) & isSunSensitive
but I've moved to more cursed code
Mmm yeah I can’t think of an easy way to do that
Other than rewriting the mob spawn system
isSunSensitive is a EntityMonster thing
it just returns true lol
Not sure how the first would be allowed though 🤔
I know there's a method to check if hostile mobs can spawn, not sure on a clean way to impl overriding
hi can you open site ip bans?
my virtual server got banned
no he cannot
no
oh
If this new cursed code works.. then i'm gonna be during a looot of cursed shit lol
stop breaking stuff optic
No
ASM!
If I can make this work it'll both be cursed, but clean things up kinda lol
ignite!
but I think the mapping system is gonna fuck it alll up lmfao
Might be forced to work w/ the obf'd jars rip
I just want to do cursed shit D:
I DID A THING
lmfao that could actually work, but I'm doing something else
if i set PlayerDeathEvent message to 'null' does it print an empty line or nothing at all?
?tas But it is @Nullable so I assume it will work like that.
yes
it does nothing
kty
also can i just say i hate this? it would be much better if it didnt exist and people would say nothing or just answer the bloody question :/
i mean if people don't know
yeah i love getting flooded with "i don't know" answers, idk why people don't do that more often
why do we exist just to suffer
most likely anthrophrotic principle or however you spell it
Hi, maybe someone here has expirence with that kind of logic with InvUi library. What I am trying to do? I have a normal gui with an VirtualInventory as an ingredient, where players can put and take items, I want to "synchronize" it - I mean when two players are watching this gui and someone put items the second player will also see it. I would be really gratefull for any kind of help.
Here is my code: (I am new using this library)
public void openInventory(Player player, AssortmentChest assortmentChest) {
Gui.Builder<Gui, Gui.Builder.Normal> guiNormalBuilder = this.getGui(assortmentChest);
Gui gui = guiNormalBuilder.build();
int usedWeight = assortmentChest.getUsedWeight();
int weightCapacity = assortmentChest.getWeightCapacity();
Window window = Window.single()
.setViewer(player)
.setGui(gui)
.setTitle("Skrzynia " + usedWeight + "/" + weightCapacity + "kg")
.build();
window.open();
}
Maybe you could store the Window object, and whenever player wants to access it, just get the object and do Window#open(Player)?
From what I can see that everytime that method is called you're creating a new inventory, so it's a different inventory essentially.
good idea, I will test it out
it doesn't work, I need to close gui before opening again and its still not working
Ah, maybe it's best to ask on their discord support server.
I'm not really familiar with InvUI
they are not answering 😦
Why do you need to close the gui before opening it again?
because it is throwing an error that the windows is already opened
@young knoll Praise be libraries
why dont you use compact packages
library requires that specific package structure lol
bb
im talking about the ide feature to turn it into 1 folder marked as org.bukkit.craftbukkit.v1_21_R3
oh. I like it this like so that empty packages aren't a bitch
Netbeans default 😇
Ah md, do we have a way to randomize mobs on spawn within spigot?
e.g. cats, sheep, etc?
Not sure, I thought at least at one point they just did
hmm
lemme double check
@sullen marlin Same code as spawn eggs?
Cause for sheep I'm seeing only White, Gray, Black, and Brown
gonna check w/ spigot api, but I have a feeling it might be the same lol
What other colours do sheep spawn?
Aside from like a 0.0001% chance for pink, if that still exists
That's something you have to do yourself, there's no natural green sheep in mc
for pure vanilla, these
Yea, doing this for Ageable, Axolotl (For the blue color), Cats (Non-vanilla spawning), Sheep (All colors), Mooshroom, and Foxes
Might have to double check those last 2 using vanilla spawning
Praise be randomization
Threw this stuff under extensions, just so I can CraftCat#randomize and somewhat clean up code lol
Hoping I can do the same w/ abstract classes & abstract methods, then I don't have to cast all over the damn place lmfao
Car
if (mob instanceof Ageable) {
CraftAgeable ageable = (CraftAgeable) mob;
ageable.randomize();
}
if (type == EntityType.AXOLOTL) {
CraftAxolotl axolotl = (CraftAxolotl) mob;
axolotl.randomize();
return;
}
if (type == EntityType.CAT) {
// FIXME: Can't use an extension for this one, otherwise compilation breaks
Cat cat = (Cat) mob;
randomizeCat(cat);
return;
}
if (type == EntityType.MOOSHROOM) {
MushroomCow cow = (MushroomCow) mob;
randomizeMushroomCow(cow);
return;
}
if (type == EntityType.FOX) {
Fox fox = (Fox) mob;
randomizeFox(fox);
return;
}
if (type == EntityType.SHEEP) {
Sheep sheep = (Sheep) mob;
randomizeSheep(sheep);
return;
}
Haven't fully ported it, but this is the current mess lol
Did something similar w/ jockeys too, albeit not fully supported yet
what is an extension
cursed code
Adds new methods to classes
e.g. this adds a CraftAxolotl#randomize method to the code
so mixins but worse
Actually, I'd say better. You're not having to do super annoying annotation stuff just to add a new method or something
if we're going for worse though, let me present the jockey code:
if (isJockey && entity.isValidJockeyMob()) {
entity.convertIntoJockey();
}
interface injection is not annoying at all
2 annotation, no PITA annotations like fabric
just needs a specific dir structure
i feel like that would also be like 2 annotations with fabric
possibly only 1
u would just need to cast, if anything
Wouldn't have to cast in my case if I knew how to modify abstract classes (if even possible D:) (╯°□°)╯︵ ┻━┻
i mean ```java
interface Randomizable {
void apply();
}
@Mixin(CraftAxolotl.class)
class CraftAxolotlMixin implements Randomizable {
@Override
void apply() { ... }
}
Entity entity = ...
if (entity instanceof Randomizable randomizable) {
randomizable.apply();
}
that ain't a PITA
Registering's different for fabric as well https://wiki.fabricmc.net/tutorial:mixin_registration
Where you'd have to manually add everything, the above code is 100% automatically
sure you're gonna need to add two lines to a json file
which your ide has a literal button for
he doesnt use intellij like a normal person though
cause IJ sucks
what do u have against intellij :(
dude netbeans is NOT better
actual brainrot
hates mixins/fabric
he hates anything that isn't his 2014 spigot netbeans
1 window/project, tf kinda design is that?
I hate it
you are aware they have a workspaces plugin right
Install a plugin just for functionality in an IDE I'm already using?
you do realize how dumb that sounds, right?
but his workflow
yea, annoying as hell having to alt-tab
then install a plugin
it's not that deep
ooor just use an IDE I've been using for 5+ years with the functionality built in?
there are modern replacements
None that interest me enough to switch, install a plugin, and re-learn everything
is installing a plugin really that hard to you
i mean
Hard? No.
Pointless? Yea, pretty much
in his defense it would also mean installing a whole different IDE
are you saying netbeans does not have an ij plugin
and learning an entirely new IDE..... just to replace one single feature that's already buit-in in an IDE I've used for almost 6 years now
Shortcuts, UI, etc, etc
like eclipse but shiter
I don't need an IDE to look nice lmfao
you preferably want a tool you're gonna be staring at for 10 hours a day to not look like absolute dog shit
same reason I don't switch to linux for the customization options.
Idc about them lmfao
but maybe that's just me
u dont switch to linux becos ur a plain jane
Switched NB to a dark theme & called it a day
i dont switch to linux because i cant play Fortnite
we are not the same
(im worse)
stg I could see rad switching to the newest JS library which dies a week later just because it's newer
that would imply I use JS in the first place
and what makes you think that
just because i don't use an ide that's stuck in 2014?
And you're assuming I require or need a modern IDE. I don't lmao
when did I say that
still looks bad
Yea, exactly. It's good enough
eclipse actually i take it back
Idc about looks but it's better than eclipse lmfao
i haven't used eclipse in like 5 years
those icons are like Massive
compared to IJ or Eclipse
im all for visibility but like
Fuck
need muh 10000 icons
ngl didn't even notice
wait untill you find out i use the old intellij ui
i am aware of that
if it dont look like this ion want it
mmmmmm old ui
If I do use IJ, it'll be because I'm paid lmfao
not buildtools!
it was the first project i pressed radical steven
the old UI isn't that bad tbh
i just really don't like the file location thing whatever at the top but you can remove all the
it's now way smaller and at the bottom
too much for my poor eyes to handle
the new ui is also fat i feel
covers too much of my code i cant process it properly
Yea, I don't look at NB's UI that often either.
I just remembered the import keybinds & what not
Also, wait until rad learns I use sublime text for literally anything that isn't java
hi, for some reason i cant cast a block (that i checked the material of to be an ACTIVATOR_RAIL) to a Rails class to check the isOnSlope() method... please help (version 1.12.2 plz dont bully me)
how do you not look at your ides ui
I look at the code, duh
Forgot to say; there is no ActivatorRail class
the actual important bit of an IDE
that's still part of the ui
Use it for C++ and Python currently lol
switched from notepad++ two or so years ago lol
i use nano 🗿
needed better highlighting and NP++ didn't have a plugin kek
I make money by coding, not using an IDE
do you make money
guys can someone help instead of yapping about ides?
I have premium resources and bought my PC from it (and like <$20 in donations), so I'd hope so
Praise be good highlighting
got like... 20-ish different colors. Makes going through logs infinitely easier
u gotta check with the BlockData
also got $0.56 pending on modrinth atm
so
or well cast the BlockData to Rail i think
(I'm probably not gonna update that lmfao)
oh so its not the Block itself?
nope
oh thats why, thank you so much
same goes for items
u check with the ItemMeta rather than the Item/ItemStack? itself
I cant cast this though
Rails rails = (Rails) railBlock.getType().getData();
railBlock is a Block btw
@buoyant viper
no, im on 1.12
thats the tricky thing
try uh
Rails rails = (Rails) railBlock.getBlockState().getData()
alternatively: update ur server and plugin to latest mc
ok this seems to work let me try
Rails rails = (Rails) railBlock.getState().getData();
yay it worked
oh yeah
thanks youre the best fr
np
is it possible to obtain a chunksnapshot of how a chunk would have generated for any version (current or previous)
Hi, I’m looking for Minecraft developers primarily for long-term cooperation, but there’s also room for someone looking for a one-off project. I’m working on an ambitious and unique project where you can create something extraordinary and gain a valuable addition to your portfolio. I’m looking for people who can write mods for Fabric and have basic knowledge of Spigot. Would anyone be interested?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Really? you require 20 posts to create the thread in section hiring dev
Yeah that's faster solution thanks for advise
No. You would only be able to get a snapshot of how it would generate with the version you are using. Some of the previous versions have fewer block types, lack of data, and then occasionally the world generation code has been altered itself thus making it impossible to know how it would generate in a prior version.
This is why the seed you use in a previous version can generate an entirely different world in an updated version
Lmao well i am not sure if they were referring to void worlds
Well true
is there any way to make intellij stfu about missing controller value at the top level for JavaFX FXML?
its annoying af
as im loading those dynamically
due to how javafx is nasty and does allow you to fetch by id predictibly
and i need to set dependency injection via constructor
but controllers expect to have no arg constructor in order to construct them implicitly via reflections
so im left with unpredicatable lookup() method that allows you to select elements, but it depends on the css and layout results of the notation, so it may be unpredictable depending on the element you've used to fetch it, since you're relying on internal implementation output
or these errors which actually not errors since i do setController() at the runtime
or i can do setter injection, but that's even more nastier
for gods sake is there any good UI framework in java that doesnt suck
like really
Here's a tip: Don't use java
Doesn't exist
not java but kotlin: compose!
interoperability with Java 🤩
Imagine trying to use compose functions in java 💀
hehe
does anyone know how to set custom nbt to an itemstack in new 1.21
Hey! Wanted to ask, does the spigotmc site has any API or way to update a plugin from a CI ?
just trying to automate the process of deploying a plugin
no, also spigotmc is for releases not continuous builds
Alright thanks! Yeah I was only thinking about releases
just point download to external jenkins Ci pipeline
Hello I uploaded my plugin on spigot but it doesnt look right, how do i update it's description?
edit
Cant find that option anywhere
bottom of the page I believe
Nope, nothing there
And where is that, all i see is report
you are not logged in then
I am, i literally just posted it xd
you have to have 2fa enabled to upload/edit
Just enabled it and yeah still nothing
T-T
is there a different url for that or where am i going wrong
nope, its just on the plugin page
Yeah its def not there
has teh plugin been approved yet? Not sure if that has an effect
I believe it does, to prevent spam/trojans
Alright i guess imma wait then?
Its just the images i inserted are mis aligned. gottta fix that T-T
Ah yeah, it just appeared xd
ty
May take up to an hour to process the permission change if you just enabled it
FYI it would've told you at the top of the page this is something you needed to do
who the hell in javafx dev team decided to make XML based format for GUI's but decide not to add proper id fetching support
what if i want to attach controllers dynamically
instead of using their @FXML annotations
that's a bad design if you ask me
the fact that JavaFX doesnt have DOM api equivalent of document.getElementById() is just... what?
closest to this is lookup("#id"), but then you have implementation specific css selectors, like who the hell decided that this is a good idea
Is there a way to check interact event every tick (20times a second) ?
Schedular
any other ways (if you mean calling a 4tick long schedule every 4 ticks(not actually checking if he is still interacting))
But why?
Do you know how Spigot works?? Why do youu need to check an event?? Events fire themselves???
wellll yesss
i may not know.
let me re-phrase. How do you check if player is inputing RMB every tick?
you can't
you get one event on first click, then you get a new event if they hold it down to repeat
datapacks better?
i remember people did that with datapacks💀
If you can do it with datapacks then thats your only way
crazy that there s no actual way still
API does not provide any method to check
nah, im good, had enough of that shit
made me in-sane
well, there is no packet sent for a key up so the server can;t know when you release
it only knows on press/repeat
blocking is not teh same as a key press
its a toggle
so a packet is sent to block and release
every tick you can check if he is .isblocking()
optimised?no
works
yes
yess
datapacks are good to extend the way people can configure your plugins
like I can just say my plugin has terrain generation, butif you load your own datapack in there with custom generation then my plugin can yoink the gen settings and use that instead
thats free customization
then can't you use that logic to imitate what he's trying to do
depends what he is trying to do
he asked if he coudl check if a key is pressed each tick and the short answer is no
not unless an event is triggered by toggling the key
well, it's up when it's not being pressed/repeated
he actually asked about checking interact event each tick, so no as he's talking about mouse clicks
🤷
ic
with mouse clicks there is no signal for stop pressing
if i generate a chunk does it get loaded? if yes does it lazy load the eight surrounding chunks and generate them?
C:\WINDOWS\system32>"C:\Program Files\Java\jdk-23\bin\java.exe" -Xms512M -jar "C:\Program Files\NMS\1.21\BuildTools.exe" --nogui --remapped --output-dir "C:\Program Files\NMS\1.21"
[--nogui, --remapped, --output-dir, C:\Program Files\NMS\1.21]
Loading BuildTools version: git-BuildTools-f901b6f-188 (#188)
Java Version: Java 23
Current Path: C:\Windows\System32
*** Could not find PortableGit installation, downloading. ***
Starting download of https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.1/PortableGit-2.45.2-64-bit.7z.exe
Downloaded file: PortableGit-2.45.2-64-bit\PortableGit-2.45.2-64-bit.7z.exe with hash: 851a15074dea6b272785b2a2a4697a72970256de2afe7b8e4a9c5e168c27ccdd
Extracting downloaded git install
Exception in thread "main" java.lang.RuntimeException: Error running command, return status !=0: [C:\WINDOWS\system32\cmd.exe, /D, /C, C:\WINDOWS\system32\PortableGit-2.45.2-64-bit\PortableGit-2.45.2-64-bit.7z.exe, -y, -gm2, -nr]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:1042)
at org.spigotmc.builder.Builder.runProcess(Builder.java:967)
at org.spigotmc.builder.Builder.startBuilder(Builder.java:212)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
I'm confused onto whats happening
running a buildtools.exe through java?
yeah, and the simple fix was to run as administrator
thought my uac already handled it but apparently not
Hey, deployed api and depend on it in a third party plugin but somehow [16:34:55] [Server thread/ERROR]: [skytester] Plugin skytester v1.0.0 has failed to register events for class me.albusthepenguin.skytester.Sky because me/albusthepenguin/api/events/SkylineSendPlayerEvent does not exist. in the multi module project I can do it across modules but unsure why I can't use third party plugin to do so ? what am I missing. it's the correct path.
(yes I depend)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>me.albusthepenguin</groupId>
<artifactId>Skyline</artifactId>
<version>2.1.5</version>
<relativePath>../pom.xml</relativePath> <!-- Adjust path if necessary -->
</parent>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Maven Repository</name>
<url>https://maven.pkg.github.com/AlbusThePenguin/Skyline</url>
</repository>
</distributionManagement>
<packaging>jar</packaging>
<artifactId>skylineapi</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>```
Make sure that class is present at runtime
how do one do that?
some1 in the mood th help me find my memory leak in my src lol
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
take a heap dump and find what object is leaking?
i got told thats not possible

you can do it from looking at the src, having a heapdump tell you whats leaking makes it easier to figure out where its coming from
/spark heapdump
you can create a heapdump with spark, https://spark.lucko.me/docs/Command-Usage#spark-heapdump
if you're storing block states or similar that'd be why
im calling its a location or a player
and now?
lol on brawls we had 200000 vec3/blockpos in a heapsummary before
oh so just a few
like 2000 is normal for vanilla I think
use something like MAT or visual vm to open the heapdump
The Eclipse Foundation provides our global community of individuals and organizations with a mature, scalable, and business-friendly environment for open source …
They do get copied a ton
So not that surprising
does that work with intellj too?
wdym does that work with intellij
open heapdump sorry xD
intellij is an ide not a heap dump analysis too
oh ok my provider is down rn i install visualvm and read it then
you don't need eclipse to use MAT
i hope it says which plugin
I cant read that lol
try mat, and did you actually make it cause the mem leak
just creating a heapdump after a server is started wont help very much
also at what do i have to look at? instaces of size classes by numbers or classes by size of instances
how bad of a leak is it that you cant get a dump?
spark has a memory dump command that will crash / slow down the server but gather all data you need to identify the leak
even a simple heapsummary might be enough to find the leak
if its too bad
but i cant predict the memory leak server crash
idk when it crashes thats what i mean
Why are you so certain its a memory leak? Do you actually run out of memory?
as nothing you have said so far actually indicates a memory leak
um
you get a stacktrace when it crashes? as an out of memory does generate a stack trace
how i get that?
the jvm will throw an error
the game server console will show the jvm error
you are on a hosted panel or something?
novacloud@ryzen01~ Server marked as offline...
[Novacloud Deamon]: ---------- Detected server process in a crashed state! ----------
[Novacloud Deamon]: Exit code: 137
[Novacloud Deamon]: Out of memory: true
thats what i get
how much ram does this thing have?
Deamon
kekw
14gb
is the mc server allocated all 14gb?
unlikely you are using 14gb
how often does it crash?
every 9 hours
damn, thats a HUGE leak. It shoudl be simple to find
I think the issue is GC and because GC needs ram to do its thing it dies
a huge leak??
elgarL pls help me if its easy to find XD
i am trying to find it for 3 days

doubt they are using JVM arguments for allocations above 10GB
if you have 14gb and you assigned it ALL to the jvm you will run out of memory
?flags
Aikar's garbage collection flags: https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/
i can show u the startup
java -Xms128M -Xmx14336M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -XX:+HeapDumpOnOutOfMemoryError -jar server.jar
and it still runs out of memory with that
do not assign ALL memory to the jvm
i sadly cant change that
why?
its not editable
shitty host I assume
yeah
a host not allowing you to do that is bad
very bad
possibly not
IF that max memory is ALL the systems memory then GC may never trigger
GC does trigger I see memory spike from 10gb to 5gb and then back to 10gb
they are probably using docker which is fine
ok, then just run spark at 1 hour and again at 5 hours
docker ram allocation isn't done the same way as jvm allocation
see what has increased by a LOT
u mean a spark heapdump? or how its called idk
what plugins are you running and are any of them you made?
yes 4 selfmade
i am pretty sure they are corrupted
i cant code i used chatgpt ... xD
that....explains a lot
is source public?
I can give the src
how moch you wanna bet they're storing some kind of block state or player reference
i dont store that
bound ot be be some map leak yep
this is what I said a while back, watch it be a list storing player objects and never releasing them
not sure why you call it corrupted
corrupted implies they don't work, clearly they are working
frost I said it before you
since u guys dare to bet on my src error i just post my src XD
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
see something there?
its main and other class
those instances only exist when a their online or alive respectively
but u said never release
once they log out or die the server doesnt need that instance and you dont remove that reference to it
when they log out and comer back its a NEW Player. they will not match their old ones
use the leave event and remove them from the list when they left
this ensures the list is kept cleared of old objects
but there is probably a lot of other stuff that is wrong too
looks like he does remove in the quit event
yes, so its unlikely to be that plugin causing issues
can i send u the other plugin too?
yes
thank you
i think thats okay
Wait
thats the outdated code..
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
sorry
if u guys could tell me what i have to look at i can look for myself :D
huh which plugin now
the last one you sent
ah yeah
You don;t listen to the quit event to remove teh Player from the Set in the bed plugin
you shouldn't be storing players in the first place
So what does that mean? i dont know what that means i told u its ai XD
if the player quits while they are in a bed they will forever be in the Set
Ohhh if they get knocked out of bed
if they log out/disconnect
i need a player quit event?
yes
and then bedenter delete player?
BedEnter.remove(event.getPlayer())?
yes, for teh quit event
Okay thank you, give me pls a sec
Though to be a serious memory leak you would have to have a lot of players quit while sleeping
i have a few other plugins which have the leak i guess
but first i need to find out how i add it cuz bedenter is red CANNT RESOLVE SYMBOL BEDENTER
fixed it now mb
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
what about this one?
No Collections so no leak, unless you are mass jailing and the config grows to a massive size
sure
thanks
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
No leak
I don;t do dms
oh no
the english-german mix is messing with my brain
don't feel bad
everyone here has produced some atrocious code at some point
sure thats fine, but we are not going to sit here and just make fun of you either lol
it would have to be the other plugins you are using, but I thought we identified one already?
yes but it was a small one
i guess
there aint many pleayers who leave while sleeping
on my server
Probably no leak, unless you are respawning multiple Displays in that last plugin
Do as I said, run spark profiler at 1 hour and 5 hours. Note differences in object sizes
I will
but for example
even if i find it how can i tell why and where it caused the problem?
the profiler will tell you
okay thank you
it will guide you to which plugin is causing it
you are using skript?
quite possible javascript taking up all your resources
Skript = Javascript? huh now i am confused
its based off it
is it the plugin itself? or skripts which i coded?
not sure, I didn't look at anything since ElgarL was
he is pretty decent developer so if he doesn't notice anything glarring probably true then
i mean the skript plugin itself
Who can help with item display rotation?🙏
what specifically about it
What's your current code?
i did the last spark 2 hours ago is it time to make a new one?
yes a couple of hours shoudl be fine, if you are running out of memory in 9 hours
its 2gb big how can i show it to u=
Is it possible to download the Spigot plugin?
or how can i see the difference and show u
spark sdhould give you a link
Try right rotation, that will be after the translation
So u dont want the spark heapdump
Same
where can I ask?
Can you send me a new code?
Hello, I am trying to connect my plugin to grafana loki to publish every log from minecraft console. but Bukkit.getLogger returns the logger for my plugin and not for the whole server, what should I do in order to listen to every log?
Basically, I want to track every log which I see in minecraft console, not sure how to do that, log4f seems to be a little confusing
Bukkit.getLogger is the server log, Plugin.getLogger is the plugin log
Maybe just don't translate?
I don't know any other methods, this is the second time I'm using item display
You can just move the entity, no need to translate
Do you the creator spigot know the easiest method for some1 who dont know shit how to find a memory leak?
ingame with a plugin like spark
Is it the valid way to do that? Passed logger is Bukkit.getLogger(), although it doesn't seem to catch any log at all, is the level messed up? Also, if I make a handler for server's logger, should I also make one for my plugin or it's already included?
Are you actually using spigot and not some fork
paper..
Even worse, purpur
Thank you, next
DAMN WHAT
😭
i am sorry
some1 mad cuz paper better 😿
?whereami
hi, how can I check what is the amount of item what player puts in inventory
here is my code now, but event.getCursor().getAmount() is returning the amount that player is holding on cursor. I need to check if someone take someting or put, if put how many he put.
@EventHandler(priority = EventPriority.MONITOR)
void onInventoryClick(InventoryClickEvent event) {
InventoryHolder holder = event.getInventory().getHolder();
if (!(holder instanceof AssortmentChestViewHolder chestHolder) || !(event.getWhoClicked() instanceof Player player)) {
return;
}
ItemStack currentItem = event.getCurrentItem();
int slot = event.getSlot();
AssortmentChest assortmentChest = chestHolder.getAssortmentChest();
Bukkit.broadcastMessage("cursror: " + event.getCursor().getType());
if (currentItem == null) {
ItemWeight itemWeight = this.itemWeightProvider.getItemWeight(event.getCursor());
player.sendMessage("put");
player.sendMessage(event.getCursor().getAmount() + " ");
assortmentChest.addContent(slot, itemWeight);
chestHolder.updateTitle(assortmentChest);
chestHolder.action(event);
return;
}
Material currentItemType = currentItem.getType();
if (currentItemType != Material.AIR && event.getCursor().getType() == Material.AIR) {
player.sendMessage("Take");
assortmentChest.removeContent(slot);
}
chestHolder.updateTitle(assortmentChest);
chestHolder.action(event);
}
maybe my logic is wrong and there is simpler way to do that
is there any gradle plugin like paper's paperweight.userdev, but for spigot?
Any good developer here? Who have free time for plugins dev?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
one of my plugins relies on nms and i would like the ci to be able to build the .jar
Thx bro
or you can just put all your nms in a maven repo behind credentials
CI can do anything you can do
?nms iirc this guide says something about gradle anyway
hm?
it is just that i wanted something easy like a compileOnly(spigot1.20.4)
looks like this suits my needs, thanks
InventoryHolders on spigot? No you better not. You're doing a deep copy on Tile Entities take a different approach
?gui
okay, but the event will be the same, how can I get the real amount? and how can I detect if player is putting or taking
what is the end goal?
hey i tried to see if, when the player interact with an item PlayerInteractEvent, it's an eatable item so i use
player.getInventory().getItemInMainHand().getItemMeta().hasFood()
any idea why it don't work?
why do you need to know how much they take or put?
I need to detect if player is putting something to inventory or take someting. If putting I need the exact amount of the putter item
yes but why?
for my other stuff around this
that doesn't really clarify anything
there is a reason I am asking because it dictates how you could go about it
to calculate "item weight" in a slot
the real question is, how soon do you really need to know about it?
I made system that some items has their weight
and I need to calculate the waight in a slot, so I need to know what is an amount of put item
whether an item can be consumed or not is controlled by the consumable data component which spigot has no api for
its little weird 😅
ok, on inventory open of the chest get a snapshot of it
on close, compare it with your snapshot
to do what?
to update lore with item weight
idk what this item weight is for or does
its not vital
ok if its not vital why must it be done while the chest is opened?
to update lore, and calculate this weight. Its not vital to understand what item weight is.
I just need to check if player put or take items and what is the amount of put item
with InventoryClickEvent
you don't need click event for this
so instead of on close, when chest opens run a task that checks the inventory of the chest when it was opened to what it is now when checked
so get a snapshot
can I get the effect with InventorDragEvent?
yes but that isn't reliable since that is thrown when simply moving an item not necessarily placing it
anyways, its easy to compare snapshots of inventories for changes
if no change, don't do anything
if change detected, check the slots
odds are the item without lore isn't going to stack with one that has lore
so that means realistically would have to check only the empty slots but idk your specific setup etc
i will try thanks
i propose new law in java clean code
if you cant name your variables under one single word
your implementation is too big
Im making a AI questing plugin. Shits huge
for me personally this seems to be the case like 80% of the time
well yeah but consider
player
playerName
that's acceptable
Its actually pretty decent atm. Heavy constraints and context needed though
or ig playerId
at this point you shouldnt store playerName, playerId if you have player instance
ai isn't that great at it tbf
yes, but I don't want to repeat getUniqueId in 17 places
just name it name or id
what if I have two players
as long as the name fits within the 80 character limit its fine xd
do you suggest id1 or id2?? 😭
Its basically open world with endless quest lines with the help of quest generation and context from ai
yes
Im not coding in AI lol
what about
victimId
killerId
could be also
Ill pleasently surprise you when its released
but i would prefer references instead in this case
if you need to reference both playerNames, its usually a binary operation algorithm so it should be under separate utility method
what if I just need to run a check and pass them somewhere else?
example?
I can't type codeblocks rn but checking player ids and passing them to say a map
like checkSomethingA checkSomethingB map.put
I just store them in a variable because it looks nicer
putIfAbsent
computeIfAbsent
methods
i guess
i just noticed that for my cases where i have two word variables it implies that algorithm could be simplified into smaller parts
they don't do the same thing though?
well yeah
unless you need critical performance that calling a method slows it down, you should already split stuff up
looking at you, python
inlining 4 method calls saved 10s off a 14s runtime
yeah makes sense
the main rule is me is that variable name shouldnt repeat the same information that type name already does provide
you shouldnt name UserInformationService variable to userInformationService, imho you should name it like users or information or just service, and the type would implicitly tell you more information about details (if you name service you can lookup to to the type to see what kind of service it is for example, or if you name it information you can lookup to the type that it returns you user information)
if you have collisions for a name, it implies to me that either:
**a. **you name variable data wrong in that particular context where variable is being used;
**b. **your algorithm is too big and need to be splitted
how can i make buildtools ignore the java version?
what?!
that seems very pointless
you will definitely not have only 1 service
userService at least
nobody will understand that, calling it only service
users is alright tho
UserInformationService userInformationService = new UserInformationService()
but that might imply that its a List or Cache, not a database client wrapper thing
that's why you just strip all the vowels, srNfrmtnSrvc
peak C naming
or do shit like userI9nS5e
oh ye i remember ncurses, mvwaddch
absolute bullshit
why leave the a in there at that point
naming it service would imply that class holds only one service class, i agree that it wouldnt make sense if class holds multiple services to name it under service name
what's the point of naming it the same as the type
shouldnt type tell you the exact details
if you have UserController class, then calling the infoservice only service might be feasable
you should name your variables according to the context
noone wants to look at the types all the time
i name my user information service user information service because it's a service for information about users
👍👍👍👍👍
IDE's exist in 2024
hover over every second variable in intellij to see the type or press ctrl + B to see the declaration. seems very good!! yeye totally recommend 💯
i dont want type information, i want function information
im not gonna call it ClassUserInformationService that is actually pointless
type name implies the functionality
typename is not visible always tho
java is a strictly typed language, its not as if its javascript where type information is hidden
still possibly not on your screen
ye when typing but not when reading
https://i.imgur.com/U7btLwH.png i want you to tell me what type CLIENT is or rather what it does
it depends on the context of the class
its not as if the fragment is verbose enough to define its functionality
class is enum Platform
even if you name it with functional type name
youre calling your buttons login...
so what is val?
is login a method? login(username, password), is it a constant localized string or is it a BUTTON?! WHAAAT
because its part of the method context in another context it could be called something else
if your context is a class named Screen then its not straightforward
again it depends on the context, if its a different context i would name it something else that suites the context, in this case there's no graphics related fields so its reasonable to call it like this
you dont call motorcycle just cycle just cause in the context of a road it might imply that it has a motor
or washing machine "machine"
pointless
thats a different thing, those are different words with different meanings
your examples are equal to that if you wanted to compare to generics lol
i would actually because washing machne is a machine, if i want to know which kind of machine it is, i look at the type.
login and login button is also very very different
looking at the type is just another additional extremely pointless type
not in Java
why?
because the type isn't going to magically change
not calling a button soething something button just because why not seems very pointless to me
someone reading a codebase for the first time doesnt know what the type originally was, and the type is indeed irrelevant like class interface or what not
types have to be declared
ye you dont always see the declaration
not sure how you wouldn't?
50 lines up on your screen???
...
I can see like 200 on a screen
hover over it?
but you spend more time embedding the same type information over and over in variable names than just to check once when you use an IDE
i can only see 50
ctrl+click it?
anyways, IDE's today do a good job telling you where the declarations are at 😛
...
calling an integer just "variable" because people can just click on it to see that its an integer is the most pointless thing ive ever heard
in my opinion, embedding type information is variables clutters your code for no reason, and it makes it less readable, since those variable names tend to be quite long, and usually you can know what variable actually does just by looking at the context where variable is being declared. so there's no need to embed such information and repeat yourself, instead calling it something short helps readability.
or just where it is being used
if I see an equation I know the types have to be of the number family
i dont understand why the method still has button in it tho
the return type already tells you what it returns 🤷♀️
public static LoginScene create(final Stage stage, final UserInformationService service) {
final InputTextField username = new InputTextField();
final InputPasswordField password = new InputPasswordField();
final InputButton register = LoginScene.createRegisterButton();
final InputButton login = LoginScene.createLoginButton();
final LoginScene scene = LoginScene.instanciateLoginScene(username, password, register, login);
login.setOnAction(new LoginNavigationActionHandler(stage, scene, service, username, password));
register.setOnAction(new NavigationActionHandler(stage, RegisterScene.create(stage, service, scene)));
return scene;
}
here's the whole method.
why is it so quiet suddenly
i dont see it how its not clear from the context what login is inside the method
LoginScene is quite clear and the method name even more so
yeah the method name is alright
LoginScene so we are dealing with UI elements, and its creating them
this tho
and this LoginScene.instanciateLoginScene youre not being very consequent with this idiom
type tells you what login refers to, it implies that InputButton is implicit, non-existant LogicInputButton type, but since there's no need for separate class implementation in this context it refers to as login
that is a static method, to get a LoginScene object
also known as lazy loading
yeah i know that it creates a LoginScene object because its in the LoginScene class
just call it LoginScene.instanciate if you wanna stay true to that concept
and LoginScene.createLogin
good idea
i agree on this one
well I don't know the class structure so its quite possible there is other objects that could be instantiated in it?
cause one might guess that createLogin probably might eventually return a button cause its in a Scene context
and that person can look it up in intellij
makes it good to read 💯
if there's other object instanciated, its a sign that your implementation has too much responsibility
my point was instanciateLoginScene makes sense if that class had other methods for instantiating objects. Therefore we know we are instantiating the LoginScene from that class
public static LoginScene create(final Stage stage, final UserInformationService service) {
final InputTextField username = new InputTextField();
final InputPasswordField password = new InputPasswordField();
final InputButton register = LoginScene.createRegister();
final InputButton login = LoginScene.createLogin();
final LoginScene scene = LoginScene.instanciate(username, password, register, login);
login.setOnAction(new LoginNavigationActionHandler(stage, scene, service, username, password));
register.setOnAction(new NavigationActionHandler(stage, RegisterScene.create(stage, service, scene)));
return scene;
}
``` woah i love this already 🤩
in my case its the only object instanciated, so he's right, i should've named it instanciate() as method
some classes can be pulling double duty where you could instantiated with a static more then one object
that is all I was saying
whether or not implementation has too much responsibility is more or less preference
and not something I am trying to debate
public static LoginScene create(final Stage stage, final UserInformationService service) {
final InputTextField usernameField = new InputTextField();
final InputPasswordField passwordField = new InputPasswordField();
final InputButton registerButton = LoginScene.createRegisterButton();
final InputButton loginButton = LoginScene.createLoginButton();
final LoginScene scene = LoginScene.instanciate(usernameField passwordField, registerButton, loginButton);
login.setOnAction(new LoginNavigationActionHandler(stage, scene, informationService, usernameField, passwordField));
register.setOnAction(new NavigationActionHandler(stage, RegisterScene.create(stage, informationService, scene)));
return scene;
}
``` tell me whats more readable
my idiom is that the less words i see and the more i depend on the context the easier for is to read for me, verbosity adds complexity for me. also if class name changes, i dont need to change my variable names too, since they depend on the context and not on the specifics of data
public static LoginScene create(final Stage stage, final UserInformationService service) {
final InputTextField usernameField = new InputTextField();
final InputPasswordField passwordField = new InputPasswordField();
final InputButton registerButton = LoginScene.createRegisterButton();
final InputButton loginButton = LoginScene.createLoginButton();
final LoginScene scene = LoginScene.instanciate(usernameField passwordField, registerButton, loginButton);
login.setOnAction(new LoginNavigationActionHandler(stage, scene, informationService, usernameField, passwordField));
register.setOnAction(new NavigationActionHandler(stage, RegisterScene.create(stage, informationService, scene)));
return scene;
}
you could even make it more readable by removing even pointlesser final keywords
public static LoginScene create(Stage stage, UserInformationService service) {
InputTextField usernameField = new InputTextField();
InputPasswordField passwordField = new InputPasswordField();
InputButton registerButton = LoginScene.createRegisterButton();
InputButton loginButton = LoginScene.createLoginButton();
LoginScene scene = LoginScene.instanciate(usernameField passwordField, registerButton, loginButton);
login.setOnAction(new LoginNavigationActionHandler(stage, scene, informationService, usernameField, passwordField));
register.setOnAction(new NavigationActionHandler(stage, RegisterScene.create(stage, informationService, scene)));
return scene;
}
i use final everywhere since then i could be guaranteed that the variable is not surprisingly being mutated somewhere else
prevents bugs
well final imposes compile time errors
that you should not expose variables publicly? instead write getters and setters
wdym
idk how a variable should be accidentally mutated
what i mean by mutation is that it wouldnt mutate the variable deep down in the function where i would miss that due to error
were not writing python
not that it should be mutated outside method
if i see a field being declared final i can be sure that at the end of the function, that variable will stay the same
unless it wasnt intialized in the first place (in that case it would be null)
meanwhile if i didnt declare it as final, i have to use my dumb monkey brain to manually check with ide that the variable is safe to reference in the way i want and that it hold what i expect to
idk how that should happen by accident but okay
