#help-development
1 messages · Page 582 of 1
thank you
Hey I got a protocol Lib question, I currently have this for sending a "fake item" packet saying that the user has x mask on but I need it to update all the masks for the player that just joined the server
@Override
public void onPacketSending(PacketEvent event) {
Player player = event.getPlayer();
int slot = event.getPacket().getIntegers().readSafely(1);
if (slot != 4)
return;
PacketContainer equipmentPacket = new PacketContainer(PacketType.Play.Server.ENTITY_EQUIPMENT);
ItemStack item = equipmentPacket.getItemModifier().readSafely(0);
System.out.println(player);
if (item == null || item.getType() == Material.AIR)
return;
NBTItem nbtItem = new NBTItem(item);
if (!nbtItem.getBoolean(NBTConsts.GLITCH_ITEM))
return;
String type = MaskUtils.getMaskType(item);
int level = MaskUtils.getMaskLevel(item);
Masks.Mask mask = MaskUtils.get().getMask(type, level);
if (mask == null)
return;
equipmentPacket.getIntegers().write(0, player.getEntityId()).write(1, 4);
equipmentPacket.getItemModifier().write(0, mask.getMaskItem());
event.setCancelled(true);
// Forward the modified packet to all online players except the sender
for (Player targetPlayer : Bukkit.getServer().getOnlinePlayers()) {
if (!targetPlayer.equals(player)) {
ProtocolLibrary.getProtocolManager().sendServerPacket(targetPlayer, equipmentPacket);
}
}
}
brub
thats for big pieces of code right? if its small it should be ok
change "spigot-api" to spigot with classifier "remapped-mojang". but as mentioned above, you don't need to do that, you already got the CBD to get a context from
alr
just another self promotion since you already use my CBD lib, maybe you also find this useful:
?morepdc
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
it allows to use maps, arrays, collections etc, e.g. to save a Map<EntityType,List<ItemStack>> and other fancy stuff in PDC
yeah i'll be using that soon
im implementing all the standard stuff first
then i'll add all the custom ones
ty for making these ❤️
currently I am considering just using an PlayerJoinEvent but if you got lots of players online thats a lot to do
actually, this wont work, what i mean is creating a standalone PDC, without having to use another's context
well it would work, but it's not what im looking for
then you indeed need the craftbukkit classes
alr
like this ^
you can cache the registry and context and reuse it btw
Player#showParticle(...)
or sendParticle, idk
there's no spigot-api in what i've just sent
or did i miss it
with classifier i assume you mean <remappedClassifierName>remapped-obf</remappedClassifierName>
noo
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>
did you read the blog post I linked earlier? you need to run buildtools for this to work java -jar buildtools.jar --rev 1.20.1 --remapped
otherwise maven won't find spigot
well check the javadocs
yeah my bad, i usually dont understand these commands
you download buildtools, and then run it with the --remapped parameter
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
do build tools work across multiple versions?
like does 1.19.4 work with upper and other 1.19 releases?
buildtools works for every 1.8+ version, but your code will be version dependent because the craftbukkit classes have the version in the package name
e.g. the CraftPersistentDataTypeRegistry on 1.20 is in package org.bukkit.craftbukkit.v1_20_R1.persistence
then you gotta use reflection or a multi module project
oh god fancy words
is any of what you've mentioned going to require me to update the plugin whenever a new minecraft version drops for it to work on it?
yes
sometimes
then it's not worth doing, i dont want it to be version dependent
well
not necessarily version dependant its just for certain updates the class may change its signature or functionality
for starters, what does creating a new pdc with a context do? whats the relationship between this new pdc and the context?
bruh
you may be able to hope that each new update doesnt change any of that
reflection is your friend there
try {
String packageName = Bukkit.getServer().getClass().getPackage().getName(); // Will be org.bukkit.craftbukkit.v1_20_R1
Class<?> craftPersistentDataTypeRegistryClass = Class.forName(packageName + ".persistence.CraftPersistentDataTypeRegistry");
Class<?> craftPersistentDataAdapterContextClass = Class.forName(packageName + ".persistence.CraftPersistentDataAdapterContext");
Object registry = craftPersistentDataTypeRegistryClass.getConstructor().newInstance();
PersistentDataAdapterContext context = (PersistentDataAdapterContext) craftPersistentDataAdapterContextClass.getConstructor(registry.getClass()).newInstance(registry);
PersistentDataContainer myPdc = context.newPersistentDataContainer();
} catch (ReflectiveOperationException ex) {
throw new RuntimeException(ex);
}
this works in all versions
oh damn
you should cache the "context" object somewhere
yeye
wtf is context
whats all in this 1.20 update
it's been a thing
oh
eg like this
public class MyPlugin extends JavaPlugin {
private static final PersistentDataAdapterContext dummyContext;
static {
try {
String packageName = Bukkit.getServer().getClass().getPackage().getName(); // Will be org.bukkit.craftbukkit.v1_20_R1
Class<?> craftPersistentDataTypeRegistryClass = Class.forName(packageName + ".persistence.CraftPersistentDataTypeRegistry");
Class<?> craftPersistentDataAdapterContextClass = Class.forName(packageName + ".persistence.CraftPersistentDataAdapterContext");
Object registry = craftPersistentDataTypeRegistryClass.getConstructor().newInstance();
dummyContext = (PersistentDataAdapterContext) craftPersistentDataAdapterContextClass.getConstructor(registry.getClass()).newInstance(registry);
} catch (ReflectiveOperationException ex) {
throw new RuntimeException(ex);
}
}
}
PersistentDataTypeAdapterContext, exists since 1.14.1
ive never touched that shit and hopefully i never have to
didnt even know that existed and i thought i memorized the entire API at one point
the // Will be org.bukkit.craftbukkit.v1_20_R1 comment is just you assuming im using 1.20 right?
no
oh
it will be v1_19_R3 in 1.19.4 for example
Bukkit.getServer() returns the interface "Server" but getClass() on the actual object returns its implementation class
hence you will always get the correct package name, no matter which version
you're a savior 🙏
np
it's like Bukkit.getPlayer(...) seems to return a Player, but it's actually a org.bukkit.craftbukkit.<version>.entity.CraftPlayer or sth, which just implements Player
what about this btw?
Just being able to create an instance of it as an interface is all
The implementation isn't exposed to Bukkit so you can't create instances of it
But really it's not doing much under the hood aside from passing through the type registry, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataAdapterContext.java
oh alright
i wonder why all classes (Entity, ChunkAccess, etc) have their own CraftPersistentDataTypeRegistry, why don't they all use the same instance?
choco, any idea?
hey i hate to have to ask this here,
i was wondering how i can detect which chunks are taking the longest to tick
How can I convert a spigot gradient to a mojang gradient when I just use a nms Component.literal it becomes this §x§3§e§4§2§f§6
(e42f6 is the gradient)
¯_(ツ)_/¯
I didn't implement it
damn this class is getting more and more ugly in every commit
💀
💀
anyoe know
huh is this really the correct form to mention constructors in javadocs? ClassName#ClassName() ?

