#help-development
1 messages · Page 1019 of 1
Hello, I have finished your guide for menus, but you have not covered the pagination. Do you have any suggestions on how we can achieve this? @lost matrix
covered it where?
?gui
Multiple approaches for this. Set some elements fixed in the GUI (should be shown for every page). Then create a List of GUI buttons, define how many of those should be visible
per page and refill the GUI depending on what page index you are on.
I personally make my menu systems work on "layers"
So we have a "base" layer with the default stuff, and a "paginable" layer
With multiple "paginable areas" which are just a fancy List<Integer> + List<MenuElement> type deal
for my 7x3 paginated UIs, i have a List<T> with all elements, then just a Map<Integer, List<T>> with the pages and items, then some buttons to cycle between the pages and split the items into three rows
Lol
Do you think it makes sense to set metaData for players when they open a menu? @lost matrix
smth
pls use an ide 
why dou need to use metadata
eclipse is an ide?
It looks like an ide to me
doesn't count
eclipse looks like madness
Lmao
im sorry
its by definition an ide tho
What about 🫘 Beans 🫘
i like Eclipse.
And thats fine
I do not, but use whatever you prefer
I love Eclipse. Multiple projects open at the same time
thats why im using it.
Literally all users of IDEs other than IJ flex on me with that
Seeing as I never work on one project at a time, it's perfect
Let that sink in VSCode
Last time I talked to frostalf he was recommending netbeans to me like it's gonna change my life
just open ~/IdeaProjects
Lmao
I once did that with my downloads folder
Ij took a while to finish indexing
Its possible to change color of liquid in cauldron? I cant find image in texture files of some cauldron with liquid so I wander how it is working.
Damn
Obviosly I will not make plugin for bedrock edition, lol. So its not possible in java, saad
Bro paused for a sec to destroy the happiness
@lost matrix im trying to paginate like this. its seems work. But i feel its not best way to do that.
add it to cabernetmc
damn 
are you saving the player data in yaml?
yes
isn't better in json?
no diff
hm
gson exists but yaml is better supported
Im thinking how to store honey or some other liquid in cauldron or somthing like this. Probably its possible when I will add custom block but Im not sure why I cant find filled cauldron textures in resourcepack files.
idt you can store honey
water and lava only iirc
in caultron? nop I tried
as in yes it works or no it doesn't?
u cant stored honey in cauldron
then not possible
i have a lot of questions about this architecture
What does idt mean
but i guess 7smile is too busy
i don't think
Identificator tarball or what
what texture is displaying vanila in cauldron? its displaying texture of stored liquid? bcs I cant find full cauldron textures

7smile?
ig the liquid texture?
the one that would show when you place it down
Bros demons get distrubed by that screenshot

looks like it, hmm, I probably can make custom block and display that, but I will need make 3 block per liquid, bcs it can have 3 stages fuck. Or just found other way of doing that idk how lol
Would you kill me if I put you into a room where the walls, floor and everything else are that screenshot
just make a custom model
for the entire thinf
yes
happily
i would like to see it
if you show me
istg if you make a map art of that in smp and trap me there
pretty sure he's under an NDA
No, no, absolutely not
What would make you think thaz
and bedrock doesn't use traditional menus
ah
we use forms
I definitely am not farming blocks for that
yep.. sadly there is probably not other way, thanks
most flexible way so i don't get the sadly there
this is a REALLY REALLY old version
im using this @echo basalt
bro pinged lukas
yes sorry about that
i'd recommended to just use something like interfaces by incendo
lukas is at work stockpiling bananas rn
auto complete thing
My menu system is the best 👌
I will need to interact and do thinks with them that's why xD btw. what is better option to create custom blocks? item frame/display entity/armor stand?
display entities + interact entities>>>>>
https://pastes.dev/GGD3fBD508 if you're interested this is my version that i wrote a while ago, it does use kotlin and interfaces-kotlin
Gotta post mine now
can i dm to you @echo basalt
Since I'm in love with mine
why you are using this at BaseMenu:
private final List<Runnable> closeTasks = new ArrayList<>();
for animate buttons ?
because it's old
It runs every runnable when the menu closes
you can do stuff like
menu.onClose(() -> ...)
i ain't reading allat
No
i decided to use 7smile7's menu system. its more reusable and simple for me.
I basically use what 7smile7 did in his guide with tweaks to make it better
but i realise im noob at writing lambda expressions.
300 lines to make a simple menu
yike
wait it's kotlin omg
how we observe which menu opened then.
I'm embedding my events so yes
if I separating them into different classes it would be much less lol
what do y'all think of mine
kangarko guy using metadata stuff a lot in his menu system.
i mean i'm using a pack
well kangarko is an ...
[insert drama here]
was that the one guy who took quotes out of context
I prefer things hardcoded. I don't like giving users too complex of configs
that's how you get misconfiguration of silly individuals
Yeah, it was the person that would take a quote from a context where someone bashed on him and tried to spin it in a good light
Doesn't need to be complex
just using it for my plugin aswell 
tf is that

