#help-development
1 messages · Page 793 of 1
what is there to not get when you cast twice. What is the concept here
REEE ECPLISE is doing it own things so much lag
Double casting is not a common term. But generics can use it
And typically there isnt a reason to do it either
But it exists just like using unsafe exists and typically you dont need it lmao
I mean, it is just a langauge feature ?
i don't even know why it has a special term
nor have I ever heard of it lol
lynx have you ever dove into translation stuff in mc
obviously you can cast twice, I am just confused as to why a concept like "double casting" even exists (apparently)
once or twice 😅
why ?
ive got a pr for more translateable stuff and im wondering if stuff i thought were missing ways to get the nms version that have translateable stuff have a way to get it
He’s been voluntold to make everything translatable

There is super rare scenarios where you might not be able to cast to something but could use an intermediary first to get to it.
As i said most likely will not need it
Yes, generic tomfoolery is one of those
It bothered me so hard that i even looked into a way to generate code at compile time so i can simply use some type of string interpolation and
have translation key, values generated for me
yeah its kinda annoying
Yeah choco
which is going to be fantastic given that the bukkit translatable is in spigot-api
and the translatable component interface is in bungee
mhmmm
some things have keys in lang file but they dont expose a description id so i would have to manually generate the string which is is magic values
Wait bukkit translatable is in spigot api
Wont they be pretty useless for components?
Well for components themselves yea
but for formats for components
they are fucking godlike
it was
some weird entity lambda
very important that those remain as patches 
otherwise how would you know where bukkit starts and spigot ends
how else will I run craftbukkit in producion
layer
Or a lawyer
flat af coll
I’m like the earth!
dont lie. I know coll is busty for a fact.
🤤

I guess other people could just rewrite some of the spigot patches to solve any license issues
At least the smaller ones
rewrite to solve licence issues is a wild idea 
sounds rather difficult for anyone to truely claim they "heard of a concept in spigot" and then implemented it without having any influence/being close to spigots implementation
like, you are just derivative work at that point
Yea but who hasn't

