#help-development
1 messages · Page 980 of 1
What do you mean by print the location?
just print your Location object?
hi, could you help with velocity? I'm trying to use Redisson to transfer messages between servers, I added Redisson as a dependency, but when creating the Config for RedissonClient I get java.lang.NoClassDefFoundError: io/netty/resolver/dns/DnsCache. I tried to add io.netty as a dependency, and tried to shade it, but it didn’t help me; in the jar itself, if I open it through 7-zip, there is no such class.
I checked through javadoc for this dependency this class should exist, but it doesn't.
how do you do the animation where it counts up to a certain number? like if the number is 855 and it just counts up to 8 first and then 5 and then 5
You dont need a cluster configuration unless you are running multiple Redis servers, which would be overkill in almost any scenario.
You also shoulr remove the configuration from your maven shade plugin. Just let it properly resolve the dependencies it needs.
What you are describing is not counting up. And we have no idea where this "animation" should occur. In Chat? In the actionbar? on a hologram? etc
im just looking for an explanation as to how to do it in java tbh and then i can make it appear anywhere lmao
i saw their config using cluster on their github
most likely in GUIs with items
useSingleServerConfiguration()
Im just gonna guess what you want then.
So given an int (eg 855)
- Convert it to String using
String.valueOf(...) - Get the characters on each index
- On each iteration step: Append one more character to your output
Results in
"8"
"85"
"855"
But first remove your maven shade plugin <configuration> section pls
thanks but thats not what i asked for sorry for thr bad explanation. basically it first counts up to 8 like this;
1
2
3
etc
8
abd then when it@finishes that it moves on to the second number and does the same thing again
So
"1"
"2"
etc
"8"
"81"
"82"
etc
"85"
"851"
"852"
etc
"855"
That is a very weird way of assembling a number...
it does that in punching machines and some slot machines so thats what im trynna replicate
but youre right yes
Alright. In that case you want to:
- Convert your int to a String
- Get each character of the String
- Convert from character to numeric value
- assemble animation by starting with an empty String the length of your number
" "or"___" - Iterate each index of this empty string and append your characters accordingly
thank you idk why brain froze on that one lmao
damn it's 2am 😦
I would create a method with this signature:
public List<String> assmbleAnimation(int number) {}
And each index of that List is the next String to display
Hi smile, how are you doing?
smile hates me D:
I was just attending my doggo#
Its 9 am here and he wants attention
My dog is sleeping on the couch alone... he doesn't like my room
f
Anyways you been working on anything cool
Just on my dissertation for diffusion models. My plan is to have a text-to-building model. Tell it "build a pine tree" or "imagine a castle with brick walls and wooden roof" and then it generates you those structures.
Currently this is only realized for stuff like images, music etc
Yeah he wrongly predicted the weather XD
I wonder what he needed the stool for
I'm still working on the seasons project, just fixing a couple concurrency issues... I pretty much wrote for 2 hours w/o testing
but before that, I still need to write Config config = new Config() - because it says that there is an error in this line.

