#help-development
1 messages Β· Page 468 of 1
or does that require a texture pack
how? Can u send me the wiki link
I literally see chunks being loaded, but teleportation still doesn't happen
you can format it your own way and hardcode the string modifying part
And then just getting the string from config
just change to /n or smth
Not sure if it lets you
and then read the string from config and change it back
Oh I see
thanks, just found it as well, I'll look into this
to what can be accepted by minimessages
this is what I am doing
Could someone please help me with this? https://discord.com/channels/690411863766466590/1095995534004736050
this is inside a command
where are you using a org.bukkit.Command?
i wanna make more .yml files using YamlConfiguration, so i made this code:
Users.java
public class Users extends YamlConfiguration {
private File file = new File(TenguCore.getInstance().getDataFolder(), getFilename());
private Users config = null;
public String getFilename(){
return "users.yml";
}
public YamlConfiguration getConfig(){
if (config == null){
config = this;
}
return config;
}
public void loadConfig() throws Exception{
if (!file.exists()){
TenguCore.getInstance().saveResource(getFilename(), false);
}
this.reload();
}
public void reload() throws Exception{
super.save(file);
super.load(file);
}
public void save() throws Exception{
}
}
main:
@Override
public void onEnable() {
// Instance
instance = this;
saveDefaultConfig();
// Load Files
Users users = new Users();
try {
users.loadConfig();
Bukkit.getConsoleSender().sendMessage(ChatColor.GOLD+"[Tengu Core] "+ChatColor.WHITE+"users.yml created.");
} catch (Exception e) {
throw new RuntimeException(e);
}
Bukkit.getConsoleSender().sendMessage(ChatColor.GOLD+"[Tengu Core] "+ChatColor.WHITE+"Plugin: "+ChatColor.GREEN+"Activated");
}```
It does creates the file, but it doesnt writes the stuff i have in resources/users.yml
is that some kind of commands api
hi, does any 1 know how to detect if a block played in BlockPlacedEvent has a lore? (so i need to get the ItemStack)
dont extend a fileconfig
i uh.. i am not using it anywhere in the command
what is this mess lol
as your reload impl wont work
wrap a FileConfiguration
BlockPlaceEvent#getItemInHand()
also i have no idea why youre storing a reference to itself
youre basically doing YamlConfig getConfig() { return this }
ye but it should write what i have in the users.yml
but i get a empty file.
the only change you need to make is rename newConfig and configFile
this is basically my whole command
just wrap a FileConfiguration and a File
youll probably have to write delegate methods
ye you dont work with Command, String, String[]
the command is your method, the label is the annotation value and the string[] are your method params
never had this issue when I wasnt using acf, what are the possible fixes?
just remove that command, label and args param
getResource is coming from..?
instead of args[0] use a parameter of type Player
or OnlinePlayer, dont really remember good
huh
.
legacy file writing π€
ohh so I just take the args in the function directly
filechannel where
and convert them too
yes
based x)
bukkit be like
ohhh this is just like making a discord bot but in java so its instantly worse but better than before but its still bad tho cuz java
yay
Files.newBufferedWriter ftw
so um what about CommandSender doe, like for some commands I wanna let console use em but for some only players
can I keep CommandSender sender and the check inside?
if its like that, both will be allowed
you can probably just create a method overload if you really want
so if I do Player player then its only for players
hmm
but CommandSender sender makes it for both?
ye cuz a player is also a commandsender
damn this shit is confusing
take a look at the docs
someone has a forum for custom config files?
what if I did OfflinePlayer target and just took a name as input
does it parse automatically?
because that would be the best thing ever
i am trying to make a crates plugin but i am unable to figure out how to calculate the random drops, can anyone help
Custom config files?
Anyone know why Damageable#damage works, but doesn't when I provide a player as the damage source?
Random random = new Random();
yes
more files
like users.yml
messages.yml
and stuff
Oh, well that's easy.
that's literally ez
First off, have you referenced this?
https://www.spigotmc.org/wiki/config-files/#using-multiple-configuration-files
teach me
call me
i just saw it
or go to the link
no
instead of writing it down in resources folder
You can do either or, but I prefer to just copy my configs using #saveResource()
oops meant to reply
i was using it
look
i know that but what if the chances for an item are less than 1% how do i calculate that
you still use saveResouce and type in resource
Check if #nextDouble is less than 0.01?
the easier method is making a util method something like https://github.com/The-Epic/EpicSpigotLib/blob/master/epicspigotlib-core/src/main/java/me/epic/spigotlib/utils/FileUtils.java#L34-L47
that probably should be for another guy
complex maths and run between 1 and 1000 instead of 1 and 100
(change based on percentage of items)
i have no troubles with configs
now you do
oh noooo
@fluid river funny moment System.out.println(Arrays.toString(chunk.getEntities()));
For some reason there is no entity in the chunk))
cool
Look where?
Question.. why is there no one there when there really is.......
.
How can I cancel the jump event ( for example by setting the jump to 0 ) without canceling it directly in PlayerMovement?
spigot has no jump event
but you can listen to teh statistics event for jump and set Y veolocity to zero
Looking for help to get the dependency/repository working for WorldEdit, would appreciate any help as I tried to go to the WorldEdit discord, they just took the piss out of me for not knowing much because im new to all of this.
perhaps reassess if you actually need to use it then
what would you recommend?
That depends on what you are trying to do
essentially create independent islands per a player, just messing around.
so pasting templated islands?
Yeah with a command
if you are using 1.18+ use the built in Structures API
many discords are toxic to new commers
why though, that's so useless.
developer ego
if i pm you can you have a look at my pom file, just to see if you can help me to get the WorldEdit API working?
I did follow a guide on spigot that was nooby friendly but seems to not work.
?paste
cheers ill put it in there
It depends a lot on what people ask and how they ask. Some people don't show any effort and therefore get non effort answers aswell. That's not what you did tho. You asked just fine
I essentially did the same thing as I did in here, showed everything then their response was "lmao do it yourself" essentially.
usually people are willing to help if they can help you in here. Some people just come here and say "I don't know how to code but I got this code from chatGPT and it doesn't work" and expect a full guide on how to install an IDE, configure it, install maven etc
the pom looks ok to me, without looking up versions
but then again I don;t use worldedit
what issue are you running into?
Do you get an error building the project with mvn clean package?
"Cannot resolve symbol 'sk89q'"
// get user's bank data
CompletableFuture<ResultSet> future = CompletableFuture.supplyAsync(() -> {
ResultSet results = grabBankData(targetUUID);
return results;
});
future.thenAccept((results) -> {more stuff here});
public static ResultSet grabBankData(UUID targetUUID) {
ResultSet result = null;
try {
PreparedStatement statement = plugin.getConnection().prepareStatement("SELECT purse, bankStored, bankLimit FROM mm_pdata WHERE uuid = ?");
statement.setString(1, String.valueOf(targetUUID));
result = statement.executeQuery();
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
this causes the entire server to stall out and crash and burn
During compiling or does your IDE already have problems?
Is that what you get from the IDE or when building it using the maven commands?
calling thenAccept iirc blocks the thread
IDE already has problems.
Does same thing whilst compiling though.
It doesnt
what must I do then?
is it just join and get that block
IDE already has problems.
Does same thing whilst compiling though.
listen to 7smile over me
Looks alright to me. But you need to handle exceptions which are thrown in the CF
Else they get hidden
so just put a try catch in the CF?
Is it trying to fetch worldedit from the spigot repo? Can you run maven clean package and send us the full error using the page you used before?
mvn clean package *
You should handle the exceptions through the methods provided by CompletableFuture
?paste
When you relocate something, independent of using maven, groovy or kotlin, you should expect the name of a dependency changed in the jar like the one you've putted
https://paste.md-5.net/yupuyafifu.coffeescript This is the whole error log when trying to package.
It is a fresh new install of IntelliJ and a brand new project, I've been at this all morning, I was able to sort out the Spigot API just fine but WorldEdit API guides are horrible for implementation.
To understand for a complete nooby like me.
My case is a gui dependency and I relocated it, but opening the jar on WinRAR I see the name of the packages doesn't change
CompletableFuture<ResultSet> futureResult = CompletableFuture.supplyAsync(() -> {
}).whenComplete((result, exception) -> {
if (exception != null) {
exception.printStackTrace();
}
});
For example like this
doin dat rn
i was expecting a #exceptionally
ok so -
I run command
nothing happens
nothing in console
everything stalls, crashes and burns
Show stack trace
wait wait wait
hold on
everything didnt die
actually, nothing at all is happening
like, nothing except console saying that I used X command
command registered properly?
Add debug messages
and server didnt die
I'll see if I find something. I haven't used the WorldEdit api myself yet. The first googling attempt lead me to what you tried already (which does look fine for me)
What you could try is building the project without any world edit related code/imports. To see whether it successfully builds using your pom
I really hope that plugin.getConnection() retrieves a connection
from a pool like HikariCP.
debugging...
if anything wouldnt it be better to just retrive the connection pool then get a connection instead of getting one from main class
Yeah only using the Spigot API, without any WorldEdit related code works perfectly fine, I was able to create a plugin yesterday just fine.
It appears to work perfectly fine in the pom file but the actual code has errors all over it.
That's what he said tho. :p
Any ideas?
I meant with the worldedit dependency still in your pom. Just without actually accessing it
Hello! I am having a problem with that if I start to write /server I get kicked immediately. How can I solve this?
Yeah I'll try that now
Show your code and your console
Yep compiled the plugin perfectly fine with the pom implemented with WorldEdit still.
It's only when I use the WorldEdit code it starts freaking out and doesn't recognise any line of code from the API.
thx
That's cause there is no method. There is ProxyServer#getServers() though.
Screenie of the code incase you need to see the errors.
plugin.getLogger().info("2");
// Purse item
ItemStack balanceItem = new ItemStack(Material.PAPER);
ItemMeta balanceMeta = balanceItem.getItemMeta();
balanceMeta.setDisplayName((plugin.lang.getString("bank-purse-item-name"))
.replace("&", "Β§")
.replace("{purseMoney}", String.valueOf(purse))
.replace("{currency}", plugin.currencyName)
);
balanceItem.setItemMeta(balanceMeta);
inv.setItem(11, balanceItem);
plugin.getLogger().info("bi");
for some reason, its getting stuck at this out of all things
(2 is printed, bi is not)
So how can I solve it?
Guys, why does the chunk return an empty array from entity? I know for sure that I am getting the chunk I need and I know for sure that there are entities there.
guys how i can cancel the event for teleport player to another dimension?
i tried to do this but idk
if (waterLocation.getBlock().getType() == Material.END_PORTAL) {
event.setCancelled(true);
}
}
Use the right method? Just replace #getServersCopy() with #getServers()
Where can I replace it?
In your code? Are you not making a bungeecord plugin?
No, I am just using bungeecord with aegis
Then that's a #help-server question.
Ohh, sorry, i havent seen that channel
<repository>
<id>enginehub</id>
<url>https://maven.enginehub.org/repo/</url>
<releases>
<enabled>true</enabled> <!-- releases enabled: this specific repository also hosts release versions -->
</releases>
<snapshots>
<enabled>true</enabled> <!-- snapshots enabled: we declare a SNAPSHOT repository because we need to download a SNAPSHOT dependency -->
</snapshots>
</repository>```
can you try to configure the repo like this?
report to aegis, although i don't recommend using aegis as a bungeecord fork
?paste
https://paste.md-5.net/jasozoyale.xml Like this?
use ```xml for better view with xml syntax colors
nice
What event are you listening on?
yes
I refreshed maven and it still has errors
i have done , thanks
?paste
I added both dependencies suggested from this spigot forum post.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
oops deleted their message
lol
https://paste.md-5.net/gomutomuko.coffeescript errors when trying to compile with edited pom file
try opening enginehub repo on your browser
to see if it opens it or not
this link
yep it does
bruh
yeah also opens
restart idea
restart as in close Intellij?
close and open
does it build?
Nope, it doesn't recognise a single piece of code from WorldEdit API
?paste
<releases>
<enabled>true</enabled> <!-- releases enabled: this specific repository also hosts release versions -->
</releases>
<snapshots>
<enabled>true</enabled> <!-- snapshots enabled: we declare a SNAPSHOT repository because we need to download a SNAPSHOT dependency -->
</snapshots>
try removing these lines and reload maven see if it helps or not
if worldtype is not the same as the world you are in
or if world has different id/name
check if you haven't disabled idea autosave, or do a ctrl+s and reload maven
we had that before^^
freejavalessons
wait, why your worldedit-core and worldedit-bukkit version mismatch?
try using 7.2.9-SNAPSHOT and 7.2.9 for both of them and reload check and see if that helps or not
Alright I'll try and yeah I just followed the guide I posted earlier didn't work at all.
last of all, if you couldn't add it as dependency then you can download its jar and install it locally
the refresh button for Marven isn't appearing anywhere is there a way to make it reload the whole pom file again?
its grayed out? or you can't find it (its gone)?
which is it
i changed the version from snapshot to only 7.2.9 as suggested for the world edit core, seems to have fixed the problems.
no more errors with imports
gl
its that because you haven't used that import in java
if you wanna get rid of that then you shall enable auto import optimization feature on idea
how to do that? sorry for asking an annoying question π¦
or just right click file -> optimize imports
you can also ignore grayed out imports (if its not too much), since its not necessary in java
figured it out cheers
that's all for now π just gotta fix the actual code errors now lol
thank you both
Thank you
yes its offline, its been about 2/3 hours now (as well as i know)
nah more then that it was off yesterday too π
ok so its much longer than i knew
how can I edit the usage message in ACF?
@strong rapidsage
@fluid river I think I've done with this. I got the wrong coordinates, and in order for FAWE to copy entities, it was enough for me to load chunks with the correct coordinates. This method gives the correct coordinates of chunks:
BukkitWorld out, BukkitWorld in, ProtectedRegion pr
final CuboidRegion region = new CuboidRegion(out, pr.getMinimumPoint(), pr.getMaximumPoint());
Bukkit.getScheduler().runTask(Main.getInstance(), () -> loadChunks(out.getWorld(), region.getChunks()));
private void loadChunks(World from, Set<BlockVector2> blockVector2Set) {
List<Chunk> chunks = new ArrayList<>();
blockVector2Set.forEach(blockVector2 -> {
Chunk chunk = from.getChunkAt(blockVector2.getX(), blockVector2.getZ());
chunk.addPluginChunkTicket(Main.getInstance());
chunk.load();
chunks.add(chunk);
});
for (Chunk chunk : chunks) {
chunk.unload();
chunk.removePluginChunkTicket(Main.getInstance());
}
}
I canβt from mobile
AT Usage
cool
@@
does anybody knows how can i prevent players to insert any items in craft slots? (4 craft slots of player)
?jd-s
i just asked a question, that ain't funny
declaration: package: org.bukkit.event.inventory, class: CraftItemEvent
declaration: package: org.bukkit.event.inventory, enum: InventoryType
cancel 1
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
cancel 2
depends on your particular case
you know to help you i also need javadocs right
that just cancels crafting the recipe not to insert the items in that slots
and well, i don't wanna google
you have the second link
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryType.html#CRAFTING check if type = crafting and cancel
declaration: package: org.bukkit.event.inventory, enum: InventoryType
i tried to search and these are the indexes, where is the crafting slot and recipe result index?
ok
nvm, thanks
Then you either mean '@Syntax'
Or not possible
seems like it is infact @Syntax
next time try to use javadocs yourself, rly helpful thing
β€οΈ
Are you overloading a sub command with different parameters?
only like 2 params
But yeah
i just dont want it to say <arg1> and stuff
?paste the onCommand method
The variable name in the method is the name that will be used
And itβs not recommended to use args1 especially if youβre working with act
you need to register the command
i didn't mean that, sorry
Acf
in both plugin yml and in plugin code
show
plugin.yml + your code
seems fine but
shouldnt there be two spaces in yaml
command:
uhcconfig:
description: shit
strange tho
it may be that but (at least in python) the yaml indentation set to the first indentation level
foo:
a:
that will make that all the indentation levels need to be of 1 space
espera
es tu on enable
public void OnEnable() {
Bukkit.getConsoleSender().sendMessage(name+"Ha sido activado (version: "+version+")");
Comandos comandos = new Comandos();
getCommand(comandos.cmd2).setExecutor(comandos);
}```
OnEnable -> onEnable
truee
and add @Override
np
what did you change?
(commands will appear just by adding them to the plugin.yml)
can you send it again
you still haven't changed
what IDE are you using?
if you use intellij with the mincraft dev plugin it should make the main class automatically so you cant make a spelling mistake
Well you shouldnt make that mistake anyway, if you start typing onEnable (or any other method that can be overriden) intellij will complete it for you
in what type should I store the "inventory of items" of the player? (in db)
its really just a list of items that the player has "bought from the plugin store" which cannot manually be altered with by the player
I would just use a list and if statements but thats like.. boring
its basically an inventory but the player cant alter it themselves, just the plugin can
(and will be shown to player when they want)
I see
also adding the @override annotation to methods you inherit will help you spot these kinda of mistakes easier too
ow awesome
I will use your lib for sure
thanks for making it public
alex strikes again
Star Wars new episode
lmao
What
im going to judge you hard for this
What did you say i didnt understand
de.morice:advancedbuilders:1.18.1-SNAPSHOT be like
snapshot means you can publish twice
Can you show us that class
so you could release updates for said version without a version bump
is there a way to just show a list of all offline players in @CommandCompletion ?
cant find anything for it on the acf wiki
I am aware.
it should be onEnable()
can I manually load a specific chunk programaticlly like the player would
Can you debug onEnable if Comandos object is being defined
Also get the string by getter methods
yes
May be plugin yml
show plugin.yml
main: UHCProyect.UHCProyect
version: 1.0.0
name: UHCProyect
api-version: 1.19
author: SoyElRafin
description: plugin
command:
uhcconfig:
description: ola
usage: /<command>```
lol
its preference but id advize intellij
thanks
they changed the UI tho
I liked the old one but this one is more efficient
i dont think so
they changed it after the new ui
?paste
With this pom.xml https://paste.md-5.net/izofimalux.xml it doesnt output a jar with dependencies i build it with clean and package
You should add maven-shade-plugin rather than assembly plugin
Can you show how would i do that
remove maven-assembly-plugin
And add this under plugins section
thanks
need to relocate bstats in that too
public class PlayerDragonSpawn implements Listener {
@EventHandler
public void onPlayerDragonSpawn(EntitySpawnEvent e) {
if (e.getEntityType() == EntityType.ENDER_DRAGON) {
DragonBattle dragonBattle = ((EnderDragon) e.getEntity()).getDragonBattle();
if (dragonBattle.getRespawnPhase() == DragonBattle.RespawnPhase.END) {
Bukkit.getLogger().log(Level.WARNING, "Dragon is not finna spawn");
e.setCancelled(true);
}
}
}
}```
i need help, the code never reaches Bukkit.getLogger().log(Level.WARNING, "Dragon is not finna spawn");
its supposed to cancel a player spawning a dragon
then the respawnphase is probably not END at the time of spawning
Heh. See that's the hard part
We don't really have API for that
I suppose what you could do is check if Registry.MATERIAL.get(material.getKey()) == null
If it's null then it's not enabled
Probably works
no, that doesn't work afaik
Yeah pretty much
its just a simple registry for the enum values
Is it a simple registry?
yeah, it filters out legacy mats, but everything else is there
neither of the experimental annotations are runtime, so you can't check the enum field for an annotation either
And I'm super hesitant to add Material#isExperimental() because I really hate adding new switch statements that need to be constantly updated and maintained lol
i tried start to
too
how about you just merge the "nuke enums" pr
π
Listen if it were up to me I'd love to
I'd take my approach instead lol
Yeah or a Set or something
p.playSound(p, Sound.AMBIENT_CAVE,1.0,1.0);
hey guy , can someone tell me whats wrong with me code ?
i dont wanna use world play sound , i wanna play it just for one player
like this ?
p.getLocation().playSound(p, Sound.AMBIENT_CAVE,1.0,1.0);
no
https://www.spigotmc.org/threads/a-modern-approach-to-inventory-guis.594005/#post-4553427 you should read this
very much better
use better one like the one on spigot
Copilot, like in most other places, is wrong here lol
this.usersConfig is null. Pretty descriptive stack trace right there.
isn't it just @SuppressWarnings("deprecation")
I mean with the right arg ofc
but, that's how I remember it
Create one file per player.
Dont throw all players into one file.
Name the files <UUID>.yml and put them in a userdata folder.
Hey!
I made a reload command that probably isnt updating changes from config.yml why i need help :c?
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
// Load config if not exist
plugin.saveDefaultConfig();
config = plugin.getConfig();
String noPermission = config.getString("messages.noPermission");
String reloadMessage = config.getString("messages.reloadMessage");
if (sender instanceof Player) {
if (!sender.hasPermission("craftedby.reload")) {
sender.sendMessage(noPermission);
return false;
}
}
try {
config.save(new File(plugin.getDataFolder(), "config.yml"));
plugin.reloadConfig();
} catch (IOException e) {
e.printStackTrace();
return false;
}
sender.sendMessage(reloadMessage);
return true;
}
Why does every create a field to store their plugin config?
it's the quickest way to break things
people not willing to listen
I don't understand the need to be rude when I came here for help, not for criticism.
π
Nothign rude in that comment
i already read the documentation
saying people not willing to listen?
no ones give me a response :s
he was talking to me, so still nothing rude
tell us what is not working as you expect it to
config.save(new File(plugin.getDataFolder(), "config.yml")); basically plugin.saveConfig()
Yeah sorry im working with the help of chatgpt haha
But this thing dont work at all
eww
yep, change that save to the one Fb showed
Ok
I keep thinking of Basil Brush when I see you type π
I doubt you know who that is though
i dont
k i did this:
@EventHandler
public void onJoinEvent(PlayerJoinEvent event){
UUID playerUUID = event.getPlayer().getUniqueId();
File userFile = new File(TenguCore.getInstance().getDataFolder()+"/userdata", playerUUID.toString());
FileConfiguration userConfig = null;
if (!userFile.exists()){
userFile.getParentFile().mkdirs();
TenguCore.getInstance().saveResource("userdata/"+playerUUID.toString()+".yml", false);
}
try {
userConfig.load(userFile);
} catch (Exception e) {
e.printStackTrace();
}
}
and maybe thats the best
should i use config.set(""); to set some paths?
probably best https://www.youtube.com/watch?v=cnfs8wvXgpA
is this "bad code evening"?
u talking to me?
why is ant and decks saturday night takeaway in the background at the start
either use the system seperator, or use nested File
cmon dont associate that with me π₯Ή
π¦ π₯ π₯
this is really bad code evening
hm?
what is this crap
go atleast look for it then
π
you again
You have to tell it βgo find it thenβ
The whole string iirc
Unless you mean in the actual expression itself
Yeah, $0 as the replacement is just the whole string
It's whatever was matched
""$0".toUpperCase()" uh?
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
code without context hmm
for me its discord crashing
did you add the dependency?
are you using maven or gradle?
the dependency tool
are you using intellij?
fuck my life
do you have a build.gradle file?
lemme guess, the dependency you're trying to use does only have a jar
then somehow figure out how to add a jar as dependency on eclipse ig
bruh what can you import and what not
i have no clue without screens
how are you exporting yoru jar (if you are)
assumed his issue was that external dependency that wasnt added
or, in the project window do you see a pom.xml or a build.gradle file ?
eclipse user π€
me π
is the tabcompletion still that bad?
you're used to it ig
i was thinking of using neovim with some plugins but that doesnt really give the experience of a real ide
honestly just use vscodium if you wanna get barebones if you want the whole vim thing you can just grab the vim hotkeys extension
i once had vscodium taking down my whole os π
wtf u using bro π
idk i was having some issues with linux
just switch to a stable OS like fedora or ubuntu and you'll be fine
i thought about wiping my os today but my backups didnt really like that
who even transmits 60 gigs of vms to some cloud provider π
backups π bro just don't backup anything
then cry when you loose everything
you wouldnt be the first one
I have like 20 years of backups. HD's just keep getting bigger so I get a bigger one each time and save it all
I've had my entire OS die on me before luckily in most cases its not a drive failure and you are able to transfer your info even in cases where its not most of my important stuff is on github
I keep everything. Even game patches from the 90's π
My OS ended up dying because of a GPU failure NVIDIA shipped me a broken 1050ti back when I bought my first PC
so you just have a bunch of hdds?
all in servers. I just keep getting more π
did you invalidate caches
i only wish i could say tht
usually intellij starts magically working when you do that
most things start magically working if you invalidate cache
as an avid vscode user I can not relate
I've only had to invalidate caches once
it was cuz I borked something though wasn't even my IDE's fault
i only invalidated caches once to realize it was me who cant write proper code
it was 8am bruh i was still sleeping
thought the compiler was doing dumb things
Why am I making a spanish translation to my plugin when I barely speak spanish π€¦ββοΈ
what am I eve ndoing
wasting your time
spanish dictionary is my best friend :}
The old version of the plugin I'm forking has a german translation
bro I ain even speak german I can't update this shi
just leave it like that
or do the google translate move π
laughs in german at the end user
if I were to use anything it'd be DeepL
which was originally made for English to German translation I believe
gotta keep it fun
deepl π¦Ύ
π
lol
wait my english was confusing it with isOdd
oh I thought for a second the asserts were their attempt
you can do micro optimization and do a little
if(test != 2 && test % 2 == 0) return false
and also start test at an odd number and += 2
to skip half the iterations
because any prime number above 2 is odd
Makes sense, but never trough of that lol
use chatGPT
[ViaVersion] You are running an outdated Java version, please consider updating it to at least Java 17 (your version is 16.0.2). At some point in the future, ViaVersion will no longer be compatible with this version of Java.
I updated to Java 17 and now I can't run the server
Unsupported Java detected (61.0). Only up to Java 16 is supported.
Which plugin does cause this error? Or is it spigot? What version are you on?
1.16.5, the plugin named ViaVersion is causing this, but now I have run BuildTools and it's updating to Java 17
Oh so that's also from ViaVersion?
why are you running 1.16.5 still
Oh no this one is from start.bat
It's better to build the server on
Well in that case I guess spigot 1.16 does not support java 17
Maybe, we'll see after buildtools is done
Yeah rebuilding with java 17 could also help
@tender shard Jefflib has a hologramManager but it's deprecated
What's the alternative
iirc its deprecated bc its temp
you can probably use that one just expect some errors or bugs
π
hi, i am working on a /spawn command, you have to stay still and not move 10 seconds and then you will be teleported, whats the best way of doing it?
storing the uuid and the Sys.currenttimemillies in a hashmap?
and having a loop?
cuz doing it with a scheduler is very difficult
store their uuid in a set and check if their uuid is in that set on playermove event
also check if getTo and getFrom are the same
so you dont stop it from them looking somewhere
no, looking is alright
ive done that, but the teleport part is difficult
and only cancel if it isnt
store the task and if they move cancel that
Map<UUID, BukkitTask>
how?
but u can spam it (with cancelling it and then doing it again) and u get a lot of bukkitschedulers
keep a task, in a map
Yeah when I did that spigot updated to 1.19.4
im starting to love c++ lol std::function<double(double, double)> whereas in java DoubleBinaryOperator
you can only store 1 value per key in a normal map
I don't want 1.19 bro π
how?
private Map<UUID, BukkitTask> playersTeleporting = new HashMap<>();
public void startTeleport(Player player) {
playersTeleporting.put(player.getUniqueId(), Bukkit.getScheduler().runTaskLater(plugin, () -> {
player.teleport(location); //idk what this actually is
}, 20 * 10);
}
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
if (!playersTeleporting.containsKey(event.getPlayer().getUniqueId()) return;
if (event.getTo() == event.getFrom()) return;
playersTeleporting.get(event.getPlayer().getUniqueId()).cancel();
playersTeleporting.remove(event.getPlayer().getUniqueId())
}
that could be improved
but thats the general concept
lol the formatting
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
How can I use Java 17 for 1.16.5
chatgpt just keeping itself busy writing a whole char table
hellooo what is the octave generator? can't find info on google
I don't want to use 1.19
1.8 to 1.11 Java 8
1.12 to 1.16.4 Java 11
1.16.5 Java 16
1.17.1-1.18.1+ Java 17
If I remember correctly 1.16.5 will happily run on java 16
Yeah it is running on java 16
what does 1.16.5 even do better than 1.17 or 1.18
uhh its older and has bigger number at the end
duh
if thats not a good reason to stay behind what is
i wish java had that 0...9 syntax kek
c++ doesnt have things java has and the other way around :(
Oh that is nice
Sadly this applies to everything
Languages
Minecraft editions
Etc
I'm having some issues including submodules in the main export file
With maven I run package/install on tlib-parent
Oh then I was doing it right
lol
Do I still run package on parent?
Or the dist module
iirc you run it on dist
Thanks, will test
I still can't figure out how to actually shade all submodules
check jefflib
?paste ur dist pom

How convenient
java.lang.NoSuchMethodError: 'void net.minecraft.world.entity.Entity.setInvulnerable(boolean)'
you didn;t remap
Ugh
?nms <3
did you do that in every module?
the modules contain the NMS so you need that in teh pom of every NMS module
Wait I just thought of something
If my library includes nms
Do plugins that use it as a dependency also need to do the nms stuff?
shouldnt need to
you shoudl be exposing an API
I am
So that means
In plugins that use my lib, I use normal spigot dependency?
Without remapped
yes, the plugin is just api access
Cool
all nms is hidden behind your api
Hello, I have a towny server and during pvp, if the pvp status is turned off in towns, the players cannot hit each other.
so they can escape to town
I installed the combatlogx plugin but it didn't work
wrong channel, but thats correct, unless you force it worldwide as an admin
Elgarl I just had an idea
I'm going to try to make Holograms compatible with adventure components
sorry for wrong channel, how do i force it as admin
You need the Towny discord
there are a few different ways, depending on if you are using wars or not.
Thank you
ask in Towny Discord
does anyone know if theres a server for protocollib developemtn help
or can I ask here
?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!
so that's a yes? i was unsure if i could ask protocollib questions which i why i asked if i could.
anyways:
for some reason when trying to getChatComponents() from the PacketContainer from the system chat message, it does not return the chat component whilst everything i've checked shows that system chat message should have that chat component.
anyone know what font this is ihave been seeing it in loads of servers.
you can get it in vanilla
what is getChatComponents() returning?
do you know the name?
not how it works
how can i get it
it returns an empty list
is it a color code or what
an empty list or a list with one entry which is null?
list of size 0, empty list
nah it uses certain russian characters and all
So, turns out I'm not the first one to run into this and found another issue on GitHub with the same problem as mine. If the chat component in the packet is null, you have to e.getPacket().getModifier().read(1), and then cast it to BaseComponent[]. Thanks for your help all!
this?
I'm assuming as I don;t use protocol lib
this is from 2019, basecomponent is not kyori and is deprecated
ill try with component tho
public class blockPlace implements Listener {
@EventHandler
public void onPlayerPlaceBlock(BlockPlaceEvent event) {
Player player = event.getPlayer();
player.sendMessage(String.format("%s, the item you placed is %s", player.getName(), event.getItemInHand().getItemMeta().getDisplayName()));
}
}
so ignore it or dont use paper api
Have you read anything?
how do I get the item I placed
yeah, your saying basecomponent is deprecated, only paper do that
check if ItemMeta#hasDispalyName
minecraft normal items doesn't have display names?
also it's net.md_5, isnt md_5 the spigot person
does item have display name set on meta
sadly not, you would have to format the Material#toString
then i think it doesn't have display name, read docs
ok but why did you tell me to "ignore it or dont use paper" if in the message you repleid to i said i was going to be using component instead
that's weird xd
basecomponent is not kyori and is deprecated
im telling you to ignore the deprecation warning, or not use paper api relating to that
does anyone know if you're allowed to use service providers in on load
oh mb
it works, with my custom item
but
public class blockPlace implements Listener {
@EventHandler
public void onPlayerPlaceBlock(BlockPlaceEvent event) {
Player player = event.getPlayer();
if(event.getItemInHand().getItemMeta() == DirtGenerator.createDirtGenerator().getItemMeta()) {
player.sendMessage("Right Item");
} else {
player.sendMessage("Wrong Item");
}
}
}
I did this
and it always say Wrong Item
even if I have placed the custom item
dont compare meta, use ItemStack#isSimilar
Before you continue, please do not use function names for classes. Use ThisNameFormat instead of thisNameFormat. so call your class "BlockPlace" instead, it's easier to then seperate variables and functions from classes.
so if (event.getItemInHand().isSimilar(DirtGenerator.createDirtGenerator())
What is
AreaEffectCloud
aight let me try
Okay, I'll refractor
tf
Works now, thanks @remote swallow
Alex made a hologram using that
thanks π
yeah
it has some advantages
no idea what they are
why isSimilar tho not isEqual
Not same amount of items in itemstack for example
Uhhh ebic
That thing shows only advantages
There's no way they're that much better than armor stands
Difference is AS has motion lol
thats all i could find lol
Is it new?
dont think so
ggs getting error on a line with nothing on it lol
its existed ever since lingering potions probably
Holy shit
recompile
Already tried lol
what would be the best way to store data for an offline player that resets when the server restarts without memory issues? I don't know if it would be a problem if many players joined and left and caused a lot of data in a hashmap.
run clean package or clean build if its gradle
Hey, I wanna ask something, does the custom item become a normal item when placed, or when broken?
database, json, yaml etc
I want to keep it custom
you would need to keep track of the block and drop your custom item when the block is broken
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
using that is somewhat easier
oh this is useful, thanks
how do i add clickable text to a component
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
thanks
does custom block items have TileState?
with .lore().add() it wants me to use a Component. How can I do this?
it should have a hasLore()
?whereami
well i kinda know it doesnt have a lore
its a new itemstack that I just made and I want to add a lore to it
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
use set lore and a new string list
or papers adventure alternative
will .lore().add() work?
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta

lol paper still hasn't fixed the javadocs issue=
it's been like 3+ years now
i didnt even notice that lmao
double annotations, everywhere
at some places, 4x annotations
@Nullable @Nulable List<@Nullable @Nullable ItemStack>
welcome to papermc :3
oh don't forget the deprecated annotations
I wonder why they don't add those 12 times too per method
ooooh and dont get me started abotu folia haha
"Oh, your plugin uses the regular BukkitScheduler? Ermmm....."
it needed 2 terabytes of ram for 300 players
I believe spigot ran into the multiple annotation issue recently
Itβs what happens if you mark collections and their contents with something like @urban grotto
@Nullable ItemStack @urban grotto [] stacks ?
the issue in the spigot docs was fixed like 3 years ago
[JDK-8175533] Documented annotations show up twice in Javadoc for fields and parameters - Java Bug System
Found it
yep, it's when there's both TYPE and the other thingy
spigot used to switch to jetbrains java5 annotations
but meanwhile they use sth else
I think they still use that
they switched to other annotations IIRC
I talked to choco about it a few months ago
not 100% sure but like 99% sure
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations-java5</artifactId>
<version>23.0.0</version>
<scope>provided</scope>
</dependency>
We better ask MD to discipline him
lol yeah idk
anyway, I remember that I expenrieced the same issues, and then md_5 told me to use java5 annotations
but the downside is, those do not support type annoattions
e.g. List<@urban grotto String>
it's kinda weird that it still hasn't been fixed
bump
Ok so
Between .3 and .4
Connection playerConnection = entityPlayer.connection.connection
Broke
dig through https://nms.screamingsandals.org
There it is
Ty
Wait but
How can I search for what the new version of something old was
Or like, what exactly am I looking for
I know why it doesn't work, cause the field is private in .4
and public in .3
Iirc thereβs a getter
Nope
Unless gotta go through more stuff to get to it
But it's not directly available from ServerGamePacketListenerImpl anymore
.4
do you actually need the Connection? Usually you only need the ServerGamepacketListenerImpl
Well in .3 I did
for what?
But in .4 if I can just send a packet
I don't
What's the .4 way to send a packet to a ServerPlayer
do you only send packets, or do you listen to imcomping ones?
then you never needed the now private field
you can just use the ServerGamePacketListnerImpl#send(Packet<?>) method
Yeah
yeah NMS sucks
I decidided to call nms "slughurn"
idk why but it's kinda matching name
yeah ik ik
Wait nvm I got this
anyway you can just do sth like ((CraftPlayer)player).getHandle().getConnection().,send...
I can figure it out
you dont have to get the "connection of the connection"
why can it only go up to 1.12 and not 1.8.9 im not sure why because back in 2022 this plugin used to allow me to go to 1.8.9 can someone help
wait
i cant show image
bruh
on intellij
minecraft development plugin only goes to 1.12 and not 1.8.9
how can I fix this
?
you can get verified to send screenshots
!verify
Usage: !verify <forums username>
!verify
Usage: !verify <forums username>
!verify JonsStuff
A private message has been sent to your SpigotMC.org account for verification!