#help-development
1 messages · Page 1196 of 1
Yeah probably
I don’t think the library has built in worldedit listeners
so I were right
because a plugin doesn't have the access it needs to for a proper fix
Could add an event that’s called whenever a blocks type changes
But that might be a bit heavy
PDC isn’t broken
yerrr it is for blocks
blocks dont have a container to add it to
Make a wrapper for chunk pdcs to basically make block pdcs
lets add a container to blocks then?
Just make a wrapper
thats called custom block data
?blockpdcc
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
It is a bit more RAM heavy but anyways
alex already made it
Dafuq is a custom block data
why dont we do this tho
after all these years we shoudl
the thing on that link the bot sent
Because blocks don’t save any additional data
Oh literally what I just recommended to program yourself LMAO
so make them hold additional data then
oh is it a minecraft limitation
yes
Yes
fairz
Hence why I said you'd need to fork Spigot
how is spigot and minecraft related in that aspect tho
JÄÄÄÄGERMEISTER
Vanilla blocks do not store nbt tags
yerr
That aren't tile entities
its a minecraft server 👀
yer
so it is related
It takes a lot of time to make sth like that, it needs a lot of rewriting you can just avoid by using a simple wrapper
in all aspects
extend hashmap erry day
yeah calm
Extend MinecraftServer everyday
Technically there’s Map.Entry
Because Pairs are kind of just... bad? lol
They're poor API design. If you need to return more than one result, you should create a record instead. You then effectively have a Pair but
- The method names are better than getFirst()/getSecond() or getLeft()/getRight()
- If you ever need to add more return values, the method signature doesn't need to change
- No generics
int[]
Pair<Integer, Integer> angles = getRecoilAngles();
if (angles.getLeft() < 90) {
// what is left?
}
left is x
right is y
x, y not just one
a comment works, whats a better thing to use then
^
public record Angles(int x, int y) { }
Angles angles = getRecoilAngles();
if (angles.x() < 90) {
}
No generics, primitive ints, clearer method names, immutable
ill consider it
It's a Pair but better :p
yerr\
how would i do like zooming in
i know people add slowness or something to make zoom in
is that the best way
but pair, triple quadruple
if I ever need to return two ints I just return them packed into a long instead
int[] angles = new int[2]
infallible strategy
What if you need 3 ints tho
BigInteger to the rescue
I was thinking Vector3i
Genius
Yeah basically. There's no other way to make the client zoom in
Except with a spyglass but you can't trigger that from the server
type
Location location = player.getLocation();
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
PlayerConnection playerConnection = entityPlayer.f;
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(54, UUID.randomUUID(), location.getX(), location.getY(), location.getZ(), 0.1f, 0.1f, EntityTypes.bN, 0, new Vec3D(0, 0, 0), 1);
playerConnection.sendPacket(packetPlayOutSpawnEntity);
List<DataWatcher.c<?>> dataWatchers = new ArrayList<>();
dataWatchers.add(new DataWatcher.c<>(5, DataWatcherRegistry.k, true));
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(54, dataWatchers);
playerConnection.sendPacket(packetPlayOutEntityMetadata);
}```
I'm using NMS to create client based entities and messing with their entity meta data on 1.21.4, I've tried looking but I'm not entirely sure what the DataWatchSerializer does or where's used; the dataWatchers list is a list of ``public static record c<T>(int a, DataWatcherSerializer<T> b, T c) {`` that's inside DataWatcher. Could anyone point me in the right direction ?
you can do slowness zoom without changing player speed
could stuff like this cause performance issues if there are several players with their own boss bars at a time?
for(int i = 0; i <= 100; i++) {
double progress = i / 100.0;
Bukkit.getScheduler().runTaskLater(Wicklow2.getInstance(), () -> {
harvestBar.setProgress(progress);
}, (long) (progress * duration));
}
if anything, I wouldn't do it at intervals of 100.
perhaps a more performant approach would be to use a single repeating task?
yeah because thats going to startup 101 tasks
You can do 1 single repeating task, as compared to the 101 that Yeboieee mentioned:
BukkitTask progressTask = Bukkit.getScheduler().runTaskTimer(plugin, () -> {
double currentProgress = // do something here to calculate / get current progress
harvestBar.setProgress(currentProgress);
if (currentProgress >= 1.0) {
// Cancel task when complete
Bukkit.getScheduler().cancelTask(progressTask.getTaskId());
}
}, 0L, updateInterval);
Or use a single delayed task with interpolation, though this essnetially assumes that the progress bar will be complete by a set period of time
Bukkit.getScheduler().runTaskLater(plugin, () -> {
harvestBar.setProgress(1.0);
}, duration);
how would the interpolation work?
it just goes from 0 to 1 when the duration is over?
or you can make a single task that ticks everyone
I dont know ur usecase, but the first one works
we just use coroutines at work 😛
we use heroin at my work
type deal
and lets see the newCoroutine method
that's my special sauce :)
my order was fucked but close
long progressStart = world.getFullTime();
BukkitTask barProgress = Bukkit.getScheduler().runTaskTimer(
Wicklow2.getInstance(), () -> {
double progress = (double) (world.getFullTime() - progressStart) / duration;
harvestBar.setProgress(progress);
if(progress >= 1.0) {
Bukkit.getScheduler().cancelTask(barProgress.getTaskId());
}
}, 0L, duration / 5);
I have this now, but I'm getting a compile error: Variable 'barProgress' might not have been initialized
dude...
u reference barprogress in its own creation
that creates a circular dependency
dont you do that here?
Use task -> instead of () ->
?scheduling
Then you can call task.cancel inside the runnable
^^ has examples
i dont remember
what was that example supposed to be then
BukkitTask progressTask = Bukkit.getScheduler().runTaskTimer(plugin, () -> {
double currentProgress = // do something here to calculate / get current progress
harvestBar.setProgress(currentProgress);
if (currentProgress >= 1.0) {
// Cancel task when complete
Bukkit.getScheduler().cancelTask(progressTask.getTaskId());
}
}, 0L, updateInterval);
```this was your example, how would you do it correctly?
Open the wiki and take a look
Or do what coll said
Jishuna* mb mb
Not used to the new name
oh cool
I see thanks
BukkitTask barProgress = Bukkit.getScheduler()
.runTaskTimer(Wicklow2.getInstance(), task -> {
double progress = (double) (world.getFullTime() - progressStart) / duration;
harvestBar.setProgress(progress);
if(progress >= 1.0) {
task.cancel();
}
}, 0L, duration / 5);
is this not correct? I am getting Required type: BukkitTask, Provided: void
the runTaskTimer method that takes a Consumer<BukkitTask> does not return anything, it's a void method
the one that takes a Runnable returns a BukkitTask
?gui
ima be honest
i used chatgpt to make a plugin for me
so i have NO idea
:D
just said i needed spigotAPI

