#help-development
1 messages Β· Page 483 of 1
its like 2mb
I thought that too at the start
Don't shade it
Just add it to the library in plugin.yml
my plugin with it is 650kb, witout its 150
if you want 1.17 support you have to shade
is it on maven central?
Yup
I thought it was on its on repo
thats only snapshots
java.lang.NoClassDefFoundError: net/minecraft/network/syncher/SynchedEntityData
Help me out
Why
i dont see chocos bungee api branch on his bukkit repo
Yes, it is remapped
I thought libraries option was added in 1.16?
π€·ββοΈ maybe it was scrapped seeing as we have libraries now I guess no reason not to use adventure anyways. I had always thought it was hosted in its separate repo which is why I tended not to use it
adventure dies if you use the libraries feature on 1.17
bruh
Any ideas?
good thing I don't support 1.17!
Where are the nms tryhards so I can tag
It's on his spigot repo
that appears to not really help
How does that not help
more stuffi have to read
And he said he stopped working on it anyways
(Except idk how to modify spigot patches :lul:)
same way for cb
To make new ones yes
you can always just yolo and hope and pray :P
wouldnt this like add json to the item
Yes NMS is much faster
I'm pretty sure
But it is not future proof and does not help anyone else
Correct
i just need keybinds
Neither
all i want
fuck
I'm 99% sure
Same thing as holograms
I added support for all components
But hover, click from the component directly doesn't work
keybind is client side so i would guess it works
i only need to show the keybind
the component already does that for you so its not a huge deal
yeah
...........
just show the string value
Text, Translatable, and Keybind components should all work
i need to run buildtools now
L
L
L
use my BuildTools python script that does the exact same thing as BuildTools atm lol
i made my own bat
because I cbf to add the other stuff I wanted
aks me for versions and remapped then just runs
@tender shard
hes prob asleep by now
java.lang.NoClassDefFoundError: net/minecraft/network/syncher/SynchedEntityData
SynchedEntityData dataWatcher = new SynchedEntityData(null);
Hate having to figure this out
π₯²
reminds me I need to update this
seems like a remapping issue
that's a mojang name though
I'm using nms in about 100 more things
In the same plugin
spigotRemap {
spigotVersion.set("1.19.3")
sourceJarTask.set(tasks.shadowJar) // or `tasks.shadowJar` if you use Shadow plugin.
}
Hey does anyone know how to use bold text in the tablist? I'm using this right now and it works with colour codes but not bold text for some reason :/
use getStringList instead of casting
well the error says it's trying to find the mojang class
What can I do to debug then
clean, then rebuild
19.3
I know it's there
I checked too
Wanted to make sure I wasn't losing my mind
I just changed and it didn't fix it :/
What's your string look like? Because formatting should come after the color.
Anyone know why this isn't working?
@EventHandler
public void entityDamageByEntity(EntityDamageByEntityEvent event) {
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "Fired");
if (event.getDamager() instanceof Player) {
Player player = (Player) event.getDamager();
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "Is player");
if (player.getInventory().getItemInMainHand().containsEnchantment(CustomEnchants.WITHER)) {
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "Has Wither");
LivingEntity entity = (LivingEntity) event.getEntity();
entity.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 40, 1));
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "added");
}
}
}
the print statements indicate its stopping at the conditional that checks if it has the Wither enchantment yet it definitely has the enchantment and ive done this before for a Telepathy custom enchantment and it worked that line worked
although you can get mojang mapped server jars
I translated the colours before formatting, still not working :/
Is it getting translated at all?
What's the config look like?
Yea, color ---> formatting. &b&l
please use some proper dependency injection instead of classloader magic
nah bro ClassLoader magic is fine as long as you hate good, well structured, and efficent code
Isnt it String#replaceAll() meant for regex pupouses?
yes
On a string it is
otherwise use String#replace
i have no idea man
i wrote it as something else originally
and intellij was just like "do this instead" so i just kinda did
Oh made it by some sort of IA because it seems/look a copilot autocompletation
Yeah remember IA can help to build logic, but not always is the best ππΌ
what ia?
Copilot surely
realistically it isn't gonna be a huge hit to the overall performance of my plugin
i see no reason to overcomplicate it
i believe you mean ai then
in french maybe
Yeah the french like to mix stuff up
So while for everyone it is EU, for the french it is the UE.
Same with NATO (OTAN) and many more abbreviations
I could give you a number of reasons why those are not the same.
Intelligent Artificallity
IA = Inteligencia Artificial
AI = Artificial Intellisense
XDDD
Verano at it again
You see we speak english here
i mispelled on english, but are the same thing
I swear to god he is nothing but a troll.
So we abide by english grammar
is it possible to make a world that doesn't get saved to disk
No, just drunk and tired
ie would reset on server restart
And perhaps a neglect of the english language
Can't you disable autosaving?
But not sure if that works when shutting down the server
That will cause issues with other words
I thought it was on a per-world basis
I think all worlds get saved on shutdown.
But could be a paper thing again
whereiam?
just before i go and have a few breakdowns while adding base components to lore, has anyone done it b4 and still got the code or know of something that can add base component arrays to lore
At worst just use a custom world managers - that ought to do the trick
If it doesn't seem possible with the bukkit api it probably isn't possible with the bukkit api.
?jd-s but let's see
Yeah but for recommendations if you will code public plugins for spigot site, You wont be able to publish them if they use paper api
So I've been looking for ways to disable enemy ai online for one of my custom enchants and found: /entitydata @e {NoAI:1} pretty sure that's just a NBT tag but how would I set an NBT tag in code like that?
ive already reached the point where ive gotta use nms
LivingEntity#setAI()
Oh fr?
Yea, stupid easy.
I dont think there is an easy way to achieve this. There is some API which looks like it should
prevent saving chunks but i had limited success with those in the past. Safest way would be
to simply delete and restore the regions folder.
How to include a maven dependency from a repo with credentials
Oh I remember
.m2/settings
maven or gradle?
It's actually good if you can spend enough time with it
if i set with param true after setting it false will it be able to target players again if its a mob
Maven on the other hand doesn't improve by much if you spend more time with it
It should.
just tried this and uh they're kind of disabled perm now lmao
LivingEntity entity = (LivingEntity) event.getEntity();
entity.setAI(false);
wait(3000);
entity.setAI(true);
Pretty sure wait is ms
I changed wait to Thread.sleep and it froze the game for the entire 3 seconds lmao
you can't wait nor sleep the main thread
unless you want this shit to happen
mmh
With gradle I was
So how do i wait 3 seconds? im trying to disable ai for 3 seconds when you hit a mob with a certain enchantment to create a sort of a stunned effect
Which is what I mean
if you set it up correctly - yeah
What does setting up correctly mean
?scheduling
Like lets say I want to incluide those in the bundle for github
The lazy approach would be to make use of a file://-repository
The correct one would be to use the proper maven repos
There is no proper maven repo
For massivecore
And I don't feel like compiling myself
do they have a github?
You can use the systemPath variable
do it with jitpack then
this is the only way if those files don't exist on any repo
How would I do it geols way thn
So
<repositories>
<repository>
<url>file://${project.basedir}/deps</url>
<id>local-potemkin-repository</id>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>empty</groupId>
<artifactId>modlauncher</artifactId>
<version>999.0.0</version>
</dependency>
</dependencies>
The layout within your deps folder would then looks somewhat like that:
.
βββ empty // {group}
βββ log4j // {artifact}
β βββ 999.0.0 // {version}
β βββ log4j-999.0.0.jar // {artifact}-{version}.{type}
β βββ log4j-999.0.0.pom
βββ modlauncher
βββ 999.0.0
βββ modlauncher-999.0.0.jar
βββ modlauncher-999.0.0.pom
the .pom files are not required per-se but can be useful from time to time
well file repo isn't the only way, you could set the depedency as a system dependency instead
doubt many will upgrade then
shame even maven is in the habit of removing actual useful features
That is something you might have thought when they removed http://-repos, but here everyone is using a version of maven that doesn't support http:// by default
just install to maven local
they didn't remove http repos
just go into your settings and change it if you really want it
maven isn't stopping π
Yeah should have made that "by default" thing a bit more clear
https works fine
Yeah https works and will continue to work
VehicleData vehicleData = vehicleDataMap.get(minecart.getPersistentDataContainer().get(new NamespacedKey(Main.plugin, "type"), PersistentDataType.STRING));
double maxSpeed = vehicleData.getMaxspeed();
double acceleration = vehicleData.getAcceleration();
double[] currentSpeed = {0};
new BukkitRunnable() {
@Override
public void run() {
if (player.isInsideVehicle()) {
minecart.setVelocity(
player.getFacing().getDirection().setY(0).multiply(currentSpeed[0] + minecart.getVelocity().length() * 2));
System.out.println(currentSpeed[0]);
System.out.println(minecart.getVelocity().length());
currentSpeed[0] += acceleration;
} else {
this.cancel();
}
}
}.runTaskTimer(Main.getInstance(), 0, 5);
}````
yoo, i am searching about 2 hours for the problem.
the code i want should do this: every 0.25sec the currentSpeed gets applied to the minecart and the currentspeed += acceleration
but ingame th evehicle only moves at ~1 speed
what do your sysouts show?
[23:55:17] [Server thread/INFO]: 0.0
[23:55:17] [Server thread/INFO]: 0.0
[23:55:17] [Server thread/INFO]: 1.0
[23:55:17] [Server thread/INFO]: 1.0
[23:55:17] [Server thread/INFO]: 2.0
[23:55:17] [Server thread/INFO]: 2.025
[23:55:18] [Server thread/INFO]: 3.0
[23:55:18] [Server thread/INFO]: 3.025
[23:55:18] [Server thread/INFO]: 4.0
[23:55:18] [Server thread/INFO]: 4.025
[23:55:18] [Server thread/INFO]: 5.0
[23:55:18] [Server thread/INFO]: 5.025
[23:55:18] [Server thread/INFO]: 6.0
[23:55:18] [Server thread/INFO]: 6.025
[23:55:19] [Server thread/INFO]: 7.0
[23:55:19] [Server thread/INFO]: 7.025
[23:55:19] [Server thread/INFO]: 8.0
[23:55:19] [Server thread/INFO]: 8.025
[23:55:19] [Server thread/INFO]: 9.0
[23:55:19] [Server thread/INFO]: 9.025
shows speed is increasing
yes but why isnt that applied to my vehicle?
I'm pretty sure minecarts have a speed cap
[23:55:19] [Server thread/INFO]: 9.025 says it is, thats the velocity length
i know
then you are being limited as Coll said
the minecart velocity is reporting as you expect
maxspeed is 120
is delay in ticks or ms?
ticks
Ight ty
According to the wiki the max speed is 8 blocks/s per axis
how do people do those command manager things where you use annotations to make the description, permissions and stuff
They probably just grab acf or whatever and use that
what is afcf
Annotation command framework
I thought it was Aikar's command framework
Not according to the GitHub
Ah huh
Did the armor protection or sword damage change between recent version ?
Yep you're right.
Cuz i take like 0 damage on my server in 1.19.4
Nope
Make sure you have an up to date version of ProtocolLib
There was a bug at one point that prevented damage from being inflicted
Or maybe it was ViaVersion
One of those two lol
I dont use ViaVersion but im gonna take a look
?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!
'void' type not allowed here
When I try to compile with maven
actives.addAll(super.activateOne(object));
I'm having more issues even getting it to compile with maven
Wasn't getting these before on gradle at all
what is the return type of activateOne?
?paste the error
do anyone know how to make a restart-script spigot.yml for linux i use tumx
restart for the entire server?
yes like /restart
i have no idea what that is
just ask urself
how
is a server supposed to completly stop its own process
and then restart
/restart is literally a command
it just stop it
spigot already has restart
Although usually itβs better to just have a loop in your startup script
then i clearly dont know what he means
You have to setup the start script.
just set your .sh script in correct spigot.yml to call it
you said your getting an error, we need that error
yea i dont know how to make one
do u use maven
?paste the full error
I use windows so mine is in spigot.yml restart-script: Start.bat
that doesnt help us at all
that just calls your start.bat script you would normally start your server with
im not windows
whatever command you use to start your server
where is the plugin.yml in intellij or whatever ide you use
and do you use maven/gradle
put it in a .sh file in your server root, set it executable perms
add it in your spigot.yml as I showed you
i use tmux and it dont work
no idea what tmux is
another varient of screen
ah
kk, iirc if you dont use maven/gradle the files to include in teh jar should go in /src/
you must know where you MC server is
/home/opc/
why sleep 5?
thats just the sample. sh file
ye know what
Or maybe it was someone else
ah, no idea then. Check intellij is adding those files on compile
this is my basic spigot startup (for testing) https://paste.md-5.net/miwubemehe.bash
i have a few questions
- is there any way i can sort this into different files?
- i cant manage to fix bugs such a:s custom items getting consumed in bulks of 5 instead of one, the items being usable on vanilla recipes, "meth" item not usable
https://paste.md-5.net/axahoxaran.cs
if you can help i'd gladly appreciate it
(asking again because i dont think anyone answered)
its still just stopping the server
did you edit your spigot.yml?
yes
?paste your spigot.yml
change restart-script: /home/opc/start.sh to just restart-script: start.sh
probably
isnt opc the root users
Yea, the restart script should be in the same folder as the server jar.
or similar
Shouldn't be.
root is the only true root account.
Everything other group needs permission or to be part of the su groups.
You're plugin.yml isn't in your compiled jar.
it works now but idk where the consle is
The console should be in the same location as the server directory
i use tmux
I don't know what that is.
a screen alternative
thx
check in the intellij build system the plugin.yml is set to be added to the compiled jar
Probably because you forgot to include it. How are you compiling your jar? Maven? Gradle? Manually?
Yeesh. Screens suck enough as is.
What does your artifact look like?
Well that explains it. You have nothing in there.
How did you create the artifact?
Did you change anything on the popup window?
It should of done that for you automatically. Normally you'd see a folder called compile output from <projectName>
Or something similar
You only have the META-INF folder for some reason.
Try creating a new artifact and see if it includes the compile output. Same steps. Jar --> From modules with dependencies.
Send a screenshot of what it looks like
I meant of the page after that step. :p
That is weird.
Yea, if you don't have this in your artifact, it won't compile properly.
Although I'm not sure why it's not including it when you create the artifact.
java.lang.NoClassDefFoundError: abq
I was able to remap
But still the same error
Are you remapping for the wrong version or something
Yes
It's valid
It can't even file the class
Same as before
Just obfuscated name
its real name in spigot is net.minecraft.network.syncher.DataWatcher
if you are using the remapped jar you use DataWatcher
if you are obfuscated you use SynchedDataWatcher
So use DataWatcher
The special source plugin converts remapped code back to obfuscated code.
So if you are using the remapped jar, write remapped code.
How hard is this to understand?
are you using specialsource?
why not?
Because I'm using gradle
then paperweight?
can't help you on Gradle
Working perfectly
It's literally just this SynchedEntityData dataWatcher = new SynchedEntityData(null);
It
Do those other 100 things use the mappings?
It's not a build problem
got it to work with tmux
#!/bin/bash
tmux new-session -d -s my_session 'java -Xmx19168M -Xms19168M -jar paper.jar --nogui'```
public void onVehicleMove(VehicleMoveEvent event) {
if (event.getVehicle().getType().equals(EntityType.MINECART)) {
Vehicle vehicle = event.getVehicle();
if (event.getVehicle().getPassengers().get(0) != null) {
Player player = (Player) event.getVehicle().getPassengers().get(0);
VehicleData vehicleData = vehicleDataMap.get(vehicle.getPersistentDataContainer().get(new NamespacedKey(Main.plugin, "type"), PersistentDataType.STRING));
double acceleration = Math.abs(vehicleData.getAcceleration()); // Beschleunigung auf positiven Wert setzen
System.out.println(acceleration);
Objects.requireNonNull(player.getVehicle()).setVelocity(player.getLocation().getDirection().setY(0).multiply(2 * vehicle.getVelocity().length() + acceleration));
}
}
}```
trying to fix this. i want that every time a vehicle is moving, the speed multiplies 2x, but i doesnt work.
?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.
Have you tried using debug statements to ensure your conditionals are working
Are you setting the max speed of the minecart? Minecart#setMaxSpeed().
Also why are you doing requireNonNull there
its from ide
I just tested SynchedEntityData dataWatcher = new SynchedEntityData(null);With remapped 1.19.4 and specialsource. Works just fine
I understand
Itβs erroneous
But it's not working for me with all the rest of my nms working correctly
Your issues is clearly paperweight then
removing it, wait a sec
not a Spigot issue
Add some debug too
You either have a bugged project or something is misconfigured.
my code now
public void onVehicleMove(VehicleMoveEvent event) {
if (event.getVehicle().getType().equals(EntityType.MINECART)) {
Vehicle vehicle = event.getVehicle();
if (event.getVehicle().getPassengers().get(0) != null) {
Player player = (Player) event.getVehicle().getPassengers().get(0);
VehicleData vehicleData = vehicleDataMap.get(vehicle.getPersistentDataContainer().get(new NamespacedKey(Main.plugin, "type"), PersistentDataType.STRING));
double newAcc = vehicle.getVelocity().getZ() + vehicleData.getAcceleration();
System.out.println(newAcc);
player.getVehicle().setVelocity(player.getLocation().getDirection().setY(0).multiply(vehicle.getVelocity().length() * 2));
System.out.println(vehicle.getVelocity().length() * 2);
}
}
}````
problem: vehicle is getting slower
debug:
```[01:39:45] [Server thread/INFO]: 0.19072766091831947
[01:39:45] [Server thread/INFO]: 1.9523270238599832
[01:39:45] [Server thread/INFO]: 0.18968338312566352
[01:39:45] [Server thread/INFO]: 1.952588044364577
[01:39:45] [Server thread/INFO]: 0.1886448229940064
[01:39:45] [Server thread/INFO]: 1.952847635721898
[01:39:45] [Server thread/INFO]: 0.18761194921783966
[01:39:45] [Server thread/INFO]: 1.9531058057568564
[01:39:45] [Server thread/INFO]: 0.18658473066305967
[01:39:45] [Server thread/INFO]: 1.9533625622515192
[01:39:45] [Server thread/INFO]: 0.18556313636602914
[01:39:45] [Server thread/INFO]: 1.9536179129453441
[01:39:45] [Server thread/INFO]: 0.18454713553264387
[01:39:45] [Server thread/INFO]: 1.9538718655354144
[01:39:45] [Server thread/INFO]: 0.18353669753740448
[01:39:45] [Server thread/INFO]: 1.954124427676669
[01:39:45] [Server thread/INFO]: 0.18253179192249314
[01:39:45] [Server thread/INFO]: 1.954375606982135
[01:39:45] [Server thread/INFO]: 0.18153238839685568
[01:39:45] [Server thread/INFO]: 1.9546254110231565
[01:39:45] [Server thread/INFO]: 0.18053845683528832
[01:39:45] [Server thread/INFO]: 1.954873847329622
[01:39:45] [Server thread/INFO]: 0.17954996727752978
[01:39:45] [Server thread/INFO]: 1.9551209233901936
[01:39:45] [Server thread/INFO]: 0.17856688992735809
[01:39:45] [Server thread/INFO]: 1.9553666466525292
[01:39:45] [Server thread/INFO]: 0.1773116893057258
[01:39:45] [Server thread/INFO]: 1.9556803879787632
[01:39:45] [Server thread/INFO]: 0.17119942766743357
[01:39:45] [Server thread/INFO]: 1.9572081669167571
[01:39:45] [Server thread/INFO]: 0.1452359849995531
[01:39:45] [Server thread/INFO]: 1.9637004825869266
[01:39:45] [Server thread/INFO]: 0.12321005756961957
[01:39:45] [Server thread/INFO]: 1.9692371335872443
[01:39:45] [Server thread/INFO]: 0.014784886537881207
[01:39:45] [Server thread/INFO]: 1.996308536019995```
Itβs getting faster in the logs you sent
if your velocity is below 1 you will get slower with this math player.getVehicle().setVelocity(player.getLocation().getDirection().setY(0).multiply(vehicle.getVelocity().length() * 2));
and ingame its getting slower
How would that get slower
Direction is a unit vector so will always be 1
Itβs always doubling itβs own velocity in the direction of the player
so what can i do?
he's muliplying by 2
so sorry less than 0.5 it will decrase
he's multiplying 1 * (velocity * 2)
How
for any non-negative number velocity * 2 is always bigger than velocity
It should not be slowing down in that context
if velocity = 0.4...
direction(1) * (2 * 0.4 = 0.8) == 0.8
Yes
ahh
ah yep my heads broken
And 0.8 is faster than 0.4 lol
I had the 1 stuck in my head, 0.8 being less than
You were just forgetting that the speed is being compared to the initial velocity not the unit direction vector
@edgy crystal I suspect youβre speeding up but by such a small amount that youβre not noticing it
Your sysout is printing newAcc not the actual velocity you are setting
System.out.println(vehicle.getVelocity().length() * 2);
Itβs printing both
Ish
For the record youβre doubling it again after setting it, so the actual number is half that
first one is an odd calculation which is going down
second is the actual velocity which is going up
Yes
So the velocity IS increasing. just not by much each time
alright,
so thank you, but i don't know what to write for an code haha
my math & english are not the best
System.out.println(vehicle.getVelocity().length() * 2); is showing it getting faster
yes
Your actual acceleration is probably being slowed by MC resistance
Minecarts are very slow, just doubling the speed isnβt going to be super noticeable
alright, ill turn it up to 5
i have turned it up to 5, and if i push the veh, this prints:
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.9961248730655665
[01:54:14] [Server thread/INFO]: 5.001609162617644
[01:54:14] [Server thread/INFO]: 4.994602621367113
[01:54:14] [Server thread/INFO]: 5.001608672327551
[01:54:14] [Server thread/INFO]: 4.9100770044103434
[01:54:15] [Server thread/INFO]: 5.002437417160766
[01:54:15] [Server thread/INFO]: 4.1809649734668515```
if you push the cart MC will be trying to set a constant velocity
alright, so the velicity.length ~1, and only the multipliere (in this case 5) sets the speed
no
a velocity is not a unit vector
if you are pushing the cart MC will be setting a speed
okay
i hate this shit man, the first error i cant fix.
would you be so kind and give me the code? otherwise ill try another option
it sounds like you want to just override the minecart acceleration/deceleration.
yes
to always accellerate in the direction the player is facing?
thats right
then I'd suggest you track it yourself
ignore the velocity that MC reports to you
track the speed and apply it yoursef
i dont get wym with ignore velocity?
so store a vector for your minecart which will be your speed
each tick you take that vector add a vector multiplied by the players direction
then apply that to the minecart and store it as your new vector
hm alright
kinda like player.getDirection().setY(0).normalize().multiply(0.5)
would be your acceleration vector
each tick
so you fetch whatever vector you set last time, add your acceleration vector, apply to the minecart and store the new vector for the next tick
alright i'll give my best
what is the egg for the pterodactyl panel?
hi what's iam doing wrong?
i made a plugin that is 3 parts:
- api Module
- core Module
- ROOT Module.
all repo and dependacies are added into core and api
does player#teleport cause a playermoveevent
show the actual pom entry causing the error
It shouldnβt, but it will cause a teleport event
i think i fixed it ..
final error π
Failed to delete \SkyPvP\core\target\maven-status\maven-compiler-plugin\compile\default-compile\createdFiles.lst
you have two maven running?
1?
got it working
Refer to pterodactyl terminology page
Pterodactyl is an open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
Just realised this is spigot server lol, how is it related
ah
appreciate it
oh
is there a plugin where i could do stuff like /enchant sharpness 50
would there be an easy way to make fog (if players have it enabled) act like a world border
and have it slowly shrink
yea but do you know any?
k my bad
Sadly you canβt change the fog distance without a client mod
is there a way to get my game working with those special client mods
that do things like auto gg
Auto gg is probably hardcoded to hypixel
oh
Well, if you take auto gg apart you could figure out how it works to emulate it
hey i'm making a plugin where the player is this little robot that you control
so that raises the question is it possible to implement tank controls with locked head rotation or is that like really hard?
what's the easiest way to use brigadier for server commands
I don't know why.. but when I start my server I get errors that my config is null, but my config is initalized first in the on enable, https://paste.md-5.net/gotobinanu.java heres the error [02:44:19 ERROR]: Error occurred while enabling Tazpvp v1 (Is it up to date?) java.lang.ExceptionInInitializerError: null at world.ntdi.nrcore.utils.command.CommandCore.<init>(CommandCore.java:55) ~[Tazpvp.jar:?] at net.tazpvp.tazpvp.commands.EventCommandFunction.<init>(EventCommandFunction.java:51) ~[Tazpvp.jar:?] at net.tazpvp.tazpvp.Tazpvp.registerCommands(Tazpvp.java:181) ~[Tazpvp.jar:?] at net.tazpvp.tazpvp.Tazpvp.onEnable(Tazpvp.java:98) ~[Tazpvp.jar:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:279) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:192) ~[paper-1.19.4.jar:git-Paper-515] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.19.4.jar:git-Paper-515] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:555) ~[paper-1.19.4.jar:git-Paper-515] at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:466) ~[paper-1.19.4.jar:git-Paper-515] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:638) ~[paper-1.19.4.jar:git-Paper-515] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:437) ~[paper-1.19.4.jar:git-Paper-515] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.19.4.jar:git-Paper-515] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1104) ~[paper-1.19.4.jar:git-Paper-515] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[paper-1.19.4.jar:git-Paper-515] at java.lang.Thread.run(Thread.java:833) ~[?:?] Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.file.FileConfiguration.getString(String)" because "world.ntdi.nrcore.utils.config.ConfigUtils.CONFIG" is null at world.ntdi.nrcore.utils.config.ConfigUtils.<clinit>(ConfigUtils.java:17) ~[Tazpvp.jar:?] ... 16 more
how can i remove my dependence of ai , i am so addicted on generating the code by ai that i am loosing my ability to code π
stop using it
and use google instead
personally I'd avoid use of the default config stuff
https://github.com/Y2K-Media-Creations/simpleconfigs/blob/master/src/main/java/sh/miles/simpleconfigs/ConfigUtils.java
I'd use something like this class to manage your config shit
i do it involuntarily , i though using ai will help me avoiding mistakes but now i am addicted
I only use ai for monotonous stuff like repeating similar code if need be
she's a beaut
I'm a bit of an artist myself
my plan to make a tower defense plugin while simultaneously making a standalone tower defense game that mirror functionality is truly the stuff of madmen
getting this error
public void onPlayerDeath(PlayerDeathEvent e) {
Player deadPlayer = e.getEntity();
DeadPlayerUtil.createDeadPlayer(deadPlayer.getUniqueId(), deadPlayer);
deadPlayer.sendMessage("YOUR UUID: "+ deadPlayer.getUniqueId());
try {
DeadPlayerUtil.saveDeadPlayers();
} catch (IOException ex) {
System.out.println("Failed To Save JSON File.");
ex.printStackTrace();
}
}```
code
DeadPlayer deadPlayer = new DeadPlayer(p.getUniqueId(), p, p.getDisplayName());
deadplayers.add(deadPlayer);
deadplayersuuid.add(deadPlayer.getUUID());
return deadPlayer;
}```
some more code
Gson gson = new Gson();
System.out.println(Hardcore.getPlugin().getDataFolder().getAbsolutePath());
File file = new File(Hardcore.getPlugin().getDataFolder().getAbsolutePath() + "/deadplayers.json");
file.getParentFile().mkdir();
file.createNewFile();
Writer writer = new FileWriter(file, false);
gson.toJson(deadplayers, writer);
writer.flush();
writer.close();
System.out.println("DeadPlayers Saved Successfully.");
}```
more code
can anybody help me?
private UUID id;
private String playerName;
private Player player;
public DeadPlayer(UUID id, Player player, String playerName){
this.id = player.getUniqueId();
this.playerName = player.getDisplayName();
this.player = player;
}
public UUID getUUID() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getPlayerName() {
return playerName;
}
public void setPlayerName(String playerName) {
this.playerName = playerName;
}
public Player getPlayer() {
return player;
}
public void setPlayer(Player player) {
this.player = player;
}
}```
Use mysql or NoSQL like mongo.
i want to use json for the storage
NoSQL
...
Hello, what is the differency for Chat on Spigot and Bungee? My plugin controlling the chat and don't action correctly.
Sorry my bad english X,,D
Now thinking about it, could it be that the management of the players changes?
Oh and what I wanted to say above, what are the differences between spigot and bungee in chat? Since my chat plugin doesn't correctly do what I want.
Itβs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
NoSQL is json format
Bungee is player interface that saves through servers player sends message through bungee, every players in the proxy gets message. When player sends message to spigot every players in the spigot server gets message but not proxy players.
that shouldn't be too hard
but awesome you are making progress 
yeah always important to learn and understand concepts
even if you might not use it any time soon π
they come in handy when you have to make some new concept to handle problems π
you will figure it out eventually, just takes time so use what works now improve it when you can π
or maybe even sooner
who knows, you will figure out the more you dive and learn the inner workings of Java π
w3 schools is good, but won't teach you beyond a certain point
once you hit that point, you will have to learn about the JVM π
unfortunately, there isn't very good reading materials in regards to learning about the JVM
yes
how can i check if my nms packages are installed succesfully and get the names of all the functions and classes
just type out the package names? Should autocomplete them
i cant find any package named 'net.minecraft'
i just downloaded the build tools and changed the dependency spigot-org to spigot, where it could have went wrong π¦
once i change the groupid and artificat id i get error that is it not found
permit me share github link?
i dont think there is any restriction on sharing code links
GitHub: https://github.com/Majhrs16/ChatTranslator
My problem is, sourceLang and targetLang are inverted between each player, that is, for example: from player A who has Z=1, and player B who has X=2, when A sends a message, B receives X instead of Z.
This only happens when the plugin is used on a bungeecord
it is pretty clearly specified on the plugin page that the plugin is not compatible with bungeecord
*also, thats not "a Github"
UPS
wot
I got confused about the link XD
It is that I want to make the plugin compatible with bungeecord, since it is mine
ok
but, this channel is for bungee :V
this description say textualy "Serious Spigot and BungeeCord programming/development help | Ask development-related questions here"
Oh, You know that with the translation it is not the same, but what did I want to say?
I mean, that's why they make different accessories, since it's not the same base :o
oops xd
how can i make custom items unusable on vanilla recipes
But, I would like the plugin to be on each server, not on the entire network.
how can i do that, ive been trying but cant get it to work
thanks
:'v
which is it?
ohhh, thanks
probably the easiest way, not necessarily required though
how i add message to Player.kick(); ?
?jd-s
thats deprecated
no its not
Heβs probably using Paper
Stop using paper
Itβs deprecated for components
Build against Spigot
Not due to it not being usable
Yes
ayyy
Hello there , i know this might be bad to do , but iam making a custom death system based on damage event .
what iam using is :
EntityDamageEvent
if ((player.getHealth() -
event.getDamage() > 0)) return;
after that i cancel the damage and heal the player and teleport him so he never die acctuilly
there are 1 bug i found but its related to the combatLog i guess .
the problem is :
if i hit someone and i die without getting any damage from the other player , like die from void , or burn by lava etc ..
i will not get any death stats , and that player who was attacked won't get any kill stats ..
your username is killer, yet you prevent kills
runTaskTimer(plugin, 20L * 10L /*<-- the initial delay */, 20L * 5L /*<-- the interval */); is this like a 30 second delay?
doesnt combatlog have an API or sth?
no, it's 10 seconds and 5 seconds
i made a custom combatLog system .
how do u decipher this ancient language
there is only this method which return the attacker
i want to make new method to get the other player who was attacked
20 ticks per second. so 20 * 10 = 10 seconds
You need to tag the damaged player any time they are hurt by another player. and timestamp it.
if they die within an acceptable timeframe you can attribute the kill to the last damager
ohhhh
How can i check if a player can build from the player interact event?
its better to do it in teh block place event
depending on what you want to do after
I want to do something similar to itemsadder when a custom block is placed
But i can't use the block place event to do it
When i click a block with a item like PAPER it will place a barrier block, but if i can't build it will not
there is no way to tell if you can build when another plugin cancels the event
you could fire off a BlockPlaceEvent yoruself and check if it's cancelled
but it's not recommended as you could mess with other plugins.
Using BlockGrowEvent, I created the following code to make a crop grow one more step than normal when it grows. But it doesn't work well. Can someone help me?
@EventHandler
public void blockGrowEvent(BlockGrowEvent e){
Block crop = e.getBlock();
BlockState state = crop.getState();
Ageable ageable = (Ageable) state.getBlockData();
if (ageable.getAge() < ageable.getMaximumAge()) {
ageable.setAge(ageable.getAge() + 2);
state.setBlockData(ageable);
state.update(true);
}
}
you need to cancel the event if you are manually changing the growth
I see! Thank you very much. I will give it a try.
https://paste.md-5.net/ramewokova.java the completeTask method only runs when the generated is a stair, if it's a normal block like idk oak wood then it doesn't run
why is this?
a stair is not solid
also filter by Material::isBlock
you no longer need the while loop then
sorry seems stair is solid
its light thats allowed through
why is this not working?
if (item.hasItemMeta() && item.getItemMeta().getPersistentDataContainer().has(new NamespacedKey(this, "meth"), PersistentDataType.BYTE)) {
// Apply potion effect after x seconds
for (PotionEffectType type : PotionEffectType.values()) {
int duration = 20 * (90 + player.getPotionEffect(type).getDuration());
player.addPotionEffect(new PotionEffect(type, duration, 0));
}
}
"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.
any errors? does the item actually have a byte pdc key?
its supposed to give every effect but it isnt even usable
it does, yes
and no errors
hold the item in game and run /data get entity @s SelectedItem
More code
Did you register the listener?
i did
Then print out the item data and show it to us.
And send your whole code.
full code (very messy): https://paste.md-5.net/dezuzejoja.java
sorry, im new to this, whats that mean
you add the effect with a level of 0
oh that, yeah 0 is level 1 effects
add sysouts then
what that
Ah i see the problem
System.out.println()
wdym add log message
Dont use minecraft as a namespace. Use your own namespace.
i added that moments ago, it wasnt working before either
System.out.println("we reached here!");
what is the senarios of death i should expect?
if(attacker == null && combatLog.isInPvP(player.getUniqueId())){
what else :p?
Asking like that: All of them
0 context => crossly generalized answer
ik ik
but i have been trying to handle some things
if i hit someone and i fall to void, it should give stats , but its not ..
Add a log message. And print the items data in the chat to show us.
I think minecraft should detect that as a kill for the attacker if you damaged him before.
on it
well iam not using PlayerDeathEvent .
i made something custom ..
well if they never damaged you that life and you fall in the void regardless thats a skill issue and they wouldnt get the kill for it usually
I imagine you would need to keep track of every fight in some way
how can i copy the data onto here
Not verified? Upload screenshots here: https://prnt.sc/
?img
Not verified? Upload screenshots here: https://prnt.sc/
!verify
Usage: !verify <forums username>
Custom could look like this:
Add 2 PDC tags to each player/entity
- UUID of last attacker
- Long timestamp of last attack
Then you can always check who attacked this entity and how far
this attack lays in the past. Just make sure to clean it on death/game end.
yes i did make a combatLog system .
Hm, if you dont need it to be persistent then PDC might not be the right approach.
But this will result in people logging out before they fall into the void to deny the kill.
now add a sysout to see if it passes the if or not
create a Record containing lastAttacker and timestamp
it should check :
- killer is null but player is in combatlog
- killer is null but player is not in combatlog
- killer is not null and player in combatlog
then push to a Map of <UUID, record>
check the code i sent .
which method does this get checked?
server is restarting
if i hit a player and i die to void , it should give stats to me and to the player who got attacked (Kill stats).
I would rename them as
attackerID
defenderID
This way its more clear. Because yours implies that a player cant be an attacker.
not really ,
if I punch you, then run around the corner and get run over by a car, did you cause my death?
if i hit someone , and i fall to void
i do this :
?paste code to not spam
This can be replaced by just
playerCombatInfoMap.put(playerId, playerCombatInfo);
also, would the"public void onCraftItem" in my code prevent items with those nampespaced keys from being used in crafting?
it does
https://paste.md-5.net/onoputaruc.js
super slow ass mf
a), use an item builder, b) dont store that in yml, c) store the id as an int d) load items on startup and when a new one is created
loading the yml and every item when someone opens a gui is just going to cause lag
what is an item builder
create storage handlers and load items on startup
so what's the problem?
one sec
Bukkit.getOfflinePlayer(plugin.data.getString(ymlPath + ".owner"));Will be VERY slow if the player does not exist or has not played on your server before
yeah the user has played before
allows you to do new ItemBuilder(Material.RED_CONCRETE).name("<red>Downvote").build()
is this getting a name or a UUID?
want me to push what i have to github and show you what i mean with storage handler
oh also use a getter for data, not a public field
then you need to use UUID.fromString
else it's attempting a name lookup with the UUID string, which will not exist and it trys to ask Mojang
if you want expandability you should have an interface for storage
gonna try it like that
Which is where its slow
UUID.fromString(plugin.data.getString(ymlPath + ".owner"))```
the sysout should print on the server's console, right?
aw yep its real fast now
i added this
System.out.println("we reached here!");
this can be made into a stream, and you shouldnt directly #replace("&", "Β§") use ChatColor.translateAlternativeColorCodes
i will still make the changes i should
correct
i pushed what ive got so far to github if you wanna look at it
mhm
it does not appear to print then
bump
is there a simpler way i can make this system?
also it works for all non solid blocks like slabs
the item doenst have the key then, could be the key isnt beind made the same as the prior, keep a variable of the key instead of using new NamspacedKey(plugin, "key") each time
it only doesnt work for full blocks
elgarl answered you
he said that stair is not a solid and then that it is a solid
so I don't get where the problem is
check stash to see what the material enum says is solid then
and how may i do that, im extremely new
the repo is not public btw @remote swallow
oh
Next you need to deal with
i thought it was lmao
that will be fine if there is only ONE player on the server doing anything
or if the listener is made for evey player xD
public class MyClass extends JavaPlugin {
private NamespacedKey methKey;
@Override
public void onEnable() {
this.methKey = new Namespacedkey(this, "meth");
}
private boolean hasMethKey(ItemStack stack) {
if (stack != null && stack.hasItemMeta) {
return stack.getItemMeta().getPersistentDataContainer().has(methKey, PersistentDataType.BYTE);
}
}
}
yep, which would be a crazy thign to do, right
its public now
delete Material[] materials = Material.values();
its not needed
just pick a random from solidMaterials
if you filtered for isBlock you know it's going to be a solid block
i did and still the code only works if it generates a non full block like a slab stair flower pot or anything like that. if it's a full solid block then the completeTask method doesn't run
wait that's to me?
your current code does not create a player file
if(block.getType() == generatedBlockType && !completed){
completeTask(p);
completed = true;
}
this only runs if it generates a non full block like a slab or stair
unlikely
i mean i tested it many times
if it generates a slab, i walk over it, the method triggers
if it's something like oak wood it doesn't work
ok first thing, your Block block = p.getLocation().getBlock(); is always going to be Air or water or lava
so Block.getType() is never going to be your generated type
unless it's a partial block, like a slab or stair
what exactly are you trying to do, not what you code does. What is your actual goal?
basically, a random block generates and walking on it completes a task
and also it needs to be persisent
so it saves itself to a yaml file
generates where?
I got the same issue here.
Packet encoding of packet ID 82 threw (skippable? false)
java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "trackedValues" is null
at net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket.pack(ClientboundSetEntityDataPacket.java:17) ~[?:?]
at net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket.write(ClientboundSetEntityDataPacket.java:38) ~[?:?]```
What was the solution here?
I try to send a `ClientboundSetEntityDataPacket` to attach some entitydata for a armorstand via mojangmappings.
`protocollib.sendServerPacket(nearby, PacketContainer.fromPacket(new ClientboundSetEntityDataPacket(stand.getBukkitEntity().getEntityId(), stand.getEntityData().packDirty())));`
But somehow all players exept one player will be kicked from the server with error `Packet encoding of packet ID 82 threw (skippable? false)`
But it is random, which players will be kicked.
make a thread, so its easier to talk
me?
no DKL
help
anyone know how im somehow stack overflowing by opening a different inventory on the close of another
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onInventoryClose(InventoryCloseEvent event) {
System.out.println("called");
CustomInventory inventory = inventoryMap.get(event.getView());
if (inventory != null) {
inventory.consumeCloseEvent(event);
this.inventoryMap.remove(event.getView());
}
}
``` thats whats causing it
it runs the called like a hundred times then dies
Hello. I'm currently developing a plugin for profiles. I added caching via LoadingCache, but when I get a profile from the cache, it returns a reference, so if I edit something in the received profile, it will be edited in the cache. How to avoid it? Create a copy constructor or something similar?
you are opening the new inventory before the previous one has been closed. So it closes it by opening the new inventory, causing the close event to call again.
have anyone tried this?
seems cool
Yeah it does but ide don't really support
I'd consider trying maybe if I had a vsc plugin to make the compiler and linter shut up
it does have intellij plugin for that tho
I don't use intellij so rip for me
I'll stick with my boring old vanilla java for now I suppose
How can i send a PacketPlayInArmAnimation in nms?
How are templates useful in java, is it like reified generic type?
not all features i like
i honestly would love to have preprocessor definitions in java
and to make those variables accessible through java command by inputting the class
that way build system could recognize them
and do some logic
if anything I would want scripts that arent attached to a class
Ig templates here just makes generics available at runtime
i think templates would just generate the class at compile time
just like c++ does
by not using generics
i realised my issue
hiding the implementation behind syntax
something like fastutil does
it implements separate class for the different implementation
instead of using generic types
to alleviate the performance overhead of generics
lmao
Caused by: com.comphenix.protocol.reflect.FieldAccessException: Field index 0 is out of bounds for length 0
PacketContainer container = Freebuild.getInstance().getProtocolManager().createPacket(PacketType.Play.Server.PLAYER_INFO);
container.getPlayerInfoAction().write(0, EnumWrappers.PlayerInfoAction.ADD_PLAYER);
container.getGameProfiles().write(0, WrappedGameProfile.fromPlayer(player));
try {
Freebuild.getInstance().getProtocolManager().sendServerPacket(player, container);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
How can I best fix this error?
I've tried everything, it just doesn't work.
Are you using the right right version of protocollib?
no i use left one
guys should I ask microsoft for 4 bil or 8bil usd for my game
is engine yours?
nah godot
Yes i have, the 4.8.0
What version of Spigot is the server running?
1.19.4
?nms
I got it, found a version of Protocol Lib that should be the latest 5.0.0-Snapshot
Yeah
Thank you anyway for the support!
I need help with this documentation
<build>
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.18.2-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc
1.18.2-R0.1-SNAPSHOTπ«remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
Here i don't know weather to change group id or not , cuz if i do no change it gives error for unfound group id , after changing it i also have to change the artifact id , version which gives error cuz the '<goal>' tag would have remap which is not found
You need to reload your pom
by running the code right?
how do you run it?
hey im running into a weird problem im working with packets for the first time and trying to override the default mining animation but to do that you have to give the player permanent mining fatige which you do with this
player.addPotionEffect(PotionEffectType.SLOW_DIGGING.createEffect(-1, -1));
the problem im having is when the player leaves and rejoins or the server closes it still says they have mining fatigue
it just gives error
but it doesnt do anything unless they drink milk and it gets reapplied
im new and might not be much help, but cant you make the player loose the effect when they leave, and reapply it when they join?
for (PotionEffect effect : player.getActivePotionEffects()) {
player.removePotionEffect(effect.getType());
}
});```
thats in my on disable and the same method on player quit
should remove every active potion effect the player has
the server runs this before the players are kicked as far as im aware
then it should
im going to give mtyself some other effects and see if it clears those
welp
idk what i changed
but i just
rebuilt the plugin from intellij
and it worked
so
maybe i changed something last night at like 2 am and forgot about it
I need help giving a colored glow effect to player, been searching in the forum but I only found that it can only work with a team, but is that the only way?
What would be the best way for getting the main class instance from objects (like models, utilities). Because you cannot use DI for them

I mean why you laught it's a really importante question
Oh sorry mate i just get up
Here Is where i find DI a deal, that you can't imolement it over utilities or models things
pass the main instance to them
why shouldnt that work?
Yes that Is correct while not doing utility method like UserModel, BlaModel, etc
please show me ANY example where DI wouldn#t be possible
But what about for Enums, models where smtimes you need main instance. How you get one? Because those are not initialized
if your enums requires your main instance, it probably shouldnt be an enum.
no idea what you mean with "models"
If your enum needs a reference to your main instance you are doing Smth wrong
With models i refer to objects which are used for any properties. Like User, Sever etc
and what's the problem in passing your instance into "User" or "Sever"?
With DI you can't pass it, you should a static getter un that cases
What
bruh you're too high again
That's the point I'm trying to go
no, you're just talking random bullshit again lmao
Pls just produce an example
If you're crafting area is 3x3, why are you not using the normal crafting table interface?