#help-development
1 messages · Page 1121 of 1
Pretty much
Ah
But without netty http
why tf does mojang not do this
Because boo dependency
is it not included
Nope
i just use mc port - 1
Mojang doesn’t use it so it isn’t bundled with the game
But then that needs to be forwarded
yea
No idea
They should hire me to do it for them
banner.setType(factionData.getBannerColor());
banner.setPatterns(factionData.getBannerPattern());
banner.update(true);````
how do i change like the location where the banner looks at ?
because if i set it to a new material/type it changes its location
set the block data
declaration: package: org.bukkit.block.data, interface: Directional
Does anyone know why the PlayerInteractEvent is called when I drop an item while looking at the air?
There's no way to differentiate it, right?
I’ll have to detect when an item is dropped in the same tick or something similar
hmm
I did not know that
Is there a easy way to disable this?
for (String s : task.getRewards()) {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), s.replace("[player]", Bukkit.getPlayer(uuid).getName()));
}
Or do i just need to make my own method?
only op or * players can see that message. and thats soemthing that can be changed in the server properties or spigot, something about broadcast console to ops
Hi everyone
hi
😿
hello everyone
hi chat
💀
How do I make a warden that has a PDC tag with a player's name in it not apply darkness to that specific player?
I know there is EntityPotionEffectEvent.Cause WARDEN but how do I check which warden it was?
wsp rad
wdym "which warden it was"
just check the pdc?
ratio bozo
in 2 years
I don't have who to check it on
EntityPotionEffectEvent doesn't give an entity, only the one affected
I can check the cause to be a warden but I still need to know which warden it was or access it's pdc somehow
event?
so you're using the event, and it doesnt show who applied the effect?
just check last damager of the player then perhaps
correct
who does 10 second typing tests 💀
it doesn't even damage the player
15 seconds sorry
lots of people
gotta maximize it ykwim
do a 60 second test
i can get 200wpm with 10 words
thats the point
lemme see one sec
Is there some event for the warden when it tries to apply darkness perhaps
hello
meh
Hey
do you guys have an idea of how I would copy/paste worlds?
(without restarting the server)
I could use schematics to paste things, but the world would still not be empty, it'd still have some sort of terrain generation
Using multiverse or somethinz
how would u do that with multiverse?
Idk but I saw people utilize the mv api for doing worlds
https://pastes.dev/oZoCNRUYJb I made this with help from some very old bukkit posts
but then you'd need to restart the server
right?
No, if you use worldManager.initializeWorld(new File(getDataFolder(), "maps"), "cheese"); it will get the world named "cheese" in a folder named "maps" and create a new world in your worldfolder (which is usually in your server directory). And any world in the worldfolder is a world you can go use
what if im inside world abc
and i replace abc
with a world from maps
what happens then
would probably go wrong
the forum posts I read said to remove all players from a world before doing stuff with it
Note that it might lag the server when creating or overwriting a world. I haven't tried this while online I only use it onEnable
everything gets replaced except for loaded region files as those have file locks.
same with loaded player files etc
Everything gets replaced except whiskey
and the WeedRepository
It is back from the dead
it has been revived by the great master
rate the readme guys
https://github.com/Sweattypalms/skyblock-remake
O
looks way better than before
im gonna rate the code instead
it didnt have any images
yes it is
havent been working on it as much as my minecraft server framework (the rust one)
:3
Visually impressive
Technically nonsense?
anyone knows how big a packed enum is in c? (typedef enum __attribute__((__packed__))), size and compiler dependent?
something else than java
?paste
bro
maven does NOT want to compile with java 17
it keeps compiling with 21
I specified java 17 in intellij's project structure
and it's still compiling with jdk 17
also pom.xml?
maven uses whatever JDK you are running it with
Unless you use toolchains, but nobody does that ever
(those nerds pretend they do)
or set in the pom
Never seen one even pretend that
I'm talking about toolchains in Maven. Toolchains in Gradle do get used though
Or well, they might (invalidly) come to the conclusion that the pom.xml is setting the JDK (which is very close to that in the case of --release, but you'll find the one or the other edge case where you can see that there is a difference)
I changed my JAVA_HOME as well
Yes
<java.version>17</java.version>?
I already have that there
try a clean install
source/target?
that alone does nothing
welcome to windows
Oops
I didn't realize this would take so long 😭 so many item components
haven't even started making the builders yet
Hello together, I have an question. Does anyone now how to check if an DayLightDetector is inverted ? Spoiler: isInverted() dont work. Im using the version 1.21.
I really going to get an breakdown if i dont give up
if the method isn't work please report a bug to the Jira. Based on the code it seems like it should work just fine
use kotlin and put them all in one file
before reporting please make a minimally reproducable bug
kekw no thanks
buddy prefers bloat
Me when I have a 10,000 line file
if putting everything in a single file was so great why do we even use separate files :)
i only know one lang that does that
I know plenty of languages that separate things out into multiple files
hell even python separates stuff into other files when needed
I really don't want to look through 10,000+ line files though
its not my idea of fun
The problem is: isInverted doesnt even exist ;/
you need to update your IDE
make sure you're on Java 21 as well
Is it a good idea to create getters for different classes in my main class and just pass down the main class instead of passing everything separately, so I don't need to change a lot of stuff every time I need a new class instance.
u mean so that u can simply do MyPlugin plugin instead of PlayerManager playerManager, IdkManager idkManager?
coroutines alone are not convincing enough for me to use a borderline scripting language for development
lol
I hated it initially
For sooo long
smile will always be the biggest hater
just on everything
@shadow night dont you fucking dare
i only use it for the top level variable declaration lol
you know
you know I will
Lmaoooo
wtf even is atrocious
Is that screenshot just sittion in your clipboard
Ready for a paste at all all times
Horrible
I also found it quite nice to write initially. And then i worked on a bigger project with other devs (which where quite experienced as well) using this language.
And that really made me abhor the language.
Damn you really don't like using simple words
Not with static, I mean so I can do this
public MyClass(JavaPlugin plugin) {
this.one = plugin.getOne();
this.two = plugin.getTwo();
this.three = plugin.getThree();
this.four = plugin.getFour();
}```
instead of this:
```java
public MyClass(One one, Two two, Three three, Four four) {
this.one = one;
this.two = two;
this.three = three;
this.four = four;
}```
Abhor
That's fine
oh you haven't seen @lean arrow then
hi suit i pinged you
wake up now
Is he someone who lives for r/IncreasonglyVerbose?
Ah
coroutines are just spicy promises
So much easier to write tho
Might as well use CompletableFuture
suspend my function please
ok suspend tailrec actual inline operator fun
class WorldQuitEvent : Event<WorldQuitListener>(WorldQuitListener::class)
ill js leave this here
why do i have to type in the type twice???
It gets real fun as soon as you introduce your own syntax via infix functions
tbh that is quite fun
yes
incredible!
infix fun Int.pow(other: Int) = ...
println(2 pow 2)
assertTrue(2 pow 2 == 2.pow(2))

Also ^ is bitwise xor
yea
we had it as pow in maths lmfao
apparently you have to do this ```kt
fun power(baseVal: Int, exponentVal: Int): Long {
val base = baseVal
var exponent = exponentVal
var result: Long = 1
while (exponent != 0) {
result *= base.toLong()
--exponent
}
return result
}
You could improve this in some ways, like checking if the base is 0, 1, -1 or 2, but this is essentially what you need to do.
it's just the first baeldung result
You could introduce ** like python.
Honestly. Not too horrible. But it completely ruins any coding standard.
is there any good alternative to kotlin? scala maybe?
Java
boilerplate
Writing precise, standardized code requires verbosity
why not kotlin
kotlin is concise, multiplatform and fun!
i mean if your code sucks, it's gonna suck in any language
speaking from experience?
not in kotlin 
first-hand
emison v2 when
If you want to snot out code without boilerplate you can also just write python and use GraalVM
Groovy is the greatest language
💀
Just never try to decompile it lol
rust best
And debugging is a pain, too.
But that's just an ecosystem issue. Language-wise groovy is good.
thats what im saying. so ill js use whatever language is the least annoying
Saved as screenshot for future riles
send to @shadow night for the important channel
I mean, I'm one of those few people who have a /bit/ too much experience with gradle.
So I've also grown accustomed to groovy by extension.
if anyones interested this is how decompiled kotlin looks
i prefer kotlin dsl > groovy. Because kotlin at least tries to be a programming language
interesting
try decompiling it yourself then
i mean i have the src
which decompiler is that?
vineflower
now try to decompile clojure into java :Clueless:
i still have to make my brainfuck to java bytecode compiler
i think coll challenged me to
Shouldnt be too hard. Except that the granularity of pointer shifting in java might need a bit of tinkering.
why does it do this
i forgot how brainfuck works so i have no idea
hmmmmmm ah yes
thought it was a bunch of loads/stores
aha
weak
lateinit is another keyword i despise. Why not write a proper lazy object.
annoying
i got a good example
by lazy moment
real
by lazy is synchronized by default though
private val apiKey hehe
// FIXME: don't put in sourcecode
college projects be like
Hello is there anyone here who is interested in protocollib packages and could help me in plugin?
sure
interesting
I'm creating a plugin for the tab list on version 1.20.1, but the problem is that when I try to intercept the 'PLAYER_INFO' packet and use 'PlayerInfoData' to set the player's display name on the tab list, it throws an error. Could you tell me what I'm doing wrong? ;p Or what I might be missing to correctly change the player's display name on the tab list?
what does flate do
https://imgur.com/a/AGQNqvY <- error i got
Can I somehow loop all withers in the world without looping all entities?
just add a check if it's not a wither?
right
Hm this could be done without an unchecked cast warning
list.add((T) bukkitEntity);
->
list.add(clazz.cast(bukkitEntity));
Same result but still
Is it?
🗿
not completely the same result tho
Is skid obfuscator allowed? https://github.com/skidfuscatordev/skidfuscator-java-obfuscator
I don't think flow obf is that allowed
I'm going to use proguard but it gives an error 😦
Myeah, it honestly just moves the unchecked warning down to javas method XD
But uh, if you plan on releasing your plugin elesewhere these restrictions are kinda irrelevant
Before anyone here is giving you advise on obfuscators, you would first have to make a strong argument on why you really really need to obfuscate your code.
I need to protect my home plug-in
Most of the time obfuscation backfires
i will laugh if the code is a piece of shit
your only reason to obfuscate should be optimization of some
obfuscation for the purpose of hiding the code is pointless
At that point just don't release source
that's the whole point of obfuscation tho
that's literally what the word means too lol
anyone ? 
the vm will take care of optimising your code anyway
lol
filter out null values from the data stream
Well, you can optimize for size using obfuscation
Can I somehow get if a location is colliding with some player's body and which?
But there are a few other ways of optimizing jars for size that don't include obfuscation (most notably using jar-in-jar where as the entries within the inner jar are STORE'd)
Yes, entities have a BoundingBox and you can check if a location is inside a BoundingBox
BoundingBox? Sounds interesting
I would need to loop all player's though, right?
You could just check around the area of which the location is
What is your overall goal? There are probably a lot of optimizations you can do.
I'm raycasting a projectile and trying to check when it collides with something
tbh there probably is
I didn't really google how to do it and just improvised so perhaps im doing evething wrong :D
always the same error
This way you can give your projectiles a custom size and use spigots ray tracing to check for collisions with blocks or entities:
public class CustomProjectile {
private double size;
private Location location;
private Vector velocity;
public void flyForward() {
World world = location.getWorld();
boolean ignorePassable = true;
double maxDistance = velocity.length();
RayTraceResult result = world.rayTrace(location, velocity, maxDistance, FluidCollisionMode.NEVER, ignorePassable, size, entity -> {
if (entity instanceof Player) {
return true;
}
return false;
});
// Add the velocity to the location
location.add(velocity);
if(result == null) {
return;
}
Block hitBlock = result.getHitBlock();
if (hitBlock != null) {
// Do something with the hit block
}
Entity hitEntity = result.getHitEntity();
if (hitEntity != null) {
// Do something with the hit entity
}
}
}
Show your modified code
protocolManager.addPacketListener(new PacketAdapter(this, PacketType.Play.Server.PLAYER_INFO) {
@Override
public void onPacketSending(PacketEvent e) {
if (e.getPacketType() == PacketType.Play.Server.PLAYER_INFO) {
PacketContainer packet = e.getPacket();
List<PlayerInfoData> playerInfoDataList = packet.getPlayerInfoDataLists().read(0);
List<PlayerInfoData> modifiedLists = playerInfoDataList.stream()
.filter(data -> data != null)
.map(data -> {
WrappedGameProfile profile = data.getProfile();
Player player = getServer().getPlayer(profile.getUUID());
if (player != null && player.getName().equals("oneyz_")) {
WrappedGameProfile newProfile = new WrappedGameProfile(profile.getUUID(), "newName");
return new PlayerInfoData(newProfile, data.getLatency(), data.getGameMode(), data.getDisplayName());
}
return data;
})
.collect(Collectors.toList());
packet.getPlayerInfoDataLists().write(0, modifiedLists);
}
}
});
now im going to feel like I was spoonfed :(
but sick code 🔥
What is the new exception?
[20:09:04 ERROR]: [TabOZ] Unhandled exception occurred in onPacketSending(PacketEvent) for TabOZ
java.lang.IllegalStateException: Unable to set value of field private final java.util.EnumSet net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a
So thats a different exception now at least
yes, but why?
i didn't see any errors in code
I've been struggling with this for 3 days xD
The exception above occurs from PLib not being able to set a field in a packet via reflections.
Make sure that you use the very latest PLib version. 5.2.0 i think.
still the same
Can’t you streamline the lambda to Player.class::isInstance
Yes, i just wanted to be a bit more verbose for him 🙂
or with kotli...

kekw
fr!!
@lost matrix added log for:
modifiedLists and playerInfoDataList
and both is empty:
https://imgur.com/a/9HqhYsP
what could be the cause?
Alright my head's a mess right now; I'm trying to update my plugin to 1.20.5 but I've completely forgotten how to get the dependency in place
I know it maybe had something to do with buildtools or... something, I don't know. Help? skdjd
Surely there's an easier way no?
using maven?
Change your dependacy in Pom
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>```
Yeah, but I have no idea where the strings I should place in the POM to update the versions are
And I also don't know what i should do previously... I thought I had to use buildtools and it'd autofill afterwards but no
Running BuildTools is only required if you have NMS dependencies. Otherwise the spigot-api is provided automatically via the spigot repo.
All you have to do is update the version inside your pom.xml
Send us your pom and well find out what you need to change
Hello
Yeah, I do have core needs for the NMS dependencies so that might've been why
one sec..
There you go
By any chance is there the auction plugin, auctionhouse updated to 1.21?
I dont see any nms dependency...
I wrote in that channel
It's used through another module called core-nms, don't worry too much about it
I really just don't know where to find the strings for the dependency versions
Then you should wait, this channel is for development, not server help
I'm bookmarking this, thank you!
I mean this is literally the repositry you added in your pom ^^
Just opened with a browser
Also, remind me slightly: spigot is for nms, spigot-api is for the api only right?
is the crawling in a 1x1x1 block another event than swimming?
oh my god
I really can't get away from development for 3 months
this was so stupid lol
thank you
nms can no longer be accessed via just the spigot artifact. It is strongly recommended to use the remapper now
?nms
Oh thank you!
I so hope this removes the need for my nms multi-version compatibility thing...
Out of curiosity, why do they obfuscate their mappings?
If... they're just going to release the mappings afterwards...
Didnt this change in 1.21? I fondly remember reading that mojang just distributes unobfuscated sources now
I guess its possible but I highly doubt it
When suing someone for Copyright you have to demonstrate that you actually made an effort to protect your property.
When I use this and it hits a block, is it possible to check which side it hit?
@misty folio im best pumkin
Check the RayTraceResult. I think it has a method for that.
I could never sue somebody for copyright then
You can't imagine how much I do NOT care for that shit
ah, thx
It just makes it easier if you obfuscated.
can anyone know how to make numberless scoreboard? 1.21 nms
Spigot forbidding obfuscation: :D
You can on spigot, with limitations
I'm creating a gui system for a kit, the kits are visible in the gui according to the permissions the player has, but there is a problem.
I set permissions with luckperms. There are 2 kits and 2 Ranks.
I gave one permission for each, but every time a player dies and revives, the system gets confused about which kit to give to the player. For this reason, I used a method like this; the kit permission for the higher rank is set to permission true and the kits with lower ranks are set to false, which prevents the kits from appearing in the gui. What can I do about this?
is there no way to detect if a player is crawling / cancel it?
In short, the player is also allowed to be permissin.
And is it possible to have it visible in a kit gui set to false
Whats the best way to advertise a free plugin you've made?
its not really something you advertise. it is published on spigot which is for server owners to look through.
fair
youll probably never find ads for plugins especially really successful ones like luckperms or skinsrestorer, the truth is that the best way to get ur plugin out there is to just make a really good plugin
Player#setSwimming(true) no?
Question, How do you count how many strings are in a configurationSection with a certain name? eg
Rewards:
Item: 'diamond'
Count: 5
Item: 'iron_ingot'
Count: 10```
no somehow doesnt detect it on a swim event
canceling swimming works crawling no
getKeys(false).size()
Yes that counts everything in the section though.
Duplicate keys 💀
I know, cant think of a better way of doing it
which new nbt changes
the 1.20.5 nbt removal
oh probably
Mojang doesn’t have to avoid breaking changes :p
Mojang employee that makes world converters: 💀
Ahh okay I've re-read my own code and reunderstood everything
whats up
I'm not actually using NMS fully, i'm using reflection to call NMS methods based on the version, and I make new reflector classes for new versions when things change within the scope of what i'm using
so I need to read through the code to check for changes
read the context !!!1
Which, due to the new nbt removal, must be a lot
i hate reading because you cant hold a consistent conversation
fuck you
I have to download stuff from buildtools to read the code from nms right?
yes
alright, thank you!
you need to run buildtools (and you prob want it remapped)
I seem to be using the obfuscated call method names within my reflectors, which makes me think that that's what is provided to us through the spigot server right?
oh thanks!
Yeah, so I'll need to pop up the remapped source code on one side and match it with the obfuscated one on the other side, and use the obfuscated ones for reflection...
alright, i'm caught up with my prior logic
tyy
Eh when mapping a value with a string, if the string key is " ", is that a null key or will it take it as is?
space
Cool cool
is there any documentation for the new components system...?
My entire plugin used to revolve around NBT manipulation with NMS and it's all gone to shit now...
I'll look into it, ty!
time to remake your plugin 😂
The way I made it only requires me to remake one small part of it, the one that actually handled NBT serialisation and deserialisation into base64 data, but jesus christ nothing works
why would they do this
If you are already making a reflection class for every version
Just use actual modules and ditch the reflection
modules?
Also it's not quite that
I made reflections for every major change in nms where it affected my serialisation use cases
so, only when nms screwed items
pdc
Backwards compatibility to 1.7.10 would break consistency with pdc
Also I couldn't use PDC because I'm just getting all the info about an item and serialising it so it can be recreated later
and not storing stuff in it :p
Unless I misunderstood PDC: My current understanding is that PDC is a "container inside an entity or item that allows it to hold extra data"
All of their data?
Yes
anybody?
How so? It might make everything easier
They are ConfigurationSerializable
And there’s also BukkitObjectOutputStream and BukkitObjectInputStream to convert them to bytes
Ah yeah, I use that
Nvm on my question.
I convert an ItemStack into a signed magnitude base32 int representing the item, and then into base64
I didn't know about ConfigurationSerializable though
I'll read up on it
Ahhh, I didn't know they were serialisable by default... Time to rewrite this part and get rid of nms. Yay!
are there any examples/tutorials for knowing the right architecture to adopt for your plugin (for example, for packages you put such and such a thing in managers, listener, utils etc....)?
How can I prevent a boat from rotating?
Sometimes the byte[] tranformation is slightly out of size for a base64 encoder to make it work, (common with mods), so the mag 32 step ensures that it's always within a comfy size for the encoder! I'm essentially translating it into a predictable-sized int that it can always make do with 😄
I didn't know I could directly get the byte[] from spigot's api, so i was using nms for that
How do I disable the HikariCP logger?
I have already tried:
Logger.getLogger("me.skinnynoonie.nooniemanagement.hikari").setLevel(Level.OFF);
and
Logger.getLogger("me.skinnynoonie.nooniemanagement.hikari.HikariDataSource").setLevel(Level.OFF);
But it does not do anything, I still get these logs:
[17:18:47 INFO]: [me.skinnynoonie.nooniemanagement.hikari.HikariDataSource] HikariPool-5 - Starting...
[17:18:47 INFO]: [me.skinnynoonie.nooniemanagement.hikari.pool.HikariPool] HikariPool-5 - Added connection org.postgresql.jdbc.PgConnection@4fde8f16
[17:18:47 INFO]: [me.skinnynoonie.nooniemanagement.hikari.HikariDataSource] HikariPool-5 - Start completed.
Does PotionEffect#apply replace the existing effect?
The solutions do not work
what difference between spigot mappings and mojang mappings, which is better?
It keeps using Bukkit's logger
?tas
Mojang
Spigot mappings are dead
How do I reset someone's equipment after sending a fake equipment change to a player
ok, thx
Do I just do it manually
multiple rewards are annoying
for some reason i keep running into a different entity id than the item displays that are being spawned?
event.getPlayer().getNearbyEntities(2, 3, 2).stream().filter(entity ->
entity.getPersistentDataContainer().has(this.ctfGame.getTeamKey())).filter(entity -> entity.getType() == EntityType.ITEM_DISPLAY).map(entity -> (ItemDisplay) entity).filter(itemDisplay -> itemDisplay.getItemStack() != null && itemDisplay.getItemStack().getType() != Material.AIR).forEach(entity -> {
System.out.println(entity.getEntityId());
System.out.println(entity.getType());
final String value = entity.getPersistentDataContainer().get(this.ctfGame.getTeamKey(), PersistentDataType.STRING);
if (ctfPlayer.ctfTeam() == CTFTeam.BLUE && value.equalsIgnoreCase("red")) {
ctfGame.assignFlag(event.getPlayer(), "red");
} else if (ctfPlayer.ctfTeam() == CTFTeam.RED && value.equalsIgnoreCase("blue")) {
ctfGame.assignFlag(event.getPlayer(), "blue");
}
});```
redFlag = sign.getWorld().spawn(loc.clone().add(0, 2, 0), ItemDisplay.class);
redFlag.setItemStack(new ItemBuilder(Material.DIAMOND_HOE).setCustomModelDate(1).build());
redFlag.setItemDisplayTransform(ItemDisplay.ItemDisplayTransform.GROUND);
redFlag.setBillboard(Display.Billboard.CENTER);
redFlag.getPersistentDataContainer().set(((CTFGame)this.getGame()).getTeamKey(), PersistentDataType.STRING, "red");
redFlag.setGlowing(true);
System.out.println(redFlag.getEntityId());
((CTFGame)this.getGame()).getRedTeam().addEntities(redFlag);``` i have two of these that print 24 and 30
this prints 47
public void setHidden(boolean hidden) {
this.hidden = hidden;
if (hidden) {
PotionEffect invisibility = new PotionEffect(
PotionEffectType.INVISIBILITY,
20,
0,
true,
false
);
instance.runTimer((task) -> {
Player player = getPlayer();
if (!this.hidden) {
task.cancel();
if (player != null) {
Map<EquipmentSlot, ItemStack> equipment = new HashMap<>();
for (EquipmentSlot slot : EquipmentSlot.values()) {
equipment.put(slot, player.getInventory().getItem(slot));
}
for (Player p : Bukkit.getOnlinePlayers()) {
p.sendEquipmentChange(player, equipment);
}
}
return;
}
if (player == null) return;
invisibility.apply(player);
for (Player p : Bukkit.getOnlinePlayers()) {
p.sendEquipmentChange(player, HIDDEN_EQUIPMENT);
}
}, 0L, 1L);
}
}```
Why is ``this.hidden`` in the lambda always false?
?
bump
Bump
you were told why
This explains nothing
If it means anything, it means that this.hidden is supposed to be true, not false
the expression itself will always be false
not always, but most of the time
The if statement passes, and this.hidden is true ouside but false inside
What warning?
IntelliJ sometimes tells you if it thinks something will always be true/false, but based on you asking what warning I don't think that's the case
so specifically where is it not passing?
So basically
This prints these:
Hidden value outside: true
Hidden value inside: false
is there a way to check if block is replacable? like grass, snow layer, veins - that means if you click on them with a block they get replaced with this block, you dont have to break them
i need to replace block if its air or replacable block
I believe if it's not solid
Bump
but is for example flower solid?
probably no
not
I don't think so
so if its not solid then what you said is not true
if this.hidden is false in the lambda u must be calling the setHidden method twice in that one tick
Yeah I just found out I was calling setHidden(false) in one of the helper methods
so it works now?
👍
nice
Also how do I spawn an ash particle that doesn't fall
particles are clientside AFAIK
There is a server doing it
maybe they use a differernt particle
Maybe, but what particle looks similar
idk which one it was but there was one that was js a gray dot
is it bad practice to use records for stuff like services that just take a couple things in
No, that's fine. Records are just immutable data holders, so treat them as such. If it's not an immutable data holder, use a class
That's what I was thinking, but one could also argue that like they are only proper for like user data ect
Basically treat it like a C++ struct :p Shouldn't really have any more methods than what is generated for it
public record DefaultVersionLoginPacketHandler(
LabyModProtocolService protocolService
) implements PacketHandler<VersionLoginPacket> {
@Override
public void handle(@NotNull UUID sender, @NotNull VersionLoginPacket packet) {
}
}
so this would be bad?
as opposed to just having a normal class
.
Hello, which lib should I use to interact easily with NMS ?
bump
packetevents
i'm in their readme as well
That’s for packets specifically
.
yeah, I don't want for packets
and for others there's only nms and reflection right
I saw that x)
(as sane solutions)
well, interacting with nms using reflection or smth like that
still not specific enough
I need some classes to do that
what do you really want to do
whar
Bump
I tried
I noticed the ash particle has a black variant, which doesn't exist here
Can you try to remember it
was years ago when i didnt even know java and i went through the whole particle list so i rlly cant
Oof
i found it
I found it on accident lmao, it was mycellium particle if you're wondering
What is the mycellium particle in spigot?
where can i find the craftbukkit version codes corresponding to the minecraft version? like v1_20_R3 = 1.20.4
they do not line up like that always
ok I'm really tired of my hotswapping being broken, does anyone have an up to date guide on how to do it correctly
i just wrote a python script for this
import sys,zipfile,io
jar = sys.argv[1]
with zipfile.ZipFile(jar, "r") as z:
jar2 = z.read("META-INF/versions/" + jar.replace(".jar","") + "-R0.1-SNAPSHOT.jar")
jarf = io.BytesIO(jar2)
with zipfile.ZipFile(jarf, 'r') as ja:
a = ja.namelist()
fl = [f for f in a if f.startswith("org/bukkit/craftbukkit/")]
print(fl[1])
what is broken about it? Also I don't think everything can be hotswapped
every single time
at least right now
from my limited research it seems its a limitation with intelliJ currently
all I did was change a single character in a string
I think it might dislike the build logic I have
because I'm shading stuff
but it used to work
well not a limitation with intelliJ, rather the hotswap it uses
I used to have a working setup but then nuked it
From doing no research at all, it looks like the hotswap failed
by mistake
not sure if its the build logic or not rather what it is you are trying to change
you are not doing clean build right?
it always does it
no matter what I am changing
damn it I'm having another energy crash this sucks
lol
bump
Custom entity behavior = nms implementation.
There are some tricks you can try instead:
- Mount it on an ArmorStand
- Set its rotation on every tick (ugh)
- Modify outgoing rotation packets. This will result in the boat rotating only server-side
Tried mounting it on an armor stand and that pretty much fixes it, but then I can't detect the boat going backwards because it can't. I'm already sending a Vehicle Move Packet with the yaw/pitch reset any time they give input, but it seems like the client still rotates the boat...? Not entirely sure, but here's the video:
https://cdn.discordapp.com/attachments/706186227493109860/1274892580844339272/2024-08-18_19-46-08.mp4?ex=66d4627d&is=66d310fd&hm=7429d0e3f2f43f9f51a5663c409a6f83b27a8d6705aa5558892d78cc067bfc36&
Hm, what is it you want to achieve in general?
greatness
Ah in that case i got a tutorial post in spigot. let me look for it rq
unfortunately the client doesn't send the vehicle steer packets when your camera (set via camera packet) isn't your own, which makes my goal of a third person camera impossible
however the client still sends boat information (paddles turning & vehicle move packets) if the camera is not its own
so I have to resort to boats to detect wasd input
Alright, sounds like the server doesnt need a boat at all? You could just send a packet to the client, making it think its on a boat, resulting in
the client sending steering packets, without an actual boat on the server that could rotate as a result.
the problem is the client thinking its on a boat will send flawed vehicle move packets which impacts the coordinates sent, making a certain part of the detection not work
unless I can get the boat to stop rotating
(more specifically if I hold, for example, my D key and the boat rotates to the right, it will continue to try to do so when I let go even after resetting it as shown in the video)
How do I disable the HikariCP logger?
I have already tried:
Logger.getLogger("me.skinnynoonie.nooniemanagement.hikari.pool.PoolBase").setLevel(Level.OFF);
Logger.getLogger("me.skinnynoonie.nooniemanagement.hikari.pool.HikariPool").setLevel(Level.OFF);
Logger.getLogger("me.skinnynoonie.nooniemanagement.hikari.HikariDataSource").setLevel(Level.OFF);
Logger.getLogger("me.skinnynoonie.nooniemanagement.hikari.HikariConfig").setLevel(Level.OFF);
Logger.getLogger("me.skinnynoonie.nooniemanagement.hikari.util.DriverDataSource").setLevel(Level.OFF);
try {
this.dataSource.setLogWriter(null);
} catch (SQLException e) {
throw new RuntimeException(e);
}
But it does not do anything, I still get these logs:
[17:18:47 INFO]: [me.skinnynoonie.nooniemanagement.hikari.HikariDataSource] HikariPool-5 - Starting...
[17:18:47 INFO]: [me.skinnynoonie.nooniemanagement.hikari.pool.HikariPool] HikariPool-5 - Added connection org.postgresql.jdbc.PgConnection@4fde8f16
[17:18:47 INFO]: [me.skinnynoonie.nooniemanagement.hikari.HikariDataSource] HikariPool-5 - Start completed.
some people ought to think twice about what they're calling their services
Are you talking to me?
I guess I'm more generally talking to hikari and his <redacted> logger
It's because I'm shading it
god past me is so good at writing api endpoints for no discernable reason
thanks past me
real nice of you
some say he's still looking for that guide to this day
I think md5 posted it on andrew tate's youtube accidentally
Is it possible for a non player to ever click an inventory?
Pretty sure it was around before cp had that connotation
But yeah sounds weird saying around my non programmer friends lmao
Oh, I thought he was talking about the class name
I still don't understand how I can disable the logging
hello, i had a plugin create dummies that i now cannot delete and here is the Entity data is someone able to help ?
this is the following entitiy data Training Dummy: Damage: 10 has the following entity data:
<"extra":[{"bold":false,"italic":false,"underlined":false,"strikethro
ugh":false,"obfuscated":false,"color":"red","text":"Training
Dummy: "},{"italic":false,"color":"yellow","text":"Damage:
10"],"text":"""')"
kill @e time
Im learning java could anyone possibly send me a straight forward plugin i can look at
Like dm it to me
I remember when I didn't know OOP and Java, Bukkit's encapsulation was so confusing to me
that dont work
What particles can I use to outline a block with green effect? without glow
You're helping more than usual illusion 😄
I'm always helpful just not to you
Oh why's that
imillusion halp pls how 2 good code jeva sai 'compile no' i cri
Ok bro
;-; I thought you were always helpful
poor kat

whatd he do to you
I just don't like him
💀
perfect time to pitch my startup, it's an online platform that connects psychiatrists to chicken
I'm looking for a 3bil in funding at a 10bil evaluation
it's called eggcelent counselours
that was good lol
Good thing I don’t like you either ugly
damn
Ikr really throwing some fire his way
I was hoping for an uno reverse card or something 😦
?pastebin
Does anyone know how to make numberless scoreboard? 1.21 nms
does anybody know why this would be double messaging like this ?
Guys, why does the warden not call EntityTargetEvent when it hears me??
I was wondering why people weren't showing up to work
💀
okay youre cooked even more
the fuck bro
did you go
also how does one pull that off bro
Hey, i'm trying to use adventure (a gradient) but it looks like this
Here's the code to deserialize it:
public static String miniMessageParse(Player player, String input) throws NullPointerException {
String message = getInstance().messages.getConfig().getString(input);
if (getInstance().getServer().getPluginManager().getPlugin("PlaceholderAPI") != null)
return miniStringParse(parsePlaceholderAPI(player, input));
return miniStringParse(message);
}```
<gradient:blue:dark_purple><b>Carbon Bag
Does someone know why this happens?
And it doesn't act as a gradient
public static String miniStringParse(String input) throws NullPointerException {
if (input == null)
throw new NullPointerException();
MiniMessage miniMessage = MiniMessage.miniMessage();
TextComponent text = (TextComponent) miniMessage.deserialize(input);
return LegacyComponentSerializer.legacySection().serialize(text);
}```
Yea i do
however, how do you enable hex colors there?
private static final LegacyComponentSerializer LEGACY_SERIALIZER = LegacyComponentSerializer
.builder()
.character('§')
.hexCharacter('#')
.hexColors()
.useUnusualXRepeatedCharacterHexFormat()
.build();
I'll try it, thanks
whats the event of when a player looks at the display name of an item in an item frame?
or whats the event of when an item frame gets rendered by the player
(basically i need to disable the display name of the item)
can i update scoreboards async?
i want to disable this
yep
set it to "" afaik
nah u still see this:
try null?
or a negative space
idk if the display name is Nullable but i think so
mojang and spigot are fucking ass
holy shit
only reason java is gonna fucking plummet to the fucking ground
if it hasnt already
Try kotlin
nah, java's nice
especially since 21
They seem mad about something
there isnt a single standard when it comes to mojang
whether its their code or the protocol
unbelievable
Their coding standards have gotten quite a bit better. Especially when it comes to the data-driven parts.
Yeah
Registries are pretty standard now
Compared to 10 years ago when everything was magic values
sometimes they want varint, sometimes they want int
sometimes they start from 1 and sometimes from 0
¯_(ツ)_/¯
Idk why int is used tbh
It’s only worth using if you expect to regularly have large values
I just switched from a spigot server to a paper server rn just for performance reasons. I loaded my spigot plugin where I register a scoreboard via plugin for playtime using:
private void registerScoreboardPlaytime() {
Objective objective =
this.scoreboard.registerNewObjective(
"playtime",
Criteria.statistic(Statistic.PLAY_ONE_MINUTE),
formatColors("&" + this.getConfig().getString("playtimeTitleColor") + "Playtime")
);
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
List<OfflinePlayer> players = List.of(Bukkit.getOfflinePlayers());
players.forEach(offlinePlayer -> {
String offlinePlayerName = offlinePlayer.getName();
assert offlinePlayerName != null : "Offline player name is null";
Score score = objective.getScore(offlinePlayerName);
score.setScore(Math.round((float) offlinePlayer.getStatistic(Statistic.PLAY_ONE_MINUTE) / 20 / 60));
});
Bukkit.getScheduler()
.runTaskTimer(
this,
task ->
Bukkit.getOnlinePlayers()
.forEach(player -> {
Score score = objective.getScore(player.getName());
score.setScore(Math.round((float) player.getStatistic(Statistic.PLAY_ONE_MINUTE) / 20 / 60));
}),
0,
60 * 20
);
}
now it updates the playtime each tick and counts it up. Everytime the schedular is called tho it resets to normal, why tf does it do that??
could it have to do with the fact that getOfflinePlayers probably also uses the online players?
i mean this is only called onEnable
it's supposed to set the times for OfflinePlayers once
just to display it
and updating is supposed to happen every minute
I think you need ask this in the paper server
just did :)
Oh... Sorry xd
did they scold you?
Is there any way I can make the lava flow faster without using gamerules?
Location look = player.getLocation();
Vector vec = look.getDirection();
player.setVelocity(vec.multiply(2.5));```
How can I make it so the player doesnt take fall damage from this?
this is in paper.yml:
lava-flow-speed:
normal: 30
nether: 10
Hey, is there a way to avoiding players getting slowed down by soul sand?
I think Its client-based so the only way is to give speed to players on soul sand.
Hmm, i'll try to do that
You could possibly give them the attribute the soul speed uses.
Only 1.21+
Uh, i need multi version support, so that's not an option unfortunately
Do you guys know how much does soul sand reduce speed?
info on wiki says "approximately 41.91%"
Could someone help me with this :)
My idea for this would be:
Give player some flag using PDC
Schedule clearing of this flag in few seconds
Have event listener listen for player damage, specifically fall damage (I do believe you can differentiate it somehow)
And cancel the event if player has the flag set.
Don't exactly know what you're trying to achieve tho, so can't help more.
Hello, anyone can help with this? :<
https://imgur.com/a/GDWBHX3
listen for the damage event, check if its from fall and cancel it
would be my guess
How would i check if its from the fall?
EntityDamageEvent#getDamageSource
But then wouldnt that just be from all falldamage?
just set a flag somewhere when the player uses the ability or whatever then when the event occurs, check for the flag and set it back to false
But then say the player lands in water the flag would still be true so when the player next falls from somewhere they wont take damage
well you could use PlayerMoveEvent
to check if the player is in water
Ok thanks
but that eats performance so idk
Nevermind, it's bug (i guess) from PLIB - Writing to index 1 seems to have worked for me specifically for the player info update packet
before:
List<PlayerInfoData> playerInfoDataList = packet.getPlayerInfoDataLists().read(0);
packet.getPlayerInfoDataLists().write(0, modifiedLists);
after:
List<PlayerInfoData> playerInfoDataList = packet.getPlayerInfoDataLists().read(1);
packet.getPlayerInfoDataLists().write(1, modifiedLists);
modify(Consumer<T>) when
If i'm using mojang mappings, do my reflection methods etc still need to be obfuscated
or will maven do that
for instance SomeClass.class.getDeclaredField("a") as supposed to SomeClass.class.getDeclaredField("someReadableValue")
In the past i've never really used mojang mappings so the above example was my usual go-to
or if it makes more sense, my IDE complains with this:
Is there a way to make them compatible
In a pvp indoor area with world guard, when a player hits another player, LastDamager detects this in the fake death I coded and when the player dies, the kill is counted to the person who hit him.
But pvp is off
Will I control this by integrating the worldguard API? Or is there another way?
Hm
Is there any way I can make the lava flow faster without using gamerules?
ah ok
In my plugin, I need to develop a solution that takes into account all situations such as pushing with a rod, hitting with a snowball/egg, dying with lava or fire and processes them in detail in order to determine the correct lastDamager according to the factors that caused the player's death.
For example, when I push a player with a rod, shouldn't the LastDamager be written to me when that player falls from a height and dies? But the system doesn't do this and this applies to everything above, I need to solve this problem
A what?
new minecraft strucutre lootchest
Oh so it is a thing
yeah
Is it literally called trial vault?
Interesting block huh
key hole lived throu some tough shit
Anyways yeah probably playerInteractEvent and see if the block interacted with was a "trial vault"
hey I was gonna write that
Too slow :p
and since its an inv you can prob even check for inv open event and then check the type
wait is it even an inv?
im confused
It looks like a spawner sorta thing to me kek
It won't trigger InventoryOpenEvent
because its not a Menu
InventoryOpenEvent is a shittily named MenuOpenEvent
.
yeah I didnt play that shit yet so I guessed
not like Container is really indicative of anything anyways its just a fancy list wrapper
and then I questioned my self
wheres the diff?
or does he mean that every token ever expires every 30s global time, even though you just created it?
tf
Creating a new entity with nms, keep getting ...Squid has not defined synched data value 16
trying to get SynchedEntityData with getEntityData()
Constructor<?> help = Squid.class.getConstructor(EntityType.class, net.minecraft.world.level.Level.class);
just for simplicity thats basically what i have
make a spigot/paper fork
and make it public
:(
(i personally find paper way easier to fork)
effort
considering they have examples and a guide on how to
someone make it public and send me the jar
i know how to
in my internal paper fork i made like most of nms public
i should consider that
ehhhh okay maybe
maybe it's time to do that
My genius is insurmountable
im so tired
why did i even google that
I messed up
turns out i have no clue how i did it
anyway for paper support go to their discord
I don't need a paper fork
?whereami
ike
i know how much you hate paper but it is way easier to patch
yes but I love finding ways to use it
hmm, this won't work for a public server in hindsight
As in people who download it
i'll try find a way without the patch and then resort back to it if i have no luck
yea obv
you'll need reflection or some asm or bytebuddy fuckery
(accesswidener and mixins my beloved)
yeahhhh
why isnt it public anyway
kinda annoying

in nms text displays every setting method is private
mojank devs when their ide says to make it private bc no usages:
😢
YEAH
erm
ok thanks mojang
me when the builder constructor is private
i've seen constructors which are private and only the bytebuf ones being public
kinda annoying
but w/e
mostly packets
wgaat
i barely ever use private tbh
only for redundant things that i don't want clogging up my autocomplete
lmao
or fields
I have a feeling i'm being judged
stop judging me
mine doesn't count
you suck
i wouldn't take that if i were you
just saying
thats so me
help im trying to build a gradle project where does the jar go when I run jar 😭
WHERE IS ITTTT
uhh context?
build/libs
^^
I have this totally not nbt related reading logic, IJ cries about the while body being empty, is there a way to make it shut up?
Node compound = new Node();
while (readNextTag(compound));
root.setStorage(name, compound);```
put something in it
I dont need to
run build not jar and if you have shadow run shadowJar not build
readNextTag is a class method which updates some offset variable, which is used to determine when its done or not
and I want it to continue until its done
its like, do this function until it returns false
hank you
okay so there is no clean way I guess
what's so unclean about it
if I add a continue the IJ is crying about it being the only statement and therefor useless
is it possible to store entire itemstacks with their meta in PersistentDataContainer?
or something
well its not really waiting
its like waiting, but the updates are happening inside the function calls
like its waiting until x iterations
which depends on the data
good place to use it then
like a byte array