?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! 🎉
I prefer w3school as a guide 😭
W3 is just okay tbh
It doesn't have enough depth imho
It's good if you only want surface level examples with very little examples or explanations of actual uses
It does the trick though
what does period do on tasks?
its the ticks between iterations
If I want to have permanent spawned in entities, such as TextDisplays, and want to avoid duplicates of them, should I spawn them in on server start, add them to a list, and then delete them on server shutdown?
declaration: package: org.bukkit.entity, interface: Entity
?whereami
im banned from there😭
That's our problem how?
No?
i mean it probably is a problem with me setting the IDE up incorrectly, so it doesn't probably matter, does it?
You were banned for Homophobic trolling.
yea yea yea whatever you can say.
you can say what you want, if i did not intend for it and consider your claim to be out of thin air , i have the right to
idk dude, not our problem, you should ask in Paper... oh wait
its my profile and your is yours
womp womp
did you asume my gender
bhaha dont bring ur trolling here
i was not?
ok, you started this, not gona engage, this server is too valuable for me
Well that was dumb. I realised that it was indeed a mistake in the IDE, I was exporting the World Edit API i was using ALSO with the plugin (basicaly the error in the console that i ignored)```
[10:51:36 ERROR]: [WorldEdit]
** /!\ SEVERE WARNING /!
**
** A plugin developer has included a portion of
** WorldEdit into their own plugin, so rather than using
** the version of WorldEdit that you downloaded, you
** will be using a broken mix of old WorldEdit (that came
** with the plugin) and your downloaded version. THIS MAY
** SEVERELY BREAK WORLDEDIT AND ALL OF ITS FEATURES.
**
** This may have happened because the developer is using
** the WorldEdit API and thinks that including
** WorldEdit is necessary. However, it is not!
**
** Here are some files that have been overridden:
**
** 'EditSession' came from 'zombies (file:/C:/Users/user/Desktop/minigames/zombie/plugins/.paper-remapped/zombies.jar)'
** 'CommandManager' came from 'zombies (file:/C:/Users/user/Desktop/minigames/zombie/plugins/.paper-remapped/zombies.jar)'
** 'Actor' came from 'zombies (file:/C:/Users/user/Desktop/minigames/zombie/plugins/.paper-remapped/zombies.jar)'
** 'World' came from 'zombies (file:/C:/Users/user/Desktop/minigames/zombie/plugins/.paper-remapped/zombies.jar)'
**
** Please report this to the plugins' developers.
**********************************************```
Lesson learnt: never troll liberals, never ignore erorrs, and always search for the errors to occur in the most unexpected places
I mean thanks for letting me know ( i already kind of forgot im using paper and not spigot XD) , technicaly speaking if it were a paper only mistake, i would've just wasted a lotta people's time
@nova notch i genuinly dont want to engage in this interaction, please dont. You dont know the full story, the "trolling" was in my pronouns and probably still is, because cant have shit nowadays
huh
huh
@mortal vortex ok, have to ingage, one question: do you WANT Me to continue trolling liberals?
or what
im not a liberal, sry. also this inst a relevent place for this.
i lituraly say i wont do it again because of how dumb it is
this server isnt the place, you are right
but i mean you kinda brought it up first
Is giving normal members a string field that I will parse with PAPI a bad idea? Can they op someone or do some other unintended actions?
can we just close that chapter off already, it's gotten stale. Also OFFTOPIC AF, jesus christ. how long has it been since i got banned from there? jesus. if somebody cant take jokes/puns(or whatever they are called idk) one degree higher than stale then idk, maybe it's actually a problem in them and not me? (an easterner speaking)
You should sanitize, theres a command injection risk whenever you take a raw input and parse it anywhere, i'm not sure about PAPI but there might be methods to execute commands from a placeholder.
What does sanitize mean
Can you stop talking to me? You said lets drop it, and you're continuing it. I didn't necessarily start an argument, I was simply making it known why you were banned.
Just like it would otherwise mean, removing anything harmful.
This is commonly done in things like SQL, where you remove anything code or query related from a string, so nothing can be executed.
Right, but now do I do it?
Thats the thing, I am not sure if PAPI has things that can be executed. You dont want people to be able to execute commands through PAPI. so be mindful
How would you parse it to papi anyways? using a command?
Well, when PAPI tries to get a placeholder it executes the code inside of the plugin that returns it, so if a plugin allows being hacked, it can, but can it be done just from default PAPI? Im not sure
Theres a parse method in their api iirc
pathetic is currently being completely decoupled, so you could just yap the engine and do your own stuff with it
here's the progress https://github.com/Metaphoriker/pathetic/pull/116
the structure of pathetic has been improved the open the doors for any kind of 3D environment
the provider, which before were forced on bukkit, has been opened up
several renamings of core classes ...
Is there a way to spawn a custom raid? I'm assuming not because I don't see anything. Maybe I'll have to make a custom Raid Handler?
You're correct I think.
You can try inducing bad omen?
Well, I meant more along the tracks of spawning a raid without being triggered/using a player
you could try to take a look into the sourcecode
and see how a raid is triggered programmatically
Do you have a link to the source code perhaps? Never really dived that deep before, so idek if it is a link lol
either here or you have to dive into NMS
but i would advice that at a given point without a clear solution you stop, and just create your own raid logic.
That's what I was potentially thinking because I did at first try to see if making a new RaidTriggerEvent with the parameters of (my custom raid class, world, and me), would work, but nothing happened
well, the event is not what triggers the raid, but the result of it
its called when the raid is triggered
most likely, but that also gives you more control over it
Yea, custom number of waves, what entities to spawn, number of entities, etc
Hi, I'm using packets to make client side entities; how do I send a text component in the entity's metadata? I tried using an NBT Compound as well as a string in the line
dataWatchers.add(new DataWatcher.c<>(2, DataWatcherRegistry.t, nbt.p("{\"text\":\"string\"}")));
How do I approach this? I'm using the wiki.vg protocol page where it says the index 2 is the custom name entity metadata index and it needs an optional text component
public static void test(Player player) {
Location location = player.getLocation();
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
PlayerConnection playerConnection = entityPlayer.f;
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(54, UUID.randomUUID(), location.getX(), location.getY(), location.getZ(), 0.1f, 0.1f, EntityTypes.bN, 0, new Vec3D(0, 0, 0), 1);
playerConnection.sendPacket(packetPlayOutSpawnEntity);
List<DataWatcher.c<?>> dataWatchers = new ArrayList<>();
NBTTagCompound nbt = new NBTTagCompound();
//nbt.p("{\"text\":\"string\"}");
//{"text":"string"}
//dataWatchers.add(new DataWatcher.c<>(0, DataWatcherRegistry.a, (byte) 0x40));
dataWatchers.add(new DataWatcher.c<>(3, DataWatcherRegistry.k, false));
dataWatchers.add(new DataWatcher.c<>(2, DataWatcherRegistry.t, nbt.p("{\"text\":\"string\"}")));
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(54, dataWatchers);
playerConnection.sendPacket(packetPlayOutEntityMetadata);
}
Whenever I try it I get kicked with "Network Protocol Error" and no information - I'm definitely sending a packet wrong ☹️
worth seeing how the packet sends text components
ComponentSerialization.TRUSTED_STREAM_CODEC.encode(byteBuf, playerTeam.getDisplayName()); //if you use mojmaps this is how components are serialized in 1.21
are you spawning a zombie just to try it out
it's worth a look into mojmaps on how they send entitydatas
probably also the entitydata for a zombie is incomplete
you could very well just use the API for this yk
or at least use Mojang mappings 💀
Did you all just add a santa hat png to your profile pictures ?
Any fixes for this? my console is spamming it and i cant get weapons from mmoitems as well
Yeah @remote swallow did
omg that's hilarious XD
yeah thank @remote swallow 
This makes me unreasonably happy
I should put a Christmas hat on mine too now that you mention it
Seems like getting some sort of playerdata is null / tried to get playerdata from a non-valid source or something
what should i do
contact the plugin author
Yes that's me
how can i decrease the price of a villagers trade in 1.21
nothing im trying is working
ive got an upgrade system and i want to decrease the price of a villagers trade by 10% per upgrade
If I want to move an armor stand to the player's position and aiming direction, what would be the best option? Spawn the entity and start a task where every x time I move the armor stand to the direction/movement or with the playermoveevent or what other option can you think of?
i want to make a pet
either way works really
people usually will use a repeating task out of general avoidance of the player move event since it is triggered more times than one normally wants
but when it comes to these things that follow the player movements, that isn't as much of a concern
oh ok, thank you so much
so should i use packets or normal entities?
just use normal entities for the time being
Hello, I have a question about Custom Crafting plugin. Is it better to make the whole crafting system yourself or rely on addRecipe and let it handle by vanilla minecraft and build custom system on top of it? I asking because I want to make sure I cane make recipes that require more items in one slot. (So for example 32 iron ingots in one slot + a nether star would craft something)
the recipe system is good enough for most types of recipes nowadays with exact choice being a thing
only thing that is annoying is the recipe book being bugged with exact choices
Well the worst thing is that you cannot make the Exact choice type check if the itemstacks amounts are correct
someone here to help?
i have a problem, can someone help me with plotsquared? i bought it completly legally and really need some help because i dont know if its a bug or im just not smart enough xd. my problem is: im using paper server 1.21.4 but the plotsquared skript is telling me on the first line. using plattform:bukkit!! and not paper. so i cant use the nice paper setting like animal pathing etc. can someone help pleasE? i cant send screenshots sadly
It will always treat all ingredients as a stack of 1
i have a friend that do big plugins and he said that the server will lag because of using normal entities
public class MiniaturesHandler {
private HashMap<String, MiniatureArmorStand> miniatures = new HashMap<>();
private HashMap<String, BukkitRunnable> movementTasks = new HashMap<>();
public void spawnMiniature(Player owner) {
if (miniatures.containsKey(owner.getName())) return;
Location loc = owner.getLocation().add(0.5, 1.3, 0);
MiniatureArmorStand miniature = new MiniatureArmorStand();
miniature.spawn(owner, loc);
miniatures.put(owner.getName(), miniature);
startMovementTask(owner, miniature);
}
public void removeMiniature(Player owner) {
MiniatureArmorStand miniature = miniatures.get(owner.getName());
if (miniature != null) {
miniature.remove();
miniatures.remove(owner.getName());
}
BukkitRunnable task = movementTasks.get(owner.getName());
if (task != null) {
task.cancel();
movementTasks.remove(owner.getName());
}
}
private void startMovementTask(Player owner, MiniatureArmorStand miniature) {
BukkitRunnable task = new BukkitRunnable() {
@Override
public void run() {
if (!owner.isOnline()) {
this.cancel();
miniatures.remove(owner.getName());
movementTasks.remove(owner.getName());
miniature.remove();
return;
}
Location playerLocation = owner.getLocation();
double shoulderOffsetX = -0.3;
double shoulderOffsetY = 1.4;
double shoulderOffsetZ = 0.3;
float yaw = playerLocation.getYaw();
double radians = Math.toRadians(yaw);
double offsetX = shoulderOffsetX * Math.cos(radians) - shoulderOffsetZ * Math.sin(radians);
double offsetZ = shoulderOffsetX * Math.sin(radians) + shoulderOffsetZ * Math.cos(radians);
Location shoulderLocation = playerLocation.clone().add(offsetX, shoulderOffsetY, offsetZ);
miniature.teleport(shoulderLocation);
miniature.setRotation(playerLocation.getYaw(), 0);
}
};
task.runTaskTimer(NexuMiniatures.getInstance(), 0L, 1L);
movementTasks.put(owner.getName(), task);
}
}
i do it
that isn't the case at all
a
what the heck
what word is blocked in here lol
He also told me that it would be a problem to do it with normal entities in case the plugin is removed from the server.
but the server of my client have 200 players
that will lag for sure
well, if you are going to do client-side entieis anyway then I recommend using something like this instead of doing it yourself: https://github.com/CubBossa/ClientEntities
it is true that many entities will in fact cause lag, however that isn't a concern for most servers
damn clearly you got a skill issue
I tried to resend it many times but it just wouldn't let me lol
new slur discovered???
im using a packetevents library too
Depends on the tracker impl if you're referring to client side entities
Client entities don't tick as much so it should be fine no?
that looks good too, as long as you aren't doing it yourself it should be fine
So do you recommend me to use that library?
most people should stay away from doing these manually
yea i dont want to
It should be more helpful than reinventing the wheel yeah
I haven't looked at the library myself
But assuming it's well made you should build with it
it isn't more so about reinventing the wheel but rather the fact that essentially re-doing the tracking logic for your client-side entities is a pain in the ass to get right
so it's mostly easier to just leave it to libraries that probably have done a better job than most of us are capable of lol
I like CubBossa's ClientEntities since its API is pretty nice (it's essentially bukkit's but with PlayerSpaces instead of the World)
only disadvantage is that it doesn't support all entities nor all events
but for most things, it does the job
yea this one supports all entities i think
And re inventing the wheel in coding is good you learn as well it's not a bad thing
I find that to be a lie most of the time to be honest
reinventing the wheel is a rather inefficient way to go about learning a system lol, or at least that is what I've experienced when teaching people
I'm happy that I know packets
It's not a lie if you really want to learn code and not just use libraries
ur smart
jesus christ
Especially with a library involving NMS, I much prefer to reinvent the wheel myself than have to wait for the developer to update to the latest versions
u got shadowbanned
I hate that it is just specific messages lol
maybe they now run an ai over each message and it now believes you wanted to hack something xd
tbh, as far as it has already gotten with implementing ai into everything even if it's useless or brings disadvantages, i would not rule that option out ;-;
If it was ai it could decipher the meaning of hack and it wouldn't have blocked the message
The ai we currently have is really good at words and translating not much else yet
not if discord decided they also gotta train their own model
in the end, there's always a good chance an ai will screw something up, especially if it hasn't had enough training, but at some point, it just won't get better
I don't think we know the won't get better part yet, I do think chatgpt does improve but it's held back by all the regulations this company has and that's why I'd we can get true ai we won't be the first country to get it
yes, ai gets better, but there's always a kind of hard limit of to what extend an ai will increase it's probability to being correct with training. it follows a kind of linear path if we compare different ai's with one another
atleast thats what we've been observing in all ai models
And we are just learning how to do quantum computing that changes the game completely
yep
I'm also in cyber security, and the fact I am alive when quantum computing is going to be widely available, everyone in this field needs to essentially start over cause it can crack all current encryption methods in minutes
it looks nice for me
i can't find info on .schem to how to parse it. anyone got any resource like snippet
i need something standalone. like a library
ah yes
nonsense that i dont understand anymore
Call it a stupid question, but there's 100% that "call()":
public static int a = 0;
public void inc(){
a++;
a++;
a++;
}
public void call(){
inc()
a = -1;
System.out.println(a);
}
would always print -1 right?
if on single thread, yes
The TS type system can be quite powerful
can this be not single thread somehow?
but it can also be very hard to read and understand
with the way you've wrote it no
alr thx
operations are sequential
searching those feels like searching needle in a haystack
Yeah
Race conditions are a real pain to debug
Bukkit api needs Rust's unsafe {} syntax, but for concurrency
what does that do
It allows you to write unsafe code
that would otherwise cause compile time errors due to not being safe
basically it nags you to check if the code you wrote is really safe
sounds... unsafe
Supabase has an insane typing thing
its just there to remind you that you may fuck up here
so you can supabase.get("MyCoolTable") or something and get it directly in a schema
just like Optional<> in java
it's fucking crazy
Yeah generated schemas like that are quite neat
Very common in Nuxt 
alr chat, spammed a bunch of prints, wml ig
It’s a client entity
Yes
The entity still exists
I mean yeah it exists server-side
Still you need to add handlers for your 'client' entities though
what sound is harp.ogg in spigot 1.8.9?
Hi all, I have this question, I have created a custom world generation:
``package net.swordpvp.survival.world;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.generator.WorldInfo;
import org.bukkit.util.noise.SimplexOctaveGenerator;
import org.jetbrains.annotations.NotNull;
import java.util.Random;
public class WorldGenerator extends ChunkGenerator {
@Override
public @NotNull ChunkData generateChunkData(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, @NotNull BiomeGrid biome) {
ChunkData chunk = createChunkData(world);
SimplexOctaveGenerator generator = new SimplexOctaveGenerator(new Random(world.getSeed()), 8);
generator.setScale(0.010D);
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
int rawX = chunkX * 16 + x;
int rawZ = chunkZ * 16 + z;
chunk.setBlock(rawX, 0, rawZ, Material.STONE);
}
}
return chunk;
}
}``
When I want to upload to the world:
`` WorldCreator worldCreator = new WorldCreator(“world”);
worldCreator.generateStructures(true);
worldCreator.generator(new WorldGenerator());
worldCreator.createWorld();
System.out.println(“CreateWorld”);``
it doesn't want to accept my generation, what could it be?
does kickevent fire quitevent ?
im pretty sure no matter why the player leaves, the event is being called
i've never thought that i would be so happy for one library which contains 4 annotations
jspecify's @NullMarked is so cool
what does it do
it marks @NotNull for every field, parameter inside class
but then you use @Nullable to mark nullable return types and fields
basically you declare @MarkNull and it will nag IDE to check for nullability
if you dont want that, you add @Nullable and mark that field/property as nullable
its just for maintainability is a good lib to have
"world" is already taken as a world name by default
like jetbrains annotations but with whitelist/blacklist for property nullabilities
If you want to make a new world with your generator give it a new name
hi, I'm quite new to Spigot I just started recently, so apologies if I am misunderstanding some basic things here.
on the Spigot documentation I see the following: (can't attach images so here's me pasting it)
static final Criteria KILLED_BY_TEAM_AQUA Increments automatically when a player is killed by a player on the aqua team. static final Criteria KILLED_BY_TEAM_BLACK Increments automatically when a player is killed by a player on the black team. static final Criteria KILLED_BY_TEAM_BLUE Increments automatically when a player is killed by a player on the blue team. static final Criteria KILLED_BY_TEAM_DARK_AQUA Increments automatically when a player is killed by a player on the dark aqua team. static final Criteria KILLED_BY_TEAM_DARK_BLUE Increments automatically when a player is killed by a player on the dark blue team.
(this list continues for a fair bit...)
how could I make use of these? could anyone explain how they work with a bit more details than listed on here? or are these outdated vanilla scoreboard criteria that aren't usually utilized for a plugin? all I know is that it's a number for a specified player than can increment up when the condition is met, although I'm not entirely clear with what the condition exactly is.
what I'm mainly confused about is this: teams can have custom names. there's no team that's "THE Aqua team" for instance. there's just "a team, that has been assigned the aqua color" right? and there can be more than one "teams assigned aqua color" so how can this criteria differentiate? I'm not quite understanding. would it just be any team colored (as an example) "AQUA" regardless of the name?
The team color is still used
for things like glow outline
If you want to set the team color use Team#setColor
thanks for the quick response. I am asking about the criterias here listed in my example from the docs though (eg. "KILLED_BY_TEAM_AQUA")
so the name has affect on this check I'm assuming? and what if there's more than one uniquely named teams, that all are colored as aqua
No name has no effect
The display name is different from the team color
or well can be
I see, understood. that clears that up
i feel like JSpecify is lightweight version of Kotlin's typesafety with @NullMarked, i recommend you guys this lib, it can eliminate many null-safety bugs, and if there's null safety warnings you know cannot exist on runtime you just add noinspection comment and be done with it. It works very well with Intellij
its nothing special but damn it works well for me
i like it
Yeah JSpecify is nice
I guess this is more of a general java question, but I have a abstract Minigame class, and two subclasses called CTFMinigame and RocketMinigame.
The subclasses are supposed to have Settings (List<String>), which are supposed to be the same for all instances of the classes.
How can I achieve this, since you can't have static methods or such in abstract classes?
abstract getter method in Minigame and then static lists in CTFMinigame and RocketMinigame
That's one option
I have no reason to use this stuff =/
oh boy we gettin theoretical with this one
so much text
you can just skip to the diagrams
refactoring guru does have great and detailed guides
It's worth reading through them
uh oh factories
Hey! 🙂
This is good advice. Basically advancement on static stuff 🙂
identify stuff that never changes, move it out of objects that don't need it
and essentially addressing the duplicity problem
yeah factories are pretty useful, should review dry and solid principles
in regards to that article, if you were making a game, this is where you get into what should the client track vs what does the server really need to know. In that articles example, the client should be the one applying the colors to objects and the server really shouldn't be worry about that stuff. Unfortunately wish MC client was built differently because of this
I'm wondering if anyone would have some guidence when it comes to MC 1.21.3 update.
I have my own plugin that I maintain and update whenever I see a new update comes out.
I seem to be having some issues with an experience bar where My plugin has issues setting the XP of a player after they join a server once and then leave and join back in.
I'll probably get some backlash out of this, but this experience bar gets updated on PlayerMove event (its used as a timer). It had worked completely fine up until 1.21 😦
seems you need to delay in a tick or two when you apply stuff to when players join and then ensuring that you are not using old player objects when they leave. IE you are tossing them away like you should be doing.
one of my pet peeves is everyone thinking stuff needs to be done immediately the moment someone joins lol. (not directed at person needing help fyi)
I'll do some more digging, but I'm pretty sure the player does get thrown out of the maps I store them in
we have self-cleaning maps at work :3
never hurts to check, but I think the issue is more or less just trying to do stuff immediately before everything is fully initialized when they join/leave/join etc. And all you should do is just delay what you are needing done.
in fact it is good practice you don't do stuff immediately upon a player joining if you don't need to. This gives time for everything to be stable, and then knowing if the player is going to stay
makes no sense to start doing work if in the next 1-5 seconds they just leave lol
^ pretty sure frosty came up with this on the spot
if its super important that you get stuff loaded before they can run around, this is why lobby worlds or waiting worlds are a thing
I had a waiting world where you can do some stuff while stuff was being prepped if it came down to it. wasn't used all that much, but still nice to have instead of making the player stay in one spot lmao
That's an entirely different situation to an exp bar
In short, lifecycles are a thing and attaching logic to the player's lifecycle is appropriate when that logic is specific to that player
For example, when a player logs in we load their data, and when they quit we yeet it back to the database
they are using it as some kind of timer for something. And yes I am aware of that, however since I don't know their specifics and just that their issue is exp bar I was simply giving examples in practices where you resolve players moving around and causing more work for the server
Lobby / temporary worlds are nice for 2 purposes: Load balancing and providing choice. If you have 2 gamemodes then you want to limit how much data you load
At work we have the mentality of "only do necessary IO"
If you're loading data when the player joins, only load what's needed and prefer doing things lazily when latency isn't an issue
anyways, I have to go to work now. So I will have to leave this help with other people lol
For example, on one of our gamemodes we have a "reward station" system where you can get a reward every few minutes and upgrade the station for a shorter cooldown / reward. We only load "reward station" data when the player logs in to that particular gamemode. It wouldn't make sense to load it on the lobby
can i have 5 bucks
Alright! 😄 found the root cause. I was in fact not removing the player from one of the Maps on quit/leave event
not sure how I've got away with that for so many minecraft versions 😅