if you don't have hardcoded slots do you not have to redirect to specific events. Atleast in most menu systems that's done via a classpath to a specific method or handler
Both of your menu systems are great, but for me, 7smile7's menu system is the simplest and most maintainable. his system handling events well.
and looks very clean
I'm not saying it isn't ¯_(ツ)_/¯
Not arguing about this, you asked for an example and I gave you one
I mean its subjective kekw is that not why we all have our own system
its what works best for you/us
pretty much yeah
yes
Mine's made for the commission market instead of my own plugins. Users want configurability, they have all of it
oke, thats 1.19.4+ thinks but thats not a problem. thanks a lot
the API is in java dw baby
7smile7's is made for simplicity. Dude made a guide, no need to overcomplicate
all of my libs are in java
same p much
kotlin my beloved
just need to make a standalone version
tf is this
how's C++ btw
Get paid well per hour
we use geyser
I did some heavy internals
added custom entities, now I've been working on surface scanning
Got that done last night
I actually was doing that in the exact time of the message lmfao
go back to banana, lukas
🤪🤪
I'll come visit you tomorrow
@lost matrix I've been using kotlin at work lately
what's your opinion on this company-inflicted torture
should I sue for mental health issues
okay bro
Yes. That is indeed unavoidable.
alr omw
@shadow night DONT YOU FUCKING DARE
i love omg so fluff
why we shouldn't use metadata on players when player open menu @lost matrix
i removed metadata stuff but how we can recognize which menu opened
.
that's what they were talking about
ah ok
olivo pink too?????

and whats the problem with setting metadata to players.
back, do i need to change more?
Am I stuck in a time loop or what?
its just silly there's no point
what
what do you gain from setting metadata when they open the menu
not to mention metadata is leaky
Just let the inventory track data
You've sent that message a few times before, no?
Can plugin interact with mods in events?
why you mixing them
Not I but this nevermind
getting menus from its InventoryView.getTitle is leaky as well.
why not?
As long as the classpath is set up correctly there is no issue
that's why you don't detect menus that way
use a proper manager
also its not leaky to do it that way
its just a shit design
metadata literally leaks memory
Only if you don’t remove it
what is the event when a snow block appears or ice block appears when its snowing
Should be fine if you cleanup after yourself
all 1 person who actually removes it kekw
true 
Let's say they create a new mob through a mod and I want to control it through a plugin)
- Metadata is rubbish
- Spigot already tracks the inventories opened by players
you can do that
but you're on your own
Head over to the discord for the hybrid you're using
and see what exactly they do
or you know actually just make a mod??
Lol
Eheeh
to add kangarko is not the worlds most amazing example I'd take his suggestions with a grain of salt
generally speaking the menu design 7smile7 has in his guide is very effective. for pagination its just having multiple arrays internally
you can replace all of the slots or some of them depending on how you want your pagination setup. Which is the perk of such a flexible bear bones guide and system
indeed cring
can someone help me with my plugin error?
https://pastebin.com/KEgUscJ7
if this is the full stacktrace ask paper
alr thx
who who?
who he
its not important
hello, i have a question about death chest plugin @hollow tree
is the chest countdown active when the chunk isn't loaded? like if i die 2000 blocks away, will it count down only when i'm nearby?
Does anyone know about creating plugins? I need a developer
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
#help-server or go to the developers discord
based server name
i can))
could someone tell me why this is a list?
Can we discuss it here?
MessageToMessageEncoder
yea
I think he wanted to order something
In fact I would need a plugin that could differentiate the creative inventory from the survival inventory to avoid cheating. And at the same time prohibit certain commands
do you see what I mean?
Not having the same inventory in survival and creative
deepl badly translated
?
you not can have same inventory
this is vanila logic
How so ?
Order it, I don't know much about java
How would i cancel that a block that explodes because of another block drops itself at the BlockExplodeEvent. When i would cancel the event it would cancel the explosion for all other blocks. I have a DaylightSensor that i drop naturally with some NBT data and wanna remove the original drop. I couldnt find a way
Are you sure you want the BlockExplodeEvent and not teh EntityExplodeEvent?
Block = Bed, Entity = TNT
Yeah thats the right event but i listen to both. But both just give the explodedBlock list
What is causing yoru explosion?
getBlockLIst and remove yoru block from it
but isnt that just a copy?
no
Ahh okay nice thanks
Hey, i'm trying to use jitpack to make my own api but when I try to use it in maven it doesn't find the dependency I've created the tag/release already
what java version does your API use?
often the build from jitpack fails because it uses an old maven and java version you need to add a jitpack.yml or sum in your api so it uses the newest versions
You can check if the build failed on the website
https://jitpack.io/ Check if the build failed
Yea, it was using java 1.8
then add a jitpack.yml as Justin said
changing the api version in your pom doenst help. When i tried it didnt work but maybe i did something wrong
let me try ig
This is GM's jitpack.yml for java 17 https://github.com/ElgarL/GroupManager/blob/master/jitpack.yml
i have tacospigot
Too old! (Click the link to get the exact time)
do you mean a custom modelled entity with resource packs
or an actual entity that the client renders itself
unless you are writing a plugin you are in teh wrong channel.
are you making a mod
tell us, are you making a plugin or a mod
bro
well you told us
...
?whereami
spigot has nothing to do with mods
not possible with spigot
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
it is possible, but outside of the scope for this discord
i doubt they're looking for spigot derivatives ngl
something something modelengine?
💀
why don't you ask them
?whereami taps sign
then go to their support
you want to ask us if another discord supports something?
instead of asking in their discord if they do?
Tacospigot is a fork of paper
tf is tacospigot
and why would they call themselves spigot if they're a paper fork
pretty soon we will have burrito derivative

