#help-development
1 messages ยท Page 673 of 1
Hey, how can I run a method then announce something once the method is complete? ๐ค
by using Bukkit.broadcastMessage at the bottom of that method?
yes this -- when check
yMax this int were start check
for optimization
Nah, I mean I want to have a effect run and once the effect finishes broadcast something. I tried doing that what you just said but it just broadcasts it straight away
show your current code
I think that's enough or should I add something else?
At the moment I have
@EventHandler
public void onBlockBreak(Player player) {
double chance = getChance();
if (chance >= ThreadLocalRandom.current().nextDouble(1)) {
// The chance happened!
forceProcedure(player, Objects.requireNonNull(player.getTargetBlockExact(5)).getLocation());
}
// If the chance didn't happen, the method will continue without broadcasting or calling forceProcedure.
}
But I want to do something after the forceProcedure method has fired.
so add something under forceProcedure ?
Then it just fires straight away
what does forceProcedure do
it doesn't, it will fire after its finished, unless forceProcedure runs async
I mean I have some falling blocks in the forceprocedure method and I want the method to fire once the last falling block has landed
https://media.discordapp.net/attachments/730993330170888212/1140671119947464704/image.png?width=299&height=36 i keep getting this error idk why
then start a runnable that checks for all falling blocks wether they're still falling and if not, it broadcasts the message and cancels itself
probably that jar isn't in your current folder
it is
it's not. show the output of ls
bash: 1s: command not found
LS
i dont see any files called "BuildTools.jar" there, only that's called "BuildTools (1).jar"
I don't care how you name it, you simply have to enter the correct name
if the file is called blabla.jar you can't expect it to work when running java -jar BuildTools.jar
this is not working, i am trying to place a block at a given location
Location loc2 = block.getLocation(); World BlockWorld = block.getWorld(); TheBlock = block.getType(); Bukkit.getWorld(BlockWorld).getBlockAt.getType(); block.setType(TheBlock);
if I just do
Location loc2 = block.getLocation(); TheBlock = block.getType(); Bukkit.getWorld("world").getBlockAt.getType(); block.setType(TheBlock);
it's fine but I prefer not to do it this way
getBlockAt.getType()
lol
yeah what is that supposed to be
mistype I am using two computers. Bukkit.getWorld("World")getBlockAt(loc2).getType();
TheBlock = block.getType();
Bukkit.getWorld("world").getBlockAt.getType();
block.setType(TheBlock);
Set the block to the type it already is ?
ok look, you're gonna have to send the actual code, this shitty snipplet is useless
that's not even valid java
also why are you getting the world by name
what is it even upposed to do
nothing of what you sent would compile
world.getBlockAt(loc).setType(TheBlock);
this is the correct way to do it, I have no idea what above was doing. I have to set the world variable and then call on that, i was setting the variable while i dont know. I understand now. I will paste the file in a minute
TheBlock should be called "type" or "material" btw
right now it looks like a ClassName
its a material i defined as a variable... i think i am typing the language right
it is an absolute mess while I figure stuff out but here is the file https://pastebin.com/bt4UALy4
you should really thinkg about using proper variable names ๐
e.g. don't call stuff "e" or "f" and especially don't use NamesThatLookLikeClassNames
same for methods
I get that's how they try to teach but i learn better like this, after i get it down i will convert it to proper names.. just makes it easier for my head to comprehend
methodsUseLowerCamelCase();
fieldsAndVariablesUseLowerCamelCaseToo
ClassNamesUseUpperCamelCase
now I need to convert the bottom to a list, and then figure out how to pull the correct information out of it when its time.
you don't want to read/save a file every time someone breaks a block
I need some help with a custom item. I copy pasted 3 custom items I gave 2 of them certain amount of uses. When I use them up they disappear from my inventory. The third custom item is one time use but whenever I use it and I have multiple in my inventory, every one of them gets removed. (This doesnt happen when I use up the other ones).
what in the unholy hell is the second BlockBreakEvent
It's just messages, seemingly the same messages.
I suggest making a method, extracting the different values and then passing those as arguments
code for the removing of used items
just reduce the amount in hand
or if it is unstackable, then just set the item in hand to air
also
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Well its stackable, but for now I just told the players to not stack them ๐
ty
is there a thread with common problems, best practises?
I am using CompletableFutures and just realized that the more assets I need to reload, sooner I get this issue
java.util.concurrent.RejectedExecutionException: Thread limit exceeded replacing blocked worker
I am using CompletableFuture to deserialize a World (just by its name) from a YAML file
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.
Can't I queue thousands of CompletableFutures? It seems that at some point they start blocking, I don't really get what's the issue so I can't figure out the fix...
show your code
ur probably running them all at the same time instead of actually queueing them
i need use loadChunk when search location in here ?
The algorithm is the following. It loads a configuration object from a YAML file (kind of deserialization). The issue is that any of these configuration objects are loaded from a specific folder, so any YAML file that's valid and is inside this folder will be loaded at the same time asynchronously. I am also using a main future to check when all these YAML files are done being read.
So I think in order to fix it would be to figure out a similar solution like the main future I have for all the files inside the previous specific folder?
You'll want to use a cached thread pool
Exactly what Iโm looking for ๐๐ป
Is there any list of server versions that are used in NMS? Like v1_8_R3
https://www.spigotmc.org/wiki/spigot-nms-and-minecraft-versions-1-16/
https://www.spigotmc.org/wiki/spigot-nms-and-minecraft-versions-1-10-1-15/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
that has all after 1.10
For what purpose can NMS really be needed besides custom tags?
Hmm ok
I would rather re-think your design
How can I check if a clicked ender chest belongs to the clicking player?
Probably using an executor and submiting tasks to it is a better approach
It will use a pool of threads or a single thread depending on what you need
Inventory#getHolder returns null.
Using e.getClickedInventory() == e.getWhoClicked().getEnderChest() only returns true if the ender chest is opened by a plugin, not by the ender chest block
?
u can't open anyone else's enderchest
unless done with another plugin
enderchest is exclusive to the owner
I mean you can with the API
Using a plugin, you can.
And for my plugin it is very important to know if the player (aka admin) actually clicked is own ender chest.
Otherwise the plugin will break
well you use the plugin's api
not spigot api
The plugin just uses Spigot's API to open the ender chest and doesn't set any data
and getClickedInventory().getHolder() returns null?
Yes
try getTopInventory
What exactly is that going to achieve? ๐
The clicked inventory is the top inventory since it's the only one that can be an ender chest
its gonna be null
a
help
java.lang.AssertionError: TRAP
at net.minecraft.world.item.ItemStack.O(ItemStack.java:192) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at net.minecraft.world.item.ItemStack.e(ItemStack.java:1192) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:456) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1622) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:28) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3498-Spigot-b081915-10ba1be]
what does that mean
ItemStack mD = MetalDetectorItem.metalDetector;
ShapedRecipe mDR = new ShapedRecipe(new NamespacedKey(this, "metal_detector"), mD);
mDR.shape(" X ", " Y ", " Z ");
mDR.setIngredient('X', Material.IRON_HOE);
mDR.setIngredient('Y', Material.REDSTONE);
mDR.setIngredient('Z', Material.GOLD_INGOT);
Bukkit.addRecipe(mDR);
}``` trying to make a custom crafting recipe is something wrong about this?
because it doesnt seem to work
but also doesnt seem to trow an error
What are you doing with ItemStacks?
i made a gun
that if u shot 6 time then it will reload
acutally its just removing item and readding item
@EventHandler
public void ORC3(PlayerInteractEvent event) {
Player player = event.getPlayer();
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (event.getItem() != null) {
if (Objects.requireNonNull(event.getItem().getItemMeta()).getDisplayName().equals("ยง9Diamond Gun")) {
++Ammo;
Arrow a = event.getPlayer().launchProjectile(Arrow.class);
a.getWorld().playEffect(event.getPlayer().getLocation(), Effect.SMOKE, 10);
if (Ammo % 6 == 0) {
player.sendMessage("ยง7Reloading");
//player.getInventory().removeItem().remove(DiamondGun);
Bukkit.getScheduler().runTaskLater(_plugin, () -> {
//player.getInventory().remove(fakegun);
player.getInventory().addItem(DiamondGun);
}, 100);
}
}
}
}
}
What's fake gun
Ok
the gun
Delay the launching by 1 tick
?
I encountered this Exception yesterday.
For some reason, delaying launchProtectile by 1 tick fixes this
Why are you incrementing before instead of after?
You can at least give it a try, can you?
because the event registers item name so ill just remove player's gun and add an fake gun that is simliar to real one and remove the fake gun readd the real gun after 5 second
I don't know why, but I can assure you, I encountered this exact error yesterday and fixed it by just adding a delay of 1 tick
So... Maybe it works for you too ๐คท
depends what
Yes
Why would they need to do this? Their issue is related to ItemStacks, not entity spawning.
i gotta say that shoting protectile is littearly fine
and the errors doesnt says shoting protectile have an issue
if errors says shooting protectile have an issue then it wont be itemstack problem
yk
you dont load the data when they join, or save quick enough
Typically you only see that error if you are screwing with ItemStack amounts or trying to mess with them on another thread. Entities can also trigger that error, but that's under different circumstances. Is there more to that class? Something seems to be missing here.
I now came up with this monstrosity:
private boolean isOwnerOfEnderChest(Player player, ItemStack clickedItemStack, int clickedSlot) {
ItemMeta clickedItemMeta = clickedItemStack.getItemMeta();
PersistentDataContainer clickedItemContainer = clickedItemMeta.getPersistentDataContainer();
clickedItemContainer.set(this.clickedShulkerKey, PersistentDataType.STRING, player.getUniqueId().toString());
clickedItemStack.setItemMeta(clickedItemMeta);
ItemStack potentiallyClickedItem = player.getEnderChest().getItem(clickedSlot);
if (potentiallyClickedItem == null) {
clickedItemContainer.remove(this.clickedShulkerKey);
clickedItemStack.setItemMeta(clickedItemMeta);
return false;
}
ItemMeta potentiallyClickedItemMeta = potentiallyClickedItem.getItemMeta();
PersistentDataContainer potentiallyClickedItemContainer = potentiallyClickedItemMeta.getPersistentDataContainer();
boolean isOwner = false;
if (potentiallyClickedItemContainer.has(this.clickedShulkerKey, PersistentDataType.STRING)) {
String uuid = potentiallyClickedItemContainer.get(this.clickedShulkerKey, PersistentDataType.STRING);
isOwner = uuid.equalsIgnoreCase(player.getUniqueId().toString());
}
clickedItemContainer.remove(this.clickedShulkerKey);
clickedItemStack.setItemMeta(clickedItemMeta);
return isOwner;
}
Please tell me there's a better way to check the ender chest owner...
private boolean isOwnerOfEnderChest(Player player, ItemStack clickedItemStack, int clickedSlot) {
ItemMeta clickedItemMeta = clickedItemStack.getItemMeta();
// ...
clickedItemStack.setItemMeta(clickedItemMeta); // ?????????????????????
what's the purpose of this?
you set it to whoever clicked the chest?
I have to set the ItemMeta in order to update the PersistentDataContainer.
I want to check if clickedItemStack is the same ItemStack as in the player's enderchest.
Since you can open another player's ender chest by using a plugin, I need a way to check if the clicked inventory is the enderchest of the person who clicked
The method works, but I'm searching for a better way that isn't this monstrosity...
Hey I was wondering if someone could lend a hand, I'm trying to advance one of my plugins into being available for multiple server types (currently only bungeecord) by adding in a standalone spigot version to it. I planned to do this with multiple plugins in one gradle project however I am not really too sure as to where to start with this because I've never really done anything that "advanced" with gradle before. Feel free to DM me if you'd wanna do it in a more closed off place lol
Why compare itemstack data when you can just compare the inventory? Inventory#contains()
You already know who's enderchest is being opened when you open it. Just compare the contents of that inventory with whatever you want to match with.
Two enderchests could contain similar items.
I wouldn't have definitive proof of it being the same item
That wouldn't change the fact that you already know who the inventory belongs to.
If you are relying on the items having specific data, that's fine, but you have to have a Player object beforehand to even open their enderchest inventory.
Hey, where can I get the spigot api for 1.20.1, I have one via BuildTools but I'm missing classes like ChatMessageType, for example
If I have a Block object, can I check for tags, such as CROPS?
How exactly do I already know who the inventory belongs to?
Just because a player is viewing the ender chest, doesn't mean it's his ender chest (Plugins can allow players to open someone else's ender chest)
cant you use instanceof for checking?
Tag.CROPS.isTagged(block.getType())
Thanks!
yeah but i got a plugin for 1.20 which is using ChatMessageType but i want to code it myself cause it dont work like i want
That's correct. However, if it's your plugin, you have control over how the inventory gets opened.
Is this something you're trying to check yourself or are you relying on other plugins for this?
does anyone now how to use the actionbar in 1.20
im guessing its a bungee class, use maven or gradle and get the api from the repo
declaration: package: org.bukkit.entity, interface: Player, class: Spigot
i dont got a maven
if you use eclipse, intellij, netbeans etc it has it built in most likely
or you can use gradle
both work
I want to publish the plugin at some point, so there can be other plugins opening ender chests for players.
The goal is to interact with the clicked item. This will only work if I know who's ender chest it is though
how?
download gradle and gradle init
If it's your plugin, you already know who it belongs to.
Player target = Bukkit.getPlayer("WhoeverItMayBe");
Player you = event.getPlayer();
you.openInventory(target.getEnderChest());
You already know who it is because you have their Player object. target is what you can use to identify who's enderchest it is.
Unless you're opening their enderchest some other way, this is how you can get that information.
Yes, but only if my plugin opens the ender chests, which is never the case, since this is not what the plugin is supposed to do.
Even if I add this feature to my plugin, it doesn't guarantee that my plugin is the only one that does this
I'm trying to add compatibility for plugins that do this
repo?
Maybe I'm being shortsighted here, but I don't think that's realistically possible. If you are trying to make this compatible with every other plugin that has the ability to open enderchests, you'd want to hook into them and work accordingly.
Otherwise, you have to override a bunch of functionality that those plugins provide possibly introducing new bugs that wouldn't have existed otherwise.
As said before, enderchests don't have an owner field attached to them, so there's no way to reliably determine that. You could try checking inventoryholders, but that's not always guaranteed to be a player much less nonnull.
That's why if your plugin provides the functionality, you can do exactly what you want.
Okay, thanks.
This is exactly the information I was looking for ๐
how i can optimaze this code
that won't even work on spigot
why
because serializeAsBytes() does not exist
also that string won't be human readable or editable btw
lol what
there is no method called ItemStack#serializeAsBytes() in Spigot
i in paper
1.16.5
yeah it will only work on paper, not on spigot
and the string will be gibberish
I'd rather turn the itemstack into json https://github.com/JEFF-Media-GbR/JsonConfigurationSerialization
this be just num in string
[1,2,3,4] -> "1234"
in spigot not exist metods for serilaze itemStack?
you can use a BukkitObjectOutputStream to turn an itemstack into bytes
or you use the lib I sent above which will turn your itemstack into human-readable json, e.g.
{"\u003d\u003d":"org.bukkit.inventory.ItemStack","type":"DIAMOND_SWORD","v":3465,"meta":{"\u003d\u003d":"ItemMeta","meta-type":"UNSPECIFIC","enchants":{"DURABILITY":3},"display-name":"{\"text\":\"My Sword\"}"}}
and to use it with jeson, you need to connect it to the server?
no clue what you mean with that
this library needs to be downloaded and installed on the server?
no
a?
I've always wondered why some dependencies need to be downloaded as a jar and some don't. the same worldguard api needs to be downloaded in order to work with it, although maven has it
does BukkitObjectOutputStream actually works?
i remember that it didn't copy the item completly
i never had any issues with that
i made a plugin for someone and the only way to get the same item was via nms
cant you send yaml files through pluygin messaging and then convert it to itemstack
boos has some odd corners and fun cases where the thing just blows up when deserializing
and the case where the serialized data is lossy compared to the actual nbt
serialization means not so safe?
what
serialization means taking a live object and turn it into some other data representation to store or send elsewhere
i know but this not so safe ? is there any chance of losing data?
.
if by any you mean non-zero, then yes, but it's likely fine
if you want to be 100% on the safe side then you'd have to get the nbt instead, like how fr33styler showed before
this?
yes
hopefully, CB#1230 gets merged soon and it will be good forever
@eternal night 
mysql:mysql-connector-java๐ซ8.0.33 was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced
to where
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.1.0</version>
</dependency>
tysm
quick question, using F4 usually opens the decompiled class methods. I wanted to check on the inner workings of a method to make sure it works like i intend it to, but all i get is this. LivingEntity is an interface, but the object it's called in is a player. Why doesn't it jump to the override, but to the original method declaration?
Did you forget to shade or provide mysql connector?
wait
none of the classes implementing LivingEntity including player show their method bodies? Fuck did i build the source for bruh
Spigot should provide mysql connector already ๐คทโโ๏ธ
How the fuck HashMap short keys? I just put data with some order and they are just in completely random order...
You're missing a slash between port and database name
Yes, if you want order use a treemap or linkedhashmap
by their hash
Hashmap has no guarantee of order
But yes pretty much what md said. If you need the order, don't use HashMap
Hello, do BlockPhysicsEvent include BlockPlace and BlockBreakEvent ?
Is the server running locally on the same machine?
is there a way to get rid of the wiggle?
I have set the awareness and Gravity to false
I move the entity with:
// targetLocation is the player's location + 2 blocks up
Location TargetLocation = player.getLocation().add(0, 3, 0);
Location BalloonLocation = entity.getLocation();
Location PlayerLocation = player.getLocation();
// make the balloon move towards the TargetLocation
entity.setVelocity(TargetLocation.toVector().subtract(BalloonLocation.toVector()).normalize().multiply(0.2D));
Well, there's part of your issue. You have one set with an IP.
By creating your own event sadly
then its called many time the players moves in the region
Probably. If all of your servers are on the same machine, then you don't need to set an IP in the server-ip field. You can leave them blank.
anyone have an possible idea?
You need a plugin for that.
how do i get inventory of dead player
like what do i cast an offlineplayer to
humanentity? humanplayer?
ok nvm
Hello, how can I get the previous BlockData of a block updated with BlockPhysicsEvent ?
(I want to check mushroom blocks MultipleFacing)
I think i know exactly what you're doing. Just cancel the event if a mushroom block is involved
okay thanks
Just founded this at the same time x) https://www.spigotmc.org/threads/cancelling-block-physics-on-mushroom-blocks.460790/
I wanted to check the block facings but idk why I would do that x)
not sure if that counts as block physics
I think
I'll try growing a mushroom
okay
hum, when I place a mushroom block next to the block updated, it isn't cancelled
@smoky oak
thats cuz block placement aint physics
okay
it triggers it
I'll cancel block placement then
there is a way around that
you can place mushrooms next to each other
i think you cancel it and then place the block yourself
which you can do in a way it doesnt change texture by setting some boolean to false
I want to make custom blocks, but I don't want normal mushroom to be custom blocks
But I think my actual code is good```java
@EventHandler
public void antiMushroom(BlockPhysicsEvent e){
Block block = e.getBlock();
if(CUSTOM_BLOCKS.contains(block.getType())){
e.setCancelled(true);
}
}
@EventHandler
public void antiMushroomPlace(BlockPlaceEvent e){
Block block = e.getBlock();
if(CUSTOM_BLOCKS.contains(block.getType())){
e.setCancelled(true);
}
}```
oh well
cancel block place
:LUL:
how should you do regex mapping in spring, seems to be harder then it should be lol
@GetMapping("/{test:^(?!test).+$}") is for some reason not matching /foo/ even trough it should lol
looks like I'm a little asleep
e.setCancelled(true);
block.setType(MUSHROOM, false);//The 'false' stops physics update
in ?
the second one
remember to remove the item from teh player if not increative btw
yes
(and to apply the correct one of the mushroom types... etc. Lots of small details here lol)
@EventHandler
public void antiMushroomPlace(BlockPlaceEvent e){
Block block = e.getBlock();
if(CUSTOM_BLOCKS.contains(block.getType())){
e.setCancelled(true);
block.setType(block.getType(), false);//The 'false' stops physics update
}
}```
I'm asleep so I'm doing shi*
but I think this is okay
ah yea sounds about right
can't place the block :/
maybe I need this code... ?
https://www.spigotmc.org/threads/cancelling-block-physics-on-mushroom-blocks.460790/
let's try
looks like it's perfectly working
but updating all connected mushroom blocks, not a good thing 'cause I'll generate worlds based on mushroom blocks x)
Okay so I have followed quiet a few YouTube tutorials and spigot forums and I can't seem to get this fixed
The one plugin error I can't figure out what's wrong with the plugin.yml
your jar is missing a plugin.yml
https://cdn.discordapp.com/attachments/1093961981419073829/1140778334683418675/IMG_20230814_164351.jpg this is my setup I'm using eclipse
this took me an hour to find out and fix ๐ฅฒ https://github.com/JEFF-Media-GbR/JsonConfigurationSerialization/commit/7422fa426c9567f12175cf949ca45977e40083dd
you should be using maven
or gradle
they're not using maven, there won't be any resources directory. The file belongs into the root folder in this case and then has to be selected everytime they build
I highly suggest to switch to using maven: https://blog.jeff-media.com/how-to-create-your-first-minecraft-plugin-using-the-spigot-api-and-maven/
wasn't sure
but as said, you should be using maven instead of using "export .jar"
How do I get the direction the player is looking in?
getYaw()
Thanks
somehow nobody knows this
that's why i wrote that post lol
the other spawn methods (falling blocks, dropped items, etc) also have consumers
damn
I have done some basic coding on eclipse already and it's just the plugin.yml I can't figure out I have put in the yml by the main, Il check maven out if I can't figure it out on eclipse but I'm one of those people once I come across a problem I would like to figure it out before moving on so I know how to do it https://cdn.discordapp.com/attachments/1093961981419073829/1140778334683418675/IMG_20230814_164351.jpg.
https://github.com/Realizedd/DE-ArenaRegen i decompiled this using buildtools but its 70 mb instead of 70 kb
??
im trying to compile this code
https://github.com/Realizedd/DE-ArenaRegen
but its compiling as a 74 mb jar
when on spigot it is supposed to be 74 kb
How did you compile it
so how do i get the plugin
Download the plugin source.
yes i did
Now unzip it and open it up in your IDE.
i added buildtools.jar to the plugins source folder then i ran java -jar BuildTools.jar --rev 1.19.4
i already configured the pom.xml
Yeah that's going to build Spigot
alternatively, configure your gson instances correctly :D https://www.javadoc.io/doc/com.google.code.gson/gson/latest/com.google.gson/com/google/gson/GsonBuilder.html#setObjectToNumberStrategy(com.google.gson.ToNumberStrategy)
Not the plugin
how do i build the plguin then
If you have no idea how to compile the addon you should just buy it and support the author
By using the gradle tools built into the IDE
I assume you're not a developer
too broke for that
And just a user wanting it for free
Sounds like you're too broke to run a server then
Then tell them to buy it
there is none for using ints
it's an interface
ghost is my friend and a staff in my server. he is helping me with stuff and plugins
to be clear paypal is banned in my country so i cannot pay the author via paypal
i reached him for third party payment he ghosted me. didnt reply for many days so we have to use the open source
Well that's 3 entirely different reasons just to counter what I said
Honestly that just makes me think some parts are lies
we are actually an smp with over 80 plugins duels is just an option
so we are not building a whole server " based on his work "
think what you want you are free to judge, if you dont want to help i bet someone else will
You could try and scheme with someone that has a paypal account
i mean i dont get why its so big of a deal to help my friend whos trying to compile
move event is not triggered when player is mounted on something right?
Open source doesn't always mean you're allowed to use it
i need the plugin in my spigot account to be able to update it when there is an update.
having someone else have it is bad
Especially for commercial use
i get you man but i did my part and i tried to reach out he refused to help not my fault
who said its commercial use, its not
I'm assuming it is based on the information I have
you dont have any information about the server and how it is run,so please dont judge without knowing
you have no idea what the case is so i will have to respectfully ask you to stop judging us without knowing the real story and the real thing. you dont know us so do not assume the worst.
thank you
beside i asked before deciding to ask my staff to compile
#general message just so you know im not a " bad person "
I'd say the best approach for this is to just pay someone the 7$ to teach you how to compile it yourself
You learn a new skill, you're still helping the industry
isnt this channel supposed to be for help.
if you want to help thanks your great
if you dont thanks too someone else will help
It is but we aren't straight-up going to do it for you, we're here to direct you in a general direction, not to hold your hand
i understand that
but the other user was saying other stuff.that were not constructive
thats all man, no grudges i get it
yeah it does indeed
it require multiple build tools
Not exactly
BuildTools is spigot's system for compiling.. spigot
It grabs NMS and does spigot's patches on it
oh i get you
And it lets you select a version to do it
so nms is another file
NMS is mojang's server code
i though build tool is like the package you use to import
like import math
may i have the link for that
It's proprietary :p
Just know that when you run BuildTools, it grabs NMS, patches spigot on top and installs it on your maven local (repository)
When you try and compile the plugin, it then grabs all the nms versions it needs from mavenlocal and uses them as dependencies
you think 7$ is nothing , it is nothing for most of the world ( not you as in you but like whoever is reading )
but for me it is a few days of salary ( after some issues happened )
so please dont judge me wrongly
inflation / war / etc.
It's fine I started making plugins when I was like 12 because I couldn't afford premium things either
its cool
And it's my job now ๐
Does anyone know why this stat is inaccurate?
playerData.getStatistic(Statistic.DAMAGE_DEALT);
if buildtools was for compiling spigot and not the plugin then what was the point of actually running java -jar BuildTools.jar --rev 1.19.4
Inaccurate how?
You'll need to provide more than that
its stored client side, dont use that
like my stats from the client
dont match up
oh bruh
do I rly have to make that stat myself
You're running the buildtools jar and specifying it's "revision" as 1.19.4
it installs nms & the api into your local repo and makes a server to run
so would mvn clean install complile the plugin or
Try and see
ok i got some jar file that was generated but its not 70kb which is how big the plugin is
what should i do
the MTVehicles plugin moves player on an armorstand and does not have vehicle move event
obfuscation can influence the file size
Just look at the code
okay
what the fuck is this
they don't. i checked their java doc
so a 70kb plugin goes into a 1kb?
what no
how should I get the client side stat
any idea?
Other way round
they just teleport and sometimes apply velocity
unless its a b c obf
thanks
so then how do i compile the plugin
Yea. Most people dont do that tho
it still wouldn't work - I don't have any gson instance
Figure out the build system and run its normal compile cmd
listen for every damage then store it in the server's database
I'm only providing a class implementing JsonSerializer and JsonDeserializer, so that means everyone else who'd be using that would have to use a custom ToNumberStrategy
it uses gradle & maven, i ran mvn clean install which gave me a 1kb jar of nothing https://cdn.discordapp.com/attachments/730993330170888212/1140793400736628827/image.png
how do i mark it for inclusion
It wont use both
you told me to use java -jar BuildTools.jar --rev 1.19.4
applying velocity on an entity triggeres any event?
yes
because the project uses nms
i told you to use gradlew build
after looking at the code i realized that it uses nms
so then i told you to run build tools
gradlew build just closes the cmd prompt and doesnt do anything
Use an ide
bruh omg
double-click it on intellij and you'll go far
i have eclipse
why is damage dealt stats like that lol
1 damage = 1/10 hearts
something something number precision
you ran build tools for 1.19.4 but the project uses 1.19.3
Dont need bt gor the api
well the build.gradle doesn't include the spigot repo
Damn wtf
i remember he sent the github a while ago
so you want me to run build tools 1.19.3
but i cant be bothered to find it
yeah
what version are wanting to run this on
1.19.4
like all of them
you cant
it doesnt have nms for it
you would need to create the new module and then add the nms code
Ideally you'd just fuckin patch it yourself and remove all others for simplicity
But that's beyond our budget
looks like the latest version it supports is 1.19.2
even though the error mentions 1.19.3
so i cant run 1.19.3 too or
Yeah so this code doesn't have the NMS written for 1.19.4 or whatever
meaning you'll have to do it yourself
earliest you can run is 1.19.2
fixed the comment
Takes like 10 minutes for an experienced developer to do
its missing 19.3 and 19.4 nms
yeah
i can run 1.19.2
yeah
doubt it would be very hard to find where you call the statistic
does applying velocity on an entity such as armorstand trigger any event?
^^
https://github.com/protonpass/android-pass open source password manager 
isnt bitwarden open source too?
idk
hell, googles 2fa authenticator app is open source
its an old version but still works iirc
yeah its on github
hell, keepass(xc?) is open source too p sure
u can be secure and still be transparent :P
proton pass is decent
it has UNLIMITED log in locations
unlike dashlane
or any other password manager
lets hope a last pass doesnt happen
Login locations?
Isnt that normal
not for dashlane
Bitwarden also works from everywhere
i dont trust my self to hsot that
Just use docker + watchtower
still dont trust myself
yte idk what ima do about that
I had my ssn and everything on there
Hey I was wondering out of curiosity if it would was possible to download and load a plugin directly on to ram using a plugin loader
Do attribute modifiers persist through restarts?
Okay, I'm confused
I used set to store a UUID and it did this
world-uuid: !!java.util.UUID '1a40e31e-c053-457b-ad98-4b78d1ebeecd'
you need to toString i
not even sure if this is possible just with regular JRE would be heaps of fuckery and not worth the effort
oh
I've seen people do it before
I dont know what witch craft they used but they did smthin
what practical usecases would doing that have
eh
you mean like plugman?
I dont think it loads the jar directly into memory
it creates a temp file if im correct
sure but that seems pretty pointless
just construct a Plugin object and throw it into PluginManager#enablePlugin(Plugin)
i wonder how it would be any more "secure" than just loading it from a file
Is there any reason why isString would be returning false when the entry able to be read with getString?
well if it is a string?
So, pointless
Then what is name: test being deserialized to?
A string
so why does isString not think it is a string
when i run /shop
it says This command cannot be executed now, please fix the configuration formatting first!
i use economyguishop
idk what happend first it works
Probably because its only part of your default config but not the loaded one
Which yaml file, the included or the saved one?
can someone help?
There is no default
It's a FileConfiguration that I'm writing to and saving in the actual file
Print out the config using saveAsString
saveToString() *
[19:13:20 INFO]: [LCEMinigames] [STDOUT] name: test
world-uuid: 1a40e31e-c053-457b-ad98-4b78d1ebeecd
start-locations:
...
what's the output of
myConfig.get("name").getClass().getName();
it's a String
well no clue, isString simply does an instanceof
maybe ?paste your code
it's working fine
thank you all for your help I figured it out though ๐
No idea
// Setting
FileConfiguration arenaData = YamlConfiguration.loadConfiguration(arenaFile);
arenaData.set("name", arenaID);
// Reading
this.arenaData = YamlConfiguration.loadConfiguration(file);
this.arenaData.isString("world-uuid")
oh my god
I forgot an ! before the condition that checks if it is a string to send the error message
lol
https://paste.md-5.net/ugihuvoham.java
Why is the games not working (ItemStack) but the lobbyselector is
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
I just supplied an image of what I meant by not working./
Well probably sth threw an exception
No exception.
Off the top of my head you set item Meta twice not sure if thatโs the issue
basicially I need differences from lobbyselector and gamesselector
You did it again outside the scope where you got it in the first place but idk
You also complete the second future immediately
noww here is that
At the end
This whole method seems very weird btw, why do you even need a ton of futures
now thats the problom! thank you so much i could not find htat
I need the futures because I use sql
public CompletableFuture<String> getLang(UUID uuid) { return CompletableFuture.supplyAsync(() -> { try ( Connection connection = plugin.connectionPool.getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT language FROM Players.PlayerData WHERE uuid = ?") ) { statement.setString(1, uuid.toString()); ResultSet rs = statement.executeQuery(); if (rs.next()) { return rs.getString("language"); } return ""; } catch (SQLException e) { throw new RuntimeException(e); } });
public CompletableFuture<String> getMessage(UUID playerUUID, String message) { return getLang(playerUUID).thenApply(language -> { if ("en".equals(language)) { return en.getProperty(message); } return "null"; }); }
And why dont you just cache the messages on startup
cache the messages?
Yes
private final Properties en = new Properties();
It seems very weird to do sql requests for everything all the time
Instead of doing it once
oh I didnt explain, I need to get the language of new players too
and the ycan change their language
how do I get them all to a map?
Just a regular hashmap
im not familiar with sql that greatly
When someone joins, load their data and add it to a hashmap
ohh
Then you just use the map from then on
Then you dont need hundred futures everywhere
sql doesnt take alot of ram
Ofc you only load data of online players
each hashmap will contain the paeyr id, the language and the uuid
Then you need 200 million mb RAM
i dont see the math
bruh
imagine if
Loops were instant
and threads don't access data at the exact same time
Would be a dream right
Itd already be great if people would just always use latest instead of 1.16 or 1.8 lol
eh
whats wrong with 1.8? besides secuurity
Its old and the api lacks 80% of features
older versions just lags thegame
honestly yeah 1.8 is so annoying
newer*
Api is VERY limited and Java 8 is pretty annoying compared to newer Java versions
Magic bytes for materials, no pdc, it just sucks
well yeah java 8 sucks
has anyone made an updated 1.8 bukkit api
You can just not use them
Idk get some mods
Or get a better toaster
I have a gen 4 intel and I can still manage a few hundred fps
how do I remove tghis?
Yes, its called 1.20
updated?
Why when I click in the air it doesnt open the menu but when I click the ground it idoes?
@EventHandler(ignoreCancelled = true)
public void onClick(PlayerInteractEvent event) {
if (!(event.getAction() == Action.PHYSICAL)) {
Just fyi you can use jvm flags with clients like you do with the server and tends to increase performance or reduce the laginess
imagine a --nogui with the client lmfao
Client already does that as the gui flag in the jvm is for the jvm console not custom gui stuff
Lol nice. I was curious who it was that did that
I was feeling nice
no im just saying it would be funny if minecraft was a command line and a command line only
You probably could make some kind of intermediary script for this
I also got my finances in order
Paid for my glasses, all my credits in advance and advanced payment for gym
And then you have twitch plays minecraft
This is always good
I'm broke as shit now but I'll fix that next week
we got 3 advanced coders here and no one knows how to fix this?
2 advanced coders** don't include me
I shall include you
And he beat me to it lol
๐ข
Ass pressure
you did not just say that
it's officially commented
Itโs in the javadocs
u got a github in your profile
typical experienced dev
declaration: package: org.bukkit.event.block, enum: Action
doesn't mean shit
w orking on my main github project rn tho
tyvm
Never assume the advanced coders dont know. Not all issues requires the help of such and in most cases you probably could resolve such things yourself if you spent time learning to debug as well as read the api for the methods you are using
doing some annoying stuff
this, if you're asking for help at least make your problem challenging
but the air is not working
sky block plugin?
right click air won't fire if you aren't holding an item
coding skyblock must be hard
ehh you just make classes until you get tired
do you use ai coder completion?
yessir
which one
but I only use it because it speeds up my development time
I'd advise against AI code completion until you know what you're doing
it's not a babysitter, it's a tool
I know what im doing ๐
btw remember the issue ghost and i had
we tried everything for 2 days.
and we just gave up ๐ญ
it just wouldnt want to work so weird
is that why you're asking about a playerinteractevent
Seems interesting
Lol
its just not working the playerinteract event
the air
And failed?
it used nms and they don't know the difference between maven and gradle
Lol
also they're trying to run it on 1.19.4 but the nms modules only goes up to v1_19_R1
if you want a flawless job just pay some fool like 10 bucks ยฏ_(ใ)_/ยฏ
I mean not overly difficult to update the nms for that
But paypal is banned in their country
So you now need to convince a dev to accept crypto to update nms on a plugin that costs 7$ on spigot
Think all that changed was just some nms paths and that was it
someone else did
Between those versions
it's just a setBlockFast
That message wasn' about you
we dont wana change
only compile as is ๐
Yeah takes me maybe 30 seconds
Ah. Then you must not have had something setup correctly then. If you were trying to compile as is. However i tend to have issues with gradle so if that was what was used i personally would probably swapped it over to maven.
Remove the ones you dont need lmao
oh
yeah but that requires effort
That is the beauty of modules
ah wrong channelk
That sucks
sorry if i look like an absolute baboon im not much of a coder 
Pretty much. If they went the modules route it shouldnt be static linked in code as that defeats modules lmao
Over time you will be
Are you going to have varying types of players?
well i used to learn coding but i gave up.
switched to managerial studies
Uhh
I have interfaces that extend SkyblockPlayer
For added context
So I can do a <T extends SkyblockPlayer> but it looks ugly
Then i suppose you could use a generic then if the piece of code is something that is agnostic to the type
Ok so I remove every version except 1.19.2 or 1.19.4
yeah but it's uggo
Lol
Unless
..
I use generic types and expose an extension that hides them
Interesting
Yeah probably could do that via just cast it regardless of what it is
Would still need a method to accept a generic but it wouldnt need to be public
nah
it's only getters
playerjoin and playerquit might just be handled through each platform
Or I might make a wrapper for those events
Wait so I run every single version of buildtools?
why should you?
Because right now I have a "network structure" system where you can specify simple/complex and it ends up being cleaner for communication
Thatโs listed in the repo
Yeh
Alright
And my objective is to multi-platformize that code
Well good luck with that lol
Iโll get back to you when I have every single version ran
like all of this is database code
premium or free?
cool
fair ยฏ_(ใ)_/ยฏ
Does it save and load islands dynamically
yes
how much would it cost?
you could do feature request as custom add ons for 5$
ehh
like if a player want something specific added
Addons will be stuff like
Slime world format? Or something else
auto migration from SSB2
I use my other plugin to do that
so in theory I can support both
right now it just has a world pool and worldedit
how much will the pluygin cost illusion
base plugin is free, modules are 5$
damn
Wonโt that be a bit spicy if the island is a decent size
modules are things like Automatic migration from SSB2, profiles, all the typical askyblock logic like island levels and leaderboards
compression is a thing
And I can make my own serializer if I really care
Fair
Currently I just plan to have everything in one world and let minecraft save it
btw illusion i have a suggestion no other sky block plugin have
island vault ๐ like player vault but for the island
Iโll cross the dynamic saving and loading bridge if I ever need to be able to split it along multiple servers
Isnโt that just a chest
I've had people offer me 40$/hr to work on a private fork
And a lot of networks ask about the project
virtual one
Canโt be that hard to save and load an island to a database
Yeah so that could be a feature in a "TeamExtras" module
Hehโฆ
I mean
There are a few things to consider
Like uhh
Its super easy. I have a mechanism for this somewhere already
giving a solid 30 minutes of leeway before unloading
making sure the island is only loaded on 1 instance
In this case my system supports complete integration between server types
So you can run 2 bungee proxies, 1 velocity proxy, 3 minestom instances and 1 spigot instance
And it'll still like
work
So do you store the island as a schematic
Well maybe I'll need to write a serializer for minestom
At the moment, yes
But I can just write a different serializer
It's all modular
Fair
This is the easiest. My mechanism i had if i remember right used png's
I wonder if I can make an abstract class that has a generic type
Iirc the schematic format has to be continuous, so if you have a lot of air itโs going to waste a lot of space
Current schematic format that is used doesnt have issues with air if its saved with compression
True I forgot about compression
Then you just distribute removing/placing all the blocks over a few ticks so you donโt nuke the server
Hmm not as complicated as I thought
I do this when making some player wrappers
Do you have one island per world or do you group them all into one world
Depends on the config
There are different grid types
One's a world pool
However instead of returning null it throws an exception if its used instead
Another is a single world with a grid
Fair
hm
Ive always wondered the overhead of having a ton of worlds loaded
As long as you disable spawn chunks it's fine
Can do that too
Doesnโt adding the world cause a brief lag spike
Create a pool of them on startup I assume?
Does the api actually have a method to disable spawn chunks
yes
Depends on their size. From my experience with a few thousand by few thousand block void worlds. You can easily run 300 worlds and only consume 1gb of ram for all of them
Ah that doesnโt sound bad at all
Hm
Considering a skyblock island is usually pretty tiny
I was worried the server would die trying to tick 300 worlds
This is why I have a matchmaking system ;)
I can set limits on how many players there are
And what matchmaking criteria I should use
Fair
To evenly fill up servers
I asked 7smile7 for a small review and he found the entire thing overkill
Im just debating the pros and cons of a grid world vs one world per island
In the context of a single server
In a single server context a grid wins
In dynamic loading context one world per island wins
A lot of plugins break because they weren't written for dynamic islands
Like minions plugins that just hardcode the location of each minion
I might make some hacky bullshit for compat reasons but honestly I'll just tell them to do it themselves
Or I design for per world from the start
or I make a 5$ module
per world has a lot more overhead but the end result is a lot more scalable
Hmm
Or you could go for the triple overhead and do a 5 world grid
Lol
I guess Iโll look into the overhead and see if itโs worth the trade off
Oh wait I know
1 server per island
pov: hypixel
nah they use multiple worlds
according to my insider knowledge
ah shit I'll have to rewrite part of my profile system
this took so long to design
ah shit I need to multi-platformize my command engine
probably a solid 30