#help-development
1 messages ¡ Page 580 of 1
đ
ive never tested with alts before
i just send it
never had a problem w that
Test in prod đ
production is just a realistic testing environment
i dont think running as admin is the way to go
woah
okay so prism you say
css
Try set version to 3.17.30 xd
seems good to be unless this build task fails
update: it didnt
try invalidating your intellij caches possibly
file -> invalidate caches
i GameProfile was added into the server software though?
on modern versions *
or i mean PlayerProfile which is essentially same thing just the non mojang version of it
Hello^^ Does anybody have an idea why im getting [ERROR] Failed to execute goal on project LoopCityScript: Could not resolve dependencies for project de.dafeist.loopcityscript:LoopCityScript:jar:1.0.0: org.spigotmc:spigot:jar:remapped-mojang:1.20.1-R0.1-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigot-repo has elapsed or updates are forced since I tried to update to 1.20.1
Yes we have api for PlayerProfile now
This failure was cached in the local repository
invalidate your caches
Doesnât mean mojang repos are gone
Have you run BuildTools
yes
What do ya think craftbukkit depends on :p
Add the update flag to your package command and run that
wdym? I just ran buildtools lol
I have never heard of an update flag
-U iirc
just pressing on "Update Project" gave me the error already
[ERROR] Failed to execute goal on project LoopCityScript: Could not resolve dependencies for project de.dafeist.loopcityscript:LoopCityScript:jar:1.0.0: Could not find artifact org.spigotmc:spigot:jar:remapped-mojang:1.20.1-R0.1-SNAPSHOT in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
Did you use the remap flag when running BuildTools
I ran java -jar BuildTools.jar --rev 1.20.1
so no, no remap flag
is it necessary?
Ur gonna need the remap flag for remapped
X
why? lol
I'm trying to spawn a client-side armor stand on 1.20.1 but I got this error https://paste.md-5.net/ikewafozaw.cs, the code works fine on 1.19.4, anyone know why?
this.sendPacket(new ClientboundAddEntityPacket(stand), data.player());
private void sendPacket(Packet<?> packet, Player player) {
((CraftPlayer) player).getHandle().connection.send(packet);
}
Did you remap to the wrong version
great thanks, my build is working now
hear me out right... sleep
will do, thanks my friend
hey, i need to store very temporary data for a lot of entites, but I dont really know how to go about doing this efficiently
i could use a hashmap, but the entries wont be removed when the entity dies and so will eventually cause a memory leak (there is A LOT of entities in this case)
what could I use like a hashmap but that removes the key as soon as the entity disappears, or storing data directly on the entitiy (persistentdatacontainers are not an option in my spesific case)
what kind of Entities?
will a weakhashmap instantly remove the key when the entity dies or will it wait to garbage collect stuff in the hashmap or what (idk how this works)
Wait for GC
what kind of data do u need to store
how often does java run a garbage collector
When it needs to
i need to store who placed an ender crystal in crystal pvp
Use pdc
yea u can use pdc
or nms thingies
And the value is the player id
add NBT-API and store on the Entity (as you can;t use PDC)
depends on the jvm
but like a weak hash map wont hold strong references to the entries, thus not preventing gc from marking the objects and sweeping them
where the hell is the remove packet
ClientboundRemoveEntities
ohh its an entity id list alr
Weak references is what you want in this case, no?
yeah id assume so
i mean id rather the entry be immediately removed from the map when the ender crystal dies but im not sure if thats possible
You could use the death event
and yeet them when they die
So why can't you use pdc or nbt directly
crystal isnt a livingentity
i could use NBT
i dont really know how NBT works
yeah why not pdc, nbt or even metadata (if persistence is not needed)
u dont have to touch nbt
Metadata will still leak
a Crystal is a TileEntity so has PDC
ive heard people say that metadata has leak issues
its just a big map essentially
If you don't use it right it will leak
^
You need to remove it
But thereâs no death event so⌠yeah
EntityExplodeEvent probably triggers tho
ok not a tileentity, still an Entity though, ALL have PDC
i might just use a hashmap and manually check it
prob what I would do tbh also
i want my plugin to support multiple versions
should the hashmap point to the crystal object, or its UUID, or what
Theres many things to consder when using a Map
eg, a server crash/restart/reload
in all cases your Map will be empty but your crystals persist
I would weak map the crystal entity
I'd just use PDC and support back to 1.14
its a new plugin so you decide who can use it
make people update
Is there a list of all the sound enum sounds https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html ? One where I can actually play them?
declaration: package: org.bukkit, enum: Sound
you just want a list of all the enums?
Sounds.values() should be fine if thats what you want
no I wanna hear some of those sounds to figure out which one fits the best
Like a webpage with some mini-mp3-players
Thought there might be one
ohhh i see
ngl good plugin idea
i can prolly spin it up in a day if you want to
make it a gui
Yes. But those aren't all sounds :(
google?
I think a plugin like that would be quite helpful for development @noble lantern . You could aswell add some settings to change the pitch (or even the volume)
i can likely modify musepluse quickly to put & play the sounds in a gui and release it as a side fork
similar to this where each disc is a Sound enum
I do like the pitch feature though
ill make the middle button a pitch up /down feature
left click up right click down
could use F for a toggle for finer adjustments - like I do in a GUI for chances
like this @noble lantern
thats not the particle i want
is there any particle thats good as like a one point indicator
that stays in one place
doesnt fall down either
Redstone dust is great ^
might have been renamed
what data does it need
DustOptions
alright so before Burchard is done with the sound test - any suggestions for a "you failed" sound? Like a higher pitched level up is for success
What's for failure?
Anvil is usually used
there's a specific sound for wither block break?
For menus
what
yea
same as zombie door break thing i think
It's not for a menu specifically. Can be anything
might use a high pitched tool break
how does this make sense im confused as hell
all i do is increment the y value on pos by 0.1 until its 1
you probably have a wrong function and therefore it's put in a line
yea thats weird
or post it here if you want me to take a look
public void tick() {
if(highlightedBlock != null) {
Location loc = getHighlightedBlock().clone();
loc.add(0.5, 0, 0); // Center Bottom
Particle.DustOptions dustOptions = new Particle.DustOptions(Color.fromARGB(0, 255, 0, 0), 1.f);
for(float y = 0; y < 1; y += 0.1f) {
getHighlightedBlock().getBlock().getWorld().spawnParticle(
Particle.REDSTONE, loc, 1, 0, 0, 0,
dustOptions
);
loc.add(0, y, 0);
}
}
}
yeah you keep adding Y to the location but you use the Location from the previous loop run
just loop ten times and always add 0.1
fixed
or clone the location each time but that'll be worse in performance
yeah that's the easy way which is more work for the CPU^^
Well you could still cache the world. That'll be mostly cosmetic but still^^
imma calculate where the corners of a block are
Display regions or blocks usually
i do this here tho
public void tick() {
if(highlightedBlock != null) {
Particle.DustOptions dustOptions = new Particle.DustOptions(Color.fromARGB(0, 255, 0, 0), 1.f);
Location loc = getHighlightedBlock().clone();
for(int x = 0; x < 2; x++) {
for(int y = 0; y < 2; y++) {
for(int z = 0; z < 2; z++) {
getHighlightedBlock().getBlock().getWorld().spawnParticle(
Particle.REDSTONE, loc.clone().add(x,y,z), 1, 0, 0, 0,
dustOptions
);
}
}
}
}
}
is there a better way than to clone it every time?
i mean there is but that would be alot more of code no?
shorter ain't always better
well i get that but making it without cloning would mean i have to subtract everything again
Also it would not be a lot. Just create x,y,z and add it accordingly (can be done before you are in the most inner loop)
well no. You can start with
double x = loc.getX();
double y = loc.getY();
double z = loc.getZ();
and then inside your loops you just reset it by calling
y = loc.getY();
and do the adding obviously
or actually even simpler:
for(int x = loc.getX(); x < loc.getX()+2; x++) {
do that for all the loops and set x,y,z one by one right after the corresponding loop
for some micro optimization you can also cache the loc.getX()+2 part but JIT would optimize that for long loops anway
now you don't even have to clone above since you don't change it
lol
I do that
I took a really big haitus off development; is this an okay Maven dependency config?
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.0.33</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.42.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Idk when does it shade, is the mysql connector shaded there?
This is my maven output:
Spigot has the SQL drivers, they're not needed as dependencies
Oh? Does it support PostgreSQL as well?
Huh, well that's interesting, was that added within the past 2-3 years or was I just a dumb-dumb during my plugin dev time?
No it's been that way forever
dumb-dumb during my plugin dev time
So it seems...
2 am, if i code anything now it will be madness
that's the best time to code tbh
woops
at least you'll be productive
writing the same code over and over again
forgetting loops exist
go to sleep
Whatâs a loop
don't you know fruit loops?
fruit loops are only good with marshmallows
you put marshmallows in milk?!
fruit loops with marshmallows
Peak satire is not being able to tell if real
@flint coyote i gotta do some irl stuff but this is what i got rn
they're 100% real
likely ill add some search feature as well to make it easier to naviate
cause its like 14+ pages of songs (and make it so mouse doesnt jump)
you should also display the current pitch somewehere and maybe make it adjustable how much you wanna step
besides that it looks cool already
yeah itll be displayed too dw
its has everything ready just didnt display it cause i need food :p
pitch does increase speed
or decrease
Does this detect resource pack sounds smh
nah
0/10
impossible to do that sadly
I'm not sure what the lowest and highest pitch is though.
Also I feel like the pitch has steps. 0.7=1.0
I just tested a few values and 0.7 sounded exactly like 1.0. 0.5 was the same as 0.1
so ye idk the "steps"
hmm ill do some googling or source code diving once im back
Although the registry contains enum values so probably not
i dont thin kcustom sounds get added to the registry sadly
when you play custom sounds its just a string
Smh I blame @worldly ingot
okay ill be back like later tonight when im home with this published on spigot, doubt youd want it right now :p
Feel free to polish it, take your time :)
Thanks for the quick response :p Makes looking for sounds a lot easier
it was only so quick cause i had like 85% of the code written out from musepluse, kinda just worked right out once i cut all the unused code out
And yeah i always found sound searching annoying too
ide have to find it again haha
Filter button when
sure I'll do that right when you join the server for 10 minutes straight
how would you get sounds added by a resource pack with nms unless you had the resource pack available on the server? The client doesn't "declare" sounds to the server it has
Ah true they are only registered client side
mfw musepluse doesnt even have that yet xD
okay fr this time bye bye
I figured they were server side because they show up in /playSound tab complete
I forgot tab complete for vanilla commands is client side
Alright so we use log4jshell to read the clients resource packs
Good night, I would like to ask for help from you. I started making a server on version 1.20, made a lobby, installed Velocity and an additional "test" server.
I've tried several plugins on NPCs to teleport to the "test" server from the lobby, but not one of them works, even Citizens.
How can I use the bukkit api to redirect it to the "test" server when the player clicks the pcm?
the Velocity dependency I imported into pom.xml
public class ServersTeleport implements Listener {
@EventHandler
public void onPlayerInteract(PlayerInteractEntityEvent event) {
Player player = event.getPlayer();
Entity entity = event.getRightClicked();
if (!entity.getName().equals("Vanilla+")) return;
}
}
Afaik citizens NPCs donât exist on the server
So that event wonât detect them
Doesnât citizens have support for running commands now
So you can just have them run /server
how do I solve my problem then?
yes, but it's don't work...
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
I create an NPC, add a command to the server to it, but nothing happens when clicked
What command did you add
Try making it run /send <p> test
just in the chat?
or add a command to NPC
The NPC works for other commands
/server sends the person using it to that server
Obviously the NPC cannot be sent to the server
According to the citizens docs you can use /server if you use the -p flag
nope
/npc command add -p server MyServerName
thatâs what the docs say ÂŻ_(ă)_/ÂŻ
Otherwise youâll need a plugin that adds a /send of some sort to Velocity
I wonder why an additional plugin is needed on "/send" when there is a regular /server
đ¤
Like I said
/server runs for the person executing it
It doesnât allow you to target a specific player
/send does but velocity doesnât seem to have that by default
Try something like https://github.com/OskarsMC-Plugins/send
this only works on the Velocity server, but everything that should happen happens on the lobby server, and there is no access to "/send" from the lobby server
getting custom models to display in-game is not fun
make your own model rendering engine
it would be easier
at least I could use whatever models I'd want
bruh
Hey so I am wanting to send a packet to all players saying that player x has a different helmet on but still function on the server end as the armor that it is
public static void setHelmet(Player player, ItemStack helmetItem) {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
// Create the packet
PacketPlayOutEntityEquipment packet = new PacketPlayOutEntityEquipment(
entityPlayer.getId(),
3,
CraftItemStack.asNMSCopy(helmetItem)
);
// Send the packet to the player
for (Player playerLoop : Bukkit.getServer().getOnlinePlayers())
((CraftPlayer) playerLoop).getHandle().playerConnection.sendPacket(packet);
}
Currently have that but it keeps bugging out and sometimes wont show any of the armor and other times it just doesn't replace the helmet. any ideas why and how I can get it to work?
(1.8)
does PDC have some sort of file variant?
no
NBT I suppose
if you use the JNBT library you can read and write with NBT which is what PDC is based off of
Why can't you use the api
It has to be only visible i don't want it to be physically charged
there should be smth like setStage If im not mistaken
Could you please elaborate? Also it's 1.8 so might not be there
oh 1.8 gimme sec I'll read on the nms wiki
Open to using protocollib if needed
So here's what a quick search returned
Entity entity = ((CraftEntity) npc.getEntity()).getHandle();
DataWatcher data = new DataWatcher(entity);
data.register(new DataWatcherObject<>(5, DataWatcherRegistry.a), (byte)1);
CraftPlayer cp = (CraftPlayer) player;
cp.getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entity.getId(), data, true));
then look at table 2 here, value 5
https://wiki.vg/Protocol#Player_Digging
typing on a phone is painful, so I'll just redirect you to the spigot link
https://www.spigotmc.org/threads/bow-draw-packet.545376/
And that'll allow me to set the item how exactly? Sorry on mobile currently so I might have missed something
But that's for updating the item in hand? I want to update the helmet to a virtual itsm
Hang on lemme get an example similar to what I'm doing
kinda like that
I am doing a similar thing
ohh
I miss understood the
then*
here, you can apply that to your needs, it should tell you how to ""Overlay" an item
https://www.spigotmc.org/threads/make-player-hold-a-fake-item-using-protocollib.469635/
EnumWrappers.ItemSlot is 1.9
?1.8
Too old! (Click the link to get the exact time)
dw I wont be stuck here for long the dev for our cannon Jar is making a 1.20 version
progress
man there is some weird stuff happening in the resource packs
it looks like I have to check for the file resolution manually? I think?
either that or the uv is always 1/4 of what blockbench outputs
still looking into that one
now we're cooking with kerosene
what a beautiful new "block", mojang if you're reading this it can be one of the 3 new blocks you add the next update for only $100k
Mc education edition chemical element blocks be like lmao
no, it's an art piece I call "after 6 hours of frustration I needed a directional UV"
you wouldn't understand, it's deeply personal
Lol i also see it
Lmao
no
Tell me how you've done it and I'm remaking ic2
it's going to be open source, free and have an api
custom models in mc
through spigot
yes
Do it quicker, I need to make ic2
closed alpha this weekend, open before the end of the month
no animations for now though
don't need them right now, it's coming later
Is it atleast possible to dynamically change textures?
you can do what I do and just replace the entity
Sounds ok ig
oh this isn't good
I think I need to read how large textures are to resize the minecraft uv
Is there a way to simulate a player placing a block so all of the blockdata is correct? Stuff like what way the block is facing relative to what surface was clicked/direction the fake player was facing, and getting things like walls to be attached correctly?
would anyone know why a cuistom pack would only work in 1.19,2 for the custom items in it
but the rest of the pack works just the modles show as purple and black
A missing texture
just go intot the resourcepack and remove all other texture then the one ur using
but how owuld that make any sence if it works perfect in 1.192.2
but not .3 or .4
(didnt mean to be rude)
those
xD
you can see the changes that were made
ye imma just pay someone for that ngl
How to shade dependencies into remapped jar?
With the Maven shade plugin, just like you normally would
I got it but when i use plugin it returns
Caused by: java.lang.NoClassDefFoundError: bbn
uhhh that doesnt seem like agood error
You are missing your dependency
what dependency?
org.joe.testplugin.core.item.CustomItem
uhhh this isnt good either
You also trying to use remapped
yea i am
What you trying to do?
Your plugin is trying to use class that it can not reach
i fixed it?
some packages have the same name as an already existing package so i capitalized them and now it works ig
also my intellij keeps using 70% of my cpu and just crashing at random times, any1 know how i can fix?
u can not everyone has these problems
Meanwhile zero issues with Eclipse and one of the lowest memory footprints of any IDE đ
might have to switch anyways since my github student license is expiring soon
Use free version
https://spark.lucko.me/wlGCuw3hbE
Is it me or do i not know how to use spark? (trying see what specific method call is causing a spike, but i dont see anything in the view)
Just says 93% of thread is Unsafe.park() calls (Even if its just running on its own)
I prefer IDEs where nothing is behind a paywall
If something or someone comes in clutch it means they saved the thing they clutched
Caused by: java.lang.ClassNotFoundException: bbn
After remapped it returns me this error dont know why
It was first going wrong but he came in clutch
um explaining a word using the same word doesn;t work đŚ
.
If you win 1v5 in cs:go u made a clutch
In alternate words:
It was first going wrong but he saved it
so clutch means good?
y
ok
Did you remap to the wrong version
<build>
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.19.2-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc
1.19.2-R0.1-SNAPSHOTđŤremapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>C:\Users\Michael\Desktop\ProfilSerwera\HypeProjectBukkit\plugins\hype-guilds.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.19.2-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc
1.19.2-R0.1-SNAPSHOTđŤremapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>16</source>
<target>16</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<outputFile>C:\Users\Michael\Desktop\ProfilSerwera\HypeProjectBukkit\plugins\hype-guilds.jar</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
//repos
</repositories>
<dependencies>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.21.9</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.19.2-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc
1.19.2-R0.1-SNAPSHOTđŤremapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>C:\Users\Michael\Desktop\ProfilSerwera\HypeProjectBukkit\plugins\hype-guilds.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.19.2-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc
1.19.2-R0.1-SNAPSHOTđŤremapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>16</source>
<target>16</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<outputFile>C:\Users\Michael\Desktop\ProfilSerwera\HypeProjectBukkit\plugins\hype-guilds.jar</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
//repos
</repositories>
<dependencies>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.21.9</version>
</dependency>
</dependencies>
I dont think so its wrong
every version match
Same server version is also 1.19.2
[11:53:14] [Server thread/INFO]: Starting minecraft server version 1.19.2
[11:53:14] [Server thread/INFO]: Loading properties
[11:53:15] [Server thread/INFO]: This server is running CraftBukkit version 3610-Spigot-6198b5a-19df23a (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT)
Dunno, i'll change it
change it back to what it shoudl be]
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
Okay boss, done
are you suppoed to be shading core?
No core is diffrent module in project, works as plugin
ok
then so long as you are using the same 1.19.,4 in every place in yrou pom it looks ok to me
I'll try with .4 instead of .2
one oddity, why are you using parent? is this a multi module project?
hey, a question about the best way to code something
Because plugins dont really have a gameloop but more of Tasks that need to be run/scheduled
I want to make a random player generator, but instead of just returning a player instantly, i want it to have an animation
(by first generating an x amount of false players, and then eventually generating the random player that has to be returned/is the real selected one)
this animation between the false random players is always the same (just a particle going from player A to player B)
anyway, i was wondering what is the best way to implement this
Should i make a gameloop by doing a scheduleAsyncRepeatingTask(.. , .. , 0 ,1)
Or should i recursively call the scheduleAsyncDelayedTask() (every task will be one random new player, the last one would be the real one)
also, is it posible to return a task like this with any type, (so in this case a player)
Or should i save these values inside a object thats accasable from outside this task aswell
yep
Its big
open it as a zip and see what you shaded by mistake
big test
Caused by: java.lang.ClassNotFoundException: bfh
New version new error XD
Oh wait i fucked up now cuz engine still .2
each module that uses nms needs it's own specialsource
only one module uses it
and it must use the correct inputFile
don;t make any changes to the default inputFile
I only changed from 1.19.2
to 1.19.4
Do you need to have it go infinitely or only when you want it to run?
but you did fix the inputFile back to what it shoudl be?
then no other module shoudl have a specialsource, they shoudl use spigot-api not spigot
?paste
onyl when i want to run
(probably will be a command /selectRandomPlayer or something)
every animation will be around 10 ticks long, with every tick an particle on a different place
So this would be a lot of different schedulars if i where to make it recursively i think?
it is because of background
Are player's attributes permanent?
Changing it, but since i changed engigne version from 1.19.2 to 1.19.4 i can even join server
server has to be teh same version you are building for
So, according to the author of the FFMPEG Wrapper for Java this call is supposed to be a blocking call. So I throw it into the CompletableFuture (This thread pool is a newFixedThreadPool with runtimeCores * 2 as the size). Logs are indicating the calls are happening off the main thread, however, I'm just getting horrible tick drops when this method is called without any major CPU usage (That I can see in task manager at least)
Would this possibly just be FFMPEG Wrapper doing something funky in the background with the binaries, or am I not supposed to hold blocking calls in CompletableFutures? (Ik I should probably ask the author of that lib but thought ide see if anyone had any ideas first) and err ignore that command its leftover
p.sendMessage(main.getConfig().getString(ChatColor.translateAlternateColorCodes('&', main.getConfig().getConfigurationSection("faction-locale").getString("provideFactionName"))));
how come it just sends a blank space in the chat, my config
faction-locale:
provideFactionName: "&cYou must provide a faction name."
playerAlreadyInFaction: "&cYou cannot create a faction while in another faction."
When I used ffmpeg in a project I just parsed the output
getString("faction-locale.provideFactionName")
hmm sadly can't do that i dont believe since this wrapper is mainly for specifically running CLI tasks (Im converting a m4a -> ogg in that task so I know it'll be a little taxing for the server but no matter what chokes the main minecraft server thread)
Can someone help me with this most likely simple error that i came accross im not sure what am i doing wrong
first time working on 1.20 before i only worked on legacy
make a repeated task that gets cancelled when you reach the final player
yeah I wrote a media converter. It runs nice as I rin ffmpeg in its own thread
which line is 22
mine was mostly to convert to WebM
ohh, that solves most problems yea, i did not know you could cancle tasks
val objective: Objective = scoreboard.registerNewObjective("scoreboard", Criteria.DUMMY, "scoreboard objective")
store the task in an object
Fix your problems first xd
i already fixed it
was it a java wrapper around the ffmpeg binaries by chance? If so is that public :p
ur solution did the same thing
But u did stupid way
what api version r u using
1.20
does it correspond to ur game version
yup
show me, go to ur pom.xml
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
you can easily handle ffmpeg using a process builder
yeah i see
try this
val objective: Objective = scoreboard?.registerNewObjective("scoreboard", "dummy", "scoreboard objective") ?: return
Caused by: java.lang.ClassNotFoundException: bfh
It now returns this but the saddest thing is that this class is part of the project because its instance of the NPC
ugh ill try it but that is deprecated way
the way ur doing it doesnt even exist
you can;t be including your modules correctly then
how come it is shown to be correct in ide
what is your server jar
How can I double hearts using :
victim.getAttribute(Attribute.GENERIC_MAX_HEALTH)
1.20.1
Your server jar is definitely not 1.20
1.20.1
net.minecraft.server.v1_8_R3.PlayerList
Help?
yeah hes using 1.8 lol
1_8_R3 is definitely not 1.20.1
i did a reload of everything and yeah now it doesnt even recognized by the server /pl shows 0 plugins loaded
myb my minecraft version was off idk
no not ur version. the server
version
use build tools man
i know where u got it from charon
the server doesnt lie
?paste
The logs do not tell a lie
?paste the error again
victimAtt.setBaseValue(victimAtt.getBaseValue() * 2)
now i dont have that error now i have error on start of the server
give me a second
surround 1.20 in ""
it is on top of the cmd just when server starts
in the plugin.yml
done
https://paste.md-5.net/vajiredovi.rb
Anyone know what might be the problem?
ok and how did u not get this error before charon
maybe i did have this error just didnt see it from loading minecraft đ¤ˇđťââď¸
You are doing new MainClass() somewhere
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
GuildHeart.java:26 trying to access a class bfh which is not in your jar
ty now it works
Okay but i dont have any bfh class
Show yo code
I'm betting on you have a specialsource incorrectly configured in a module it shoudl not be in
Should i put it as in the whole project?
what?
in the main project pom
specialsource shoudl ONLY be in the module which is using nms. nowhere else
And its here, module core is using
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
the module using spigot is the one using nms
Its module core, in diffrent module i am using remapped
what
specialsource should only be in the module pom thats using remapped
And it is only here
sus
?paste all your poms
https://paste.md-5.net/ewilovamad.xml -> module core
https://paste.md-5.net/elohitogur.xml -> hype-guilds
https://paste.md-5.net/semazilewu.xml -> main, this core pom.xml on the botton of the screenshot
remove outputfile entry from shade configuration in module core
do you have a depend in your plugin.yml for core?
Yes
I'll
big test
I have bad info for u
?paste GuildHeart.java
this.heart = new PersonalNPC(npcManager, guild.getOwner().getPlayer(), guild.getTag(), heartLocation);
This is 26 line
?paste PersonalNPC
Which jar are you using
remapped-obf
oh
Yeah that's not the one you want
Use the one with the regular name
Top one
If it'll work i will paypal you 5$
I didn;t even consider he was using the wrong jar đ
Fixes we did needed to be done anyway đ
What even is the difference between all those jars
for use in testing servers
They are all different steps in the assembly process
It's fine
Hmm, makes sense ig
ie, before reobfuscating, before shading etc
I never used any jars besides the normal one
I thought is remapped-obf because when i decompiled it it looked completly fine
(normal) is the only one you should use
Makes sense
unless you are running a deobf test server
You wouldn't want to use a half-way assembled jar lol
Now because i dont want to mess this up can i move this normal .jar into plugins? Because i am running server in IntelliJ so i prefer to not move this file everytime to plugins folder
Yeah it's the obfuscated one. Spigot uses Spigot (or mojmaps now??) mappings for class names rather than the obfuscated names
there is a proper way to distribute teh jar
It makes sens thanks so much
?nms
alex has a link to show you how to do it properly ^
i hate that i was using a 12mb library for this the entire time
actually hitting myself over the head rn + thank you :))