yea i saw
someone know how to fix this?
java.lang.NullPointerException: Cannot invoke "java.sql.Connection.prepareStatement(String)" because "this.connection" is null
Method:
public void initializeDatabase() {
try {
String query = "CREATE TABLE IF NOT EXISTS PlayerStats (" +
"UUID VARCHAR(36) PRIMARY KEY," +
"Name VARCHAR(20)," +
"Kills INT DEFAULT 0," +
"Deaths INT DEFAULT 0," +
"Kill_Streak INT DEFAULT 0," +
"Max_Kill_Streak INT DEFAULT 0," +
"KD DOUBLE DEFAULT 0.0," +
"Bounty INT DEFAULT 0" +
");";
PreparedStatement statement = this.connection.prepareStatement(query);
statement.executeUpdate();
statement.close();
} catch (SQLException ex) {
this.plugin.getColor().sendConsoleMessage("&7Failed to connect with PlayerStats table: " + ex.getMessage());
}
}```
get teh connection when you need it. don;t store it in a field
Your connection is null
how can i do it?
waow
You need to init the connection
hi
Hello
i forgot what i wanted to ask
xD
lmao
an example? i just started coding in java
how do i make custom pickable items using item displays
how do i detect if a player goes inside it
add an Interaction entity
that makes it so they have to right click on it
same place as your ItemDisplay
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
unless i misunderstand interactions
an area, a boundingh box
you could, but thats more work than making them click
alr
You would be checking every move event, seems very inefficient
can i make it so that interactions only work one time
map?
looks bad
add a pdc tag to teh entity once the player has used it (add the players UUID)
i'm just gonna delete the entity once they use it
much simpler 🙂
its not since move event is thrown regardless
it just depends what you decide to do in regards to that event
i'm gonna check the nearest entities to the player in a radius of 0.1
why .1?
if that is the case, then grab all entities in loaded chunks and get their locations. If they are not 0.5 from player when they move ignore. Update locations when entities move. remove entities that are no longer loaded.
i'm 99% sure there's a method to get the nearest entities tho?
or is that method more efficient
probably is, but there is something I can't remember about it that was terrible
but you don't need to keep grabbing nearest
just grab the entities already loaded
alr
i prob don't even need to check the whole chunk, the entity i'm checking is within a 15x15 room
a more efficient approach would be to grab entities as chunks load using the chunk load event, and entity spawn events
well as long as you are already tracking entities that exist already, you always know their locations
saves you from looping
did it finally click?
?
guess not
i just don't understand what you mean by that
declaration: package: org.bukkit, interface: World
see there is this handy method to get all the entities
i can compare the location of the player with the location of the entity i'm tracking instead of doing that
its slang for it finally makes sense, you see the light or understand etc etc
ic
yes, this is pretty much what I was getting at
does anyone know how to change the setPositionRotation for 1.20.2 in idea
my setPositionRotation doesn't work, it stays red, I don't know how to solve that
type . and see what you ide has available
thanks for your help but already got it
you have setPosRot and forceSetPositionRotation
im trying out this spigot libraries function in plugin.yml for the first time, am i doing this wrong?
libraries:
- com.discord4j.discord4j-core:3.2.5
looking at the docs this seems to be the right format.
i get an error stating this is the wrong format though
hi elgar
Should I make method that spits out itemstack static?
if its stateless, yes
in rust dereferencing a nullptr is legal
using the value isnt
heard that in their discord lol
guess were gonna see
probably gets optimized out if you type it explicitely lol
getting a segfault when printing the val, otherwise arent
haha time to get a segfault
can you segfault me
😏
Wtf is Molang
OH GOD
Is it just an expression evaluator at home
molls
i can public static void main you :)
control c me after that pls
At least someone has made a library to parse it
molang?
animation engine?
yea more or less
cool maths problems 
It’s less cool when you are working on a platform that doesn’t support it
What about removeWhenFarAway
POV: the game devs wants a specific storyline
can i just disable remove when far away from all entities
i have a way to distinguish between custom mobs and vanilla mobs (i don't ever want custom mobs to despawn)
unless the server stops
can you get the plugin disable reason? for example normal disabling through plugman or if the server is stopping
yes I think
it would take specific arguments such as item's data access object and produce an item stack with applied PDCs, metadata etc.
so that I could utilize it in several places
public void loadSubcommands() throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
Reflections reflections = new Reflections(package_path, Scanners.SubTypes.filterResultsBy(s -> true));
Set<Class<?>> classes = reflections.getSubTypesOf(Object.class);
for (Class<?> clazz : classes) {
Object obj = clazz.getDeclaredConstructor().newInstance();
subcommands.add((Class<Subcommand>) obj);
}
}
public void executeSubcommand(String name) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchFieldException {
if(subcommands.isEmpty()) {
System.out.println("No subcommands found");
return;
}
for (Class<Subcommand> subcommand : subcommands) {
Object obj = subcommand.getDeclaredConstructor().newInstance();
Class<?> clazz = subcommand.getSuperclass();
if(!name.equalsIgnoreCase(clazz.getField("name").getName())) continue;
clazz.getMethod(execute_method).invoke(obj);
}
}```
Is this a good way of loading classes / invoking methods that are inside of it ?
first this aint python, package_path should be packagePath
second i feel like you should have a list of subcommands instead of using reflections
since subscommands might require constructors
also u don't need to get the superclass
u can do
subcommand.getMethod(executeMethod).invoke(obj)```
any reason you are using reflection ?
is someone here acquainted well with netty?
depends on what you mean with well acquainted
is it possible to extract the class name and line number where the exception occurred?
from Exception class
according to chatgpt:
StackTraceElement[] stackTraceElements = e.getStackTrace();
if(stackTraceElements.length > 0) {
StackTraceElement origin = stackTraceElements[0];
String className = origin.getClassName();
int lineNumber = origin.getLineNumber();
}
hmm i'll try this thanks
better alternative to send Custom data from server A (starting ... ) to server B (already On just update the data)
for now iam using redis
lets say a Quest data for a user from game-1 server (game end ) to Lobby server(update the data before user go back to lobby ?
Redis is fine. Its pub/sub is intended for that. It's literally called a "message broker" :p Unless you're experiencing a bottleneck specifically caused by Redis, I don't think you should be seeking alternatives.
Alright thanks
Reading the classes and storing them in a list so i can access them later.
or is that a bad idea
I mean still, I wanna practice
i mean
nothing's wrong with practicing, but there are other and better ways to practice reflecton
The sleep method has a location param, does the server check if there is a bed at that location or the client?
The location must be in the current world and have a bed placed at the location
That deff answers what I asked
Kits , quests , cosmetics are all configurable .yml files but i need to have them in 1 centerlized location so i can pull from it
What
(multi servers , or even multi proxies setup)
You shouldn't do that
about my question here
why?
Just upload the same configs to all servers?
for me no , but for customers you know ..
Do you think hypixel has a centralized skywars config that all bedwars servers pull from?
If they're all on the same machine, symlink
Does the sleep method check for the bed on the client or the server :(
Thanks , i will look into it
Hypixel probably uses webscale MongoDB
If it's a server method, presumably the server, if there is any check at all
Do you know if ther is a check?
What's the method
Wrong ss
declaration: package: org.bukkit.entity, interface: HumanEntity
Someone said I could send a block packet to the player to fake the bed and remove it the next packet
Presumably force overrides any check
But I assume client would still check?
Not sure, try it!
I'll just try and see thanks cutie ❣️
I know back in like 1.7 beta the client didn't check
And there were bugs that left people sleeping randomly in air
Unsupported version 🤓
I have custom beds with resourcepacks so I would prefer them functional
Haha
i was thinking to have (cosmetics files {configurable .yml files} inside the proxy plugin folder and it push it when proxy start .. (and when ever a spigot server load again (start) it push the data to that server .. but now think what if we have multi proxy setup thats not a scalable soulation 🙂 , need to think out of the box
what are you doing...
i think by fixing it
I mean it could have been a BuildTools exception :p
So it's good to clarify before jumping to conclusions
So yes, what were you doing and is there more to that stacktrace?
oh whoops
How come there isn't a chunk.getY?
Ah, but on the client it says the chunk y?
Do I just have to implement my own method to get the y?
?xy
Pretty sure the y may be for rendering
I'm measuring the distance between the player and an NPC using the distance in chunks, depending on how far away the NPC is I'll display the NPC.
Something is doing it already for normal mobs (e.g. sheep) if you make your y distance large enough.
Well chunks have no y so you can only do x and z in chunks the server doesn't expose a chunk y AFAIK
I stated on the server
I dont know shit about the client
Just weird how it's not exposed even though it's right there lol
Well that's the client
So it may have a reason to be on the client
the client is probably just dividing by 16 / shifting by 4
I'll just make my own getY then
block.getY() >> 4
my favourite java language feature is unicode escape codes
specifically the part where \uuuuuuuuuuuuuuuuuuuuuuuu0020 is perfectly fine
The y value is what chunk section you are in
Spigot doesn’t expose any of the chunk section stuff but getting the Y value should be as simple as ^
or the part where having literal null bytes, 0x00, in your identifiers is also legal
gcc would get the hardest stroke if it ever encountered that
that's because strings arent null terminated in java
not talking about strings
class Fo\u0000o {}
is perfectly legal
it doesn't form part of the identifier, it's straight up ignored
wtf is that
Can someone help me with deluxetags
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
adult swim command?!!?!??!?!
weirdest tv channel name ever
literally
or the part where '\n' and '\12' are legal newline char literals but '\u000a' isn't
same case with '\'' vs '\u0027'
hallo, so I ran the buildtools and got a compiled craftBukkit jar, where do i put it to make maven cooperate (https://imgur.com/uUYs1zZ ) (right now the craftbukkit jar is in my src folder)
eh that's more sensible
why'd you say that
Q: Can you make BlockDisplay entities client side?
entity.setVisibleByDefault(false)
player.showEntity(plugin, entity)
🫢 didnt think of that, awesome thanks. and to confirm, a bukkit schedular can be running for multiple players at once but not interfere? id like to play a Display animation but only for specific ppl
I didnt realize a Boolean was server sided, checking if the animation was active interfered
So instead of having the entity just exist, we want it to spawn invisible but then use showEntity for all players online?
because i have a model placed that animates but i need it to only animate on some screens
Only use showEntity for the players you want to see it
Everyone should see the entities exist, but once someone clicks it, it should only animate on their screen
when someone clicks it i add those entities to a list and foreach move them
display entities are absurdly cheap, like, absurdly cheap
you can just have one per player
alright. maybe. but just a note, the code spawns them using a command, and the model is in many locations, right now a player can click it and it will add all those passenger entities to a list animate and sets a boolean that its active so no other players can click it till its done animating. what i want to change it to is that multiple players can animate it at the same time
if you're gonna have one entity per player then yeah, each animation would exist for each separate entity
How would you make a arraylist for each player then? the model is a door and its at multiple locations summoned with a command so that its permanently there until someone clicks the stored location, it then adds the passenger entities to array so that foreach can set their new transform
I dont know how you say its possible to use showEntity, since it needs to add the clicked ones to array, the entities are not created by code
The version will be like 1.18-R0.1-SNAPSHOT, look at what BuildTools says
okie
tyyy
can i make a player have a temporary item in a specific slot? all ways i tried result in a wipe if a sudden crash happens
after a specific time the original item should be back
hello, can someone help me, i managed to spawn an armor stand packet with metadata but i cant find a way to set item equipment to the armor_stand
not really. There will always be a chance under some specific set of conditions that an item will be destroyed. There are a couple things you can do though.
- If this replacement should take a long period of time to activate you can do Asynchronously save to a file/db with time based capture to reduce DB calls. This data can be restored on login if the DB has an entry on startup.
- If its just a brief moment and will disappear after a few seconds. I'd actually recommend printing out the item replaced to console as some form of restore-able string that admins can use to restore given something goes wrong.
Realistically this is a pretty niche concern. The chance of a crash during a brief period replacement is slim to none. Weigh your options based on time factor
i'm prob gonna do the second one
if this is a public plugin I reccomend adding a setting to turn off this logging or an option to log it to a separate file. Server owners get annoying about logging for some reason
it's a private plugin
I mean I do get why they do. A lot of them want to follow the chat on the console - so regularly appearing log messages can make this hard
that's fair tbh
I would probably take the extra mile to save it to a file and check it on login (if you are experienced with that)
especially if crashes happen frequently for you
usually they should not
if crashes happen frequently... maybe you should fix that kekw. Imho if its a very short period the only issue with saving to a file is the consideration that its worth the computation needed for IO. But yeah otherwise its generally a good idea to throw it in a file
like the item is in their for what 1 or 2 seconds. Is it worth the async IO to disk 🤷♂️ I think that's the only real consideration about that
yeah it's really a thing of duration and also frequency
okay wait I just thought of something extremely fucking stupid
Save the item replaced into the items PDC
not that frequently but rare items could get wiped
I mean that is still a workaround but it's not that bad
for example I have
PlayersSpecialItem, its replaced by YourPluginsCoolItem, but before you put YourPluginsCoolItem into PlayersSpecialItem's slot simply serialize PlayersSpecialItem into YourPluginsCoolItem so it can easily be restored. It is hacky, but technically the easiest solution here
It Works™️
while I agree it is hacky, I do like the idea
I ascended with that idea. I joke about serializing items into items so much I realized it may actually be an okay solution here
I mean in that case it's actually the perfect solution. Even if the crash causes the item to no longer be in the inventory - the data gets lost with it
So you really only save when you have to
someone know why when i start a 1.8 paper server in java 17 the console is not compact and create empty lines in it?
I have a building made of armor stands and if they are planned to be turned into a corner, will this “machine” turn smoothly like a real car?
Paper won't support these versions (neither do we tho)
smoothest way to do it is with velocity
but theres a lot of maths you will ahve to do
Pride month moment
Isn't pride month kinda like drunk month, because when you are drunk you do not walk straight
can i somehow rotate itemdisplay around the axis that is not on the center of itemdisplay?
why do i feel like there was a pride month like 3 months ago
Dunno, maybe 12 months passed like 3
or theres multiple pride months 🤔
Explains Alexs situation
ha?
yup
rad confirmes
just that it's not only walking
every month is if you're gay enough
Lmao
Where is the code that actually executes BlockDamageEvent (or any event for that matter) in CraftBukkit/Bukkit?
like the actual server logic itself
how do i rotate entity around some axis?
I bet somewhere in the patches
if that's what you mean
download CraftBukkit source and ctrl+f "BlockDamageEvent"
yeah found it now in the nms classes
how tf do you do this md so many classes to go through lmao
PacketPlayInBlockDig.EnumPlayerDigType only has start, stop and destroy that sorta sucks, no way of actually getting block damage progress without listening to the animation or some hacky way
guess tahts just a minecraftl imitation atp
pull from buildtools and make sure your IDE is up to date
a lot of people have been having the same issue
Update ij
how many meters is single skin pixel?
what?
meters?
its said that 1 block is 1 meter, usually
So if you compare the total height of a character.. do some maths.. voila!
skins pixels arent exactly the same scale as blocks so not as simple as it sounds
does anyone know where i can find developer jobs for servers? I have a part time job already but it'd be nice to make some money on the side
look in help chat or create a services thread after meeting requirements
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
?Services
the pay for 90% of minecraft servers is shit
unless you're doing it fulltime for a big network
epic command fail
D:
ebic command file
I was going to try apply for some of the bigger networks, problem is I play actively on them so I probably wouldn't want to develop
lmaoo i mean shit for someone who just graduated is still decent
you're much better off going non minecraft related if you want something decent
fair enough but you have to understand i'm more doing this because i enjoy the game in general, and I have more experience doing minecraft related stuff than anywhere else
I could put up a few databases and manage some data/analyse etc but
it wouldn't be very enjoyable work
ah makes sense
like gta wanted system?
bounty
uh you can just use a hashmap lol
thats a question that doesnt have a simple answer, depedns on how you want to implement it
im "new" in java and spigot api, how does works the hashmap?
You could use vault api for the reward part
I would suggest you to get more familiar with the basics of Java first
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
yeah, im using it
i know how to use java, but i dont used the hashmap
Like I mentioned here
Hashmaps are the basics
ok, but
the function needs to be in a for loop right?
i mean
the wanted system
Depends on what the wanted system is for
recollect all of the players online, and picks one
So a bounty system?
and for a certain time a reward will be offered for killing him, if he is not killed within a certain time he will change person
Create a List, generate a random number get player from number index
"forEach ->" ?
is there no Collection#random in java smh
How can I make that run all the time?
"for"?
isnt there shuffle
idk, there is in kotlin
raydan don't you fucking dare
Not like generating a random number is super hard
ThreadLocalRandom#current then Random#nextInt or whatever
ktstdlib has it
if you need a random string just create uuid substr replace - with ""
Sounds like a pretty bad and inconfigurable way to do it
why convert to any array
collection.size() exists
there are
ahhaha the one random plugin i made for a server a long time ago has 175 downloads for some reason
i dont even want to think what the code looks like
Mine only got 22 lol
wait this was actually lie
like
a decently laid out plugin
i definitely had too much time on my hands lmfao
Mine has 37 downloads and a review from CMarco 💀
i think i forgot to reply to this guy
reviews are not the place for support
Sir are you having a stroke
oh no shot i fucking added snake to the jar file
it works as a standalone snake program
theres no way
😭
its early. finger still asleep 🙂
Lmao
Almost 1pm
it was a late night
time to start preparing the pork for a roast
everythign as always. Roast spuds, brussels, cauli, broccoli and parsnips
and what are your opinions on yorkshire puddings
Yorkies are nice, just annoyign to make
fair enough
I like my dinner piping hot but yorkies take an extra 15 mins at a higher heat after the roast is done
fair fair
but then u need to wait
years for it to cool down
to eat
nah I like food hot. I can;t stand to wait for a steak to rest.
we invented fridges for a reason
My goblin escaped last year
is there any better way to save all resources in a resouces/folder than looping the jar file entries
no
fun
Ai generated refrigerators?
4th day of trying to get minecraft:clock clock.json time predicates correctly configured.
All good ideas, but none of them worked.
There was this one guy who made a digital clock and he tested and adjusted his times by hand because he either couldn't figure out any logic behind the time predicate.
So, I tried to adjust my clock to also use 636 textures.
And tried his time predicate settings.
Well, it did not work.
In this colum you can see the differences between his times.
They are completely random!
There's no logic to it!
Some of the numbers are abosolutely insane.
Like these for example.
5 zeroes? Really? Why?!
Please - if you know anything about minecraft:clock, help me. I'm going insane.
(2 x iteration - 1) / (2 x numberOfModels)
Gives the correct time predicates for the 64 vanilla clock models.
But guess if that works when you increase the amount of models? No, it does not work.
Neither does linearly dividing the normalized values evenly.
There's no logic to it. Why didn't they just 6000 ticks -> show this time on the clock.
That would have worked so well.
And, sure, normalize the values. Why not?! Someone might change the length of the day cycle or something and you'd want to accomodate them.
But this is not just regular normalization of the values. This is insanity!
Oh - by the way - when you do subtract the current value from the previous value using the defaulf time predicates:
It's nice and uniform.
But does it scale up... ? No it doesn't!
😠
I spent several hours testing all the clock phases by hand and got around 13 done.
There's no logic to the numbers I got from that.
If there is, I'm not seeing it.
what predicate do you have currently?
I can show you one that checks the time every 5 ticks
clock.json | Test your C# code online with .NET Fiddle code editor.
Here's how I've been trying to calculate it.
{
"condition": "minecraft:time_check",
"value": 0,
"period": 1000
}
translates to
if (time % period == value) {
return True;
}
time_check is related to to time?
yes
Ok, so ... you're saying you want to divide the 24 hours in Minecraft time into 1000 time slices.
I would like to see the values for 288 time predicates.
So every 5 minutes.
no, just that you are probably going about this wrong
Well, I definitely am. Please explain how it's supposed to work.
However, the code above in the fiddle does return the vanilla time predicates.
🤷♂️
But I haven't been able to get it working when scaling up.
well the time tag is the just the decimal value of the time that is less than one
not entirely sure why they did it that way
Yes, they've normalized the values between 0 and 1. Probably thinking that if the length of the day changes the clock and everything will keep working.
here is another predicate similar to what I showed that has a range on it
{
"condition": "minecraft:time_check",
"value": {
"min": 12000,
"max": 22500
},
"period": 24000
}
But just dividing 1 / number of clock phases does not work.
The time does not seem to be linearly divided among the 24000 ticks.
no its not
Yes. So your suggestion is basically that I learn the new Minecraft tag system etc and use that to output the time predicates with time_check.
No matter what the time predicate does?
time check is just a condition
Oh. Well I did not know that or account for it.
If there's a default duration it might mix things up.
there is only 230 visually distinct frames
375 ticks is essentially 18,75 seconds.
indeed that is correct
here is the math in how the clock is handled in the game
# Assume RGBA values are handled as 0.0 to 1.0 float values
def setup_clock_sprite (item: Image, dial: Image, dial_angle: float, output: Image):
rx = sin(-dial_angle)
ry = cos(-dial_angle)
for y in range(item.height):
for x in range(item.width):
pix = item.get_pixel(x, y)
if pix.r == pix.b and pix.g == 0 and pix.b > 0:
u: float = -(x / (item.width - 1) - 0.5)
v: float = y / (item.height - 1) - 0.5
dial_pix = dial.get_pixel(
int(((u * ry + v * rx + 0.5) * dial.width)) % dial.width,
int(((v * ry - u * rx + 0.5) * dial.height)) % dial.height
)
dial_pix.rgb *= pix.r
pix = dial_pix
output.set_pixel(x, y, pix)
should give you a hint why the 0-1 values
That is very helpful.
why is this python
because I pulled it from the wiki as I don't have my IDE open to give out snippets currently
ah
Right. So they're just ... wait ...
Isn't this the old pre 1.9 clock?
I think it used to be controlled like that.
With rotations and everything. But they changed that.
So that might not actually be how it currently works.
the only difference is that one is dynamically generated and the other is not
the math should be relatively the same
Really. Hm. Well having to deal with sin cos and all that that would definitely explain the weird setup.
@wet breachWell, from that I think the formulate should be just about normalization i - / (number of textures - 1)
But that doesn't work either.
Looking for a builder for a long-term project. Minecraft RPG economy survival server with rogue-like dungeons bosses. Must have a builder portfolio, a % of profits is promised... Dm me for more information
?services and one channel is enough
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
My immature little ant brain is in a rush for this kind of service, I apologize
You want them to have a portfolio but you are "promising" percent of profits? I sure hope you are going to pay for their work too
its like offering "Exposure"
Isn't work its own reward?
not rlly
some people dont even have the opportunity to work!
and you do
so it is its own reward!
be hard pressed to find anyone who has a portfolio to actually agree to be paid with percentages of profits from something that has yet to turn a profit. I wonder if this person thinks they are going to be making money hands over fist to even make such a contract o.O
Mind your own business buddy
So, anyway. Is there any way to get those numbers from Java code instead of using those time_checks @wet breach ?
probably
I really don't want to learn yet another new system just for this.
what are u making
Trying set time predicates for clock.json.
For 288 - or any number of textures, really.
I've been trying to do it for 4 days.
Not much luck.
The only thing that works is setting them by hand.
Testing them meticulously value by value.
😂
the way you expressed that was so exquisite but came served with some irony.
meticulously i like that word
@short drift hire 10 people to do it manually
and you’ll be done in no time
perfect job for fiver
You’re a programmer, write a script to automate the process of hiring people to do it for you
Duh
you're a programmer, spent five hours to automate a task that takes someone five minutes
you;re a programmer, write a script to do it for you
You’re a programmer, write a script to automate the process of hiring people to do it for you
Or just don’t be a programmer
Very useful advice. Thank you everyone for your contributions.
Yup happens
being a programmer is probably the best life decision you'll ever make
I'm a game developer, though.
being a programmer in a normal office job is probably the biggest lifehack ever
you just automate your job lmao
I wouldnt work as a programmer in an actual job.. I still count it as my hobby
You get paid monthly for doing something one time and pretending to do something all the other times
I love programming
idk I am still to find out in my life
Besides when there is spigot smp
xd
coll didnt get to claim his free 97k in crypto
I'm on drugs and do it everyday 😛
sir, can i initialize packetlistener in a separated class or should i put it in onEnable method?
@river oracle are all modules done now?
i was expecting some help tho
?tryandsee
package me.antonitoo.corespvp;
import org.bukkit.Bukkit;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import java.util.UUID;
public class BuscaYCaptura {
Col col = new Col();
private Player jugBYC;
public HashMap<UUID, Integer> fijado = new HashMap<>();
public Player getJugBYC() {
return jugBYC;
}
public void iniciarWanted() {
List<Player> jugadores = (List<Player>) Bukkit.getOnlinePlayers();
if (jugadores.size() < 2) {
Bukkit.getConsoleSender().sendMessage(col.col("&e&lSKYPVP &r&8- &aLa busca y captura no ha sido iniciada porque hay menos de 2 jugadores."));
return;
}
Random random = new Random();
jugBYC = jugadores.get(random.nextInt(jugadores.size()));
fijado.put(jugBYC.getUniqueId(), 1);
for (Player todos : Bukkit.getOnlinePlayers()) {
todos.sendMessage(col.col("&7Se busca la cabeza de &e" + jugBYC.getName() + "&7. Se está pagando &e100$ &7por él."));
todos.playSound(todos.getLocation(), Sound.ENDERDRAGON_GROWL, 1, 1);
}
jugBYC.sendMessage(col.col("&c¡Cuidado! &7Estás en busca y captura, la gente obtendrá dinero por matarte, así que ten cuidado."));
}
public void quitarHash(Player p) {
fijado.remove(p.getUniqueId());
}
}
this class is good?
i tryed it and it doesnt detect the hashmap