#help-development
1 messages ยท Page 2086 of 1
I wonder if its because of your recursive call
or maybe the asserts not entirely sure because you only give us pieces of code
it definitely goes over every file, the file.delete() call also returns true (because assert doesn't throw error) but the files don't get deleted
are you deleting the files first before you unload the world?
no
hmmm, do you turn off world saving?
you see the deleteWorld call is after the Bukkit.unloadWorld call
not sure, where is it?
its a config option and there is api methods to turn it off
but without being able to see exactly what you are doing we can just keep guessing ๐
package com.tlw.sg.gamestate;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import java.io.File;
public class SettingsState extends GameState {
@Override
public void start() {
title = ChatColor.DARK_GRAY + "SettingsState";
World oww;
World nw;
World ew;
if ((oww = Bukkit.getWorld("NW_OverWorld")) != null) {
Bukkit.unloadWorld("NW_OverWorld", true);
deleteWorld(oww.getWorldFolder());
}
if ((nw = Bukkit.getWorld("NW_Nether")) != null) {
Bukkit.unloadWorld("NW_Nether", true);
deleteWorld(nw.getWorldFolder());
}
if ((ew = Bukkit.getWorld("NW_TheEnd")) != null) {
Bukkit.unloadWorld("NW_TheEnd", true);
deleteWorld(ew.getWorldFolder());
}
World nwOverWorld = new WorldCreator("NW_OverWorld")
.environment(World.Environment.NORMAL)
.createWorld();
World nwNether = new WorldCreator("NW_Nether")
.environment(World.Environment.NETHER)
.createWorld();
World nwTheEnd = new WorldCreator("NW_TheEnd")
.environment(World.Environment.THE_END)
.createWorld();
}
@Override
public void stop() {
}
public void deleteWorld(File path) {
if(path.exists()) {
File[] files = path.listFiles();
assert files != null;
for (File file : files) {
if (file.isDirectory()) {
deleteWorld(file);
} else {
assert file.delete();
}
}
}
assert path.delete();
}
}
ok after some thought, debug your path being sent to the method to see that it is actually getting the correct one
if the directory is empty IE a path that doesn't exist, the methods you are using still return true
because well it checks if it doesn't exist
and if it didn't exist before, well its true ๐
public void deleteWorld(File path) {
if(path.exists()) {
File[] files = path.listFiles();
assert files != null;
for (File file : files) {
System.out.println("file.getAbsolutePath() = " + file.getAbsolutePath());
if (file.isDirectory()) {
deleteWorld(file);
} else {
assert file.delete();
}
}
}
assert path.delete();
}
```like that?
well yeah somewhere output the path being sent to the method
so you can see if its getting the correct path
I have suspicion this might be your issue
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/session.lock
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/uid.dat
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/data
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/data/raids.dat
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/poi
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/poi/r.-1.-1.mca
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/poi/r.-1.-2.mca
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/region
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/region/r.-1.0.mca
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/region/r.0.0.mca
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/region/r.0.-1.mca
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/region/r.-1.-1.mca
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/region/r.-2.-1.mca
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/region/r.-2.0.mca
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/region/r.0.-2.mca
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/region/r.-1.-2.mca
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/region/r.-2.-2.mca
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/entities
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/entities/r.-1.-1.mca
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/entities/r.-1.-2.mca
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/level.dat_old
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_OverWorld/level.dat
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_Nether/session.lock
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_Nether/uid.dat
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_Nether/DIM-1
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_Nether/DIM-1/data
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_Nether/DIM-1/data/raids.dat
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_Nether/DIM-1/poi
[11:33:02 INFO]: [SG] [STDOUT] file.getAbsolutePath() = /mnt/minecraftbukkit/./NW_Nether/DIM-1/poi/r.-1.-1.mca
there were more lines but the max length for a msg is 4000
but it seems right, doesn't it?
hello guys i made setspawn command its working normal but when i call it after reloading server, server teleporting me to 0 0 0.
when im reloading server the x, y and z is setting to 0
it seems right except for that .
So, are these files symbolic links at all?
if they are that could be the reason too
How can I make this in a yml? I need to be able to go through all the plots with for each or smth and check the coords...
Should look like the picture
also, since this is a mount location, should ensure that the Java user in question has delete permissions
or that the mount flags are correct lol
Don't use assert
I thought maybe assert could have been the problem lol
It probably causes file.delete to not run
Well, it is a Nitrado server so I don't think this is a problem
wait really?
At least I think so. Lemme look at the bytecode
GETSTATIC de/geolykt/starloader/DebugNagException.$assertionsDisabled Z
IFNE E
INVOKESTATIC de/geolykt/starloader/DebugNagException.boolExpr()Z
IFNE E
NEW java/lang/AssertionError
DUP
INVOKESPECIAL java/lang/AssertionError.<init>()V
ATHROW
E:
Yep, it ignores it
Don't have an overly pedantric IDE or throw an IO exception
is there a way in which i can disable the usage of smithing tables?
I use IntelliJ IDEA
pls help ๐
i wanna disable the functionality of smithing tables
?jd-s
PlayerInteractEvent and then clicked check block type and cancel it
would it throw inventoryopenevent
prevents a player from ever opening it
declaration: package: org.bukkit.event.inventory, class: PrepareSmithingEvent
not if you cancel the itneract event first
you could
cancel the InventoryOpenEvent
if instance of SmithingTable cancel
either or works
i mean
i want it to be usable as a building block
say i right click on it with a block
with the intentions of placing said block
will that cancel the block placement?
okay so then use InventoryOpenEvent then ๐
lol alr
yeah your right
thanks
that would indeed cancel block places when you place blocks against it
How can I make this in a yml? I need to be able to go through all the plots with for each or smth and check the coords...
Should look like the picture
I recommend to not store data as yml
where then
configs as yml are fine tho right?
I guess IntelliJ Idea is decent lol
YML is around 100 times slower than bytebuffers from my experience. Probably around 200+ times slower than a raw DataOutputStream
This does not really look like a config to me
no i ask bc i do FileConfig config_struct = getRersoucr("config_struct") at the beginning of my code
then parse that
*pass
But for configs yml is fine as you will not have configs that are multiple MB is size
Yes, as you are probably going to discard all yml-specific containers afterwards either way
ok thanks
Basically the path of yml is: raw bytes (-> string) -> tokens -> java objects -> yml object -> your config object
what is the best way to build a spawn area in a world?
one block at a time
oof
well your question wasn't really specific
so...if it was me, I would use schematics to store the structures to load up
schematic structure like what worldedit uses for example
just uses NBT data
I got a random generated world where all players (around 16-32) are getting teleported into when the game starts, I need to insert a spawn area where every of these players have a specified spawn location then
Hello, fellow programmers. Is there a way to detect if a PrepareAnvilEvent is the one called when a player clicks the result item?
you would have to check if the slot clicked is the result slot its a really finicky event
Is the ip passed to getServer().getBanList(BanList.Type.IP).addBan(ip,"reason",null,"some source")
The same ip I get from player.getAdress.toString()?
Have you tried logging it
What do you mean?
ie logging player.getAddress().toString()
Oh, yeah I'm saving it in a config
why wouldn't the ip addresses be the same?
IIRC it doesnt return the same IP they're connected (IPv4) with it returns something else but you'll have to check (I think it returns IPv6)
For some reason it doesn't ban the player
you need to kick them as well
banip doesn't automatically kick them
Yeah I know, I mean they can still relog
I need a way to give a specific texture/model to a single block of any type. So if i have a row of lets say iron ore, i need to set the texture/model of just one or just two, without actualy changing the type. Same goes for entities and inventory items
custom model data
?cmd
?custommodeldata
this damn bot
if you have a bungee setup you need to ensure you have ip_forwarding otherwise their ip is the same as that of the bungee server
second you also need to ensure they can't directly connect to your mc servers in a bungee setup
otherwise it is the same as if the network is in offline_mode
this works per block? that would be easier as i thought
well
not the palaced blocks texture
but the item block yes
for the block texture you need to use something with a block state
or... armor stands but... block states are better performance wise
NoteBlocks are good for this
you can set the state while its an item
so when its placed it still has the same state
Removing the port did the trick ๐
the only problem is, that i cant change the actual type @noble lantern
Your wanting to implement custom blocks right
basicly what im trying to do is something like a polishing plugin for viaBackwards to โpatchโ the visuals of a missing type in lower versions, by taking a texture stored in a res pack
well and do the same for entities and so on
so your trying to add in blocks for lower versions when they dont exist?
if so...
or are you trying to get your current plugin to support different version(s) without throwing errors?
i dont think you can change block textures in the world
Not without overriding other blocks?
you override the BlockState
so for noteblocks
you set the note and instrument
and you can change its texture that way
Right but still
so in a way your overriding a block yes
Right
but in reality your just overriding its state's texture
Im talking about a completely new texture in the world
so you would basically register that state invalid by prevneting changes to that state
yeah completely new textures arent really possible
Without overriding any existing textures
your gonna override something in some type of way
yep, but as for blocks its relatively limited
But arent visible in then world
as your limited to the different states a block can have
IIRC using noteblocks you can have around 150 new blocks added
then water logged double slabs
not realy, for not existing blocks, viaBackwards places stone as example (on client side) to make the game still functioning, and when you break the block you get a stone block that has custom properties i think (name is chhanged an so on), so when you place it, its the same again, but for players in higher versions its the right block type
this actually isnt overriding any existing textures using these tbh but its more limited than noteblocks
iirc only about 20 blocks suported that way
i thinkg that could be a bug with via backwards itself
your better off asking the developer for help directly
instead of creating a hacky work around for it
its meant that way. For entities like glow squid as example its replaced by a regular squid with a โglow squidโ name tag, but only for those clients that use a version of mc that does not support glow squids
and your saying for clients that actually have glow squids its still doing that?
nope, for them its normal
copper ore looks like iron ore if your verison doesnt support ist, and thats what i mainly want to fix
i see
so in that case your likely going to have to replace all generated ore with a custom block of your type like in here
Youll have to use BlockState and set a block in the world with that specific state, and from there prevent any state changes on that block
Then listen for braks and drop the RAW_IRON item that you have custom model data on
by no means this is simple at all
it takes lots of work to implement
New Minecraft 1.13 secret to Adding in extra custom textures to your world, without removing any old blocks. All done using a new Minecraft 1.13 features with Note Blocks.
Watch Jansey's survival series: https://goo.gl/4Tpyjp
How to update textures in 1.13: https://goo.gl/kgiDx1
Sample resource pack: https://bit.ly/2ObhIyc
Watch Jansey's sur...
this video should help get you going in the right direction if your 100% sure you want to go through with this
you can also use water logged slabs as a custom block too
youll need to use packets to change the mining speed unless you want to add in a mining fatige effect
I personally would advise against this purely because these custom blocks are stikl acessible in normal multiplayer
In case of mining speed and all the game logic stuff, its is handled by viaBackwards, i just have to change the visuals
You would have to change the block entirely if you want the texture changed is the issue
you would basically be creating your own custom block if your wanting to this
wym?
its a sacrifice if your wanting to add in custom blocks, youll lose functionality of certain states of blocks adding these in
you just have a event that prevents the state changes of blocks you want
most of the actual breaking drops etc arent added in yet but its a very nice way to handle custom blocks
also frost thats the first time trying the method you told me to try at 20tps and actually thats barely even noticable lmao
not entirely sure if i want to do it that way but thanks for the assistance ^^
theres a few different blocks that you can do it with not just noteblocks
ie mushroom blocks, unused block states like double waterlogged slabs
either way
your gonna have to make a custom block in some type of way using one of these methods
Block states are by far most efficient way to do this as they have no performance effect on your server
when you delve into the realm of Spawners and ArmorStands lag can get really severe with just a handfull of blocks
trust me i spent many hours and days working out the best way to handle adding in blocks :p
Cancelling outgoing packets worked? Or did you end up going with something else?
verybadwords.add("kys");
verybadwords.add("ppnugget");
if (e.getMessage().contains(verybadwords)){
e.setCancelled(true);
}``` how do i check if message contains something from arraylist
I am currently using BlockPhysics event, i couldnt really get Packets working but im probably just retarded haha
i ended up forcing a block update to the player directly and that made the actual flicker barely noticable
you can slightly see a flicker but honestly im fine with that slight flicker compared to the previous flicker which was a full tick
Yeah it's only noticeable if you're looking for it
you would use equalsIgnoreCases while looping through that Arraylist
better yet use regex but, that works
k
watch when i release this someone complains about the block flicker
imma just say "no"
it will be written by me too
with 1100 words again
ill figure out the packet bs eventually
its just getting the block location from BLOCK_CHANGE that was proving difficult for some reason
I'm trying to install this library and it says : Dependency 'com.github.cryptomorin:XSeries:VERSION' not found
Any idea why?
define the version
looking forward into that
Oh got it, thanks!
you should shade it too if you haven't
if i call item.getItemStack().setAmount(0), does it delete the item entity?
yessir
or
you can getItemStack().setType(Material.AIR)
both work
well cant in this case
private static void removeOneEach(HashSet<HashSet<Item>>[] iHHS_array) {
HashSet<Item> collapsedSet = StructureScan.collapseNestedSetArray(iHHS_array);
for(Item i : collapsedSet){
i.getItemStack().setAmount(i.getItemStack().getAmount()-1);
}
}
In certain version it will delete the item if the amount is set to 0
But to be safe I add an amount check
Idk if it's a fact but it's from my own experience.
https://paste.helpch.at/ayosalisuh.cs
annyone can help me with this weird error?
im making a sign gui and it gives this error when i try to open an invertory
this is my sign gui: https://paste.helpch.at/rugahelele.java
and here i make the inv: https://paste.helpch.at/erakobexaq.cs
Hello, is there any PlayerKillEvent
You need to listen to EntityDamageByEntityEvent https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageByEntityEvent.html
generator-settings={} function in some reliable way yet?
is still guessing no, so it is time to dig out and override the generator
PlayerDeathEvent and then Player#getKiller
the entity one might be more suitable
Hes on 1.7 I think that name is changed on that version
i hope not 1.7
Unless he updated hi project in recent hours
nothing like running an exploitable version! - living on the edge of self destruction
:))
I wish dragon block c mod would update from 1.7.10
It was such a damn good mod
Is it possible to get an error from UUID.fromString("some string")?
code not available for you to update?
Negative :/
Theres another project called dragon block c being worked on but
Oh, I was more interested in preventing this, I mean, what can't a UUID recieve?
Its been 2 years my hopes are getting lower
Well say if a uuid is invalid it would throw an error
Ie if I put BigButts as a string it would throw an error
Oh alright
Normally you'll never run into this
anything that does not fit the format would error
Unless a user edits the data manually
Hi could someone give me example code of using Minecraft Server query connection?
you could just look at the floodgate code
old one got a recent update, maybe you could contact them for code access to update it to something reasonable
Only thing is
ok thanks
The OG author of that mod actually died (rip)
And his brother who is way newer to coding took on the project
So I assume that the code base would be pure tragedy to work with
floodgates primary purpose is auth for bedrock players using geyser
Someone is actively porting it though to 1.12
yeah i saw dragonball super
ok you think it's possible to extend minecraft query for custom packets?
Oh oof no updates since 2020
possible, will microsoft 2fa accept it? i doubt that
What is a good Level to pass into log when logging a success message?
you mean in the legal terms?
Level.FINEST doesn't seem to have a handler
most people already have to suppress the client blocklist lookup to prevent chat lag
no
one more question, is there other way to connect minecraft server with website besides of Query and Websocket?
we will go with yes?
half of your questions are rather version specific and depends if teh server is online or not
Oh wow even the new DBV mod thats gotten so much hype is being made in 1.7.10.....
Smh
Bruh
but most of the maps: sqauremap, bluemap, etc all communicate with the server for specific purposes. In general you would not want to query the server very much unless you want to increase latency
I'm working on a piano plugin where by the Website client you are sending Melody and Notes information to the server so latency needs to be quite good
hi im trying to make a villager go back to full health upon sleeping apparently this doesnt work
public class SleepEvent implements Listener {
@EventHandler
public void onVillagerSleep(EntityInteractEvent e){
Entity entity = e.getEntity();
if(entity instanceof Villager){
Villager villager = (Villager)entity;
if(villager.isSleeping()) villager.setHealth(20);
}
}
}```
did i use the wrong event?
you could do that through a database or flatfile access - and seaprate the sides from eachother
EntityInteractEvent is when the player interacts with an entity
ohhh
never mind i'm wrong, EntityInteractEvent is when an entity interacts with a block @spiral aurora
but presumably the villagers aren't interacting with the bed
Then i would need to connect website to database with is slow and not secure or i missed the point?
slow???
@gleaming grove you can write your own socket
does getAbsorptionAmount() work on 1.8?
huh then what event would i use then
https://www.spigotmc.org/threads/villager-bed-event.410064/ @spiral aurora best i could find with a quick google
for sure slower then TCP/UDP connection
that's gonna be too slow for playing a song note by note
the dynmap of pianos .....
umm.... nm
@gleaming grove spin up a separate socket in your minecraft server
I m not takiing about maps, but about piano player
like
if(villager.isSleeping()){
Damageable damageable = (Damageable) villager;
damageable.setHealth(20);
}```?
that makes sense
i will try
From my experience in nodejs REST servers would be able to handle thousands up requests a second, yeah websockets are likely better though
Idk how java handles rest it might not handle it very well
Yessir
it's not about handling 1000 per second
how do i get player's absorption health?
it's about how fast the connection is
with REST in any language you have to establish the connection every time
which is slower
Ahh I see now
not really
yes really
Yeah webwockets stay open the whole time so its better
he's sending each note from the UI as a separate packet
that's totally latency-bound
he wants a real-time piano to play from his website into his minecraft server
the architecture of the system is designed for what the system is actually supposed to be doing
REST has its place, this is not it
yes dynmap performance shows that well just for realtime player updates
the time between event and update is a lot less important for dynmap than it is here
if your REST call takes 0.5 seconds in this instance that's too long
you wanna be in the 1-10 ms range
Make tempo 4/4 and force requests to take one second
Ezzz
Worlds easiest metronome lmao
e
@tropic idol which one has your registration in it?
Does Google not provide any results for this?
look REST is too slow to handle piece like that where each note is separated packet which has few fields with data https://www.youtube.com/watch?v=UbgMEcTMISc
The song "Korobeiniki" is based on a poem of the same name by Nikolay Nekrasov, which was first printed in the Sovremennik magazine in 1861. Its increasing tempo and the associated dance style led to it quickly becoming a popular Russian folk song.
Korobeiniki were peddlers with trays, who sold fabric, haberdashery, books and other small items ...
and there could be X users at the same time streaming this kind of music from own browser
i found https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Damageable.html#getAbsorptionAmount() but it doesnt work
declaration: package: org.bukkit.entity, interface: Damageable
oh right
its 1.18.2
im on 1.8.8
Was just about to link that
you guys value player performance over server performance, i have no place in this conversation since there is no desire to mitigate the perceived issue
1.8 needs nms for that iirc
e
You can just run that socket server on a separate thread?
for sure
Rust with arctix-web compared to node.js express is way faster though
Yeah, rust is way harder to learn compared to nodejs anyways
I guess C server would be even faster
Binary
could anyone pls help?
Even better
C has an even steeper learning curve though
You need to manually manage memory
for a java programmer, yes it does
looks for my generation bookmarks
the server is not gonna suffer from a socket over a REST connection lol
REST works through sockets anyway
it just disconnects immediately after receiving a response
1.8 api is cursed
glad you think so
not passive aggressive, our training obviously differs significantly
trying to scale up sockets to a high number of connections isn't great, but in this use case it absolutely will not be a problem
the minecraft server will be unable to handle the players before these tiny sockets start to cause problems
- slap it on a seperate thread
it's not really about the threading
but also you can't just thread up to infinity lol
Its not but if one was seriously concerned about performance, running the socket on another thread is an option so your not on the main thread
You can until your computer explodes 
i don't think anyone thought running the socket on the main thread was an option
you'd never do that
for this type of use case anyway
You'd be suprised
Ive seen people run discord bots on the main thread of a spigot plugin lmfao
they're doing it wrong
that's not one option of how to integrate with a discord bot lol
Indeed they did lmao, I forgot who did it i beileve it was one of my friends a while back
Conclure is here get your dictionary out
well most discord libraries out there operate asynchronously
in which case it isn't running on the main thread
^
Ide need to check what JDA runs as or the other lib java has
Java has 2 discord libs for some reason
As far as I have witnessed, people just declare the callbacks synchronously
it has more than 2 I am afraid of
Oh no wtf
but anyhow, a random thread pool won't help unless you can use it properly, that is knowing what implementation suits you the best, knowing the blocking coefficient and then making sure everything is still thread safe
mye and sometimes devilish to test
https://minecraft.gamepedia.com/Custom_dimension - Gets the generator settings of the world that will be created or loaded.
concurrency in rust is fun ๐ณ
what's the disease called again you can get when you cut yourself with rusty objects?
ah yes
i have to think about that everytime someone mentions rust
would be a nice name for some framework in rust
what does the leading I mean?
?
interface
Interface
hmm, yeah not waht i am looking for
but that's what it means
Map<RegistryKey<World>, ServerWorld> map maybe
overriding dimension order - so far I have figured out I need to set the keys before generation
i have no idea what you mean with dimension order tbh lol
setting intial spawn priority to nether, end, or overworld - default behaviour is forced to overworld
in the constructor of ServerPlayer, the respawnDimension is set to Level.OVERWORLD. I don't think there's any "order" besides from that
my other experiments resulted in mixed dimension chunk generation
players also have an NBT compound tag called "SpawnDimension"
but it only gets read when players also have "SpawnX", "SpawnY", "SpawnZ" set
i'll put that down as an additional note, thanks
why tf is this working
public class Test {
public void doSth() {
Test.this.hashCode();
}
}
why shouldn't it
because you called it test?
because this is not a static field on Test
That is not how that works
You can prefix your this access
With the class you reference
It is very useful in like lambda
oh yeah for that it makes sense
Ye it's pretty useful
wait, no
this works fine in lambdas without the class name
public void doSth() {
new ArrayList<>().forEach(element -> {
this.doSth();
});
}
Yes because you are not running into a name conflict
when would I run into one?
oki
2 Classes with same name mayb
it makes sense when having an anonymous class
e.g. this
public class Test {
public void doSth() {
new ArrayList<String>().forEach(element -> new Consumer<String>() {
@Override
public void accept(String s) {
System.out.println(Test.this.toString());
}
});
}
but for lambdas I don't really see any reason, they always only have one method
okay but yeah this makes sense for Class.this to exist
til
Class.this sounds weird tho
one gets used to it
yeah that's why I wondered
i found it in NMS code but a CB patch actually removes it lol
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/nms-patches/net/minecraft/world/level/World.patch#84 and yeah they also use it within an anon class
Yea that is basically your usual usage
for lambdas it becomes kind of special
idk which release, but because your lambda basically becomes just a method invoke potentially, your thisstill references the "right" instance
you called your intellij "purple square" and forgot where you put it?
Is there a way to test if a material is a legacy material?
don't those all begin with LEGACY_ ?
No? take for example acacia boat
?
It's enum is only: ACASIA_BOAT
the enum is ACACIA_BOAT and it's not a legacy material
material names changed in 1.13
before 1.13 it was just BOAT
since 1.13 it's ACACIA_BOAT, OAK_BOAT, etc
Ah I see
Is there a way to detect the different names and convert it to the right version?
there's XMaterial and XBlock
they support all versions
ofc they are ๐
they are called LEGACY_XY for a reason ๐
I've tried to use XMaterial, but to be honest I am not succesful ๐
visual identification
explain
no
then do not throw down accusations
Hi, I would like some help if possible with developing a plugin.
I am trying to load a class which is defined inside my plugin's jar file, but I keep getting the same error all the time: ClassNotFoundException.
The error trace says that the error happens in the method loadClass which is in the class java.net.URLClassLoader.
Has anyone experienced a similar issue or have any tips for what to do?
does anyone know how to add custom ore generation to my plugin? i have been trying to figure it out for a while but cant figure it out.
what are you using?
im trying to add custom ore generation but cant figure it out, i made a generator for a custom world but it needs ores
I'm using MultiPaper, but in this case I'm getting the exact same error with Spigot, Paper and CraftBukkit
So ig it's really caused by Bukkit's code
i rather meant ide and maven or gradle
what does your plugin do? and do you have the full error?
The classes I'm trying to load are present in the plugin's jar file
oh andalso i am not using any api's other than spigot cause i dont wanna add dependencies
?paste the full stacktrace
ClassNotFoundException can have many causes, e.g. when the class couldn't be initialized
Im actually not in a position to reveal much rn. But here is a representative stacktrace of the error I keep getting: https://paste.md-5.net/sanecubuko.apache
I have a class from my plugin's jar that I'm serializing using Redisson, and I get this error when deserializing
The URLClassLoader doesn't seem to find the class in the jar
I have tried changing the classpath before starting the server, etc etc. However I always get this
Pretty hard to know without the code.
(presuming that the error is caused by it not being able to locate the class from the classpath)
I understand. Ill try to produce a minimal example plugin rn
I mean no one here is going to steal your code lol
personally guesses they simply do not load their class
How can i check if the folder for the plugin exists?
look in the directory
Ye ๐
is "ExampleClass" actually included in your .jar file?
this looks like the class really doesn't exist
btw your stacktrace doesn't reveal anything about your code besides the method and class names so...
not really a problem in sending it
what's "MarshallingCodec" line 148?
Hey does anyone know how to show essentials money in scoreboard in version 1.16.5
when you use code inspection too much and then annotated every method using other plugins APIs with this
@SuppressWarnings("NonThreadSafeLazyInitialization")
I want to make a config that stores playerdata and idk how to add playerdata in the config
a custom config file or the included config.yml file?
custom config
you can load existing custom config files with YamlConfiguration.loadConfiguration(File)
then you can use set(...) and getString(...) etc like usual on that config
then you can save it again using myCustomYaml.save(File)
ok ty
if the file doesn't exist yet, just do YamlConfiguration myCustomYaml = new YamlConfiguration();
although IIRC if you try to load a "non-existing" config it just returns an empty one anyway
kty
np
however, depending on what you wanna save, I'd suggest to use databases or the player's PDC instead
then stick to yaml files for now ๐
k
Hi i wonder if its a way i can hide a plyer but not hide in tab and not potions?
then they don't show up on tab
really? I thought they did
then sorry, idk
well you could use packets
what MC version are you on?
YamlConfiguration.loadConfiguration(playerdata);``` do i do it like this?
i am on 1.18.2 and code my own plugin
is there a useful link i can use so i know what .a and .b does for creating a npc with nms?
because youtube tutorials just have .getโฆ
but i donโt have that
think player.hideEntety works so you now find it in you'r link
no, not quite
YamlConfiguration.loadConfiguration returns a new YamlCOnfiguration
YamlConfiguration playerdata = YamlConfiguration.loadConfiguration(playerdata);
like this
oh yeah that makes sense!
k
anyone?
you should use mojang mappings
then the methods aren't called "a" and "b" but have proper names
It is in the jar file, and ive coded up an example that reproduces the issue:
https://paste.md-5.net/isotihajey.java
With server log https://paste.md-5.net/jememobeye.md
(For a user that connected the second time)
oh and how can i do that?
as I said, is ExampleClass included in your .jar file?
or is that a stupid question?
thank you
Yes it is in the jar, definitely
I can see the .class file by extracting the jar
i just have the part you gave me put in
i dont have any clue as to how this problem could be happening ๐ค Somehow apparently im not
Just show the code
It's a class used internally by Redisson, its job is to reconstruct the class objects that I've stored as bytes in my Redis server (sort of like how Java Beans works)
the problem is that it cant find the class I originally used to store the file into Redis
I have posted the code above
ic
I am trying to run certain code the moment a player hits the floor. Which event should I use to check for Entity.isOnGround()?
[21:00:59] [ServerMain/WARN]: Configuration conflict: there is more than one oshi.properties file on the classpath
[21:00:59] [ServerMain/WARN]: Configuration conflict: there is more than one oshi.architecture.properties file on the classpath
you might want to fix that too
[redisson-netty-2-11/ERROR]: Unable to decode data. channel: [id: 0xbf ... obfuscated code ?
I'll try fixing that right away
it's from when I was testing by changing my classpath (which didnt solve it)
otherwise, that might be leading into the other if its confused
What do you mean?
when you say hits the floor, do you mean dead, swim, crouch , etc?
Resolving the oshi.properties thing did not remove my problem, seems unrelated
that seems to be a log line from Redisson, the exception messages explain the situation a lot better i think
well it can not talk to the server
eitehr the connection is incorrect or the data format is not matching
I confirmed that it does talk to the server, because I managed to store a MyClass object into the server (the playerData.put line in the code).
When I try to load that MyClass from the server however, is when it throws all these errors
Well, I want to add a player to an array when they take velocity from their own bowshot and remove them from it when they are no longer in the air / hit the ground
then you need to check your reading method
then you would probably want to use the bowevent - https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityShootBowEvent.html
It is for Player.isOnGround(), but what else could I use to check if the player hits the ground?
bowevent -> delay -> check player on block
Hey everyone, can someone pleeeaaase help me:
In the newest version, 1.18.2, I can't say entity#setInvisible(true), this Method does not exist.
So how can I create an ArmorStand entity that I can set Invisible?
the onPlayerJoin method?
no : "When I try to load that MyClass from the server however, is when it throws all these error"
goofy paste
Why are you using NMS
the playerData.get(name) line is the last thing i do before the error happens
The code i sent is everything in the plugin
then playerData.get(name) is incorrect for your data
so, I actually tested this with other data types
If I use Strings in the map instead of MyClass objects, the playerData.get line works fine
I can get builtin Java types (such as String) from the map. But if I declare a map with my own types, I get these errors about it not being able to load my class.
if i recall that would mean your constructor does not behave the way you think it should
It does not...
Use the API
The constructor of MyClass?
Don't use NMS
So what am I supposed to do?
.
that would be where you create your map for MyClass is it not?
declaration: package: org.bukkit.entity, interface: ArmorStand
This is my goal
But then this is not working...
My mfing teacher
told me python which she spells (PITON)
isnt
object oriented
bro
what
fr?
damn i thought it was
google says it is
@quaint mantle What can I do so it works
i have this https://paste.md-5.net/agowuyazib.java and i want to add values like Players: 927153cb-70a8-4413-aa83-93bd76d32792: Kills: 0 Deaths: 0 to it, how do i do it?
path Players.UUID.kills?
PlayerData.get().addDefault("Players. " + e.getPlayer().getUniqueId() + ".kills", 0);
like that?
damnit spigot blocked tor gotta wait till i get home
actually
i will try to describe teh issue
so i am learning plugin development, and in the premade file there are errors on the imports
how can i fix this
blocked tor??
intellij has tor support?
no
then you should be fine
where did you put it?
how do i add a number to that?
you still need to add stuf to your maven or gradle build file
ok how do i do that
but how do i add 1 to it
then click the gradle link
I use intellij Minecraft development plugin for spigot plugins
how is this relevant?
i cant access the website, because school also has it blocked
how do i add 1 to it
use a normal browser in incognito mode
i made it but i want the value to go up
vpn
I create the map in MyListener. but creating the map itself does not cause any errors. (The code would run fine if I never called .get)
dont have one and all the free ones are shit
there is nothing wrong with the map as you write with it fine
yes, as you stated: it does not behave as you think it should
so you either need to create access to how you think it should behave or use it as you currently have it setup
where do i get the spigot api jar
I have done this to myself before as well
Im not sure what I would need to change to make the error stop appearing. But yeah this is how it stands
for plugin message channels an bungeecord how would you get the response
okay, how do you think this works for you? : MyClass data = playerData.get(name);
Has spigot no villager trade event ?
sec false
Is it possible to create an ItemStack with the material id and not the enum?
youll have to use InventoryClickEvent
and check if its instanceof MerchantInventory
Really ?
Why... there are 3 other villager events ๐
Okay then i have to figure out how i get the trade ๐
when server starts up you'll need to get the villager and add MerchantRecipe's to the Villager
whats the events?
why would you want to do that?
I don't want to add the MerchantRecipe, i want to get it after someone traded the MerchantRecipe ๐
I'm trying to create a plugin that has a GUI with items in it and make it support multiple versions
The issue is the names of the materials change over the different versions
ah you can just use inventory click event and check if the slot clicked was the result slot and that the material isnt air
anyone?
although @lunar yoke I am not really sure why you are trying to do it this way myself - i would think you'd be using playerData - err no not playerdata, name
Then i now the trade was valid but i still don't have a object of MerchantRecipe ๐
I would be so much cleaner with a dedicated event ๐
You would have to use MinecraftVersion.getVersionNumber() checks on top of changing the strings by getMaterial(string) normally
you would make your own event
that sends out the selected MerchantRecipe
So I would need to manually change every material in the game?
๐ค I'm quite sure that's what I do in the code I posted
no only ones that changed between versions
If i would needed it multiple times it would make sense, but i need it just once ๐
But its fine then i have to use the InventoryClickEvent ๐
You can cancel the even registration after it fires once
you dont use it and you dont define MyClass data type in your code
HandlerList.unregisterAll(this) after the event finishes
I did this as an example that highlights the error, I normally have a lot of classes with lots of associated data that I would like to store in various maps
incredible error messages
I do, it's in the link if you scroll down
if you add humor to error messages then bug reports become funny :))
hey there it is, its a string
I don't use it but that seems to be beside the issue since it crashes before I can get it. If there wasn't an error, I would infact be able to use MyClass
Ah, is there a list of these somewhere?
i just google the item
like if you google RAW_IRON and go to the wiki
Why do i get a warning Argument 'Main.getPlugin().langManager.getConfig().getString("noPerm")' might be null
From this? ```java
if (Main.getPlugin().langManager.getConfig().getString("noPerm") != null)
player.sendMessage(ChatColor.translateAlternateColorCodes('&',
Main.getPlugin().langManager.getConfig().getString("noPerm")));
https://minecraft.fandom.com/wiki/Raw_Iron#History
And you just scroll down to the history tab on the fandom page for the item when you wanna check what version it was added like so
Because it might be null as in that key could not exist in the config
Thanks for the help!
you can null check it to get rid of that warning
Am i not null checking it?
or is it an intellij error
IntelliJ warning
okay so
String noPerm = Main.getPlugin().langManager.getConfig().getString("noPerm");
set it to an actual variable
and use the variable
I know... I did that before, but
I need to be able to "reload" it because i have a reload command that reloads the .yml file
are you pulling that on every command
if so it will still reload it
if not youll need to reset the value with a reload() method
Look up XMaterial
That's what I'm trying to use๐
I know. But i don't really know how to use that...
But I can't figure it out
You would make a getter for your class thats using it in your Main class, and in your ReloadCommand class get the class by your plugin instance and call reload() on it
XMaterial.ACACIA_BOAT.parseMaterial()
calling parse material gives you the material for that specific version
Hmm okay... i will try to figure it out
But running that in 1.8 throws an error, am I doing something wrong?
or you can just live with the intellij warning ๐ either or
is there a way to change the server properties or do i actually have to go change the file
But then i need to do the "reload" method in every class that is using the string, right?
yessir
its best to have a ConfigFile class that handles all your variables
that way you only have one class that deals with actually pulling the values
public Map<String, MyClass> get(Object key) { return dataMapValue; } /me tries to recall if you need to create access functions for custom types? where is alex
Yeah. But then i can just put the Strings inside the reload command?
no you dont
you should be able to get("something") and it return MyClass
Hmm not sure what you mean by that
What's the error?
When I try to initialize an itemstack with the material it throws NullPointerExpression
how to can i save hashmap Key(Location) value(ItemStack) i will save it in config and then restore it
Hmm okay, I think i can figure it out
for Locations you need to store them as a key like "worldName:0:0:0:pitchHereIfYouWantIt" and for the ItemStack Yaml supports just shoving it right in the file
i cant remember if yaml supports saving a Map directly
i like getOrDefault(Object key, V defaultValue) myself rather than just get
typically when i use HashMaps its something to do with data, so default value for me is just null which is what get() will return if non found ๐
like this
getConfig().set("defchest","World: " + world + " X: " + x + " Y: " + y + " Z: " + z);
yes just know youl have to serialize that to a Location when your loading it but thats fairly straight forward process
class a{
Material m;
public a(String s){
new a(Material.getMaterial(s);
}
public a(Material m){
this.m = m;
}
}
Is this the correct way to do overloaded constructors?
what happens when you move line 50 to line 45? It would be easier than trying to create it twice and missing a new
That would work yes
new a("hi") or new a(Material.AIR);
you can do same with methods too
a.hey("hey") or a.hey(Material.AIR)
I mean that looks like the stack would overflow if you call a(String)
time to eat something today
yea i just noticed
m is NULL
do you know why
lets see then
which causes the args to not get passed properly
yea that would explain it
okay now it fails wihotu an error
fun
at least the instanticing works
instantiation?
whatever you want to call it
considering it actually failed in that class i know the code at least gets that far
apparantly not
welp
back to debugging
context?
oh
I mean thats just java
but well, its actually due to enforcement of initialization order
wekk
well
this() has to be before anything else in the constructor
similar to super() in case you're invoking a super constructor
I mean this() and super() calls another constructor of the same/super class without creating a new instance of the class
but if i write a constructor in that one i can call super() the same way as this(), right?
mye if I understood u correctly, yes
that makes a lot of sense actually
Could not find your SpigotMC.org account!
I mean not really
ye
oh no worries, I am just picking on your words a bit
ye
thats very correct 
ye
they're succulent
im using maven to build do i need Kotlin?
how do i make a player sit on a stair
I thought about spawning an entity
and assigning passenger
yea do that
but that would be glitchy wont it
how to make it invisible
set it invisible, remove hitbox etc. considering its an entity it should have functions for that
remember to remove the minecart when the player leaves it
ic
sit on a stair?
_gives @grim ice link to ancient plugin: https://dev.bukkit.org/projects/chairstairs_
lol
apperently it still works despite not being updated since 2014
any money is too much for coc
yes
oof, you could have bought me a gold taco for that much
not really
woders if i battled you once upon a time
nope, played it for about a year or two when it first came out
that sounds like a very bad idea
thats why im asking how to do it
stop the server, delete the world folders, change seed in server.properties
if you have an admin console, some do it for you
its a message in your console
so... still a no
anyone else's testing server look like this lol
you making a custom generator?
yup
playing with explosions
lol
i hate this server - (fabric server i admin)
3/4 of the startup is garbage from incompatibilities, legacy warnings, and barfs from invalid code
https://mclo.gs/sE7yZgx <- the startup of a "Better Minecraft" fabric server
is afraid that if I put it out of it's misery they will request another modpack
fabric is the future ๐ช
Indeed
of what? dumb ways not to maintain/support stuff?
fabric is what happens when u give people too much power over the platform
(((mixins)))
mixins do be kinda sexy tho
oh yeah theyre amazing for modding
yeah they're nasty but mmmfpph
but when thats like the main way for people to really mod the game... ur bound to just kinda have a cesspool unless u use mods specifically tested for compatibility
forge has its incompatible mods too but
fabric is the wild west of mc modding
so do u guys use yarn or mojmaps?
yes
yes
myes
yes
whatever is provided by default so yarn
kappa
yarn kinda yummy
did you look at my server startup?
oh yeah its fucking long
it makes me want to cry
Yeah I got a bit anxious as well
wait wtf not enough crashes isnt just a client mod?
thats disgusting
at least client u could get away with like crashing while ur connected to a server
but server crashing??? why would u want to just ignore that
it reduced the amount of messages
same with the Advancements Debug one
i found that and reduced the starup log errors from 8Mb to whatuver it is now
Um, I'm actually curious, when is the best way to use Record?
the java class record?
yes
They're by definition "immutable data carriers"
Is it fine to use it whenever I have only a private final fields on the class?
mye
well main point is that its a shorthand to writing an entire immutable data class
like writing getters, constructor, hashcode and equals take some time
and it gets quite verbose
Okay, thank you
there's a button in intellij for generating getters!!!
Cuz I really loved it lol
ye
i dont want 3 lines of code
xd
well in addition records use invokedynamic for equals and hashCode
which is super fast :3
yes method handles

lombok more like very dumb will not use
it's cathartic
I'm gonna revolutionize the server I work for, gonna put menus everywhere.... chat messages overrated
lol
hot take but I hate menus as replacements for commands
I think when commands can be used, they should be used
and menus are good for when users need to manage data
I mean when you can memorize a command, then its pretty much always faster to type than navigating a ui
zzzz

players get angry when the chat is being spammed by command shite
mye true
plus you can see all the information without having to individually click everything https://streamable.com/ptjtai
things that are ephemeral work just fine in an action bar
now that is a good use case for a menu
I spent so long making this pagination interface, that I'm gonna use it >:(
what if the chat moves as you're pressing yes and you click another clickable chat message
u could smash my tunnel
ayo
then that's unfortunate
indeed
there's a thing with the conversation api we have where you can't get messages while in it, iirc
but you couldn't get it working before. What changed?