#help-development
1 messages ¡ Page 1524 of 1
what is bungee's package name?
see your dependency tree
excludeGroup 'net.md_5.bungee.api.ChatColor.*'
something like this?
async on paper :fingerguns:
How do I do "If plugin x exists and is enable, run this, if not, fallback on that"
PluginManager#getPlugin
thx
can anyone help me with gradle & shadow?
I seem to not be able to exclude files
Is AsyncPlayerPreLoginEvent PlayerJoinEvent but async ?
Oh i see
So i should query the player's data from my DB with AsyncPlayerPreLoginEvent i guess
yeah
Ok thx
cause you still get the UUID and it's async
Yup, thanks !
note that the player won't be able to actually join until all of the event handlers for that event return
so you have up to 30 seconds to do your things, or the client times out
Loaded class blablabla from blablabla which is not a depend, softdepend or loadbefore of this plugin.
how do I remove this error
it's so glaring
you depend on the plugin you load the classes from o.O
so do I add like depend in it?
since Im modifying RedLib here, this the the plugin.yml
name: RedLib
loadbefore: [GameManager]
depend: [GameManager]
softdepend: [GameManager]
load: STARTUP
main: redempt.redlib.RedLib
version: 2.0
author: Redempt
api-version: 1.13
as you can see, I both depend and softdepended my plugin
but still
[18:39:36 WARN]: [RedLib] Loaded class hk.eric.gamemanager.Main from GameManager v0.0.9 which is not a depend, softdepend or loadbefore of this plugin.
Hello! Why does my hologram teleport down for one block when refreshing?
[13:04:33 INFO]: -----------------------------------------------
[13:04:33 INFO]: Hologram:{test;[md.sintez.cloudclans.units.holograms.HologramComponent@7bfd8bda, md.sintez.cloudclans.units.holograms.HologramComponent@9c25d33];Location{world=CraftWorld{name=world},x=-254.00880178851247,y=60.456490660775856,z=-97.16444501360145,pitch=0.0,yaw=0.0}}
[13:04:33 INFO]: -----------------------------------------------
[13:04:33 INFO]: -----------------------------------------------
[13:04:33 INFO]: Hologram:{test;[md.sintez.cloudclans.units.holograms.HologramComponent@37b35d4c, md.sintez.cloudclans.units.holograms.HologramComponent@505aa1e8];Location{world=CraftWorld{name=world},x=-254.00880178851247,y=59.456490660775856,z=-97.16444501360145,pitch=0.0,yaw=0.0}}
[13:04:33 INFO]: -----------------------------------------------
My methods: https://pastebin.com/vXyKyXN2
?paste
ok, sorry: https://paste.md-5.net/ucoqirobaq.md
I suppose your hologram is an armorstand?
It contains many armorstands which represent it's lines
Hologram contains HologramComponents which are armorstands
so hologram is an array of the armorstands
Yes
The whole hologram
For example, here we have two HologramComponents: [md.sintez.cloudclans.units.holograms.HologramComponent@7bfd8bda, md.sintez.cloudclans.units.holograms.HologramComponent@9c25d33]
ok lemme see
Here it is the HologramComponent class, btw: https://paste.md-5.net/xurufopeso.java
The log is printed when the reload is performed
do you see it going down 1 block in game aswell
Bukkit:reload?
No
your own reload?
so youre saying every time you run refreshTopHologram()
the armorstands goes down by 1 block
I think yes
I dont know about spawning, but when you get the location of an entity
it's always at the center of X&Z and their bottom Y
It might just be that offset
you might just need to offset the location up by one every refresh
Even for the async one ?
I suppose youre using bukkit's location class, so you basically just offset it by 1 block upwards like this
hologram.getLocation().setY(hologram.getLocation()+1);
Yes
Yes, you are right, ty
It's not about the thread being blocked
It's because it's PRE login
so bukkit only ALLOWS the player in AFTER all the PreLogin events end
unless you schedule something ig, if you want to do delayed things in prelogin for some reason
what are you trying to do exactly?
Fetch some player data (e.g. a currency) and store it in a HashMap when a player connects
So i can save the HashMap in a DB every 5 minutes or so
Please dont say you use a hashmap with Player as a key
Yeah i know that
so what's your problem?
I just want the database query to append right AFTER the player is logged in
why would you want that
Because during the time of the query, the player isn't connected
yes and?
And it's delay and i don't want it
You have 30 seconds to query
you mean you dont want players to wait before getting in?
yes
I think you didn't think this through
you have 2 options for loading player data from database
- After the player gets in
- Before Player gets in
for option 1, you either let the player join and freeze them and not let them do anything before the query is done, or suffer potential bugs for not loading data in in-time
for option 2. you just let the player wait for a few seconds
now which one sounds better
call your query from teh Async event using a CompletableFuture, then complete the Future after the player logs in
Okay i'll try that, thanks
idk why you would want that tho
I just want to do it
Just like there won't be any use for my plugin, i just code for fun
cause you still have to wait until the query is done until the player in allowed in the server right
If it was me, I'd use the completeableFuture but I'd also make the AsyncPre wait a couple of seconds before progressing on
No, it's just storing it inside a hashmap
querying a database takes time
The player can move freely during that time
up to a few seconds in fact
I know
if you dont care about players moving while the database is being queried and want the query to start after the player's in for fast join time, just use PlayerLoginEvent and use a seperate thread to query the DB
if that's what youre going for
Yeah that's what i needed, thanks
the advantage of using a Completeable future is you can test it in teh Async and wait in there until its finished if you want. Then process the data when login has finished.
So many ways to handle it
He's not tryna be safe here Elgar
I'll take a look at this, thanks !
he just want the players to be in :p
so telling The event to wait would be against the goal innit
yep
I was just asking if there was anyway to do it
.
it doesn't need practical functions
he just wants to make it be exactly what he wants :P
Is there a way to prevent circular dependency while not getting the "plugin is not a depend, softdepend blablabla" thing?
You only soft/depend on the plugins you require. None of their dependencies
I wonder why most repositories are necessarily use version suffix -SNAPSHOT instead of just without it?
because most repos in the bukkit ecosystem follow a rather incremental development style
the only version that would really be worthy of not being a SNAPSHOT would be the last version of each mc version
e.g. the last spigot version for mc 1.15.2
yea because why go through that effort
Hey guys, i'm trying to create a "headless" swing interface and can't find any doc on it someone know ? (i know there is any link to this channel subject but i need help)
first google result ÂŻ_(ă)_/ÂŻ
â¤ď¸
how do I know if an attack is crit or not
I can't find it in the protocol or EntityDamageByEntityEvent
Hello, I have following problem with protocol lib:
com.comphenix.protocol.reflect.FieldAccessException: No field with type net.minecraft.EnumChatFormat exists in class PacketPlayOutScoreboardTeam
I just wanted to make a fake scoreboard team with packets on my 1.17 server, what am I doing wrong?
There are some protocollib at the moment in my experience
im not sure that it has been fully updated
However, that error looks like you are trying to write to a field that actually isn't in that packet
I am not familiar with it - you will have to see if some1 else knows or google it
I tried to google but I still haven't solved it
How to move a location relative to its rotation?
Does anyone know, how to cast PathfinderMob to Villager? (NMS)
net minecraft server methods
yes
No
yes
IntelliJ is the biggest cry baby
is there any way to fake a block place event
PluginManager#callEvent
i... know that
What's the best way to make something run every x amount of seconds?
BukkitRunnable
so basically, is there even a way to construct the event
and yes I know there is a constructor
but without having the block placed?
Is this server like dead?
or is using build permission plugin API's the best/only way to test if a player can build a certain type of block at a certain location
I remember there were about 5 messages per second
Calling the event with that method doesnât place the block
ofc, i know that
here is the constructor:
public BlockPlaceEvent(Block placedBlock, BlockState replacedBlockState, Block placedAgainst, ItemStack itemInHand, Player thePlayer, boolean canBuild, EquipmentSlot hand)
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = (Player) sender;
ArmorStand stand = (ArmorStand) player.getWorld().spawnEntity(player.getLocation().add(0, -2, 0), EntityType.ARMOR_STAND);
stand.setVisible(false);
stand.setGravity(false);
stand.setInvulnerable(true);
stand.setCustomNameVisible(true);
stand.setCustomName(ChatColor.RED + "A hologram.");
nodes.add(stand);
@EventHandler
public void onEntityInteract(PlayerInteractAtEntityEvent event) {
Player player = event.getPlayer();
if (nodes.contains(event.getRightClicked())) {
player.sendMessage("test");```
nothing happens when i click on it
did you register the listener
yeah
there are certain stuff that cannot be faked without having to place the block, like the block itself
public List<ArmorStand> nodes = new ArrayList<>();
HoloCommand holoclass = new HoloCommand();
List<ArmorStand> nodes = holoclass.nodes; is what nodes is btw
use a set
and yes use uuids
the bukkit entity wrappers are not identity elements
i'm not sure if they implement equals properly, either
As NNY stated: Use a Set for this. And creating a new reference to the List seems obsolete as you already have an instance of HoloCommand
Also: If you create a new HoloCommand() then the List inside this instance is not the same as in other instances of HoloCommand.
Each instance has its own "nodes" List.
So you need to access the List of the instance you actually register in your main class.
You should only have one single instance of HoloCommand. This instance should be registered and used in other classes to access its properties like "nodes".
because it's not part of spigot-api
Run build tools?
iirc normally that fixes stuff like that for me
Itâs a CraftBukkit Class
All your imports are broken, clear/invalidate your cache and restart your IDE
what do I import?
Run BuildTools and change the artifact-id from spigot-api to just spigot
Ohhh - I didnât notice ur artifact id, yeah I normally just depend on spigot
And probably also update your version.
I'm coding an event for a server running 1.16.4
ÂŻ_(ă)_/ÂŻ
If you didnât want 1.17 at least go latest b4 that
Iâm assuming it ainât ur server then
some friends of mine asked me to do it and they were running 1.16.4 so whatever
Fair enough
they want me to make a custom tab menu which is annoying cause that means packets x_x
Packets and I have a love hate relationship
lmao
They love to work themselves into my project
And I hate them
means that you have to do reflection or interface for cross version ):
Nah protocollib is where I go
Although - anyone know wtf is up with it. For some reason I always get errors on load even though it says it supports 1.17
If I create my own paginated menu I have a problem with calculating the pages: I always get 1 page too less or 1 page too much. What I do: <max items> / <possible items a page> and check if the currentPage (+ 1 if you click on next) is bigger than this
how can I customise the tab menu beyond just headers and footers?
I would like to display in the tab menu 6 teams with the players of each team underneath the name of the team they're in
and also change the colour of that player on the tab menu to the colour of the team they're in
you would probably have to do something with minecraftâs built in teams feature and edit the tab list for whatever team theyâre on
how do I do that last part
in the event, iterate through the world players and check what team theyâre on, and edit the name in tab as necessary
which event?
isnât the way you set the header and footer on the tab menu is through the tablist update event or something?
I think you just use a scheduled task for that and a send a packet
however that's for the header and footer
I'm trying to figure out how you actually edit a name
or stick something in the tab menu which isn't a player
so then I can have something which looks like this: ```
Red
player1
player2
Blue
player3
player4
that would be a bit confusing, canât you just edit the list name using Player#setPlayerListName(string)
and then like have a colored tag for whatever team theyâre on?
didn't know you could do that
I'd still like to add them underneath a corresponding team title though
I'd also like to store a score next to each team
can I create a fake player?
absolutely, just make an add_player packet and fill out the necessary data
iâm not gonna over it here because itâs very involved
is there a tutorial you could link me to?
this requires an EntityPlayer but I dunno how u make one
you need all this stuff
ty
How can i check if a uuid is in my mysql database?
currently it contains the uuid and its coins
is there a place where i can get some dev to hire for free maybe in future with payment?
select * from somewhere where uuid=?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
if the set is bigger than 0 then it's in there
thanks
well it worked
thanks
Is there a way I can get rid of the connection bars and skin?
?paste
nope
will this do it https://paste.md-5.net/mokidigoci.java
hopefully. havent coded in a while
sure, but you might want to use a prepared statement even if you can trust the input string to build a habit
Nope can only alter them
pfew. 1 time smth works like i want it to
o. Is there a way I can add stuff without a fake player then?
you can always set the skin to a picture of something with a similar colour to the background
Can only modify header and footer the way you want
and set the ping to something high to distinguish it's not a player
I see
I'm just trying to find an image of the hypixel skyblock tab menu
huh, looking at this now there are the connection things and they do have those skins
and I guess they just add a bunch of fake players for the blanks
and set the player tab display name to just blank
I just need to figure out how to add a skin to the fake players now
how do you change nametags with packets
i cant find an api that has updated to 1.17
in 1.13 type of custom name changed to OptChat from String.
https://wiki.vg/Entity_metadata#Entity_Metadata_Format
How can I change custom name of my...
no for players
yea above their head
I actually had a YTber on my Minions test server once. And he bought the plugin lol.
lol
I need to be able to reset a world in my minigame after the game is played? Anyone know how I can reset it from a template? Is there another plugin to do this in 1.16
Do anybody know how i can get packets that the client sends to the server?
ok i have quite a problem im trying to detect armor equip using right click when outside of inv but its just not working at all
here is just a reference screenshot but like doesnt work at all
yes very much information
what should i do instead then
PDC
whats pdc dude
?pdc
PersistentDataContainer
don't worry, I use even more cursed stuff soon â˘ď¸
more cursed dan this?
Hey guys, have anyone of you an idea to cancel a bot when it is not on water (in 1.16).
My first thought was I could yous the VehicleMoveEvent and make some checks like this:
var vehicle = moveEvent.getVehicle();
if (vehicle.getType() == EntityType.BOAT && vehicle.isOnGround() && !vehicle.isEmpty() && vehicle.getPassengers().get(0) instanceof Player) {
//Some Stuff here
}
and cancel the event, but the event is not cancel able so i tried to set the velocity form the vehicle to a Vektor of 0, but this dosen't work.
So on my second thought I teleport the vehicle to the point where the vent was called(moveEvent.getFrom()) and this dosen't work ether.
I have no ideas left so help me - I don't want to kick the player out of the vehicle or destroy it
can an item have multiple pdc tags?
infinite amount..
ok good
Modifying the ItemStack class via ASM to implement caching
it should call collision event while on the ground
set velocity there
and how would i check for lore the right way if there is any
You can do this on bukkit?
Nah, I just wrote a seperate mod loader that sits on top of bukkit
Question... how are you guys serialising ItemStack[] arrays?
ItemStack.serialize() is fine, but what to do for ItemStack[]?
Wound it not be easier to just make your own cache that handles itemstacks
Iterate the array and combine the output perhaps?
i just loop through each then set the item using the slot?
Or just use ArrayList
Yea, it needs serialising to be put into a database đ
why would a item be..
so it must be a string, ideally using Gson().toJson()
?pdc when smh đ
The problem comes about when retrieving it from the database and converting it from a base64 to an ItemStack... so serializing may be better
Custom command successfully added.
?pdc
finally
Oh
@quaint mantle i see u answered my call
Good bot
for justive
I need to be able to reset a world in my minigame to a template after the game is played? Anyone know how I can reset it from a template? Is there another plugin to do this in 1.16
(he's saying that your question belongs in #help-server)
you have multiple ways
if you code it, you can usually just turn off auto save and unload the world
either completly use a copy of the world or a part of it
can you turn off autosave for a specific world?
because there are other worlds that need to be autosaved
if you want multiple same worlds,make a copy of the one you need,make sure the folder name is stored,then call bukkit newworld for that name
it should love a brand new world
calling bukkit.unloadworld has a 2nd paramter
to save or not
declaration: package: org.bukkit, class: Bukkit
There is also World#setAutoSave(boolean)
That doesn't change anything
no dude
put this into your server start.bat file
so that you dont have to wait 20secs
lmao
how do I fill an area with all air (there is too much to fill for the /fill command)
world edit
I'm having in error with my yml file on a plugin.
but they perpetuate across servers resets
in a plugin
I'm aware that there is the REMOVE_PLAYER enum option but I don't know if there's a way I can just removed all players or reset the tab list to the default?
I can't do that in my plugin code?
Worledit only works when the player uses the axe and //pos1, etc.?
Are you doing it in a command?
If your doing a command, use arg[0] and arg[1] to get two coordinates from the player
Google replace block
I don't want to use worldedit though
...
l
its too big for a fill command
Take small chunks then
ok ill try this thanks đ
np
đ
I'm having in error with my yml file on a plugin.
This is what I get back
main: me.amazingfalcon720.rblcandc1.RandomBlockLook
name: RandomBlockLook (1.17)
version: 1.0
description: Edited version of GeorgeNotFound's to include the newer blocks added since 1.14!
alright then
The name doesn't change anything anyway
yeah nothing changed
I have problem with auto increment
How I delete a five records I have holes in id 4, 5, 7 how I can fix this? I use SQLite
Where is the plugin.yml located?
Here
when i add an AttributeModifier to say for example a sword, it removes all other ones, how can i fix this? i add them like so: ItemMeta meta = is.getItemMeta(); attributes.forEach((k,v) ->{ meta.addAttributeModifier(v, k); });
aight thx
should work anyways
in what line is the error
I made the same error before
moving it out of src fixed it
weird
Im guessing it worked for falcon because he hasn't said anythign else
Anyone know how can i sort nametag prefixs for playerlist in onJoin Listener?
you have to conver tit to chunk cords
you mean scoreboard teams?
Yes
worked for me when i used to do my java plugins in a normal java project
Hmmmm - Maybe
I want to order it so for example owner will be first admin second something like that
Depends on where it searches to compile I guess
you have an identifier for your team. add a 0000 to the beginning just like 0000owner 0001admin 0002developer
so it will be the first
public void onPlayerWalk(final PlayerMoveEvent event) {
Player player = event.getPlayer();
Block block = player.getWorld().getBlockAt(player.getLocation().getBlockX(), player.getLocation().getBlockY() - 1, player.getLocation().getBlockZ());
if (player.getInventory().getBoots().getType().equals(Material.LEATHER_BOOTS)) {
System.out.println("With boots");
block.setType(block.getType());
}
else {
System.out.println("Without boots");
block.setType(Material.SNOW_BLOCK);
}
}``` I have this piece of code which makes the block beneath the player turn into snow when he wears leather boots. For some reason, it doesn't work.
Compare enums with ==
What do you mean?
They can see 0000 in tab?
it doesnt
Like, player.getInventory().getBoots().getType() == Material.LEATHER_BOOTS?
you are setting the block type to the block type block.setType(block.getType());
Ok.
Yeah
just if he dont wear leather boots it will be snow
why does adding an AttributeModifier reset all other modifiers?
How do I fix it then? Should I just make a message?
no if you don't add it to the prefix or suffix
@tulip pike
I saw it.
thats your solution
I don't know what you mean
It's the line I made.
you are saying the type of the block is equal to the type of the block. If the block's type is grass then you are setting it's type to grass
instead you must set it to snow
yeah. and its wrong. now if you wear leather boots the block type wont change
just if you don't wear leather boots.
..?
Itâs the wrong way around, when they wear boots you do nothing, it they donât you set to snow
Yes.
System.out.println("With boots");
}
else {
System.out.println("Without boots");
block.setType(Material.SNOW_BLOCK);
}``` I just typed this.
Oh. Well, why don't do that in reverse? lol.
@hybrid spoke Here is the code:
https://paste.md-5.net/uyuwatigab.java
Exactly
this is not how it works
What is wrong?
i would suggest you to look at a tablist/ranks tutorial
java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because the return value of "org.bukkit.inventory.PlayerInventory.getBoots()" is null This is what I get.
I'm just only set the nametags?
yeah but you want to sort it with ranks n stuff and thats the task of a scoreboard
But you didn't answer how can i do that
i actually did
several times
Send the tutorial link
check if the boots of the player are null
Just Fucking Google It helps you help others to use Google and search on their own!
if (player.getInventory().getBoots().getType() == null) { @hybrid spoke?
without the .getType()
Ok.
you dont want to check if the type of the boots is null, you want to check if the boots is null. if you check if the type is null but the boots are null, you will get again a NPE
One more thing, how do I check if a player is above one block or two?
if (player.getLocation().getBlockY() == +1) {?
hello spigoteers, i am trying to make a placeholder replacer for bungee commands, and i dont seem to be able to get the command to run
https://paste.bristermitten.me/opovamokyh.cs
this is the code i have at the moment, the event works and the newMessage is what i expect it to be, but dispatchCommand returns false and the user gets no output. what am i doing wrong here?
also worth mentioning that i've tried chat("/" + newMessage) and dispatchCommand("/" + newMessage)
Can someone help me with my problem?
You want to check if the players location is 2 blocks above another location?
That's simple math
since you want to check if the player is ABOVE a block, you will have to go down with the Y
Can you give me an example?
playerLocationY - blockLocationY <= 2
don't you already have that by yourself? player.getLocation().getBlockY() - 1
if (player.getLocation().getBlockY() <= 1) { like that?
otherwise use the blockface
If you think about it, what will this result in?
It checks if the Y coordinate of the player is 1 or less
=> will only be true if the player is inside bedrock
Well what would that check?
If the player is above a block?
i think you can just execute bungeecord commands with dispatchCommand
every other command have to be send via jedis or PMC to the server the player is at
< and > will check if the player's y is less or greater than 1
Yes.
50/100 points to the gaaaaaaaaamer!!!!! it will also return true if the player is inside a block
Why so rude man?
because you are too lazy to just google it
I've searched. That doesn't mean you have to be rude.
this channel is for ⨠Serious Spigot and BungeeCord programming/development help â¨
Hey man, I don't remember asking for you being a b****.
You helped me once, sir.
okay - scroll a bit upwards and proof yourself wrong
Still got help didnât you?
Yeah, for only 1 thing.
what's that method for then?
bungeecord commands
Wait what
That's what I'm doing
or trying to do
Not a spigot command
litebans bungee
bungee commands canoot be executed on the spigot end
This isn't on the spigot end
It's a bungee plugin
Trying to intercept and change bungee commands
does the player has the permission to execute that commands?
did you try it with other commands?
Pretty sure I have permission as it was working fine before I added the listener
and are you sure that it is a valid command?
banPattern.replace(newMessage) yeah but aren't you replacing it?
anyone know of something that I could use with a discord bot so that I can create a channel that displays how much downloads i have on all of my plugins?
Yeah, but I'm pretty sure banMessage is printing the same output - it doesn't actually contain anything that would match the regex
I can't test atm as I'm not at pc but I'll see if I can do a little more debugging soon
Hi there, does anyone know how to spawn multiple players in copies of the same world ? (Trying to make an arena game)
either you r hiding the players from different arenas for each other and cancel the drops or you are having multiple worlds or at least 1 world with multiple copies
ah wait i think i understood you wrong
My idea was to have a single world, thats get copied for each arena game, and saves are not written to disk
And then teleport the players of the game in to their specific world
Like bedwars, arena and so on do
if its the same world with the same coordinates you could just teleport them to the same coordinates every time
But how i can make those play at the same in 1v1 modes ?
That's why i was thinking i needed multiple copies of the world
Running in parallel
i would do it like creating a copy of the world and setting the spawn for each team 1 time so they always get teleported to the same coords
maybe there is another more efficient way - i am not a mingames maker
you could look at open source 1o1 plugins and see how they did it
Do you know any good plugins that i could look at ?
Could someone here possibly help me write a script to do two specific tasks?
Because I have absolutely no idea how to do it
https://github.com/Enzias/EasyDuels maybe this one đ¤
Thank you very much!
this is looking for development/programming help, not scripting. would suggest you to ask your question here https://www.spigotmc.org/forums/skript.90/. otherwise you have to be lucky that any1 here knows the how
Ahhh okay, thank you
I'm looking at it, and it seems like this is single arena mode with only 1 match a time
And the other do get queued
how can i clear 1 item to an inventory ? if i do player.getInventory().remove(Material.GUNPOWDER); that remove all gunpowder but i will just remove 1 gunpowder
Create an itemstack with 1 as the amount
and you might have to use removeItem
ok thank you @chrome beacon
Well pl would be null
loop through the contents, compare the itemstacks and reduce the amount
im back now - if i input /ban, then /ban is what gets printed
idk, sorry^^ don't have much to do with such plugins
what does your ban command look like?
it's litebans
21:06:19 [INFO] /ban blah blah help me
21:06:19 [INFO] false```
the command itself shouldn't really matter - it gets "ignored" whatever i print
oh wait
is this the fix?
hold up
maybe its returning false because the player is not existent or smth
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Read these ^^
because the original /ban gets cancelled, then the event handler gets triggered by the new /ban, which replaces it again, and again, etc
bruh
Wdym Olivo that would work 100%
bruh
10/10 solution
is the bungee event api thread safe?
but if you are trapped in recursion, how does it print the result just 1 time?
probably not
No
ugh why does this have to be so complicated
let me attach a debugger and see where dispatchCommand is failing
i think we are just overlooking something realllllyyy easy
What are you doing?
Hey guys, can you please give me avenue as how to make chunk claiming system ? Like just which methods should I look into ?
not talking about anti-grief
#getChunk 
just chunk claim
replacing regexes in commands basically (eg /ban player smth should be replaced with /ban player really long message here)
i hope so
ah ok lol thanks ! but how about linking chunks to group or player for example ?
So make a method to trigger the claiming and then have a Map of the player to the chunks that they own
oh interesting, apparently i don't have permission suddenly đ¤
đno make fun of i, me begginer dont bulli međ
Hey, sorry if that's a newbie question, but:
why can't I instantiate inventories?
Inventory inv = new Inventory(); // error <- Cannot instantiate the type Inventory
it's an abstract type
and heavily dependent on the underlying server implementation anyway
So like Map<UUID,Set<Chunk>> where chunk is just the chunk cord int pairs
so exactly what i said at first
ok, thanks
There is a method under Bukkit
Bukkit#createInventory
^^
Just saw that on the wiki
Hmm Im not familiar with those but I will look into them and figured it out, thanks man !
yeah it's really weird though, i definitely have permission if i run the command normally (i.e disabling my command replacer plugin)
Sure - good luck
so... maybe it's not checking for permissions with luckperms or something
maybe you have permissions on the spigot server but not on the bungee
so your first /ban will get executed at the spigot and your second on the bungee
im using luckperms bungee so i dont think so
the spigot server doesn't even have any plugins on it
if ( !command.hasPermission( sender ) )
{
if ( tabResults == null )
{
sender.sendMessage( ( command.getPermissionMessage() == null ) ? proxy.getTranslation( "no_permission" ) : command.getPermissionMessage() );
}
return true;
}
``` when i ran a debugger, this if statement was true for whatever reason
hmm i am not that into bungee. but anyways, you got the solution
yeah although im not sure what the fix is
i should have permission
i do have permission
Okay so I came up with a join plugin. But I think something on the server if blocking me from sending links in chat, is there something with spigot that blocks the ability to send links in the game chat?
just if any plugin detects them and blocks them
see other links like plugin updates work, but this link I have set up with a welcome message plugin for dynmap just wont work
define not work
welp... i figured it out
dispatchCommand doesn't like the command starting with an /
god i wish things would give more helpful error messages
im trying something
frick you it worked :D
doubt
why
If it did work I donât recommend
- you shouldn't need to cast null in the first place
- null bad
hmm confused
I use auto increment in database but how I delete a five records a have holes in id 3, 4, 5, 7 etc. How I can fix this?
Could either save the number of removed and use them as the next save increment, or loop through the size of the numbers and find the first missing number.
or be extremely expensive and move them all down by id-1
i would recommend just leaving it as it is
a lot easier on a technical level, and it also shows that things have been deleted
but how I use this as foreign key?
yea I know but I must fix this how I don't want to have some problems later
or loop through the size of the numbers and find the first missing number. would recommend this
đĽś
but you should cache it somewhere so you don't call the database every time
this is quite a specific case
I prefer realy fix this
generally it doesn't matter if your autoincrement key is sparse
it's mostly used as an id, the point is that there is only one of each value
whether every value is present or whether the range is continuous is not usually a concern
and if it is, you run into this issue
therefore, design your system in such a way that it is not a concern
realy I prefer fix this
i can't see replies
^^^^^^
unless it's actually causing a bug (which probably indicates your code is bad), there's not really any need to spend the time making sure it's continuous
it isn't "broken", you can't fix it
^
is continuous 1 to more than 100
what
and where is something to fix?
you can just loop through your table
you wont need the id for that
a no
ok
intresting idea but I need id without holes to other
then your code is shit
and you should fix it
so that it doesn't require "id without holes"
but just "id"
based
the id should just be the identifier and nothing you have to put in order
id is also internal so noone will ever see and judge you that its not in order
I can tell you why I want to put it in order
it is in order
the order is just not continuous
and that should be fine
as requiring it to be continuous involves going through difficult and computationally expensive hoops
yeah this is gonna scale terribly
hmm oke but I only want do this manual
no in source
you're a 1.8 user aren't you
lmao
no xD
but I see you don't like 1.8 spigot
can someone help?
i don't like any spigot
you on group SpigotMC
your server is overloaded
?
Also that's Paper
your entity counts are fucked
lower water ambient specifically
someone has a large chicken farm
you have 90 active mob spawners
lower your spawn interval
don't run a server on fucking windows 10
lmao
address these issues and take a longer timings report
a no message to me xD
I got this error when trying to load in another plugin
You can't use () in the plugin name
ah thx
Also not sure if you can use .
you should move the 1.17 part to the version string
kk thx
pretty sure plugin names are alphanumeric
hey its you
maybe
oh ok
đ
Im trying to create a holograms leaderboards
same thing
Loc isn't a list
oh sorry would this work then?
Yes
thank you
đ đ
would this work?
Try it and see?
Hello, how can I select all blocks of a chunk ?
cuz each update everyone using it has to update the config.yml manually
hi, im having a problem with someone using my plugin, they sent me this error https://hastebin.com/bazagopuzo.yaml and im pretty sure its not a problem caused by my plugin, but im not sure what it is and i have no fix for it
it points to PermsManager.java:25
its 6 lines below lol i misclicked
Bukkit.getServer().getServicesManager().getRegistration(Permission.class);
might be a corrupted jar? not sure how that would throw java.lang.IllegalStateExceptionzip file closed
i already told him to redownload, gave him a fresly compiled jar that worked for me
we are using same java version, same spigot version
what about vault
Does he have some other plugins accessing yours too early and causing it to initialize?
i think its latest since it shows the no new version line on the small log he sent
We need to see a startup log (latest.log) with the error in it
ill tell him rn
it looks like the error happened during a restart
Hello, is it good to save Lists in the MySQL database using serialization or is there a better way? I heard that it is not a good way
if you want to keep it in a table it's perfectly fine
no, it's not a good idea
depends what the list contains really
how do i make it add missing values in the config.yml
and not affect existing ones
cuz each update everyone using it has to update the config.yml manually
hey guys can I ask you a beginner question?
not sure what your structure looks like but you might want to consider having a third table which with the sole purpose of one thing to another thing (two foreign keys)
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
you can compare what values are defined vs what aren't and rewrite the config with the missing keys define but imo I don't see the point in writing something like that since it's too much effort to maintain
does this work for a config.yml that is in the /resources folder
why not
does getConfig() get the one in the resources folder
or the one in the plugin folder
read the config file that is packaged with your jar, and compare what keys are defined there vs the config file in the plugins folder
getConfig gets the one that is loaded in memory, which is the one in the plugin folder
https://hastebin.com/icubogevef.yaml here is what he sent me
public void updateConfig() {
try {
if (new File(getDataFolder() + "/config.yml").exists()) {
boolean changesMade = false;
YamlConfiguration tmp = new YamlConfiguration();
tmp.load(getDataFolder() + "/config.yml");
for (String str : getConfig().getKeys(true)) {
if (!tmp.getKeys(true).contains(str)) {
tmp.set(str, getConfig().get(str));
changesMade = true;
}
}
if (changesMade)
tmp.save(getDataFolder() + "/config.yml");
}
} catch (IOException | InvalidConfigurationException e) {
e.printStackTrace();
}
}```
this doesnt work
though there is also some funky stuff where you can optionally add the defaults and whatnot (it's slightly confusing what bukkit really does to it)
but i got it off someone having the same issue as me
use getresource in conjunction with the reader constructor of yamlconfiguration to read the one in your jar
really though, use a proper config library or framework
bukkit's is shit and lackluster
okay, so I want to use spiggot to place a double chest. At the moment I am working on connecting each chest. Rn I can place chest but connected to double chest.
Location blockLocation = new Location(deathboxWorld, xLoop, yLoop, zLoop);
Location blockLocation2 = new Location(deathboxWorld, xLoop+1, yLoop, zLoop);
Block block = blockLocation.getBlock();
Block block2 = blockLocation2.getBlock();
block.setType( Material.CHEST );
block2.setType( Material.CHEST );
Chest chestBlockState1 = (Chest) block.getBlockData();
chestBlockState1.setType( Type.LEFT ); //thats my issue. I can not set the type to left.
block.setBlockData(chestBlockState1, true);
I assume that I need to set the Block state somehow now. But I dont know how to do.
state.update
your plugin is being disabled (line 763) but is continuing with the startup procedure, that probably has something to do with it
For example, it contains UUIDs of some players
a UUID list is fine to put in SQL
What is the other way of doing it?
are you reffering to my question?
UUID.toString()
oh i didnt actually see that thanks a lot
no he just threw it in the room
So you mean to use serialization or what?
you don;t need to use serialization to save UUIDs
ofc he meant you @astral burrow
Hey, for some reason this code isnt working properly on my dedicatedmc server but it works fine on localhost
File data = new File(game.getMain().getServer().getWorldContainer(), map.getWorldName());
this.directory = new File(game.getMain().getServer().getWorldContainer(), "arena-" + game.getId());
if (directory.exists()) {
Bukkit.unloadWorld("arena-" + game.getId(), false);
try {
FileUtils.deleteDirectory(directory);
} catch (IOException e) {
e.printStackTrace();
}
}
try {
FileUtils.copyDirectory(data, directory, pathname -> !pathname.getName().equals("uid.dat"));
} catch (IOException e) {
e.printStackTrace();
}
this.world = Bukkit.createWorld(new WorldCreator("arena-" + game.getId()));
well
You either convert it to a string or you use getUpper and getLower on the UUID and store the longs
uuid.tostring is technically serialization
kinda
though, some database schemes allow you to use a UUID type directly
help :/
even if not, i'm pretty sure the uuid can be converted into a long
for efficient storage
Yeah, I know about this way, I wondered if it is a good way to do
Its as good as any.
Ok, thank you
have a third table acting as a bridge to link it together
it would look something like this (both are foreign keys):
list id | uuid
--------|-------------
1 | uuid1
1 | uuid2
1 | uuid3
....
serializing an entire list is and storing that is not generally a good idea, this might be something you want to research more
does getConfig().getKeys() return comments and blank lines too?
nope
is there a method that does that
no
nope
public void updateConfig() {
try {
boolean changesMade = false;
FileConfiguration config = getConfig();
YamlConfiguration tmp = new YamlConfiguration();
tmp.load(getResource("config.yml"));
for (String str : tmp.getKeys(true)) {
if (!config.getKeys(true).contains(str)) {
config.set(str, tmp.get(str));
changesMade = true;
}
}
if (changesMade) config.save(getDataFolder() + "/config.yml");
} catch (IOException | InvalidConfigurationException e) {
e.printStackTrace();
}
}```
it works
but the blank lines dont appear
and nor do the comments
because bukkit strips those except the header comments
i guess? but then you'll have like a 100 line comment at the start of the file which is completely seperate from the keys they're describing
like i said
use a proper config api or framework
bukkit's is shit and lackluster
not really a config api nor framework
would this work
https://github.com/SparklingComet/ConfigAPI
Excuse me, I am trying to understand and just this line felt thrown in the room without context for me.
can you send me a good one
So, for example, if I have a clan plugin and I want to store some clan's members in MySQL database, I have to create a new table in that database, in which I will have two columns - clan name and member's UUID? Is it what you mean or am I wrong?
well in that case you can have two tables, one for clans and the other for players, clans storing information about clans only and players storing information about players, with a foreign key to a clan (assuming players can only have one clan)
Ok, ty, got it
configurate is one
okay well
how do i get the config from the resources
and put it in the data folder
i don't, no
ill just stick with what i have
What file would you delete to reset STATISTICS.PLAYER_KILLS?
iirc stats are stored in a separate file
but yeah deleting it would nuke all stats of that player
that's awesome
actually nvm
wow NNY
strange that it's json
yeah i expected
usually everything is nbt
a .dat
given that you are an 1.8 user
saying uuid for...
it's probably an offline mode uuid
or that
since no 1.8 players can afford to purchase the game
fkng burn damn
fk is nny
i'm a pretty cow guy
in EntityDeathEvent, would getEntity.getLastDamage return the event that caused the death or the one before?
why would you check if a offline player has permission?
vault api
uh, the former
can't check for online players
you can't its not tied together
by that point the damage event has fired
vault api return null with lucky perms plugin
declaration: package: org.bukkit, interface: OfflinePlayer
so use luckperms api :o
if anyone isnt using luckperms in 2021 they dont deserve your plugin
real men use pex
i cant seem to find a vanilla way to make minecarts invisible and unbreakable XD
use pex api
me lookin at minigame servers đ
that's because there is no way to make minecarts invisible
vanilla?
i mean a minecart is still a entity
wich still should have the default nbt data
wtf in vanilla u have the Invulnerable tag in minecart but it Doesnt work
the only way to make the minecart invisible is to not send the minecart entity to begin with
wich has the default nbt invisible
i see
yeah but the client doesn't respect it for all entities
f but i want the gui and stuff
mein kart
true i guess
f.e you can't make falling sand invisible either
also why invisible minecart in the first place?
cuz
actually nvm dont tell me
i wanna spawn a minecart and make it follow on your head so u got like a little backpack thing
aka armorstand
becuz min cart can has chest
ye
armrostand with chest on head?
i dont think that has a gui
genis
that is the preferred method
then you just need to implement a gui for it
also what
how would you fucking open it
i mean hes going vanilla way
it's on your back
so idk why hes asking here
how are you going to click it
no i mean im having a gui u can open by holding a item and clicking
spoken like a true 1.8 player
still why ask here?
So deleting all files in stats actually doesn't reset it
i love you jtx
i have the minecart on top of the head
i mean is ur server stopped
while u deleted them?
no
nice!
dumb
they haven't invented restarting in 1.8 yet
f i guess i just remove the texture from minecarts