#help-development
1 messages · Page 941 of 1
i'd feel bad even asking that much from you.
you know
what
after reconsideration, maybe i'm missing out. i'd happily join your medieval minecraft server.
i'd happily be your developer for free.
You can do as much or as little as you want
@alpine urchin
Mostly we just code stuff for like kids to play with
in any case, the site tryitands.ee won't solve my problem)
If ur interested u can dm me
So how much do I have to pay you to be a part of your server @restive mango ?
is it possible to get the contents of a generated (loot) chest before a player opened it?
It doesn’t cost to join tho
Oh, if it's not your server then I'm not sure I would want to continue then.
Do you know how to code?
Yup
How many bits are in a bit?
Do you mean byte
Hello there , it tells me that the byte is wrong and give me an error :
its for 1.20.4
the 5 should be head slot
Now tell me, how many bits are in a bit?
Hi.
equip packet using protocollib
for 1.20.4
The thing is, wiki.vg/Protocol represents the actual network buffer
if iam not mistaken
the lowest level
ProtocolLib reads NMS packet classes
using reflection
so just because in the network buffer it is written as a byte, doesn't mean NMS stores it as a byte.
NMS could store it as an int
your packet api you made is amazing but it does have allot of stuff i don't need so iam creating my own .. 🙂
So to be safest, decompile NMS minecraft, and see what data type represents what you are looking for
and see that in this case it isn't a byte
👍
alright thanks
what does it have that you don't need
the plugin size is becomming almost 4mb
really huge ..
Boolean, byte, short, int are all considered to be 4 bytes in the JVM
Ofc reading it from the network is different
what's your point
Point being it doesnt matter what nms stores it as
Ah
cause he needs to compare with NMS and not wiki.vg/Protocol
wiki.vg/Protocol describes how the actual buffer is read and written
which may not always corrospond to the data type stored in NMS' wrapper
I've contributed to wiki.vg/Protocol
I haven't
But it's a common mistake people make when dealing with ProtocolLib or their own packet libraries.
No, it's not silly.
Register a handler in netty after decode & decrypt
Process
Reset position
Done
no funny business
Ofc you & nms are now deserialising twice
But please dont act like reflection is better
😭
well the thing is , i wanted to make it for diffrent versions so , 1.8 , 1.16.5 , 1.19.4 , 1.20.4 , and so on
only this major versions
ik it change how it read the data bettwen old ver , and new
I don't think you fully got my point.
Are you using ProtocolLib or your own little utility or whatever.
protocollib
I would redirect you to their github issues
but i will make a moudle system so i can make diffrent code for spwan , despwan, editMeta for entity for diffrent versions
try
instead of
getBytes()
try something along the lines of getItemSlots()
or so
something with itemslots
enumitemslots
I didn't design ProtocolLib so I don't know.
is it possible to get the contents of a generated (loot) chest before a player opened it?
That's a really good question
depends
if the loot is 100% the same every time cause of the seed
then yes
idk how helpful that answer is
i did this ,
Load the chunk the loot is in
and i still get the same error 🙂
no thats not working, no tile is generated then
Afaik it generates during chunk gen
Oh
you mean if every chest has the same loot?
i will try to fix it later
no it generates when a player interacts with it sadly, but I can't fake this, can I?
Do what he does for the most part
please help)
Push player interact event with fake NMS player 🧌
what is a "NMS player"?
An instance of an implementation of the “Player” interface
ah yeah alright
If you’re gonna be fucking with nms you may as well call the generation method directly though
Hence why I put the troll because its a suboptimal solution
are there some api stubs for the net.minecraft source? Im pretty new to spigot api tbh
does it make a difference really
If i have 3 config files how do i get a string from one of them? do i just use getString("patj") or is there a other way that i need to use?
im tired
hi tired im epic
the difference being?
one used to be the real package one wasnt
net minecraft server used to be the package all code was in but they removed that
you guys mislead the poor soul
fun fact
net.minecraft.source (or maybe net.minecraft.src) was used, but by OptiFine
who cares about optifine anymore
idk i use sodium
optifine is the most intrusive mod ever
i havent installed optifine since like 2021
I use it on my phone
?
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
the path
yeah no shit, "path" is the path inside the config file
Indeed net.minecraft.src, it was used in old ass versions of mc and everyone adapted to it back then
🧎
Forge 🔥
so i was right lol
just a bit very old
How can i use Mojang Mappings in gradle?
use maven
No other way? Gradle has a better syntax
paper has tooling for gradle iirc
just gotta watch if u only want to use spigot api stuff
i use patrick choes remapper
I use myCoffee remapper
Links to the sources?
not really
Tell em’ man
I just prefer gradle over maven
Dont we all
use patrick choes remapper
i love maven
bc paper is gonna be breaking stuff soon
no, no we dont
🥸
i just hate pom.xml files
why
they are kinda ugly
Are confusing for me, to long
it's just XML
yall acting like you have to look at the all day
blud is writing eXtensive Markup Language to build a java/kotlin project
XML is used in a lot of places
"writing" not like the IDE does it for you
you likely just copy-paste the dependency tag
exactly
Heyo, how would I get the number of matched results outside of the async task? (Also would appreciate if someone checked if my code is alright, didn't test it yet)
public int addMessage(String message){
Bukkit.getScheduler().runTaskAsynchronously(Main.getInstance(), new Runnable() {
@Override
public void run() {
try (Connection con = Main.getInstance().getHikari().getConnection();
PreparedStatement insert = con.prepareStatement(INSERT);) {
insert.setString(1, message);
int matched = insert.executeUpdate(); // I want this
} catch (SQLException e) {
e.printStackTrace();
}
}
});
// To be used here
}
Any help appreciated
You’ll probably want a “callback” to execute when its finished
Yuh, and how do I do that?
completeable futures >>>>
addMessage(String msg, Consumer<MyResultType> callback)
This also
but Kotlin Flow better
Would futures allow me to do what I said? Or is it just something that would help to improve the code
futures can do that
Alr, will look into it, thanks
read here
What's the best way to get an instance of a vanilla enchantment from it's name?
arent they just enums?
they are badly named
iirc it got updated recently and you have to get it from the registry
From what name, the Enum name or the registry name
or just make a big switch
in 5 yesrs someone will show a screenshot of thats to my boss and ill loose my job
Yeah I was planning on using the registry
are there some api stubs for the net.minecraft.server api I can use in intellij?
Just wasn't sure what the best way to get a suitable NamespacedKey was
api stubs?
yeah like api docs for the package
declaration: package: org.bukkit, class: NamespacedKey
There are none
hmm, then is there the source code or anything I can import into intellij so I can have autocomplete
What version do you want to work with
Ahh thank you
1.20.4
?nms
?paste
thank you, do I need to use this jar to launch the server or is it just for the IDE?
I really dont understand this error and how i fix it
https://paste.md-5.net/tituwinoru.sql
Main class: https://paste.md-5.net/agolefizil.java
private static final Economy economy = new Economy(); is line 16
Is the economy class you're importing yours or is it part of an external library?
BuildTools is used for building the Spigot jar since it cannot be shared. It also takes care of remapping the jar and installing it to your local maven repo
Its fron an dependency
Great so that dependency must be on the server, or shaded into your plugin
And if it is there make sure to add a depend field on the plugin.yml so your plugin loads after your dependency
Ohh yeah, thx. Its the depend part i have forgot
Now im getting an "plugin already initialized" error, do you know how to fix that?
o_o are you creating a new instance of your javaplugin class
I'm sorry if I'm bothering too much, but could you give me an explanation/example based on the problem I sent? I don't really understand how to implement it into the code
Do I have to make my database thingy into an interface or somethin?
or you extended JavaPlugin in more than your main class
public CompletableFuture<Integer> addMessage(String message){
CompletableFuture.supplyAsync(() -> {
try (Connection con = Main.getInstance().getHikari().getConnection();
PreparedStatement insert = con.prepareStatement(INSERT);) {
insert.setString(1, message);
int matched = insert.executeUpdate(); // I want this
return matched;
} catch (SQLException e) {
e.printStackTrace();
}
});
}
// use in another method, formatting will be fucked up for the code above
Thank you
oh look this idiot didn't ping me this time
public CompletableFuture<Integer> addMessage(String message) {
return CompletableFuture.supplyAsync(() -> {
// Run the blocking code here
return 123;
});
}
addMessage("Joe!").thenAccept(value -> {
// Do something with the value, this will run after the blocking code is done executing
});
@tribal cypress
Main.getInstance().getHikari().getConnection()
this makes me sad
yes
Ty nerd
wlcm
Hm now I got the following error: (I didnt use maven before)
Failed to execute goal net.md-5:specialsource-maven-plugin:1.2.2:remap (remap-obf) on project Looter: Error creating remapped jar: Unsupported class file major version 64
using jdk20
Use jdk17
okay, just a general question, why is this so strict? Most of the time there aren't even big differences between java versions
There were some major differences in 21
Everyone knows they just increase the version because they feel like it
Thank you very much!
@remote swallow Thanks to you aswell!
Followed this tutorial to get myself more known to HikariCP, what's your method of getting the main class?
I usually just pass the main class instance through a constructor, but I don't see a problem in doing this
I'm just not a fan of the class.getthing.getthing.getthing lol
Why don't I have a setTitle method?
https://imgur.com/SmfrXYh
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/InventoryView.html#setTitle(java.lang.String)
Ah, ofc, I guess that's a personal preference for everyone haha
You're probably on an old version
I'm using 1.20.1
so that would be why
how do I override the chunk generator of an existing world?
do I just bruteforce it with reflection?
What is loading the world
hey, apologize for the tag. but where is GsonSerializer from?
Thats my Gson wrapper...
Im close
appreciate that! 🙂
You can just clear the ctor
The idea of this class is that you can dynamically add type adapters whenever you need to.
I was a bit bothered by the fact that you couldnt change the Gson instance after building it.
Sure. You can just create an instance of this and then pass it around and let everyone regster their adapters or even
change the builder dynamically.
how ru even initializing this
I dont use this annotation anymore. But ive written this a while ago so there it is
oh damn im blind
why do some people use nms for there plugins
bc the want to do stuff thats not possible with api
Because some functionality can only be achieved by tinkering with the internals
Ahh alrigth
please help)
There's a map data packet you still need to send
PacketPlayOutMap?
for example java ((CraftPlayer) player).getHandle().playerConnection.networkManager.sendPacket(new PacketPlayOutMap(yourMapId, 4, false, true, new ArrayList<>(), yourByteArray,0,0,128,128)); I can get the mapid via MapView.getId(), but what is byteArray?
it's the colors for that map
how do I get these colors?
You might be able to get them from the craft map view
can someone help me or give me an exmaple of the worldcreator.generatorsettings
i try
worldcreator.generatorSettings("{layers: [{block: stone, height: 1}");
I still can't find the method, maybe use the getPixel(x, y) function somehow
map the colors to a byte array
and you can skip the mapview entirely
will it be on 1.12.2? and it converts the color to byte but I don't quite understand how do I get the colors from the map
you are using 1.12.2?
i found MapPalette class
yes
why
because I want to)
well we don't want to support old versions
try it and see if it works
if it doesn't, you might be on your own
I sense a disturbance in the force, as if a developer just nuked a codebase because the code was all garbage and has rewritten it to be marginally less garbage, but it still debugging it
no
F
Sorry for bothering again, do I put the Bukkit.getScheduler().runTaskAsynchronously(..) into the "blocking code" part aswell or nah?
You don’t need to run an async task inside a completable future
well
Awesome, thanks
I retroactively justified spending little under a week playing with godot by changing these to use transformation matrices which is what I should've done in the first place had I not been so lazy
I'm hoping I"m down to the last issue, a mismatch between pivot points and model centers
Can anyone help pls ? I have trouble saving the fake water block its not working , i added all the code i can
https://github.com/el211/FakeWater/blob/master/src/main/java/com/afelia/FakeWaterPlugin/FakeWaterPlugin.java
After restart I loose it
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
I save it to a data file
Does the file have the correct data
Data yml
Yes the coordinates are being saved
But the block is becoming normal water
It’s loosing its ability of fake water
anyone knows whether i could delegate to Configuration without that default param constructor thing?
class Config(
private val plugin: X,
private val fileName: String,
// yes this is ugly but who cares, at least we aren't manually delegating anymore
private var config: FileConfiguration = YamlConfiguration.loadConfiguration(File(plugin.dataFolder, fileName))
) : Reloadable, Configuration by config {```
delegating like that needs a primary constructor parameter, it doesn't need to have a default value tho
I even added the methods to save the fake water block been on this a lot 😭
Location is directly configuration serializable
Just save and load it directly
last time i checked it didnt allow it when i did not declare it in the constructor, lemme check
so why does it have an onEnable
either ur creating antoher instance of ur main class, what coll said. or theres 2 of your plugin in ur plugin directory
Poor naming choice then
What
yes it needs to be a primary constructor parameter
disturbing
… seems pointless but okay
why cant they just be 1 plugin
1 plugin without any internal plugin loading
that doesnt stop it being 1 plugin
everytime i say 1 plugin i mean 1 plugin with no internal loading
i dont see a reason for this to have internal loading at all
it doesnt make more sense for that
it just makes it more confusing
I still don't see a legitimate reason for this
what you are trying to do is both impractical, and frankly, stupid
and ultimately useless
Keep your plugins separate.
If you have shared functionality, move it into a library
and depend on that
No, it does not
it makes no sense
How do I not know?
there is no server that would need something like that
X
and is doing things the wrong way
But 5 plugins run 10000% worse than 1 plugin with the same features
Source: dude trust me
okay, and
you also have 1 giant glaring issue, if 1 of your sub plugins error they shut down the entire plugin
doesn't mean that the idea is wrong
everything shits the bed not just that 1 feature
Mans taking 'loose coupling' in the opposite direction and fast
Separate your plugins
once you have done that, then we can help
“Somehow”
Bruh the code didn’t just magically appear
You wrote another onEnable at some point
ah yes this is valid syntax
class Config() : Configuration by YamlConfiguration.loadConfiguration(File(plugin.dataFolder, fileName))```
Okay well, someone did
whose code is this then
why aren't they the ones asking for help
okay, remove the second onEnable
again, separate your plugins
butter has your profile picture change colour
and check how you're initalizing
yes
according to you, it has modules/sub plugins
citrus
each of those become 1 plugin
by not implementing 2 plugins in 1?
you literally just said you have like 4 different plugins in 1
which is it
time for you to go and read the asking for help post
go read this (look at me go illusion i didnt ping you)
okay, so remove the second onEnable
then refactor it
make it work
none of your code should depend on onEnable(), really
onEnable should setup things that other parts can use
That would be ideal, yes
when asking for help with code it is good to show said code
I told you
refactor out the second onEnable
and see what coll said
dammit you cant even change a delegation impl at runtime in kotlin
🤔
🤔
🤔
would it work if i use Bukkit.getServer().getOnlinePlayers() in the onDisable method?
ok, thanks
That looks epic how did you do it
Display entities are love, display entities are life
it's freeminecraftmodels, well, it's the rewrite from hell that took way longer than it had any reason to because I was lazy at first and ended up working for nothing
it supports both armor stands and display entities actually
and should automatically assign based on server version and client protocol
Ohh
(via floodgate)
well so do you so what does that really amount to at the end of the day
well I don't really care because ngl even though I have the code for it I have not implemented scale yet
and I don't think I will do it right now
hm
I think mine does scale
yeah no I don't really care right now
Tbh I never tested it
I just want to put this out
But it’s part of the matrix so it should work
took me over a month to go back on what I said on day 1 and just implement transformation matrices
should've done that on day 1, I would've been done by day 2
hell it took me like 3 hours to do and most of it was ripping out the old code
Yeah it took me like a week of bashing my head against 3 vectors to just switch to matrix4f
How to get double chest items with block?
https://www.spigotmc.org/threads/cant-get-doublechest-instance.496585/
I have the same problem, but I want to get the items, not the block itself
if a little kid sees that they're never playing minecraft again
good, these experiences build character
I am a panda and I must A̶̐̚s̶̯̉c̵̅́ë̷́̆ñ̵̊d̸̀̇
Why didn't you donate to the panda drive, Steve? Do you hate pandas, Steve? Do you enjoy watching me suffer, Steve?
When its EntityDropItemEvent called? I was thinking its called when u kill entinty, but is not
When entity died it drop items, looks like its handled by EntityKillEvent
Its not at least for me in game mod 🤔
its kinda wierd imo, but its mc nothing special lol
thanks for explanation
is this how super works?:
we have an abstract class with a constructor accepting x,y and setting them
and we have a class extending that abstract class and it calls super(10, 20);
so now if i call getX(); in the extending class will it give me 10?
Yes
well this is a fun bug
my animations are playing 3x too fast
and I can't figure out how I did that
then just multiply the time for each frame by 3 or divide each movement speed by 3
public CustomItem(String id, String name, Rarity rarity, Type type, CustomEnchantment[] enchantments, Material material) {
this.id = id;
this.name = name;
this.rarity = rarity;
this.type = type;
this.enchantments = enchantments;
this.material = material;
}
// com.amirparsa.skymine.customitem.store.WoodenPick -> super("WOOD_PICK", "Wooden Pick", Rarity.COMMON, Type.PICKAXE, new CustomEnchantment[]{...}, Material.WOODEN_PICKAXE); | getName(); -> "Wooden Pick"
like this?
what?
panda is now off his cocaine
What is a good way of delaying/cancelling all AsyncPlayerPreLoginEvent's if onEnable isn't finished yet? My data is getting corrupted if I start logging in before the server is on 💀 do i like use completable future or something
they cannot enter if the server has not finished loading
i can start logging in with asyncplayerpreloginevent
and I create a new data profile if the player doesn't have one yet, so it is important the dataprofiles are all loaded
It should be impossible for that to fire before onEnable has
'EnchantmentWrapper#getName()' is deprecated
what should i do then
getKey().getKey
alr thanks
will it return something like DAMAGE_ALL? how can i convert it to normal names like Sharpness
oh alright I think i found the issue, i was loading data before the data needed to load the data was finished loading cause its asyc, so i use thenaccept
wait so it will return just SHARPNESS? i dont have to do any conversions?
no
no for no it will not or no for no need to convert?
no need to convert
alright thanks
lore.add(ChatColor.AQUA + "|- " + enchantment.getRarity().color + Utils.getFriendlyText(enchantment.getEnchantment().getKey().getKey()) + " " + RomanNumber.toRoman(enchantment.getLevel() + (enchantment.getLevelMultiplier() * level)));
``` so it will be this?
Which option offers better performance? 1 world for fishing and another for a separate mine. or 1 world for mine and fishing, where the mine is 1k 100 1k for example and fishing -1k 100 -1k
I would imagine the single world
worlds are more heavy than chunks i think
Yes but it’s not really a big difference
is there still not a big difference if I make a seperate world per skyblock island like hypixel instead of generating an island every 1000 blocks in 1 world
xd
you are comparing 1000000 worlds with 2
i'm pretty sure the personal islands are seperate worlds, you only have the players visiting the island on tab and I read a devlog
Can anyone tell me if worldborder loads the chunks I want? for example, do I want to load some chunks in 1000 100 1000, others in -1000 100 -1000 or am I forced to load the entire area between 1000 and -1000?
but if you want the most performance you should create a ubuntu dockerfile that runs a server with a configurable port, two servers one for fishing and one for mining the u will use kubernetees to launch 2 new servers each 10 players and you will make a custom bungeecord network that will intergrate with the kubernetes to balance load and create a fully custom player data system and you will store the player data on a MongoDB database and sync the servers
Yes
And only so many run on one server
will spend + performance this way
1000 servers, each server 10 worlds, holding your skyblock islands
oh yeah true i can't afford too many servers so i'll just keep them in 1 world xd
nah will just take about 2 years and 5 millioon dollars. not that much
But if the objective is to spend less resources, will I now buy a new machine? Keeping data updated between servers and going to the database to get the data has a performance cost
😂
With a simple proxy and like, a redis cache you can easily do 100+
Which version
Latest
in 1.8, I host 1000 players on a 20 dollar ovh ded
1.8 is much cheaper 😂
Log4J entered the chat
I said 100+
Of course what type of gameplay you are doing also matters a lot
For skyblock you still need most vanilla mechanics intact
you either get your players/server hacked or use a later version OR spend 100 BILLION dollars buying mojang and forcing them to fix log4j on 1.8
was fixed
the hypixel .jar doesn't run on spigot 1.8?
they haven't been hacked yet 😅
Tbh we have no idea what it runs on
1.7.2
Probably isn’t even close to a real minecraft version anymore
You can also just
When typing /ver doesn't it say it's spigot or bukkit?
its a highly modified spigot fork
and it should run 1.8
its so different i better say its a spigot spoon rather than a fork
1.7.10 optimized for all versions
Does bukkit not use the minecraft api?
if the minecraft api is completely obfuscated, how did the bukkit developers do it?
“Api”
There is no api
Anyway, people decompiled and remapped the code to be somewhat readable and went from there
In the context of programming, "API" stands for "Application Programming Interface". An API is a set of rules and definitions that allow different software to communicate with each other.
Basically, an API defines how software components should interact. This includes what operations can be performed, what data can be accessed, and how it should be formatted. APIs can be used to allow communication between different parts of the same software, between different software, or even between different operating systems.
APIs are fundamental to modern software development, as they allow developers to create applications that easily integrate with other systems and services, without needing to understand the internal details of those systems. This promotes code reuse, simplifies development, and makes software easier to maintain.

minecraft didn't make an api, but it is possible to communicate with the game, so when it says minecraft api it is the code itself
What they code it has real mappings so real names
whats have better performannce?
setBlocks
but replace method filters the blocks, but I don't know if the cost of setting fewer blocks is worth the cost of the filter
help
If you want to know, try timing them
whats the captxha plugin ill send in dms
Why is my custom entity spawning invisible?
super(((CraftWorld)world).getHandle());
}
@Override
protected void initAttributes() {
super.initAttributes();
setSize(3);
}```
new SlimeListenerEntity(player.getWorld()), player.getLocation());```
```public static LivingEntity spawnEntity(Entity entity, Location loc) {
entity.setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
((CraftWorld)loc.getWorld()).getHandle().addEntity(entity);
return (LivingEntity) entity.getBukkitEntity();
}```
It is there because I put pressure plates and Its talking about... just i cant see it lol
You’d have to debug further then
Is it actually invisible (does it appear in spectator mode) or was it just never sent to the client
Appears to not be sent to client as it does not show in gm3
Alright then it may be an issue with the tracking system
Does your code for the entity do anything else
nope just spawning with a command for now to test it
Does it use the standard EntityType.Slime
where woukd it? i posted all the involved code lol
Wait what version is this
I know for a fact latest requires an entity type for the entity constructor
Hey guys how do you prevent a dragon egg from teleporting on right click/left click?
this one is an old plugin.........1.8
1.20.1 btw
Hi, I just got back into java dev and am trying to get a plugin going. I have IntelliJ with the Minecraft Plugin plugin installed, and am creating a plugin with Maven, it's being built on my Jenkins server, however when ever I load up my test server with the plugin installed it kicks out an error shouting about "plugin.yml" is not found.
Having said that; plugin.yml is absolutely there. I opened up my .jar with Java Decompiler and I've noticed a very odd file structure that I think is the issue here. Is this right? https://i.imgur.com/Ptbtg9D.png
Here's the console error: https://i.imgur.com/VhNDYZy.png
Your jar file didn't compile correctly.
It's more or less an exact export of your IDE structure, which it shouldn't be.
?paste your pom
Note: I have moved the location of "resources" to multiple locations to check if that was the issue
Would it be reasonable to have a single Inventory instance for GUI that is shared between different players?
So they all see live updates?
Or should I create multiple inventories and update them all in a loop?
plugin.yml should be in the root folder
Did you copy this jar file from your jenkins instance?
So I tried that too, and the above screenshot of the file structure continues to create "main"
You can see the last "plugin.yml" in the above screenshot, that's directly in the root folder, yet when compiled it tosses it in "main"
If you are using maven you should only need resources directory placed under /src/java
Did that too, I'll move it again and recompile.
What does your pom xml look like?
.
I love when people think out and give backup logs and images for their questions 🙂 (not sarcasm)
https://i.imgur.com/U4OS170.png -- Compiling and pushing to Jenkins now.
If it’s a static inventory a single instance is fine
why not compile locally for now?
If I have user-placed blocks generating items on top of them every X interval (unique per placed block) -- would the best way of generating those items be;
onChunkLoad (or similar)
readFile (Get block location and rate from file)
- see if any "generating blocks" are in that chunk
- then spawn the item above that block's location
I struggle with thinking of the "most optimal way"
The items will update when interacted with. So it will be redecorated
In your pom remove src directory setting and resources section
This should resolve your issue
I am so far in the weeds of re-learning I've forgotten how to do a local compile without Jenkins while using maven and such, but sure I'll give that a shot too
Testing now
Is the update meant to be global
You only set those if you have those things not in usual places
If its intelliJ theres a big M on the topish right click that then run mvn package
yes so they don't override their changes. It's an admin UI
or just run from console
I'd like them to all be up2date whenever something changes
Then yeah a single instance seems fine
could you show the original file structure in your IDE
You also want to run package goal. Should compile and make jar
before compiling
alright. Just gotta figure out how to deal with multi paged inventories then (so they all can open seperate pages) but I'll find a solution. Thanks!
https://i.imgur.com/cq3yrpC.png As of this second
Single. You can set it the view to be the same for all of them.
resources should be same level as java
So multiple inventories but same inventory view is what you are suggesting?
Easiest way for this is to use multiple inventories for each page
That's where it is right now, unless I'm reading this wrong?
wsup
Oh no I see what you mean
Single inventory per page with same view. This way they see same inventory and view without having difficulties in changing what they see when going through pages
one level up
not sure if it matters for maven but you can also flag it in IDE as a resource folder
yeah because its a package
You can move the files directly though your file manager.
IJ should update accordingly.
I also have a collection at the moment.
But I guess I'll have shared inventories that automatically update on changes for the one-page inventories and non-shared ones with extra code for updates on paged ones.
Oh we're talking about inventory frameworks
I have removed that section from the POM, https://i.imgur.com/qbSAnDr.png
resource folder is gone completely
You can’t send the same view to multiple players afaik
openInventory always makes a new view
You still need it though. At least for maven projects.
Paginable menus should all be done in the same Inventory instance in order to not reset the cursor
Well the problem is that clicking something on the third page will move it to the first page to mark it as selected. So all items are shifted by 1 slot.
It just needs to be moved up one directory level.
The cursor doesn’t reset anymore
/src/main/java
/src/main/resources
Isn't the solution to this just making the clicked item highlighted in the current page until you change pages?
yeah that's a blessing
Mark as resource in File>Project Structure> Modules
and
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
in build tag of pom
thats how i have mine setupo
Oh that's actually an idea. I could add the enchantment effect to it to show it has been tempered with.
Now try to package it and see what happens.
resources folder is completely gone, trying what @drowsy helm just said
Ok what mc version are you targeting?
What's your project structure look like now?
1.20.4
Change java version in pom to 17 minimum
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>```
^ 1.17
Change to 17
instead of 1.8
Just 17
ok
They dropped the 1.x at some point
Try doing a clean build now
Okay, doing a clean build now
Just for clarity sake, you are using the maven tools and not the IJ artifacts correct?
Guess we find out lol
using jenkins, so i'd assume so
But i will let you guys take care of the rest. Have to go fetch a truck lol
Trucks are pretty heavy to pick up
Okay, so moving from 1.8 to 17, that was the only change that I did, that worked. plugin.yml and config.yml are now present in the jar file
Hey @young knoll, you remember how you mentioned fixing the spigot update checker to actually check against recent changes instead of just checking if a month has passed?
I figured out how to do that, but I was wondering how much more needs to be added to a system like this.
I was initially wondering if there should be a threshold that needs to be passed before it causes the startup delay, but now I'm wondering about urgent updates and how those should be handled.
¯_(ツ)_/¯
Does it cause significant startup delays doing the web request
Tis another concern
So why did that fix it? Can someone explain this so I know for the future.
It can as evident from work with BuildTools. 😢
However, there may be some checks we can do beforehand.
Could go with a small timeout ig
I don't question the java gods
Alternatively do it fully async, but then you can’t delay startup
Because the dependencies you are using are compiled with java 17 and since you told maven to use 1.8 it caused it to be weird and silently erroring lol
GOT IT. JAVA GODS, MY MISTAKE FOR NOT SLAUGHTERING A CHICKEN PRIOR TO CODING.
Lmao
The method is based off of the /version command and it does make a web request, but I don't have a bad connection to test latency with.
Thank you everyone, I appreciate the support. I'm sure I'll be back again.
Oxymoron.
I was thinking about the async thread, but yea... no way to do the startup delay then.
Unless I just want to say fuck whatever is going on currently in the main thread. :kek:
get them a visa
You'll have to send a fake border packet to the player you want to show the border to
not sure if theres any spigot api methods to fake it though
World border?
or is it you want all players to be able to go through?
Use world guard
Player#setWorldBorder() exists though. :3
there ya go
This would be a good time to mention I use 1.3 Bukkit
world border is clientside though so they wouldn't be able to pass throug hit if it were visible
Set world border larger make a region less then it and then you can designate who can or cant leave that region border
I suppose you could just not delay startup and go with a massive red message
Maybe throw in an ascii art of
for good measure
Do you know off the top of your head what the experimental jar does with it's startup message?
Does it also delay?
Its based on time so it shouldnt
Even if no updates happen if a certain amount of time has passed it would still show that message lol
That's not ideal. lol
Yeah well that is how it works. The time is set at compile time
Yea, but I'm wondering about the experimental jars in specific in order to maintain consistency.
The other way it shows that message is if it detects updates
It should be the same. Not sure why it would be messed with in experimental jars
Thought it did detect if there was a new version
Only with the command. Not at startup.
What is your background?
There is a flag you can use to bypass the delay just fyi
Lets see if you can find it
I know. :3
Shouldn't it actually check against current versions instead of time alone?
Can't we control the timeout?
Sure
You could set the tcp timeout to anything all the way up to like 24 hours if i recall
Gonna move to the datacenter rq
So hear me out.
If we need the timeout to be 30 seconds, then that should already act as a delay of sorts.
However not sure if increasing timeout in application bypasses the system timeout though
Yes the OS imposes timeout on connections
Just not sure if applications can go beyond that. Setting it lower shouldnt be an issue however
The alternative is to not delay startup but print a big red message
Or idk, just nuke the server when the result is ready
Kek
System typically has a timeout of like 1 minute or something like that. Some linux os's still have values of 5 minutes if i recall. Longest timeout value set by the system that i have seen was like 30 minutes but dont remember which os that was
Which is insane lmao
Is the only way to check connectivity to ping another site?
Cause if there is a way around that, it could just skip the web request all together if it has no connection.
Wait, what if I check against network interfaces?
Common way is to check dns
Yes but you do a icmp on dns address or a known good dns address
Tcp ping is slower and most hosts except dns block icmp
Icmp is better because no tcp overhead.
Is that still going to be a blocking request though?
Did something changed between version 1.20 and 1.20.4 for the entity spawning?
I get a NoSuchMethodException on
'org.bukkit.entity.Entity org.bukkit.World.spawn(org.bukkit.Location, java.lang.Class, java.util.function.Consumer)' in older versions.
I checked the docs and the method of RegionAccessor seems unchanged between versions
itemDisplay = world.spawn(location, ItemDisplay.class, item -> {
// Some stuff here
});
We changed it from a Bukkit Consumer to a Java Consumer
Ah ㅠㅠ
If you compile against the 1.20.(1?) API, it won't be able to run on versions before that due to the change. If you compile with API versions before that change, it will work across all versions
Pre-change it will compile looking for org.bukkit.util.Consumer and we can ASM transform that. Post-change it will compile looking for java.util.function.Consumer in which no method with that signature exists until after that change
Indeed the Consumer is from Bukkit before that. Alright thanks I'll change the API version then
Yeah I don't remember which minor version exactly it was that made the change
Could check the commit history. It was definitely a 1.20.x version though
Imagine having your own consumer class
It was 1.20.2
Don't worry I'll just change the version to something I know was using bukkit cons
Since the import is implicit you can't see that without knowing ahah
So is there no way to take an item stack and either hurt an entity as if it was used or to just get the attack damage of said item?
Id prefer not to manually code every enchantment lol
hello
can i get some help?
when i try to get a list from messages.yml is empty
the path is ok tho
this is the path
and this the impl https://paste.md-5.net/fiticiwepe.cpp
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
ah you were faster :)
the empty exception i made is being thrown
what is the path you call the function with?
commands.eco.pay.cool and commands.eco.pay.also-cool
both of them in different usages
Where do you initialize the var configuration?
onEnable
Can you show us?
and then
this is the Configuration impl = https://paste.md-5.net/asuyosuleh.java
( scoreboard config works perfectly )
But what is the "configuration" variable in this code?
is the path to your messages.yml correct? Where's that?
no where's the path inside your code
oh
Alright
wait
i didnt delete
messages.yaml
and it didnt update
it works
lol
kinda buggy
but works
Sounds good :) I'm sure you'll manage to fix the placeholders
thanks btw
yeah
hahaha
I dont think it is
declaration: module: java.base, package: java.net, class: InetAddress
Best effort is used. If java is able to use icmp it will otherwise it will use tcp on port 7 which is still a privileged port so can still fail if the application doesnt have sufficient privileges
can u help me?
kinda hard for me
HAHAH
this is the method im using https://paste.md-5.net/qezosaqoca.php
but
wait
i mean i have a list of messages, iterate over that and then in every iteration use the placeholder in that message
and then add it to a new list of messages
and return that
That looks overcomplicated.
Why don't you just use replace in your double loop?
and I'd prefer streams
I mean it does look right to me. It should work. Unless the .use() does some weird stuff
why don't you just use .replace()? Is a Placeholder a Closeable interface?
it just replaces
lol
oh I see. I thought it is the "use" function of a closeable interface
got confused by the name
your break is the problem
You are breaking once any string is blank
So you are not replacing any further strings.
So unless all of them have text you are aborting
It should be a continue
yw
Guys im searching for a plugin where i can spawn skeletons with spawners but at daylight
Does anyone know one?
Please ask in #help-server
When you say check dns, do you mean check locally through the machine's resolver or literally just pinging a popular dns server like cloudflare (1.1.1.1) or google (8.8.8.8)?
Wouldnt make much sense to go through machines resolver of you are using icmp. Just need an address that is known to be outside the hosts network
Pinging google might be easier to do then trying to fetch the dns of the adapter
So you would create an inetaddress object of googles ip and then use the method to see if it can be pinged
You can set with the method max hops as well as timeout
I seem to be getting weird results with it.
public static void sendPingRequest(String ipAddress) throws UnknownHostException, IOException {
InetAddress address = InetAddress.getByName(ipAddress);
System.out.println("Sending Ping Request to " + ipAddress);
if (address.isReachable(5000)) {
System.out.println("Host is reachable");
} else {
System.out.println("Sorry ! We can't reach to this host");
}
}
#getByName() says it supports the regular web format. www.google.com
However, it keeps failing.
When I do a manual ping to google.com I'm able to get a response.
use a URLConnection over an InetAddress as the Inet is getting messed up by a redirect
If you are going to use getbyname it makes no sense to isreachable because getbyname requires a dns query
Just use 8.8.8.8 as a configurable default for checking purposes and dont do any resolving
I’ll attempt more tomorrow. Gotta get to sleep for work in the morning.
Work is over rated
Money isn't ☹️
Well that is how you learn to make money without working
That is the goal people have right?
I wish. If I don't get a job at an IT company before I'm 22, realistically I get drafted to serve at the Russian army
Should probably move
Depends where you move to lol
Additionally I probably won't be able to legally move until I'm of the age of 30+ (where I can't get drafted) or unless I am proven to be uneligible (e.g. some serious illness or smth)
Depends on what laws they start passing lol
And to move you kinda need money and to know the language. I currently only know English and N4 Japanese
Just become a refugee. Go to another 1st world country. Get adopted by rich people
Problem solved
Risky shit 😬
Worst case is you just end up in another 1st world country where your prospects of needing to serve in the military is less
Well in my current 25 year plan for the future I want to travel to Japan for about 3 months to form an opinion on whether it's cool to reside there, and do the same with Germany
Travelling I can definitely do safely
And if things go right I might migrate randomly lol
Travel to the US 
I do not want to pay 500000$ for an ambulance
No one does
Welp there you go
The cost just goes to your insurance and that is assuming it was a private ambulance. Second, medical debt is one those that is extremely difficult to collect on more so if it was incurred due to an emergency
The people who claim they pay for an ambulance are the ones that dont know how to bill their insurance lol
I've heard plenty good things about insurance companies specifically in the US 😬
Its not as bad as people perpetuate really. Many of the low income people dont pay medical costs or a large portion of it as its usually subsidized by the goverment or the medical facilities or both
Mainly because you cant collect debt from someone who has no money anyways
Also known as judgment proof
Well one more thing I dislike about US (and consequently my current country) is its eagerness to partake in conflicts
Thats the US military for you. We been conducting war for like 30 years straight
So we became really good at it lmao
Yep and I really really don't want to be a part of it
Then dont. In the US there is no requirement to join
Who said things won't spiral out of control?
Unless we have a draft but we havent had a draft since ww2
I really don't wanna talk politics because that is a very controversial topic. But with the shit going on in the world right now, it's not foolish to doubt the "stable" things that we've become accustomed to
Even if it does. The citizens of the US have a say. While you could technically punish some who dont follow the draft you cant punish millions either. Also a draft can only happen if congress agrees to it and we have formally declared war on someone
Fair point
Also the US and canada is pretty well protected in terms of anyone wanting to attack that it is essentially suicide for anyone who tries
Pretty sure there is a couple eu countries similar in that regard
Well I guess I'm still yet to do deeper research on countries to migrate to, like my itinerary for the last 18 months has been "Japan, Germany or Iceland". The US might be fine, I'm just doubtful about it, probably actually because I know it more than any other country I researched. E.g. I'm watching a Tyler Oliveira video right now at this instant and all the present problems are evident, meanwhile I've only read some articles on the countries I've been thinking of, because I have yet to learn the native languages to really be submerged into content. You bring up good points, so looks like I'll have to do new research lol
Idk what present problems you refer to but even if you are not a citizen here you still have rights. This cant be said of some other countries.
Japan might be nice to visit but you need to have some education as far as i am aware to get a decent job there even if the job doesnt really require the education. Germany as far as i have been told is decent for migrating to just dont pester the police lol
Canada may even be an option but it does depend where in canada. I probably wouldnt advise mexico
Well since the US is really open to free speech, all the true colors of the country are discoverable, and by that I mean that there are just as many negative information mediums as there are positive ones. I've learnt about the healthcare problems, I've learnt about the prominence of political discrepancies, I've discovered Tyler Oliveira and tens of other outlets that talk about lesser known stuff. The amount of negativity spread around the US has kind of built a bias against me, as opposed to Germany, Japan or Iceland, which of course have their weak points, but I've heard a magnitude more positive things than negative. And if I talk shit about Russia publicly I may not even see the day I migrate 💀
Yep, that's my current view too
There is health care problems but its mostly for the low income people like super low income. And it makes sense because the US government cant just provide free healthcare and it cant really force the states to do so either unless they foot some of that bill. Some states cant afford that cost no matter what and the states that could would need to create new taxes for it. However many states do subsidize healthcare for the low income in various ways. Also you cant be denied emergency treatment either regardless of financial status
For the US government to provide health care to everyone it would cost somewhere in the trillions to do it
how to find out what entity the player is looking at?
RayTraceResult rayTraceResult = player.getWorld().rayTraceEntities(player.getLocation(), player.getLocation().getDirection(), Bukkit.getViewDistance());
Entity entity = rayTraceResult.getHitEntity(); // HERE IS PROBLEM
if(rayTraceResult.getHitEntity() != null && entity instanceof LivingEntity){
((LivingEntity) entity).setHealth(((LivingEntity) entity).getHealth() - damage);
}
cuz it gives null
That's understandable, though can it not be done via taxes? Not totally free of course but at least to bring the prices to an adequate range
Most states do this already and many states require businesses to provide health insurance to full time employees. Health insurance through my job right now would cost me $30/month.
For some what decent insurance it costs like $100-$400 depends what options you want or dont want
I can easily afford with my current job $400 a month for insurance
What do you think of the view that "insurance companies are never your friends", in the sense that they'll do everything in their power to avoid paying the bill? And suing a potentially multi-billion dollar company is basically never successful
This isnt the case for all insurance and it depends on your coverage. Where some go wrong is when they are getting treatment for something that isnt life saving but they hit their coverage limit
Once you hit that limit its a case by case thing whether your insurance is going to continue to pay. But this is where we get into the realms of finance and many americans not taught proper finance and everything that is at their disposal
You cant assume an entity exists without first checking
if(rayTraceResult == null)return;?
Probably best if you first checked if entities are even nearby
If they are find the ones ahead of the player and then do your raytrace to those entities
If I may I wanna provide an example. There's been a large terrorist attack in Moscow recently and the government is paying $5000 to every outpatient. Do you think that would be enough to foot the bill in the US? I've seen some outrageous medical bills and not sure how true they really are
I read somewhere that it can rayTrace can hit the player himself, is this true? Do I need to do a check?
It depends what was needed for your treatment. $5k is probably sufficient for anyone not needing life saving treatment
I suppose it could if you started a raytrace from a location that is not the players
I'm asking because these are the first photos I get when I look up "us healthcare bills". Surely this is not ok and is an exception as opposed to the norm?
Just as i expected from looking at first pic. So we have a thing called private hospitals. Kaiser is one of them. Not just anyone can go there. Emergency room is an exception depending on what level trauma center they are and whether or not they accept government money.
Private hospitals I know of yeah, I think every major country has some 😄
