#help-development
1 messages · Page 1821 of 1
?xy
Asking about your attempted solution rather than your actual problem
this is not something you want to accomplish, thats for sure
It is indeed my problem, because java agent need to use jar form
ok but you cannot package a jar file into another jar file
it tells me to implement methods for structure manager?
stop instancing objects, getStructureManager
xd I can manually drag jar into jar to make it work
indeed solve the issue, I just have to do it manually
just put the jar in the same folder
and just access it that way
i dont understand why you need this
declaration: package: org.bukkit, class: Bukkit
sorry which folder you mean ' same folder'?
use 1.18.1 javadocs
you have your jar file in a folder
just put the agent jar file into the same folder
hmm let me try
um there's no documentation for either of the Structure.place(...) methods?
like
what's that int for?
or that float
or that boolean
its all right here
So I made an empty list using:
private static List<ItemStack> itemsList = Collections.<ItemStack>emptyList();
``` and I want to add element to it using `indexesList.add(something);` but it throws me an exception. How do I fix it?
thanks, put the jar into /target/classes make it work
-.- not what i meant
shouldnt the javadocs be in there?
im telling you
xD
i mean the bukkit javados are there?
you do NOT want to do whatever youre doing this way
ya ty for help
this is literally the purpose of jar files
website javadocs are superior and easier to check
?
I wasnt understand your answer sorry
i dont understand your question but you should never put a jar into another jar file
simple as
new ArrayList<>();
ArrayList<MyClass> myArraylist = new ArrayList<>()
Thanks
though even that does not tell me how the palette works. If i dont want to change the blocks i leave that at 0 right?
also thanks for your answers
how coul i access that variable?
just 0
k thanks
just move it out of the supplier
if its out of supplier:
ClassName.this.clicked
well, some fancy stuff really have to do this way to make it work I guess
INFO]: [STDOUT] [org.bukkit.craftbukkit.v1_17_R1.inventory.CraftItemStack] Test
ya it finally worked
;_;
i still have no clue what youre trying to do
insert own code into craft bukkit method body
so I just managed to run a print message inside CraftItemStack static method
also it would be hella lot slower doing it at runtime
hmm it in form of plugin would be easier for me to distribute actually, and I can add certain new events using this
i would rather make wrapper classes
Asking about your attempted solution rather than your actual problem
version control would be pain in the ass
static method cannot do wrapper class ig
?xy
Asking about your attempted solution rather than your actual problem
?xy
Asking about your attempted solution rather than your actual problem
?xy
Asking about your attempted solution rather than your actual problem
otherwise I will attempt easier solution
dont spam
i feel like youre not telling us what you actually want to do
that's what I am doing, a way for me to add new events
ok but i still dont think thats a very effective nor good idea
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
Much better way to add events
use regex
why not serialize and deserialize?
how?
Double.parseDouble?
then jus rewrite
register your command via vanillaCommandDispatcher
won't that be version dependent?
i dont understand the diff between brigadier and the one everyone is so used to cmd systek
what even is brigadier
is it better or something
mojangs command parsing thinghy
Brigadier is Mojangs command framework
brigadier is the new command parser, which contains new parsing of commands since 1.13
It's what Minecraft uses internally
will that work on every version 1.14.4+?
yes
Brigadier is fully utilised since 1.13
but that would involve some NMS to make your commands work
also your commands will get minecraft: namespace, since that's how bukkit registers commands
it seems a bit confusing from the usage
no. its impractical, just because of the obfuscation
no
any non nms way?
i rly don't want to involve NMS here
seems like tis would be a pain
i dont say use nms but look at how mc does it and see if there are any methods to do it without nms
or can u just have it execute the good old dispatch cmd minecraft:tppos
use spigot javadocs in vscode
wat
what i would do, i would split the string into 3 pieces with delimiter of space ' '
try to use Integer.parseDouble() for these split strings
if one of them fails
read the first character of the failed string
Double*
Is the string coming from a command or elsewhere?
why people use other ides when intellij exists 🥲
if its ~ char and the string's length is only 1, handle it as relative location, by getting the relative location coord, depending on the order of the split strings
intellij has a lot of features most people dont use
perfectly reasonabe
ya idk why people dont use intellij
and because of that it takes up so much memory
oh
same
ROFL
true when i updated to intelij 2021 my ide would freeze trying to load Material enum
i was like bro ima use eclipse
cus intellij was so unusable at the time for me
and i have 16gb ram 💀
right so you just answered your own question
well yeah but i havent had these issues for months
try using my solution
^
what are the different types of inputs a location can parse anyways
like ^ and others
how is that different from ~
i know u can do like +2 or smthn to args cant u
instead of using hte world vector it uses the player vector
so its to the right/left instead of x/z
so it playerX + 3?
no
that makes no sense
right could be from any direction
if you take the cross product of the player's facing direction and (0,1,0) youll get the right vector
its not as if you rotate in real world and the planet earth rotates to your right lol
opposite of this is the left vector
yeah i mean get player right or left
spigot is more for accessing cb
not providing utility methods
it does in some cases but not anymore
if mojang had a left/right system im sure itd be in spigot
sadge
so someone can help me access the javadocs even if I have the remapped, build tool version of spigot?
like even on the base bukkit functions
?paste
in C++ we have something like this
void myFunction(int (&arr)[ARRAY_SIZE]);
if we want to pass fixed size array at compile time
do we have something like this for java in compile time?
I have a function trigger onChunkLoad, but it requires enough computing power to crash the server. How can I delay those, so that for example there is only one instance of the function running?
how to fix Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.6.0'] was not found
no
i’m curious: how does that actually work? what if you pass an array of random size?
it only allows to pass only provided size array
that means if its bigger or smaller it wouldnt compile
you specifically need that provided size array
so the size of the array must be determined at compile time then?
yes
interesting
Arrays in C++ are just technically pointers to linear memory addresses on the stack
by determining the base pointer before and after the array allocation you can get the array size in compile time by just subtraction: oldBasePointer-BasePointer/sizeof(dataType), or in cpp to get the size of fixed array we do, sizeof(arr)/sizeof(arr[0])
long time = 0;
for(Chunk chunk : Bukkit.getWorld("world_nether").getLoadedChunks()){
try {
Thread.sleep(time);
time = handleChunk(chunk);//Returns how long function took
} catch (InterruptedException e) {e.printStackTrace();}
}
This still causes a server crash. Anyone knows why?
what does handle chunk do?
it looks like your threads get in some sort of hang mode/dead lock
it basically copies the bottom half of that chunk onto the top half and does a bit extra
?paste
@ivory sleet
the reason im so confused is that i specifically tell it to WAIT for as long as it took the previous iteration
and if that process is called ONCE nothing happens but whats intended
where do i learn how to fork spigots
Well, void method(V v1, V v2, V v3..)
regex
Heya, i am making a plugin and was wondering if there is some centralized storage of plugins that developers are able to access and use it as something like a maven repository in order to pull plugin jars
For what purpose
Mainly just not cluttering my pom.xml with lots of repositories
Or having to sort jars one by one from each download location
Because i have about 6 plugins which are softdepend and keeping track of what version each is a mess
no not really
i'd suggest forking paper instead - it is much easier.
See
https://github.com/PaperMC/paperweight-examples
if you depend on those plugins, you should keep track on them. They can easily change and break your plugin
How can I convert world time to second?
time % 1000 * 3600 / 10000?
You mean how long is a second in game?
Normally 20 ticks is a second if that's what you are looking for
Hey, I'm looking for a way to set final damage in entitydamagebyentityevent (basiclly a fixed damage that ignores armor or any kind of reduction)
Only thing I can find is setDamage()
Couldn't find anything on google 😒
I mean I want to convert Minecraft time to real seconds, since I will play with it further later.
Hey, my entity is not getting teleported. Any idea what might be causing it?
Location loc = new Location(world, x, y, z, yaw, pitch);
debugLog("---");
debugLog("seat before: " + mainSeat.getLocation().toString());
debugLog("tp: " + loc.toString());
mainSeat.teleport(loc); //THIS IS NOT WORKING
debugLog("seat after: " + mainSeat.getLocation().toString());
what kind of entity is it
armor stand
not what he asked! This isn't paper discord
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
bla bla bla
how do you get what a skeleton or stray is trying to shoot at and launch a projectile at a realistic trajectory
Hey, I was wondering, are events thread safe? Can I rely on calling events inside a runnable?
Only if you Mark them as async
My use-case would be loading a map from a map template and throwing an event when it finishes, does it make sense? is there a better way to do it?
wait for load and when its done call the event on main thread?
hmm, wouldn't that block the main thread?
how do you check what a mob is aggroed onto
callback 😛
anyone know
btw its checking inside of a runnable
LivingEntity#getTarget
well ig it technically doesnt have to
theres no livingentity.getTarget()
well there is in docs but for some reason its not showing up in intellij
@waxen plinth
Don't ping me please
srry
What version are you using
That should work
¯_(ツ)_/¯
Its in CreatureShootBowEvent but idk if that has anything to do with it
since its supposed to be showing up anyways
cuz its livingentity
do you have any depenencies except spigot
nope
hello, i need some help,
i created a hammer, but i can break in protected zones (worlguard...)
i fixed priority to lowest and returned if event get cancelled
anyone can help me ? (please ping)
LivingEntity doesn't have getTarget. You need a mob
is there a line of code that lets the server catch up in case it is running behind?
ah yes
server is lagging
just execute this line of code
and it would not lag again
btw how do u trace a vector to a block ik its like vector - loc or smth but i cant remember
Sounds like you need to delegate your tasks to another thread if it’s hanging the server up
Just use Bukkit.fixServer() of course
is there any way to generate UUID based from objects instance (not random UUID) easily?
no what i meant is that after running the code it lags behind and tells me 'is catching up'
i was curious if i could force that to happen midway through to reduce impact on players
that's server lag
you cant just tell it when for server to lag
i want to know if i can check how many ticks the server is lagging behind
on another tangent are there non deprecated methods to create asynchronous tasks
use bukkitrunnable
Bukkit.getServer().getTPS()
iirc to get the amount of ticks/second
subtract that from 20
and you'll get how much the server is behind
it could be both ran synced and asynced
?scheduling :p
dammit
cant remove blocks in async task
wait does running a synchronous task still slow down the main thread?
yes
yes it does
DAMMIT
Well create a workload distributor
^
In very simple terms, it seems to distribute the large load into smaller increments executed one after another
Rather than executing multiple asynchronous operations
That’s not what I said
but that causes a lot of lag
I said small increments executed one after another
That’s synchronous
Not asynchronous
For example, do blocks 0-20 on tick 1, 21-40 on tick 2
Etc
for some reason this is always making it shoot in one specific direction, and all knockback is done towards that direction, no matter what it is from
LivingEntity target = ((Mob) event.getEntity()).getTarget();
Vector motion = event.getEntity().getLocation().toVector().subtract(target.getLocation().toVector());
Arrow arrow = event.getEntity().launchProjectile(Arrow.class, motion.multiply(3));
To reduce the lag
Do I have to remove player onLeave from BossBar via bossBar.removePlayer(p)?
issue with that its fairly slow. I need to change ~10k blocks on each ChunkLoad
issue with that being is that doing it with world edit would require me doing that for every chunk manually
which is a lot worse
since the affected area are 55 region files
Tbh, 10k blocks per chunk load does not seem like a great idea…
Well then you have no other options
I suggest to still use the worker distributed thing
And I strongly discourage against using FAWE
can someone help me fix this idk why it always shoots a specific direction
how would i distribute a loop then?
int x,y,z;
Material m;
BlockData d;
for(x=0;x<16;x++){
for(z=0;z<16;z++) {
for (y = 1; y < 126; y++) {
block = chunk.getBlock(x,y,z);
m = block.getType();
if(set.contains(m)){
if(m == Material.BONE_BLOCK){
d = block.getBlockData();
block = chunk.getBlock(x,y+128,z);
block.setBlockData(d);
... }
is it safe to generate type 3 UUID based on object's hashcode
UUID.nameUUIDFromBytes(Ints.toByteArray(object.hashCode()))
something like this
i want to generate object instance UUID since some objects that im working with could have prebuilt UUID's while some could not
launchProjectile exists
it has launchprojectile
*is
but the launchprojectile doesnt make it shoot up
if u jsut use it
so it needs a vector
up?
the thing launches the projectile in the direction they are facing
but for some reason mobs dont look at a pitch when shooting (or is it yaw idk what its called)
oh i just found out its spamming null pointer exceptions
fun
okay does anyone have an idea why this happens?
[22:13:32] [Server thread/INFO]: Handling chunk (699/1131) ... it is 1639430012532 Slept for: 330
[22:13:33] [Server thread/INFO]: Handling chunk (700/1131) ... it is 1639430013060 Slept for: 528
[22:13:33] [Server thread/INFO]: Handling chunk (701/1131) ... it is 1639430013418 Slept for: 358
[22:13:34] [Server thread/INFO]: Handling chunk (702/1131) ... it is 1639430014019 Slept for: 601
[22:13:34] [Server thread/INFO]: Handling chunk (703/1131) ... it is 1639430014334 Slept for: 315
[22:13:34] [Server thread/INFO]: Handling chunk (704/1131) ... it is 1639430014664 Slept for: 330
[22:13:34] [Server thread/INFO]: Handling chunk (705/1131) ... it is 1639430014991 Slept for: 326
[22:15:46] [Server thread/INFO]: Handling chunk (706/1131) ... it is 1639430146602 Slept for: 131611
Why does it need like 2 minutes to paste a frigging 16*8*16 structure?
time is in milis
idk probably doesnt wanna work until all the chunks needed are loaded
im not very good with generation lol
so i have no idea
cant be it
i desinged it so that the structure stays inside the chunk its generated in
o
generating the structure is the only difference between 706 and the others
can someone look at this and tell me why it takes like 2 minutes? both red and blue are roughly 16³ block structures
Biome biome = chunk.getWorld().getBiome(chunk.getX() << 4, 64, chunk.getZ() << 4);
boolean warped = biome == Biome.WARPED_FOREST;
Structure struct;
File file;
if(warped){
struct = blue;
}
else{
struct = red;
}
struct.place(chunk.getBlock(0,(int) (128 + 100*random.nextDouble()),0).getLocation(),false,StructureRotation.NONE,Mirror.NONE,0,1,new Random());}
gonna need to see slightly more coe
where exactly is blue and red defined
?paste
static Structure blue=null;
static Structure red=null;
//in method before loop
blue = getServer().getStructureManager().loadStructure(this.getResource("nether_house_blue.nbt"));
red = getServer().getStructureManager().loadStructure(this.getResource("nether_house_blue.nbt"));
what method is that
thats directly before the other code
it's calling that method on a subset of the chunks total
it needs around half a second without calling that method and two to three minutes if calling that method
and i just dont get why
its literally just placing a structure
and checkign what biome is at 0 64 0 in that chunk
have you actually tested what specific part of the code is slow
also i dont understand why you define a static variable in a method when the static variable is the same
its outside of the method because i thought maybe its the loading of the structures
but its still slow
would HashMap<UUID, WeakReference<List<Punishment>>> more or less equal WeakHashMap<UUID, List<Punishment>>
ah okay, thanks!
What reason do you have to weakly reference a list?
how can i use the ClientboundAddEntityPacket Class with a empty constructor?
I mean... if it doesn't have an empty constructor, you can't
Hi
oh this is bad
Which is your preferred IDE?
for 1.17 or 18
doesnt matter
Can anybody help
We are literally helping you rn
Lmao
I am saying that the IDE does not matter based on the mc version you use
10 cents they don't know java
^
Is this really important?
??
IDE makes it easier to recommend a tutorial
oh sorry i answered rhe wrong message
Is this really important?
does eclipse have native maven support yet
Probably asking for ide specific instructions
without a plugin
Yes, so they can be directed to a relevant tutorial
it is in every release now
ic ic
sometimes it can be directly to a toxic discussion about whats the best IDE
I swapped from eclipse to intellij because of the lack of native support for maven when i used it
I actually found the first thing I dislike about Eclipse today. No nested module support 😦
vscode is garbage even for the languages its meant for
Is it hard to make a plug-in
Netbeans is the only ide with actual native maven support
If you know Java no.
the answer is simple, intellij 😎
Neither eclipse nor intellij are 'native'
well fuck now I gotta learn Java
I mean
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
tbh I just consider 'native' as in I don't have to install an external plugin to use it
How long would it take to learn
how can i get a net.minecraft.world.entity.Entity ?
6 months to be decent, with effort
idk when I used eclipse I had to go to one of their plugin pages and do smth funky to get it to work, either that or I was being dumb
Ima just pay someone to make me one
think ive just always used gradle tbh
i still running eclipse, the thing that I meant is that there could be some developers that can drop you shit only for say this
I like Eclipse for home use and single dev projects
recently ive been trying to migrate to a vsc dev env
to uninstall some programs
pretty good handling gradle projects i got but its intellisense is.... subpar
I like eclipse when I need to develop on something with less-than-decent hardware
since it has a lot less overheard
intelilj is an absolute beast, which also means it uses a ton of ram for features most dont even use
^
i think i used it use it for 4gb of ram and it worked just fine
hotswapping took ages but... hotswapping /shrug
id like to think i use most things that intellij offers but idek ll
feels like i always find something new
Yeah
its also actually only 1 out of the 2 IDE's that support full kotlin dsl gradle too
the other is android studio
Eclipse is terrible for Modules though. Have to use working sets and they are stored as separate projects.
Im going to be honest here. I used to complain about how intellij only allows 1 project instead of multiple. I am starting to like 1 project view better
I need to actually look into how modules work in intellij because I've tried like twice to make 'em but I always frick them up somehow!
smh
Cause of how many files and everything
dont you just right click parent module, then click new module
lol
how to import nms?
Run that first
i did that
i love 1 project per window
i did that too but its not recognizing the method
beats whatever the fuck eclipses "workspaces" are
yeah lol
can i see your build.gradle
or pom.xml
or build.gradle.kts
lol
1sec im reloading the ide atm
I just have everythign in one worspace
pom.xml contains both <artifactID>spigot</artifactID> and <artifactID>spigot-api</artifactID>
its indexing rn
that doesnt tell me anything
i need a full file
smh lol
we need to make sure everything is right
public static void setBlockInNativeChunkSection(World world, int x, int y, int z, int blockId, byte data) {
net.minecraft.server.v1_14_R1.World nmsWorld = ((CraftWorld) world).getHandle();
net.minecraft.server.v1_14_R1.Chunk nmsChunk = nmsWorld.getChunkAt(x >> 4, z >> 4);
IBlockData ibd = net.minecraft.server.v1_14_R1.Block.getByCombinedId(blockId + (data << 12));
ChunkSection cs = nmsChunk.getSections()[y >> 4];
if (cs == nmsChunk.a()) {
cs = new ChunkSection(y >> 4 << 4);
nmsChunk.getSections()[y >> 4] = cs;
}
cs.setType(x & 15, y & 15, z & 15, ibd);
}
yea thats where i am
havent touched maven for a while so idk, but i didnt need it before
but still doesnt find it
did you create the method?
b r u h
Well according to the forum
- it is unstable
- Does not perform light update
- Does not send updated blocks to player (requires a relog)
- Does not work if specified coordinate is in a not loaded chunk
idfc, i just need the blocks there
its supposed to block up the upper half of the nether
the reason im doing this in the first place is because for SOME reason even setting like 9k blocks per second causes my server to lag behind massively
and its not like its a bad one
4G ram and a cpu that's usually at like 9%
aaaaaaand scrape there's no such thing in the 1.18 nms anymore
@paper viper is the full NMS list avilable somewhere? I dont want to spend like 2 hours searching for the correct path
can you somehow make LivingEntity#damage not call damage events?
Hello,
someone know how detect if player is behind block during TNT explode?
Everything works but is player is behind block then is also pushed...
This is my code:
public class ExplosionEvent implements Listener {
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false)
public void Explosion(EntityExplodeEvent event) {
Location loc = event.getLocation();
double radius = SettingsStorage.getInstance().TNT_RANGE;
if (loc.getWorld() == null) {
return;
}
List<Entity> nearbyEntities = (List<Entity>) loc.getWorld().getNearbyEntities(loc, radius, radius, radius);
if (event.getEntityType() == EntityType.PRIMED_TNT) {
double hf = SettingsStorage.getInstance().TNT_HEIGHT / 2;
double rf = SettingsStorage.getInstance().TNT_RANGE_FORCE / 2;
for (Entity entity : nearbyEntities) {
if (entity instanceof Player) {
pushAway((LivingEntity) entity, loc, hf, rf, event);
Common.broadcast("You are pushed");
return;
}
}
}
}
void pushAway(LivingEntity player, Location l, double hf, double rf, EntityExplodeEvent e) {
final Location loc = player.getLocation();
double distance = e.getYield() * 8.0f;
distance *= 1;
double hf1 = Math.max(-4, Math.min(4, hf));
double rf1 = Math.max(-4, Math.min(4, -1 * rf));
player.setVelocity(l.toVector().subtract(loc.toVector()).normalize().multiply(rf1).setY(hf1));
final EntityDamageEvent DamageEvent = new EntityDamageEvent(player,
EntityDamageEvent.DamageCause.BLOCK_EXPLOSION, distance - loc.distance(player.getLocation()));
Bukkit.getPluginManager().callEvent(DamageEvent);
}
}
I am having auto completion/hints issues on intelliJ idea. It works for some namespaces but for others does not work.
any clue how to resolve it, I created multiple projects, re imported libs but no luck
Hi, I'm trying to update a plugin that was discontinued and I noticed they use the import org.spigotmc.SpigotConfig, which is throwing an error since it doesn't exist in the API. Is there a way to add a gradle dependency that has SpigotConfig, or will I need to find a way to rewrite whats there? I can send a github link to the file if needed, since the plugin is open source.
The spigot config is implementation detail /shrug
it is pretty just a plugin accessing server internals
I might just try commenting out the code and the import and see how much it breaks things lol
why does paper not have async chat
This is Spigot not paper
you're in spigotmc
And it does for the record
So does vanilla
Hey,
I'm currently trying to make pigs follow a player when hit.
I was able to cancel out the panic state, but using setTarget does nothing.
The pig just walks around normally instead of following the player.
Any ideas?
setTarget requires them to be attacking mobs
You probably need NMS, or some weird runnable logic
Does anyone know of a good data structure for storing a group of strings, and each of these strings would be weighted
I'm struggling to put this to words. I just need a group of strings, and I need certain strings to be picked more often than not
I don't need order, nope
You could have each string have a specific range from 0 to 1
then pick a random decimal between 0 to 1
for example:
This is for a custom structure handler for handling variants of the same structure, need to grab some namespaced keys more often than others
"dog" -> 0.0 - 0.7
Iirc I used NavigableMap for this
I'll take a look at that
Anyone know any alternatives to libby? Looks like it hasn't been updated in a while https://github.com/Byteflux/libby
There is slimjar which supports java 16
and repos other than central
but it currently has a gson issue
i made a mini library that supports relocation, dependency installation, and loading
but it doesnt get dependencies of dependencies
For reference: https://github.com/slimjar/slimjar
Im assuming you cant use the libraries feature
in plugin.yml
but nowhere near as many features lol
Wow I didn't even know that existed, but it looks like it's only for maven central dependencies
This looks pretty good though, thank you : )
Its broken rn sadly tho
Oh, ok :/
I now did it with velocity.
The pigs are now flying towards the player, but that's way funnier and more fitting for what I'm trying to do anyway 🤷
was working a bit ago, but the author is busy in college right now
i used to use it. it was perfect and supported java 16 and everything
so i had to develop a mini subsitute
Oh
You have to make some changes to the source
yeah
your entire project depending on your own repo is opposite of what you'd want tho
wdym
is there a spigot method for simulating placing bonemeal on a block?
No need
c++ is just too slow for a game server like minecraft
huh
lol
lol
...
Skrigot
I think minecraft should be written in node
The project is maintained by a single dude
Bukkit is written in Java anyways
minecraft should be rewritten
Why?
^
^
^
^
Java works very good
but java edition is more expensive
In terms of?
And?
price for account
java kinda sexy tho
so why they not optimize the game
They do?
or business experience for that matter
but ik a thing or 2
I cant code shit but ik the answers to some things
I dont have patience thats my struggle
the amount of work to rewrite the entire java version into c++, keeping 100% compatibility with each current quirk
Guys i know how to walk but i dont want to do it
Pulse
aid
keep ur mouth closed
Obviously you’re just guessing a lot of stuff aid.
woah
dont start shit it this discord
that's powerful
aid keep a friendly tone please
they're constantly optimizing it
^
and spigot is more optimized than vanilla
and paper is more optimized than spigot
.
cap
Conclure yes thats friendly if ur disrespect
u know thats being biased and you're getting reported 🤣
Anyways aid, since you seem to be knowledgeable about these optimizations, why not tell mojang yourself?
we have ourselves a game development expert right here
I did
Oh okay
LOL
mojang didnt respond
a surprise
i wonder why
your suggestion probably was over their heads
they don't know what they are doing obviously
not on your level
you guys just lack the brain water to even begin to comprehend aid's insight
The content is way different than what they offer
some disrepect in here
yes
yea
so expensive
25$ and you get free updates forever
Just wash the dishes my guy
I bought this game once and I've put well over 20k hours into it in the last 11 years
talk about replayability
its more expensive though tf u on about they should focus on java edition if anything
I paid $0.00004002 for every hour I spent playing this game
ive played like 10 hours of minecraft this year
Anyways aid, surely Java, or well the jvm has some overhead, however features like garbage collection make the production much faster which allows the game to develop quicker, personally I prefer more updates of content being delivered faster rather than the game use 10% less resources or something.
The community also developed some seriously sick performance optimizations
both client side and server side
ye
Tru
so idk what the issue is
but the real question is where is the sound going from all the mobs being ticked
what
like the sound of mobs
clearly
also thanks for the recommendation baby girl this works beautifully
sound
like explosion sound
Negligibly
not really
no like 10k + tnt
What takes up server resources most is probably ai and world related stuff
⚡️✨(FREE) spigot sound optimization [ASYNC] ✨⚡️
no but people asking about 0.5% of a tick sounds sending take might
so I am just promoting my fork here
or just disable it ?
if its not recommended for the gamemode
Where do I test this shit
sound packets are so incredibly cheap, worrying about them is just not good
tnt is a different story
yes
I don't think the sound would be the main issue there
^
^
Im not talking about the main issue
the sound would still be completely irrelevant
the sound wouldn't be the issue, the performance issue would come with it modifying an area of blocks and entities in the explosion radius
the amount of block lookups, entities that spawn and need ticking etc
i return again asking for help.
I was having issues with chunk loading in 1.18 and when i asked about it here the suggestion was that it was a 1.18 issue, not a spigot issue, and that 1.18.1 fixed it. I am on the newest 1.18.1 spigot version and the problem is persisting.
My tps is not dropping. htop is fine. running a fresh timings rn.
But basically, anything that forces the server to load chunks chokes the server. everyone rubberbands back about a second. so every player join, death, portal..... moving in a boat over water...
All of my chunks are pregenerated.
This is on a server, ive capped the player limit at 12 for the time being, bc around 15 it begins to fall apart. too much movement from players. Is this a bug we know about/are working on? or should i be reporting it somewhere?
😄
i rent a datacenter machine btw, its not a hardware issue. we used it for 1.17 and could hold about 20-25 players before tps started to drop.
But yes aid, speaking of performance and saving resources, disabling sounds in the client will decline the usage of resources by 0.01% so might wanna do that
because 1 thing I noticed
even ingame options of the client
send packets to the server
Interesting did you have any report or sample on it like from spark or timings?
That’s indeed the case
im running timings rn. i can post in 5-10 minutes. wanna make sure it catches it happening.
Sure, though I’d suggest using spark 🍿
but what im trying so say f 3 with all that info of chunks and shit the server is constantly updating it so what if I delay the client info by 3s so its not updating every sec
i can add that in before the next restart. which is at the hour 🙂
Then the client will experience outdated data
Or well the other way around could possibly also be the case if you got a weird client
ye i got 1 xd
see I just need to work with a dev and I can come up with weird optimizations I love problem solving
Anyways I need to head off, be a good guy and someone might pick you up on your request concerning spigot in cpp
how should i make shield reduce damage only by 50%?
since damage modifier is deprecated, i have no idea to do that
Reduce all damage?
Not sure
but i want it to reduce only 50%
e.setDamage(EntityDamageEvent.DamageModifier.BLOCKING, e.getDamage(EntityDamageEvent.DamageModifier.BLOCKING) / 2);```
i want this but without DamageModifier
any idea?
i have a heapdump from spark to try and figure out what my issue is... but yeah. not sure how to parse this. about 5000 warnings for 'failed to resolve object id 0x--------'
if anyone is around that would be able to assist 🙂
im dumb. i found the profiler/dump summary. i got this now XD
?paste
When the return false is activated it says /trust in chat
Does anyone know why?
On line 28
return false prints the usage message in chat
Return true instead
Ok
I'll try it
Oh wow thanks it works
Also
Whenever I build the artifacts I have to stop the server then start it or else the files won't replace, Is there a way for me to update the plugin but not have to stop and start the server?
wait you can replace it
and not restart server
and new changes are applied?
how lmfao
/reload
ur weird
my server yells at me for using System.out.print and I try using JavaPlugin#getLogger and it doesn't work
why
Define doesn't work
paper complains not spigot
How do I send an image?
To be fair
simply does not work
It is right
Yeah
I don't care, I don't want them bullying me in to using better practices
logger.log(Level.ALL, msg); but this does absolutely nothing
I've never tried the ALL level
what level works
This is the error
warning and severe work
idk those are the only one's I've used
ok. if anyone can help with the above issue. I have two different spark profiler reports. one where i let the server run normally. and one where i had a player log in and out a couple times very quickly to force the issue.
I dont know if this is an issue I can solve. but something is wrong.
Normal gameplay - 8-10 players
https://spark.lucko.me/KPBHnV2Bu2
Forced issues - 9 players
https://spark.lucko.me/KPBHnV2Bu2
it seems to filter down to
jdk.internal.misc.Unsafe.park()34.52%
so half the used tick during the problematic report
if (target == "accept", "deny") { } This doesn't work what would?
If the targets name equals accept or deny then activate
first off
idk what language ur smokin but that doesnt fly in java
Yeah...
why are you comparing to a string with ==
Idk
what are you trying to do
if (target.equalsIgnoreCase("accept") || target.equalsIgnoreCase("deny")) {} u gotta compare them individually with ||
|| means or btw
Oh thank you
alerithe i got a new error today
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
yeah but that would be a life changing with it does something like target.equalsIgnoreCase("accept", deny) lol
or just look into their code then made a String... string method hmmm
uh oh
hi, i want to make a skript that allows that when you step on a specific block, it spawns an item with a specific delay and spawn count. Thanks
Ask in the skript discord
can u give me the link? i cant find it
Literally just google "skript discord"
Does anyone know if there is a more efficient way to check for an inventory click event for a gui, than I used in my plugin here: https://github.com/Code12x/WorldTP-For-Multiverse/blob/master/src/main/java/com/code12/worldtp/listeners/InventoryListener.java ? I was using the timings command in spigot and the inventory click event looked to be higher than it should be https://timings.spigotmc.org/?url=piziqagafu. I'm trying to improve the efficiency of my plugin, and whenever someone uses the gui to teleport to another world, it lags for a bit.
if (Biome.valueOf(element.getAsString()) == null) {
continue;
}```
Can I not null check an enum? I keep getting an IllegalArgumentException for this, is there a good way to check to see if an enum exists? How much of a sin would it be to use a try catch to check if the enum doesn't exist?
You can turn the enum values into a set and use contains
Or just catch the exception
is there a event called "standing" like give a item to a player when they are standing on a block for 10 sec
No
what is it called then?
There isn't an event
You would probably use either a runnable or the player move event
that's all I needed to hear
but for example, i want to give a player an item for each 10 seconds he stands there, what do i do?
runnable
?scheduler
?scheduling
It dosent exist
lol
srry im new
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
i just stared now
Do you know Java
this is not the place to get support for skript
Don't ask us about skript
kk
BuildTools is supposed to add craftbukkit to my local maven repo, correct? It was able to do that for 1.14 and 1.15, but no other version I try downloading seems to add it to the local maven repo.
Well I don't need it now, but I was gonna need it to update a discontinued plugin that had a lot of NMS stuff from 1.14 to 1.17. I only needed to edit a few lines in a specific class, but seeing as I didn't have the dependencies, it wouldn't compile. I found a way to edit the bytecode of the class in question directly, so I didn't need to do any recompiling (which was super hacky and I'm surprised it even worked lol)
when i add a vanilla enchant to an item with one of my custom enchantments, it removes the custom enchant
how can i prevent this
"custom" enchantments are generally unsupported
That being said, they shouldn’t just disappear
Are you sure it isn’t just visually disappearing
There's no nbt ok bukkit itemstacks created with new ItemStack, right?
wdym visually disappearing
in the lore
what does that mean
Right
I mean you probably should use PDC for enchantments
ok
But it will be harder to support other plugins that way
Yeah
I wanna code a pdc wrapper that supports 1.8-1.18 for poor legacy buddies
I do prefer the hacky way myself tho
what is pdc
?pdc
Don’t encourage them :p
hmm right
Hey! I am developing a simple maploader. I see bukkit doesn't like the world's directory name. But, why could be so?
This is the name: 9b9a6c37-c613-4806-a02a-8841cf27ac91__1639463605 it does not seem to be what the error message indicates. Could it be the length?
[03:33:25 ERROR]: Failed to load map. Temp map id: 9b9a6c37-c613-4806-a02a-8841cf27ac91__1639463605
[03:33:25 WARN]: net.minecraft.ResourceKeyInvalidException: Non [a-z0-9/._-] character in path of location: c:\users\jose\desktop\mctest\plugins\hardgaming-test\gamemaps/temp/9b9a6c37-c613-4806-a02a-8841cf27ac91__1639463605
[03:33:25 WARN]: at net.minecraft.resources.MinecraftKey.<init>(SourceFile:41)
[03:33:25 WARN]: at net.minecraft.resources.MinecraftKey.<init>(SourceFile:46)
[03:33:25 WARN]: at org.bukkit.craftbukkit.v1_18_R1.CraftServer.createWorld(CraftServer.java:1118)
[03:33:25 WARN]: at org.bukkit.Bukkit.createWorld(Bukkit.java:588)
[03:33:25 WARN]: at loader.MapLoaderAsync.lambda$loadTempMap$0(MapLoaderAsync.java:46)
[03:33:25 WARN]: at loader.MapLoaderAsync$MapLoadProc$1.run(MapLoaderAsync.java:107)
[03:33:25 WARN]: at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftTask.run(CraftTask.java:82)
[03:33:25 WARN]: at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:415)
[03:33:25 WARN]: at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1255)
[03:33:25 WARN]: at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:428)
[03:33:25 WARN]: at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1206)
[03:33:25 WARN]: at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1034)
[03:33:25 WARN]: at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304)
[03:33:25 WARN]: at java.base/java.lang.Thread.run(Thread.java:833)
You are trying to make a resource key with a bunch of invalid characters
Why are they invalid? They are all of the format [a-z0-9/._-]
\ isn’t
oh, that is weird, seems I will have to work with relative paths then
Why not just use the ending part
just use the other slash
String name = plugin.getConfig().getString("player-name");``` what i should put in plugin place
your main class that extends JavaPlugin
net.minecraft.world.level.block.Block.a(int) -> returns IBlockData
Is there a list of mappings from int to block? I havent found anything
I mean, you could always use int ids
Why do you need it though
im fairly sure passing a int instead of a item is faster
And what are you doing that is so performance critical that you can't even use an enum over an int
nothing
but i cannot pass that as an argument
to that function
so i need to either use int or another nms class as argument
im trying to get IBlockData
No
What are you trying to accomplish
What is your goal
Spare me the details of your current attempt to solve it and tell me the actual problem
?xy
Asking about your attempted solution rather than your actual problem
I just want to set IBlockData to set a block in the world via nmsChunk.setBlockState, since the bukkit method is too slow (speak server crash).
The problem is that the function initializing IBlockData only takes weird arguments - which do NOT include ItemStack or Material. The functions basically all refer to either other IBlockData (probably for rotation and stuff) or an int as valid inputs.
The issue with that is that that int? There's no list ANYWHERE telling me what int to input for what block and I'D rather not iterate over all the ~1200 blocks Minecraft has manually
ah
You want to fill every chunk in the nether with specific blocks?
upper half with netherrack and one layer bedrock