Have to wait till i get home.
sure
Thinking next year i will upgrade my mobo. Thinking of something like the z790
And then getting an intel series 2 chip. This way it should be a while before i cant upgrade my cpu. Currently i am stuck with the i7-4790 which is not bad but i do want more then 4 cores lol
Also want to try out that ddr5 ram
And then i will save this mobo and cpu i currently have and build my wife a computer off that. She doesnt need anything fancy since she doesnt do gaming like i do lol
so I recently updated a plugin to 1.21 from 1.19 but for some reason now it doesn't recognize the imports net.md_5.bungee when it used to on the old version. anyone know why?
Update the latest version of the dependency?
so I updated spigot to the newest dependency version, but haven't ever used a bungeecord dependency. I don't need one, correct? (other plugins I have created on the newer version don't use a bungeecord specific dependency that I can tell and they work)
Amd your spigot dependency is right?
pretty sure
smh
imagine the transitive dep of bungeecord chat is gone and lyam's just tweaking
🙄
did they remove it
is there a new better way to do ChatMessageType & chatcolors from rgb?
its just not registering it anymore and i'm not entirely sure why
Because from my experience in using both amd and intel. Amd tells to not be as stable mostly in regards to drivers. I dont like to play the find the driver that works which may not be the latest game
In regards to performance in gaming amd doesnt significantly beat intel cpu wise. It might have a slight edge but i am willing to sacrifice that slight edge for stability. In gpu though no comparison obviously lmao
I currently with the 4790 can game on max settings and even if i wanted to have multiple stuff going while gaming too. So at present i dont have much of a reason to go with amd
alright I moved this question to a thread to provide more information
(https://www.spigotmc.org/threads/net-md_5-bungee-not-registering-on-plugin-update.672596/)
Probably a cache issue. Try invalidating IJ caches and reload the project.
how can i decrease the price of a villagers trade in 1.21
nothing im trying is working
ive got an upgrade system and i want to decrease the price of a villagers trade by 10% per upgrade
Look at the villager trade events
Hi.
I think, unless a specific method exists, you can use MerchantRecipe to duplicate each existing trade in place of it's reduced counterpart.
declaration: package: org.bukkit.inventory, class: MerchantRecipe
for (MerchantRecipe recipe : villager.getInventory().getOffers()) {
double newMultiplier = Math.max(0.1, 1.0 - (0.1 * value));
MerchantRecipe newRecipe = new MerchantRecipe(
recipe.getResult(),
recipe.getIngredients().get(0),
recipe.getMaxUses(),
recipe.getUseCount(),
newMultiplier
);
villager.getInventory().removeOffer(recipe);
villager.getInventory().addOffer(newRecipe);
}
hi, um i cant quite work out how to do custom model data in 1.21.4 with strings?
hi
I was wondering
since the paper api has many new functions, is its possible to wrap the paper api to be as a library plugin so when making a plugin use that library "zip?" as a dependency to run bukkit/spigot server?
no
is there a way to port other api functions?
uhm, thats make sense to use just paper , but im from the hybrid dark side, the idea came from because i saw many library mods, such as kotl, or other personal libraries.
the bad side its, not all mods works and not all plugins works, if use like such as carboard, that its trash , very outdated xD
okay. :C
anyone know how to do this?
hello everyone this is a very weird problem im having to face
on version 1.21.1
player.performCommand("some command");
just doesn't want to work
or even this when i want to test it out
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "say Hello, this is a test!");
like it just doesn't work for any reason
im not sure how my code is going to help but okay
`TikTokLive.newClient(username)
.onGift((liveClient, tikTokGiftEvent) -> {
// Retrieve the player dynamically when the event is triggered
Player player = Bukkit.getPlayerExact("ShoseGaming");
if (player != null && player.isOnline()) {
String tiktokCoins = String.valueOf(tikTokGiftEvent.getGift().getDiamondCost());
player.sendMessage(tiktokCoins + " coin amount");
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "say Hello, this is a test!");
} else {
Bukkit.broadcastMessage("ShoseGaming is not online.");
}
}).buildAndConnect();
}`
this is like a trigger event when someone sends a gift on tiktok live
and i just wanted to create an action based of that event right?
that action involves performing commands but for some reason it just doesn't want to, the player is a valid player in this case i've debugged that
actually i just added a try except block to my code and it says "error aoccurred while executing the command: Asynchronous command dispatch!"
so yeah there we go
thanks anyways
Sync it to minecraft's thread
?scheduler
ing
TikTok
Can PlayerPreLoginEvent not get called before PlayerJoinEvent somehow?
Pretty sure yeah I don't really thinknyou should be using PlayerPreLoginEvent either way
I meant.the async one, yeah
Will it always get called before PlayerJoinEvent?
Yes
Yeah also you can pause that thread for up to 20 or 30 seconds iirc
So it's safe to do DB calls on
doubt you'd be able to do it for that long, any incoming player will be timed out before that
well, as long as the player timeout time isn't greater than whatever delay you make in that event I guess
that's what they're saying
the client (and server) will close the socket after 30 seconds of inacticity
Pretty sure it's 20
So for custom model data components for 1.21.4 how would a string look? And is it better to do a string or just use the normal custom model data with integer numbers?
I thought it was async?
uh
nvm
apparently there is a hard 30 seconds timeout for inactivity on the socket, and the server has a separate 15 seconds timeout linked to the keep alive packet
yep, client will also timeout when itself isnt sending a keep alive for 20s, if the server hasnt kicked it yet for some weird reason
use the component, its the new way which mojang want us to use (also makes it easier to differntiate what has what model)
out of curiosity, is there a thread safe way to use a queue that's not synchronized if one thread is ALWAYS writing and the other thread is ALWAYS reading
im gonna guess that's not possible
depends on the OS
in most cases that is true
smh
however, on some systems that timeout is longer
that timeout is minecraft's timeout
you'd need to be a special kind of fucked up to receive a call saying "yo this socket times out after 30s" and go "nah"
there is some systems mostly linux where applications are not allowed to modify socket settings
and on those systems typically the time out is greater then 30 seconds
both the client and server are set to disconnect if there's a keepalive timeout
even if the socket doesn't the application will
ok....I didn't say anything about the application except acknowledged it has a 15 second time out
because this keepalive system is built by the application and not just the socket
the application doesn't control the socket was all my point was and just pointing out that the timeouts for sockets is system dependent not application dependent
they said socket in their message
🙄 whatever
apparently there is a hard 30 seconds timeout for inactivity on the socket
yep believe I read that correctly
still a pointless argument for the sake of drama
why i not can get player attributes if he not online
I was pointing out its not a hard limit set by minecraft except on systems that allow applications to modify socket settings
i want remove some modify
bruh i just want remove modify from attribute
but i cant get attribute from offline player
yeah but why
i create plugin with custom attributes
why would you care about offline players
ok i see you dont undestand what i mean
then explain what you mean ppease
i slove problem
i just will not do this
nevermind
but I still have to access the player's attributes if he's not online.
why is that
bc if you want manipulate with attribute if player not online
this
unconfortable
I also need it for statistical purposes
ah
just make your own decoupled attribute system and update values when the player logs in 
or fork spigot and add your own offline support 
💀
i think getting some "file" from player and update hist stats be better
it is set by minecraft via Netty's ReadTimeoutHandler, it spins up a task on a timer that if no payload was received after n seconds it will just close the socket
probably reading the player data
iirc its nbt
but ideally you dont wanna change it
just read only
and make changes when they log in if you need to
and you know, I was thinking about it and I realized that I've never seen an api that allows you to access data that you logically have the right to access.
frosty still gonna argue that that's netty's special sauce and not what he's referring to by the OS
it's just a normal task on a scheduler that calls close(fd) lol
there's no need to manipulate data for offline players because that's beyond the player's lifecycle
Just clean up after yourself when the player logs off etc
wdym
ilmir the kind of guy to keep every player that's logged in on a hashmap to be able to modify attributes when they're offline
if a ppayer isnt online, you shouldnt have to care about them
^
Well, that doesn't seem right.
It is
Such as?
You know they just usually use time-series databases for that kind of stuff
just push a point once in a while and use that to render graphs
I just mean making a whole system to just update the data of a player who logs into the game looks cumbersome.
"crutch"
Just don't support updating data for offline players then
because ✨ there's no need to ✨
but I guess it's just not an improvement.
you can achieve your goal with a database
i know but this still big combesome
just means you suck at coding then
bruh i dont suck coding it just illogically
I don't know how minecraft is set up, but intuitively it doesn't make sense given that player data is stored somewhere.
bukkit api moment?
nope
NMS doesn't care about that data either
It wouldn't make sense to keep offline player data loaded forever
Just a waste of RAM
and technically a really slow memory leak
yea?
Having data loaded for offline players when it's not needed is just a bad idea
sounds logical
welp now this needed 🙂
sounds logical considering that plugins are custom addons.
now i see
Then right call this "Minecraft canon"
Ehehe
whenever the player goes offline, their data is saved on their respective uuid.dat files
people usually don't bother with trying to access that data while the player is offline since it implies using NMS due to how the Bukkit API is designed, there is no good way to make an API to access the data of an offline player
Paper has considered decoupling Player and OfflinePlayer in order to make that feasible, however that change would break many things
any option that implies using minecraft's default storage would imply being dependent on the minecraft version, and there's only so much you can store inside PDC and the such anyway, so people just go for a database instead to avoid the hassle
the first part wouldn't be a problem if the API for it was there, but it isn't and there will probably never be in Spigot at least, until someone finds a novel way to implement it without breaking backwards compat too much if at all
So this all bc plugins not official lol
it's more of the fact that it is a lackluster solution to most problems without API for it
I guess this still "Minecraft moment"
I mean, if you're stubborn and want to go that route, you could still do it, maintaining NMS-dependent code isn't rare for plugins anyway and I don't think the code for this specifically has changed all that much between versions
This complicates my situation considering that the plugin has a shell over the characteristics of the players which in theory should be updated regardless of the online will have to make a system
💀
I mean, just use a database
How can I check when a player gets revived by totem? EntityResurrectEvent seems to also trigger when the player respawns normally and the event doesn't produce a Cause to check for a totem for example
"Get the hand in which the totem of undying was found, or null if the entity did not have a totem of undying." just check if getHand is != null?
Will be called in a cancelled state if the entity does not have a totem equipped.
then make your own tickcounter
so just ignoreCancelled to true?
yes
I might do the hand check as well just to be on the safe side
Is there any way to transfer all information about a player (like inventory contents, enderchest, achievements, stats, etc.) from one account to another?
Possible 🤔
Just load the player's inventory to a hashmap and then add it to the other player's inventory
if its just 1 time, you could stop the server and rename their saved playerdata file in the world folder, to the other account uuid.
i think it works with the server online as well if both players are offline when doing so
and same with inside the advancements folder
but youd need to restart to apply the changes
easier than going through a long list of attributes to copy paste over using plugin code that you need to restart to add anyways
So there isn't some sort of unified API call?
no
Okay, that's what I wanted to know
Thanks
there are for loops to get advancements, then write them. same for inventory items.
each feature of the player would be individual. so as another method you could just rename the playerdata file
Is there an Event for a pressure plate being stopped on- and off of?
I know there's PlayerInteractEvent for stepping on a pressure plate, but what about stepping off it?
should trigger too
after all it's ass pressure
it aint tho
yeah no its def only triggering when stepping on it @blazing ocean
oh yeah that's fine, works like a charm, thanks
so I made simple damage indicators using armorstands as markers, but sometimes when hitting a mob the armorstand flashes (for like a split second) before going invisible. is there any way around this or is it just something you have to deal with? (probably the second, but let me know)
Sounds like you are spawning them and then making them invisible instead of spawning them invisible
whats best way to spawn them invisible?
Use world#spawn and modify it in the consumer
does this require nms?
no
^ that is an API method
what would I put in as the consumer
could you provide an example? I haven't done this before
Would look something like this:
world.spawn(location, ArmorStand.class, armorStand -> {
armorStand.setInvisible(true);
armorStand.setDisplayName(etc)
});
Typing on mobile and going of memory but should be close enough
For reference what I used is a lambda function
yeah its like the one in stream() i just never realized thats what they were called
Now you know :)
ty
I am a aware, on some systems, it simply doesn't do anything.
frosty where's my 5 bucks
was waiting on me to confirm it being sent
what im doing is giving a itemstack a custom texture
I would assume it has a check for operators and excludes them
Hello, I have an error upon loading my plugin. it say a class was not found. I am trying to use ProtocolLib as a dependency for my plugin and use packets, but it cannot find the main class which is ProtocolLibrary
Make sure the scope of protocollib is provided in your pom.xml
Validate by opening your jar as a zip and checking that there are no copied protocllib files
And you need to have it running on your server as well
it is running on the server, my plugin.yml has the depend and the scope is provided, i don see whats wrong
Someone that has familiarity of the Map interface (like the Minecraft map), is there a way to prevent a map from being copied via a property or something?
is jitpack down for anyone else rn?
when building with maven i keep getting stuck on Downloading from jitpack.io
sometimes it doesn't build quickly enough and thus maven times out the connection since it won't wait forever
if there is something that uses jitpack I will just pull the repo and build the dependency myself
this way I don't have to worry about such things
jitpack my behated
// Raw_Chicken_Nugget
private static void createRawChickenNugget(){
ItemStack item = new ItemBuilder(Material.CHICKEN, 9)
.setDisplayName("Raw Chicken Nugget")
.setCustomModelData(8)
.build();
ShapedRecipe recipe = new RecipeBuilder("raw_chicken_nugget", item)
.shape("R", "", "")
.setIngredient('R', Material.CHICKEN)
.build();
getServer().addRecipe(recipe);
}
// Cooked_Chicken_Nugget
private static void createCookedChickenNugget(){
ItemStack item = new ItemBuilder(Material.COOKED_CHICKEN, 1)
.setDisplayName("Cooked Chicken Nugget")
.setCustomModelData(9)
.build();
FurnaceRecipe recipe = new FurnaceRecipeBuilder("cooked_chicken_nugget", source, item, 0, 5)
.build();
getServer().addRecipe(recipe);
}
how should i access the raw chicken nugget itemstack in the cooked chicken nugget recipe builder
should i just predefine a itemstack for the raw chicken nugget?
DISCLAIMER: IDK ANYTHING ABOUT THREADS
So I am using a custom CompletableFuture executor that has 4 threads allocated to it. I'm only using it to create 4 completable and I dont need it afterwards. Supposedly my plugin is leaking, so how do I fix that? Can I somehow kill all threads made by an executor?
if you know nothing about threads dont use them
any idea if there is a way to check an entity's NBT tags?
my code is checking the names but I figured I might have to read something from the nbt tag
no idea actually, this part isn't my code
if you want to have some information about your vehicle use a hashmap or pdc for persistency over restart
the thing I was trying to do is trying to read this on the "vehicle entity" that the player is riding in
What am I supposed to do, make https requests on main thread?
idfk
Bruh
i'm not sure if it's accesible since it looks to be saved straight to nbt
your only choice is to get it at nbttag load
If idk how java works internally should I not use it either??
is this your code?
this part is but both mod and plugin was based on someone else's stuff
was trying to make proper traffics in minecraft with physics and shit
in that case you need to learn more on how the plugin/mod works
I get it, so far I've only got timer, rewards working as I intended
I was thinking if I add NBT to the entity and if the plugin can somehow access the NBT stored on the mod vehicle to tell what they are
you can save the nbt of the entity to your own nbt wrapper and then get the value from there 😄
it's not really efficient but it's better than trying to do it on entity load
bandicam 🗿
asuming this ^
just call it oldschool and pretend it's not lazy lol
there's nvidia recording, obs and even windows has a way to record i think
I get that, it's just old habits
this is what I was thinking but not sure what am I suppose to import to the project for the NBTTagCompound
what is the type of the vehicle entity data?
is this even spigot/bukkit?
i'm 99% sure this method doesn't exists in bukkit/spigot
i'm just saying, chat gpt isn't helping rn
look at this code 🤣
u right, every time I try to use chatgpt it seems to gets me into a confusing loop
so long story short this is my check point race plugin, I got someone to write me a base(since I'm still using 1.12.2) and added all the features I needed
Im looping through a list of materials to print them to the screen, but it throws this error:
https://paste.md-5.net/fogivomequ.rb
This is my code:
BlockBlackListFile blockBlackListFile = GlarkourParkour.getInstance().getBlockBlackListFile();
List<Material> blockBlackList = blockBlackListFile.getBlockBlackList();
ConsoleManager.message(b.getType()+"");
blockBlackList.forEach(mat -> ConsoleManager.message(mat+""));
if (blockBlackList.contains(b.getType())) {
p.sendMessage(ChatColor.RED + String.format(ChatColor.RED + "You are not allowed to use %s in your course.", b.getType()));
e.setCancelled(true);
}
It throws this error at line 98 were im looping through the blacklist and printing the material
blockBlackList.forEach(mat -> ConsoleManager.message(mat+"")); here?
Yes.
the material list is made of strings by the looks of it
is getBlockBlackList raw type?
public List<Material> getBlockBlackList() {
return (List<Material>) getConfiguration().getList("blacklist");
}
ah
this is wrong
you need to use getStringList
and replace it with strings
and do the material conversion yourself
public List<Material> getBlockBlackList() {
return getConfiguration().getStringList("blacklist").stream()
.map(str -> Material.valueOf(str))
.collect(Collectors.toList());
}
This better?
Why doesnt regular casting work when Im just using #getList?
this is what it looks like
because your black list is not of material type
it's of string type
So yml files automatically convert a list to string list?
that's the expected behaviour in most cases so yes
Gotchu
unless you save a list of materials to yml
where at the start of the list it says the type
it's a string double etc
Gotchu gotchu
awesome 😄
use Material.getMaterial("name")
at least it works lol
😄
guess still got a long way to go before i can finally put pizzaboy missions in place lol
forzen?
so far the only way I found to limit players from vehicle class is making sure they "don't having certain items in their inventory"
it's a joke
joke in that it is misspelt?
ok that's just me being dumb
lol
but not gonna get into details but the whole project I'm trying to do is a joke
I was just making sure it was misspelt or if it was intentional
but yeah its a nice joke that isn't obvious unless someone is paying attention 😛
I guess that depends on how I claim that stuff lol
@wet breach here is another one lol
love the sign
but anyway, I still have to figure out somehow attach NBT tag on mod vehicles and then read it from plugins lol
why is this difficult?
doing cars in minecraft kinda makes me question my life decisions lol
do you mean mods client side and plugins server side?
it's just I am not fimilar and haven't managed to find someone on fiverr so basically I am just doing everything myself atm
idk if I am understanding it correctly here but both server and client has the mod, and since the mod vehicles are just an entity so I was thinking
attach nbt tags on mod vehicle, and then let the plugins to read from it
u can probably tell which part is from me by how some functions are "badly implemented" comparing to the rest lol
why do you need to communicate between mod and plugin via nbt?
tbh I don't really know why, I just got this idea when I was doing the code on the mod side and
I am assuming spigot and mod aren't gonna directly access each other
ok u got me, I never thought why not
so what would be a good solution for checking the vehicle name?
I would imagine that is the name of the entity? anyways not sure why we mixing mods and plugins anyways
that's what the mod vehicles returns by checking the name directly from plugins
if both are your projects, you could just have the mod just communicate directly with the plugin
just have the mod, tell the plugin, this is the name of this thing
so implement something on the mod side to change the name?
well it can be done on the plugin side too, you could just make a method in the mod for the plugin to access
this way, it doesn't have to do weird things to get something like a name lol
ok seems like this is out of my knowledge, is there anything I can look into?
ok, so nametag doesn't read aswell xD
well, I don't know how the mod is implemented
generally, you don't have mods and plugins
but, my understanding of how mods work is mods essentially replace code/classes in the server when they are loaded, thus it should technically be possible for a plugin to simply just access a mods code/classes directly since plugins are loaded into the server as well just they don't replace functionality like mods do rather sit on top
I think I have a solution now, a stupid one
getcustom name will get nametag, gonna add nametag to vehicles
u won't believe how I made "self driving" in game lol
check ur pm 🤣
its all about creativity
as I said, if it works it works lol
I am quite familiar with needing to be creative, I am one of the people who made holograms a thing just fyi 😉
^
pass the raw chicken nugget recipe as argument of the createCookedChickenNugget method then do getResult on it
you could do Bukkit#getRecipe instead if you don't want to pass it as argument, however it doesn't seem like you are saving the namespaced key anywhere to reference the recipe properly
it just screams desync issues doing it that way, if you were to change any part of it
ideally, what I would do is convert those methods into an enum, that way you don't have to worry about desyncs
Thank you for the pointers I’ll look into them
eh, scrap the enum idea, I don't know how to feel about it after typing it out lol:
public enum Recipes {
RAW_CHICKEN_NUGGET("raw_chicken_nugget", new ItemBuilder(Material.CHICKEN, 9)
.setDisplayName("Raw Chicken Nugget")
.setCustomModelData(8)
.build()) {
@Override
public Recipe createRecipe() {
return new RecipeBuilder(getKey(), getItem())
.shape("R", "", "")
.setIngredient('R', Material.CHICKEN)
.build();
}
},
COOKED_CHICKEN_NUGGET("cooked_chicken_nugget", new ItemBuilder(Material.COOKED_CHICKEN, 1)
.setDisplayName("Cooked Chicken Nugget")
.setCustomModelData(9)
.build(), RAW_CHICKEN_NUGGET) {
@Override
public Recipe createRecipe() {
return new FurnaceRecipeBuilder(getKey(), getDependency().getItem(), getItem(), 0, 5)
.build();
}
};
private final String key;
private final ItemStack item;
private final Recipes dependency;
CustomRecipes(String key, ItemStack item) {
this(key, item, null);
}
CustomRecipes(String key, ItemStack item, Recipes dependency) {
this.key = key;
this.item = item;
this.dependency = dependency;
}
public String getKey() {
return key;
}
public ItemStack getItem() {
return item;
}
public Recipes getDependency() {
return dependency;
}
public abstract Recipe createRecipe();
public static void registerAllRecipes() {
for (Recipes recipe : values()) {
Bukkit.getServer().addRecipe(recipe.createRecipe());
}
}
}
maybe if you got rid of the recipe builders it'd look more clean, but eh
oh and unrelated but you should use item name instead of display name for this
I would just have static fields for the items somewhere
or just dont hardcode them and have a item database
eh, that's often way too complex for most use-cases, you'd have to define a human-readable format for item stacks and all that jazz
it'd be good for a exhaustive recipes plugin or whatever but I doubt that's their goal
KFC has a huge arsenal of food
I wonder if people would use a generic item database plugin if I made one
With an api
best to try it out
otherwise you'll never know
I don't think there's enough of a demand for that kind of thing, but it sounds fun
i thought the same about pathfinding and i was proven wrong
as long as its easy enough to integrate, people will use it
public class Recipes {
public static final ItemStack RAW_CHICKEN_NUGGET_ITEM = new ItemBuilder(Material.CHICKEN, 9)
.setDisplayName("Raw Chicken Nugget")
.setCustomModelData(8)
.build();
public static final Recipe RAW_CHICKEN_NUGGET_RECIPE = new RecipeBuilder("raw_chicken_nugget", RAW_CHICKEN_NUGGET_ITEM)
.shape("R", "", "")
.setIngredient('R', Material.CHICKEN)
.build();
public static final ItemStack COOKED_CHICKEN_NUGGET_ITEM = new ItemBuilder(Material.COOKED_CHICKEN, 1)
.setDisplayName("Cooked Chicken Nugget")
.setCustomModelData(9)
.build();
public static final Recipe COOKED_CHICKEN_NUGGET_RECIPE = new FurnaceRecipeBuilder(
"cooked_chicken_nugget",
RAW_CHICKEN_NUGGET_ITEM,
COOKED_CHICKEN_NUGGET_ITEM,
0,
5
).build();
public static void registerAllRecipes() {
Bukkit.getServer().addRecipe(RAW_CHICKEN_NUGGET_RECIPE);
Bukkit.getServer().addRecipe(COOKED_CHICKEN_NUGGET_RECIPE);
}
}
looks simple enough
if its too complex, only people will use it who have no other choice
who proved you wrong
pathetic?
yes
eh, people don't really use that library lol
since most devs don't quite understand what pathfinding algorithms entail
they find it daunting, even though it is pretty easy to use
well, im the dev and i can say they do
I am talking about the average spigot developer in this case
but in the beginning of pathetic i thought the same
thats where i was proven wrong
you cant succeed if you overthink the outcome
I mean, this isn't a motivation type of thing, but rather the fact that there's simply not much people dealing with pathfinding in general, as there isn't a lot of use for it in your average public plugin
The api would be very simple, something like ItemDatabase.getItem(name)
i dont really want to flex with numbers, but i can tell you its the opposite. thats what i mean with if its easy enough, people will use it
and even tho pathfinding is a niche, there are still several people using it for many different things
and i dont do shit for the big crowd, but for the people who need it. and i think that should be the main goal in the first place
i suggest to have a system behind it. a factory for new items, configuration options like what file or database type etc
as answer to this
Yeah ofc
it'd probably be good to have an API which sets a standard serialization format if anything, mostly on older versions where that doesn't really exist
if you can achieve that, the rest would be easy
I was just gonna do binary serialization
- tests are very important in your case
that works for just storage, but I'd imagine for use cases such as recipes, they'd want the option to have an human-readable format too
a database lib should be reliable
in newer versions that's easy since you can just tell the codec to spew json, in older versions not as much
though the json format is quite verbose, so probably some standard transformation options too
I don't know, I just personally find more appeal in standarizing how items are stored, be it for configuration purposes or just plain storage but maybe that isn't your goal
I mean for recipes you could just reference the item by its unique name
@wet breach just came here to say thank you, I found that by adding tags with exact same name will actually work as a name tag
is that actually mc
it looks like roblox
yes
i dont really get why its the libs job to provide a human-readable format
that's crazy
it is minecraft
concentrate on the database stuff and give them the api to query the items
the rest is their deal
most plugins don't use a database, they use a yaml file
whether that is a good choice is debatable, however that's the reality
I mean, I don't know what Jish is making lol
i also am a lazy user throwing everything into my yaml
That’s when you reference a custom item by name
right now it is just all ideas
then what are you debating about lol
^
I am not debating it, I am myself suggesting ideas, you were the one asking me about the thing I mentioned
A human readable format would be painful with all the fancy components we have now
Easier to edit the items in game with some sort of gui
I dread having to join the game just to edit some items but ig it is what it is
Modded or resource packs?
but to get back to your question @young knoll, just do it and give it some time. you would have my support, since it would be useful for me as well
looking at the previous convo, it seems to be plugin-based
nice
it looks cool yeah
I wanted to make a mario kart recreation at some point
though kev did that with xenyria (or was it cytooxien?)
Turbo kart racers
I always liked the idea of those minigames however they just fall apart with bad ping and that's what I live with lol
Yeah there’s a Mario kart datapack iirc
so I never really actually tried to make one
well currently I'm just working on [redacted] which is also pretty fun
or there's this https://www.spigotmc.org/resources/vehicleswasd.115364/
even open source
I wish xenforo had embeds
ofc modded
definitely
building is always the part that sucks the most
smh my head
is it fabric at least?
Someone is doing a full physics system for racing in a datapack
and still at 1.12.2
😭
Which is wild
Sethbling?
how does it not lol
it just calls close
it is straight out masochist behavior to do it in a datapack lol
when closing the socket doesn't close the socket :bigbrain:
haven't seen their channel in ages, wonder what they're up to
He's making a full physics engine in a datapack
he made his own programming language that compiles to datapacks
MCC is one of the crazier servers
that I did see, various of those spawned afterwards
did you see that guy doing Portal?
Yeah
is the yellow things just all displays
that physics actually looks insane
to think it is made in mc commands/functions
rocket league with that when
get tardigraded
