#help-development
1 messages Β· Page 586 of 1
I added the delay, however this doesn't seem to fix the problem
stop abusing static
plugin is null
I don't even need to look at the code to know there is a static variable in there you are using
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
please use DI
otherwise make sure you init your static variable though that's a slippery slope for maintainability
public static FileConfiguration config = FloorIsLava.plugin.getConfig();
is inherently flawed
I did
public final class FloorIsLava extends JavaPlugin {
public static World VOID_WORLD;
public static World NORMAL_WORLD;
public static FloorIsLava plugin;
public static GamePlotDivider GPD;
public static WorkloadRunnable WLR;
public static ConsoleCommandSender CONSOLE_SENDER = Bukkit.getConsoleSender();
public static FileConfiguration config = FloorIsLava.plugin.getConfig();
@Override
public void onEnable() {
@drowsy helm
I hate maintainability too tbh
if this is possible from a semantic pov:
variable a = 10
function x(y) {
y = 20
}
log(a) //10
x(a)
log(a) //20
then and only then is a language pass by reference, now does java allow this semantic behavior? No it doesnt, therefore its effectively not pass by reference
oh no
lmao
Why?
player is null what are you trying to achieve?
Would you want to have everything in global state and never pass around objects, or values for that part?
More of a design issue it sounds like
No dependency injection isnβt a design issue, your code might have design issues tho
i want to ask from my database if the language equals english any ideas how?
I mentioned mutating objects, not reassigning. While you are correct from strictly cs point of view I still think passing by reference in java is redundant as no copies are sent as in cpp
yeah I agree with u on that end
Yeah you do use some bytes here and there extra
eh its negligible
But given the advantages I donβt mind it
But yeah this i why AtomicFieldUpdater was added to java for instance
we have gigabytes of memory im sure a few bytes wont hurt lol
(As a substitute for AtomicReference)
Still dont have to worry
Yeah fair
Well I doubt you have to resort to data oriented design anytime soon
I mean its fair to think about memory while constructing a project, but I wouldn't sacrifice maintainability and readability, especially in Java just to squeeze out a few less kilabytes of ram usage
^, unless you run into having millions/billions of data transfer objects
hahaha brrrrrrr
I hope not :|
rather not think about that outside of production lol
the player?
garbage collection is for losers just buy more ram
do you know what null is
Sounds like a quote by epsilon gc
when my house is full of trash I buy a new house
why would I not do the same thing with my ram
When my bank account is full of money, just buy a new bank account?
when I max out a credit card I just get a new credit card
what are inventoryMenu.active and inventoryMenu.checkReachable ?
Try get nearby entities around it and then pass the nearest player?
oh I think I cracked the code
i just rob a new person
I think I have entered the mainframe
boys hold my beer
this looks correctly rotated
naaaaaaay it failed
it was already a feature lmao
give me a break
til
so close and yet so far
it's art, your primitive mind wouldn't understand it
ok so I think I am correcting the origin correctly for the Y axis but for some reason when I apply the same math to the other axes it loses its mind
how can i set a players primary group in vault?
yooo
is this what a number one victory royale looks like?
it's only slightly off now
are worlds stored as a world variable in a class or would you store as a string?
UUID
so .getWorld() would return a UUID? I've not looked at the doc for it yet
So guys im trying to ask from my database if the language is like english any ideas how?
getUniqueID but shorter xd
so I've got an event menu with created events and stuff, and when the player creates an event their location gets saved the location gets stored in a JSON file and I tried saving it as a World type but it gave me some weird ass answers so I tried saving it as a string and using getWorld().toString(), no clue what to do here cause it didn't give me any errors so far
for some reason my minecraft wont launch either it's been like 5 minutes and I've launched it 3 times and the game hasn't even popped up yet but it says its still running
any ideas?
Hello everyone. Would you mind taking a look at my code regarding randomTP? It should always bring players to the surface in any world. The problem, is that to find a safe place in the end it takes ages.
Maybe there's something that I can optimize
For height limits, I improvised now, the design needs to be improved but the concept is that. I apologize for the mess
what
ok thanks
it's been so long since I've made a mini game :( and this time I don't have my game engine
this is a sad life
How do i ingore if a player has op?
Becuase i have a command with opens a gui and if you have permission test.1 it sets grass in the menu and if you have permission test.2 it sets stone in the menu
But if i have permission test.1 and i am op it sets stone inthe menu
aaaaaaaaaaaand it's done
completely done
rotations, uv mapping and scaling, display scaling, big models, offset cubes for maximized size, variable texture resolutions, format conversion, resource pack generation, import process
finally
Help
if i had an n-word pass i'd use it on you :)))
cuz wth
gg π
chaos ;-;
me about to do some fucking stupid ass math to switch all my custom bound system into BoundingBoxes only to realize I could just idk. check those numbers maybe
Does #Player.getPing() work correctly?
I'd assume so if it doesn't you should report it
Well, it gives me a different result than the little "MOTD" indicator
getPing is just getting nms EntityPlayer latency, so i assume it works
Anyone?
Register the permission and set it to not be true by default when op
I want so it shows what it normallys shows
Like if you have permission test.1 it shows grass
And if you have permission test.2 it shows stone
and right now if i have permission test.1 and i am op it shows stone becuase i am op
How do i do that?
Where can i set it not to be true by default when op?
commands:
test:
usage: /<command>
That's the commands section
You'd want the permissions section
Google the plugin.yml format
if I listen to InventoryEvent, do i listen to all types of InventoryEvents at once? like inventoryclick, inventorydrag, etc ???
@EventHandler
public void inventoryEvent(InventoryEvent event){}```
like that
I don't find a way to set the footer and header of the tablist in 1.8.8 spigot
Im having some trouble trying to find a way to do this:
I have a folder with custom entities, which i would like to loop through so i can pick one out using a command, i already got the way to loop through the folder but how would i save them and be able to dynamically get one using a command, i also need to give arguments to the constructor
the is no method with Player
Basically encapsulation you get ig
I have that but i cant see how i make it not tu be true by default
Like i want a command that has 1 argument, which is a name, with that name i loop through all my registered entities and gets the one that the name matches with, but i dont know how to give arguments in the constructor of my registered entities, since they all require a Location
You need nms for that
is Bukkit#getPlayer a relatively fast method givent he player is 100% online
anyone knows ?
what
no InventoryEvent is an abstract class it doesn't fire you can listen to it, but it'll never fire
ah bruh makes sense
is there a way for me to do that so i can listen to all the events at once
yeah, but you won't like it :P
There is no spigot api for that in 1.8. You need to use the Minecraft internals directly
tell me π
any guide?
what do you need with InventoryEvent regardless
Just have method that takes InventoryEvent, put your logic there and make listener for every event and pass it into method
Seems stupid, but idk if there is smth better
^
I just told you
why use InventoryEvent then. You should atleast use the abstract InventoryInteractEvent
if you want to refresh something (given a fixed rate of time). you should use a runnable and start it on open end it on close
hm yeah i really don't like that indeed
what are abstract events for then?
uhm less repetition in code
When working with nms you'd generally rely on your own Java skills and read decompiled Java code. 1.8 is old so there's probably a guide for you somewhere.
If you're asking how to get access to nms, simply change spigot-api to spigot in your pom and run BuildTools if you haven't already
imagine having to write the same thing over and over again like 10 times
I'd just kms
what are you trying to do
black magic
For inheritance ig, bukkit event system works a little different then classic observer pattern
there mainly for the events that are implemented, however you could instead implement it yourself I suppose.
That is why you can't listen to abstract one, as all "listenable" events have static list of handlers
not really;
because basically some items are special (they have some nbt)
and i shall then spam setslot packets (animation), the animation is fake, like the items are not really getting replaced
but yeah that needs to happen for any inventory, for any event inventory (because no there isn't a proper way to do that for the itemstack only, in fact in the process of inventory events, itemstack instances are lost, we can't keep track of them this way)
.
why can't you keep track of itemstacks in inventories?
not sure what makes you think they are inherently lost?
yes, if the inventory instance goes away that is true
Whats the packet in protocollib to create a new entitiy
are these player inventories?
testing
or custom ones?
uhm player inventories but also anvil, or anything
then nvm, not wise to just hold inventory instances for all the players π
@wet breach the thing is, you should more consider that i'm animating the inventory rather than actively replace the itemstack
ideally, itemstacks remain unchanged
trust me i'm fully aware of my situation
actually
it's a project i'm on for 2 years lol
you probably could hold the inventory instances
yeah but it becomes tidious + some inventories (even non custom ones) really get lost for some reason
like their reference is dropped & replaced
i don't know why
its just how it is
if the player disconnects or leaves the server the instance for the inventory of player will be lost
it's not the only case
otherwise the player object always holds a valid inventory instance for said player
not sure how it wouldn't
it was my first attempt, i ended up making too many difficulties/exceptions
Hello. I have a question about the Spigot site. May I ask it here?
sure
I have a premium plugin on Polymart. Can I upload a free demo version of this plugin to spigot, and for those who want a full link to polymart?
@wet breach on the subject of inventories;
any clue what inventoryMenu.active & inventoryMenu.checkReachable are for
what does active / reachable mean
you can't link or advertise to outside sources on spigot. You could probably provide a free version that works, but you can't make a demo version that stops working or starts advertising either
Whats the packet in protocollib to create a new entitiy
where did you get those methods from?
I can link to my github. And there is already a link to a third-party resource. So it is possible?
reachable is probably in relation to the views. Since you can have both a player inventory and chest inventory open. and Active is probably for the inventory that is currently opened I would have to look at the source code since its been so long
For example, the popular Eco plugin. If you go to his git, there will be a link to polymart
linking to github is fine, but spigot has strict rules in regards to advertising and what is considered as such
you can't advertise on spigot's site
Could not find artifact org.spigotmc:spigot:jar:1.8.8-R0.1-SNAPSHOT in spigot-repo
ServerPlayer#inventoryMenu
ah
which channel should i go for git bash BuildTools error
yeah than its pretty much what frost says
I meant it
here or #help-server ig that's kinda a either or thing
@wet breach also possible?
active = inventory opened or no ?
active most likely means the one being interacted with or opened. As I said I am not entirely 100% sure
no
the reason their github is linked is because its a resource that is opensource
both are booleans btw
ok. thanks
if its open source, how can it be a premium resource
is there like a license key or something
no
there isn't anything against selling a resource that is open source
that is completely allowed
oraxen is paid and is open source
I know
they have like 2k buys or smth like that
its more or less paying for convience that it is already compiled and to support the devs
but I imagine people just building the plugin on their own
yeah makes sense I guess
just like Aseprite
Not everyone knows how
fair
the player.attack() method uses the players mainhand item right? so if the player was holding a sword for example and i did player.attack(target) it should use the sword to calculate the damage?
I want to say because its in the Server package, that it most likely has to deal with the blocks that have inventories
and those inventories are shared between players
so, a player could have opened one, and then closed it, but it could still be opened for another player
so this doesn't mean that inventory completely closed
since the InventoryHolder is a block and not a player, you need a way to check if that inventory is still active IE opened
@wet breach do you know what the state id (also called revision) is for an inventory view ?
I'm confused what to put in this field of my SetSlot packet.
I can find ServerPlayer.inventoryMenu#containerId, would it be the window id of the currently opened inventory for player?
ServerPlayer.inventoryMenu#stateId and ServerPlayer.inventoryMenu#incrementStateId
which one of those should i use for my packet ?
i see
state id has 2 states
it either changed or it hasn't changed. The id changes if it changed, and then it gets sent to the client if the server made a change
the opposite is true from the client
both send periodically the same state id to infer the inventory has not changed
so in my setslot packets i should ServerPlayer.inventoryMenu#incrementStateId() right ?
to tell them it has updated? (or pretend it has)
Did you run BuildTools like I told you to
anyone knows? a simple yes or no is enough
this would cause the client and server to update the instance
or refresh it
ohhh
so i should put the same state id than before with ServerPlayer.inventoryMenu#stateId
just installed
if nothing has changed right, but the thing is you can only control the server side
the client will attempt to update the id if it made a change
i just want to send SetSlot packets (fake packets)
i mean
client should think the inventory changed
display smth else
then increment the state id if you want the client to thing it changed
but server side it should stay the same
how can I find out in what version some api thing was added?
nvm im dumb
well i mean I would still like to know but I misread something which is why i couldnt find it
pls
also it sais outdated java version
HypixelSkillCore.getInstance().getServer().getPlayer(uuid).setMaxHealth(health);
warning : Method invocation 'setMaxHealth' may produce 'NullPointerException'
am i forced to find another way?
so,
- i send a setslot packet with ServerPlayer.inventoryMenu#incrementStateId()
- client updates the inventory
- client synchronises to server the state id
- server inventory hasn't changed, only client side has
its just a warning
there really isn't. The only way I could see someone coming up with something at this point, would be to have all the Javadoc jars, and then run a program to see the differences between each
Did you tell it to build 1.8.8
im so lost xd
?bt
i know but i think it will break
most likely wont
oh i see, thats too bad
Why is that a gif
since im spamming the client these packets, is it wise to keep incrementing ?
Are you sure that by sending such a setslot packet to client with non-updated state id, then client wouldn't update the content of inventory ?
when you increment state id, the server tracks the id changed, sends that along in the packet. The client then sees that and refreshes. The client after a time then responds back about the state of the inventory and it sends that id you set back to the server. The server acknowledges that the client hasn't made a change. If the client had made a change it would also increment the id and send that to the server. Server would then be tracking the new state id because both client and server needs to be the same
i dont know
hm okay so for animating client side inventories, i'm obliged to keep incrementing
else client won't see that i asked it to change
exactly
okay ty
however, any modifications to the inventory automatically causes server to increment the id too just fyi
you only use that method if you just want the client to do a refresh
but i don't modify the inventory; i just send packets
just letting you know that other things cause it to increment too
@chrome beacon just done like you said
do you know what the definition of insanity is
ah okay i see, ty man!
it's doing the same thing over and over again and getting different results
thats sanity
MagmaGuy invents true random in code
cus insanity is where you do the same thing over and over again with it never changing , but still hoping for a different result if i remember correctly
new ClientboundContainerSetSlotPacket(session.inventoryMenu.containerId, session.inventoryMenu.incrementStateId(), slot, CraftItemStack.asNMSCopy(this.armor))
does that look good enough?
I fluked litteraly every knowledge (except your confirmation on increment thinggie)
i don't know what else to put in the first field of the packet
its supposed to represent window id
(session = some ServerPlayer)
hey , im tryna make like an area damage skill , where when the player does a certain action ( for example right clicks ) the player attacks all players in a certain radius.
is player.attack(target) the correct thing to use? i want it so it calculates damage based on the players mainhand item ( so for example with sword , axe etc )
I have instaled build tools, and all that staff but can fix it to use nms spigot
when I reload the maven got error
Is it done building?
also last question
are raw slots (integer) in bukkit the same than the ones sent in packets for SetSlot ?
Probably. Try it and see
or are they two things apart
alrighty
It's not done yet. Wait for the Spigot 1.8.8 jar
This doesn't look like it's finished running. There should be a completed jar in that folder unless you specified a directory using --output-dir
at my pc isn't doing anything
?
I did the command java -jar BuildTools.jar --rev 1.8.8
then wait and just did that
?paste your log file if it's finished running.
okey 1 sec
now it's correct
thanks all of you
Whats the best way to add custom entities which i can easily loop through to pick one out by name/id
and sorry to be so dump
I cant remember but was there a reason for the playerinteract event to fire for both left_click_air and right_click_air when I right click with an item in the air?
Fellas does this code look okay?
package dev.eternatum.eternatumskills.listeners;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import dev.eternatum.eternatumskills.misc.ItemTypes;
import dev.eternatum.eternatumskills.misc.BlockTypes;
import org.bukkit.configuration.file.FileConfiguration;
public class ArmorStands implements Listener {
private Plugin plugin;
private FileConfiguration config;
public ArmorStands(Plugin plugin) {
this.plugin = plugin;
ItemTypes.setPlugin(plugin);
}
@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
Block block = event.getBlock();
Player player = event.getPlayer();
Material blockType = block.getType();
ItemStack tool = player.getInventory().getItemInMainHand();
// Check if the broken block is a mining block type
if (isMiningBlock(blockType) && ItemTypes.isMiningTool(tool)) {
player.sendMessage("You the correct tool to break this block!");
}
}
private boolean isMiningBlock(Material blockType) {
for (Material miningBlock : BlockTypes.MINING_SKILL_BLOCKS) {
if (miningBlock == blockType) {
return true;
}
}
return false;
}
}
?interactevent
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
im not talking about that
It's not displaying the text saying I don't ahve the correct code
im talking about left and right click
I already ruled out the fact that its the wrong hand
i mean for now I can just ignore right click air actions since it will fire again for teh left click, but still, its kinda weird
nvm it only happens for certain items
like the MAP
wtf
https://ibb.co/FnHq0Q4
is there still this method to read packets, because I do not find in version 1.20 the method to get the channel from the player
Id strongly recommend using a packet api
which e.g. to read only packets
I like ProtocolLib a lot but theres a lot of options
Whats the recommended way to deal with loading 52 placeholders. These are all loaded on the first player join of the startup so it lags the player a lot while its loading in. Im using PlaceholderAPI for placeholders. Any solutions or ideas to help solve this?
How do i add a name and a lore to a item i give to a player?
ItemStack itemStack = new ItemStack(Material.BOW, 1);
p.getInventory().addItem(itemStack);
#getItemMeta#setLore(list of lore here)
but there is not yet for the 1.20
does anyone at least know how to get the channel to test it
#setItemMeta() with the changed lore
Whats the best way to procedurally generate something like a dungeon, like i just want like 5 different random rooms connected straight after each other
ItemStack stack = ...;
ItemMeta meta = stack.getItemMeta();
meta.setLore(string list);
stack.setItemMeta(meta);
like id obv build them first
any ideas?
It dosent work
If i am trying this example it dosent work
meta.setLore("This is the lore");
What do you mean?
How to i reply the meta?
I got this right now:
ItemStack itemStack = new ItemStack(Material.BOW, 1);
ItemMeta meta = itemStack.getItemMeta();
meta.setLore("This is the lore");
itemStack.setItemMeta(meta);
p.getInventory().addItem(itemStack);
p.sendMessage("You got a bow!");
}));
thats a string, not a string list
meta.setLore(List.of("This is the lore"))
I am getting this error
What havent i done right?
Cannot resolve method 'of' in 'List'
what java version
1.8
Wym doesnt work? You dont get the effect? Do you get an error?
Did you register the event?
The item is still not getting a lore or a name
Arrays.asList("This is the lore");
Whats the most efficient way to load 50 placeholders?
What kind of placeholders
can i listen to InventoryInteractEvent? (or is it just an abstract class)
PlaceholderAPI placeholders
Yeah
And what do you mean by load
ok cool thx
For PAPI I just have a big Map<String, Function<Player, String>> but some of the placeholders can be a bit wonky
So for example, InventoryInteractEvent & InventoryClickEvent would fire both at the same time when i do an "inventory click" ?
Its used in holograms and holograms only render when a player is in the world so on the first join after startup it lags the player a lot while its loading
Im not sure of the differences I would check the docs
you can't listen to most of if any of the abstract events
(they are abstract can't be instantiated)
while its gettign it from the db
Oh so you have placeholders for values in the database
Why dosent my bow get a lore?
ItemStack itemStack = new ItemStack(Material.BOW, 1);
ItemMeta meta = itemStack.getItemMeta();
Arrays.asList("This is the lore");
itemStack.setItemMeta(meta);
p.getInventory().addItem(itemStack);
p.sendMessage("You got a bow");
you dont set the lore
but does InventoryInteractEvent fire ?
meta.setLore(Arrays.asList("This is the lore"))
you never did ItemMeta#setLore
lol
you just made an array list
Yes
afaik no
For that you might want to look at CompletableFutures and return a temporary value until the data's available
fuck i hate completable futures
ok thx, if anyone can confrm that would be great so i have 2 ide
futures are great
I might just cache the place holders on startup
I kinda do this at work
Might switch from AtomicReference to something else
like a future.getNow
ngl i dont understand anything past the first line of the constructor
does that work with papi or that a custom placeholder plugin
An abstract base class for events that describe an interaction between a HumanEntity and the contents of an Inventory. meaning it will not be fired
Thanks
Sry but how was it i gave the item a name?
meta.setDisplayName(String)
Procedurally Generated Dungeon
mk, well InventoryEvent isn't an "abstract base class"; yet it doesn't fire
so your definition doesn't stick
ItemStack ingredient = new ItemStack(Material.DIAMOND);
ItemMeta meta = ingredient.getItemMeta();
meta.setDisplayName("Special Diamond");
ingredient.setItemMeta(meta);
ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(myPlugin, "test"), new ItemStack(Material.DIAMOND_PICKAXE));
recipe.shape("X");
recipe.setIngredient('X', new RecipeChoice.ExactChoice(ingredient));
Bukkit.addRecipe(recipe);
this turns a diamond named "Special Diamond" into a pickaxe
Thanks
Do you know how i get the players name?
If i want the lore to be bought by PLAYERS NAME
"bought by" + player.getName()
go ahead and try
go ahead and try, but It won't work
Represents a player related inventory event says nothing about being called
ah okay
granted since this is Open Source there are doccumentation inconsisensies
Thanks
It was because i couldnt use that i had already trierd i needen to use .getDisplayName
id recommending wrapping it in ChatColor.stripColor
so you dont get a coloured name
how can I get the version and set it at the pom.xml, i mean to take plugin.yml version and set it with a variable on the pom.xml
resource filtering
example?
version: ${project.version}
and in pom:
<project>
...
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
yes as I said there are some inconsistencies in the docs, but abstract never fires
kk
as you know you can't instanciate an abstract class
so there'd be no way to fire it
use reflection to make it a normal class
thank you soo much, i new and still learning
Time to do the impossible 
blow up the houses of parliment?

I am afraid that is not possible
Unless you use reflection to register a Javaagent to hotswap the class to make it a normal class
Can this work? There is a slight chance. Should you do it? Absolutely not.
is that ur brother, noah.sh
my brother is 24
what would even be the purpose of trying to make an abstract class not abstract?
maybe the abstract class should not be abstract. But even then you could just create a class that extends it an changes nothing
Also Alex since you are finally here, how was your benchmark?
lmao
How can I allow moss to grow with endstone?
it's running now, with lists of 10, 1_000 and 1_000_000 elements
10 minutes per method so 60 minutes in total
Make a datapack that adds endstone to the #minecraft:moss_replaceable tag
Why dosent this work?
meta.addEnchant(Enchantment.KNOCKBACK, 2);
I am trying to give a stick of knockback 2 to a player
ItemStack itemStack = new ItemStack(Material.STICK, 1);
ItemMeta meta = itemStack.getItemMeta();
meta.setLore(Arrays.asList("This is the lore"));
meta.setDisplayName("Stick");
meta.addEnchant(Enchantment.KNOCKBACK, 2);
itemStack.setItemMeta(meta);
p.getInventory().addItem(itemStack);
Hello, i'm storing in a hashmap whether a player has pvp on or off, how do i save the hashmap when server is reloading? (I think that using .yml files or mysql are too overkill for something like this)
incorrect. PlayerChannelEvent is an abstract class, and you can 100% register a handler for it
Add a third boolean argument set to true
is there no way to tell whether an Abstract will fire other than try and see
sounds good
you can register a listener for any event for which it, or a supertype has a HandlerList declared on it with both getHandlerList methods
Okay cool thanks!
is there a method to do this with a plugin or?
I was told at some point along the line that such events would fire
interesting enough though
?jd-s
so you could technically register and Use PlayerEvent lol
no
because it or a supertype doesn't have a HandlerList declared on it. that's what I said
mmm read that wrong
What is good private vpn server software
does anybody know why this could not be working?
Any1 know anything about the worldedit api?
Trying to load a schematic but i have to create/get an edit session,
this requires a World as parameter but its from com.sk89q.worldedit.world.World;
Stay in #help-server
casting does not work
Use the BukkitAdapter
you have to provide a worldedit world type, not bukkit's one
well i get that but how do i get that
you can read worldedit's wiki, it's all there
.
the bukkitadapter dependency? instead of the other one
It's a part of the WorldEdit bukkit dependency
And it's the class that converts between bukkit loc and worldedit loc
And other things
World worldEditWorld = BukkitAadapter.adapt(p.getWorld());```
would it be smart to use schematics and the worldedit api for procedually generated dungeons?
cus im not gonna lie, jigsaw blocks and structure blocks aint it
Hello, i'm storing in a hashmap whether a player has pvp on or off, how do i save the hashmap when server is reloading? (I think that using .yml files or mysql are too overkill for something like this) (i remember doing it a lot on the past but i can't remember how i used to)
cant u save it in pdc
you can use the player's PDC to directly store it per player
oh thats how thanks, i forgot about persistent data containers
in 1.20.1 there's a new datatype for booleans (on/off)
in older versions, you can just use a byte, 1 = on, 0 = off or sth
okay thanks guys!
np
u trying to convince me to swap form nbt to pdc huh
ofc its better, it avoids use of NMS code as it might be abandoned in the next release
how about being able to change textures using a texture pack with pdc? is that possible?
PDC is stored as nbt
custommodeldata is used for custom textures, usually on mushroom blocks or noteblocks
^
erm yeah I explained it wrong
You use it on items for custom textures tho
custom model data for the inventory icon
i mean more like on any item, like a pickaxe with a specific nbt tag
itemstacks, not blocks
then noteblocks / mushroom blocks with with weird overrides in the resource pack for placed blocks
Sure just set the customModelData of the pickaxe
Again pdc is stored as nbt
that's what custommodeldata is for
back to this question
Thanks
Sure
Or you can use Mojang schematics
Keep in mind they have a bigger file size tho
is there a gradle dependency for spigot 1.20.1?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Uh convert that or use the link
My eclipse cant find it.
repositories {
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
}
dependencies {
compileOnly('org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT')
}```
im thinking of a good way to create a connection point in the schematics tho
where's the spigot repo bro
shh
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
iirc sonatype is for bungeecord and bungeecord-chat
but idk
it's funny how bungee's listener system is much better than spigot's lol
well, have to remember a lot of the code is from CB
bungee has nothing to do with CB code
wait which java version do I need to use the spigot 1.20.1 api?
java 8
17 minimum
the API is java 8
(for some ridiculous reason)
well why bother forcing java 17 if it doesnt use any java 17 features
good question is why haven't we bumped to java 17 yet
it's basically only interfaces
No reason to
why not use java 17 if you can't even run anything withou it
because you might wanna write a 1.8 - 1.20 plugin using java 8 using the api
so preferable java 8?
17 is the best
you Couullddd use 8
you are creating a chicken & egg situation. You can't use newer java features cause you don't compile with it, but you don't have a reason to compile with it cause you don't use features
private interface methods, records, better instanceofs
I'd only use java 17 if my plugin is 1.18+ only
1.17*
1.17 uses java 16
okay my plugin is supposed to be only 1.20. I reckon I should use 17
if it were me, I would bump the java version on the api
now, they are bumping to java 9 on the experimental branch but that version isn't LTS
it makes it easier if you do that as you would avoid some easy problems to encounter
why not go all the way at that point lmfao
java 9
that's my thing, and I said as much on the 2 PRs that bump it
at least bump to the next LTS version, 11
I think I might make a comment as well
they are bumping because they want private methods on interfaces, so technically that only requires java 9, but its so weird to not use an LTS version imo
just go to latest lts and problem solved π
what repositories are necessary for 1.20.1 api? Just to check incase I forgot one
I agree
just the spigot repo
?maven
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
https://ibb.co/Yt5XqCn
Does anyone know how to get the channel from a player from version 1.20, since this method no longer exists. And yes I know that I could use a packet API.
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/pom.xml looks like its 17 now to me
thats the server, the api still compiles with 8
oh
the server requires 17, cause mojang uses it and uses newer features
and what is it called? I searched and searched but found nothing :/
don't know haven't messed with 1.20 NMS yet
Wait, so then why doesn't the api match what the server uses then?
just going to have to search for it lol
no clue
because Java 17 can still run java 8 code
can someone tell me whats wrong? havent touched spigot within the last year. it says that the api is not resolvable
https://paste.md-5.net/ukunukilud.coffeescript
the API doesn't use anything in the later versions that was introduced in those versions
that is a bad reason due to the chicken and egg thing I mentioned earlier
how can it "use" those features if you don't first bump the version
you can't use something you are not using
you just spend extra effort or design poorly things to avoid using newer features
especially bumping to non LTS is not ideal
was that related to me. could you take a look
like private methods in interfaces, or records
a lot of the API doesn't change
not old api, new stuff
that's why they are bumping to 9 in the first place, new api
Ok, even then, a lot of the API doesn't have a use of new Java features
...
oh my
you've really missed the point
you are creating a chicken & egg situation. You can't use newer java features cause you don't compile with it, but you don't have a reason to compile with it cause you don't use features
well apparently it does a little cause they are going to 9. You can't use the package-private record + interface pattern, which is nice for API designs
I haven't missed the point, I understand their reason for wanting to bump to 9, they want to using something in the API but was only introduced as early as Java 9
we can use features in the future where needs if applicable its better to have it than not have it
missing the way better switch statements for any switches that need to be in the API
Ok, but Java 9 is non LTS, they should be using 11 at the bare minimum.
The only time a version bump in Java is necessary is if something being introduced into said api requires it
doesn't make a difference, they are all outdated versions
Java 11 will contain everything in java 9
Love those new switch statements.
11 isn't outdated, its still supported right?
is there any reason that the PDC of a player that I added with my plugin would get cleared (I did not change it in my plugin and no plugins I have would have changed it) ... Randomly, ppl's PDCs are getting wiped for no reason. It happens like randomly every few weeks. Anyone know why this would happen?
Java 17 has support for another 3 years and then extended support for 3 more years after that
I wouldn't say 6 years is close to EOL
No it's not? It doesn't end official support until next year.
extended support maybe
switch(life){
case true -> entity.live();
case false -> entity.revive();
}
11 gets security updates for 3 more years
just real quick
17 gets security updates for 6 years
Extended support for Java 11 dies in 2026
surprisingly it still has active support but only for another 3 months lmao
extended support will still be there but that is only for enterprise
Just use java 19
π
What he said
angers everybody here
lol
me: using java 20
Me using java 9 because i can
another site that makes it easier to see
Is there any reason that the PDC of a player that I added with my plugin would get cleared randomly? (I did not change it in my plugin and no plugins I have would have changed it) ... Randomly, ppl's PDCs are getting wiped for no reason. It happens like randomly every few weeks. Anyone know why this would happen?
is it a saved file?
Ah, it's specific to openJDK
idk what you mean, when I set the PDC i just say player.getpersistentdatacontainer().set(key, the persistent data type, and the value)
Wouldn't that break so many plugins that put player data in their PDC?
i dont create a file to put it in if thats what you mean
is there a size limit for PDC?
dont pdc's get cleared on restart?
no they dont
ok
they stay
just making sure
alright
They are persistent. It's in the name
could be that there is a cap on max chars in a pdc
hmm
Not sure there is one. Probably whatever the limit of the data value they use is. Either that or whatever the server can load.
I wonder if anyone has tested like how much data you actually could store in it before it just dies and resets
we can test this
i dont think so
are you randomly deleting your playerdata folder?
he aint saving
hes using pdc
not a file
pdc is stored in the playerdata file right?
yea
player pdc is stored in the playerdata which is in the playerdata folder
does he have a weird username maybe?
I have a theory if its just one person then
uhm no
alr what is it
If it is just that single person, I can only assume they are using a hacked client to attempt to do something malicious but inadverntently whatever it is causes their Player data to reset or at the very least the PDC
I would see if you are getting some weird packets
hmm
i dont think so
some ppl that are staff are getting reset and some good friends that ik wouldnt hack
oh its more then a single person
you said its only one guy π
do you have SSH access to your server?
what are you saving in the pdc?
yes
I would check for 2 things
all of the stats for a rpg sorta game
alright
not necessarily
when chunks are created space is precreated for them
so they have space reserved already
PDC doesn't do this
?paste
I don't think it's a bad drive. If it only applies to people's player data, that's too coincidental for a random disk failure.
you doing any math, that could result in a integer over Intenger.MAX_VALUE
?
not really, this is how hard drive failures start before it starts propogating
no def not
yea ig
then you excluded disk failure
but its so confusing for me
I used to use a mysql database I just couldnt
so confusing
mysql is fun
nah
i wanna try to make my own file in the server but i aint got any ideas how to do that
yeah definitely would see if your home directory, which is where most people put their servers ran out of space
you could try with a json file
Is it? Hard drives spin, it's purely random chance what gets hit.
correct, but the areas that do get hit are the ones used most often. So there could be a dead sector
USE PASTE
and that dead sector happens to be where the playerdata directory is at
yeah mb forgot
yup my home directory has only like 20% use
and its also possible other directories are affected just unknown
ItemMeta itemmeta = item.getItemMeta();
if (runeName(rune).equals("Jagged")) {
itemmeta.getLore().add("Every " + JaggedNumber() + " hits stuns enemies");
itemmeta.setDisplayName(ChatColor.GOLD + "Jagged Power Sword");
event.getCurrentItem().setItemMeta(itemmeta);
hi for some reason this code changes the name of the item but not the lore
any help would be great
HMMMMM
Hmm, I can see that. Guess I haven't had enough drives die on me yet.
when I use "df -H" cmd on linux
Why doesn't this display a text display? (No errors console)
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.
the aN method just conmverts a datawatcher to a byte
hi so im making queue system at moment and basically in on inevnotry click i get which item is clicked and of that i get to which server should player be sent and all the necessery stuff that has to be provided inside of QueuedPlayer data class which works as constructor of some sort (that is second code starting from line 15) and i have this queue start function in Queue class that essentially just runs task every 2 seconds to check if someone is in queue and then queue is being sorted by priority that we are getting from QueuedPlayer data class/constructor and the first person with biggest/highest priority is being sent to server that we are also getting from constructor etc etc the problem is there is not even single error but for some reason im not sure if queueStart function is even being called (i call it upon on enable of plugin) so im added to queue and everything but seems like im not being sent even though im connected with bungeecord and channel should be settuped properly so any help would be really nice https://paste.md-5.net/podipikipu.cpp
Hoyl shit wall of text
yea got 79G remaining it says
here bro this is what it says
tried to just explain my situation as best i could because there is no much code to see because i keep it very simple
put that on spigot fourms
no fro
My best bet is some plugin that you are using is either removing the data intentionally, or one is doing it accidentally when they modify the player data.
that is the whole output of cmd
there should be more
should I find a different cmd?
no please no that will take most likely too much time for someone to respond and to be honest i dont even know mail or password i used for spigot forum π
interesting, your main partition doesn't point to a hard drive mapping
points to a virtual mapping
well aint noone wanna read that on discord
wonder if that virtual mapping is reporting incorrectly
it shouldnt be a virtual mapping tho
wanna make a thread for this?
if it was mapped to a device, it would say /dev/sda like you see /dev/sda2
How do i check with group a player is in with luckperms?
i hope for prince on white horse called @eternal oxide
alr i made one
Thats how i have it configured on my server
pdc getting randomly wiped thread
Server/DNS/Pi-Hole/Docker
yeah but it is still mapped virtually, so I assume you are using LVM? I think its called that
Ubuntu Server
Im not good enough for debian server yet
its to barebones for me
ubuntu has LVM
no LVM is a software that manages volumes and partitions
typical use of it is for raid setups
If I set an itemstack in a furnace inventory, do I have to update it or something or can I just leave it like that?
I assume you have 2 Hard drives but in a raid configuration?
anyways I think you might have a soft raid setup with 2 hard drives
me?
if the second hard drive starts failing it will cause issues with the first one
no the other person
the one with the problem
or is it you with the problem?
oh it is you
@wet breach My new toy
i got no idea what yall r talkin abt
What plugins do you have installed?
nice
It was only 20β¬
???
pretty nice
I want a switch for that price. :3
@fresh timber yes what I was saying was to you
the WildMiner plugin is mine
i only got 1 hard drive thingie i think
if you are using LVM odds are you have a soft raid setup as that is the typical use of it and quite common for hosters to provide
yea
LVM?
unless you just like using it to manage your volumes
what is lvm
hosts ussually provide a soft raid or an raid 1 or 2 for servers
I host my server on my own computer
i own a server computer that runs vmware which sucks but I have a linux machine in the vmware that runs my mc
anyways, I would take a look at LVM and see if its reporting any issues
i have no idea how to do that xd
I swear I think you guys are lookin in the wrong area. It's probably a simple issue with either his plugin, or one of the ones he has installed. :/
Yea
could also be taht
but it would effect everybody
and not in such random intervals
Does it not just affect players who are online consistently?
its never happened while the player is online
always the player logs off and when they rejoin, their stats are gone
but not every time
its pretty rare
ok, then have ur plugin scan the data before the players leave, and when they join, and have it output a log
Do you have any code that modifies it onJoin and onLeave?
so you can get an idea when it happening
But agian, that would effect not just 1 person per week, it would effect everybody
yea but if i modified it onjoin/leave, it would happen all of the time
yea
it would happen all the time
im a bit confused what you mean here
Not if it's done under certain conditions.
Check the PDC on leave and on join
How do i check which group a player is in, in luckperms?
but what to do with information
@fresh timber show us ur onEnable and onDisable
check lp wiki
alllllrightt
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
MY EYYES
There's nothing how i can use it in a plugin
How about sharing the code that relates the PDC usage?
@timid hedge Do you know how to read?
https://luckperms.net/wiki/Developer-API
might as well give you my plugin
Reading is a lost art. No one fucking does it anymore. π’
alright
ik its a shame
thats why coding is hard
?paste
Cna you send us ur join event?
yea hold on
and leave
ima try to send a lot of the pdc stuff
Why dosent this work?
<dependency>
<groupId>net.luckperms</groupId>
<artifactId>api</artifactId>
<version>5.4</version>
<scope>provided</scope>
</dependency>
do you have the repository
alright @vast ledge and @kind hatch here it is https://paste.md-5.net/ilaxaconed.cs
Holy large class
What? xD
frick
I dont need to
Maven
If you're using Maven, simply add this to the dependencies section of your POM.
<dependencies>
<dependency>
<groupId>net.luckperms</groupId>
<artifactId>api</artifactId>
<version>5.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
wrong format
Did you forget to reload maven
Yep
Thanks
small question, the leather armor pieces are the only ones I can make into any color in the inventory right?
yes
Yep
sadge
I cant see how i check the players group..
i wanna develope a vote plugin with nu votifier. But every version i see isn't as an api available. Any idea why?
Hmm, well now I'm even more confused. Cause your usage of the PDC doesn't even do anything other than setting values.
exactllllyyyy
thats the point
nah
it does other stuff
like display it
and it boosts stuff
Right, but it's non destructive usage
like if your rebirth pdc is set to a certain level it'
what would be a good way to mark spots in a schematic, like in a dungeon schematic for spawnpoints of enemies, do i just add armorstands? So i can get all armorstands and add those locations to a list
wdym?
wdym?
it does stuff
it sets the values then uses them to boost other stats and blocks they mine
that wasnt all the classes that use the PDC btw @kind hatch
How do i check if a player is in two different groups?
I am trying to check if the players group is test1 or test2
if (player.hasPermission(getPlayerGroup().equalsIgnoreCase("Test", "Test2"))){
Why is has permission there
Cause LP uses permissions like group.admin to specify inheritance.
Yeah but equals would return a boolean
2.6.0 wont work
Have you noticed any sort of pattern with the data disappearance? I'm finding it hard to believe that it's truly random.
ehm
Timeframes? Player activity? Only offline players?
Use the latest version 2.7.3
yea i tried to see a pattern but they just seemed to be playing as they normally do
Why does it expect a ;?
p.getWorld().getName().equalsIgnoreCase("A") {
Also wont work. Does it work for you
Ah looks like 2.7.3 failed
Is there a way to find the explosion power of an explosion in the BlockExplosionEvent and the EntityExplosionEvent?
#getYield()?
Doesn't seem to be power
Oh wait, you said power.
Don't think there is currently a way to get the power of an explosion.
Power should always be 5
In that event since only beds and respawn anchors trigger that
As for entity explode yeah there doesn't seem to be any api
declaration: package: org.bukkit.entity, interface: Explosive
Hm check this one
Get the entity from explode event ^
but they don't give the actual code
just the architecture
like i have the interface
but not the impl
you need spigot craftbukkit + nms as a dependency
and then you can check the heirachy of the class with ctrl+h
What interface?
to get the impl class
you don't need craftbukkit as a depend only spigot + nms
spigot covers craftbukkit and everything surrounding it
adding craftbukkit is redundant
package net.minecraft.world.inventory;
import net.minecraft.core.NonNullList;
import net.minecraft.world.item.ItemStack;
public interface ContainerSynchronizer {
void sendInitialData(AbstractContainerMenu handler, NonNullList<ItemStack> stacks, ItemStack cursorStack, int[] properties);
default void sendOffHandSlotChange() {} // Paper
void sendSlotChange(AbstractContainerMenu handler, int slot, ItemStack stack);
void sendCarriedChange(AbstractContainerMenu handler, ItemStack stack);
void sendDataChange(AbstractContainerMenu handler, int property, int value);
}
i need the source of sendCarriedChange
@chrome beacon
(what i sent is all i get from my IDE)
you need to use a java decompiler
like jd-gui
then decompile the minecraft server in your .m2 directory
bruh y'all confuse me
it's the 3rd different answer i get now
so,
if i decompile will it have the proper mojang mappings ?
its just different solutions to the same problem, they are all valid. Though if you use IJ listen to Olivo
One is useless. Two are different ways to do the same thing