I've got temperature system pretty much designed now with some fun little mechanics
what's the event to disable explosion block damage
EntityExplodeEvent for TNT, Creepers etc
BlockExplodeEvent for Beds exploding and plugins creating explosions
Very nice. You could in theory use the biome temp as a baseline or modifier
okay but blockList() returns an immutable list so how do I clear it
I already am, they are just predefined values : https://paste.md-5.net/oququgijem.cs
You can not clear this list? That would be pretty garbage.
Where do you get "immutable" from?
not a mutable list
it doesn't use mutable lists anywhere in the event..
case SPRING:
biomeTemperatureMap.put(Biome.PLAINS, new double[]{15, 22});
biomeTemperatureMap.put(Biome.FOREST, new double[]{12, 19});
biomeTemperatureMap.put(Biome.DESERT, new double[]{22, 31});
break;
case SUMMER:
biomeTemperatureMap.put(Biome.PLAINS, new double[]{25, 35});
biomeTemperatureMap.put(Biome.FOREST, new double[]{22, 30});
biomeTemperatureMap.put(Biome.DESERT, new double[] {30, 45});
break;
case AUTUMN:
biomeTemperatureMap.put(Biome.PLAINS, new double[]{10, 20});
biomeTemperatureMap.put(Biome.FOREST, new double[]{8, 18});
break;
case WINTER:
biomeTemperatureMap.put(Biome.PLAINS, new double[]{-5, 5});
biomeTemperatureMap.put(Biome.FOREST, new double[]{-8, 2});
break;```
I feel like this system needs to be changed...
Are you writing Kotlin?
yeah
-.-
why do people hate on kotlin so much
Because its a borderline scripting language with atrocious features and questionable design concepts that are barely scalable
The method returns an ArrayList which is mutable
sry i don't do java
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/World.html#getTemperature(int,int,int)
Ah i thought more about this temp
declaration: package: org.bukkit, interface: World
but how can I work then if I don’t have a shade with Redisson?
You def need to shade Redisson. But remove your weird configuration from the shade plugin.
To be fair, it's rather a QOL thing, as to let people have configurable biome temps based on seasons
Ah makes sense
After I get these errors fixed, I gotta work on the temperature scale changing like in intervals rather than just 25-10
Add campfires to your temperature sources.
And use a Map<Material, Double> for tracking them.
This way you dont need to stack if-else statements.
It would be more like
public static double calculateHeatSourceEffect(Player player) {
World world = player.getWorld();
double heatEffect = 0.0;
int searchRadius = 6;
for (int x = -searchRadius; x <= searchRadius; x++) {
for (int y = -searchRadius; y <= searchRadius; y++) {
for (int z = -searchRadius; z <= searchRadius; z++) {
Location currentLocation = player.getLocation().add(x, y, z);
Block block = world.getBlockAt(currentLocation);
Material material = block.getType();
heatEffect += heatSources.getOrDefault(material, 0D);
}
}
}
return heatEffect;
}
And you could load this Map<Material, Double> from a config to let people configure the heat and add other blocks as well (like GLOWSTONE or LAVA_CAULDRON)
Oh another cool thing about the temperature system, I've got a working theory on heat detection
That's funny
You could also maybe let the distance to the heat source influence the temperature. But thats up to you.
Will be slightly more expensive to calculate.
Thank you btw will be back with results later
is it possible to cancel taking items from armor stand?
Sure, PlayerInteractEvent for example
PlayerArmorStandManipulateEvent
public void onEntityDamage(EntityDamageByEntityEvent event) {
Entity entity = event.getEntity();
double damage = event.getDamage();
double modifiedDamage = damage + damageBoost * level;
event.setDamage(modifiedDamage);```
Isnt this how we change a mob's damage?
It get's its base damage and multiplies it depending on level
public static void loadHeatSources() {
ConfigurationSection heatSourcesSection = seasons.getConfig().getConfigurationSection("season.heat_sources");
if (heatSourcesSection != null) {
for (String key : heatSourcesSection.getKeys(false)) {
double heatValue = heatSourcesSection.getDouble(key);
Material material = Material.matchMaterial(key);
if (material != null) {
heatSources.put(material, heatValue);
} else {
seasons.getLogger().log(Level.WARNING, "Invalid material found in heat sources: " + key);
}
}
}
}
Does this seem alright?
This is one option to modify all damage an entity takes from other entities
really now?
No idea where your damageBoost and level are coming from, but this will increase the damage of all entities to every other entity.
*Given that you registered the Listener
whats the difference between World#dropItem and World#dropItemNaturally
As the JavaDocs suggest, dropItemNaturally adds a natural random offset to the item dropped (like the game would on default)
You need to let maven download the javadocs
how?
Ohh
well that makes a lot more sense than nothing having documentation
thank you sm!
Why item flags are not working on 1.20.5? Are for removal? Or is just Spigot bug?
Goodnight everybody!
morning
how can I quickly compile a plugin if I need it to have a shade. It just comes out through the artifacts without a shade.
that is, should I constantly use mvn package, copy from target to the folder with the plugin?
yes
😢
if you want to build directly read https://blog.jeff-media.com/how-to-make-maven-automatically-put-your-plugins-jar-into-your-test-servers-plugins-folder/
is there anyway to avoid learning how to use databases but also not have to store all my data in yaml
why?
depends on the case. You can store some information in a PersistentDataContainer
Hibernate
This is a framework thats helps devs work with sql
just learn how to use databases
will help you now and in the future
You can store your data in json files (thats not yml) or in PDCs. You can actually get pretty far with storing your stuff in files
if just one server needs this data.
@distant forge did you solve your issue already? If not I can offer you to look into it via screen share or if the project is open source it'll be even easier.
No, problem is still there. Just found out that my intelliJ version is rather old, so updating it would be my next step. Need to get wifi for that though xD
Can I come back to you, if that does not help?
I have the very same issue, I think. Many classes, such as org.bukkit.Material, or org.bukkit.entity.EntityType are shown as missing, even though they compile, and are listed in the library package. (Though it seems that all the "broken" ones are listed as ClassName.class, instead of just ClassName) And yes, I've invalidated caches, done clean maven installs, etc.
Sounds like an intellij issue with enums
As with the other user, make sure you're up to date
Does someone know why could this happen?
Yep, sounds exactly like my issue
how do I make the nms and bukkit api work?
Just depend on spigot
That is not what I'm asking for
Asks how to use both nms and spigot
Gets legit response
"That's not what I asked"
¯_(ツ)_/¯
Tf do you mean then?
this insinuates that I should remove the other two
and thus this will solve my problem
I need to use nms
in my project
You can remove those two. The spigot artifact contains both craftbukkit and the spigot api.
Meaning it will have both nms support and the regular spigot api support.
it doesn
t
As long as you have ran BuildTools for the version you want, you should be able to use it no issue.
what
this maven thingy requires that?
Yes, that's how you get access to nms in the first place.
The spigot artifiact just pulls that info from your local m2 repo once it's been installed with BuildTools.
so how exactly do I do it?
?buildtools
You literally just run BT for the version you want to develop against.
E.G. java -jar BuildTools.jar --rev 1.20.5
If you want nms mappings, just throw in the --remapped flag
done
Once BT is done, just reload your pom
I ran buildtools in a random folder
so
prolly doesnt matter
That shouldn't matter. BT installs all of the stuff to your local m2 repo.
Which intellij already has a default for.
I'll give you an update once I run it again
How to decrease amount of if’s?
private CommandAPICommand getGrantGiveSubCommand() {
return new CommandAPICommand("give").withPermission("grant.command.give")
.withArguments(new StringArgument("donate").replaceSuggestions(ArgumentSuggestions.strings("hunter", "warrior", "master", "king")),
new PlayerArgument("target"))
.executesPlayer((player, args) -> {
if (!isPlayerHasGrant(player)) {
player.sendMessage(PREFIX + "§cУ вас нет соответствующего доната для выполнения данной команды.");
return;
}
Player targetPlayer = (Player) args.get("target");
if (targetPlayer == null) {
player.sendMessage(PREFIX + "§cИгрок не найден");
return;
}
if (isPlayerHasGrant(targetPlayer)) {
player.sendMessage(PREFIX + "§cУ данного игрока уже имеется высокий донат.");
return;
}
String donate = (String) args.get("donate");
if (donate == null || donate.isEmpty() || isGroupHasGrant(donate)) {
player.sendMessage(PREFIX + "§cДанный донат не найден.");
return;
}
Record entry = database.fetchOne("SELECT " + donate + " FROM grants WHERE name = ?", player.getName());
if (entry == null) {
insertIntoNewPlayer(player);
return;
}
InheritanceNode node = InheritanceNode.builder(donate).value(true).build();
User user = getLuckPermsUser(targetPlayer);
DataMutateResult result = user.data().add(node);
if (result.wasSuccessful()) {
luckPerms.getUserManager().saveUser(user);
updatePlayerGroupPresentTime(player.getName(), System.currentTimeMillis() + 300000L);
updatePlayerDonateAmount(player.getName(), donate, entry.get(donate, int.class) - 1);
}
}
);
}
I installed the newest version of intelliJ and the problem is solved now 🎊
@sullen marlin @civic sluice
2024 community I suppose? But thanks for the tip I'll upgrade as well.
perfect
yep
Yeeesh, 9 minutes.
Did you reload the pom?
And also update your dependency to 1.20.5?
Why are you making donation ranks from scratch, aren't there like a quadrillion plugins that do that for you
i am making /grant command
And that is?
<artifactId>spigot</artifactId>
Inb4 /lp user <user> parent add <group>
what is lnb4
in before
So, reinventing the wheel once again?
grant command give user with top rank give small rank for noobs without rank
I have a feeling that this (thing above) made more sense in russian than this is making in english rn
Sooo, users with the top rank can give regular users a rank?
I am asking for decreasing amount of IF
That's new
Top rank user’s can give friends or random people smaller ranks
bruh I'm trying to find the invocation of this event but only this shows up
For free or game money
I see
I've always found Paperweight to be better at that
???
what's that?
Papers gradle plugin to depend on nms
so do I just create a project with gradle and somehow integrate this?
why reduce the ifs?
Very much if
yes but each one seems neccesary for the command
and to send a message why it went wrong if it does
ig you could extract the if's to another method or something
maybe but that doesnt remove any ifs, it just moves them where you cant see them anymore
true, but it will improve the looks of the class ig
or, well, the method
They have a template you can use
I have never used gradle
no idea what a template is
im not clicking that
Download it and open it as a administrator
what even is .sk
skript
oh right
Slovakia
xD
honestly I don't understand why lesser known formats decides to go with two-letter file extensions, but mkay
jeez are there no functions in skript or something
this hurts my eyes, I understand why you wanna turn this into a plugin haha
but yes its very much doable to turn it into a plugin
though youd need understanding of how java works and hwo to use the same events as in the script
is there a way to figure out the actual blocks that were blown up even if multiple tnt blow up one block in the same tick? If I just add up the exploded blocks in the event I get many, many duplicates. I'm not happy with what that event does
I was hoping to be able to avoid that
what are you doing with them?
I have to keep track of explosions that belong to certain players, so I have to have an array of sets or something, which gets really ugly really quick
any alternative to this, without messing with java.library.path?
System.load(Path.of(".").resolve("libcounter.so").toAbsolutePath().toString());
new File("./libcounter.so").toPath())
or maybe you'd have to use toAbsolutePath too idk
ah getAbsolutePath() can be used instead of toPath()
new File("libcounter.so").getAbsolutePath()) seems a bit shorter already
surprisingly -Djava.library.path=. doesnt seem to do anything
wait
how does it suddenly work
the easiest option I'm seeing is to run the check one tick later and then only count the blocks that have been replaced with air
very clunky but I'd save myself the set part
I incidentally explained that in the post that I replied to
what is the purpose? for regen or something?
The event isn't run at the end of the tick though, it's run once per TnT is it not?
no I need to calculate a score based off the exploded blocks
if I just take the list of exploded blocks directly I seemingly have a ton of duplicates
in the case of overlapping explosions
are you modifying the blocks at all or just reading?
just reading
keeping track of the blocks outside the event makes this many times more annoying
alright then guess the event doesn't work how I thought 🤔
you get one event per explosion, but they can fire one after another in teh same tick, so they calculate teh exploded blocks as if the other tnt had not blown up yet
understandable
however, if they blow in teh same tick its pure change which actually blew first
I'm spawning maybe 8*7 tnt, and then many of them explode in similar areas, only half of the explosion radii ever have blocks at max and if I count the blocks I get multiple thousands of exploded blocks
as such you could store teh first events BlockList and add them all to a set. subsquent events you check against the Set, remove from teh new List any that are already in the Set and store that LIst. repeat until no more events
first come first served
the question is also, how do I determine when the last explosion has finished? do I just clear out the set every tick?
after processing it
knowing when a tick ends is not going to be easy
agh why is this event such garbage
you can practically only use it to cancel the whole explosion it seems
yeah its more of a List of Blocks its going to try to blow up
yeah I guess I'll have to do the one-tick-delay method
you can remove blocks from teh BlockList
currently creating an NPC using NMS, im very new and so i dont know what im doing.
help
it mutable
You probably want to use Citizens instead
You don't have to reinvent the wheel
i tried importing it but to no avail
What did you try?
is that... sarcasm?
oh yeah that would make things harder
can i fix it?
I recommend moving your project to use maven
for IntelliJ I'd recommand the Plugin 'Minecraft Dvelopment'
It'll do all that for you
https://github.com/mfnalex/spigot-plugin-archetype is also a good option
^^ helps install other common dependencies too
(now I want it too ;-;)
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
you have to be verified to do that
this image verification thing is so stupid. Where's the difference between sharing a link to an image and sharing the image? Both cases allow the image to be deleted off discord very easily
why make it hard for people when there is no benefit to that
spam bots
we don't have to view dick pics then though
has that ever even happened? If you can just delete the images where's the problem?
yes, frequently
clicking on a link out of curiosity and getting a dick pick makes no difference compared to having it pop up on your screen when you see the message
my grammar is all over the place ;-;
we don;t click on random img links here unless you have been helping the person
bruh
bruh? You asked I answered. You didn;t like the answer?
I get what you said but why require such an annoying verification procedure then? Not everybody, including me, has a spigot account. Just verifying using a captcha bot would be much more pleasant
why? bots can complete captcha
If you sign up on the forum it also drives traffic to the site
not really seen that happen before. While in theory possible nobody bothers with that. Also good luck having a bot solve a hcaptcha. These are getting more and more creative
We can also relate a Discord account to a forum account, for punishment
you could just create a new discord and forum account if you wanted
who would notice?
in countries like germany your public IP rotates daily, good luck tracking that
Speech mannerisms often give people away.
I have checked, you can ban evade like that easily
not necessarily
I live in germany, my IP hasn't changed in a few years now
maybe only Telekom does that
do you understand what "often" means?
These are all things which HAVE happened. These are not things I'm dreaming up.
if you were really trying - which anyone could do - then you could slip under the radar very easily
also Discord IP bans by default so any captcha bot could suffice
is it possible to change the size of a hologram
what do you mean by hologram?
armor stands + colored nametag or the new entities?
doubt since those are rendered client side
what new entities
new Entities have a Translation with scale
would that change the size of their name if i made them smaller
Display Entities
minecraft got some actual hologram entities iirc
a TextDisplay is scalable
ohh ok thnks
Do non hostile mobs not count in entitySpawnEvents? I made a plugin that adds a nametag to all mobs, it works but not for pigs,sheep,turtles,cows. While it works for every other mob. When I maunally spawn them with eggs, spawners, summon command or breeding the event works.
Entities which already existed and got loaded wont be affected by the EntitySpawnEvent. Those need to be handled with the EntitiesLoadEvent
Is there a special event for obtaining an item from a crafting table?
Or should I just listen for inventoryclick
Just the click. And the CraftItemEvent which inherits from the click event.
unless im observing incorrectly craftitemevent is more like recipecompleteevent
and isn't for the moment you craft the item
Hello Guys, i created a Server with Multiverse. Survial World and Lobby, if i die in the Survival World i spawn back in the main lobby, how can i fix that?
Stay in #help-server
RecipeCompleteEvent is not a thing. And the CraftItemEvent gets called when you click on the craft item slot.
It literally inherits from the InventoryClickEvent.
its very easy these days
wait are you sure?
the docs say "Called when the recipe of an Item is completed inside a crafting matrix"
and from observation it's called when the recipe is completed and an item in the craft item slot appears
only thing is that they might not be able to properly read their content
it was never about the captcha tho
hm
thats kinda weird
it seems like craftitemevent isn't called when you set the result via a preparecraftevent
that's probably what confused me
How can I get berock players to join a 1.20.4 server? I'm using paper and it doesn't have a 1.20.5 version yet
I have the latest version of geyser and viaversion + backwards and it's not working
Sounds like a question for #help-server and/or the geyser discord
how would i change the size of the textdisplay/size of the text in the textdisplay
Scale
set the Translation
i dont see a scale or translation method?
ah i was using TextDisplay not Display, but i assume i can still display text?
TextDisplay implements Display
ok thanks
interface ServerOperator?
Hi, I have a problem with gson. I'm trying to create a system that loads json files dynamically from a given directory so that subdirectories are supported and files can include a single / multiple entries. My method: https://paste.md-5.net/ritidulivi.cs. The problem is in line 34, on the runtime I get the following exception:
java.lang.NoSuchMethodError: 'java.lang.Object com.google.gson.Gson.fromJson(java.io.Reader, com.google.gson.reflect.TypeToken)'
However, intelij doesn't complain. I'm a bit confused as there are two TypeToken classes of gson. When I tried with the other one, the dezerialisatzion worked but it didn't parse it to my class but to a linkedhashmap. Any idea whats wrong?
Probably depending on the wrong version of gson
and using a method not present at runtime
I have the latest version of gson (2.10.1)
and what version is the server using
or are you shading/providing gson on your own
My server is on 1.19.2, im shading
Make sure to relocate
okay I dont know what went wrong but when I'm using var arrayType = TypeToken.getParameterized(Set.class, clazz).getType();, it works as then another method is used :)
Did you relocate gson
can someone help me to understand how the sleeping rotation work with the NMS packet ClientboundMoveEntityPacket.rot?
What do you mean with "sleeping"
i'm actually getting tired so many bugs ive encountered with CraftItemEvent & PrepareCraftEvent I'm kinda considering remaking the craft ui
sleeping Pos like when your are on a bed
What are you trying to do?
I'm trying to make my own crafting system
to allow for shit requiring 32x stone for a recipe
I'm really struggling with the UI part though
Split it up into two parts. First make sure the recipe detection for your ingredients work.
After that you need to handle the actual crafting of the ItemStack.
I do have the recipe detection working already
but as I said interacting with minecarft is a pain in the ass
I did manage to use preparecraftevent to set the result of the recipe
@EventHandler
public void onPrepCrafting(PrepareItemCraftEvent e) {
e.getViewers().get(0).sendMessage("prep crafting");
Recipe r = getRecipe(e.getInventory().getMatrix());
if (r == null) {
e.getInventory().setResult(new ItemStack(Material.AIR)); }
else {
e.getInventory().setResult(r.result().representation());
};
}```
but can't manage to make CraftItemEvent work properly
all it'd really need to do is just decrement the items from the matrix but fuck it's confusing
Let me try this brb
alr
my server has a few houses i need a plugin where multiple people can the same buy a house and enter the house but for everyone the inside is different because its their house and they can invite people to the inside of their house
Didnt feel too bad. But i can see where problems could occur.
Especially with shift-click crafting.
What does the code look like?
?paste
also can you try it with the requirement being 32 items instead of 64
Yeah shift clicking is the annoying part
https://paste.md-5.net/tupufitozu.cs
Dont use this as it is. Its just something i wrote in those 10mins
Clone the spigot repos, apply the patches, and let your IDE search for them
when I click clone
nothing happens
Might as well just open whatever BuildTools spits out
weird. idk what I did wrong but it works really bad for me. i cant send the video but like, the first craft takes 2 items away the 2nd takes 32
like this
for context
?
I copied
the packages
from buildtools' jar
and shoved them into a project
as if they were normal packages
and this shit
pops up
what are you try to do?
search
for usages of classes
in server code
I need precise knowledge
then BuildTools and navigate in the spigot result...
like that tells me anything
You run Buildtools and nagivate to "Spigot\Spigot-Server"?
what does that mean
you wanna check the code of spigot for search for usages of specific things not?
yes
buildtools/spigot/spigot-sever
wait its kinda genius to use the built in system to indentify the recipe
then you need run BuildTools for generate the JAR server.. this make BuildTools generate directories for clone the repos from stash that repos you can use for search
this looks the directory when run BuildTools and with IntelliJ onlyy need open the Spigot\Spigot-Server for check code..
I did
yes
oh it works
thanks

is it possible to transfer all of them at once?
Idk if the issue is coming from me not being able to use vanilla recipes or not tbh
?paste
the recipe prep is great
it works
but when I craft an item with 64 on each slot
each item goes up to 126
and i also get the result
*and keeps doublin
Hello! Can someone help please with spawn particles. I need to do wings like Angel Wings. I have made wings in butter fly shape but don't understand how to change it shape correcty
https://paste.md-5.net/wakamukike.cpp
I'm making a plugin right now, and I use Ormlite (I hope it's okay to ask for help here)
I am wondering about what the foreignAutoRefresh = true flag accually does?
I know the foreignAutoCreate = true can be used instead of create() But the refresh flag I have no idea what accutally does.
it looks like craftitemevent is never called
Set this to be true (default false) to have a foreign field automagically refreshed when an object is queried.
From the javadoc
essentially when you add that to a field and you retrieve the parent object it will auto refresh the field
import net.minecraft.server.v1_18_2_R2.World; or net.minecraft.world ??
this isn't really development but idk where else to ask this, what unicode do server use for progress bars? they're usually abunch of lines but they look connected unlike abunch of minus unicodes which are seperated
box drawing characters prolly
how can i spawn an zombie and edit him?
World#spawn(Location, Zombie.class, (entity) -> entity.setCustomName("test"))
ty
U+2588 █
U+2589 ▉
U+258A ▊
U+258B ▋
U+258C ▌
U+258D ▍
U+258E ▎
U+258F ▏
You mean those?
this
why does it have to be a unicode codepoint?
they don't use the text renderer and strikethrough for it tho
they have actual sprite textures
it works without sprites for me so cool ig
i'm guessing there is absolutely zero way to draw a spline without using particles
without writing a clunky homebrew solution, anyway
I have no idea what else could fit the description, but what were you thinking of anyways?
just some way to represent an arbitrary spline in world space that doesn't involve using particles, since those are visually noisy (and some people just have them off)
i suppose i could divide it into line segments and just use something like a chain item in a display/armor stand
What if you did some fancy stuff with text displays
If you want a smooth spline you could probably get a shader to do so
Or will it always rotate contrary to the players view
sure but this is spigot
what you're thinking of is billboarding, and yes, it would billboard
so that's not an option
Darn
i mean it wouldn't be hard
still a valid solution to the problem
you can just compute points along the spline for however many line segments you deem an appropriate approximation
can you explain how?
Resource packs I'd guess
oh, is that supported now?
that's actually awesome
i'm guessing they're GLSL, which sucks, but
yeah i'm just used to HLSL
it's not that bad to translate ofc, just personal preference
should clarify, that sucks for me, not in general lmao
cool, I'll look into that, might be able to do something wacky with custom packets
Given a player has particles turned off (client wise) there's no possible way to send particles to the player correct?
you can, they just won't render
That's what I mean
i try to override this by using serverside settings that players can use
that way you can decrease the density of particles rather than disabling some outright
Hmm
but ofc people won't always use the options presented to them, and to be fair, changing your particle settings just to play on a server is a little tedious
Yeah, but think about the visual effects offered by just one setting
Anyways, I'm just trying to figure out different weather conditions for my seasons... heavy, light, mid conditions as it were and wasn't sure if you could like force the rendering of particles
you can't, but that would be pretty easy to do with postprocessing shaders now that i'm looking into them. maybe
as long as you're able to send some information to the shader lmao
I've not touched core shaders whatsoever, I am no help there
how do I hide the
3 attack damage```
thing from tools
the HIDE_ATTRIBUTES flag doesnt seem to work
hmm
how are you applying that flag?
let's make sure you're doing that properly first
@prime reef how long have you been working w spigot?
dunno, on and off since i was like
16?
i'm now 25
i'm no expert
but i work in rendering professionally so
i may not know the API inside and out but I do have some grasp of programming lmao
Uh,
ItemStack itemStack = ...;
ItemMeta meta = itemStack.getItemMeta();
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
itemStack.setItemMeta(meta);```
You are just very quick to your own solutions haha
does the item have attribute modifiers beforehand or are you adding them at a later point?
okay yeah that
seems like it should work
shouldn't matter with the flags
if the meta doesn't have any modifiers by the time you give the item to the player, it will straight up ignore that hide flag
breh
that's a little wacky silly
"performance"
i like that this could apply to almost anything spigot does
doesnt tho
lel
this @lilac vector
By the time I give it to the player or by the time I add it to the meta?
By the time you give it to the player if theres no attributes it will ignore
So you should create the item (with the attribute flag) then give it to the player
So then it sounds like you have to give the item an attribute before caching it
there is before it but the attributes are added at the ned
maybe show more of the code? how are you creating the items etc
That's the issue
add them at the beginning
the attributes?
Yes
that makes less sense than a donut flying
💀
you can see it early returns if the modifiers map is empty, but the hide flag is added at the end
someone mustve been really pissed about having useless attributes on items
more like complete oversight
it happens constantly in software
I thought 1.20.5 was the best thing to ever happen to items
and it is
work for a publicly traded corporation and you'll realize that everything is profit driven
but cb is poo poo
But it's still not the best
whats cb
craftbukkit
ah
this is a bukkit thing because of itemmeta and does not naturally happen in vanilla
the core of a lot of spigot
and still maintained for that reason
okay so rn it is
ItemMeta meta = itemStack.getItemMeta();
meta.addItemFlags(..);
..other stuff..
itemStack.setItemMeta(meta);
but it stilld oesnt seem to work
add the flags at the very end
?paste
Show more code
one of the worst things about plugins is if you decide you want to support NMS operations for multiple versions
^
because then you end up mired in reflection
12 classes deep lol
reflection is 90% of the reason my plugins work
try type erasure
You also don't have any IDE hints
You can't import anything because that just runs counter to what you're trying to accomplish in the first place (not having to fix everything every version)
you can write "adapters" for every version you want to support instead, but setting that up is a chore
I'm having a panic attack from this paste
why
Probably the random init block
I said show more code and he won't even give me the whole method D:
i mean this is the full context more or less
i shit you not, put the item flags at the very end and see if that works
I want to see where he's calling this method from tho
one thing at a time
sure
My bad didn't swe the put at the bottom
Legit thought this was an initial block lol
not sure about Java but in C++ we do this for either memory or code clarity reasons
It's not done in Java
the only thing missing is the function signature which is just taking in the String id String id Material material int stackSize
at the very least it'll stop intellisense from grabbing variables it shouldn't
java is terrible though so
I respect your opinion
"hol up lemme pass everything by reference"
imports 27 libraries, writes 3 lines of code
average java experience
still naw
i'm mostly joking
you're pretty much fully joking
well shit. what happens after you invoke this method?
besides by the passing by reference
dude, so many java developers solve shit with libraries
it's wacky
you sure you aren't confusing us with Java script?
nah
Why build something yourself when it's already made
their are like 1 or 2 big libraries
i don't do web dev
there are valid reasons to do this (Jackson, for instance, or Spring) but I've seen Java projects with like
Sure, but that's sorta niche
they solve one random tiny problem with libraries lmao
it is anecdotal, yes, which is why I said I was mostly joking
I mean I could make the same observation about any language kek
eh, Clangs have the opposite problem
everyone stubbornly refuses to use libraries and writes hacky code with 0 consistent formatting/syntax
Uh, i have this giveitem command that
https://paste.md-5.net/ifocizahuz.java
honestly that happens in pretty much every language where downloading libraries is trivialised by the build system
C & C++ people don't do this cos their build system sucks
even where I work people do shit differently across different parts of the codebase, you've got the one guy who does everything with templates, another whose code works entirely off macros and another who just hammers out everything in boilerplate and uses variable naming conventions from the 90s
clangs don't lend themselves to this quite as easily
but that's another conversation about compilers
taking a look rq
What are you to expect from the goofy people that created the innerwebs D:
yeah this seems really basic and like it should work just fine
thats what i said!
Erm we're probably all blind and it's a one line fix
i have questions about why you do this with an array, but
yeah watch it be something really trivial
So when are you creating this item?
at startup
hold up
im holding
you might wanna give that a delay
i call dis method
BanEntry<?> banEntry = banList.getBanEntry(args[0]);
banEntry.setExpiration(expire);```
Anyone know why the ban expiration date does not change? The date object is correct
cos ive been trying to fix this for about half an hour now and i've been stripping the problem down furhter and further
we're gonna need a lot more context
this tells us nothing
what is "args[0]"
what is "expire"
Uh I feel like creating the item on enable might be an issue
don't think so, but
try everything I guess
theres no way thats actually a thing rihgt?
the problem with programming is that you never know for sure until you try
your code looks fine
cos if that's happening we gotta throw the whole api away
welcome to spigot
i don't normally do plugin work nowadays, i was only looking into it for a friend
^ this is the issue lol
and a big part of why i don't do plugin work anymore is
spigot
you gotta come back for 1.20.5
yeah, exactly - if your code looks like it should run fine, but it doesn't, and you've simplified it this much, it's probably something dumb
not even user error dumb
just a quirk that probably shouldn't be a thing
i have no idea what 1.20.5 does still
Itemstacks no are able to hold a durability for example : grass block (max stack size 1, durability 100) means you can place that block without it disappearing and it’ll just tick durability
Not only that, but a bunch of player attributes like scale and what not
you can become a giant
oh they rolled out armadillos
it literally feels modded
pun not intended
lotta QOL stuff
scale? that's interesting
hey, now I don't have to manually do gravity
ah I need to .save()
you did that?
"issue"
Yeah why would I want to update to better, newer technology when I can stick with what I know and live under a rock forever
based
it's bigger... it's better... and it'll still disappoint you!
is there api changes & additions for 1.20.5 somewhere?
Yes but unfortunately I do not know where
read
ty y2
big md5
oh thanks
he used the scale feature
anyways the most i've gotten out of 1.20.5 is disabling minecrafts features to have my own versions of it
I'm downloading Android Studio
anticheats in shambles
oauth2
openid
oauth2
openid indeed
hahaha, as usual brother
wouldnt it be easier for anti cheats?
since now plugin devs wont be using janky ass methods to increase player range and can rely on the attribute
but does that apply to attacks
probably
i just can say that not even 0.1% of minecraft developers know how to correctly do anti cheats. Talking about efficiency, effectiveness and compatibility
though it doesn't solve my need to hit everything in range 😔
if im using TextDisplays how can i change the size of it? i know the setTransformation method but i dont really understand how it works (yes ive looked at the docs and still dont understand)
huh?
breh see I knew I was onto something
You can just turn the opacity down cant you?
can you? that'd be neat
I'm pretty sure
you can
Text displays don’t have a scale attribute silly
Coll here is our resident text display nerd
you can modify the background color
You have to use the transform
so i guess you can just remove it lmao
how would u use it i dont undertsand it (ive looked at docs)
mojang in their infinite wisdom
Yeah because non living entities don’t even have attributes
dumb
confusing thing about the transform stuff is just
i want a GIANt dropped item
you literally work for paper as head CEO which is basically just mojang bro just add it smh
i don't know what format they want for left/right rotation
they won't give me write access
scared i'll delete everything
wow
see at CabernetMC
we give write access to anyone
even that homeless guy you've seen around
damn
that homeless guy? bill gates
minecraft:generic.follow_range
pineappl cabernet
bump
CabernetMC is not affiliate with PineappleDevelopmentGroup and their associates™️
When it's storming in a world, can I cancel the rain / snow visual that goes along with that?
Why
seasons plugin
U can tell a player the weather is clear 🤷🏽♂️
just lie just lie 🙉
i still think shaders will be your best bet for that
oh no
wait, you're fine with the clouds/etc.
then yeah, fake an arid biome
Ah good idea, thank you
shold be doable with packets
Quite easy with packets
if world.hasStorm -> send fake biome
with some
exceptions
Is there some minecraft way to do those floating texts nowadays?
or are we still just rawdogging armour stands
TextDisplays
are the main way now adays
using armor stands is def primitive compareitively
damn thats pretty is that a minecraft thing or a spigot
1.19.4
bump
^^ look at the constructor of Transformation, it takes a scale vector
what the method takes like why does it need 4 vectors? why isnt it just setTransformation(3, 3, 3) for example
^ +1 Geometry is annoying i don't think anyone here is going to teach you
alright then thanks
maybe smile, but he is a rare gem
which constructs them to 0
but you aren't dealing with quaternions with the bukkit transformation class
translation and scale are regular 3d vectors
to simplify it
Yea but the rotations aren’t
Ah wait right you don’t have to construct the entire transformation
You just get the existing one
Y'all is there any docs on how to get text displays workin?
yeah but like how do I create the textdisplay?
it's apparently an abstract class so
is there a way to uh
send through shader values from the server
like let's say you send over a resource pack with a postprocessing shader
is there a way to tell an unmodded client to use that shader and give it a uniform or anything?
core shaders
No
Shaders are fully client side
You can kind of communicate data to them with some hacks tho
Like text color
Is there any way to remove the DAMAGE_INDICATOR particles when attacking something?
It gets quite laggy with big boi damage
getItemMeta not working
ItemMeta meta = balloon.getItemMeta();
// Set custom model data
meta.setCustomModelData(1); // Change custom model data
return meta;
}```
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
?paste
I suggest you to use display entities. The cost of no compatibility <1.19.4 versions
you're trying to call .getItemMeta on an armor stand
can i disable collision of an armor stand?
you can make it very small is all setMarker(true)
That does disable collision
if (command.getName().equalsIgnoreCase("forloop")){
String[] cmds = Arrays.copyOfRange(args, 5, args.length);
String commands = String.join(" ", cmds);
cmds= commands.split("\\|");
for (int i = Integer.parseInt(args[2]); i <= Integer.parseInt(args[3]); i+=Integer.parseInt(args[4])) {
for (String cmd : cmds) {
Bukkit.dispatchCommand(sender, cmd.replace(args[1], String.valueOf(i)));
}
}
}
what i'm doing is making a /forloop command to repeat stuff
my concern is that it's not in the right order
forloop MommyPlease_UwU var 0 5 1 execute as @s run say var
MommyPlease_UwU is crazy
i need to change it but i'm too lazy
id be ashamed to share dat😭
i don't really care xDD i'm gringe and that's fine
Love the name
no you don't need to
i kinda like it since it's dumb but i also find it cringe
and does someone have an idea for my issue ?
dispatchCommand isn't sync
Try surrounding it with Bukkit.getScheduler().runTask(plugin, -> {
...
})
well it might be sync but what I mean is that it's order isnt deterministic
i'll try that
the whole command or just the dispatch command?
at least the outer for loop
since it's not always execute as player can be as entity, or even server runed
it's not working, i'll check the doc
that wont do anything
unless theres a command to execute a command
and not dispatch it
your best option is scheduling the dispatchCommand call
and delaying each item by one tick
but i won't do that (since i've asked but... not the solution)
it's hard for me to tell if it's even possible since everything is done in the same tick so idk
btw
plugin, () -> {}
ok
Is there a way for a plugin on the Proxy to prevent certain players on a server from seeing chat messages?
For example; player1 and player2 are on the same server. player1 has some.permission.read, but player2 does not.
Is there a way to prevent player2 from seeing player1's message? Or does this have to be done via a Spigot plugin rather than a Bungeecord plugin.
cancel the chat ever and broadcast with Bukkit.broadcast(message, "permission") is the easiest way, youd most likely need to do that on highest priority to make sure to get all message mods
no the point is that you delay it
yup, i'm actually trying
try {
Thread.sleep(5);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
i'm trying to not delay it from a tick or it would be pointless but just a little
Is there something such as a 2D bounding box or do I have to make my own?
you mean a rectangle?
yes
yes there is a rectangle in java
Well I need to check if a location is inside of it. But I might base my own class on Rectangle then
sure-?
calling thread.sleep on spigot pauses the entire server
you should not be doing it
use a scheduler with runtasklater and a tick amount specified
ok yeah i wont xDD
i want it to be less than a tick
yup but i'll since it's 50ms very itteration (can go up to 10/15 so... a lot of time )
50ms per iteration is noticable even with 3 iterations
The server does not tick more often either. What are you trying to do with your sleep?
i mean... it really feels impossible xDD
my issue is there
There’s not much you can do if the commands don’t send in the proper order without delay
yeah that's what i thought
set both y to 0
no point in remaking the class
but i wasn't really sure so i asked
I don’t think the bounding box class checks for collisions on the edge