Ah yes
The children shall be used as a pr vessel
Its not that you cant be influenced or not have seen code. Lol
The reason clean room implementations require this is mainly for businesses to have a clear defense if something is similar
Pretty much
MD wants to be safe and avoid another dmca situation
Which I get
Sadly it prevents us from just yoinking paper patches
Well the grey area currently is mojang has not officially countered the DMCA of bukkit
They stated they dont acknowledge it but they never contested it
why u gays talking sulks here
So, that leaves everyone else in the middle lol
Do you have plans if something goes wrong legally
And do those plans consist of blaming it all on mini
changed it a bit, thoughts?
Given we have people in rather close contact with mojang themselves 😅
Yes, take over bukkit
Then you have mojangs blessing and protection 
Do I not understand something
lets just infiltrate mojang
Im in
At present bukkit is still up for grabs from mojang.
Wait you already in?
What does that mean
lol
isnt it jeb_
undenyable truth
Uhhh
hopefully we get a response forum post from md_5 in regards to these allegations
Anyone can ask mojang to take over the bukkit project officially. If you have a decent team they may let you. But yeah anyone can contact mojang to do it as they said in the past
I’ll do it
Currently no one has done it
one man army
My team will be md, choco, epic, and Chocos dogs
Did Dinnerbone commit to bukkit
Can I be in the team too, just that I'm a bit useless
what for
Dinnerbone and grumm are all over the commit history
Why must it be the two upside-downs
how did they commit fraud
git commit -m "Fraud"
There’s a reason the api is upside down sometimes!
._.
Or should I say .-.
BlockData/BlockState moment
Bukkit will always be the vegan in the modding scene
Bukkit doesn’t eat meat?
md forces it to only eat plants
Yes, but forge and fabric and quilt and mcp and liteloader and etc do
wait how do you assign with lamba and an entity
Bukkit full of kelp
I think ItemStack is groovy and nifty
Hey
Lol
do i exist
so im not a craft player
You cannot craft
Epic us just some random abstraction withing spigot
Is craft player a class or an order
Isn't a craftplayer an implementation of player using nms code or something
its this weird thing
I use mpc 4.3
theyre like really bricky
That’s up to the slime!
Just mess with the nms stuff so the nms devs can have more work 
coll can you go and wake choco up
Ask simon to
idk simon
Skill issue
do you know him
Does spigot have own mappings
would be poggers
somewhat
Yes
Spigot used to maintain its own mappings
But I don't think we do anymore, so now we have some weird mojmap/spigot hybrid
Lol
Since there are so few canadians we actually all know eachother
go get him to wake choco up
coll is canadian???
no
Why are people always surprised by this
now that i think about it i barely know anyones home country from spigot
you dont say eh enough
didnt know that either xd
choco is canada too
that i know
tbf that's about all I know
7smile is german
cowoconcluwube is sweede
and i know a few polish ones
Hi
i just figured out geometry for drawing with code today
hi
Nevermind i‘m stupid lol
have a list of points and draw lines beteewn them
Ah yeah sorry
"You would have" = "You'd've"
sirup pics 😋
You'd've'L'2d
In the labyrinthine corridors of linguistic eccentricity, one'd've often found oneself grappling with the esoteric tapestry of lexical peculiarities, where the idiosyncratic amalgamation of syllables, as if engaged in a clandestine dance, metamorphosed the commonplace "you would have" into the enigmatic "you'd've."
It's often pronounced "yud ev" anyways
Can I use saveResource if I want to save the resource to folder/file instead of file?
Basically let‘s say I want to save list.yml to dataFolder/lists/list.yml
Is that possible with saveResource?
Only if you copy the file afterwards or have the same folder structure within your jar.
So inside your jar /somedata/pip/config.json
would result in it being saved in .../plugins/YourPluginName/somedata/pip/config.json
So if i created the folder lists in my resources folder of my jar, the folder would also be created, when using saveResource?
And to save I would then type saveResource("lists/list.yml")?
Is it possible to increase the block by placing it on an armor stand in 1.16.5?
elaborate on "increase the block"
https://www.reddit.com/r/Optifine/comments/fw9hyh/suggestion_unusual_method_of_adding_custom_blocks/ - hey how you think this passble?
@lost matrix
Yes. You just need to edit the model of your block accordingly.
This takes like 2mins to try out...
But yes
wait, maybe the texture is bigger than the block??
i was think this is can be only in 1.20
No, models can be quite big. But the size is fixed to the model description. In 1.20 you can scale literally anything to a tiny size or a huge one.
Hm. You could create a tiny blocks plugin which lets you display schematics in pocket format. 
Without scaling its 3x3x3
I kinda have that going actually
Lets you turn any worldedit selection into a bunch of block displays and then manipulate them
Interesting. But i just thought about how to properly scale this all down to a small size and lost interest.
Transformations are always so time consuming...
looks hella
Ignore the glitching, that's due to lag
Ah wait do you mean the size of the displays
what the..
Or how many blocks
blocks
Probably about 2k before the client starts to struggle
is this a private code?
You can scale, rotate, translate, and create animations for them
And change the glow color
Centric rotation. Did you translate, rotate, translate back?
I thought glow color override was only the 16 default glow colors but no, it's RGB
pretty much
I should add the ability to bind commands to them
Then servers could use them like a fancy npc
You control that via keyframe spacing
how do i eat spigot
i don't think you should eat it raw?
I believe I am required to redierct all talk of how to cook spigot to #general
Yeaaaah, my bad sorry, but I was at a workspace where i can‘t really test my code
Wait i‘m dumb
This wouldn‘t require minecraft, only the server. Oops, sorry for the bother
I have done some unit testing and each proxy with 500mb can run ñerfectly 1.000 players
hey how i can stop spawner animation ?
and how add armorstand to spawner with block in head
i only can set entityType
What's the reason for World#getTicksPerSpawns() returning a long while Server#getTicksPerSpawns() returns an int
? I would want proper data and sourcing
that's exactly what unit testing is about 💪
I mean thats more integration / load testing than unit testing
hello, are there ressources on how to create fake client side entities?
For Unit Testing of Minecraft Servers you probably want something like Mockbukkit
Nice benchmark but you should probably post your specs
Just be aware that Mockbukkit builds upon Paper since 1.18 iirc, so some stuff might not properly work on pure spigot
I have a VPS running a microcpu for instance I kinda doubt it would be able to pull off even 500 players without dropping to 400% cpu usage
i mean, for a proxy it's not exactly a lot
Yeah no i don't trust that server to do shit
Anyways do you peeps know of any way to implement custom block hardness without making use of mining fatigue in 1.20+?
That's the only way I know of
You can hack it server side but the client won't get the updated value so it'll break
or adventure mode I guess :p
hmmm alright thank u
does anyone have idea how to make thymeleaf not ignore @JsonSerialize annotation, @JsonIgnore seems to not be ignored, just serialize is lol
What's the reason for World#getTicksPerSpawns() returning a long while Server#getTicksPerSpawns() returns an int
transient?
Okay I think I read the message wrong, but in case you have that keyword I'd remove them
@molten hearth i have done the unit testing with Intel Xeon E5 2697 (16 cores, 32 threads) and 128gb DDR3. Of course to run them i límited each instance to 500Mb
500 Megabuckets?
average eclipse enjoyer response :p /j
i dont, i just have custom serializer for java.awt.Color defined with @JsonSerialize annotation, when i pass java object to thymeleaf Color is not serialized with my serializer
?paste
Please don't send thosens of code on chat, because it's a mess yo help and read
the error is on the run method
Please use paste md5
It's imposible yo help
?paste
Yeah i told him hahaha
Thanks!!!
Exception pls
Uh, with that you mean it is simply not called, right?
PS: Never make fields in your classes public
(except if they are final primitives or otherwise immutable objects - but whatever)
Aldo why your listerner Will be a runnable too
NoClassDefFoundError: could not initialize Minigame
why?
Assistance with Particle Generation in Minecraft Plugin
Hello! I'm facing issues with redstone particle generation in my Minecraft plugin. The code to display particles for a specific duration isn't working as expected. Any expert guidance? Thanks!
This isn't that long
Show your Minigame class. You probably have an exception in your static initializer
Also yeah, it be best to show the caused by: statement, if it is present
using a static approach for a minigame class doesn't really work well might be beneficial for you to re-appraoch this tbh
Though NoClassDefFoundError usually have a caused by
Show the construcutor of this class
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage("Este comando solo puede ser ejecutado por un jugador.");
return true;
}
Player jugador = (Player) sender;
// Generar partículas de redstone con un color rojo durante 10 segundos
new BukkitRunnable() {
int ticksPassed = 0;
int maxTicks = 200; // 10 segundos = 200 ticks (20 ticks = 1 segundo)
@Override
public void run() {
if (ticksPassed >= maxTicks) {
cancel(); // Cancelar la tarea después de 10 segundos
return;
}
jugador.spawnParticle(org.bukkit.Particle.REDSTONE, jugador.getLocation(), 0, 0, 0, 0, 1,
new org.bukkit.Particle.DustOptions(org.bukkit.Color.RED, 1));
ticksPassed += 5; // Añadir un intervalo de tiempo entre cada aparición de partículas
}
}.runTaskTimer(plugin, 0, 5); // Ejecutar cada 5 ticks, sin retraso inicial
jugador.sendMessage("¡Partículas de redstone rojas generadas por 10 segundos!");
return true;
}``` The 'runTaskTimer(plugin, 0, 5)' is showing as underlined in red.
it doesnt have a constructor
Please longs code use ?paste
Probably dont have a plugin variable here
Then comment out this line
Could you paste the ENTIRE stacktrace (from top to the very bottom) again?
Why the hell does your Ctrl + C, Ctrl + V absorb line breaks?
I doubt that a NoClassDefFoundError shows a cause.
He abuses static in the most horrific way possible, and it fks up his entire classloader.
?
It always shows a caused by statement unless the error was thrown too often
the fact static is being used in this class fucks it up
MinigameListeners.java:48
Yeah, something throws an exception while the classloader initializes the class.
@near mason Are you depending on another plugin at runtime?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
your abusing the fuck out of static here
your state is literally everywhere in random public static fields
you have 0 control over it
So no multi-plugin module code and anything?
Does your plugin work if you comment out
public static final Minigame[] games = new Minigame[]{new Spleef()};
Don't make a GameManager.
no
Same exception?
Try
try {
if (Minigame.current==null)return;
Minigame.current.tick.forEach(Runnable::run);
} catch (Throwable t) {t.printStackTrace();}
You'D want to use DI, but static is not the root cause of your issue
It just obfuscates it to smitherines
This line looks like a static circular reference to me.
Remove it, and make your plugin run. Then tell us if you have the same exception.
im 90% sure that it is
thats used in the Game class
Use an empty array instead
Yeah, circular deps aren't something I have any experience with. Never got them myself
And I love static
its in the init code block https://paste.md-5.net/iduqoqayar.java
But I generally have a strict classloading hierarchy (that is, I am well aware when a class is being loaded and in what order) so I don't bit the dust
Yeah but make your purely static classes all final to prevent this ^^
I dont see it being used...
line 22
That is not the same field as Minigame.games
Why do is he static abusing? Isnt that not recommended
You can be such a troll
That is an average verano comment
Yes. You are absolutely correct - we already said that
I know, but why they still do it?
Because it is much easier to develop for?
Delete this line, and tell me if your plugin compiles
People generally think in global variables
Wouldn't the assignment of fields be deferred until after the required classes are loaded?
i deleted that and added allGames final variable to randomMinigames
Ah i see where you are using it...
At the bottom of your Minigame class, but for some reason through a class which extends Minigame
Like the worst thing you can have is something being null as it was not yet initialized
Alright this should compile. Now tell us if you have the same exception.
I never actually knew whether you could use the implementations in the abstracted class but I think that you could
I strongly believe you can, so make sure to not then depend on the field being initialized
Cyclic dependencies: One class depended on the other which depended on the other
For the next plugin you are writing:
- Try not using the static keyword at all (Unless for constants or the singleton pattern)
- Make all your fields private
Imagine using try laughs in kotlin
Because it enables strong encapsulation
That means?
So one of the advantages is maybe you don't want someone directly editing a list and you have a specific way you would want that handled instead. So you would provide a getter and setter method for this.
?google tbh
Google your question before asking it:
https://www.google.com/
okay thank you 🙂
Makes sense
There are so many good resources on it and smile gave you the buzzword
For final immutable variables, getters are sometimes superfluous, but generally making stuff private hides away unnecessary implementation details at the relatively small cost of nothing
You want to protect anything which is mutable from leaving your instance.
Write methods which safely modify your objects instead of giving them out for other classes to modify them.
Getters and Setters should only be used by strictly immutable objects. They are the exception to mutators, which
should always be used when possible.
Hmmm
Yeah for those its more of a consistency concern
Well I always think of an ABI angle as when I am not writing a library I can just be completely carefree as long as I know what I am doing
I have done some things in my private projects which i would scold myself for if i where to post them here for help XD
we all are lazy sometimes

besides, sometimes you simply don't need that efficiency even if its proper
ManagerManager
the taled ManagerManager class which manages all the managers
I kid you not, i had that at one point
ManagerManager firstManagerManager = ManagerManagerManager.getInstance().get("firstManagerManager");
BlockManager blockManager = firstManagerManager.get("blockManager");
CustomBlock block = blockManager.get("customBlock");
getInstance().getBlockInstance()... 💀
I made it type safe instead of using Strings as keys.
public class ManagerRegistry {
private final Map<Class<?>, AbstractManager> registry = new HashMap<>();
public <T extends AbstractManager> T getManager(Class<T> managerClass) {
return managerClass.cast(registry.get(managerClass));
}
public <T extends AbstractManager> void registerManager(T manager) {
registry.put(manager.getClass(), manager);
}
...
Usage
GuiManager guiManager = ENPCore.getManagerRegistry().getManager(GuiManager.class);
But it was kinda meh.
Which is fine, honestly.
I had one bigger project where i tried using DI only.
It was kind of bothersome. But very robust i must say.
DI can fall apart pretty quickly
I wouldnt say fall apart. But it needs an intricate design philosophy.
I just don't get how its applicable for something like Managers or Registries
a lot of times you'll use those in many places passing it around through a constructor seems primitive tbh
There are other strategies than just passing them through every constructor
oh yeah aren't their those weird ah Libraries who use the Annotations or sometihng

think it mighta been guava
guice
i removed every static thing except this
Is there a API version for 1.20?
should i remove this too?
yea
make sure to quote it, since snakeyaml will parse 1.20 as 1.2 (number)
Oh
I mean it works...
I was trying to put 1.20
i just pasted it into Game class and removed static
This should be fixed
hello, can someone help me on how to use protocollib? im trying to spawn a client side entity and interact with it.
Better to cache your Random instance
because there is no reason to remake the random object every time
its utterly pointless and just unecessesary overhead
ok
you are meant to use the same random instance for better random sequencing
making a new one each time is misuse
ok thank you
anyone know how to use instanceof in java 8?
yeah?
variable instanceof SomeGreatClazz
.
the wrong part
remove "commandSendEvent"
im trying to define it too
do you really not see that red line?
In java 8 you gotta do
how long have you been programming?
add CommandSendEvent commandSendEvent = (CommandSendEvent) event; after the if
in java
if (x instanceof Y) {
Y y = (Y) x;
}
not quite
got it thx
no problem
huh
then gotta fix that somehow
u have to make ur own method
use java 9 or above
then you can't use that API
Arrays.asList I guess
legacy software legacy problems
thanks
legacy on top g
clearly
wat this
wrong language level
how fix
settings
there where you select jdk
under tht should be
language level
id go with newest
then dont use default
I tried others
but if I go under 15 I'll have to remake my code
you need to go higher
it says what ever you are trying to do is only for 17 and above
maybe even only 17
usally when you hover the error
intj will tell you what you need to use and you just need to click it
but I did other projects on java 17 and it worked
maybe u are using a different jdk 17 this time
theres so many distros
or you set your pom to lower compat
true or that
I don't use maven
gradle?
then start using one of them.
I use IntelliJ artifacts
you will your jars into existence 🙂
tf u mean to slow
how many u got
3 of them for now are unnecessary
maven does the spigot one automatically if you use the plugin
or bungeecord
or what ever
paper even
totally agree legacy versions give more money rather new ones. 1.20 is dead if you dont anything like Survival
is that sarcasm?
not really, just a fan of legacy versions
well its kinda true
i would give a simple and self explained example
if (player.isInvulnerable()) {
player.setInvulnerable(false);
player.sendMessage(ChatColor.GREEN + "God Mode enabled");
}
else {
player.setInvulnerable(true);
player.sendMessage(ChatColor.DARK_RED + "God Mode disabled");
}```
why does this say "god mode enabled" then making me killable, and the other is reverse
make a damage event ig