I have read it 10 times
Casual java developer stuff
Hm I thought that guide showed how to change output dir
That's the one I was looking for
Why did I not know of that until now
yeah would hate myself too if i would misuse consumer like that
THanks â¤ď¸
its cause its copy pasted, used to return a Consumer<FIle> i did stuff to but need to reformat my code now
Yeah, I'd get rid of that onComplete CF
I'd return the future
Just return your CF#runAsync CF and the consumer can then call CF#thenRun
I don't understand your join either
I'd return the process future
onExit would be J9 so if that is possible yeah, better call there
How can I add a bar of red hearts?
player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(40D);
player.setHealth(40D);
Doesn't work at all
Is there a way to simulate a player placing a block so all of the blockdata is correct? Stuff like what way the block is facing relative to what surface was clicked/direction the fake player was facing, and getting things like walls to be attached correctly?
What
damage the entity
cuz that just sets the data
doesnt update visuals
which is why I think pppl still prefer setMaxHealth
wot
setMaxHealth() just does player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(40D); lol
That code should work fine
att.setBaseValue(att.getBaseValue() * 2);```
This will x2 default healths right?
no
it may set normal health also
but ye shouldnt matter anyway since they're calling setHealth()
@Override
public void setMaxHealth(double amount) {
Preconditions.checkArgument(amount > 0, "Max health amount (%s) must be greater than 0", amount);
getHandle().getAttribute(GenericAttributes.MAX_HEALTH).setBaseValue(amount);
if (getHealth() > amount) {
setHealth(amount);
}
}```
na
The difference being that Player does override this. Calls super and sends an update packet
WHAT DO YOU MEAN NAH?
yea
I just sent you the implementation 
hence .
Someone should expose the sendHealthUpdate() method
true dat
It's gonna have to be me isn't it?
đĽ˛
how to add a install a dependency without pom.xml to maven?
java.lang.ClassCastException: class net.minecraft.network.syncher.DataWatcher$Item cannot be cast to class net.minecraft.network.syncher.DataWatcher$b (net.minecraft.network.syncher.DataWatcher$Item and net.minecraft.network.syncher.DataWatcher$b are in unnamed module of loader java.net.URLClassLoader @1cf4f579)
Anyone have clue how using REMAPPED, get this field? No getter for it, when i try relection it return error above
public static Int2ObjectMap<SynchedEntityData.DataItem<?>> getField(SynchedEntityData dataWatcher) throws NoSuchFieldException, IllegalAccessException {
Field fField = SynchedEntityData.class.getDeclaredField("e");
fField.setAccessible(true);
return (Int2ObjectMap<SynchedEntityData.DataItem<?>>) fField.get(dataWatcher);
}
e is the representation in the NMS
not in 1.19.4
update entity metadata
then just packDirty and move on
Yes
is it posible to create a npc without adding all kinds of extra librarys or api's or someting
os just in vanilla spigot
not without nms
ow :(
I mean @dawn plover there is another solution... if you want but it's a complicated one lmao
First off, the server must be in offline mode, and you need to do the online mode check yourself
Second off, create and maintain a connection to the server using like localhost:25565 so that a player is created
Third off, you can now control that client
This is one way to make NPCs lmfao
[15:09:08] [Netty Server IO #1/ERROR]: Error receiving packet 82
What is the packet 82 in 1.19.4?
I'm encountering an issue with my code. How can I add an additional health bar? What is the value associated with it? Do I need to make any updates, and if so, how should I go about it?
player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(40D);
player.setHealth(40D);
lol, i think i know what you mean haha
i need that second player just for testing things that requere more players and when i am alone XD
so thats why dont want to add a whole library like nms in my code, then i will just wait untill i have someone to test it with
But maby i can try to get an extra conection like you are saying right?
And where it is?
Its for 1.20
I mean you can use offline mode and run two clients
Yeah and?
There is no packet with 82 id
though i dont know what ofline mode is XD, is that something from minecraft itself? because i am not able to start a second instance (or will ofline mode fix that)
Display Objective?
Ah alright lemme teach you it
Thats it? Its impossible because i am not even using this shit packet
damage?!
damage by 0.00000001
how
Player#damage(double)
player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(40D);
player.setHealth(40D);
player.damage(0.00000001);
@green prism send the full method please and thank you
public void onJoin(PlayerJoinEvent event) {
String playerName = event.getPlayer().getName();
Player player = event.getPlayer();
if(Objects.equals(KingUtil.getKing(), playerName)) {
player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(40D);
player.setHealth(40D);
player.damage(0.00000001);
if(!KingUtil.hasCrownBeenGiven()) {
KingUtil.giveCrown();
}
}
if(KingUtil.getFormerKings().contains(playerName)) {
player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(20D);
KingUtil.removeCrownFromFormerKings();
}
}
Hey stop
pause
don't
use player uuids
that way you can also just ==
I am using playerNames, Server is going to be offline mode
Well we can't help people using offline mode, best of luck figuring it out! :D
what?
It's not for me
Yeah, at least from what I've heard/seen nobody really helps cracked server owners here.
I may be wrong.
Why tho
It's not for me, I am having an issue using spigot api. Please, help me
Cracked servers just cause problems.
Well, that person should ask for help then, not you.
I am the Developer (?) He's just a customer
I don't know if he's going to use an Offline or an Online Server
Wow. Thank you
Hey no problem, always happy to help! :>
lmao, there wasn't the "EventHandler" annotation
If i am using in my first module remapped version of spigot
Can i create diffrent module and use normal spigot with nms here?
Yeah
Just don't load the wrong classes during runtime
I might have missunderstood what you tried to say but I assume you want multiversion support
Or do you want another module that you write unmapped nms in?
I just have huge fucking api for NPC's and remaking it so it works with remapped version of engine is meh. So can i just move this api to the another module and use it in the guilds module
I don't see why people keep reimplementing npcs
Just hook Citizens? Many servers already have it installed
And the api is great
I belive mine is better then citizin
Cuz u can apply day night tasks for npc
Create groups
And make them work like you eneter some RPG city
I mean the actually npc itself not the behaviour
?
Just nevermind, can i do that?
You don't need to design it like that though
why
Yeah just have one module depend on the other
And ensure they build in the correct order
Okay thanks
how do i remove a specific value in a string list
e.g.
remove 'example_2' from this
example:
- "hi"
- "example"
- "example_1"
- "example_2"
It's just a list so there are many way to do it
This is just basic Java?
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
example.stream().filter(s -> s.equals("example_2").map(example::remove);
example.removeIf(s -> s.equals("example_2"));
Easier to just use removeIf
Minecraft chunks has around 65k blocks :l but when I try to get the number of block in a chunk is sent to player it is only about half of it
and it it not even stablize :l
may be I was wrong about how minecraft chunk work?
Read on wiki vg
It should tell you format
that is a packet for world gen^
It is a bit confusing for that :l
That is no longer the case
Or just .remove("example_2") lol
Chunks are no longer 256 blocks high starting from newer versions
I'm talking about 1.12.2 for now
Something is wrong with that link from my side
or is the file just far too large?
I believe you read that wrong, it can contain at max 65,536 blocks, not that a chunk that is saved, generated or loaded actually contains that. Technicality wise it does contain that if you wanted to count the air blocks. Air blocks take up the majority of space in the world and chunks but the game and even the api typically doesn't count those by default unless you specifically look for air blocks.
you can see the above files :l
there are lots of 0 0 0 values and 255
I don't know what that refer to
but I'm pretty sure that is not block id
Also beware that the packet itself is paletted but I highly doubt you are reading the data raw
yeh it is the data raw
so, we know a chunk is 16x16 right? well the chunk the way it is stored, is by columns in the chunk
so it will go from 0-255
in each section of the chunk
so there is 16 columns in a chunk
i think itâs -80-360 now đ
:l?
They are using 1.12
oh mb sorry
I am aware, but they are on an old version
16*16 isn't it?
There are 16 16x16x16 cubes in a chunk
Configurable
chunks are 8x8?
so it should be 256 col to be sure
my bad my math was off, 64 columns
no that canât be right
Nah. Where did you get that value?
oh wait chunk is 8x8? or 16 by 16?
16
yeh so there should be 256 cols
or 256, just woke up not long ago lmao, anyways point is
https://wiki.vg to teh archives!
chunks are not stored by layers using y as the height
this is inefficient, and instead its just a bunch of columns because this is also how MC sends chunks to the client
as columns as well
but this explains why you are using 0-255 a bunch of times
https://wiki.vg/index.php?title=Chunk_Format&oldid=14135 relevant wiki page
Note that blocks aren't stored with a size of 8 bytes
but yeah chunks typically are not filled completely to the max with blocks it can handle
unless you purposely generated it as such
as I said, air blocks typically don't count but they do if you are looking for them
Additionally empty sections (the 16x16x16 cubes in a chunk) are skipped as frostalf alluded to before
that are packets the server send in a few seconds
there {"x":4,"z":5....} which refered to the chunk I believed
Hello, how can I get the shaded version of spigot in my build.gradle ?
repositories {
mavenCentral()
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
...
compileOnly 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT'
}```The exact link is https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.20.1-R0.1-SNAPSHOT/spigot-api-1.20.1-R0.1-20230624.072431-15-shaded.jar
yes this refers to the chunk 4,5
Why do you want it?
org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT:shaded
thanks !
nms
But why the hell do you want the shaded one when using gradle?
That doesn't do what you want
It doesn't contain nms
well I have no idea how to get the block from that
oh, how can I have nms (with gradle, I'll never go to maven)
so chunks start at the upper left corner
so if you count the first occurrence of the number
the wiki said that the blocks is stored in the palette but found nothing
how can I set it in my project ?
Run BuildTools as usual and depend on Spigot instead of spigot api
Though with gradle you are better off using paperweight
the only thing I got is this {"x":14,"z":25,"groundUp":true,"bitMap":31,"chunkData":{"type":"Buffer","data":[
As for mappings you'll need to find an unofficial plugin or Paperweight
how can I depend of it ?
You can;t with Spigot. Some forks use gradle
org.spigotmc:spigot:version
You change the dependency in your build.gradle?
but idk how to include a file in my build.gradle 
let google that
No one said you need to include a file
Depend on org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT after using BT
Also you need the mavenLocal() repository configured
ideally you shouldn't, yes.
@vital sandal And https://wiki.vg/index.php?title=Chunk_Format&oldid=14135#Data_structure should help you figure out how to decode that bytebuffer of yours.
the bitmap is where the blocks are stored for the chunk if I remember correctly
basically it maps the blocks in a chunk to a number
so, starting at 1, it will see its stone, and anywhere it places a 1 should be stone
for example
and the bitmap is the block assignments to such numbers
still really confusing :l the wiki explain about global palette while I'm using chunkData
Where do you get your values from?
Hello there, how can I prevent an item from being dragged in another inventory?
This is my code so far:
@EventHandler
public void onInventoryDrag(InventoryDragEvent event) {
Inventory draggedInventory = event.getInventory();
if (draggedInventory.getType() == InventoryType.PLAYER) {
Set<Integer> draggedSlots = event.getRawSlots();
for (int slot : draggedSlots) {
ItemStack draggedItem = event.getCursor();
if (draggedItem != null && KingUtil.isCrown(draggedItem)) {
event.setResult(Event.Result.DENY);
break;
}
}
}
}
Basically your buffer should be using the section palette. You need to decode that to the global palette. Then you decode that to whatever you use internally (in 1.12 that is hardcoded. i.e. 1:0 is what is minecraft:stone in 1.13+)
seems you are going to have fun learning if this is all still confusing for you đ
Hi ive missed a lot of this convo but have literally got a working chunk comber that goes through the Anvil file format. If you have any questions about how the blocks in a chunk are stored Im pretty sure I can help you out đ
have you ever had a coloring book where you colored by the numbers?
the pallete is the blocks and their associated numbers, and then you have an index with a bunch of those numbers like you see
and basically the pallette is how the server or client knows what blocks should be where in the chunk
Thats erm... not been the way its done for ages... They changed the format a while back to local palletes
yeh sure
they are on an old version
Sorry chief ive been working with the new version.
you are like the third person to state its been changed and you are not wrong đ
Any idea?
I'll be the first to be blunt then. Dont use the old version. Get away from those cursed runes and pull the band aid off now lmao
lol
have you tried, and hear me out here...event.cancel?
I dont know if its a cancelable event
xD
Also the same wiki page has example implementations for Encoding/Decoding the chunks: https://wiki.vg/index.php?title=Chunk_Format&oldid=14135#Sample_implementations. Should more than suffice there
haha You'd think. *They arn't very good lol
Trust me we had about half a month of pain before we got our version working lol
They seem to suffice
I'm working with bungeecord :l so I'm using it to modify packet that player receive
There are janky ass edge cases
but even with the change to local pallette the concept is relatively the same with my analogy only difference is that its pre-determined which blocks get what numbers instead
for now I'm replacing bedrock patterns
any better idea for that?
Aye true. Tbh ive started dabbling with using the chunk format as a good archive file format for logging plugins. Seems promising tbh. (Turns out a file format to make files with millions of blocks in a few mb is really good if you replace the idea of blocks with player action logs)
What kind of edge cases?
The dumb as hell thing where they had some blocks spanning over 2 binary longs
Wut. Isn't the max size 13 bits?
... you would have more than 1 block per line
as I seen here it is even 31 :l
*These edge cases is one of the main reasons they switched to local palletes
combine this with memory mapping and you can load and save large swaths of data in seconds. I helped someone make a custom block loggin plugin for monitoring blocks placed by those in creative. Anyways, by using binary saving and a custom way to identify the sections of data like anywhere there is a - its new data for example combined with memory mapping, they were able to load I think it was 10-20mil blocks of information in 3 seconds and saved it in 6 seconds
Ngl, i'll be blunt, if you and your friend were willing you should 1000% make that open source
You'd be a damn hero
not sure if they are still maintaining this plugin or not. This was years ago
Even if they arnt
The general principle of it would be a nice step in the right direction
Yes, but shouldn't be too hard to implement. But it looks like they [wiki.vg] already accounted for that
My point was when making from scratch for other purposes (such as a block scanner)

