#help-development
1 messages · Page 1166 of 1
Door this block yea?
I can get mode material using plugin and block data as string
?
I know somehow protection private plugin can protect mode blocks
But I think he not check material
He just protect range
Outdated maven plugins, Not relocating jconnector and why are you using the ant plugin...
If you’re using maven for your Spigot plugins (which you should do), it’s easy to make maven automatically save your plugin’s .jar in your plugins folder. There’s two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...
This is off github
?
ant is crazy
It's using the antrun plugin to move the jar to the plugins folder
Yeah I know
Which is a bad idea
I'll change it to apache
I used jar plugin for a while. Then I needed to do relocations and it turns out the maven shade plugin can as well put a jar into the plugins folder.
Anything else? Or you think that is the issue?
that's the issue most likely
Okay let me have a look tysm Olivo
Not relocating will conflict with the old bundled version
and antrun might move non-shaded jar
If it fixes you are a life saver
Hm
as for the outdated plugins it's generally a good practice to keep them up to date
Could be the issue because I have the mysql driver as a dependancy
That's fine as long as you relocate it
"apache" isn't really specific enough but I assume you're following the guide I linked
Hmm just wondering why you want to shade mysql connector into your plugin? Doesnt spigot include it already? (Except if you are on an older version)
but iirc mysql-connector has a GPL license so shading it and using it has some limitations
bukkit has a gpl license too
so, not that much change
lol nice
so basically if you break their terms of service your break spigot's as well
Yeah gotta find solutions when you are on 1.8
I am using a modified version of the server anyways so I might just add the sql connector to that instead
Instead of adding it to every plugin
Hello, how can I download spigot to obf mappings for 1.7.10 ?
I already tried spigot-mappings-downloader by @shadow night, but well, it doesn't want this version
its just to old
there are spigot mapping for this version, right ?
huh
or maybe I can generate spigot mappings by myself ?
lemme check
BT doesn't support this version, and there is nothing in the builddata git
like, if I have the spigot jar, and I have an obfuscated jar, I can do mappings between both, right ?
but the spigot jar will have spigot mappings, and the obfuscated jar will be the minecraft default server jar, which is obfuscated
Why do you need the mappings?
I want to switch a spigot 1.7.10 server structure to mcp mappings
because my modified client use mcp mappings
you could try to get the build number of the spigot jar, maybe it's still on https://hub.spigotmc.org/versions/
where can I find the correct build number ?
try /version, Idk tho
Don't forget that you cannot redistribute Mojangs code
I know
I'll not distribute it
That includes the compiled jar so you'd need to get a patch system working
for sure
I wonder if I can build b1.7.3 with the correct build number
idk
I'm searching the good jenkins build number but well
pretty difficult, idk how to use jenkins really much
253 (from 2015) appears to be the oldest version still available
You can go through the git history manually and find the versions you want though
that's ancient
I've found bukkit for 1.7.9 anyway
LMAO CRAFTBUKKIT
@cinder abyss can you send me that spigot jar in dms?
for sure
Just look at the stash repo
?stash
https://paste.md-5.net/ahidavicux.xml
I did shade and I get the same error main artifact doesn't exist
This is latest xml with obviously different file location
sadge
perfect then thanks
You did not follow the link I sent
What part am I missing?
it's 1.8
I'm cooked
where tf are spigot versions before 1.8
Use the proper way
md5 got some crazy dark sides
Hm okay
Gone
hey, does anyone know if it is possible to make mobs climb like spiders naturally? I tried implementing everything Climbing related into a custom mob class, but everytime the Mob goes to a wall, everyone in the world gets kicked..Network Protocol Error, but no visible errors in the console.
Looks like you're trying to send the climbing state as part of the entity data to the client
That's not going to work since the client doesn't know how to handle that
Aight.. ty, there a workaround or BukkitRunnable 🫠 ?
When placing concrete powder in water it places as concrete block (immediately changes before placing) and doesn't give off the BlockFormEvent. How can I prevent this?
That causes a crash complaining about not defining it..
on the client
yes
meant error not crash, sry
im a bit confused, if i dont set it, how would it know when to climb?
Aight, but tbh I dont even get where the spider or mob is "climbing". Is it happening somewhere else when the specific flag is set? Couldn't find it... But I just checked, I thought the spiders somehow know they can climb and have a different pathfinding, but turns out they just do it when they face a wall..
looks like
Does anyone know if it's possible to remove the sound that plays when you break a block, and then replace it with something else?
Resource pack
It’ll be multiple sounds though, different block types have different sounds
How can i change a player skin and update it for every online player, because when i change a player skin the player who changed it can see it but every other player still see the old skin, or if they die or rejoin, they see the default skin
I believe you need to send a remove player packet and then add player packet with the modified gameprofile
I tried, doesn't seem to work, even because from what i noticded so far is that once i change the gameprofile it stays like that so shouldn't it already get the updated skin when a player joins and loads the player with the updated gameprofile?
Is there a way i can listen to https://wiki.vg/Protocol#Acknowledge_Finish_Configuration ?
PacketEvents or ProtocolLib
-# or inject if you're willing to do the bytebufs yourself
Shh
I want to make a packet system that requires only a bit of reflection
It should be doable
Idk, doesn’t it require doing it 100% manually
Ie encoding the packet id and length yourself
is it possible to do packet stuff without an external library or NMS
yes
just the spigot API
no
because it is possible without external library .... you would need some NMS or Reflection stuff true
yes but you would need to know where which nms stuff is ...
View mod dependencies; Search up mappings; All on your web browser instead!
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
yeah i know that stuff, but for him its not obvious maybe and also it could change at any time
Can't search for methods and fields on mappings.dev :p
You can on Linkie :p
Nerd
You're the nerd
You should be able to use reflection to get the bytebuf constructor for a packet
And then go from there
Just do this with inject:
have a list of all constructors, run through all of them with the bytebuf in a try/catch and reset the reader, and in the one that doesn't throw, take the output
🧠
performance 
What if I made my own mappings site that is better than both
Hmm
I like the name
Are you good at frontend? I can do most of the work, just can't css lmao
kek
no.
Understandable
I'd love to hear some feedback
good for searching classes, highly needs method/field searching. I see they are planned in readme but IDK when will it come 😀
tbh I'm not a big fan of having all the packages be the center of everything, and only having such a small search bar at the top, since the main use case is to translate mappings or search for something
but yeah, method/field searching as they said above
Linkie also has a stacktrace translator
What pathfinding goal can I use that if I hurt custom mob1, custom mob2 will get agro on me
if that's possible
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0, true));
this.goalSelector.addGoal(2, new MoveTowardsTargetGoal(this, 0.9, 32.0F));
this.goalSelector.addGoal(2, new MoveBackToVillageGoal(this, 0.6, false));
this.goalSelector.addGoal(4, new GolemRandomStrollInVillageGoal(this, 0.6));
this.goalSelector.addGoal(5, new OfferFlowerGoal(this));
this.goalSelector.addGoal(7, new LookAtPlayerGoal(this, Player.class, 6.0F));
this.goalSelector.addGoal(8, new RandomLookAroundGoal(this));
this.targetSelector.addGoal(1, new DefendVillageTargetGoal(this));
this.targetSelector.addGoal(2, new HurtByTargetGoal(this, new Class[0]));
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal(this, Player.class, 10, true, false, this::isAngryAt));
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal(this, Mob.class, 5, false, false, (entityliving) -> {
return entityliving instanceof Enemy && !(entityliving instanceof Creeper);
}));
this.targetSelector.addGoal(4, new ResetUniversalAngerTargetGoal(this, false));
These are the iron golems
maybe its:
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal(this, Player.class, 10, true, false, this::isAngryAt));
in the isAngryAt Method ?
how do i change the current version of my spigot plugin to 1.21.3 in the pom.xml?
change the current version to the 1.21.3 version ?
yeah
for example i use this: 1.21.3-R0.1-SNAPSHOT as version
change from my old version to 1.21.3
alright lemme try that
on this iteration of the site, most likely never, as including members of all namespaces in the search index would blow up its size by a lot, i.e. several megabytes
it's a statically generated site which ties my hands a bit
i suppose its the DefendVillageTargetGoal
oh yes i didnt see that
I'm using vaultapi to make use of economy, however. Is there a way for me to creaate a custom user account with the name "Tax"? Where all of the tax money goes to
I've not been able to succeed due to deprecation warnings
Could just use the bank system and add it to one of the admins
That would probably be the safest way
does the plugin that handles your economy not have an api to use?
silkspawners-v1_20_R1-8.1.1-SNAPSHOT.jar
is this supposed to mean that this is for 1.20.1?
Supports up to 1.20.1, yes.
1.20_R1 = 1.20, 1.20.1
1.20_R2 = 1.20.2, 1.20.3
1.20_R3 = 1.20.4
1.20_R4 = 1.20.5, 1.20.6
It would also be R1
ok
Doesn't this the revision number only change when the protocol changes or some shit
If you do have 1.0 please don't obtain spigot from illegal sources
no
Never do this, that's just kind of rude
i fixed it..
Stop being rudely annoying
People won't want to help you
It's advice for life kid
Fixed the versions. :p
When an update gets released but the revision number doesn't change, that means that the previous version will get overriden by the newer one in buildtools, right?
Usually that seems to be the precedent
Iirc the revision number has to do with protocol changes so that'd seem to hold as logical
is it reasonable to add something to the API that needs to play around with Registrys that are normally frozen after all datapack stuff is done ?
We need a bootstrap api
So you'd want to work in add some bootstrap api to spigot
It'd be best to have a completely separate loading interface this would be a different load step with a different main class
i dont want that xD i know it works to play around with the frozen registry
Unfreezing registries at time for plugin load should not be in the bukkit api
can someone help me build this plugin to use on my server. I have no experience building plugins and keep running into errors in intellij:
https://github.com/PitSim-Network/PitSim/
would be: load: STARTUP/POSTWORLD/BOOT
Absolutely not
You want a different entry point all together
The server doesn't exist at bootstrap afaik
Very sure if it does exist at all nothing would work putting it under JavaPlugin would be beyond dumb
A bootstrap API should be very separate from JavaPlugin
It should be extremely discouraged to exchange any info between your bootstrap and runtime plugin outside of some constants
Ah, if only I knew what the registries were and how they work with the game. :p
what do you want ?
Pop open cb and look at main
They're frozen in the main method iirc if not it's very early in server declaration
I remember looking because I setup bootstrap for my toy implementation of an api
problem with a fully new boot api is the complexity to add/change stuff then
It's not really supposed to be easy because it's inherently different from the previous contract of plugins that entries weren't actually possible to be modified at all
can someone help me build this plugin to use on my server. I have no experience building plugins and keep running into errors in intellij:
https://github.com/PitSim-Network/PitSim/
I have been trying to build it my self for the past 2 hours and i keep hitting errors.
Gradle plugin. :cries:
It looks super outdated
So
Wot
i really just want to run the plugin on my server lol
it is the only one i can find that actually works
You talking about Minecraft.main()?
Cause I see some static methods to I guess load registry stuff.
Yeah
It's the non bootstrap main
Iirc it occurs right after bootstrap and the cli is parsed
It does
Mmmmm
i am so confused rn
Damn my memory is clearly not as bad as I thought
Same error
I created the profile
Stlil says main artifact does't exist
?
does anyone know how to build a gradle plugin
artifacts 👀
gradlew build
When I shade the jar, it still says main artifact doesn't exist
Send the exact error
Sure one minute, here is the pom https://pastes.dev/1pB0tJ784Q
What are the point of these registries?
Just to initialize stuff?
Which ones
Yes and sync between the clients
Some registries are data driven e.g. enchantment or biome
Meaning they can be modified by the server and synced to the client
Also building the jars just gives the same sql error saying the driver couldn't be found
What command did you run
Interesting.
Cause I'm seeing some stuff like flammable blocks being initalized and the @ selectors for commands.
Yeah that's why you're getting that error
It's even telling you in the message :kekw:
However if they were modified at plugin load time there is no guarentee stuff doesn't explode eventually
Isn't that the shade plugin
Especially as stuff gets more data driven
What am I supposed to use
Read the error message
Ah, so is that why I keep hearing things about registry freezes?
Yes they freeze before the server is created
I'm assuming this could be potentially useful down the road where you could remove or modify existing registry entries
I'm really confused on which part you are reffering to, I didn't run it from command line, I don't think I bounded anything to the lifecycle phase and I'm not sure what config it refers to at the end
I didn't run it on command line, I used the maven panel on the side
which runs it from the command line
oh lol
As the message says use the package lifecycle
Me when I comment out this line. :kek:
Do I need to add any <execution>s?
Yeah you can actually modify them at plugin load via reflection but the longterm effects of such actions are probably destructive
Ok I just mvn packaged it's fine
there are registries that wouldnt do a shit about modified later but some might kick the player because of stuff the player doesnt know about later registered stuff
It's safest and smartest to just create a separate bootstrap load
To manage this
Not to mention we don't want plugin developers being naughty during the regular lifecycle of the server too
would be smooth af but wouldnt allow reloads
Reloads aren't supported behavior:3
Remember that please
Would be nice if they were :/
if reloads are not supported behavior we just can unfreeze and modify :9
Designing around an already stupid "feature" is quite silly
We should be striving to improve the api not hinder it by adhering to already very known and possibly destructive behavior
Ah yes, like adding those AdvancementRequirements I've been hearing about.
is anyone able to compile remapped jar using buildtools? i tried via both gui and cli, for both i cannot compile 1.21.1+ versions
can i pay someone to compile this plugin for my server? it will take me like 5 years but someone else could prob do it in like 10 mins. https://github.com/PitSim-Network/PitSim/
?paste the full log please
No stop repeatably asking
29.99 cashapp
30.99 paypal
40.99 deliveroo
10 bucks paypal legit
Oof, I hope these integers are arbitrary values.
I think it's data versions
hello, i have a question, when i create a world and i tp the player in, it takes like 5-10 sec before the player get tped, can i avoid that and make the tp instantly?
minecraft uses DDA raytrace algorithm, no?
what's dda?
ray trace is just ray trace
i don't know what dda changes in this
ray trace blocks, ray trace models of the blocks/collisions
wait seriously?
sure
only problem is now i’m worried that it’s not even possible but im probably wrong
well accuracy, many different algorithms use different types checking collisions
my custom raycast I implemented didn't work in corners for example, now I want to learn the one mc is using
you don't pay if it isn't doable ¯_(ツ)_/¯
There is a YouTube video that Minecraft uses as well
I forgot how they're callled
I used this video as a resource: https://www.youtube.com/watch?v=NbSee-XM7WA&ab_channel=javidx9
The block is made out of pieces that act as collision
that is basically explaining this algorithm
Every block has a collision shape
Yup
A collision shape can be empty, simple (1 cuboid) or complex (multiple cuboids)
It's not really cheap, I even have a method that uses their detection if you're interested
could you just explain what AABB is and how does it relate to bounding box?
An AABB is just an axis-aligned bounding box
It's still a regular bounding box but 2 of the axis (x and z) are the same
oooh
yes please
@Override
public boolean hasHitBoxAt(Block block, double x, double y, double z) {
CraftBlock craftBlock = (CraftBlock) block;
VoxelShape shape = craftBlock.getNMS().getShape(craftBlock.getCraftWorld().getHandle(), craftBlock.getPosition());
if (shape.isEmpty()) {
return false;
}
double deltaX = x - block.getX();
double deltaY = y - block.getY();
double deltaZ = z - block.getZ();
AtomicBoolean hasHitBox = new AtomicBoolean(false);
shape.forAllBoxes((minX, minY, minZ, maxX, maxY, maxZ) -> {
if (deltaX >= minX && deltaX <= maxX && deltaY >= minY && deltaY <= maxY && deltaZ >= minZ && deltaZ <= maxZ) {
hasHitBox.set(true);
}
});
return hasHitBox.get();
}
I mean I know I can simply use World#raytrace... stuff but I am planning to do opengl anyway might as well implement it myself
nvm my interpretation of axis-aligned is dogshit
still makes sense but wtev
I have a cuboid class that also does edge detection with no included corners
. B
AXA
B
type shit
i'm unhappy that mojang doesn't have a collides method
and i have to use this method that keeps going even after collision
oooh that is aabb and I assume that when they call AABB#grow the just extend its size
this is a check to see if it's inside min max points
growing is probably to extend search
ok
@deep veldt Opinions?
👀 oh shit it actually worked
90k LOC on a 6-thread ryzen while running call of duty?
still slow
ur mum
can someone help in genral
draw 4
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!
why is chrome pulling more ram than call of duty
but did you get the jar and make sure it actually loads
it has like 19 dependencies that's not on me
i don't know how many tabs of chrome you guys have but i never considered browsers to consume too much
is there any way you can check the dependencies? i can pay for the jar later im busy rn
mostly regular plugins and a .jar I got from the original dev
hmm, 1.5gb
6 gb
how tf do you have 6GB used by chrome???
what in the
this is kind of a pain in the ass now that I think of it
how much ram do you have overall?
32GB
nah
There's some stuff that's outdated
And some other stuff that's just not there
so is it just impossible
Nah I found it
the fuck
are you saying that you have everything needed to run the plugin?
Technically yes but running it properly is a bit more complicated
You need a firebase account, mariadb/mysql and pterodactyl
firebase is crazy
yeah
i love advanced optimus tho
i don't know if it saves that much power tho
it's a laptop
but it's good nonetheless
if i play a game, it uses the nvidia gpu
all the others graphical tasks are on the igpu
of the cpu
ok so if I get it now AABB is basically a bounding box that is always aligned in the same direction and because that I can just check the intersaction area with the function above?
wait, but if you don't have a monitor connected to the igpu, how is it using memory?
there's no way that's the case
an iGPU will allocate 1gb at most, but that's when it is actually being used
It's hardware reserved
actually I'll make my own bounding box for the entity, because I don't want to rely on nms at all
why
just make 4 small spheres
unless you want it precise
but without nms you don't have access to body rotation
doesn't really metter, I am using a fireball that afaik is just a square or a really squary rectangle
You don’t need NMS for bounding boxes?
well it has it but if I know the size of the fireball and its location I can calculate the bounding box?
it's not on ancient versions of minecraft tho
just get the nearby players
or entities
players? I already get them, I need a custom block collision because the whole code is custom
?howold 1.8.8
Minecraft 1.8.8 is 9 years, 3 months old.
i'm not sure it's easy to do without nms in that case
you'd need to get the rotation of blocks and compute all the voxes shapes of all the possible blocks
waiiit that's true actually, not all blocks are full cubes lol
well I'll use nms then as I originally intended
Modern versions have api for that too 
there's api for blocks voxel shapes?
oh wait
there is
you can get all the bounding boxes and check if it interesects with any of them
yes that is perfect
not really happy with the api
it most likely having wraps of wraps
but i'm pretty sure the gc knows what it's doing
previously I didn't even consider that the e.g. stairs would have multiple shapes
i actually had something for stairs and fences
that was for 1.8.8
thank god i don't use it anymore
let me see if i find it
can we move this to dm?
go for it
this was my first ever project
there was no voxel shapes in 1.8.8
so i had to use the api to somehow fix this issue
fences and stairs would've ruined the gameplay
well I am thinking of just not considering the bounding boxes because the projectile is moving so fast that I see 0 difference if there is a different bounding box also because of the size
doing it prentending they are all solid blocks means I don't need bounding boxes right?
players will definitely notice
and before anyone says that i was repeating myself, yeah i know now
I can make the projectile go to the middle before destroying it if it is not solid/full
would this at least a little solve this (but yeah I know what would happen if the stairs would be positioned to the opposite side of the intersaction)
why not just java Block block; Location location; for (BoundingBox boundingBox : block.getCollisionShape().getBoundingBoxes()) { if (boundingBox.contains(location.getX(), location.getY(), location.getZ())) { //It collided break; } }?
i assume the bounding boxes are block shifted
i also assume by ray tracing you go in ~4 steps per block
I raytrace by 0.3
yeah I get it why that would be the problem...
so i bought the sourcecode of the plugin parkourrun. can someone help me to fix the plugin so it works again and that it works on 1.21.1
are you gonna pay the one who works on it too?
depends how much
lol
you can use the services on spigot forum in that case
i don't think anyone will fix it for free tho
doesnt matter. i want to pay but not to much
you considered this badly, if you really wanted to get a plugin made why didn't you just pay one to make it from scratch?
you would have more chances
sure but where can i find someone for it?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
the services thread
anyway, i wanted to fix some of the horibble code in the the past, which one do you prefer
probably i'd probably even separate shorten this even further
definitely new
hey I was looking into the mapview and maprenderer functions and I was wondering if there's a way to do a vanilla render on a map at a certain position
like if I just want to load a circle into a map?
but even your old code looks nice compared to my 1-year old code, i mean, back then i didnt even know what enums were and when i knew i used them but now i do it properly with classes instead of enum hell ;-;
i never used maps
lol ofc it's better
i assume you can render 2 maps and copy the vanilla render onto a your custom map?
i assume you can get the pixels from such a map?
I prefer the new code but I'd put the ternary in a separate method so the intent is more clear
there's a lot of ways to improve the code
i think a named local variable would be better than a separate method
there's no check for the other side
So on a minecraft mod it's indexing out from a change that was made, and it's happening randomly when someone joins the server
It's one of two pieces of code, and I can't post it here because it's too long
If you could help that'd be great
I'm very much on my wits end and don't know where to turn too for this kind of support, and spigotmc is known for their good support
paste bin the code
?paste
this is some pretty decompiled code
Yeah I know it's not the best
The original mod author gave me permission but not the original file
McCreator oh lord
yeah..
I'm doing the best I can with what I have
I basically jst need a mixin to patch this
I feel like this looks ugly
setTitle(TranslationKeys.TITLE.get());
Idk how else I'd do the .get() tho
😂
🙏 genius
Anyway so like, more on how I'm able to consistently able to replicate the indexing bug. When using the attack function in the mod, and someone tries to join. That's when it indexes
or do I stick with Translations.getInstance().getTranslation(TranslationKeys.TITLE)
And do you really need any of those superfluous consonants and vowels? Why not just TK.T
TK.TIT
YEAHHHH
T.I().GT(TK.T)
This is readable enterprise code
Man maybe I should go back and work on my greeting service
👏👏👏
too bad this app is going to be a real project or I might just take your suggestion
make a setTitle method that takes a Supplier
so you just hide the ugliness with abstractions
I don't believe it does
I couldn't find it on JFrame atleast
oh wait you thought haha Minecraft Title probably
I thought it was a method you had created
nope unfortunately I'm using Java Swing
private Frame() {
setTitle(TranslationKeys.TITLE.get());
setSize(800, 600);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
public static void start() {
SwingUtilities.invokeLater(() -> {
final Frame frame = new Frame();
frame.setVisible(true);
});
}
TranslationKeys.TITLE.apply(jframe)
🤢
I'll just leave it as is lol
I need to get the actual project contents first I suppose
Do I REALLY REALLY need the original source or no
if its with MC Creator you're pretty much stuck looking at horrific shit anyways
I am trying to make a plugin with nms of different versions using the 1.21 currently on server but I can't get the nms version from the server it gives me error.
Enabling Plugintest v1.0.0
[21:49:02 WARN]: [Plugintest] Versions1
[21:49:02 WARN]: [Plugintest] 1.21.1-R0.1-SNAPSHOT
[21:49:02 WARN]: [Plugintest] 1.21.1-2329-803bf62 (MC: 1.21.1)
[21:49:02 WARN]: [Plugintest] craftbukkit
[21:49:02 INFO]: [Plugintest] Package parts length: 3
[21:49:02 INFO]: [Plugintest] Part 0: org
[21:49:02 INFO]: [Plugintest] Part 1: bukkit
[21:49:02 INFO]: [Plugintest] Part 2: craftbukkit
[21:49:02 INFO]: [Plugintest] Failed to determine NMS version!
Are you running paper
You’re meant to just use the package name and append what you want for reflection
If you want the actual server version use Bukkit.getVersion or whatever it is
Tis what I used apparently
hmm maybe?
I can't even find out how to render a vanilla map with no custom renderers at a location
is there a way to get a list of all vanilla maps in the server
or an event when a player creates/activates a new map
i guess worst case I could check for right click while holding an empty map
I think I'm just going to reimplement vanilla rendering for what I'm doing, it'll be easier that way
how can I reload my custom maprenderer to a map when the item is re-loaded
https://github.com/JavierFlores09/block-display-test/blob/master/src/main/java/me/javierflores/blockdisplaytest/TestCommand.java#L40
can someone figure out why this doesn't work consistently. With or without delay, it doesn't matter, it is very inconsistent; I tried with vanilla commands, like this:
/summon ~1 ~ ~1 minecraft:block_display {Tags:["test"],block_state:{Name:"minecraft:sand"}}
/data merge entity @e[tag=test,limit=1] {start_interpolation:-1,interpolation_duration:40,transformation:{scale:[3f,3f,3f]}}
and it works consistently, so I'm unsure why the above wouldn't
Did you try a longer delay
I'm in the process
still, kinda sucks if that's the case lol
yep, it is consistent with 2 ticks
kinda annoying
final List<Player> playerListBad = this.getGame().getTeams().stream().collect(ArrayList::new, (accumulatorList, currentGameTeam) -> {
somethin2.addAll(currentGameTeam.getPlayers().stream().map(GamePlayer::getPlayer).toList())
}, ArrayList::addAll);
im poking around in a codebase and i have no idea what this means
and google dosent really help
I believe it means the person who wrote this code didn't know the map method existed on stream
if I'm seeing this correctly this could probably be rewritten as
final List<Player> playerListBad = getGame().getTeams().stream().map(team -> team.getPlayers()).flatMap(GamePlayer::getPlayer()).toList();
wrote this code in discord so it probably won't run but this is my best guess at whatever this is
This is why you don’t do streams kids
okay right
so this is my decoding of whatever the hell that was
(sent a ss instead of discord code block because id have to reformat the code again)
this is considerably easier to understand so, ill just use this lmao
fair
that's so much more understandable
Words muttered by the utterly deranged.
Methods were not meant to be CHAINED! Let them roam FREE!
this is just as readable
it is just unfortunately formatted
disagree to disagree 💪
var playerListBad = getGame().getTeams().stream()
.flatMap(team -> team.getPlayers().stream())
.map(GamePlayer::getPlayer)
.toList();
you're the one who wrote it lol
oh I thought you were saying the streams weren't readable vs the collectors only
I was trying to say that the stream approach was just as readable as the for loop
ohhh
yeah No I agree, but I feel like for loop prob requires a lot less knowledge of what the stream methods I do 🤷♂️
so probably more "readable" in that aspect
I guess one could argue it is less readable considering you got to have some inkling of compsci knowledge to understand what a map function does, however anyone who's done programming for more than 5 seconds knows what it does anyway
was just typing the exact same thing, stop reading my mind smh
the way the guy originally did it was crazy tho, it was a collector which was essentially a reduce to imitate a flatMap lol
I'm wondering what they were thinking when writing that tbh
like why even use streams at that point
probably chatgpt gone wrong, by looking at the amount of comments there
oh no that guy didn't write that I think
pretty sure he's looking at someone elses code
well, whoever wrote it used a LLM
hmmm I'd say its likely, but that guy also wrote the comments I think
but that is very LLM code
I wonder what chatgpt would do If I gave it this
nowadays llms don't blunder that bad with code so idk what the input would have to be tbh
lets see what ChatGPT 4o mini does
chatgpt
white mode
I don't have an account or anything
so I don't think I can do dark mode
I don't actually use AI in any capacity outside of optimizing search terms if I need to search a library database
correct
yeah i wrote those so i could get an understanding of what the hell it was doing (im not familiar with stream functions, but good to learn either way)
any way to make my logger have a colored plugin name
why
dont use colors in logger, use something like ConsoleCommandSender instead
I kinda just wanted my getLogger().info to stand out from all the other spam
and annoy your user even more
logs are logs, not advertising billboards
be concise and plain
im the only user
ctrl + F in the logs then
i love having purple warnings in my console
okay
anyone familiar with reflections library
I have a CorePlugin abstract class for my listener and command loading:
public abstract class CorePlugin extends JavaPlugin {
protected Set<Class<? extends Listener>> listenerClasses;
protected CommandLoader commandLoader;
public CorePlugin(String packageName) {
Reflections reflections = new Reflections(packageName);
this.listenerClasses = reflections.getSubTypesOf(Listener.class);
getLogger().info("Found " + listenerClasses.size() + " listeners");
this.commandLoader = new CommandLoader(reflections);
getLogger().info("Found " + commandLoader.size() + " commands");
}```
which is present in my core plugin
and then it extends it:
public class XinCraftCore extends CorePlugin {
public XinCraftCore() {
super(XinCraftCore.class.getPackage().getName());
}
but cant find any listeners or commands
if you are in Paper, you could use the ComponentLogger
Lol, any tool that isn't designed for CI should be using colors
maybe it's because they're in different classloaders
but they aren't isolated so it should find them, weird issue
yeah its annoying me because I have absolutely no idea
try instantiating the Reflections with a ConfigurationBuilder that adds the JavaPlugin#getClassloader
ConfigurationBuilder config = new ConfigurationBuilder()
.setUrls(ClasspathHelper.forPackage(getClass().getPackage().getName()))
.addClassLoader(getClassLoader())
.setScanners(new SubTypesScanner(), new TypeAnnotationsScanner());
Reflections reflections = new Reflections(config);
System.out.println(reflections.getSubTypesOf(Listener.class).size());```
found 0
this is directly in my lobby plugin btw
instead of in my abstract class
just for testing
I was thinking more like
public CorePlugin(String packageName, ClassLoader... classloaders) {
var reflections = new Reflections(new ConfigurationBuilder().forPackage(packageName, classloader));
...
}
// inside XinCraftCore
public XinCraftCore() {
super(XinCraftCore.class.getPackage().getName(), getClassloder())
}
8
sorry should of specified
I've never had an issue with it before tho
this is the og one
I need java 8
actually not sure
I build my plugins with java 8
and I use spigot as the dependency
however I use pandaspigot when actually running the server
well, og reflections does support java 8 tho
interesting
ok testing now
yeah didnt fix it
but I'm glad I'm using this lib now
this is what I used to test
Reflections reflections = new Reflections(new ConfigurationBuilder().forPackage("net.xincraft.lobby", getClassLoader()));
for (Class<?> clazz : reflections.getSubTypesOf(Listener.class)) {
System.out.println(clazz.getName());
}```
somehow it found this:
[14:33:28 INFO]: Reflections took 309 ms to scan 1 urls, producing 998 keys and 4499 values
[14:33:28 INFO]: fr.minuskube.inv.InventoryManager$InvListener
I meant the one passed to the constructor
what does XinCraftCore.class.getPackage().getName() return
System.out.println(XinCraftLobby.class.getPackage().getName());
System.out.println(XinCraftCore.class.getPackage().getName());
System.out.println(CorePlugin.class.getPackage().getName());
Reflections reflections = new Reflections(new ConfigurationBuilder().forPackage("net.xincraft.lobby.listener", getClassLoader()));
for (Class<?> clazz : reflections.getSubTypesOf(Listener.class)) {
System.out.println(clazz.getName());
}```
this code is inside XinCraftLobby btw
far out I'm so lost
what if you use the expandSubTypes option in the config builder
maybe it isn't recursively scanning sub packages
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().setExpandSuperTypes(true);?
[14:50:22 INFO]: Loading classes...
[14:50:22 INFO]: Reflections took 0 ms to scan 0 urls, producing 0 keys and 0 values
System.out.println("Loading classes...");
Reflections reflections = new Reflections(
new ConfigurationBuilder()
.setExpandSuperTypes(true)
.forPackage("net.xincraft.lobby"));
for (Class<?> clazz : reflections.getSubTypesOf(Listener.class)) {
System.out.println(clazz.getName());
}```
tried with "net.xincraft.lobby.listener" too
reflections is so weird lol
provide the classloader too, otherwise I doubt it'll be able to find it
I am trying to get a hotswap agent setup to work without an IDE but I can't get the damn thing to work lol
it doesn't detect the changes on the classes of the plugin
not finding anything
im writing my own fucking scanner
perfect
fucking finally
I had to write my own shit
Wait why do you use Reflections
Guava has ClassPath for this
And guava is shaded into server jar
hi can someone help me,
@EventHandler(priority = EventPriority.MONITOR)
public void onCropPlayerBreak(BlockBreakEvent event) {
CreatureSpawner spawner = (CreatureSpawner) Bukkit.createBlockData(Material.SPAWNER).createBlockState();
spawner.setSpawnedType(EntityType.ALLAY);
event.getPlayer().sendBlockUpdate(event.getBlock().getLocation(), spawner);
event.setCancelled(true);
}
I don't understand why this is not working
the sendBlockUpdate method is not replacing the crop by the spawner
This is working perfectly if i add 1 to the y of the getLocation vector (so above the crop)
maybe cancel it first then send update?
also try, but same
ouch
that weird right ?
yes
i have also try with packet and more but this is not rly related to spigot, but even with packet that wasn't working XD
i don't understand
I've been disappointed for 1 hour but I can't find the solution, and I would really like to understand the problem
also try this:
@EventHandler(priority = EventPriority.MONITOR)
public void onCropPlayerBreak(BlockBreakEvent event) {
event.getPlayer().sendBlockChange(event.getBlock().getLocation(), Material.AIR.createBlockData());
event.setCancelled(true);
}
``` but not working too
Do the sendBlockChange inside a bukkit Schedule run task later with atleast 1L delay work lol
it gives me beta warnings
runTask has the same delay btw
it runs on the next tick so basically 1 tick delay
Please help me I can't join to my server
Unless its a plugin development related issue
i find this unknown for me parent for plugins in pom - "MassiveSuper" who know what this?
what
how name is bukkit dependency for 1.7
Ik this isn’t spigot kit anything, but is there a command that I can use with itemtag (unless it was itemedit) that clears the nearest person close to you inventory? Cause when I do @p it does it to me obv
@a[distance=0.001..,limit=1,sort=nearest]
Should choose one player that is close to you but not you I think ?
No clue what you're talking in the rest of your message
@p[rm=0.1]
what is rm ...
ah mb that was the bedrock distance thing
it is
should still use @p tho, as you save the sorting and limiting
That may be true, yes
not by default I believe
but you can just download a plugin to do that
I'm just trying to get the whole theory down pat but like
I'm splitting my plugin into 4 plugins
core, lobby, matches, bridge
in my lobby plugin I would have the gui and the command that runs when you try to queue a match
and that would send you to the match server
but then how would I determine stuff like map
like how can I for example send a player to another server but with data
can you explain what both of those optiosn are
declaration: package: org.bukkit.entity, interface: Player
there is in fact a command btw, however I am unsure of how these proxies implement the sending of players, as if in they do it using the built-in packets or the way it was always done before these packets existed
storeCookie unavailable as 1.8
so basically
player.sendPluginMessage
and then
send the player to the matches server
no, you send the player first, the sending itself can be a plugin message too (the Connect channel)
then you use the Forward channel to send your custom data, by sending another plugin message
then you just receive it on the other end
the other option is to just make a plugin in the proxy to handle the data-passing, because plugin messaging depends on players being there
why is that a drawback?
well, in your scenario I assume it won't be
out.writeUTF("Connect");
out.writeUTF("match1");
out.writeUTF("Forward"); // So BungeeCord knows to forward it
out.writeUTF("ALL");
out.writeUTF("matches-channel"); // The channel name to check if this your data
ByteArrayOutputStream msgbytes = new ByteArrayOutputStream();
DataOutputStream msgout = new DataOutputStream(msgbytes);
try {
// write data like map name and stuff
} catch (IOException exception){
exception.printStackTrace();
}```
like this r ight
I fucking hate this
I am unsure of whether you can send two messages in a row like that
but you can try it I guess
but use a try-with-resources
@SuppressWarnings("UnstableApiUsage")
is it possible to have my matches server have no world?
where would you send the player to
you can have a minimalist world, by not keeping spawn chunks in memory
that or use a specialized server platform like minestom or whatever, don't know if there are any for 1.8 though
you may also consider looking into slime worlds
I saw that it looks promising
thats why I was thinking to send the plugin message first, which would generate the world, then send the player
I'm confused why this doesn't work
you could use dataoutputstreams
try (ByteArrayOutputStream data = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(data)) {
out.writeUTF("Connect");
out.writeUTF(server);
player.sendPluginMessage(engine.getPlugin(), "BungeeCord", data.toByteArray());
} catch (Exception ex) {
ex.printStackTrace();
}```
lobbyplugin onenable: this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord"); this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", this);
lobbyplugin command:```
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("match1");
player.sendPluginMessage(XinCraftLobby.get(), "BungeeCord", out.toByteArray());```
matchesplugin onenable:
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", this);```
matchesplugin onpluginmessagereceieved:
```java
@Override
public void onPluginMessageReceived(String s, Player player, byte[] bytes) {
// handle plugin messages
getLogger().info("Received plugin message from " + player.getName() + ": " + new String(bytes));
}```
nothing is being logged by matches plugin
thank u
is there a player on plugin message received server?
no
to receive a message a player has to be online
is there any way to get around that
nope
that's why you send them there first
plugin messaging uses a message packet that comes with a player connection
you can skip bungee messaging in favor of sockets
you have full control over the connection this way
eh, just use a plugin on the proxy
but I am sending them there I thought, just through a plugin message
or a plugin on proxy
they probably have APIs so you don't have to deal with sockets directly
sockets are not as hard as you think
they aren't hard, just annoying to do properly
if you care about secure sockets at all, anyway
that'll only work if the servers are in the same machine
and at that point, just use a unix socket
so velocity plugin it is?
then use secure sockets
it most likely is the same as normal but with either a password/token
that sounds like a lot of fucking around
welcome to cross-server communication
then again, there's probably some kind of API in velocity so you don't have to deal with all of this yourself
if there's no first-party API, then for sure there's a third-party one
but that kind of thing you'll probably be better off asking the velocity guys
if it uses plugin messages it'll face the same issue
just don't mention you have a 1.8 backend and you'll be fine lol
ahaha
I dont understand how my plugins would connect to the velocity plugin tho
would I just send a plugin message like normal
and then my velocity plugin will intercept it and perform the proper task
bro why does velocity look so overengineered
pretty good post to get more or less an idea of what the different ways to go about it are
communication with sql databases?
i guess communication is just data at the end of the day
socket time it is
ah, it's just one way to connect
communication is just data synchronization for all that matters
but with socket you know in an instant that data has been received
yeah, but it's awkward to handle at scale
I guess it isn't such an issue for minecraft proxies
that was a good read btw I really like redis, but it seems to depict it only as an information giver. for example letting the lobby know which matches server to send the player to. but i’m not sure how to actually send the player if I can’t send the player to an empty world using plugin messanger?
redis as far as i know will need a dependency
sockets is built into java
the connection is 2 way
bungee channels i guess
apparantly that only works if theres players on both ends
I need to be able to send a player to an empty server
ConnectOther i think works on empty server tho
will try
yeah it works
wow you saved me a lot of trouble
wait Connect does work without players
dunno why it didnt work the first time
I think I'm gonna use redis
- lobby server tells match server that player with uuid is connecting with map name and team size
- matches server recieves data and generates the match
- matches server prepares for the player by hooking into SpawnLocationEvent and checking for player uuid and sending them to the correct world
- matches server tells lobby server that its ready
- lobby server sends player to match server
does this make sense
I could probably use sockets but I want to write the code in mind of expandability
this makes sense right
just use a limbo style server
Is it possible, somehow add more than 1 server resourcepack to player?
Merge them together and then send
Can't you send multiple on newer versions
I do recall hearing something like that
but I don't know if that's actually the case
Yes
And If I have everytime another rp? I mean, I have plugin that allows players to send link to their rp and after that install it by other players with command
And I want to have another plugin with rp
Ok so basically I need a command that clears the closest player TO ME inventory. And I’m gonna put this command onto a usually item in Minecraft so that when they use it, it clears the other person inventory. But when I do /clear @p it clears mine
which version is this on
My guess would be 1.20.3 ?
You can apply multiple in the latest versions
I believe this is a 1.20.6 feature
In the player#sendBlockChange method what is last argument responsible for and what can it be used for?
For reference I'm using 1.8.8 as a base version.
Since rn only viable option is using (byte) 0. But there's no wiki on what this actually does and/or is reponsible for. I assume some type of block data?
nope
either 1.19.3 or 1.20.3, can't remember
I recognized there's a bug when I try to use sendBlockChange method with Material.AIR it doesn't seem to work. Could this be because AIR doesn't have viable block data and (byte) 0 doesn't work?
sendBlockChange just wraps the packets check out and see if the raw packet works as intended
If it does create a report on jira
?jira
If the packet doesn't work as you expect I don't think we could really do anything
Good to know :)
Is there a known issue in Spigot with falling items and blocks going up and down, falling over and over and over again?
What could cause such a thing?
That's a vanilla minecraft bug that's over 10 years old
Really? Is there anything I can do about it?
Also, you can't always pick up those items.
You can teleport the items slightly so they're not right on the edge of a block
Yeah that falling is only happening on the client due to the packet that the server sends has it's position rounded
I don't think they are on edge of anything. If I blow something up with TNT, for example, I have the blocks falling from 10 meters again and again and again.
Are they on a ghost block?
I don't know.
Maybe?
Here's what it looks like.
Now I have constantly ~4000 falling blocks. Which can't be good.
huh falling blocks? I assumed you were talking about the item 💀
No, blocks.
The server is probably lagging
It's not.
Check your max tick time in the spigot.yml
If the entity ticking is taking too long it will simply stop and move on
which will cause client desync
It's 50. Probably default.
Try increasing it
To what would you suggest I increase it?
And if it is what then?
That means the server is unable to keep up the amount of entities you have
so to prevent tps drops it just doesn't tick all of them
I wonder if it could be related to my custom block physics. It has been pretty laggy.
When spawning entities you want to modify use the spawn method that accepts a consumer
That will ensure that it's modified before it's spawned instead of after
I'm not sure I understand what that is.
The consumer takes in values like sethurtEntities?
a consumer is a functional interface
So you give it a lambda function where you modify the entity
Mkay. Thanks for the tip. I will look into it.
For the items specifically, there is a bug in Spigot where every 4th item does not check if it can start falling again
You can fix this by setting entity-activation-range for misc. to 0
But as Olivo said, there is other vanilla bug with items being on edge of blocks, that can't really be fixed easily
turns out their issue wasn't with items at all
it was actually falling block entities
ah, didn't fully read the convo
What does that do if I set it to 0? Are there any consequences?
why was FoodComponent#setEatSeconds() removed in spigot 1.21.3? is it no longer possible to change the time it takes to eat a thing?