how would u go about detecting lag machines?
what methods have u guys come up with?
-
looking for where players are during lag spikes and honing in on - those chunks?
-
ruitine scan of all chunks tick speeds to see which ones are taking the longest to tick?
-
something else?
interested to hear ur guys thoughts as fellow developers
Anyone able to help me with some protocolLib stuff?
PacketUtils class https://sourceb.in/0vLrfGkAAs
Method that calls the setHelmet method https://sourceb.in/weVuaNfXVr
Issue: Packets only get sent sometimes but unsure if thats just a stroke of luck of something up with the code
Ideal outcome: Player 1 puts on a helmet with a mask "bound" to it and all players excluding player 1 see the mask instead of the helmet
its so annoying because It can work one second then bam not work again
I want to make a personal plugin to send commands to the minecraft servers of my network, separately, I already have the logic and everything, I will use mysql for it, but my problem is that "I don't know how to optimize it", there are 200 users at the same time by server but with the code as such it ends up exploiting the server, can someone help me? I tried to use Scheduler Programming but I don't see any change
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Why do the commands depend on the amount of players? Is it the same command times each player?
To who u are talking
you
The data query will be done every 5 minutes, but when the players enter the server starts to die, regardless of whether I'm asking for data or not
I mean, just by connecting it, everything starts to explode.
Are you doing your query on the main thread?
How can I convert a spigot gradient to a mojang gradient when I just use a nms Component.literal it becomes this §x§3§e§4§2§f§6
(e42f6 is the gradient)
Probably, I'm not really sure, it's the first time I've done this, but in theory based on what I did, I made a thread with scheduler programming to do it.
Show me the scheduler. It has to mention "async"
sure 1sec
public static void insertInv(StaffInventorySQL staffInventorySQL) throws SQLException {
BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskAsynchronously(Main.getPlugin(), () -> {
try {
PreparedStatement statement = Main.getPlugin().getConnection().prepareStatement("INSERT INTO staff_" + getDatabaseType() + "(uuid, inventory, armor, fetched) VALUES (?, ?, ?, ?)");
String inventory = Base64.itemStackArrayToBase64(staffInventorySQL.getInventory());
String armor = Base64.itemStackArrayToBase64(staffInventorySQL.getArmor());
statement.setString(1, staffInventorySQL.getUuid());
statement.setString(2, inventory);
statement.setString(3, armor);
statement.setString(4, staffInventorySQL.getFetched());
statement.executeUpdate();
statement.close();
} catch (SQLException e) {
e.printStackTrace();
}
});
}
I clarify that it is only an example and some tests lol
||and that he was not very sure how to use the schedule programming with this||
hmm "runTaskAsynchronously" looks alright
BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskAsynchronously(this, () -> {
try {
DatabaseManager manager = new DatabaseManager("", 3306, "s2", "ud", "+1");
this.connection = manager.getConnection();
manager.createTable();
} catch (ClassNotFoundException e) {
Chat.sendConsoleMessage("&a[DB] &cError to connect");
e.printStackTrace();
} catch (SQLException e) {
Chat.sendConsoleMessage("&a[DB] &cError to create the main table");
e.printStackTrace();
}
});
I have this on onEnable()
So you used it that way aswell? Since you said this is just an example. The asynchronous part is important
yes
Well since the server is not dying after your plugin, what are you doing in the PlayerJoinEvent?
nothing
well its
Where do you execute your query?
every five minutes
Oh so you load the plugin and even without players on the server it crashes again?
does this happen without you trying to connect to the db? E.g. commenting that part out?
and finally it gives a thread error and explodes
Nope
I will make the plugin again from 0 so I am open to suggestions
Are you 100% positive on that statement? It does look right to me. An asynchronous thread should never lock the main thread
Yes
I'm going to redo the plugin so I'll be testing things anyway but I know what's going to happen
Well in that case you should check your crash dump for the line of your plugin that's causing the crash
Check if it's actually that part, too
It's just that I tried that a long time ago and gave up, but I want to get back on it, I'm energized again 💪
Sounds cool. Can you
I am making the table in the database and then I will make the plugin
?paste your crash dump?
i'll do it when i'm done
Sure, I just can't offer more help with your crash before I see it :)
There is no more optimal way to use?
BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskAsynchronously(this, () -> {});
yep is ok
I mean I don't like to repeat it all the time
You can always create a function to have less copy&paste or work with CompletableFuture
Uhm I don't know much about asynchronous stuff, I'm not sure how to do it
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
been stuck on this for legit like 2 days now
well it's mostly about creating a function that does what you need and returns the object you wanna work with
Imma grab something to eat so if someone responds please ping
How can I convert a spigot gradient to a mojang gradient when I just use a nms Component.literal it becomes this §x§3§e§4§2§f§6
(e42f6 is the gradient)
Anyone?
that's how its supposed to look
idk then you'll have to figure it out yourself, NMS isn't very well documented
you shouldn't ever really need to use mojang components anyways
I'm sending a packet that requires a nms component.
CraftChatMessage.fromStringOrNull(your text);
I have a very strange issue, to begin with, my plugin cannot access some parts of the config file, but it can access others... however if i use /reload this completely fixes it?? Anyone have any idea what this could be? Thanks 🙂
Do you change those entries manually while the config is already loaded?
nope, at this point nothing has been changed at all
So you load the config, try to change values and it can't access them?
i think i managed to do it
literally just saveDefaultConfig(); (in enable) and then plugin.getConfig().getBoolean("settings.debug") (which works) and then plugin.getConfig().getConfigurationSection("designs").getKeys(false); (Which does not work until after a /reload
is ok for now
That sounds odd, can you send some code? And pls doublecheck that the config on the server is the same as the one in the jar.
even stranger?! after enabling spigot debug and rebooting its now working fine?!?
let me reboot a couple more times and see if it stays the same
/reload can cause weird issues. It works fine 95% of the time. If you have weird issues you should however always do a full reboot
yeah i have been rebooting, however /reload seems to fix the issue...
that should not be the case
exactly... thats whats confusing me so much lmao
one sec
the issue seems to be with this line (seprate class)
why do you call "getInstance()"? That's probably not an issue but plugin.getConfig() should work just fine
can you show me where you are calling the saveDefaultConfig()?
thats used to get the plugin from the main class
(Main)
and what's plugin?
inside the class you are calling it I mean
thats reffering to the main class
i had just renamed it to try something else and should have probably put it back before taking that ss lol. sorry about that
Is your main class named "plugin"? Because if "plugin" in your other class is already an instance there isn't really a reason to call getInstance
Anyways, that should not be the reason for your problem.
What does this line return when it fails? null?
or basically, is it a nullpointer because you call the getkeys?
null I believe, as it doesn't actually produce any errors, however when I then try to get the size (and use this in an rng - this is where the error was actually thrown as cant be 0) the size is 0
If you don't get an error it won't be null. Otherwise .getKeys would throw a NPE
Anyone able to help me with some protocolLib stuff?
PacketUtils class https://sourceb.in/0vLrfGkAAs
Method that calls the setHelmet method https://sourceb.in/weVuaNfXVr
Issue: Packets only get sent sometimes but unsure if thats just a stroke of luck of something up with the code
Ideal outcome: Player 1 puts on a helmet with a mask "bound" to it and all players excluding player 1 see the mask instead of the helmet
its so annoying because It can work one second then bam not work again
if i remove getInstance()
Wait, plugin is a public static variable? Why?
Actually your function seems to be in a static context aswell. Maybe that's why your config is fucked up
You should never be in a static context unless you are calling some utility class
You can however create a static function in your main class that returns "this" and then do YourMainClass.getInstance().getConfig() ...
You can;t actually return this in a static context. You have to set an instance variable and return that
oh, true. I guess I should go to bed some time soon
🙂
already hit the 24 hour mark 😅
I'm at the other end, not awake yet
Time flies when coding. Especially when it's not searching for annoying bugs for hours on end
Good morning btw
Morning 🙂
I'm trying to use a GUI to select a color and for some reason setCancelled(true) isn't working because I can pick up the item and put it in my inventory and when I reopen the gui the item is missing and I can just put it back like a player vault, can anyone help me? I've registered the listener and I don't know why its doing this
Thank you so much for your help, I managed to work it out I think... It seems it only happens if the config file has just been generated. Still not completely sure why it happens, might be a mistake in my code (likely) or could be a strange bug w spigot (less likely) edit: I think it matters where exactly in the load saveDefaultConfig(); is placed. I think it wasnt working as I had it too far down?
Hey, I want to make some machinery like in tech mods. My idea is to add custom crafts that give renamed blocks which on placement write to the block pdc and start a timer that runs every tick for checks. But I thought of storing it and using config files or databases just feels wrong. What should I use, in your opinion?
just change block nbt
and store the blocks on runtime in a list f some sort
or you can like lazy load them
But if I restart the server, won't it all be gone?
but you can just reload them using block nbt
because im pretty sure that is store inside the chunk?
or am i tripping
thats probably the best way
Ig
in like some sort of chunk load event
I'll do that that way then, thanks
Anyone able to help me with some protocolLib stuff?
PacketUtils class https://sourceb.in/0vLrfGkAAs
Method that calls the setHelmet method https://sourceb.in/weVuaNfXVr
Issue: Packets only get sent sometimes but unsure if thats just a stroke of luck of something up with the code
Ideal outcome: Player 1 puts on a helmet with a mask "bound" to it and all players excluding player 1 see the mask instead of the helmet
its so annoying because It can work one second then bam not work again.
Been stuck on this for almost 3 days now
with that code wouldn't new players who join after the helmet is equipped not be able to see the helmet?
also players who disconnect and rejoin will not e able to see it
got something else for that
oh ok
I tried with a packet listener but for some reason it sets the mask on all the other players
public class PacketListener extends PacketAdapter {
public PacketListener(Plugin plugin, ListenerPriority listenerPriority, PacketType... types) {
super(plugin, listenerPriority, types);
}
@Override
public void onPacketSending(PacketEvent event) {
Player player = event.getPlayer();
int slot = event.getPacket().getIntegers().readSafely(1);
if (slot != 4)
return;
ItemStack item = event.getPacket().getItemModifier().readSafely(0);
if (item == null || item.getType() == Material.AIR)
return;
NBTItem nbtItem = new NBTItem(item);
if (!nbtItem.getBoolean(NBTConsts.GLITCH_ITEM))
return;
if (!nbtItem.getBoolean(Consts.maskBound))
return;
String type = MaskUtils.getMaskType(item);
int level = MaskUtils.getMaskLevel(item);
Masks.Mask mask = MaskUtils.get().getMask(type, level);
if (mask == null)
return;
PacketUtils.setHelmet(player, mask.getMaskItem());
}
}
your setHelmet method sets the helmet for some player, so if you are sending the equipment packet to all the other players, that will setHelmet on all the other players
so how would I do it then? Ive not touched protocol lib in like 4 years lol
I guess you could store the player / helmet status in some sort of map and every time a player joins, you would loop through this map and send a packet that tells this new player all the helmets of the other players. For this, you would just do what you did up there with entity equipment packets, one for each player with a helmet.
Hello I’ve made a custom recipe but I need each craft cost 64 of each material instead of 1
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.RecipeChoice;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.ArrayList;
public final class CustomCrafting extends JavaPlugin {
@Override
public void onEnable() {
// Plugin startup logic
ItemStack amethystblade = new ItemStack(Material.DIAMOND_SWORD , 1);
ItemMeta amethystbladeMeta = amethystblade.getItemMeta();
amethystbladeMeta.setDisplayName(ChatColor.DARK_PURPLE+"Amethys Blade");
amethystbladeMeta.setCustomModelData(1);
ArrayList<String> lore = new ArrayList<>();
lore.add(ChatColor.RED+"* This is the Ametyhyst Blade forget from a blacksmith");
lore.add(ChatColor.RED+"* For the Amethyst King of the AmethystValley");
lore.add(ChatColor.RED+"* He lost it when he died in a fight vs Sparta");
amethystbladeMeta.setLore(lore);
amethystblade.setItemMeta(amethystbladeMeta);
ItemStack amethyststring = new ItemStack(Material.STRING,64);
ItemMeta amethyststringmeta = amethyststring.getItemMeta();
amethyststringmeta.setDisplayName(ChatColor.DARK_PURPLE+"Amethyst String");
amethyststringmeta.setCustomModelData(5);
ArrayList<String> lore2 = new ArrayList<>();
lore2.add(ChatColor.LIGHT_PURPLE+"* This is a material that lets");
lore2.add(ChatColor.LIGHT_PURPLE +"* You craft Amethyst Equipment");
lore2.add(ChatColor.LIGHT_PURPLE +"* Press /recipes for more info");
lore2.add(ChatColor.LIGHT_PURPLE +"* You can obtain this item and a ");
lore2.add(ChatColor.LIGHT_PURPLE +"* lot of more in /rpg");
amethyststringmeta.setLore(lore2);
amethyststring.setItemMeta(amethyststringmeta);
ItemStack amethyst = new ItemStack(Material.AMETHYST_CLUSTER,64);
ItemMeta amethystMeta = amethyst.getItemMeta();
amethystMeta.setDisplayName(ChatColor.DARK_PURPLE+"Amethyst Fragment");
amethystMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3 ,true);
amethystMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
amethystMeta.setLore(lore2);
amethyst.setItemMeta(amethystMeta);
ItemStack amethystheart = new ItemStack(Material.TURTLE_EGG,1);
ItemMeta amethystheartmeta = amethyst.getItemMeta();
amethystheartmeta.setCustomModelData(12);
amethystheartmeta.setDisplayName(ChatColor.DARK_PURPLE+"Heart of amethyst");
amethystheartmeta.setLore(lore2);
amethystheart.setItemMeta(amethystheartmeta);
ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(this,"amethystblade"),amethystheart);
recipe.shape("xyx ","xzx ","ysy");
recipe.setIngredient('x',new RecipeChoice.ExactChoice(amethyst));
recipe.setIngredient('y',new RecipeChoice.ExactChoice(amethyststring));
recipe.setIngredient('z',new RecipeChoice.ExactChoice(amethystheart));
recipe.setIngredient('s',Material.STICK);
Bukkit.addRecipe(recipe);
}
}
I am pretty sure the only way to do this is using PrepareItemCraftEvent and CraftItemEvent
and then manually do math
I am still having an issue where for some reason the sending of the packet wont work 90% of the time
Can u help me a bit with that
dont both just use Material not ItemStack?
Yea just use ExactMaterial and then use PrepareItemCraftEvent to check if the slots have enough items, if so add the result to the result slot
And then on itemcraftevent simply subtract the right amounts from each slot
Are you certain that the packet sending code is being called every time
i.e. its not the nbt checks for glitch item that are causing the issue
Yep added the System.out.println(player.getName() + " -> " + targetPlayer.getName()); gets sent every time
1.8
ah ic
no off hand
I love being stuck in 1.8 for this server ;-;
thankfully the cannon Jar dev is making a 1.20 version so we can finally do 1.20
is this code running or is it just like a test
it runs but doesn't work as intended
aren't the two code pieces colliding
one is changing the packet sent
and results in the packet being sent more
when I test the packet listener one I comment out the other one
The equipment packet is sent to the viewer, so idk if this code makes sense
cuz its listening for the entity equipment packet
and then making it so that the player who is viewing the armor
gets the armor
ye that is what I was getting
you should just use the interact listener
and then keep that code
and then just use a hashmap and send on join
because I don't see an issue with the code
if the packets only work like sometimes, is there like a pattern to when it does not work?
idk whaat to do i cant do it...
https://www.spigotmc.org/threads/how-to-make-there-be-multiple-items-per-slot-in-crafting-recipe.512244/
https://www.spigotmc.org/threads/recipechoice-that-requires-multiple-items.544490/
I am new to plugin development and would like to make a crafting recipe take more than one item per slot.
Here is the code I have so far:...
ty
How do i import something from my other plugin to my plugin?
add plugin as a dependency
so add as depend in plugin.yml
and then use either a) the api for the plugin if its available as a repo b) use the jar as a dependency
then you can just grab the plugin instance with Bukkit.getPluginManager.getPlugin(name)
I dont understand
with bedrock packs is it possible to replace some chars with imgs like java
yo, is there a way to get the configurationSection.getKeys(false) in order of the actual config
Why do you need it in the correct order?
saves me an extra field to get the order I want
It's a lot more work to get it in the right order
aw
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'EXITS spieler_sprache(uuid String, sprache string)' at line 1
need the code?
how can I set the state of a furnace? Like, the amount of fuel it already used up from the total. I want to be able to control how long it burns and stuff
sorry can you explain first time with mysql xd
declaration: package: org.bukkit.block, interface: Furnace
thanks
You probably want EXISTS
yes
thats what i want
"CREATE TABLE IF NOT EXITS spieler_sprache(uuid String, sprache string)";
and what is the typo
._.
.
would pdc be the best way to make some blocks interactable, like a chest or sm shit to open a different gui
PDC is a good way to identify your blocks
so is that a yes or is there another better way
plugin.yml has a section called depend
add the dependency name in the list
That is a yes
okay thanks know i know the typo but i dont really know what to fix there...
and what is the right word
.
thanks mate
you're not blind, just bad eyes xd
true
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' sprache string)' at line 1
did i wrote something wrong again?
the S big or
With varchar you can define a max length
then i use text
Sure
like this´?
String sql = "CREATE TABLE IF NOT EXISTS spieler_sprache(uuid String, sprache text)";
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' sprache text)' at line 1
something went wrong
Some questions about PrepareSmithingEvent
so the uuid String to uuid text
yep that worked big thanks to you Olivio
Okay and what should i write here?
the name of the plugin you are depending on:
depend:
- "Plugin1"
- "Plugin2"
It dosent work
I have a plugin named "FormatAsMoney" for making 1000 to 1k
depend:
- "FormatAsMoney"
You need to import the plugin in to your project if you want to access classes from it
^
But i dont understand what you mean with a and b
So i need to add it to my pom.xml right?
Yes
But what should i switch out with what to add my other plugin?
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
???
Same goes for gradle
.
what are you using instead
you dont have to change the other plugin
just run mvn install in the root of the other project
an then add the local dependency
How?
is this library yours or not yours
i want to get all stone from player inventory but it must be divisible by 4 then remove how can do it?
Dude what are you talking about?
I just want so i can use my FormatAsMoney in my other plugin so i can make 1000 to 1k
check if amount % 4 == 0
this sounds like a method you canm just copy paste over
why does it need a whole dependency
Becuase i also need to have the method in other plugins
And i dont see any reasons for taking this method into every plugin
i dont think you should have a library for one function lmao
that would make sense if it was some mult faceted method but its a util method
whats the best way to do like a raycast/linetrace out of the player's eye until i hit an enemy?
unless therei s some config that it depends on in the plugin you are just wasting time importing it
Use the api
raycast with raycastresult
raytrace with raytraceresult sorry
use: package: org.bukkit.util, class: RayTraceResult
how do I check if something is usable as fuel in furnaces?
declaration: package: org.bukkit, enum: Material
and how do I check burning time?
._.
no there is
oh thank god
im trying to read my horrendous code
You could check it in the event
declaration: package: org.bukkit.event.inventory, class: FurnaceBurnEvent
private int getSmeltTime(Material mat) {
return getFurnaceRecipe(mat) != null ? getFurnaceRecipe(mat).getCookingTime()/20*1000 : 0;
}
private float getSmeltExp(Material mat) {
return getFurnaceRecipe(mat) != null ? getFurnaceRecipe(mat).getExperience() : 0;
}
private FurnaceRecipe getFurnaceRecipe(Material mat) {
Iterator<Recipe> iter = Bukkit.recipeIterator();
while (iter.hasNext()) {
Recipe recipe = iter.next();
if (!(recipe instanceof FurnaceRecipe)) continue;
if (((FurnaceRecipe) recipe).getInput().getType() != mat) continue;
return ((FurnaceRecipe) recipe);
}
return null;
}```
wow cool
I have nowhere to use that event
have to get the recipe then the time form that
i think thats the time remaining right
that is unrelated
lots of values there
there is also burn time ticks for fuel etc
TICKS_FOR_CURRENT_FUEL
is the one
but that only works when afurnace is populated with a fuel item
cant just get it from the material
That would require the furnace to be burning already
Do armor types have an actual impact on the stats ?
or is an armor entirely described by its attributes ?
(which ofc are initially given based on the type of the armor)
My question can be rephrasd:
If two armors, whatever their types, have the same attribute modifiers/data besides the type (gold / diamond etc), are they just a copy of each other ?
just use the recipe method its much easier
i think material matters when comparing armors
so they wont be a copy
but stats can be changed without changing the armor type
so you can have two different types of armor with the same armor stat using attributes
Durability is hardcoded
yeah ik about that but i already have my own durability class
do you guys think that what i did in the screenshot is sufficient ?
(only for protection wise)
1 - what the actual fuck is that color scheme
with testing it feels like armors are the same but i ain't entirely sure
Screenshot of code 💀
😢
?paste
mk
wait don't mind the CompoundTag stuff (its unrelated to my question)
i only talk about sheer protection, not damage/durability
That probably wouldn't enough
Armor has protection values by default. I'm not sure if those are included in your calculation
Do test and see if it works
well my test seems to be pretty satisfying tbh but i feel like i'm coding with the ass rn and fluking stuff you know what i mean
till i have no proof this is exact testing won't convince me
but for example, each need the same amount of hits till player dies
and i fear of not covering every scenarios too tbh
maybe it's just a luck that my testing work for the specific armors i took
hm, idk what to test too tbh, i have tested basic armors, armors with same enchants,
all that in my manual testing seemed to work fine
Then it's fine
Not worth it

oops
wat
im new to java plugin making, is there a way to create a custom mob class that extends the zombie class
yes it's somewhat complex though
are you new to java in general
i know c# well and they're basically the same imo
on the surface, yeah
i know the basics of java
they're similar but not the same
thats some implementations ive done if you wanna try and decipher it
there are a few tutorials on the forums aswell
where do i get the net.minecraft import
ah yeah that is the remapped jar
you have to get the api using maven or gradle, you should look at some beginner guides
ok
I have a plugin that's reading some values from my config file, however my title string always comes back as null and is never read properly.
Method loading config:
public static void LoadFromConfig() {
configTitle = plugin.getConfig().getString("scoreboard_title");
configEntries = plugin.getConfig().getStringList("scoreboard_entries");
}```
Config:
```yaml
scoreboard_title:
- §3Title Here§r
scoreboard_entries:
- " "
- "§6Phase: §e$phase_display_name"
- "§e$phase_time_remaining §6Remaining"
- " "
- "$team_player_count"
- " "
- "§2§lBTekGuild Events§r"```
you'll either have to get the remapped jar or use the nms equivalent
why is it static
just pass the plugin instance
and use & instead of §
its called from a static method
no, i've taken extra care to make sure it's not
does scoreboard_entries load properly?
why do people abuse static so often
and where are you debugging it
could be in between the loading and debugging where it is messing up
what do you mean?
like how are you verifying that it is null
It is initialized with a string value in the class, that method is called and should overwrite the value with whatever is in config
can you show full code
just do a quick sout(plugin.getConfig().getString("scoreboard_title"))
sure hang on
Ok I changed the config from § to & and did sout in the main class as well as that method and it works in both places
maybe the symbol was the problem
shoot it's still the same thing in game, scoreboard title shows up as my predefined string
could getting and setting persistent data container every tick multiple times heavily mess up performance? Or is it pretty much okay?
are there any tutorials you could send me
its all on mem so its fine
but sounds like that could definitely be optimised
I remember on spigot there was some guide for newbies I followed but I don't remember where and what, you might just google
do you know how?
depends, what is your usecase?
like why are you updating it every tick
you know the mod ic2?
yup
basically, I'm trying to remake ic2 machinery using plugins
gotcha
well i mean in isolation it wont be bad but if theres hundreds of PDCs updating every tick
that could be pretty bad
consider batch calculation and on-request calcs
I rn have a furnace, the fuel slot is for fuel, the cooking time and fuel time is for fuel time and the result will be a glass pane (red, yellow, green) which name is the amount of energy stored from max
like, when you hover over the pane it tells you xxx/xxx (Energy Units) or something
yeah, checks and stuff
Okay so hear me out, might be much more complex but if you REALLY want perfomance.
Keep track of last interaction with the block, if the player is currently interacting with the block update each tick, if not PAUSE the calculation, and next time they interact get the time between now and last interaction and calculate the energy produced between interactions
can be made into a formula, and means you only every have to calculate it once when the block is not being interacted with
and every tick only when the player is viewing it
idk if that makes much sense
but if it's connected to anything that takes energy wouldn't that break?
or update ticking machines every second, unless being viewed, then per tick
hmm
if oyu calculate the output per minute or something
then you can just pass that into others' calculations
it can all be reduced to one or two equations and not have to do it per tick
hmm, makes sense
pretty sure thats how games like factorio and satisfactory do it
iterating through every single machine, every tick would add up exponentially
so, instead of doing stuff every tick, I just calculate a formula to see how much its producing and use that?
yeah, and if its something with limited runtime keep track of how long the fuel will last for example
you read my mind, I just wanted to ask about fuel
so
lastInteractionMillis = last interaction in time milliseconds
maxLength = how long fuel will last in milliseconds
output = min(lastInteraction - nowMillis, maxLength) * energyPerMillis
something like that
hmm, that makes sense
thats probably the most performant way to do it, but more work to figure out calculations
but will be hundreds of times faster than calculating each tick
couldn't I count the time in a way to know how much fuel is spent if it's more than 1 and if it's more than the total amount of fuel just calculate it at that point?
so with your furnace example does is the fuel worth x energy
or the furance constantly output x energy and the fuel powers it for x ticks
🤔
im confused with how the system works
im generally confused
okay so the furnace has xxx/xxx charge right
start by just making the machines run at 1 second per tick
so it acts as a battery aswell as a generator
never played ic2 just know what it is so im pretty fresh on this
you would almost certainly need something that coordinates all updates
if you arent going to be updating every tick
hold up im watching a video lol
since if you only update every so oftern, you would have to wait for some kther machines output
Hey, I'm trying to remember the name of something but I can't remember it for the life of me, it allows you to spawn different items with different sizes etc. I think it's a 1.120 thing?
im running buildtools.jar but no jar files are created, only java source files
did it say "BUILD SUCCESS" at the end?
Hero!
then you end up running into circular dependencies and many more htings i would assume
there's also block displays and text displays btw
yes
dont think so
ends up making life harder
but I dont see another way to do it
well what does it say?
Thank you for that mfn 🙂
the way i was describing before
np
oh gosh
unless you have the generator pushing ticks to other machines
already closed cmd
calculate it on request instead of per tick
then run it again
just calculate averages on request
You know when you know exactly what you want but you can't work out what it's called? 😅
its one calculation maybe every 10 seconds vs 100 a tick
true
when is the request though
when a block is queried (i.e player interaction or outputs an item) it causes a chain of queries to other connected blocks
meaning calculations are only being executed when they are required
yes I guess
but what about something that does not take item input or output
but then ither machines rely on it
solar panels?
okay
kinda like
- hey, I need some energy
- here, take 300 units
?
how does that not result in circular updates
Fuel{
amount
energyPerConsumption = energy once fuel is consumed
consumptionTimeTicks = time in ticks which it takes to consume
}
lastInteractionTicks = time in ticks when last queried
lastInteractionEnergy = energy amount when last queried
maxEnergy
on query ->
currentInteractionTicks = time now in ticks
currentEnergy = min(maxEnergy, lastInteractionEnergy + min(Fuel.amount, floor((currentInteractionTicks - lastInteractionTicks)/Fuel.consummptionTimeTicks)) * Fuel.energyPerConsumption)
then amount of fuel used is just
min(Fuel.amount, floor((currentInteractionTicks - lastInteractionTicks)/Fuel.consummptionTimeTicks))
okay that makes sense
holy wheat
so what about a chain of machines that could run in a circle
like?
idk some process
but with the recipes you can go back and forth and convert the same item etc
letes say a furnace generates power, which powers a coal miner which feeds back into the furnace
With making a bungee plugin, I presume you have to put the file in the plugins folder of the server?
each time the miner generates coal, it will update the furnace
and queries it befoer it updates it
lag machines go brrrr
okay so generators never update on their own
so yeah you would have to have some limiter
yeah, the built jar
yeah thats a hard one steaf
i still feel updating every x time can be really detrimental
and how do you know when item machines should update if not being checked by the player
or do you just not
and only update retroactively
this makes me want to try and write one of these lmao
this shits confusing
well the easiest way is updating every tick
lag machines be like
but performance is going to plummit with more than say 200 machines
okay wait
wait
tick buffer
hear me out
tick buffer?
machiens can only be queried every x ticks
meaning recursive queries wont work
but the calculations will still work as they will still calculate between last interaction
so an infinite loop will work but only update every x ticks which
and the buffer queues the query
okay o one machine querying another that was already queried in that time will just say the result is incomplete?
there has to be some sort of priority to the queries
lets say you have 2 coal miners and in between a generator
teh coal miners need energy so they will query the generator
but they cant do it at the same time
since the generator can only push every x ticks
is that what you mean?
priorities will have to work based on direction
yeah you raise a good point
raydan i hope you dont mind if i try and code this myself
i wanna give it a crack
who am I to forbid it tho?
and then make a lib out of it
done, made it ||/s||
xD
nah more like give up after a day
make an bukkit energy library
thats cool
i have a whole idea for it laid out too but... effort
and no one would use vanilla energy tbh, at least thats why i never gave it a crack
you can run most machine ticks off thread as well
maybe if we made the BE library (Bukkit Energy) we'll have more tech plugins(?)
it should implement what we talked about and some abstract classes
would need to be highly abstract like Forge Energy is (or vault)
Also is it possible to create a Spigot plugin that can also be used on Bungeecord servers? I know they have different API's but it could work with the right file structure?
definitely
ngl once i finish oraxen support for musepluse i should take a lok into that idea again since block displays are a thing
i will be back in 20 hours
that scares me
it's awesome yet scary
make sure you don't get fractureiser
jk
You can get it, I have no problems with that
jk
took me like
4 mins to figure what that was
then i forgot cf had that virus a week ago or so lmao
damnit now im all motivated to make a new plugin cause i hopped in here smh
Relatable
ngl this would be a stupid easy thing to transfer over to spigot to get working as a vault-style API and you could have people register theyre own energy storage type
Hmm
and you could make it only use referances to blocks (machines), meaning it could almost be entirely async
as 9/10 times ur never gonna actually need main thread stuff when a machines processing stuff like making energy
i hate myself with these ideas
🤔
its the 4am talkin
yes you get to hear belligerent american rambling at 4am about stupid ideas xD
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
can someone please help, I need a plugin that limits the amount of a certain item someone can have on them at one time, but I can't find one
(Example, you could only have 2 totems or 5 golden apples on you and it won't let you get more than that)
That's not what I want
I need to download Java 20 JDK and I kinda forgor
Where do I legally get it
oracle site :p
jdk/jre are bundled together in modern versions of java dont need to download 2 anymore if thats what ur thinking
just the one jar from oracles enough for dev + everyday use
you need an account iirc
i can download it without login
okay so, im trying to add an ability system to my custom items, for the items i have a custom class that looks like this for example (HeadItem extends the class "CustomItem")
public class HighlightBread extends HeadItem {
public HighlightBread() {
super("http://textures.minecraft.net/texture/c86f7f24d45841c658730f5ea60c206663bbbd62ba67cac223d1483911884e45");
}
@Override
public String getDisplayName() {
return "%%COLOR_RED%%Highlight Bread";
}
@Override
public String getId() {
return "highlight_bread";
}
@Override
public boolean isStackable() {
return true;
}
@Override
public EquipmentSlot getEquipmentSlot() {
return EquipmentSlot.HAND;
}
@Override
public Rarity getRarity() {
return Rarity.UNOBTAINABLE;
}
@Override
public List<String> getLore() {
return null;
}
}
Now what would be the best way to add an ability? I tried using an interface but before the ability gets used i want to do a check where u have enough "Mana" to use the ability, i want that in every ability, but i cant do that check with an interface since u cant have functions with definitions in there.
Openjdk better
u can have fucntions with definitions
use default key word
The easiest way but no the best way is to add method getAbility() that will return Ability object
Is there an easy way of doing it as I've gotten to the point where I'm checking if bungee is installed and then calling completely replaced functions specific to bungee
And this Ability object can have classes that extends it, for example u can Ability class and then u have WaterAbility instace that allow you to create WaterAbilities
oh yea i could just return null if there is no ability
or use Optional.ofNullable
the hell is even that
Optional allows you to check if something is null or not
I'll give u an example
Optional<User> optionalUser = UserManager.getUserByUUID(player.getUniqueId()).findFirst();
if (!optionalUser.isPresent()) {
return;
}
User user = optionalUser.get();
And here you are sure that user is not null
but in my customitem class i would add
public Ability rightClickAbility() {
return null;
}
public Ability leftClickAbility() {
return null;
}
right?
cus i can overwrite m
or Optional<Ability>
Optionals are kinda meh
i mean adding this, whenever i wanna trigger the event i check if the ability is null
U can do that
Yes but no
In java they’re clumsy (hence why the practice is only to return them from methods)
do i need packets/nms in order to prevent a hostile entity suddenly wandering away for a little bit?
https://youtu.be/JmYODjNHy9A?t=89
shown here
Hio! I'm struggling to configure NMS..
I heard in a forum post that you need to include spigot-server.jar, but I'm unfortunately unable to get it to work?
I keep receiving error: package net.minecraft.server does not exist, even though I'm using the --class-path argument correctly with both spigot-api.jar and spigot-server.jar.
Can anyb'dy please help meeeeeeeeeeeee.. ? ..
?nms
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Um this is Java so no need for CMake
I'm just using make.
For Java?
I'm impressed. People generally don't do that
Why's it impressive and why don't people generally do it?
Because we have maven and gradle. If you want it complicated there is ant
But make is very rarely used in java space
I haven't seen anyone use make for Java
wait my math is being dumb, if i wanna draw a line between two points with particles, like from the player's eye to a certain point, whats the best way?
Regardless, you don't want to use make in conjunction with NMS. If you really wanted to you'd need to be very aware of the tools you have at your disposal (such as tiny-remapper, mojmap, etc.) but chances are you don't
Why would I need to know about those?
Thus far I've not needed anything other than make?
Because otherwise you'll have a LOT of pain going forward
I technically don't even need make, I could simply use shell scripts like I used to.
NMS is obfuscated by default. TR and mojmap helps to get sane names
hmm, so, I thought a little bit and every time anything accesses the ticking machines it has to updated
Uhuh..
Couldn't one just use a Java-decompiler?
You may (read: you definetely given that you won't use an IDE) also need to use Recaf or if that is bloatware too - Quiltflower and CFR.
You seem to not understand me: In NMS almost all methods have names such as a, b, c, etc.
I'll bet a wager that in fact your vi install is vim
what do you think about neovim then
I haven't seen anyone ship naked vi installs seperately from vim for a while now.
I haven't seen anybody use anything lower than neovim lol
Also, what the hell are you doing with spigot if that is your concern?
I'm the nano guy if I really need to change anything in the CLI. Though I can make use of basic vi
nano is weird imo
I've used ED before.
At least I don't have to remind myself of differences between distros
you look like a person who would use notepad++ for coding tbh
What's that?
._.
I used to use Leafpad but honestly gedit is better.
In regard to GUI Notepad software.
Under fedora using :save && :qa! suffices. However under Windows you need to use :wa && qa! which is just ... why
:wq ; :w ; :q! is fine.
I always do :wqwhen I use nvim
Won't flush all buffers
Anyway can you stop judging me for what descendant of ed I use?
maybe
I need help including nms.
sure
If you don't know how, it's fine.
lol
I already told you how to use nms
the only official way to use NMS in spigot is using maven
the blog post was linked to you above
can i get the endpoint of a raycast without it having hit?
But maven is bloaattttt!! 😭
Either don't (recommended), use maven (next best thing), use gradle with paperweight (if you are really desperate) or follow ElgarL's advice and use the correct (non-bootstrap) jar (if you are suicidial)
Those are your four options. No more no less
I also told you how to use nms without maven
bruh ._.
what do you even need NMS for
I use maven even on my tablet
It was not obvious for me to see in the very very long tl;dr you sent me. I'm just a 14 year old girl not a leet hax0r..
if you just use NMS without maven or gradle then you'll only have the obfuscated mappings with method names like a(), b(), c() and they will change on every new version
you can read
Trolling pretty much 🤨
Detecting TPS drops in regions and such.
tps?
Bruh, this is spigot. The entire world is running at the same tps
Yes, but what regions are taking the longest to tick?
nice eye direction, game 👍
games fine, your math is bad
And you can't modify nms as-is. If you want that while still keep using bukkit you need to use ignite or other similar transform layers
Which means that you cannot run your plugin under bukkit without these (usually external) transform layers
Location endLoc = event.getPlayer().getEyeLocation().getDirection().multiply(getRange()).toLocation(caster.getWorld());
shouldnt that just get 7 blocks away from where the player looks?
no
I can detect what regions are taking the longest to tick, I just need to get the most TPS. Which I saw in a post on the forum, however I cannot manage to get it to work.
I keep receiving error: package net.minecraft.server does not exist, even though I'm using the --class-path argument correctly with both spigot-api.jar and spigot-server.jar.
okay then what is the correct math
you multplied a unit vector and made it a Location. You basically tried to draw a vector back to near 0,0,0
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Then do /s/1.18/1.20/
im already doing a raycast to check if i hit an entity or block but it returns null when it hits nothing sadly
I've seen this, to me it seems to infer that one must be using maven.
player.getEyeLocation().add(player.getEyeLocation().getDirection().multiply(7))
I'm not a genius, okey..
oh yea
It really does not
It just means that you need to depend on the ENTIRE contents of the bundler dir
That's ridiculous.
imagine asking for help and then ignoring every advice and calling it ridiculous lol
I'm out
I'm asking for it to be done a certain way.. That's all..
I don't want to use maven, and I don't want to use eclipse.
it's mentioned in the ?bootstrap message
Alternatively do the maven dependency resolution yourself. The org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT artifact is located under ~/.m2/repository/org/spigotmc/spigot/1.20.1-R0.1-SNAPSHOT/spigot-1.20.1-R0.1-SNAPSHOT.jar @tall siren
I've done that. But I can't do it with NMS..
Did you run BT yet?
Oh god.
?bt
?bt
I don't want to install anything on my System.
then you can't do anything on your system
Then stop trying to dev for Minecraft
I have a question about adding lore to items
can I add a line to the lore that is visible and also add a line which is hidden?
to the same item
Okay well then. I'll show you how to do it in the gray zone
why do you want to use hidden lore?
the whole purpose of lore is to be visible
(what was that repository again?)
use the PersistentDataContainer to store information
basically
how to store data in items: https://blog.jeff-media.com/persistent-data-container-the-better-alternative-to-nbt-tags/
I heard in a forum post that you need to include spigot-server.jar, but I'm unfortunately unable to get it to work.
Why won't it work?
persistent data is too slow to be useful
it's not, its as fast as any other NBT tag (which lore is, too)
do you mean how to get bukkit?
No the repo that published the spigot nms jars
no, and it makes no sense
use PDC to store data in items
that's what it was made for
?
When inlcuding the spigot jar I keep receiving error: package net.minecraft.server does not exist, even though I'm using the --class-path argument correctly with both spigot-api.jar and spigot-server.jar.
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Hm, I could swear it was https://repo.codemc.io/service/rest/repository/browse/maven-public/ but it doesn't seem as if they have it
You told me to include the entirety of the builder thingy, yes. But I'm asking if there is a way to do this without having to be so ludicrous.
no
If perhaps you did answer me I might have missed it, and for that I apologise.
stop being obnoxious and you'd have already had a full maven setup going
Also: Maven is portable. You can just delete maven afterwards
NMS
of course you don't, but its easier
Thank you!!
Won't accept using bt and gradle either
Somebody with a brain.
They're all bloat..
Can;t help then. Buildtools is the ONLY legal way to obtain spigot
you guys haven't blocked her yet? lol what a waste of time
no lol
yes
spigot spigot. Not spigot spigot-api
can get it from spigotmc right?
no
just download the spigot jar?
No
no
or u mean something else?
no
there is no legally hosted spigot jar
ur trolling
She wants org.spigotmc:spigot:1.20-R0.1-SNAPSHOT
No I'm gnot.
She wants to use nms so needs the full spigot
Spigot only hosts org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT
Only legal way to obtain the full spigot is to run buildtools
That's the API.
I need NMS.
I'm happy to work through obfuscation.
two options
- run buildtools and install it into maven local/include the produced shit
- use gradle and paperweight userdev for the paper api + nms (remapped automatically)
What's option #3?
@tall siren Just depend on https://repo.rosewooddev.io/repository/public/org/spigotmc/spigot/1.20/spigot-1.20-remapped-obf.jar and get out of here
none
But beware: I've shown you how to do it illegally.
that might get taken down
- you still need specialsource in maven to remap your code
Meh it won't. It's publicly indexed at mvnrepository.com
oh
md5 does go after maven repos hosting spigot
isnt it illegal
Ah huh
to host built jars
he has to, legally
I'm still getting the same issue.. package net.minecraft.server does not exist....
hello I've a problem. I've installed a datapack and it's working in localhost with out op, but in the host it's need op
At least it is a grey area
STOP.
?dmca
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
some stupid dmca by a salty bukkit dev
You are officially trolling
I mean even without the DMCA
The .jar you sent me didn't have that..
oh yeah
You can't redistribute Mojang code
Oh it does.
its double illegal
Then why isn't it working, Mister.
klarana lol
because u dont know wtf ur doing
Because either you messed something up or you are lying.
i think ik what u need
I still wonder why you people keep talking to trolls, I blocked them after 5 minutes lol
😭 I'm trying okey.. I really am..
What?
Yeah you are right there
so let me get this straight lol
u trying to include some spgiot.server.jar and not wortking?
cos spigot not have net.minecraft
If that's what package net.minecraft.server does not exist means, then yes.
