#help-development
1 messages · Page 1085 of 1
Any way to prevent player from clicking a GUI item multiple times in a tick?
Do I need to implement some locking mechanism perhaps
Hey, I have this code:
private void updateVariables(@NotNull ItemStack itemStack) {
Tools tools = getTool(itemStack);
//tools.tools.name
List<String> expectedLore = getInstance().getConfig().getStringList("tools." + tools.name() + ".lore");
//Edit level
int levelLine = -1;
int prestigeLine = -1;
int essenceLine = -1;
int sellModeLine = -1;
for (int i = 0; i < expectedLore.size(); i++) {
String line = expectedLore.get(i);
if (line.contains("%level%")) {
levelLine = i;
} else if (line.contains("%prestige%")) {
prestigeLine = i;
} else if (line.contains("%essence%")) {
essenceLine = i;
} else if (line.contains("%sell-mode%")) {
sellModeLine = i;
}
}
ItemMeta meta = itemStack.getItemMeta();
List<String> lore = meta.getLore();
assert lore != null;
if (levelLine != -1)
lore.set(levelLine, expectedLore.get(levelLine).replace("%level%", String.valueOf(getItemLevel(itemStack))));
if (prestigeLine != -1)
lore.set(prestigeLine, expectedLore.get(prestigeLine).replace("%prestige%", String.valueOf(getItemPrestige(itemStack))));
if (essenceLine != -1)
lore.set(essenceLine, expectedLore.get(essenceLine).replace("%essence%", Utils.formatNumber(BigDecimal.valueOf(getItemEssence(itemStack)))));
if (sellModeLine != -1)
lore.set(sellModeLine, expectedLore.get(sellModeLine).replace("%sell-mode%", getItemSellMode(itemStack)));
meta.setLore(lore);
itemStack.setItemMeta(meta);
}```
I thought it was really laggy and there could be better ways to update an item lore without having to do all this. Is it possible?
ProtocolLib error, not sure how to fix it [18:58:09 ERROR]: Error occurred while enabling Skonic v1.0.5 (Is it up to date?) java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because the return value of "com.comphenix.protocol.ProtocolLibrary.getProtocolManager()" is null at ca.nagasonic.skonic.Skonic.onEnable(Skonic.java:45) ~[Skonic-1.0.5.jar:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:190) ~[paper-1.20.2.jar:git-Paper-309] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.2.jar:git-Paper-309] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_20_R2.CraftServer.enablePlugin(CraftServer.java:646) ~[paper-1.20.2.jar:git-Paper-309] at org.bukkit.craftbukkit.v1_20_R2.CraftServer.enablePlugins(CraftServer.java:557) ~[paper-1.20.2.jar:git-Paper-309] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:627) ~[paper-1.20.2.jar:git-Paper-309] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:424) ~[paper-1.20.2.jar:git-Paper-309] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.2.jar:git-Paper-309] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1086) ~[paper-1.20.2.jar:git-Paper-309] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.20.2.jar:git-Paper-309] at java.lang.Thread.run(Thread.java:1583) ~[?:?]
It is saying that the method getProtocolManager() is returning null
line 45 onEnable
ik but idk how to fix that
are you shading plib
maybe idrk
show your pom.xml/build.gradle
Or is the plugin in the server?
well it's not a class not found ex
true
so i'm guessing they're just shading plib
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.5.0</version>
</dependency>```
add <scope>provided</scope>
and add the plugin to your server
also 4.5.0 is extremely outdated
latest is 5.2.0
ok
how do i get the the entity that places the block in the BlockPlaceEvent?
That's the only way maybe, but you can show us the code how you get the level, prestige, essence, sellmode, and tool code, use ?paste please.
It's always a player, you can use #getPlayer
been a while since i last codded anything , can i do this?
PRIMARY KEY (uuid, quest_mode, quest_name)?
I believe you can only have one primary key each table?
Oh yeah you can do that I think.
?? i rn use this for letts say my damage event
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
public class pvp implements Listener {
public static boolean listenersPvP = true;
@EventHandler
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
if (event.getDamager() instanceof org.bukkit.entity.Player) {
if(!listenersPvP) {
event.setCancelled(true);
}
}
}
}
really?
With intelji to compile all modules (spigot plugin and bungeecord plugin) with one click I have to create a build script or something like this?
yes, you set it as a constraint
Yeah I think that's called composite primary key.
If it's EntityDamageByEntityEvent then it would be a different case.
You can take a look at this https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityDamageByEntityEvent.html
declaration: package: org.bukkit.event.entity, class: EntityDamageByEntityEvent
i mean like how would i do that for the BlockPlace Event
Listen to BlockPlaceEvent and do #getPlayer https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/BlockPlaceEvent.html
declaration: package: org.bukkit.event.block, class: BlockPlaceEvent
how do i do #getPlayer
Seems all good, not sure how to optimize it.
event.getPlayer()
Okay, thanks
How often did you update the item?
Every time the player opens an inventory
Have you tried to run spark profiler and see what's the heaviest task?
got this error from this code and have no clue how to fix it, using ProtocolLib btw. ``` ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this, PacketType.Play.Server.PLAYER_INFO) {
@Override
public void onPacketSending(PacketEvent event) {
List<PlayerInfoData> dataList = event.getPacket().getPlayerInfoDataLists().readSafely(0);
for (int i = 0; i < dataList.size(); i++) {
PlayerInfoData data = dataList.get(i);
Player player = Bukkit.getServer().getPlayer(data.getProfile().getUUID());
if (player == null) continue;
WrappedGameProfile profile = (WrappedGameProfile) SkinUtils.getEffectiveProfile(player);
WrappedGameProfile wrappedProfile = event.getPlayer().equals(player) ?
new WrappedGameProfile(player.getUniqueId(), profile.getName()) :
new WrappedGameProfile(profile.getId(), profile.getName());
for (WrappedSignedProperty property : profile.getProperties().values()) {
wrappedProfile.getProperties().put(
property.getName(),
new WrappedSignedProperty(
property.getName(),
property.getValue(),
property.getSignature()
)
);
}
dataList.set(i, new PlayerInfoData(
wrappedProfile,
data.getLatency(),
data.getGameMode(),
WrappedChatComponent.fromText(wrappedProfile.getName())
));
}
event.getPacket().getPlayerInfoDataLists().write(0, dataList);
}```
I've done that, the heaviest was actually isTool()
Try to store the NamespacedKey in a field or something, so you don't need to create it everytime the isTool() method is called.
somehow it doesnt cancel the block place event
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
public class place implements Listener {
public static boolean listenersPlace = true;
@EventHandler
public void BlockPlaceEvent(BlockPlaceEvent event) {
if(!listenersPlace) {
event.setCancelled(true);
}
}
}```
Because the listenersPlace is true?
True, thanks
its false
it should be
private boolean b = true;
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
if (b) {
getServer().broadcastMessage("\n§8"+commandSender.getName()+" §fenabled placing!");
listenersPlace=true;
} else {
getServer().broadcastMessage("\n§8"+commandSender.getName()+" §fdisabled placing!");
listenersPlace=false;
}
b = !b;
return true;
}
}
It's very weird, please try to learn basic java.
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
whats wierd about it pls say
You can solve that problem if you learn basic java.
Hello! How do i make a single item have different textures? I know this is possible bc this is done in Wynncraft. Both items are minecraft:paper but they have different textures. How is this possible?
Using customModelData
And a resource pack
i see, thank you so much!
I coded my own plugin with Kotlin and everything went great, but I forgot one thing, the settings are not applied back after /reload, so I forgot to save it in json. And I have no idea how to do it
Can you help with this?
why are you saving settings in json? Spigot has a built in configy.yml support
How can I benefit from this?
Is there any way to check if player dragged something? Like not clicked, dragged
Who wrote this? Its bad https://www.spigotmc.org/wiki/creating-a-config-file/
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
ah thats even another thing
much better
still bad
this one is wonderful https://bukkit.fandom.com/wiki/Configuration_API_Reference
its basic so good
I just wish these "tutorials" would forget about the defaults and copyDefault(true) until the end. Its pointless to even describe them if they have not even covered .set
mmh
I did it but it didn't work, it's still the same, for example, I gave it a particle effect, when I opened it again after saying /reload, the effect didn't come back again
override fun onEnable() {
val config = config
config.addDefault("youAreAwesome", true)
config.options().copyDefaults(true)
saveConfig()
logger.info("Blocksin Aktiffff")
server.pluginManager.registerEvents(this, this)
config.apply 
I don't understand
youll get used to it
I won't as I don;t use kotlin 😉
why PrepareAnvilEvent not work in custom inventories?
custom inventories has not backing logic
syntax mostly
Kotlin is full of syntax sugar
How can you add a recipe or simulate so that you can make a new recipe with a working anvil animation
I'd even call it the diabetis language
I can't figure it out, can someone check it please?
kotlin less bloat
I've been working so hard on things now that I can't think
kotlin is for people who like minimalism
lol
before saveConfig() you need to pluginConfig.apply
saveConfig only saves the original config
why is pluginConfig a field
you don;t even need it
don;t define a field/variable for config
just config...
delete pluginConfig just use config
youre acting like frostalf now
my car agrees
I have a few questions really just some bacics like what program do i use
intellij
go 😦
Eclipse
unpopular opinion
vim
fun fact: "go" stands for "go fuck yourself" /s
Visual Studio Code...
I tried to use vim but hard for me
hello
okayyhttps://paste.md-5.net/agowenejej.cs
Also how do k code in javascript
havent tried hard enough
I'm trying to learn go and rust. But I have so concepts to learn
step by step
You will get the most support using InteliJ. You will also suffer teh most hiccups. The simplest is Eclipse with Netbeans being out there somewhere 🙂
I learnt javascript how to code minecraft plugins?
so uh, this is my first time saving data into a database and idk how it works fully
but is the database supposed to be hosted locally in the data folder of the plugin?
and if it should be locally hosted, should i use mongodb or sql or other stuff
things like a h2 or sqlite database are just one file in the plugin folder
things like postgres or mysql are just some files on your pc somewhere
tbf ive only ever used postgres in college and mysql 5 years ago
mysql, because even if the server has postgres it will support an mysql connection
ok
you learned javascript to code minecraft plugins..?
learning javascript was the mistake
is there any guide to databases, this is hella confusing
Many. 30+ years of them
its a start
alr
Hello. I have a geysermc server and I was wondering how I would go about making a gui thats different depending on the platform? I've seen it done on other servers wherein if you are in java you get the gui with the chest and you have to click but in bedrock its like just a ui
Friends, I ask you, can you do this for me to re-apply the settings after reload? I really tried every method and it's been 2 hours and it's tiring.
But it doesn't call
It doesn't call what exactly?
i also try hard to understand
https://paste.md-5.net/tixoyujuta.cpp
thats stupid code :/
If you know, can you edit it?
change addDefault to set, delete teh config.options... line.
and delete teh friggin LOCAL VARIABLE config
I haven't eaten for 5 hours, I'm too tired to even get up and eat. 😅
copyDefaults doesn't do what you want
However, #set probably also does not do what you'd like as it overwrites the previous value unconditionally
If you want to keep defaults.
ACTUALLY, I ASK YOU, CAN YOU TRY TO WRITE IN 15 SECONDS WHAT YOU EXPLAINED IN 1 MINUTE
https://mclo.gs/GxElPLc how do i fix it?
wat
what exactly is there to 'fix'?
Sir, I swear I don't understand anything you say right now, I've been sleepless and tired for exactly 18 hours, so if you know, I sent the code I would be very happy if you edit it and post it.
oh it doesnt show
its not saving because he's converting the this.config to a local variable
getRenameText from AnvilInventory is Deprecated
does kotlin really clone the locals?
how i can get text
That would be really really dum
no he is doing that
He doesn't to what I can see?
but yes you have to apply to set it back to this.config
as far as I know
I don't do kotlin so unsure
More context is needed if you want to avoid talking around circles
What
I'm trying this
Hm, I thought that all addDefault and all other methods would mutate this instead of creating a clone
its something to do with variable scope in kotlin
I'd get rid of the following lines:
// Varsayılan konfigürasyon ayarlarını ekle
config.addDefault("youAreAwesome", true)
config.addDefault("armorstands.enderchest1.duration", 30) // Örnek bir varsayılan süre
config.options().copyDefaults(true) // Varsayılan değerleri dosyaya kopyala
altogether
Yeah, but wouldn't that mutate the original reference too, like in java?
no clue, kotlin
Problem not solved 🙄
I've really no interest in learning a bastardised version of Java.
?jd My assumption is that OP didn't RTFM of copyDefaults, but it's been a few years since I've developed plugins
copyDefaults(true) simply applies defauls AS the value IF there is no value set.
so it saves to file as set
Uh great, the javadocs are as helpful as ever
yeah then I'm not entirely sure what the original problem is
me either
My only wish is that the settings I made continue to be applied again after reload... I've been trying for 2 hours and it didn't work. 🙄
I'm going to assume he's actually manually editing the config and expectign it to change on reload
do you get a config.yml saved into the plugins folder?
What happens if you RESTART (i.e. kill the spigot process and restart it)? Does it apply your settings then?
Nope
no config file at all?
No
?paste your servers latest.log
i didnt save wth...
Something went wrong!
My other bet is that they are editing the config file in the jar instead of the one on disk - but i'm not entirely sure what saveConfig() does exactly
looks like Blocksin is loading and disabling fine
you are 100% certain you have no config.yml in your plugins/Blocksin folder?
so you do have a config
yep
https://paste.md-5.net/javikopuxi.cpp
thats main blocksin
It saves but does not load.
ig
mm
and which config you are editing? the one in src/main/resources?
its all working fine. He's just not reading it properly
src/main/resources
This contains only plugin.yml
show the code where you try to read teh config
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
what command are you entering which is failing?
your config is fine, saving and loading is fine
Like this, I give a particle effect to the armor scarf, then I put /reload for testing purposes and after reloading, the particle doesn't come back, it disappears completely.
Normally particle happens all the time unless I reload.
teh particle will not come back unless you are spawning it
if you reload your code needs to fetch all stands from the config and start spawning particles
Likewise, I place a head on the armor stand, and when I right click on it, it breaks, it comes back after 10 seconds, after breaking it, I reload it.
And it doesn't come back after reload
same issue
Well then, what is the solution?
you are not checking your config and restarting yoru helmet/particles
when you reload all your schedulers stop
you have to start them again
I don't know how to do it, I can't think logically because I'm so tired.
sleep is for the weak remember
But I won't sleep without doing it, I'm a little stubborn person
How can i do
Should I open my hands and pray because I've tried every way
move all your scheduler code out of yoru command classes
so you can call it from anywhere by passing variables
you need to store ALL data to be able to start teh scheduler in the config for each stand
Let 's do it
so when onEnable runs you loop over all saved stands in your config and start the scheduler, just as you are currently doing in your command
Do I need to set up all commands again?
When the command is run, I need to start the scheduler and update the config file by calling the start Scheduler method
Hello, I was wondering if anybody knows about the changes in advancement granting with packets between 1.19.4 and 1.20.6?
The following code is working in 1.19.4 but in 1.20.6 it only registers the advancement for the client, and it doesn't give it to him :
AdvancementHolder advancementHolder = new Advancement.Builder()
.display(displayInfo)
.addCriterion(NewAdvancementNMSWrapper.IMPOSSIBLE_CRITERION, CriteriaTriggers.IMPOSSIBLE.createCriterion(null))
.requirements(AdvancementRequirements.allOf(List.of(NewAdvancementNMSWrapper.IMPOSSIBLE_CRITERION)))
.build(resourceLocation);
AdvancementProgress advancementProgress = new AdvancementProgress();
advancementProgress.update(advancementHolder.value().requirements());
advancementProgress.grantProgress(NewAdvancementNMSWrapper.IMPOSSIBLE_CRITERION);
NewAdvancementNMSWrapper.plugin.getLogger().info("isDone: " + advancementProgress.isDone());
WrapperPlayServerAdvancements wrapper = new WrapperPlayServerAdvancements();
wrapper.setAdvancements(List.of(advancementHolder));
wrapper.setProgress(Map.of(resourceLocation, advancementProgress));
wrapper.setReset(false);
wrapper.sendPacket(player);
Thanks a lot 
And of course I get isDone: true in the server console
can i make mobs with display entities and edit sizes?
display entities are only displays of mobs
they dont have ai
they wont do anything
there is no "Entity" display entity, there is only text, block, and item displays
just spawn the real entity and use the scale attribute?
Hi, so i use bungeeonlinetime, and placeholder doesn't work .. when i type /papi parse me %onlinetime_hours% show just a blank line
aight guys ty
sounds like you should contact them
Hi guys, so it seems when I have an arrow with custom nbt, shoot and pickup the nbt is lost, same thing for blocks, when i have a block with nbt, place it and pickup again, it dissapears, any workaround on this?
That's pretty par for the course
BlockEntities aside as of latest nbt is lossed when going from block to item and item to block.
Likewise this is true for arrows given that the arrow data isn't related to some potion effect
Re apply your custom nbt
I have $50 for the first person to make me my big plugin
Kekw
50 bucks is nothing
lmao
$70 max
It's big no let's talk about 20 to 25 an hour
I mean can it be done in like an hour
No it's a big plugon
My guess that means an entire mini game
Most of the script can be copyied from kings smo
Or the foundation of his server
or a copy of another paid plugin 💀
Its not copyed straight up
I'll do it for 25 an hour final offer
Fine
That's only 6,000 dollars
Yeah and im only 5930 short
Whats the default view range of text displays?
I mean 70$ is not gonna be enough for a "big" plugin
but in any case, you should look at
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Guess i will resort to fiverr
Meh some sucker will do it
💀
There are some idiots out there
yeah on fiverr they will
Good luck soldier
Last time i got a work from fiverr, was full chat gpt, and was not fully working
you could give me that 6000
How to teleport player to other dimensional? (the end, nether)
Using world doesn't looks good, because the world name can be different
Player#teleport(Location)
Yes, but how do I get the location of the nether or the end?
something like the command execute: execute in <dimension> run tp x y z
so nothign to do with developing a plugin then
hm?
thats not a thing in plugins
thats default MC commands
am i missing something? it wont load keys that don't have values. https://pastebin.com/UpRj7TJw
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
a minecraft "world" consists of 3 actual worlds, overworld, nether and the_end
yes, but what I want is to teleport to the nether, if his world doesn't have the nether with the exact name it won't work
the name of that worlds nether should be <world_name>_nether
Bukkit.getWorlds().get(1) for nether. Or is it an array I forget
its a list
so long as you don;t have anything messing with early world loading
hm
maybe something like:
Bukkit.getWorlds().find {
it.environment == World.Environment.NETHER
}
I'll try it
if your server does not have <world_name>_nether as their nether world
they have other problems
but yeah sure that might work
The nether can be disabled
What is the default view range of the players nametag? is it like 60 blocks?
And there is also multiverse
but if it's disabled, it won't go to Bukkit.getWorlds, right?
Exactly
right
And your search will return null or whatever find does when it can't find anything
if (Bukkit.getAllowNether())...
just check if the search failed
yeah, so that's exactly it, I'll use find, thank you all
spyry
Btw, about multiverse, I think some addon lets you assign a nether and end for each world, so you might have some issues
create a function something like teleportAnywhere(Player player, Environment dimension). create a stream of the worlds then filter, something like filter(world -> world.getEnvironment() == dimension).findFirst(). make sure to check its its not null, then you simply teleport the player to whatever location in the world/dimension. calling the method would be something like teleportAnywhere(player, Environment.THE_END) you could modify to whatever suits your needs. i only use a stream because performace impact will not be noticable and its easier to read and maintain
Hello, is it possible to somehow lower the player’s camera (view) by one block? Allegedly the look of a recumbent, version 1.20.1
player.setEyeLocation
2
Cannot resolve method 'setEyeLocation' in 'Player'
its not going to be pretty
.5 scale?
there is no set for eye location
get
🙂
get indeed
Location eyeLocation = player.getEyeLocation(); double eyeHeight = player.getEyeHeight(); eyeLocation.setY(eyeLocation.getY() - 1.0); player.teleport(eyeLocation);
?
um, why?
yeah you have send a packet of a location 1.5 blocks below player location
teleporting the player to the location they are already at
location .subtract(0, 1.5, 0);
player.teleport(location );```
see how that works before you get into sending a packet
i dont know how well it will look with player control intact.
hi
how do I check if an entity is undead ? I used to use getCategory() but now it tells me that it's not supported anymore and I should use tags. I've looked a bit but how do I do this?
Nvm I solved this xd
So this is my first time using nbt API so I'm not really sure how it works but I got up to the part in the wiki where it said to put this code in my onenable method so I did that but it has an error
are you using maven? @gentle inlet
https://github.com/tr7zw/Item-NBT-API/tree/master/wiki i recommend you look at their wiki
player can't change dimensions in PlayerMoveEvent right? Because it is inserted in handlemovevehicle and handlemoveplayer and I'm not sure whether the dimension changes.
Going based purely on your project name, if you're using modern versions (1.14+), you can use the PersistentDataContainer API to add custom NBT tags to items, entities, chunks, etc.
If you want to edit a vanilla NBT tag of an entity or an item, there's probably a method for it in Entity or ItemMeta
is there a way to copy an entire directory from the resources directory and save it into the data folder recursively?
I know there's getResource but that's for single files right
or can it be interpreted as a folder?
nope
so it can't be done?
path will be preserved but it needs an actual file name
nio enjoyers 
moving files manually with a magnet and a steady hand 
the real way to do it 💪
r8 my icon making skills
12/10
damn guess I'll have to try harder next time
Good tree
why is only the S antialiased
only for S
you missed the third S
missed what
starts somewhere
you're just seeing things man
I'm making a plugin for overriding block breaking behavior and I've encountered a bug that I don't know the cause of
Whenever the block its changes breaking progress stage, instead of displaying that persistently it only shows up for a tick before resetting
I only call the SendBlockDamage method once in my code, which is when the damage progress increases, so it's not an issue of calling it somewhere else
Anyone have an idea why this is happening/how to fix it?
May we see your code
Which part?
I ran into a similar issue with my system but it could entirely depend on how it’s structured
The line that calls the update is just player.getPlayer().sendBlockDamage(currentBlock.getLocation(), currentBlock.getProgress());
And the progress is return cumulativeDamage/ore.getResistance()
And this is called whenever the progress increase is > 0.1
That doesnt show us much. If you could send the whole thing or at least how data flow works
Are you sending that every tick
Or just on arm swing?
Every tick the game checks if the block's progress has increased by 0.1 or more, and if it has it sends a new block damage packet
Listener for BlockDamageEvent -> get custom block data from plugin -> add it to BlockList
A runnable checks every block in BlockList every tick to handle damage increase, visual damage, breaking, and loot drops if broken
Hey @floral drum are you busy?
Can you show your code
I can’t speculate
This is across a lot of different classes so what parts do you want to see
About to get in a val game
wsg
?ask 🤓
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
shut up kotlin nerd
wait
you use paper maybe you know too kek
kekw
Uh
So issue with minimessage
Somehow legacy characters are getting through to the serialization / deserialization
wdym
Show what you think may be affecting it. I have no clue how it’s structured so I couldn’t tell you
?
I have no clue what's causing this flickering, my code seems perfectly sound (for this issue)
I don't think any of my code is directly at fault, that's why I'm asking
public class ColorUtil {
private static final LegacyComponentSerializer SERIALIZER = LegacyComponentSerializer
.builder()
.useUnusualXRepeatedCharacterHexFormat()
.hexColors()
.build();
private static final MiniMessage MINI_MESSAGE = MiniMessage.miniMessage();
private static String convertColorCodes(String text) {
return text
.replace("&0", "<black>")
.replace("&1", "<dark_blue>")
.replace("&2", "<dark_green>")
.replace("&3", "<dark_aqua>")
.replace("&4", "<dark_red>")
.replace("&5", "<dark_purple>")
.replace("&6", "<gold>")
.replace("&7", "<gray>")
.replace("&8", "<dark_gray>")
.replace("&9", "<blue>")
.replace("&a", "<green>")
.replace("&b", "<aqua>")
.replace("&c", "<red>")
.replace("&d", "<light_purple>")
.replace("&e", "<yellow>")
.replace("&f", "<white>")
.replace("&k", "<obfuscated>")
.replace("&l", "<bold>")
.replace("&m", "<strikethrough>")
.replace("&n", "<underlined>")
.replace("&o", "<italic>")
.replace("&r", "<reset>");
}
public static String convertLegacyColorCodes(String text) {
return SERIALIZER.serialize(MINI_MESSAGE.deserialize(convertColorCodes(text)));
}```
...
error was something like cannot convert legacy codes in a mini message component, not the & but to goofy looking one would precede all characters like the input was & color codes when it was actually formatted like <rainbow> / <gradient>
What the fuck is this
My two guesses are that it's either a Spigot/Bukkit thing or a vanilla minecraft issue
Why are you replacing that shit manually
Me trying to fix the issue I described
@worthy yarrow create the builder with .character('&')
It’s not.
What issue
I don't understand what you meant
I cannot find the error in my logs kek
Well here's my single call to the SendBlockDamage packet, have at it
@worthy yarrow
Have you tried without the check
then remove that color code thing
Just send the packet every tick
Yes, it just causes very rapid flickering
Or delay by a tick instead
I saw,
builder()
.character('&')
.build();
this works yeah?
make sure you have the other stuff for hex colors
Why are you even replacing them manually
and then see if it works
Once I get on my pc I’ll send my thing I did to fix it. I used to have flickering aswell
Or you can just give mining fatigue
I have mining fatigue 6 (you can see at the end of the video)
This entire goal is to have the visual handled by the server
Because for some reason the inputs were parsed or something before it even got to color util, ended up looking like &i&c&2c&7&r&bo... etc
🤨
🤷
You can literally just do serializer.serialize(miniMessage().deserialize(miniMessageString)) and it should give you the legacy output
wha
swear
shit
Was doing:
serializer.serialize(minimesasge.deserialize(input));
literally the same
try what I said kat
It's just the static import of MiniMessage.miniMessage()
Uh I'm just confused which i should do first, the color code serialization right?
This also didn't work
First you want your mini message -> component
don't use that method you were doing
and then you would want it to be legacy serialized
I'm not, I made a new serializer
I don't see why this would not work
what's your current code look like?
holy fuck the performance
kek
nuclear what are you trying to do
convert minimessage -> legacy
do i have the class for you
I don't either, it literally broke
the funny part is that you can't just string replace the codes because the grammar of the formats are different
.hexCharacter('#').hexColors().useUnusualXRepeatedCharacterHexFormat().build();```
with
public static String translate(String toTranslate) {
return (ChatColor.translateAlternateColorCodes('&', SERIALIZER.serialize(MiniMessage.miniMessage().deserialize(toTranslate))));
}
you prob dont need the translate but hey ho
I mean you can just use the section symbol instead and skip the ChatColor part
im pretty sure passing character('&') removes the need for translate
hey that's crazy I told him to do that exact thing loll
thats wild
git makes it pretty interesting to design a build system
huh
like verifying a git url is valid
what
verifying is for beginners, blindly run at it
Interpreted lang users:
interpreted language makers:
why on earth would a buildsystem know about git?
https://paste.md-5.net/zowowuxewi.cs
@blazing ocean see this is the error I was having earlier
What the fuck
Why are you not just serializing the component to Legacy
Just LEGACY_SERIALIZER.serialize(MINI_MESSAGE.deserialize(miniMessageString))
Isn't that what's supposed to happen?
No I mean it literally puts the & in the text as well
at nuclearkat.playertitles
Nice package you got there
Yeah it's supposed to
That's how legacy chat works no?
&7Something would be gray right
Yes
But instead it outputs literally '&7Something'
just do string.replace('&', '\u00A7');
Okay but isn't that the intended behaviour?
you are literally configuring the serializer to output &
Is it reliable? No. Does it work most of the times? yea
instead of §
i mean automatically fetching dependencies from git, like lazy.nvim
so, instead, configure the serializer for § character instead of & character
like cargo?
This was how I created the title, and in that paste you can see how it's trying to be read
Why are you using the rainbow tag twice
Does the & work now?
I'd honestly go with a maven-like buildsystem unless this is a compiled language (and even then a maven-like buildsystem makes sense)
Display name / actual contents of the tag
Whar
Display name being the display of the item created
Probably auto-closes like HTML does
Yeah it autocloses at the end of the text pretty sure
Considers it the same line so it would end up displaying as: <rainbow>TestingTesting
im still thinking about the dependency system
There's not supposed to be multiple lines
I didn't see this, and no lol
Just cloning the structure of maven repositories is the easiest unless you HAVE to adhere by existing rulesets
Why not create a custom tag then if you need it
Or am I misunderstanding this
I think you're misunderstanding
Okay, can you show the code and what you're trying to parse?
public class ColorUtil {
private static final LegacyComponentSerializer LEGACY_SERIALIZER = LegacyComponentSerializer
.builder()
.character('§')
.hexCharacter('#')
.hexColors()
.useUnusualXRepeatedCharacterHexFormat()
.build();
private static final MiniMessage MINI_MESSAGE = MiniMessage.miniMessage();
public static String convertLegacyColorCodes(String text) {
return ChatColor.translateAlternateColorCodes('&', LEGACY_SERIALIZER.serialize(MINI_MESSAGE.deserialize(text)));
}
}```
Technically all I am trying to parse is <rainbow>Testing
well its not for java, more for a c like lang which does not care where you place your source files (:
youd just need a dir where your package lives and the compiler figures it out
Why do the translate alternate colour codes thing
Like it works for the display names of items but when trying to create a text display out of it:
§4C§6o§2o§3l§3G§1u§5y```
I noticed that without it, prints out in the same format just with &
as this I mean
That makes zero sense
You're basically doing it like this right?
yeah
Show if you don't mind
You broke it. Minecrafts over.
real
Yeah but for dependency management you can (and should) enforce a proper structure if you are starting from a clean slate. And ideally you won't recompile dependency projects whenever needed otherwise you can quickly obtain build times that are far too long
public void displayTitle(Player player, Title title) {
World world = player.getWorld();
Location location = player.getEyeLocation();
String titleContents = ColorUtil.convertLegacyColorCodes(title.getTagContents());
TextDisplay textDisplay = world.spawn(location.clone(), TextDisplay.class);
Vector3f offset = new Vector3f(0, 0.15f, 0);
AxisAngle4f rotation = new AxisAngle4f();
Vector3f scale = new Vector3f(0.75f, 0.75f, 0.75f);
Transformation transformation = new Transformation(offset, rotation, scale, rotation);
textDisplay.setText(ColorUtil.convertLegacyColorCodes(titleContents));
textDisplay.setBillboard(Display.Billboard.CENTER);
textDisplay.setBackgroundColor(Color.fromARGB(0x80333333));
textDisplay.setCustomNameVisible(false);
textDisplay.setPersistent(false);
textDisplay.setSeeThrough(false);
textDisplay.setShadowed(false);
textDisplay.setInvulnerable(true);
textDisplay.setTransformation(transformation);
this.activeTextDisplays.put(player.getUniqueId(), textDisplay);
player.sendMessage(ChatColor.GREEN + "You have just equipped the " + ColorUtil.convertLegacyColorCodes(title.getDisplayName()) + ChatColor.GREEN + " title!");
player.addPassenger(textDisplay);
}```
this isn't really a development question, but by does it take forever to compile with maven? it takes like 0.7ms to compile gradle and around 8 seconds to compile maven
or am i missing something that i'm supposed to do in pom.xml
- ABI compatibility issues are also a thing
You can configure parallelability and other things
Like incremental builds I believe
any guide on that on yt?
HOWEVER gradle still has the gradle daemon
see it works for me
Gradle does not take that long, I can promise you that much
So it’s obviously very neat and arguably better than maven
Let me go look then sigh
it takes shorter?
0.07 is not much
Bukkit.getWorlds().get(0)
That's why it says there's SECTION_CHAR in it, because you're converting it to legacy, which replaces it all with SECTION_CHAR. And when you try parse it, it just doesn't allow you because minimessage doesn't allow section chars to be used
takes me 15 minutes to compile dont complain about 8 seconds
wait i meant 0.7 seconds not ms lmao
Some random ass project I have open right now
15 minutes..
But u were asking why maven is slower?
yeah i was
Only first time
maven does less caching by default
use the maven cache extension it should help some
but i said gradle takes 0.7ms to compile but i meant 0.7seconds
Second time is still 2s
consecutive runs geol take less
alr
and & works for it too
And that assumes absolutely no changes inbetween
I believe maven is also dealing quite well in that case
Ugh weird, maybe its a poorly written gradle plugin or sth
lollll
kek
the spam when you join..
@worthy yarrow end the rainbow tag with </rainbow>
fuck essential fr
Yeah I should learn gradient formats tbf
nah, it's skipping all tasks, though I suppose adding all the plugin dependencies to the classpath may take a while
This is also interesting
<gradient:#ffffff:#c68aee>hello, world</gradient> i believe
how is the item being created
public ItemStack build() {
ItemStack builtItem = new ItemStack(Material.PAPER);
ItemMeta itemMeta = builtItem.getItemMeta();
itemMeta.setDisplayName(ColorUtil.convertLegacyColorCodes(displayName));
List<String> formattedLore = new ArrayList<>();
for (String lore : this.lore) {
formattedLore.add(ColorUtil.convertLegacyColorCodes(lore));
}
itemMeta.setLore(formattedLore);
PersistentDataContainer dataContainer = itemMeta.getPersistentDataContainer();
dataContainer.set(titleContentsKey, PersistentDataType.STRING, tagContents);
dataContainer.set(titleKey, PersistentDataType.STRING, key);
builtItem.setItemMeta(itemMeta);
return builtItem;
}```
Well gradle iirc should be looking at ur files and observe changes etc, thus unless its changed somewhere it ought not to even look at it, though maybe its disabled for adding those dependencies
skill issue
does maven do incremental builds?
real
you with your real
real
I believe in newer versions its toggleable?
Or well alex talked about it
not for kotlin by default
works for me 🤔
hey guys i had a question i was struggling with, how to i like tie a class with a minecraft block
Isn't it already?
Though I remember there being some stupid catch here
mayhaps, it was years since I touched maven tbf
Regardless the default is plenty fast for 99% of cases
true true
I thought maven did its shit via the extension
I have no idea what you mean with "the extension"
Yea like xD
who really needs it
You're doing something wrong if you are running your buildsystem so often where a second is an important consideration
In my workflows I rarely run the build task
(Actually not that long but shh)
You use hotswapping w debug mode?
hey can someone help with this
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
Here's the thing: I no longer program minecraft mods or plugins and thus have my own toolchain where I can actually be friendly towards the workflow I am most comfy with
what the fuq
like 20 seconds
Fair enough
what are you doing to set the lore in the item builder?
or whatever you're doing
Also I was more referring to the fact that the itemstacks display name has a different rainbow then the text display
Takes longer to rebuild patches 😩
for (String lore : this.lore) {
formattedLore.add(ColorUtil.convertLegacyColorCodes(lore));
}
So basically I have an eclipse launch configuration which allows me to debug mods. I generally don't hotswap but at times it is useful to have - especially if you try to dial down to a specific look and feel you are trying to achieve
It's kind of a placeholder list of strings so I can convert them later
this looks like legacy colors codes actually...
are you using spigot or paper to test?
Indeed it does
spigor
oh so this can be useful for like an airdrop is what im tryna make, i can just spawn the airdrop as a block and then check if the right clicked block was my custom one or in this case chest
that is a windows issue tho
Make sure your serializer is configured to not flatten colors
switch to a proper OS 
I wonder if IntelliJ’s built in runconfig system can achieve just as much
But thats pretty neat
Why would I propose to my OS?
romance
local host is 1.21, tested and works fine prior like all 1.20s @floral drum
It would be, most of the magic to support it is the modloader
We love runClient and runServer
Does player#attack method fires entitybyentitydamage event?

Yea
@young knoll
Alright
Technically speaking it would be possible to have a similar workflow under bukkit if one is willing enough to have a dedicated main class for IDE launch configurations
Yes
ok i was wondering how it worked thx
where is spigotclip?
You know MD doesn’t want to go that route
Hey curious ask, how does no clip work in most games?
Hm? on the server side?
Yeah
I mean, you just disable collision checks?
Like I pretty much all need to invoke
/usr/lib/jvm/zulu8/bin/java
-Dde.geolykt.starloader.launcher.CLILauncher.mainClass=com.example.Main
-Dde.geolykt.starloader.launcher.IDELauncher.inlineStarplaneAnnotations=true
-Dde.geolykt.starloader.launcher.IDELauncher.modDirectory=/home/geolykt/applications/mods/sane-crab/s2dmenues/mods
-Dde.geolykt.starloader.launcher.IDELauncher.bootURLs=[<snip>]
-Dde.geolykt.starloader.launcher.IDELauncher.modURLs=[[\"file:/home/geolykt/applications/mods/sane-crab/s2dmenues/bin/main/\"]]
-Dorg.stianloader.sll.IDELauncher.propertyExpansionSource=/home/geolykt/applications/mods/sane-crab/s2dmenues/gradle.properties
-classpath <snip>
de.geolykt.starloader.launcher.IDELauncher
And it launches everything just fine
Straight forward yeah kinda thought this
What about the client?
you instruct the client to also disable collision checks
just got a new pc and forgot IntelliJ plugins
And the server just allows this?
any more helpful plugins?
Well yes because the server also disabled collisions
huh?
What games have straight up no clip cheats
Even Minecraft doesn’t have that issue afaik
a game client will always have to do some form of movement prediction, otherwise your input is going to feel terrible due to latency
I mean like, I don't understand how both the server and the client can have collision checks disabled as I'd feel collision checks are a pretty base component of a game
so if a game wants to allow noclip, both the client predictions and server validation have to consider thta
And that’s how we got spectator mode
I mean, in this case you only need to send a single byte
0 to disable no clip, 1 to enable
Well yeah if you make both the client and the server
well
You can kinda do whatever you want :p
yeah kek
So then does aimbot work because the server has to hold the "location" as it were of every player, then the client just uses those locations in a way?
Pretty much
Obviously the client needs to know where the enemy is so it can yknow, render them at that spot
what version of adventure and stuff are you using @worthy yarrow
I know it might not to be do with that but..
worth a try
Well for games like rust as an example, the draw distance regulates how far you can render, that being said aimbot only works for the radius of which the client can render?
uhmmm
4.17.0 irrc
Depends on the game
Often the game might send position info even if the player is outside render distance
public Set<Punishment> getPunishments(OfflinePlayer op) {
return punishments.stream()
.filter(punishment -> punishment.getPlayer().equals(op.getUniqueId()))
.collect(Collectors.toSet());
}```
why is this case sensitive? ``Bukkit.getOfflinePlayer("missingreports")`` returns other punishments than ``Bukkit.getOfflinePlayer("MissingReports")``
Hmm that makes sense
can u make it not case sensitive?
What about like shot validation? Rust has a system for this but still aimbot doesn't seem to be effected by it
Why are you getting an offline player with their username anyway?
then how come moderation plugins allow banning of offline players (where case doesn't matter)
Idk, what’s shot validation in this context
it's a command
is the server in offline mode?
idk lemme check
Validation that it's a proper "shot" I guess, in the sense that you're not just shooting through rocks kinda thing and are actually aimed at the player
it depends on the game, for example GTA Online you can see players on the map so it makes sense, but something like WoW the server really doesn't want to give you that info
yeah
Is it connected to a proxy?
no
ah
Well can you aimbot through a rock?
online-mode: true in server.properties
alr
I have seen it happen
I assume it just does a raycast from the shooter to the target
Often there will be some latency from the server to the client
Host your own plugin market site duh
So you aren’t quite in the same place the server thinks you are
time to go write "purple is cool" 80 times and post it
bruhhh
Were you wanting to post seasons as a premium plugin?
(You will be banished to the shadow realm)
yea probs
Smh
Ooo please let me test first :p
time to help people on spigotmc plugin development
Don’t we already have enough of those
this one is cool that I'm making frfr
That's why you should let me test
I'd know how to break it since yk I kinda tried writing it kek
Purple just being consumed by greed
wtf
Last question about the cheats tho, all cheat clients are manipulating packets depending on the cheat right?
Or do they have to?
kek we love you purple ❤️
They don’t have to
Tracers just draw a line to things, no packet manipulation required
How does the client get this data though?
I mean idk I just feel like you'd never want to trust the client
Well
yay helped 3 people in 5 minutes.
This is for rendering mainly correct?
Or mobs, or whatever you want to tracerer
public long getTimeLeft() {
return System.currentTimeMillis() - endDate;
}```
this is kinda counting up every second
``endDate = System.currentTimeMillis() + banDuration (E.g: 1000)``
please work with duration slash instants
ok
wait i'm confused
is the duration the date of when it ends
or is the duration the amount of time it needs to wait
duration is duration, instant is a point of time
ok
Or better said, a duration is the difference between two points in time
afaik instant is just a fancy epoch wrapper with some methods on it
it works
sick
[00:41:46 INFO]: MissingReports (/127.0.0.1:21763) lost connection: You are banned from this server!
Reason: No reason specified
Ends in: 42s
Moderation ID: #-1```
it kinda spams the console tho, is there a way to not show that in the console
does anyone know of any good resources for changing player skins? I can only find resources from many years ago after searching.
I have an account set with a skin. I want to be able to make any player on my server appear as if they have this skin. how can I do this?
Perhaps this will be able to help you. it believe its quite up to date.
I will check it out ❤️
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
?nms
when a mushroom spreads, how can I get the original mushroom block?
BlockSpreadEvent.getSource usually returns an air block in the vicinity of the original mushroom, adjacent to the new mushroom
Totally worked, thanks!
how can I make the IronGolem run the hit animation?
I tried packets and it doesn't work only for the IronGolem
How can I play a sound from everywhere, i.e no directional audio, and no distance fading
via command I could do /execute as @s at @s run playsound minecraft:music_disc.11 master @s and it would play from everywhere
you could use this and pass whichever player you want to hear the sound. https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/World.html#playSound(org.bukkit.entity.Entity,org.bukkit.Sound,float,float)
if you want just 1 player to hear the sound. use this https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Player.html#playSound(org.bukkit.entity.Entity,org.bukkit.Sound,float,float) and as entity just pass the same player
I cannot save the settings to the config in the plugin I coded with Kotlin.
To reload after reload
on my server players are able to "steal" items from a gui shop by shift clicking the item and closing the inventory at the same time, even though InventoryClickEvent is cancelled. How can I fix this like other servers clearly have?
this is a big issue and seemingly a bug with spigot
Sounds like a 1.8 issue
I'm on 1.21
I have never had this issue on 1.21
have you tried it?
try clicking escape at the same time you shift click an item
I'm just testing my plugin rn but I'm glad I caught this before I opened my server lol
I think I know what my issue is
package gg.wicklow.events;
import gg.wicklow.Main;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
public class FreezeInventory implements Listener {
public FreezeInventory(Main plugin) {
Bukkit.getPluginManager().registerEvents(this, plugin);
}
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
if(event.getInventory().getMaxStackSize() == 101) {
event.setCancelled(true);
}
}
@EventHandler
public void onInventoryDrag(InventoryDragEvent event) {
if(event.getInventory().getMaxStackSize() == 101) {
event.setCancelled(true);
}
}
}
I'm using the inventory's max stack size as an identifier for my custom guis
I thought I was clever lol
I mean that sounds exploitable but achieves the purpose?
I don't think that's the issue however
are there any differences between our code that could be the issue?
ok
I've never seen this sorta gui validation before so just to verify that the event is actually being thrown for your inventory
wait is event.getInventory() the wrong method?
It gets the inventory of said inventoryEvent
I don't think you can get the title of the inventory through getInventory for some reason, might be wrong
thats right
and yeah that was my issue
I need to compare titles not max stack sizes
isnt that kinda fucked tho if I have like 20 custom guis and need to check if the player's inventory title matches one of those strings every time they click in an inventory?
?inventory
?inv
?invgui
?menu
idk what that command is
?gui
Rekt
feck
wow code that looks like that makes me feel slow
I dont understand that at all
I'll understand it eventually lol
: (
hey guys, I wanna open an invnetory after player downloaded resourcepack is it possible?
when I tried this:
@EventHandler
public void onJoin(PlayerJoinEvent event) {
UserMonthlyFeeRepository userMonthlyFeeRepository = ShibaMonthlyFee.getPlugin().getUserMonthlyFeeRepository();
Player player = event.getPlayer();
UserMonthlyFee userMonthlyFee = userMonthlyFeeRepository.getMonthlyFee(player.getUniqueId());
if (player.hasPermission("test.monthlyfee") && !userMonthlyFee.isJoined()) {
plugin.getServer().getScheduler().runTaskLater(plugin, () -> new MonthlyEffectInventory().open(player), 20L);
userMonthlyFee.setJoined(true);
userMonthlyFee.update();
}
}
it just canceled to download a resourcepack
Theres an event for resource pack acceptance
Sec
declaration: package: org.bukkit.event.player, class: PlayerResourcePackStatusEvent
Just make sure the status is accepted
oh thank youuu!! I've been looking for this
Breh it keeps automatically doing util.* kek
Guys, I can't do anything about particle delivery, can you solve the problem if I post it
??
I think that Map<String, Boolean> & List<UUID> visitorLog could be another class
Check your import settings.
Settings > Editor > Code Style > Java >> Imports
Wdym you cant do anything about particle delivery?
Might end up doing a separate data class for settings for sure
🤮 kotlin
yeah exactly
Just putting everything into the island to trim tbf currently
see what all I actually need in there
Ender portal particle spreads a lot, and it starts from the top down, I want to do it the other way around, I couldn't make the armor stand start from the bottom and spread less towards the top.
:/
kotlin ❤️
Sorry cant help, dont speak kotlin ;-;
Eh what exactly am I looking for in here?
nvm found it
Hmm what all would you guys store in an island class? (specifically in relation to a skyblock plugin, decided I'm doing separate data classes for settings and visitor logs)
what if you want many owners
coowners
some of this should be in another class like level and score
Why 2 locations for the island?
One for a location of the island within a world, one for the /home location
eh
rubber duck debugging
I would probably just extend chunk for this
I was thinking level / score is gonna be delegated to their own classes, I'm sure I don't want to do these calcs in the data class, so yes will keep that in mind
looks fine to me
if you keep adding subclasses you ned to click more to get to the definition
Well level was going to be dependant on score, that being said those calcs shouldn't really be done in the island class imo
my general approach is are you going to use that score/level class anywhere besides in this island class?
if not why not just put it in there
tight coupling, SRP
separation of concerns
subclasses is solved with composition, not inheritance
I feel like readability on a core is more important that just being lazy about where my data is held
i didnt say anything about subclasses or inheritance
cough
if you deeply nest them sure
oh right
well I meant subclasses as in classes inside another class, i.e. composition
my bad
all im trying to say ont overcomplicate things
i the calculations are gonna be in a single method, it doesnt really matter
otherwise you'd need to double back on the calculations
like from the outside it would be island.getScoreStuff().islandScore() or island.getScore() and then in island it would be return scoreStuff.islandScore()
both is kinda unneeded and adds extra tracable methods
anyways thats how I think about it
