#help-development
1 messages · Page 970 of 1
I’m not talking about how faster it is
I’m talking about readability
How he mentioned
yeah
switch vs if moment
switch is more readable in my opinion
have you seen rust match
I would think else if
considering you're running one single method for each case
goat honestly
But guys lemme test my plugin 🙏
Guys
Textcomponent is abstract; cannot be instantiated
What does this error mean?
Here, you might wanna use an enum, with all the data, should make your life easier
Remove
String hoverMessage = null;
I still get the problem
Line?
45
what does that line contian for you?
new TextComponent(event.getMessage());
'TextComponent’ is abstract; cannot be instantiated
Did you by chance create a class called TextComponent?
I wonder if that's a paper thing
ah yes why are you making wood mod, stone mod, wood admin, etc, why not just combine it at chat time instead of pre-coding each rank?
Because im living proof that that, should work
Wdym?
Wat does event.getMessage() return in that case?
Like instead of having 20 ranks for every combination, when a player chats check their kit (wood, stone, iron etc) and their rank (normal, mod, admin) and do the math to check what their prefix should be
It’s more efficient this way
it isnt, for you who doesnt know java barely maybe its more efficient
TextComponent is abstract, cannot be initialised
That’s the error yes
???
Be kind he’s new
Send code
But it works for me???
I’ll just remove mine and copy paste urs
I hadn’t read sorry
Wrong import
Where
means you cant make a TextComponent object because its abstract
import net.md_5.bungee.api.chat.TextComponent;
No shit Einstein
If hes using the right iport, its no abstract
ah
Instead of
import net.kyori.adventure.text.TextComponent;
oh he used java textcomponent?
noh
nvm
I’m importing from net.kyori
Bungee lib
use net.md_5.bungee.api.chat.TextComponent
Yea, you need it from md_5.bungee
Ok done
should work now :D
I’ll go further
Yusss c:
he was using adventure
Now that thats fixed, imma fix my OS brb
which is awesome
you can do something like Component.text("text").hoverEvent(Component.text("hi"))
Sometimes I wanna commit mu der, and today is one of those times
mu der sounds french
Murder*
with adventure
When u say fromLegacyText, inside the brackets should I put my hover message?
Ye
You didn't specify the action tho
hi, im wondering smth, a plugin wrote in 1.8 can run on a 1.20 server but not the other way?
was just from the top of my head
Depends
If you don't use any 1.8+ API features then it will work
But I already told u :c
The text should be User, Administrator, or Moderator, or Stone
Etc
Depending on the permission
Use the string
Which?
okay, for a simple plugin that is supposed to work on any version should i write it in 1.20 or 1.8?
The one your giving the names to?
1.8
Usually more upwards compatible
You could also use reflections tho
I'd go with 1.20 so I can have 1.20as it's native version but of course you wouldn't use newer API features so it still works on older versions
I still don’t understand which
You created a variable called hover message, it a string
First time working with HoverText and Messages
Just put that in there
Done
TextComponen.of or TextComponent.literla(...)
I already removed that problem, thx anyway <333
Boom
Finished
Let’s see if it works now..
I’m curious
Ops I forgot to write the permission nodes
I’m dumb
Guys does the permission list look good?
Ideally you'd name permissions like so <plugin_name>.<permission> for example hoverinfo.admin. Also you need to add at least one attribute to the permission otherwise it will throw an error
Like usage:?
default: would be better
Would it? Can't I just do perm.node: {}? Seems like it'd work just fine
You really should read this to get better understanding on how to register permissions in the plugin.yml > https://www.spigotmc.org/wiki/plugin-yml/#permissions
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Naming it like porey said will solve plugin conflicts,
Also your permissions will be easier to find in Luckperms, etc.
Thanks
I'm trying to deal with scoreboard teams, but I don't understand the difference between a scoreboard prefix and a scoreboard suffix. Can someone explain this to me?
ty
test
I tried using unicode characters in an hologram however there is some gibberish code that gets printed
that can't be removed by just deleting a part of it cuz the unicode char is made of 2 unicodes
\uD83D\uDEE2
is the char
Is the encoding on your stuff right
You need to make sure everything is handled properly with UTF-8 encoding
Otherwise it’ll get messed up
I am making a slimefun addon so i am using one of their functions to update the hologram, do you think it is an issue on their part?
any git user that knows what the diff is between merge origin/x and origin x?
looks like git is actually stupid and origin/x is the only valid one, wondering how it worked all other times then
Добрый день, я директор студии. Ищу себе сотрудников. Требование: Адекватность, общительность, без токсичности. Все расскажем и научим. Пишите в лс 🤝
Anyone here who can help me make an SMP plugin? (im not paying anyone)
I have an abstract class and some classes that inherit it. I am using Jackson to serialize it into a file, but I cant deserialize it, because it throws this error: ```
Exception in thread "main" com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of com.wizardlybump17.resourcepackmanager.api.resource.font.provider.FontProvider (no Creators, like default constructor, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
The problem is that I have a custom deserializer but it is not called. How can I fix this?
the font code is at https://github.com/WizardlyBump17/resource-pack-manager
Hello, how can I add something to the population of the world?
Searched a bit and this might help you
public class WrapperDeserializer extends JsonDeserializer<Wrapper<?>> implements ContextualDeserializer {
private JavaType type;
@Override
public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) {
this.type = property.getType().containedType(0);
return this;
}
@Override
public Wrapper<?> deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
Wrapper<?> wrapper = new Wrapper<>();
wrapper.setValue(deserializationContext.readValue(jsonParser, type));
return wrapper;
}
}
should it be addDeserializer(Font.class, ... ?)
I want to add buttons to the generation of biomes
BlockPopulator
okay thanks
might be this
how babies are made? 😳
and for more complexe structures, like some cut logs, should I use the same approach @young knoll ?
When a mommy and daddy love each other very much
I used it before but it's been like 10 months
for (int i = 0; i < lines.size(); i++) {
Team team = normalScoreboard.registerNewTeam("" + i);
team.addEntry("");
normalScoreboard.getTeam("" + i).prefix(lines.get(i));
scores.add(objective.getScore("" + i));
scores.get(i).setScore(i);
}
I am trying to create a scoreboard with teams, but this just puts the numbers, 0, 1, 2, & 3 on the scoreboard. Why?
do you use nms
No
double check that you have the spigot repo on their, it should be able to find spigot-api
When checking the logs I got a 404 error
is looping thru every entity of the world inefficient? I have to check if some entities have a certain pdc
yes that would be inefficient
try to reduce your set of entities that you are going to loop through in some way
like get entities in a radius around a point of interest (like, around a player perhaps)
can someone explain why nothing is printing out
i have never used this library beofre so i dont undertand it
for (int i = 0; i < lines.size(); i++) {
Team line = normalScoreboard.registerNewTeam("line" + i);
line.addEntry(Character.toString(emptyCharacter));
System.out.println(line.getName());
System.out.println(lines.get(i));
normalScoreboard.getTeam(line.getName()).setSuffix(lines.get(i));
System.out.println();
scores.add(objective.getScore("" + i));
scores.get(i).setScore(i);
}
Can someone tell me why this just puts numbers instead of the content of the line on the scoreboard?
because you are seting the scores to i
I know, but that changes the red line numbers. Correct?
the ones to the side of the content on the right
i dotn know exactly what is happenign but i am assuming that scores is just all of the Scores stored in an arrayList
if I get rid of this line:
scores.add(objective.getScore("" + i));
i get an NPE
so the teams arent working when I try to add the content to the scoreboard
why dont you just use String.parseString(i)
will do
oh
yea
k
normalScoreboard.getTeam(line.getName()).suffix(lines.get(i)); there's something wrong with this
because it knows what the content is
it just doesnt add it to the board
does getTeam or suffix return anything
lemme see
you arent storing the value that you make there
wdym?
im just curious if the methods modify variables or return anyhting
because if they do you arent storing that value anywhere
yea they return the team
well do they modify values inside of normalScoreboard
oh
its good
i dont fully understand your problem then
how do i send a picture here
use ?paste
it doesnt allow for images
what image are you trying to put in
look at the text of the scoreboard
you see the white text
it says 0, 1, 2, 3
when it should say the content of each line in lines
1s
i have a problem with my config.yml i have it pre configured and i get it with getConfig():
and save it at the start with saveDefaultConfig():
after i change anything and i want to save it, it deletes everything and the only thing thats saved is what i have changed.
i save the config with saveConfig(); after changing something.
what do you mean with that?
this is my code example:
config.yml:
https://pastebin.com/hHEW2gkN
Main:
https://pastebin.com/Qvi2Fqhs
SettingsCommand:
https://pastebin.com/G9hzpLLy
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.
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.
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.
onLoad is called before onEnable, there's a chance that might change something. try to get the config after the saveDefaultConfig() method call
what are all the events that can be triggered where an item is being moved
@EventHandler
private void invulnerableBoats(VehicleDamageEvent e) {
if (!(e.getVehicle() instanceof Boat || e.getVehicle() instanceof ChestBoat )) {
return;
}
Bukkit.getLogger().info("Boat | ChestBoat = Hit");
if (e.getVehicle().getPersistentDataContainer().has(keys.getClaimedKey())) {
e.setCancelled(true);
}
}
when boat punched it doesn't log anything
Is there any event listener for server restart?
well ur plugin disables on shutdown
so the onDisable() in ur main class
I was looking for more a MOTD reset when the server restarts
do you mean a different MOTD on every restart?
once it's on?
That could work
yeah just change the MOTD in your plugin then
you could have the vanilla MOTD set as fallback
@EventHandler
public void onServerPing(ServerListPingEvent serverListPingEvent) {
serverListPingEvent.setMotd(ChatColor.GREEN + " Development Server " + ChatColor.RED + "[1.8]\n " + Util.getRandomVisibleColor() + ChatColor.BOLD + "SKYBLOCK SANDBOX");
}```
This is when the server is pinged, I'm looking for something when the server is restarting
i don't get what your goal is
so u mean when the server goes down
it will say in the MOTD
"Server Restarting"
right?
Something like that
A little bit cheaty but just set the vanilla MOTD
to
"Server Restarting"
so when ur plugin disables that shows up]
pretty sure that should work
otherwise idk
Did I phrase it wrong?
There won't be any motd when the server is restarting lol
thoughts so but wasn't 100%
Let me rephrase it once again, this is only set when the server is pinged, I'm looking for something like when the server is starting
Sweet, thank you
any particular reasons this is occurring? (creating project from existing source)
Is that source or compiled jar lol
You need to decompile it then
Or fuck around with enigma and edit bytecode directly
when I copied it over:
jdgui is showing me the same thing
So basically I have to go through everything blind
a, the class name though
Obfuscation ✨
How would I increase the speed of a boat?
Make a vehicle plugin and force everybody to talk about it
try increasing the velocity by multiplying
the amount of times i have said vehicle in the past 3 days is insane
so something like (Sudo code)
if boat.getSpeed < boatMaxSpeed then
boat.setSpeed(boat.getSpeed + boatIncrease);
but how ofter would that run?
often*
if its every tick with
VehicleMoveEvent
it'll accelerate insanely fast wont it?
You've said vehicle again
😭
yes
epic
oh dw, apparently open sourcing your stuff causes enough issues already
Ok i'm stuck. I have variables for the boat speed and i have a way to check if the boat is at the max speed that i want it to be at
but how do i check the speed the boat is going as a float or double or int?
as in like what do i call?
how do you check if the boat is at the max speed ?
basically im just saving on the boat
the amount of times i want to iterate over increasing the speed
and the amount of times it iterated
wait fuck that wont work 😭
why r boats like this
how does ClickType.SWAP_OFFHAND work exactly? like hovering onto a slot and pressing F?
Do you mean SWAP_OFFHAND ?
Hello, should I use equals or == to compare two locations ?
comparing locations is not a good idea
what should I do instead? Comparing X, Y and Z?
you can use .equals but comparing three doubles is not reliable
hmmm okay thanks
wdym by "not reliable"?
floatign point precision on doubles is a little random
okay
then I'll use equals
what are you attempting to need to compare locations?
to retrieve an Entity from a List:```java
/**
- Get a custom block from his Location
- @param spawnLocation The location used to get the custom block
- @return The found custom block
*/
public static @Nullable CustomBlock getCustomBlockFrom(Location spawnLocation){
return registeredCustomBlocks
.stream()
.filter(
customBlock ->
customBlock.getSpawnLocation().equals(spawnLocation) ||
customBlock.getCoveredBlock().equals(spawnLocation.getBlock()) ||
customBlock.getCoveredBlock().getLocation().equals(spawnLocation)
).findFirst().orElse(null);
}```
I do a lot of checks (and I think the two lasts are useless)
And also, I've got a big problem when adding a custom BlockPopulator:
https://paste.md-5.net/sayajukamu.pl
Here is my code:```java
public class RocksPopulator extends BlockPopulator {
@Override
public void populate(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull LimitedRegion limitedRegion) {
if(worldInfo.getEnvironment() != World.Environment.NORMAL) return;
int randomX = (int) (random.nextDouble()16chunkX);
int randomZ = (int) (random.nextDouble()16chunkZ);
int perfectY = limitedRegion.getHighestBlockYAt(randomX, randomZ);
Switch button = (Switch) Material.STONE_BUTTON.createBlockData();
button.setFacing(BlockFace.UP);
limitedRegion.getBlockState(randomX, randomZ, perfectY).setBlockData(button);
}
}```
This is gonna get slow quite fast. Def use a Hash based collection instead of iterating over every single custom block
?whereami
yeah yeah sorry, the plugin is based on spigot, but well, I use paper to run it
But I ask help for my plugin (spigot) not for my server (paper)
If I wanted to ask help for my server (paper) I should go to the PaperMc discord
okay thanks
Like this?java public static HashSet<CustomBlock> registeredCustomBlocks = new HashSet<>();
and no change to the method to retrieve the custom block?
is it poor practice to declare nested classes if their sole purpose is to be used by the encasing class ```java
public class IniParser
{
protected class IniParserSettings
{
public Character seperator = null;
public String extension = null;
public Boolean headerMode = null;
public Character commendDeclarator = null;
public String errorValueString = null;
public Integer errorValueInt = null;
public Float errorValueFloat = null;
public Double errorValueDouble = null;
public Character errorValueChar = null;
public Boolean errorValueBool = null;
public IniParserSettings()
{
this.seperator = ',';
this.extension = ".ini";
this.headerMode = true;
this.commendDeclarator = ';';
this.errorValueString = "";
this.errorValueInt = 0;
this.errorValueFloat = 0.0f;
this.errorValueDouble = 0.0d;
this.errorValueChar = '\0';
this.errorValueBool = false;
}
}
IniParserSettings settings = null;
public IniParser()
{
this.settings = new IniParserSettings();
}
}
and never supposed to be exposed?
Your plugin is not running on spigot though
but it is based on spigot 🤓☝️
Seems fine, or could use a package
I don’t understand why it can’t be accepted as a Listener Class?
What's your point?
but well, paper isn't the problem in my code, it's clearly what I made in my code
I use spigot-api to make it
does it implement listener paulem
Does chat listener implement listener
How do you know
Ops, I expended as Listener
Not implemented
my main class? Yeah
I got the wrong person my bad
oh okay x)
because I code with my ass basically
(no I joke, or maybe not?)
Anyways, I came here to ask:
I know that loadData() and saveData ask the WorldNBTStorage for the playerdata.dat file, which is resolved from the current path plus playerdata/, however I only always seem to see the folder inside world and not other places, does it always save inside world?
Not sure exactly what the question is but I think the answer is yes
let's try with this:```java
if(worldInfo.getEnvironment() != World.Environment.NORMAL) return;
int randomX = (int) (random.nextDouble()16chunkX);
int randomZ = (int) (random.nextDouble()16chunkZ);
int perfectY = limitedRegion.getHighestBlockYAt(randomX, randomZ);
Switch button = (Switch) Material.STONE_BUTTON.createBlockData();
button.setFacing(BlockFace.UP);
limitedRegion.setBlockData(randomX, randomZ, perfectY, button);```
Player data is in the main world
Ah, okay thanks
I am trying to load data per-world for some things I'm working on, I guess I should just have a copy of the player.dat file in each world under a playerdata folder, and just move the files around?
first makes more sense
that way when the user deletes a world
the data will be gone aswell
oh it says and lo
thought it say or
that is just a bit silly
i.e.
world/
playerdata/
world_nether/
playera.dat
world/
playerb.dat
playerb.dat # symlink
playera.dat # symlink
iirc mc supports symlinks for playerdata
and I just edit the symlinks
or
wait
world/
playerdata/
data/
playerb.dat
playerb.dat # symlink
playera.dat # symlink
world_nether/
playerdata/
playera.dat
hm no that won't work
also mc doesn't allow symlinks so that won't work
why do u even need this though lol
what kind of data r u saving
?
same error...
He's saying that player data should be stored ideally in a per-world manner if requested (my interpretation)
i.e.
server/
playerdata/
playera.dat
playerb.dat
world/
playerdata/
playera.dat # Overrides global one
# uses global playerb.dat
what exactly r u trying to achive and what is the outcome
I want to put some stone buttons on grass with BlockPopulator
They're trying to waste our time
💀
Here is my code:
https://paste.md-5.net/iyoyifugod.java
?whereami
yay cafebabe is back alive
^^
why do u need a „BlockPopulator“ to place a stone button
What happens to the nether then
have a seperate player data for players who have been in that world / the nether/end
world_nether/
playerdata/
playera.dat # Overrides global one
# uses global playerb.dat
basically, if a world has a player.dat for a specific player, it will load that, otherwise it will load a global one
u didnt tell me you are generating biomes lmao
would allow plugins to have different player datas per world easily
thats a whole other story
yeah that's also kinda what I need lol
thought paper did that but they don't
You're giving me the want to make a PR
no no, I want to add stones to the generation of biomes... oh, did I misunderstand my words?
hehe
It wouldn't even be that hard to
go ahead lol
well thats not what u said here
stone buttons are commonly used as stones*
I'm not english native, so I'm a bit lazy with it
I need to first finish a lot of things
yeah, to the generation of the world
biome specific rocks with buttons
yeah i also just don't have time for that
Actually, once I get time I'll add the ability to load offline players maybe
I need both per world data and offline player data
so
Caused by: java.lang.IllegalArgumentException: Cannot set property BlockStateDirection{name=facing, clazz=class net.minecraft.core.EnumDirection, values=[north, south, west, east]} to up on Block{minecraft:stone_button}, it is not an allowed value
@cinder abyss
read this
an error
Ik that but it's like impossible to read on mobile
the error they are throwing
So, I’m making that if a player.hasPermission(“example”), has the named coloured to red
But when I test it, it doesn’t work
Because youre setting the message not the name
I want to precise that I have op
You don’t need to do this every time, just Player.setDisplayName on join
So I should remove all this and say, but I don’t understand, how does it work then with permissions?
If I use Player.setDisplayName
Check permissions in onJoin event
Oh u mean, I should change event.setMessage to player.setDisplayName?
No.
sure
you guys think ?gui is needed for a lobby plugin? no right since the user can not create one of his own so the problem with view Title is no applicable
What plugin ya got
It’s hover + chatColor nicknames
It's still a bad idea
Follow the GUI guide
The hover works, but it fucks the LuckPerms prefixes
This is the hoverListener Class
Here in line 30, I think it’s that the cause of why LuckPerms does not let me choose a prefix
is there any good api for it already or should I do it from scratch?
? you're just getting the player name, straight
you aren't using the display name or getting the prefix anywhere
hi Emily
Wdym?
Thats the HoverListener
yes
This is the ChatColor listener
Here is where I code for the Username Color
With Permissions
in your hover listener you are not using the player's display name or the luckperms prefix anywhere, you are just using the player name
Yea bc it’s only related to Hover Messages
Do u mean, that this might be the cause why LuckPerms does not work?
Where do you set the hover event for group prefix
LuckPerms only stores the prefix, it does not put it in chat or anywhere, it's your chat plugin (or you) the one that is responsible for getting that prefix from LP and putting it somewhere like chat/tab etc
if you don't use it, it won't show up
I didn’t implement LuckPerms dependencies
I should put LuxkPerms dependencies right? To make it work?
You can use Vault
how does ClickType.SWAP_OFFHAND work exactly? like hovering onto a slot and pressing F?
It’s not installed on my server
yes
aight
So what’s a solution?
Yeah, but I use the method provided by Bukkit, and a cast which is good
So it's strange
what
Here is all the code
I implemented LuckPerms
But when I try the code
This is what I see in the console:
Yes
Wdym?
If you want to add more ranks you need to add more if statements
cuz you never assigned it any value
Why should I assign a value to it?
Like which value should I even assign?
I would check the luckperms developer docs
They are good.
Also i would go to their discord server for help.
You should do what i said above.
in InventoryClickEvent, if I press offhand or number key, and I hovered over a slot that isnt either, and pressed the corresponding button, how do I get both items that got exchanged? I assume its e.getClickedItem and e.getCursor but wouldn't the cursor be empty since I just changed the items? or does the item that got moved become the cursor one
Hello, I have a problem with Spigot during a Dependabot check. It cannot detect if there is an update to be done...
My plugin works on Maven.
To update to 1.20.4
Not a required update
No
You didn't read the message
hmn??
It does not detect the current version
Did you make sure it has awareness of the spigot repository? The spigot api is not on maven-central.
In the logs he searches the Spîgot and Maven repo but I get the 404 error on both
?paste your pom
looks fine
I only have this problem on projects that use Maven. On Gradle it works correctly
public static void makePlayerInvisible(Player player) {
PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.ENTITY_EFFECT,
true);
packet.getIntegers().write(0, player.getEntityId());
packet.getBytes().write(0, (byte) 14); // 14 is the ID for invisibility effect
packet.getBytes().write(1, (byte) 1);
packet.getIntegers().write(1, -1);
for (Player p : Bukkit.getOnlinePlayers()) {
if (p.equals(player)) continue;
ProtocolLibrary.getProtocolManager().sendServerPacket(p, packet);
}
}
I am tryin to add INVISIBILITY effect to a player, but some reason I get this error
Internal Exception: io.netty.handler.codec.EncoderException: java.lang.IllegalArgumentException: Can't find id for 'null' in map Registry[ResourceKey[minecraft:root / minecraft:mob_effect] (Stable)]
um... why with packets?
you know you can just add the invisibility effect right
Yes, I want it to be a per player thing
soo, player x is invis for player y
but x isnt invis for z
( need it for the transparent bukkit teams effect too )
you know there is a thing for that rihgt
hidePlayer is different thing tho right?
Do you want the invisibility potion effect or completely hide the player?
I guess?
Potion Effect
For the transparent bukkit teams effect
the transparent bukkit teams effect...
Keep in mind that you are not writing into the byte buffer with Plib. You are using reflections to set fields.
So check the NMS packet and check which fields it has. There is probably a potion effect field which needs to be set instead of the raw byte.
hey smile I need a diff type of help, can you make me stop procrastinating rq
this is what i was looking at for my refrence
look at the actual class
Go learn or you will die poor. Good call i should listen to my lecture right now...
Yeah, dont
Aight
not that noo I need to write a few thousand lines of code to finish a project
Well I give up, I can't find a solution and I've been at it for days
Oh
Well, I just ended up sending the packet directly via nms, it does say i have the effect but the effect does not register visually
I can still see the player, but in the hud it says invisbility duration
If you want to store live data for Blocks, then you should have a Map<Block, YourData>. This way you can retrieve the data in constant time, no matter how big the map gets. Just make sure to save the data when the Chunk it us currently in unloads.
Not a huge fan of storing craftblock refs
It is only a blockpos and an nms world
but even then
icky
how 🙏 i really need a negative height passenger for something im trying right now but i cant figure out how
Okay thanks
hey, it works as an immutable Location :^)
Where spigot blockpos?
@EventHandler
public void onWorldLoad(WorldLoadEvent event) {
event.getWorld().setGameRule(GameRule.ANNOUNCE_ADVANCEMENTS, false);
event.getWorld().setGameRule(GameRule.DO_DAYLIGHT_CYCLE, false);
}
``` Why are there still Advancement Annnouces and it does daylight cycle?
(Listener is properly Registred)
In the depths of hell
It's called a Block
We have joml for that
Fairly certain a Block is just a BlockPos until ú call shit
For which world do you want this to be called?
Pretty sure blockpos is world independent
each
So not exactly
What is the load order for your plugin? STARTUP or POSTWORLD
a just a 3d vector hten
yeah its set to nothing makes sense
Wait, it has a hard reference? I was almost sure that the world was stored in a weak reference there
Nope, only on Location
Meh. Then a joml Vec3i is probably better. If it has a nice hashcode method that is. Otherwise a custom BlockPos record would be nice
is there any way to achieve the equivalent of a negative slime? i need a passenger with a negative height but i cant find a way to do it since negative slimes have been removed
a DisplayEntity with a translation?
it messes up with a centered billboard
I didn;t say a billboard. Try a BlockDisplay with a Translation
What's the best alternative to Jitpack for Github-based maven repos?
why do you want an alternative?
🤣 😅
You know you don;t need an account on Jitpack to use it with any repo
Ik but it's a private repo
ah ok, then pay 😉
Frankly, I don't want to spend money without reason, so I thought I'd ask if you all knew of any alternatives
or host your own build server
Oh okay, that's a good idea
I'll bring my Raspberry Pi 4 back to life haha
perfect for the job
Oracle free tier :p
wut
ok so i want a text display thats riding the player but i want it to be lower down than the height when its riding if that makes sense, but i cant use translations because i need to use the centered billboard and that would make it move weirdly
Oracle offers always-free VPS
Hmh, this one?
What do you mean by move weirdly. Translations is the way to go if you want to translate the display...
lets say i wanted a second nametag type thing but underneath the player, so i would have the translation set to like -1.5 y or something, if another player were to look down at someone from above, the second nametag would be moved next to the player, it wouldnt be under them anymore
i dont have access to send images so i cant send what i mean
then you don;t want a centered billboard, you want a fixed billboard and a Translation
the problem is that i want to use a centered billboard, or well i need to
or at minimum a Verticle one
you can;t
a centered billboard will pivot about both horizontal and vertical
thats a shame
yeah i know, thats why i wanted something like a negative slime to ride the player and then the display rides the negative slime, but negative slimes are removed
that wouldnt work with what i was trying to achieve but i guess its impossible then
why is it impossible?
once again, with what i am trying to do, i need a centered billboard
You havn't told us what you are trying to do
why do you absolutely HAVE to have a centered billboard?
can someone help me with lands config ?
I know why this is
We found this issue at my work, reported it to mojang as a bug and it was marked as "Works as intended"
no luck
its not an issue, its how its supposed to be
centered billboards are bugged
Interesting
How to send an action bar message?
Shows as resolved
i assumed that was intentional
yep
if you have a text display with a centered billboard and move it to the players eye location, you can basically create a custom hud with the right translations, but when its riding the player, its slightly too high up
thats correct as a non centered billboard is rotated around its origin, which is not it's center
I mean you can still kinda do it
how so
coll how did you do that
teleport in player move event :kappa:
that would lag behind though
he's lagging btw
wouldnt be perfect, cant predict player input
make an AI learn the brain patterns of the player so you can replicate them
It isn't teleporting
how then, ive been stuck on this 😭
how possible is it to make a changeable hashmap but a specific key cant be changed
extend HashMap
and do your checks in .put
and .remove ig
what name would it have doe
¯_(ツ)_/¯
i suck at class naming 😭
HashMapWithKeyThatCannotBeChanged
🗿
SingleUnchangeableKeyHashMap
nahh ImmutableKeyHashMap
ImmutableKeyMap
if it's interface
what does hash even mean in hashmap
it is because a HashMap is a type of map that uses hash codes to index keys
hashbrownmap
no
ah okay so its just the primitive solution, move it further away so the difference isnt as noticable
in this video its displayed over the player in f5 but i cant seem to do that
I thought it was UI api thing
maybe its my client, im gonna try vanilla
One day :c
was a client issue
Oh how we love clients breaking things
this is why I always
👏 work 👏 in 👏 vanilla 👏
feather client renders the player over other things for some reason
this is why i'm not a fan of clients
they just change a bunch of random shit and often times without a valid reason
i meannnn. same could be said for server software
true
but most people use spigot/paper/fabric/forge
and they have actual docs
rather than like ten clients which don't explicitly say what unnecessary changes they made
Hello! Is there any way to store data inside block like dirt/cobblestone/other placeable blocks (I mean something like persistent data container)?
?pdc
?morepdc
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
^
okay, thanks, will check
hello, in AsyncPlayerChatEvent, how could i prevent the message from being sent, event.setCancelled(true) doesn't do anything
clear recipients
setCancelled should work
cancelling the event will work if you don't use shitty chat plugins
Provided other plugins aren't being weird
do you have any additional chat plugins installed?
ok it works with only my plugin installed
so yea it's a chat plugin issue
can i use event priority or smth to make it bypass other plugings?
lowest
yes
yes
how does packet logging before join event is called really work
hey
Could anyone please help me in this?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
I perfectly know this
I’m just asking politely
But
then ask your question
this.luckPerms = provider.getProvider()
you need to assign the LuckPerms instance given in the provider to the luckPerms field
Thx!
And another question sorry
I need now to use the plugin field to access the getLuckPerms method and get the player's prefix
How would I do it?
you have a field in some other class of your plugin type, you can call getLuckPerms() on that field
you were explained for 4 continuous hours how to assign a variable to a field and it seems you still don't understand it, i am sorry but i don't have the time to teach you java from day 1, you really should look into doing a basic java course that is dedicated to that
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
So I've got a decompiled jar, created a new project from it, yet the file is still read only?
I've literally just got to change a single command alias D:
alias is in teh plugin.yml so why decompile?
If I want to make something configurable but through a GUI (to save time writing), should I still use a .yml file or should I use a database
To import to intelliJ
I wasn't aware of any other way to edit
if you are only making a change to the plugin.yml you can edit just that file
a jar is just a zip archive
right I guess I always be trying to make it 100x more difficult on myself
open with 7zip, edit plugin.yml, close file and done
ew 7zip
winrar >>>>>>
eww winrar
ty for reminding me why I have applications such as these kek
use winrar not 7zip!!!!!!!!!!11
7zip super duper. Winrap poo poo!!!!1
Last time I switched to another ui was simply because of the ui, they do the same thing D:
totally incorrect. they use teh same compression
prove it
its just a different UI
7zip looks shit tho
prove it, lol
How do u use your plugin instance field to access the getLuckPerms method?
🥲
I’m not understanding it
which is why i strongly suggest you do a java course
But could u help me on this?
you have a field in your listener class
that field is your plugin instance
your plugin class has a getLuckPerms method
in your listener class, you call getLuckPerms on your plugin field whenever you want to access it
fields and methods are day 1 java material, i strongly, boldly recommend you do a java course
I know what they are
clearly
But I mean, how would u code it
._.
Fields are int, double, etc
no, those are types, those ones specifically are primitives
a field is a "variable" that lives in a class rather than locally in a method
Could u make me an example code so that I can schematically have an image of the situation?
luckperms have docs
you say you know but you lack knowledge, hence why i keep suggesting you do a course, plugin development requires a minimal amount of knowledge
That doesn’t help
they have examples
RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class);
if (provider != null) {
LuckPerms api = provider.getProvider();
}```
this is how you get a luckperms instance
u don't need "getLuckPerms"
I already have that code
then why do u need getLuckPerms?
That’s what they want me to do in the luckperms dsc srv
there are no downsides to doing a course, only upsides, you will gain knowledge and understand what people mean when they say "field", "class" and "method"
what r u trying to do?
I made a plugin where u can see some hoverable text, but when I implemented it, all of my prefixes and colored username disappeared
So I’m trying to implement luckperms prefixes
And colored username
so your code broke something in luckperms and ur trying to copy what luckperms is doing
just fix what ur plugin broke..
Should I send the code?
send the chat listener where u add hoverable text
how do you usually call a method? let's say you have a variable called response and it has a method called getText(), how do you call that method?
not you .....
aight
Idk
🧐
I will
you are only making this hard for yourself for literally no reason
Hello, I have a problem concerning bungeecord, when i try sending a player through bungeecord's plugin channel, it works on another plugin but not the one I'm currently on, there's no error anywhere and i registred the outgoing channel, thanks for your help.
here's the code
@Override
public void onEnable() {
if(!getDataFolder().exists())
getDataFolder().mkdir();
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
}
public void teleportToServer(Player player, String server)
{
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
player.sendMessage("Writing Connect...");
out.writeUTF(server);
player.sendMessage("Writing Server...");
player.sendMessage("Executing last line...");
player.sendPluginMessage(this,"BungeeCord", out.toByteArray());
player.sendMessage("Teleport has been executed");
}
I also tried DataOutPutStream
what item for gui as an "info" item what a state currently is
what
@dawn flower u found anything?
not really, i'm confused how that broke it
public static void sendPlayer(Player player, String serverName) {
ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(b);
try {
out.writeUTF("Connect");
out.writeUTF(serverName);
} catch (IOException eee) {
Bukkit.getLogger().info("You'll never see me!");
}
player.sendPluginMessage(Main.getInstance(), "BungeeCord", b.toByteArray());
}
im Main:
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
add this method to ur main class
already tried that one
public LuckPerms getLuckPerms() {
return api;
}```
What?
That should solve the problem?
how is it incorrect ?
possible to create a "shop" from deluxemenus?
yeah
nope
I guess I'm thinkong of custom then
and replace private LuckPerms luckPerms; with private LuckPerms luckPerms = plugin.getLuckPerms();
Sure
Where is that?
Could u tell me the line?
at what point are you trying to send the player?
a bungeecord listed server
ah bruh
here
at what point in teh player connecting?
what ?
are you sending him while he is still connecting?
in player join event, or while online and playing?
while online and playing
I see no issue then
other than
you are writing to out, but getting a byteArray from b
i tried also this
public void teleportToServer(Player player, String server)
{
ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(b);
try{
out.writeUTF("Connect");
out.writeUTF(server);
}catch (IOException er){
er.printStackTrace();
}
player.sendPluginMessage(this.main,"BungeeCord", b.toByteArray());
yes
and this works in another plugin but not this one
you are writing to out and getting the array from b
ByteArrayDataOutput out = ByteStreams.newDataOutput();
try{
out.writeUTF("Connect");
out.writeUTF(server);
}catch (IOException er){
er.printStackTrace();
}
player.sendPluginMessage(this.main,"BungeeCord", out.toByteArray());```
elgarl I'm curious to see the size of your local repo (intelliJ generated repos)
but this one's different
theres two possibilities that i know
that are supposed to work
but doesn't in the plugin im on
my local repo?
9.54 GB (10,251,460,193 bytes
Mine is not all SPigot/MC stuff though
I'd assume not, mine is however
Actually thats not true, I did make a notepad with a markdown viewer + calculator with jfx but that was uh
not fun
solved, i wasn't even using the right string lol
whats the event for nametagging an entity?
Can anyone please just tell me How u do use your plugin instance field to access the getLuckPerms method?
I’ve been stuck here since 3 days
Bungee or spigot?
Spigot
PlayerInteractEvent and check if the player is interacting on an entity with a nametag
<dependencies>
<dependency>
<groupId>net.luckperms</groupId>
<artifactId>api</artifactId>
<version>5.4</version>
<scope>provided</scope>
</dependency>
</dependencies> add this to your pom, onEnable or where ever: RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class); if (provider != null) {
LuckPerms api = provider.getProvider();
}
makes sense
I have a similar thing
send your code
doesnt exist
Ops
Here it is
at luckperms as a softdepend to your plugin.yml
What?
add softdepend: [LuckPerms] to your plugin.yml
pretty sure it's this:
softdepend:
- LuckPerms
both work
I just looked up the docs
but yeah both should work
ah
foo: [bar, foo]
foo:
- bar
- foo
these are the same
I prefer the second one 😜
yeah same
yeah
like yeah I use the second but I just copy pasted the docs and changed the plugin name
can we all agree that yaml kinda sucks
try it and see what happens
Let’s see
i mean as long as you try to stay consistent
?tas my beloved
Wait CafeBabe is back?
yessss
I was never informed of his return 
hello, is there anyone that knows how to return a task with the class extended ? Like this please
public BukkitTask getTask(){
return this;
}
public class Scheduler extends BukkitRunnable {
so when the class has been initialized it runs the runnable, but how to get it please ?
initialize luckperms in the onenable
do you actually have luckperms on your server
to make sure it has been initialized after the plugin enables
is it possible that methods can clash with each other in two different implementations of a clash even tho they are static?
he just doesn't initialize his fields xd
or its some bug
I did
?paste your main class
I suppose you mean something like this:
public class MyRunnable extends BukkitRunnable {
@Override
public void run() {
// whatever
}
}```
```java
public class MyMain extends JavaPlugin {
private MyRunnable myRunnable;
@Override
public void onEnable() {
this.myRunnable = new MyRunnable();
this.myRunnable.runTaskTimer(this, 0L, 20L);
}
public MyRunnable getMyRunnable() {
return this.myRunnable;
}
}```
bruh
i dont see your LuckPerms plugin
?paste your HoverListener
ChatListener
Chat or Hover?
public Character getKeySeperator()
{
return Character.valueOf(this.settings.keySeperator);
}
``` does this still return a reference to the encapsuled object or a new instance?
chat
new instance