and cancel it
player.setInvulnerable(false);
player.sendMessage(ChatColor.GREEN + "God Mode enabled");
does this make sense
when you look at it
Have you seen the game from hypixel where there teams of people and the first team which breaks the 9 blocks in the middle wins? Well the same custom plugin for 1.7 and 1.8 base is between 315-478$. Same custom plugin but 1.13 up price downupgrade atleast at 30-40% compared with the legacy one, there you have a fast argument
?
the fuck is that argument 
oh
Why? Well in 1.13 facilities are better so you need less time to code it
"See a random plugin maintained by a random person is priced by the random person differently"
gotcha
I'll make that plugin, publish it for a dollar and now 1.20 is the best version 💪
what plugin
"game from hypixel where there teams of people and the first team which breaks the 9 blocks in the middle wins" not know its name
so basically capture the flag
but on drugs
yeah similar haha
but there i can fully explain that prices on none legacy are cheapers rather legacies. Because new things has more facilities
I mean, that is not a rule is it
every single hypixel games seems to be similar to ctf now a days
You could probably write that plugin against 1.8 API and still run it fine on 1.20
in general so many servers got games like that
yeah lmao, they dont really have ideas for adding new things. They do the same idea but different name
i think all the devs are just working on skyblock all the toöe
time
yeah i never said the contrary? I just said prices downgrade depending the base version
@worldly ingot am i right?
Yea I doubt that claim is true
yeah, i fully think the same. Only what improvees there is their skyblock**
do you play skyblock actively?
what ? no I was talking about the "price of plugins is based on version they were developed against" statement
i mean i was trying to said that basically, but i didnt explained well the idea
but that kinda is „true“ outdated versions wont get purchased as much
all depends its public
i have seen to many bad plugins for 1.20, expensives around 40$ and they were having hundreds of buy per month 💀
hundreds? ive barely ever seen plugins sell for hundreds of times a month
almost like personal accounts of things are completely useless for discussion xD
run latest
be happy
legacy is legacy, unless you are planning on maintaining a fork yourself or find a maintained fork
don't use it
yeah buts its no good to tell oblise people using newer software. Be free, be happy and let them do what they want and choose 
I mean running spigot 1.8 is a straight up security risk
not if you use proper infraestructura and software 🤔
what do you mean software
plugins ?
the fact that log4j was patched on 1.8 was at best curtesy
Manteining all what you use and studying daily how your server is going, trying to find security risks and finding solutions for them
could as well not be patched
Yea
that is called maintaining a fork
the large majority of people do not have the time for that
oh right, i didnt know about the concept. I will save that, i always learn new things hehe
People who dont have time for it, is because they dont really care about what they do. I can said it for sure and experience hehehe
If you really care what you do you find time for everything
doubt it
I doubt anyone running 1.8 does not care about server crash exploits or the likes
na they just dont, most of them all childs. Who they dont know and care if the server is successfully or not
They don't care until it happens first
There's a dedicated team for Skyblock alone lol
But lots of others everywhere else
suggesting that legacy is remotely acceptable to run is just harmful imo
not but hypixel other minigames are not so maintaned as skyblock one
What'cha mean? My job is literally to maintain minigames rn
oh you are on Hypixel teams?
Yeah lol
I guess their point was the skyblock team is larger than the individuals dedicated to a single other gamemode
oh i didnt know lmao, thats really nice
:p I assure you that minigames are being worked on
no one said they aren't
like, "as the most popular server gamemode it presumably also recieves the most developer time in total"
Yeah, I mean like I said there's a dedicated team for Skyblock alone
It's 50%+ of the userbase at any given time so no surprise there
not that no one is working on mini games
thats crazy
never expected skyblock to be that big
anyone know of a reputable plugin that has a GUI lol I need to test my Commodore changes
I mean log on at any time and it’ll be 50% if not more 
Choco can you tell them to not instantly reject my applications tyvm
Do they have custom backend software for running, like custom spigots to more precise. I too sure you cant answer it but i just curious
ofc they do
don't need choco to tell you that
there is no way they aren't running their own custom software
yeah, they have such a big team for not doing it
@river oracle what do you think they use existent or custom storaging databases?
Also they must use something like a huge Redis, there is no way they not catching in memory dbs
I know they used a lot of mongo in the past
Nah, it's a giant json file /s
I assume they still do
Just one big Object[]
Then they proceed to store that array into one single document in mongo
can you change an item material while keeping the same nbt data
?jd-s
Hmm
p*per 😷
totally agree he must be talking about ñeper (shity paper) 💀
Hi, I'm making this "WaterArms" ability- basically extensions of your arms that, when you punch, punch with you.
I know how to detect when the player punches, but the thing is, it's hard to send that signal to this cast function- how would I be able to detect when the player punches INSIDE of the cast() function, or how would i make it so that the cast() function detects if the player punches for the duration of the ability?
best way to spawn many particles at once in spigot 1.8.8?
for loop
use a runnable to check how long the duration lasts, make a hashmap with all players currently using the ability, if someone punches check if they are in that hashmap
Hi , I want to create squared regions ( no round but irregular ) worldguard style , I thought I’d make them by putting each location ( if the player is content in a hash ) in a list and then I made a "foreach" but i don't think is the right method ... could someone help me ?
?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.
i can send u the scrach
paste in the code causing the error, click save and send the link in here
right- but like, how do i send that information to the cast runnable? maybe i could use my cooldownmanager to give the player a "cooldown" that says that they are punching?
wrap the player in your own wrapper, for example "MinervaPlayer", you pass this instance around instead of Player & you can simply store extra fields on each player this way. for example a boolean flag for "isHitting"
Don't do this, a squared region may exceed an excessive number of locations. Having a large hashmap is fine, but having millions of entries on a server that requires performance is not. What you can do instead is make a Set of Areas (we call our Squares like that) that hash both edges so duplicate areas are not unnecessarily added. When a player moves, iterate over each area and check if the player's new location is within bounds of the iterated area. You can make this asynchronously if the size of the areas is large. Me personally I'd make a map that maps by world name, so that you don't have to iterate over too many entries that are unreachable.
thanks!
you can use guava's multimap for this btw.
Basically a map which contains another map as value?
Nope, a Multimap is an abstraction of a Map with a collection as a value. It makes handling collections and managing a map with a collection as a value much easier ^^
ArrayListMultiMap
oh right, thanks for answering. I will take a look into
in this case I'd recommend using this:
SetMultimap<String, YourArea> squares = Multimaps.newSetMultimap(new ConcurrentHashMap<>(), () -> Collections.synchronizedSet(new HashSet<>()));
just as a thought
i want to create region like this
not a cuboid
I'd say it is the same principle
well then ur not making stuff easy for yourself ;d
i was just targeting the way of how to store the target area, the underlying hashing does not matter too much if you don't care about duplicate areas being added. It is more a question about space & time complexity, which for a Set of areas ofc is O(n), if you were to hash every location one by one you'd end up with O(1) for the simple lookup, but it would eat A TON of memory for big areas (trust me I tried something similar before). And minecraft (more like java lol) in general is really sensitive about memory usage, so in short: I would go with the same principle
... unless you only have a maximum defined number of areas that isn't too large AND the complexity of looking up whether a player is in bounds is vastly slower than what I proposed
alr ty
wait wasnt there like a way to specify amount of particles
dont think so for 1.8
i probably could use packets tho…
oh damn that sucks
like with a library that does everything
yeah but then you'd have to depend on the versions again (or use protocollib)
yea protocollib will probably be installed either way
its just that i dont feel like doing stupid packet stuff
yeah it is a great library, especially for reflection lookups (e.g. FuzzyReflection, ExactReflection that kind of stuff) really helpful 👍
it is boring I can relate to your pain 😂
Doesnt worldguard have support for polygonial regions? I think they have.
i never said that
Are you fine with using worldguard?
Or do you want to create this region yourself
2
What does that mean?
You can use java.awt.Polygon for this.
Ill share my impl with you
?paste
i need to create an extension of polygon in 3d?
https://paste.md-5.net/dehuworire.cs
This should show you the most important operations
Is it possible to make mythic mobs spawn mobs that are allied to a certain function?
api wise
for clarification, I know you can spawn existing mobs in the config, but can you create your own?
i'd like to create a defender that varries per faction and is only allied to that faction
feels like a question for mythic mobs developers
ask here
cool cool
on another note
what's the best way to go about having a block with hitpoints you can attack?
i was thinking falling block
Ive used an extrusion approach
@Override
public boolean contains(Vector vector) {
double y = vector.getY();
if (y < this.base || y > this.base + this.height) {
return false;
}
double scaledX = vector.getX();
double scaledZ = vector.getZ();
return this.polygon.contains(scaledX, scaledZ);
}
2D Projection of the vector and checking the height
but mine keeps falling
Interact entity?
i love u
oh with the new update
uhhh
wow
that does open up a lot of new doors what the
i forgot it was a thing
my currency variable isnt being persistent on relog, or server restart, but if i just quit out of the game it saves correclty to file... here is all the java files associated with it
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
this is for check , but for create...?
Look at the class ive sent
I want ur JavaPlugin class too
what is "AbstractRegion" ?
I can just repeat myself here:
Check if your loadPlayerData method is called and check if (dataFile.exists()) { is true
I mean... shouldnt really matter but here
https://paste.md-5.net/eyitekilat.java
it is, i already put debug messages in it, the value goes back to 0 on restart or when player logs back in
JavaPlugin?
the main class?
Yes
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
thanks man 💜
well that mistake is quite obvious if you look closer ^^
//Currency
fileConfiguration.set("Currency", memory.getCurrency());
//Currency
memory.setCurrency(cfg.getDouble("stats.Currency", 0.0));
I'd recommend checking out the ConfigurationSerializable interface, having those fields closer related makes things easier to understand
Or create constants for every path
I personally would just take the field names reflectively and use them as paths.
Hate serializing stuff by hand.
yup that's exactly what I've done with a package of mine lol
don't want to be nit picky, but is there any particularly reason you convert the UUID into a string in PlayerUtility?
what you dicussing about? Im interested in it
Did someone already write a recursive reflection serializer for spigots yml configurations?
I feel like someone would have done that already.
you iterate through the fields of an object (more so the type) reflectively and filter out config fields you want to be serialized into your configuration
I have found none, thus I made my own
I might publish it, it's quite good and focuses on inheritance & immediate serialization & deserialization of configurationserializable's
why they didnt already PR that to spigot? it will make better api tho
& also adds the ability to comment everything in a nested fashion from 1.7 and onwards
Probably
tells me map may not contain keys of uuid
How do i Set a client side entity as a passenger on a real entity ?
then it is up to the usage of your map if your IDE tells you that
but UUID's are (like all objects) hashable and have a custom hash method override thus are usable in hashmaps, that's what I've been doing the entire time so I was surprised to see you convert those haha ^^
Send a mount packet to the clients
ok thanks
changed it to uuid instead of string and serialized it and all a sudden it started saving... thanks for the help, was only 3 days of mesing with it lol
u could prob use ConcurrentHashMap.newKeySet()
Do you guys know if an external Java application does something with another Java application
Like is a new jvm created for every app
nothing yet sadly
presumably the jump would be for the next major version tho
initial 1.20 missed the java 21 release by a couple of days
who can help me with rainmeter widget development?
Alr but r u aware of the 1.8 hit delay bug (weird transition ik)
I want to make custom bar for fast access to apps
what? I dont really understand
Alr prob not
he asking if a new JVM is created for each java app
Each Java application will launch it's own JVM
oh really? Lmao i thought the oppsite
OK well
the 1.8 hit delay is where if u click too fast and aren't looking in at ahitbox
u stop swinging for a little bit
Like a second or 1.5 sec
and I made an autoclicker which I rushed through
So the implementation is horrible
can always already use java 21
force some users to upgrade 😏
I mean
Your plugin can compile to java 21
And I was wondering if creating 20+ new threads a second will do anything to other jvms
ok.. i will go to another server
💀
Ik it's a native hook issue that's why I did it
java native Hook can't tell the different between a java.awt.Robot click and a real click
why would you expect to? im not understanding what you mean or where you trying to go, Not wondering to sound rude
Don't expect too much to change
Paper could probably do it
Not entirely sure how thread safe things are 🤷♂️
virtual threads aren't really that helpful for the kind of workload of a minecraft server
Netty probably could benefit from them, but thats pretty much it
They can actually be quite interesting considering the total amount of threads that exist purely for short-lived IO and SQL operations on a server, which can sum up quickly with larger amounts of plugins
maybe it could help with folia idk
i know they had like 4-6 threads for netty lmao
in a big test they did
guys, who can help?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
i need make widget on rainmeter, how i can make simple gray gradient bar on screen with rounded borders?
is this spigot related?
ok, guys, no need more
Meter=Shape
Shape=Rectangle 0,0,400,40,10,10 | Fill Color 0,0,0,255 | StrokeWidth 0
[Gradient]
Meter=Gradient
Gradient=Vertical | 0,0,0,0 | 200,200,200,255
X=5
Y=5
W=390
H=30``` i maked this
i have no idea what you are even using ;dd
You are asking in the most wrong place possible, you'd be lucky to find anyone
Looks like a desktop customization thing for Windows
yes, rainmeter is a widget engine for windows
Rainmeter has a discord you know.
But on this discord dead chat
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
PacketContainer packet = manager.createPacket(PacketType.Play.Server.SPAWN_ENTITY);
Location location = player.getLocation();
packet.getIntegers().write(0, (int) EntityType.ARMOR_STAND.getTypeId());
packet.getUUIDs().write(0, UUID.randomUUID());
packet.getDoubles()
.write(0, location.getX())
.write(1, location.getY())
.write(2, location.getZ());
manager.sendServerPacket(player, packet);
}```
why doesnt i spawn anything ( i use in a playerjoinevent )
try delaying a tick
why and how?
often in PlayerJoinEvent the player isnt fully initialized and some things will not work
player might in this case maybe not receive this packet yet
okay
?scheduling
read that to learn about delaying
PlayerJoin might need more than a tick
so the code for spawning it is correct ?
only the implementaiton of the spawn is wrong?
Wrong id for your game version
im playing 1.20.1 and using 5.1.0 protocollib isnt it alr 1.20?
Are you sure you wrote the id to the right field
packet.getIntegers().write(0, (int) EntityType.ARMOR_STAND.getTypeId());
Minecraft keeps an int id for each entity
so it can identify them
You probably want to put a high value there so you don't accidentally have the same id as an existing entity
what if i dont set it at all ?
Then it would probably default to 0
packet.getIntegers().write(1, (int) EntityType.ARMOR_STAND.getTypeId());
this still doesnt set it to an armorstand ?
Where is EntityType from?
entitytype is an enum which contains the entities
so the spigot one?
import org.bukkit.entity.EntityType;
I wouldn't rely on that
why?
yes
what do i write into data?
Hi, there is any chance that someone can make a fork for an eliminated premium plugin of an 3 year unactive author of spigot?
?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/
Uh
That ain't
How entityId works
pls teach me
entityId is basically something of an entity counter
It’ll probably work
Yeah
That's the entity type though
Field 0 is entity id
Ah so that was the entity type code?
Field 1 is entity type
My bad
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
PacketContainer packet = manager.createPacket(PacketType.Play.Server.SPAWN_ENTITY);
Location location = player.getLocation();
packet.getIntegers().write(0, 2);
packet.getIntegers().write(1, 2);
packet.getUUIDs().write(0, UUID.randomUUID());
packet.getDoubles()
.write(0, location.getX())
.write(1, location.getY())
.write(2, location.getZ());
manager.sendServerPacket(player, packet);
}```
this is what i got so far
But if you want an entity id spoofed packet, create an actual entity and spoof it's id so that it doesn't collide
shadow do you know why my code spawns allays?
Did you try the spigot one?
what spigot one?
.
Also why the int cast?
Ah
i found it
packet.getEntityTypeModifier().write(0, type);
id isnt varint as stated in the wiki
It is protocollib just turns it in to an entity type for you
@grim hound , now that i got a fake armor stand, do you know how i can manipulate it to a marker, set its custom name, make it invisible and let it mount entities?
It's hard to know at times
PacketPlayOutEntityMetadata
I think
And just input it's entity id
hmm i will look into this
if you're interested I just made this repository public (moved it from another project): https://github.com/aparx/bufig - I am awaiting approval still tho, but maybe you want to keep an eye on it 😉
with FileConfiguration what happens if i try to get something that doesnt exist?
nullpointerexception
what is a way to check if it exists
Just nulll ya?
?
can i test if its null or will i instantly get an exception?
Just test if it's null
"If the Object does not exist but a default value has been specified, this will return the default value. If the Object does not exist and no default value was specified, this will return null."
No exceptions
is there a way to get and use every value in a yml?
Loop the configuration section keys
getKeys(true)
or
getValues(true)
keys is a collection of strings
values is a map<string, object>
oh neat I didn't know getValues existed
ok also can i make value names all numbers?
Sure as long as it's a string when you set it
Is it the amplifier that you have to change to a higher number in slow falling to make it go slower? Therefore, there seems to be no difference when I tested
alright thanks
I dont think the amp has an effect
What did you test. The amplifier can loop if you give it too high values
10
That might be a bit much
do u guys know the .jar file for this?
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
What about it?
Is 3 max?
i need the .jar dependency
smh
Run BuildTools
?bt
thx
I was wondering
yeah
If I were to use any translation api I would need to input an api key that anybody could see into my could
It also has limitations per day
Let users create their own api keys
what is meant by icon in potion effect? is it the thing that shows the potion effect in the inventory, therefore it is not affected when I change the icon to false
icon in the top right
^
i downloaded the buildtools.jar and i ran the command, there is no jarfile
the one in the picture?
no
no
dis one
What does it say in your terminal
