#help-development
1 messages · Page 487 of 1
thats 1.20 though
It's 1.19.4
wait wut
Yea, they are out now.
oh wowie ok ty

fixe 🙂
the name of the entity is block_display_entity >?
It should just be block_display
when i do /summon nothing comes up for that
You have to provide the nbt data as well. Otherwise, you'll get nothing. Those entities can display literally anything. You just need to tell it what.
isn't block display an experimental feature? there might be a setting for that
Don’t think so
it got added 1.19.4
What happens if you type it anyway
spawns an armor stand
What is the output of /version
You're in the wrong client version.
how would i expand/rotate a blockdisplay? i cant see any methods that would help with this?
This should help with that: https://mlakuss.github.io/minecraft-display-entities-generator/
i can use that nbt with the api?
Yes, so long as you've got the methods to set NBT data.
However, I'd recommend using the built in methods like #setTransformation() & #setInterpolationDuration()
https://paste.md-5.net/xamukenete.coffeescript
https://paste.md-5.net/iyizucekof.bash
Seems like the bungeecoord api is not getting the server
any idea?
display.setBlock(data);
display.setRotation(240, 240);
display.setDisplayWidth(10);
display.setDisplayHeight(10);
display.setTicksLived(Integer.MAX_VALUE);``` pitch isnt working and displayheight and width arnt doing anything
Whyis the tickslived max value?
so it doesnt despawn
make it -1
ty but still doesnt work same problems
just spawn concrete with a pitch, yaw, and a certain display size
any errors?
nope
try sending some debug messages
wait nvm the error is from the ticks lived
java.lang.IllegalArgumentException: Age must be at least 1 tick
ah
nvm
tbh i'm not really good with the 1.19.4 api might have to ask someone else
im used to .3
try save config
I ddi
this.saveConfig();
getConfig().addDefault();
getConfig().addDefault();
getConfig().addDefault();
saveConfig();
getConfig#addDefault(path, value)?
Yes
getConfig().addDefault("toggle-on", "&4&lYou have");
getConfig().addDefault("toggle-off", "&4&lYou have");
this.saveConfig();
where did you put it and is it loading that
rn i'm just guessing sense i got no code
The code is literally this
that is all?
getConfig().addDefault("toggle-on", "&4&lYou have &a&lENABLED &4&lCustomDropProtect.");
getConfig().addDefault("toggle-off", "&4&lYou have &c&lDISABLED &4&lCustomDropProtect.");
this.saveConfig();
first 3 lines of onenable
oh main plugin class ah
Idk
getConfig().options().copyDefaults(true);
getConfig().addDefault("toggle-on", "&4&lYou have &a&lENABLED &4&lCustomDropProtect.");
getConfig().addDefault("toggle-off", "&4&lYou have &c&lDISABLED &4&lCustomDropProtect.");
this.saveConfig();
works fine to me
sout the exception
mk
02:11:57 [INFO] Index 1 out of bounds for length 1
but how?
if (args.length == 0) {
player.sendMessage(new ComponentBuilder("Please enter the lobby you want to connect to!").color(ChatColor.RED).create());
return;
}
String a = args[1];
System.out.println(all.getMessage());
thats the full error lol
wait let me try something
Which one is 26
String a = args[1];
Is it the one acceding
Yes that
Thought so
The arguments is 1
Not 2
String a = args[0]
args[0] would bet he command though?
No
Oh wait
You’re using the bungee version
Ngl I have no clue, my test would be to sout args to see what’s in it or check the docs
But out of bounds indeed means there’s nothing there
It works!
tysm!
System.out.println(Arrays.toString(all.getStackTrace()));
= worst way to print a stack trace
Normally i just make a custom yamlconfiguration
personally
Args stands for arguments. The base command cant be an argument. So it is represented by its own parameter called command
Is anyone readily available with a Spigot test server on 1.19.4?
And can you verify whether or not an EntityDamageEvent is called twice for a single lightning strike on a player?
Ideally latest commit but honestly if you're a few behind it's not a huge deal
I'll build it rq
Anyone know why whenever I clone a group, the prefix doesn't work?
ignore the Rails dying to lava 
Looks like it to me
Code at the top, mc, and console
downloaded a fresh off the press buildtools and built a fresh jar
tyty. Much appreciated, Mike
thanks

Actively working w/ Doc to track down a bug lol
What is this bug
a introduced bug xd
Someone did a fucky wucky
A big ole oopsie woopsie
you have to return true
private static final String[] SERVER_ORDER = { "lobby1", "lobby2", "lobby3", "lobby4", "lobby5" };
public void execute(CommandSender sender,String[] args) {
if (args.length > 0) {
if (sender instanceof ProxiedPlayer) {
ProxiedPlayer p = (ProxiedPlayer) sender;
p.connect(ProxyServer.getInstance().getServerInfo(""));
}
return;
}
ProxiedPlayer p = (ProxiedPlayer) sender;
for (int serverIndex = 0; serverIndex < SERVER_ORDER.length; serverIndex++) {
String serverId = SERVER_ORDER[serverIndex];
ServerInfo serverInfo = ProxyServer.getInstance().getServerInfo(serverId);
if (serverInfo.getPlayers().size() < 20) {
p.connect(serverInfo);
break;
}
}
}```
At least that's how I'd compact it
tyvm
For any chance this happen all times?
In the WIP/PR where im testing the damage and event happen 2 times but not all the time i make the summon...
😴
What did you do to my perfect spigot 😭
Oh After doing it I found it
Isn't this because sometimes lightning strikes twice on a single summon?
Are you sure this is a bug? Looking at the source code shouldn't it always do 2 hits of damage?
Not always
But maybe it has to do with pigs possibly? Only other entity that has something to do with lightning
Pigs turn into zombie pigs if they are struck with lightning
Well not the only entity i suppose. Creepers turn into charged creepers if struck by lightning as well
Unless I'm reading this wrong it is https://haste.miketheshadow.ca/fivoduguyi.kotlin
What's the most efficient way to find an offline player's name if you have their UUID?
found getOfflinePlayer() nvm sorry
That might perform a web request to mojang so do make sure to run it async and then jump back to the main thread when it returns a value
Only if u use it by name
Ye same at first :,)
Hey there, how can I set love mode/breed mode on animals?
declaration: package: org.bukkit.entity, interface: Animals
I tried animal.setBreed(true) and all that, no results
It just does not work``` for(Entity entity : this.block.getWorld().getNearbyEntities(box)) {
if( entity.getType().equals(EntityType.SHEEP) ) {
Sheep sheep = (Sheep) entity; Breedable sheepLove = (Breedable) sheep;
if( !sheep.isAdult() || animals.get("SHEEP.Adult") == 0 ) { continue; }
animals.put("SHEEP.Adult", animals.get("SHEEP.Adult")-1);
if( sheepLove.canBreed() ) { sheepLove.setBreed(true); sheep.setLoveModeTicks(1000); }
}
}```
My guess is that Did not read the paste codeanimals.get("SHEEP.Adult") == 0 is true
Its not, I tested it with the shear
Why are you even using that animals map
Seems redundant
declaration: package: org.bukkit, interface: World
EntityType.SHEEP, EntityType.PIG, EntityType.COW, EntityType.MUSHROOM_COW
));
if( animals.get("Total.Baby") <= 5 ) { return; }
if( animals.get("SHEEP.Adult") % 2 == 1 ) {
animals.put("SHEEP.Adult", animals.get("SHEEP.Adult")-1);
}```
🤷♂️ See if you can add some debug messages or use a debugger and make sure it actually reaches the set love ticks method
It reaches to the love ticks, I know. I told you it been tested with the shear. I tried searching before asking here and posts, they super outdated
Hi , ips from the player is string or int ? i think is int but i am not sure
I noticed an issue with my design.
/**
* A HashMap of every player's Group.
*/
private final HashMap<UUID, Group> groupPlayerUuids;```
This stores a reference to the `Group` object a player is a part of. However if a player rejoins the server their UUID object reference is different than the one used to reference the group. Is there a way around this?
yeah you can obtain the host adress as string
That shouldnt be the case as hashmap is using equals override for keys
And uuid equals is checking for internal longs
It's not reference check
lemme verify that real quick
You're right
Yeah it doesn't check if the references are the same 😅
Hey guys not sure if this counts under development but
What makes existing plugins break when a new version of minecraft drops
Code changes between versions
So the plugins that expect certain code to exist break when it isn't there
Is it hard to manually update it via editing the source code
Depends on the plugin
As a person who doesn’t know java
Yeah that could be hard
Cuz I found some plugins I wanna use for when 1.20 drops
Certain plugins won’t break when updated to new version of mc right?
Yes
only plugins that use slughorn break on new versions
How does slughorn work
?nms
slughorn = nms lol
So I can edit text from 1.19.4 to 1.20 then server will recognize plugin?
Im gonna be annoying, but I feel like someone has to say it, that comment there is absolutely useless.
Or javadoc whatever
usually, yes
why the heck does mysql allow a lengh of 0
isn't that totally useless lol
thanks fam
also, does this mean that BINARY can only go from 0 - 255 in length?
Pls see my question in #general
This is fastest way to get ignored
Looks like it, but I would bet that isn't the case lol. Although when I think I never used binary for something more then 128 bits lol
pls checkout my question in #another-server
which one
idk
ah yes, I've seen it
🎵 I've got so many questions on my mind 🎵
russian FBI agent
damn what's the song name again
The entire time my issue was due to player.getUniqueId() == member.getUniqueId(). One line in my code was checking if the references were the same where-as I should be using UUID's equals method 😭
guy asked for help even before wrote a question
you should always use equals() unless you know you shouldn't
nice ==
💩
Lemme just quickly do Ctrl+Shift+F and enter in == to verify that all of them are what I need them to be 😂
I'm making a custom recipe, but the item double whenever I acquire the product from the crafting slot.
(I didn't use ShapedRecipe because the crafting elements contain custom items.)
What could be the problem?
This is my code:
public void craftItem(PrepareItemCraftEvent event) {
CraftingInventory inv = event.getInventory();
boolean[] part_tag = new boolean[10];
for (int x = 1; x <= 9; x++) {
ItemStack item = inv.getItem(x);
if (item != null && item.hasItemMeta() && item.getItemMeta().getPersistentDataContainer().has(new NamespacedKey(plugin, "smithingtag"),
PersistentDataType.STRING)) {
part_tag[x] = true;
}
}
boolean detect = false;
if (detect == true) {return;}
int board = 0;
for (int x = 1; x <= 9; x++) {if (inv.getItem(x) != null && inv.getItem(x).getItemMeta() != null && inv.getItem(x).getItemMeta().equals(Items.boards("board").getItemMeta())) {board += 1;}}
if (board == 1) {
int prop = -1;
for (int x = 1; x <= 9; x++) {
if (inv.getItem(x) != null && inv.getItem(x).getItemMeta() != null && !inv.getItem(x).getItemMeta().equals(Items.boards("board").getItemMeta())) {
if (prop == -1) {prop = x;}
else {prop = -1; break;}
}
}
if (prop != -1) {
final boolean smithingtag = inv.getItem(prop).getItemMeta() != null && inv.getItem(prop).getItemMeta().getPersistentDataContainer().
has(new NamespacedKey(plugin, "smithingtag"), PersistentDataType.STRING);
if (inv.getItem(prop).getType().equals(Material.BRICK) && !smithingtag) {
detect = true;
inv.setResult(Items.boards("ingot_board"));
}
}
}
if (detect == false) {
for (int x = 1; x <= 9; x++) {
if (part_tag[x] == true) {
inv.setResult(null);
break;
}
}
}
}
I love how IntelliJ just counts to "103 matches", then stops counting, and just claims it's "103+" like wtf
I thought the recipe cannot distinguish the same material but with different itemmeta.
I only got 39 matches 😮
it can do that just fine, but only on ShapedRecipes. For Shape**less*Recipes, it cannot do that
To be fair though I've only worked on this project for a couple weeks now 😅
goblin
public class GroupMember {
private final UUID uuid;
private final String name;
private GroupRank rank;
public GroupMember(UUID uuid, GroupRank rank, String name) {
this.uuid = uuid;
this.rank = rank;
this.name = name;
}
public Player getPlayer() { return Bukkit.getPlayer(uuid); }
public void setRank(GroupRank rank) { this.rank = rank; }
public UUID getUniqueId() { return uuid; }
public String getName() { return name; }
public GroupRank getRank() { return rank; }
@Override
public boolean equals(Object obj) {
if ((obj == null) || (obj.getClass() != GroupMember.class))
return false;
GroupMember id = (GroupMember)obj;
return this.uuid == id.uuid;
}
}
```added an equals method for good measure 😄
Why calling method near obj==null?
if (!(obj instanceof GroupMember member)) return;
return member.uuid.equals(this.uuid);
also the equals() method should check both name, and rank, too
should it
whoops. fixed
i mean just for internal use
if you have two group members, with the same uuid, but different names, I would not consider those to be the same
the passed in object could be null, this is for efficiency
same uuid's problem xD
I don't think so tbh
default equals impl also compares to null
doesnt it?
That would allow for child term types to be equal a term of the type itself
I replaced == with equals 😅
truuue
daddy?
@Override
public boolean equals(Object obj) {
if ((obj == null) || (obj.getClass() != GroupMember.class))
return false;
GroupMember id = (GroupMember)obj;
return this.uuid.equals(id.uuid);
}```
but he doesn't have subclasses
Do you think mc ever had uuid collision?
Do you getting npe?
which is probably something you dont want to have cause of hashmap collision checks etc
yes, in my SkullUtils class
Ur lucky guy ahahahha
gay class
?
private static final UUID RANDOM_UUID = UUID.fromString("92864445-51c5-4c3b-9039-517c9927d1b4"); // We reuse the same "random" UUID all the time
``` 🥲
with uuid collisions
What do you mean?
cool
Do you getting NullPointerExeption?
No no, I am only adding this as a precaution
If I try to cast obj as a GroupMember object when it's in fact null, would cause a nasty error
By contract of Object::equals
passing null should return false, not NPE
imagine how many plugins would break on a typical mc server cuz of uuid collision
no, you can safely cast null to anything
Ah, now I know
regardless, if the passed in object is null it can't equal the current object
String asd = (String) null;
should work fine
that is true ofc 😄
ClassCastException: Cannot cast joe to String
wait what
you can call static methods of null
ofc
yes
funny
static methods can be invoked on instances and variables
but like, afaik its supposed to be avoided
yeah it looks funky
iirc effective java classifies that as an antipattern
wanna see more weird java?
public class Test {
public static void main(String[] args) {
if (true == false) { // \u000a\u007d\u007b
System.out.println("Java can be weird. This line DOES get printed!");
}
}
}
Please NukerFall, try stay a little bit serious at times
doesn't that
doesn't that make it false
The Gifs are probably better suited in general I’d say at least some of the ones you send.
true == false?
note the comment behind the if
you can also randomly insert http links into your code and it still compiles fine
class Test {
public static void main(String[] args) {
https://blog.jeff-media.com
System.out.println("Visit my website");
}
}
terminates the line, and adds a }
?
yeah sth like that
iirc it's just }{
so the if(false) { becomes if(false) { } {
Hi, i made my system of commands work on annotation and i wanted to make a system for subcommands, but how can i get in class if there are @Subcommands annotations?
for reference here my classes and an example
BaseCommand Class: https://sourceb.in/DzfUpDEDAL
Example Class: https://sourceb.in/BcKm31DDCq
YourClass.class.getAnnotations()
its not a one class, they can be different one
then use myObject.getClass().getAnnotations()
shouldn't get them as list in theory so i can just get them and execute them? and only specific that's get them in general
Annotation[] annotations = someObject.getClass().getAnnotations();
for (Annotation annotation : annotations) {
if(annotation.getClass().equals(MyCustomAnnotation.class)) {
// It's your custom annotation
}
}```
ok thanks
i don't really understand what you mean
or just use Class#isAnnotationPresent
i meant if i have a class
public class ExampleCommand extends BaseCommands {
//Code for the base
@Subcommands
public void exampleSubCommand() {
}
}
This should get it
ah I see, loop over getDeclaredMethods(), then check the annotation there
for(Method method : myCommandClazz.getDeclaredMethods()) {
if(method.isAnnotationPresent(Subcommand.class)) {
// "method" is a subcommand
}
}
Annotation[] annotations = getClass().getDeclaredAnnotations();
for (Annotation annotation : annotations) {
if(annotation.getClass().equals(SubCommands.class)) {
subCommandsList.add((SubCommands) annotation);
}
}
``` same as this
no, you currently only get the annotation of the class itself. you have to loop over the declared methods, then check if any of those has the Subcommand annotation
like this
and cast the method as SubCommands so i can add it into a list and then check if the subcommand is the same as the args[0]
nope! do not cast the method, but cast the annotation
for(Method method : myCOmmandClazz.getDeclaredMethods()) {
if(method.isAnnotationPresent(Subcommand.class)) {
// "method" is a subcommand
Subcommand subcommand = (Subcommand) method.getAnnotation(Subcommand.class);
String name = subcommand.name();
}
}
sth like this
What causes it to be a “rarely no”
There have been some API changes that break things in the past
1.13 is a notable one because of the flattening
Though even that spigot made an effort to minimize issues
for example ServerGamePacketListenerImpl has a field called "connection". that became private in 1.19.4 but was public before
so plugins that used that field will now have to find a different way to access it
So no one would know whether 1.20 will break stuff until stuff breaks first?
1.20 will definitely break things
If you just use the api there’s a good chance you’ll be fine
yes
If you use NMS then you’ll 102% need to change things
sorry for replying late, but then as i get the subcommand and put it on a list how can i execute it?
then how would you init final fields?
as you can see, the CONSTRUCTOR_INVOKER thing is final
final field
I wish java could magically detect that a method is called from a constructor and therefor allow said method to set final fields too
Or a keyword that marks a method as such
but what if someone else called that method again then
im sorry wtf is this code
Private methods only
1.19.2 had a cursed constructor for ServerListPingEvent
Pretty much
it took in a boolean "isPreviewChat" or sth
Idk what I would call the keyword
so I need reflection to support 1.19.2 and <all other versions>
I just don’t like having a ton of code in the constructor itslef
"fancy"
public static fancy void setup()
but it's fancy
slef
Someone get uhh
you cannot argue that it's not fancy if it's literally called "fancy"
John Java on this asap
Shit
try @DinnerBone
@Mojang
Bros can fork jvm/jdk and rename it
@Microsoft
@Windows
hello wilson
WILSOOOOOOON
did anyone watch the new tom hanks movie btw
Damn we got a programming language in our discord
wtf
funny
who installed java on this discord server?
3 billion discord servers run java
kotlin joined the chat
Kotlin is the annoying little brother to java
thank you!
like my facts
#AD
3 billion runners serve java
3 billion devices debugs java
3 billion debugs done with java developers
3 billion bugs/features are still not fixed/implemented in java
touch very old code xd
thanks for the test and yeah the twice is a current random... not always make two times the damage.. then i waste hours in a "Bug"/"feature" already in old code xd
If I run HashMap#remove() to get rid of a reference will the object data in memory also be removed with Garbage Collection? Or should I manually clear the object?
manually clear the object? we are not in c++
the garbage collector has his own will, we never know when he do shit
but if nothing else is referencing to your object, its "marked" for removal
perfect, thank you.
á outlawed
what would be the best aprouch to make player able to create their own island
and also load/unload then when needed
sky island?
Simplest is divide the world up into areas (Math), and prevent the player moving outside theor area
not talking about that i mean how do i actually create the island. Like use the blueprint etc
create a Void world
yeah what he said start from 0 0
schematics
aight thx
you use a void world, and then generate the islands from the schematic at either pre-determined points
or random places
worldedit api has schematic loader
generally its done at random with a check to ensure minimum distance from other islands
Bukkit has a Structure loader
schematics are easier
which handles Blocks and Entities
doesnt it make more sense to create a own world for every player?
easier? not sure
(Schematics also handle blocks and entities)
i mean you could randomize the islands
indeed they do, and they handle states
Both schematics and structures handle the same data
From a logical standpoint, yes. Performancewise it would be horrible
I see no advantage to use WorldEdit for it over the built in Structures
Schematics are also much smaller
Why though? WHat advantage over Structures?
Smaller, easier to make
plenty, they are smaller, more things are compatible with them and easier to make
Smaller possibly (I've not looked) but what "easier" about it?
Structures are limited to 48x48 with just structure blocks
You can make bigger ones but you need a different tool
You would have to use FAWE to make them
No
Normal worldedit can't export as a structure
haha
Bukkit can though
Sure but writing a plugin just to make the structures is annoying
When FAWE can already do that
if I had to choose, I would choose schematics just because I am more familiar with them. So far you haven't presented why structure should be used over a schematic o.O
i have seen people make their own schematic loader
its not hard, a single class of like 30 or so lines is all that is needed for loading a schematic
Also schematics can hold biomes, structures cant
For 1, it's built in function. for 2 I've yet to hear of any reason why it's "better" to use another plugin when it's already in Bukkit and takes a couple of line of code to implement
technically schematics can hold whatever you want them to, its just a matter of how much compatibility do you need with other things
I mean both are just NBT files
built in function doesn't mean better. There is plenty of built in things in MC that are done better custom
https://www.youtube.com/watch?v=8qlnlvigodM ill just use this i have worldedit on my server anyways
Love the video or need more help...or maybe both?
💬Join us on Discord: http://discord.gg/invite/fw5cKM3
Thank you for tuning in to this episode of TheSourceCode! ❤️
If you enjoyed this video make sure to show your support by liking , commenting your thoughts, and sharing for all your friends to see and learn!
All code is available on Github:
...
most people use the world edit format for schematics
Still not hearing any reason NOT to use Structures. What exactly is "better" about schematics?
they are smaller
thats all?
easier to port arouind is a lie. they are literally nbt files
copy and paste is too hard for you?
Effiency in Loading I could acccept
I mean if you want specific biomes that always helps
to hard? thats litteraslly what Structures do
that isn't what I am talking about
schematics are literally single files
moving them around is super easy
So are Structures
^
also, worldedit exists to create schematics easily too
it's a Single nbt file, you can paste anywher, rotate and even apply integrity
I support both in my project ¯_(ツ)_/¯
well, since you haven't told me how they are better I will stick with schematics

why does this matter?
Funny enough due to limitations with the API the impl for schematics is smaller than structures
seems similar
and the Bukkit.getStructureManager() exists to create Structures, no extra plugin required
it depends on your usecase, structures are much better if you have lots of (usually smaller) structures and need to modify the builds within them a lot
visualising the end result is much easier with structures, and you don't have to deal with origin of //copy
Is it possible to change a music discs audio?
Resource pack
origin is usually in the schematic file if you want to use it
its not necessary to however
in the case of islands, don't think it really matters on the origin in this case
Structure allows you to place anywhere you like. No offset in the file
So does a schematic with a good reader
offset is only used if you were placing from player, but if there is no player offset is unnecessary
Yeah I'm still seeing littel to no reason to require an extra plugin/reader when its built into Bukkit.
Speed of placement is the only one I can really see
The problem with the built in system is that you have to place it all at once
schematics can leverage threads
https://github.com/Shynixn/StructureBlockLib this is very nice btw
In the correct implementation, thats true
Once we get block state cloning and proper virtual entity support structures will be much better
Until then they are kinda lacking
but, since structures have no better advantage I still don't see a reason for myself to switch. If other people want to, that is fine, but you have failed to convince me they are better
Isn;t there a PR ongoing for that?
wdym virtual
just because bukkit has an api for it, doesn't necessarily mean better. Just means convenient which has a trade off usually
The entities you read with bukkits structure api are virtual
There is no way to manually add them to a world
I wasn;t trying to convince you. I was waiting for you to convince me.
doesn't your source have more control?
I see
The blockstates are also virtual
well, since schematics can basically be however custom you want it to be, you don't have anything to adhere to. Structures can't be too custom they have to conform to whatever the system dictates
so schematics means you have more freedom, but the disadvantage I guess is a reader and writer but like both are approximately 30 lines of code to make
Structures can have arbitrary data too
Apart from pasting ridiculously sized builds I haven't come across anything you can't do with structures vs schematics yet
I guess I'm lazy. I'll stick with Structures and wait for improvements 😉
They are a persistent data holder
to an extent
The heck you mean to an extent
They are both nbt files
They can both hold the same things
haha man spitting facts
one has to conform to a system, the other doesn't.
so schematics can hold not just arbitrary data but literally any data you want it to
I mean yes it has to conform to PDC
But PDC can handle anything with the right adapter
right, so have to make a custom adapter and what not. But even then, it still has limitations
the only conformity for schematics is for compatibility purposes with other plugins, if that isn't needed you are free to add as much data to it, even data that doesn't even relate directly to it but maybe to have it do something at particular times or something else.
You sound like you are arguing to convince yourself to keep using Schematics.
No I don't need convincing already told you I have no reason to switch
I am saying schematics have more freedom/flexibility
because there is nothing for them to conform to
So truth is, you already use Schematics
indeed, pretty much said this way up above somewhere
why would I toss out code that works? lol
just because a new system came along? XD
No reason, it just seemed you were struggling to find a difference when there is very little. I've give you performance when pasting, but thats about it.
and the fact it can store literally anything you can think of
no
yes, it's just an nbt file
you (in thoery) could tack on anything, so long as it's valid json
Structure files are stored as an NBT file.
This file format is used to store structures such as end city, igloo and fossil into the data/minecraft/structures folder inside client.jar. Custom structures can also be saved and loaded using the structure block. These structures are saved into the /generated/minecraft/structures subfolder in the worl...
unless the api lets you add custom stuff in there, that is the format
unless we talking about creating custom loader/writer of course
You can't add arbitrary data to either without your own implementation.
to make a custom island world with random islands you are going to need a custom plugin. Now you could choose to hook into WE if you want to, or just code up a reader/writer. But that reader/writer doesn't need to be modified to add custom data
or even read it
in your case, if we strictly go with the API, you are conformed to the format given
Thats true
but yes if you had a custom reader and writer for the structure stuff, you could add whatever you wanted
but then you couldn't really use the API or have limited use
Whenever I restart the server the uuidTag of the itemstack backpack() in my inventory resets to null causing the contents to not load. Why is that and how can i fix it?
https://paste.md-5.net/fenototuve.cs //i fused the classes so i didnt have to send 3 of them//
posting random sections of code will not get you help
loading backpack inventory from hashmap on rightclick with the item:
https://paste.md-5.net/oyuyumadek.cs
function giving me the item (don't think it's necessary to send but to be sure):
https://paste.md-5.net/cerayonaza.java
creating the itemstack:
https://paste.md-5.net/egumogudek.cs
what is null? where? where are you loading the data? where are you generating it? where are you saving it?
When I give myself the backpack() it has the tag with the random uuid but when i restart the server and then send myself a message of the tag it says null
are you sayign Main.instance.uuidTag is null?
after i restart the server yes
where do you set Main.instance.uuidTag?
when creating the itemStack
https://paste.md-5.net/egumogudek.cs
could you be more specific please
o
i create the Namespaced key in my main class if you are asking for that
but that wont get us anywhere my problem is that the tag resets whenever I restart the server
I'm not understanding what you are talling a tag
Main.instance.uuidTag is the only thing I see called tag
The Itemstack has the namespaced key called uuidTag which is a randomUuid given to the itemstack to be unique. When i send myself a message of the Namespacedkey of the itemStack in my hand it gives me a UUID as it should. When i restart the server and send myself a message of the Namespacedkey it says null
show that actual code then, to start
which part of the code
that line in yoru code inv.setContents(Main.instance.backpackMap.get(player.getInventory().getItemInMainHand().getItemMeta().getPersistentDataContainer().get(Main.instance.uuidTag, PersistentDataType.STRING)));
you are reading the inventory contents from a Map?
yes
that Map will reset upon a restart, so it's empty
it is not, i save it in my config and then load it it is full trust me
ok I'm not guessing anymore. post full classes
code snippets get us nowhere
snippets
You have a bug you can not work out, you are posting code YOU think is relevant, but you can not find the cause of your issue. Stop thinking you know what code is relevant.
ow don't detect inventories by their name
how should i detect them
Track the inventory instance
Are you actually restarting the server or using /reload?
then your saving/loading is at issue
What's the code look like for the map?
i do not think you still understand my issue
ill just record a video pay attention to the green text in chat
I think he actually does as I also believe that the issue is with how you are loading your map.
The only other thing I can think of is you not reopening the inventory after using /reload, but that can't apply here since you said that you fully restart.
how to create a config file
in main this.saveDefaultConfig and you have a config file
also you have to have a config.yml in the plugin src or something like that
yes
Cannot resolve symbol 'saveDefaultConfig
which part of code
your main class FULL
you dont need to do /reload, you can do /reload confirm directly
853 lines of code mostly useless?
This just looks like you have the wrong instance.
any1 got a good tutorial to learn spigot
I only got a tutorial on how to setup the project
you learn it as time goes by
im not familiar with java
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
you must definitely know at least the basic ideas of java, so check out one of the tutorials linked above ^
i know the basic
in that case, you can directly get started. read this ^
CodedRed has good tutorials with good explanations
does he use maven in his tutorials?
moslty spigotApi sometimes nms
but does he use maven
or tell people to just add spigot as dependency using the lame way?
ok
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
alex would you be able to help me with my issue
i dont know which part you need
the whole class
there are 3
nobody will steal your code anyway, I mean it's not even working
the config file need to be in yaml ?
no way
why not?
Yes
ok
personal buisness
nobody's gonna steal code that doesn't even work, bro
If you want to use the built in api, yes. But you can make or use your own parser for other formats
its not like a small plugin yk
to advanced
in that case, pay a contractor to fix it for you
either
- share your code, to get free help
or - pay someone to do it
its only 800 lines in your main class (should not be that big) It's not a Big plugin
you cannot expect people to help you for free, without even seeing your code
nice now my plugin work
great
I'm certain your issue is whith your loading/saving, but we need to see the WHOLE class to see what exactly you are doing
Everyone here has written shit code at one time or another. No need to be embaressed.
i am not saving the itemstack from my inventory anywhere
no code = no help
its only in my inventory and for some reason the NamespacedKey is resetting
ofc it is, you used /reload
We are not going to guess. Show code
everything's gone after reload
Which leads us back to how you are reloading the data into the map.
not at all
??
or don't
It matters not to us. If you want help, show code
agree
how can i make that when I build the plugins it auto goes into the plugins folder
By changing the output directory.
how
best place to learn for plug-in development?
I have a config file with this format: yml groups: 4bd2c67d-8f89-4dd8-89e7-727ba418d203: Name: Test Group Acronym: TG Description: Test Description. Members: 4a3f6ed4-153d-424a-858d-5fdd2e78fc54: Name: CombatBorn Rank: LEADER 069a79f4-44e9-4726-a5be-fca90e38aaf5: Name: Notch Rank: MEMBER Written by this codejava String data = "groups." + group.getUniqueId() + "."; for (GroupMember member : group.getMembers()) { config.set(data + "Members." + member.getUniqueId().toString() + ".Rank", member.getRank().toString()); config.set(data + "Members." + member.getUniqueId().toString() + ".Name", member.getName()); }If a player were to leave the group, they wouldn't exist in the members variable within the Group object. How can I update the Yml file to remove a player that leaves the group? It seems to stay there.
What are you using to compile? Maven? Gradle? Manual?
?learnjava Start by learning the basics in Java
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
someone get alex's blog post out
using maven?
how to make a /myplugin reload command ?
you register a command in plugin.yml, then set an executor to that, then check if args[0] equals "reload", and then you do whatever is needed to reload your plugin
if you never cache config stuff, the command must only call myPlugin.reloadConfig()
Just set the section to null. config.set("groups.<uuid>.Members.<uuid>", null);
ok thx
use the members key to set the section null
Yes that will do the trick. I'll set it to null before re-writing it's members. Thank you.
Hello, how can I set a custom tag to a block placed in the world ?
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
check out this @cinder abyss ^
thanks
i think im not understanding something about using nms but whenever i, in pom.xml, specify i want to use the mojang mappings various what i thought were like fundamental classes no longer exist, like EntityPlayer or PlayerConnection
blockpdc is a blessing fr
?switchmappings
there is no "EntityPlayer" in NMS, it's called "ServerPlayer"
how can I get the custom block data in my texture pack 🤔
there really is a help command for everything huh 👍👍👍
oh that's what you wanna do. You can't.
ah makes sense
yeah and all of them are links to my blog haha
you're a fucking king alex
you wanna create custom blocks with custom textures, right?
exactly !
you need to use some workarounds to get those to work, one way is to use retextured note blocks
in that case, you gotta "abuse" existing blocks that allow custom textures, e.g. Mushroom blocks (ikr? funny but it's usually mushroom blocks that people use for this)
Noteblocks, Mushroom blocks, and barriers are the common ones to use.
mushroom blocks work too, since they can have a lot of different states you can give them lots of new textures
barriers?
thanks !
I want to add 100+ ores
noteblocks yes, mushroom blocks yes, but barriers?
Yeah barriers with an entity in it
Maybe I have that one wrong, but when I see custom textures, I see barriers pop up a lot too. Maybe they are really just used for a quick and dirty hitbox, but for whatever reason, they seem to be common.
yeah so the barrier itself is useless
barriers with entities seems like a suboptimal solution
It gives the hitbox
so they're just entities to display the texture but the barrier is to give a hitbox
the barriers are only there for the hitbox
like how people make custom furniture using barriers
thank god we got BlockDisplays now in 1.19.4
that will maybe finally get rid of oraxen, ItemsAdder etc
because they all have liker "utter shit" api
I hope. They are one of the best things added to the game.
I did a bit of code cleanup in Oraxen
It's still quite bad
unironically yeah
All they need now is the ability to tie collision boxes to them and it's complete.
does oraxen at least have a proper maven artifact meanwhile?
jitpack
yes but the .jar published there doesn't work
hm how so?
it's hard to explain haha
remove your .m2 directory, then create a new project and add oraxen to your pom
it won't work
You can always open a PR and fix it
im trying to make a reload command can som1 help me ?
this is also funny
it's not maven being weird, but oraxen not properly declaring dependencies to be transitive
gradle doesn't know what that is, so there's no issue
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
there are few links that would help you
as you seem to not have fundamental knowledge
i only code in C#
Where do I ask for a developer?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
well, if you code in c# you would know that logic operator is ==, not =
That wouldn't work in C# either
use equalsIgnoreCase to compare strings
or just equals
if(args[0].equalsIgnoreCase("reload")) ...
aaaaaand check the length of args beforehand
like that
and returning something inside of method that is declared as boolean and passing main instance
why are you even doing 2 arg equal checks
becaus im the worst coder in the planet
do an args legnth, then do arg equal checks
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
learnjava then
don't worry, oliver is worse. but you MUST read the java tutorials
otherwise you won't get any better
?learnenglish ig
but you seem to be able to understand basic english
I am sure you'll understand those tutorials
otherwise, google "java tutorial <yourlanguage>"
also its pretty good skill to know english, it will surely benefit you in life
there is no java tutorial in french
?paste
its only paid tutorial
idk but the last time i checked, youtube isnt paid
breh
this isnt paid either https://www.jmdoudoux.fr/accueil_java.htm
Ces pages vous propose un tutorial sous licence GNU FDL au format HTML en ligne ou PDF sur le developpement avec Java. Il se compose de nombreux
chapitres sur les bases du langage mais aussi des chapitres plus techniques tels que RMI, JDBC, les servlets, les JSP, l'internationalisation, etc ...
their is no dark mode
turn off your screen then
it'll be magically dark
good idea
best excuse
What is the recommended way or approch to do this:
getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "['plugin name']: Plugin is enabled");
Plugins already have a enabled message
put your plugins name in 'plugin name'
this is supposed to be in onEnable method in the main class
use your logger
oh really?
My logger doesn't really exist
mhm
and this project is much smaller than me to actually make a logger
JavaPlugin#getLogger is your logger
does it matter if its a 2016tutorial ?
Oh
i thought you meant create a logger class and implement stuff like that
good
thats fine, java doesnt change that much in basics
Hi, i wanted to make a scripting system for my plugin, how can i like start trying adding for example if clauses etc..
notch coded that way, so this is why
hes dumb
Why is anything programmed in any language? It's just the language they were familiar with.
they should add an universal programming language
Sounds like a bad idea
yeah
I'm in
because that was the only coding language that notch knew and thought was appropriate for a game
notch chose to do that
and ig it is cuz java offers cross platform compatibility out of the box
i would rather code in java than python or something
Java is pretty decent for games anyways ngl
or C or its children
yeah, i can't see any reason why someone wouldn't use OOP for a game
it makes everything contained and easily managable
It’s called binary
Pure oop isn't good for much of anything tbh but a combination of functional oop etc work best
that's called assembly, or binary, you choose
Assembly is not universal it’s architecture based
imo i see OOP is very good on its own
what the best for beginer eclispe or intelij
Whatever you want to
intellij
yeah
Intellij most people use
ok
Intellij for sure
I use vscode eclipse is also extremely popular
most of us use intellij, so using intellij would be easier to get help with
I used notepad++
- anything made by jetbrains is very high quality tbh
Paint IDE >
Invalidating caches for the 20 billionth time
what sould i program to learn java
How do you guys still have issues with that?
what Level should that message be?
use info prob
I don't have a problem cuz I don't use intellij when I did though god my thing broke constantly for some reason
Gotta get all the plugins
does it add the prefix automaticly, like the [plugin name]
yeah
Yes
nice
last question, does the prefix in plugin.yml add the squere braces or should i add them?
TIL
a cli calculator
what is cli ?
command line
ok
whenever you learn a new language:
- hello world
- cli calculator
- a software to organize orders of grand pianos
time to learn
I learned Java by programming Minecraft mods and just changing the string names and etc. I also copied the code from every tutorial by hand
Everyone needs to start somewhere
Hi, how can i like make my own scripting system for my plugin, like someone has some example?
just use SKRIPT
scripting system? highly depends on the goal
After a while I rewatched some Java tutorials
never use skript
why
its for my own plugin
its perforance is horid
Start by defining your format. What do you want it to do and why
How does the syntax look
yes, and then make some mock programs
you use the System.out.println() method, and that should be in the main method, or in a method called by the main method, and all of that must be in a class
yeah, java is very strict about OOP
and then create the parsers so that atleast those mock scripts work like you want
i was joking i know how to do it
and then make a billion more scripts to refine the parser
very simple like
if player.permission has "command.permission" run [Commands] that
i just have the [Commands] system already but not the if clauses system
You can always hook skript
because is not needed skript, im making a plugin for creating a computer
i see
so you want to make a scripting lang to program the computers?
quite complicated but im sure you know that already
can a player have more than 1 scoreboard team?
To save a list in MySQL i should create an another table where put everything like
id1 | id2
id1 | id3
... | ...
?
its not a real computer, but in the game
not only do you need a format, you need to decide what inputs or output the script can have as well
yes
yes, it called bridge table
only if its many-many relationship
but like the point of you scripts is to control the computers though right?
yes but then make it not lua xD
since lua is kinda sucky
but its preference i guess
Many kids know Lua
specifically roblixers
^
that doesnt make it not sucky
yes my goal is that lol
lua sucks
okay then start by what olivo said and then go from there
Hello so I'm trying to add NBT tags to an item but haven't quite been able to
I use the remapped param and have everything setup net.minecraft.server itself is all defined and works but for some reason "net.minecraft.server.v1_8_R1" doesn't exist under net.minecraft.server was wondering if anyone knows why
Remapped does not exist for 1.8
Mappings only work back to 1.14
1.8 remapped does not even exist
i thought mappings only existsed from 1.17
1.14
I was checking threads to see if theres a way to set attack damage on a sword and this came up:
https://bukkit.org/threads/nms-nbt-tags-attack-damage.394342/
They do for spigot, but they've been released since 1.14
mappings 1.14, spigot 1.17
will this work ?


