#help-archived
1 messages · Page 107 of 1
Not a single error and crash. Anyway, thank you very much @pastel condor .
Also I use 1.11 because bedwars rel supports that
Oh yeah no problem
I can’t seem to update from 1.11 to 1.15, it just hangs when going from 1.13 to 1.14
did you looked for alternatives to bedwars fierceeo?
slowly but steady we seem to finally move to stable versions :d
i want to get inventory items from config any method?
@frigid ember create your own (de)serializer or use an existing one
Doesnt config api have getItemstack now? Why not use that
@frigid ember what have you tried?
?
i tried to loop
its fine
why are you not doing new ItemStack(Material.valueOf(this.plugin.getConfig().getString("GUI.item"))) ?
i need to allow users to make more item stack
then you need object serialization
can you explain me please
something like
GUI:
- item: STONE
lore:
- 'Message'
- 'Other Message'
amount: 6
enchanted: false
- item: RED_STAINED_GLASS
lore: []
amount: 6
enchanted: true
something like this
will require YAML Deserialization\Serialization
look at ConfigurationSerializable
then learn YAML I guess
I can give you an example from my code but it's probably not the best to follow
so i think it will register flags i guss
final everywhere
hmm
I use final only when is required
private final List<ItemStack> items = new ArrayList<>();
private ItemStack head;
private ItemStack chest;
private ItemStack legs;
private ItemStack boots;
public SInventory(Map<String, Object> config) {
List<ItemStack> items = (List<ItemStack>) config.get("inventory");
for (ItemStack item : items) {
if (item != null) {
this.items.add(item);
}
}
this.head = (ItemStack) config.get("head");
this.chest = (ItemStack) config.get("chest");
this.legs = (ItemStack) config.get("legs");
this.boots = (ItemStack) config.get("boots");
}
public static SInventory valueOf(Map<String, Object> config) {
return new SInventory(config);
}
public static SInventory deserialize(Map<String, Object> config) {
return new SInventory(config);
}
@Override
public Map<String, Object> serialize() {
Map<String, Object> back = new HashMap<>();
back.put("inventory", this.items);
back.put("head", this.head);
back.put("chest", this.chest);
back.put("legs", this.legs);
back.put("boots", this.boots);
return back;
}```
whill this work?
why are you not doing
new ItemStack(Material.valueOf(this.plugin.getConfig().getString("GUI.item")))?
Material#matchMaterial() over valueOf?
deserialize items using ItemStack.deserialize
and serialize using ItemStack#serialize
Idk what is the difference between Material.matchMaterial and Material.valueOf
valueOf is the Enum default method
valueOF needs exactly to be the name
matchMaterial tries to match without being equals
thanks for your help it worked
no way
??
oof dosnt works it opened plane inventory no items LOL
no errors tho
@sturdy oar i understand now you mean `
don't ping plz
- ==: org.bukkit.inventory.ItemStack
type: STONE
- ==: org.bukkit.inventory.ItemStack
type: BLAZE_POWDER``` if a config looks like this and we need to deserialize it right?
You can remove "==: org.bukkit.inventory.ItemStack"
- item: STONE
lore:
- 'Message'
- 'Other Message'
amount: 6
enchanted: false
- item: RED_STAINED_GLASS
lore: []
amount: 6
enchanted: true``` i need to covert this to java code
it says null
You need the == so that bukkit knows which class to deserislize
hmm i will try
is there any non-official way to bypass Minecraft's max book length?
You need the == so that bukkit knows which class to deserislize
@hoary parcel yea, but is possible use ItemStack.deserislize
so, == is not necessary
More effort
for (Map<String,Object> itemlist : data.getMapList("itemlist")) {
myList.add(ItemStack.deserialize((Map<String, Object>) itemlist));
}
for (ItemStack stack : myList) {
}``` is this what you mean
??
That looks a bit disgusting ngl
I've done some of the tests for https://wiki.vg/Protocol#Entity_Velocity but it seems has a delay.
In my localhost it has delay between 40-55 which is server tick rate but it's not the same result for my dedicated.
Is the velocity packet communicate server which cause delay?
Hi! Help me! Minecraft error: "an internal error occurred while attempting to perform this command"
This is console log! (hastebin)
https://paste.bombsite.be/unoyowuyuw
packets will be delayed from chunk sending hogging up the queues.
Is it same for all of the packets?
yes
we spoke to mojang a few days ago about that to help improve the issue
its on their list now
I'm happy to hear that. Minecraft code will be better soon thanks god
and mojang has hired someone to specifically look at reworking the network
So mojang has started to listen minecraft server community. It's great
yes, Helen, the community manager, has been doing great things 🙂
Paper teams been working with Mojang to identify a lot of issues we've fixed to get fixed in Vanilla
todays snapshot is another result of those discussions
Thanks for that and good luck! I'll try to support paper and spigot for that. You guys have done a lot of things for the community. I'm really happy for that.
is Spigot working with Mojang as well
in the talks we have, no. but md5 does have other connections to them, but i dont know how much discussion they have.
I don't know the details but I think yes. If you consider, spigot team found a lot of bugs.
Aikar is there any async update for the future?
Like performance for servers and game
yes, but far far future lol
mojang does want to get rid of the concept of a main thread
id expect at most per-world threads though
finally lol
while it is possible to divide up a world into multiple threads (I've designed the solution already), its a much more ambitious project
if it wasn't for plugins, I could of done it already 😛 plugins is what makes it hard
Oh that's interesting. I've done some process before the mojang lol
shouldve just thrown the whole notch crap out of the window and make minecraft 2.0
that prob would of been worse. at least now their usage of streams isnt deep enough that they can be reverted
but a whole rewrite likely would of just been built on streams 😛
anybody available to give some help with packets?
I'm currently listening to an incoming packet from the client with this code:
@Sharable
public class DropHandler extends ChannelDuplexHandler{
DropHandler(){}
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception{
if (msg instanceof PacketPlayInBlockDig) {
PacketPlayInBlockDig packet = (PacketPlayInBlockDig) msg;
if (packet.d() == EnumPlayerDigType.DROP_ITEM) {
// more code
return;
}
}
super.channelRead(ctx, msg);
}
}
// Main code:
ChannelPipeline pipeline = ((CraftPlayer) p).getHandle().playerConnection.networkManager.channel.pipeline();
pipeline.addBefore("packet_handler", "drop_handler", new DropHandler());
However, after executing the code if the right packet is received, the minecraft server stills handle this packet even with the return; statement in the code.
Anybody have got an idea of why doesn't it work and how to fix this?
i think you gotta throw some special exception
depends on size and what you are doing
uh
no way to do this in a... cleaner way? x)
while(it.hasNext()) it.next() or a foreach array
performance wise prob identical. iterator has a small allocation each invocation though
so if its super hot, using random accesse optimized loop avoids any allocations
a stream is even better than iterator or array
your better off writing a proper plugin for it @paper basin this is wrong approach. itll create desync
Or even, reactively processing, but not really possible on bukkit without resyncing
I just need to know if the player drops the whole stack or only one item
??? your listening to block dig packet
there is a PlayerDropItemEvent
or something like it
yup, this is the one which handle drop
._.
aikar is that u irl
PlayerDropItemEvent does not gives the stack size unfortunately :/
registering packet handlers to do stuff you should be able to do by api is silly
you can do .getItem().getAmount() ?
what if it was a stack of only one item?
I want to know if it's CTRL + DROPKEY or DROPKEY
but you're right, it should be in the API, I will create a request
InventoryInteractEvent
no, from the game, not from the inventory 😅
talking about Q rigth?
yup
is that really a block dig packet? wtf
yup x)
this is also why PlayerInteractEvent is called when you drop an item
because every single PacketPlayInBlockDig calls a PlayerInteractEvent
that's a Spigot bug which has been reported for a long time
yeah hmm no event for this
or well, the event that fires doesnt receive the boolean that expressed intent
Hi! Help me! Minecraft error: "an internal error occurred while attempting to perform this command"
This is console log! (hastebin)
https://paste.bombsite.be/unoyowuyuw
can you paste that on a less questionable paste site and also make the url you know clickable
@thorny isle index out of bounds. the list its checking is empty
Also, please post it on pastebin, or the official hastebin instance
An ad filled rehost is pretty questionable
@thorny isle index out of bounds. the list its checking is empty
@worn temple
I assume by that response you aren't a programmer and didn't code the plugin. Contact the plugin author as this is a code issue
im a plugin author but I'm new and I don't know what you mean
Hey guys, if I do
p.getInventory().addItem(Const.NETHER_STAR);
and I have the itemstack as static and final in a seperate class, would this be misuse of static?
Do you want someone to give "Nether star"? @frigid ember
Whatever list is being accessed com.macioszektv.brushextreme.Main.onCommand(Main.java:33) on that line, is empty, and you are trying to retrieve the first item in it. since nothing is in the list, it is an out of bounds exception: https://www.geeksforgeeks.org/understanding-array-indexoutofbounds-exception-in-java/
Yeah, its static abuse
@worn temple if I put it in an enum would that be static abuse as well?
@frigid ember Make a static method that instantiates a new itemstack
Whatever list is being accessed
com.macioszektv.brushextreme.Main.onCommand(Main.java:33)on that line, is empty, and you are trying to retrieve the first item in it. since nothing is in the list, it is an out of bounds exception: https://www.geeksforgeeks.org/understanding-array-indexoutofbounds-exception-in-java/
@worn temple Line 33 is:
Player target = Bukkit.getPlayer(args[0]);
since you don't care about state, its technically fine
@thorny isle args array is empty.
I would like when i write a command without args, it shows usage
Well, you're trying to get the player by the args, so don't do that?
If you are so new to java that you do not understand these basic concepts, I highly highly recommend you take a step back and learn, at least the basics of, java and then come back to spigot/bukkit. Here is a great resource for learning: https://www.mooc.fi/en/
@frigid ember this is the worst community to ask about static use. it's fine to do that, however id name the class something more useful than Const, but also do .clone() before adding to inventory as you dont want multiple inventories linking to the same itemstack
otherwise it runs risk of amount changing affecting everyone who has a copy
but, your not gonna get much benefit if its just a plain nether star vs new ItemStack(Material.NETHER_STAR)
Hell, my early plugins are chock full of static abuse
but if you're configuring lore and such too, then yes it's good to store templates as ready to clone items
they're probabily fine for inventories of type gui too 🤔
Does anyone know which plugin is causing me to get giant titles that say "Teleporting to <World> Players: <Players>"? I am using essentialsx, lobbyapi, multiverse (and more but I dont think they are relevant. if you want to know please ask)
I think it is LobbyApi because it doesn't happen with multiverse teleporting. Does anyone know how to disable this?
Okay
Does anyone know if there is a free cave generator plugin for uhc?
Is it possible to replace a placeholder in the lore of an item with another list? Like I want to replace {upgrades} with a list of strings.
Theoretically it should be
Got any ideas?
Could you give more context for your scenario?
how do i give plugins permissions to my friends in my hamachi server
I guess you kind of want to rearrange and manage indexes in a list
idk how permissionsex work at all
can u send me the link? for 1.15.2
I have different upgrades for my hoe plugin and I would like the upgrades and levels of those upgrades to show up in the lore. I don't want to individually add each upgrade and level in the lore so I just wanted to grab the levels through the placeholder but I would need to have multiple lines
You’d have to start with comparing the list before transforming the placeholder to after
And then take action to the changes
why didnt java not make a string a primitive datatype
because it's not primitive
Its really just an array of chars
It's almost one of those special cases because its literals make it seem kind of like a primitive
^
Only... it's not lol
Strings are just a sequence of chars and it’s immutable
Hii can someone help? Pls i recently did a Network, once i already connected all server i had a problem in My survival server because i can’t do /spawn, when i try it just appear a message “You do not have permission to execute this command” i guess is sth in the bungee config, i already set spawnpoint in survival and tried with op and without op
Do you have a permission plugin?
In Survival, yes i use GroupManager, actually, without network i mean, Survival as a single server worked perfectly, without problems but once i connected it to bungee, the trouble appeared
Is /spawn a bungee command or what?
Is a /spawn command from essentials but it seems like bungee don’t allow players to use the command
I mean in Survival, i use essentials and in this server, i can’t use it because bungee don’t allow me idk why
c# string is primitive
@subtle blade
and @naive goblet
in c# you can do
string a =“a”;
if(a == “a”) {
}```
ik
Strings are classes in C#
primitive
They too are immutable
in java works too tho
== is conparing instances
why didnt java do it

would u want it
Not really. Serves for confusion
no
instead of abandoning it and continuing windows edition they maintain and update it still in java
java is probabily what made them so popular lol
how much of minecraft did you played before using mods?
exactly
java was used before too 🤔
Skip it python ftw
They have a team at Microsoft dedicated to the Windows version
lol
Mojang will remain on Java, as they should
😛
According to stackoverflow java is 3rd most popular programming language
so?
No need to switch it out yet
im talking about whats better
c++ and python are the other 2 i guess
Better in what way?
then go use that :p
?
for game modding c# would be best
or game deving c# is better than java
use opengl and ez
if one wants to make plugins one is forced to using java, as mc server is java, mc isnt even open src, this is terrible
choco: “i dont use anything thats not open src”
alao choco: plays mc
You're not forced to use Java
Bukkit is designed to allow for plugin loading in different languages. You just have to be willing to implement it
java is best option for mc currently
Also, LWJGL is a library for Java to interact natively with OpenGL so I don't understand your concerns
A large majority of that library is native methods
It really isn't
c# inbuilt libs are better
C# has its flaws as well
name one
compared to java
its nice not having to use a method to compare strings imo xd
“a” == “a”
why have that
this is how java works deal with it
easier to seperate reference comparison to a value or content comparison. If you're going to compare languages do it in a factual way
Well I shouldn't perhaps say too much as I don't code in C# but go with what u like idc
ur factual arguments 😫
why would i
lol
or anyth
make game in C#? just use Unity 😉
one way
lmao
yea
yeah fr
sure use unity
so basically you looked on some stuff c# does and based on that you already made your opinion?
good to hear
?
@frigid ember in java .equals is a value comparison, but == is an instance (memory location) comparison. so, while == could be "faster to type" its wrong.
ChocoToday at 4:23 PM
They have a team at Microsoft dedicated to the Windows version
ChocoToday at 4:24 PM
Mojang will remain on Java, as they should
@subtle blade this is not true. Literally was just said a few days ago (in private) that the teams are united now. each dev when they add a feature, they add it to bedrock and java at same time, both platforms are unified now in development.
No, its only correct if you actually want instance comparison
Lol like that shortcut is saving ur life
Unified in development, absolutely
There are still two teams working on the two differing projects
get yo facts ryte
It's not separate teams. The same developer adds it to both bedrock and java.
straight from mojangs mouth.
i thought so

String a = new String("a");
String a1 = new String("a");
a == a1; //false
a.equals(a1); //true
choco stanky
They are doing a lot of good stuff to clean things up internally.
would that be in 1.16?
not every language must be the same
or for 1.17
Finally got automated testing setup, hiring people with dedicated roles to improving existing elements
Its the same in C#
no
you don’t kno c#
I do tho
In c# its not instance, its reference comparison, but they can be differing just like in java
i didnt say String i said string btw
@frigid ember don't rely on it. relies on jvm interning common strings
i think "a" == "a" is true in java too
i said string
Again, its value vs instance for java, and value vs reference for c#.
In both cases, while most times it may be the same, it is actually different
Retrooper I mean personally I’d probably try out C# if I were to develop a game as it’s confirmed to be better. So fair enough
🙂
I don’t have time to preach all pros im glad u realized tho
a game was an example
Idk rlly know much about C# and tbf this comparison discussion is really unnecessary
ok
@tiny dagger "a" == "a" is only true because "a" is cached in the String constant pool. If you did new String("a") == new String("a") it'd be false. This is the same for java and C#
i feel like someone is gonna get hypixel threats again 👀
Still applies
If C# has the == that replaces .equals() use it? Nothing more nothing less why even debate about it
yes, string is primitive, and String is class. its still the same thing
"a" == "a"
Sometimes true, sometimes false, depends on caching
you'll see some code kinda work using == in Java
but you absolutely shouldn't
== and .Equals are not the same. It will not always be true. 99.99999% of the time, yes, it will be, but it depends on caching
its referential
String a = "bruh"
String b = a;
assert(a == b) : "bruh ur java broken";```
this is what string == string is for
im coding c# dude
smh Microsoft Java
Its the same in C#, it's usually true, but not always
microsoft owns mc
wtf
¯_(ツ)_/¯
Where as .Equals is always true
because you are doing referential vs value comparison
You dont compare Java Strings with ==
who said java
nobody said that
I never said always false or always true. its a different type of comparison, because it relies on caching, it can be true or it can be false
I actually compare them character by character smh
man this discussion is going literally nowhere lol
^
.Equals is always always correct because it does a value comparison not instance (for java) or referential (for C#)
who said java
literally the code block a few messages above yours..
String = Java
string = C#
@subtle blade I know. People just don't understand the underlying principles of why these two options exist.
@native shore string is just the primitive in c#, but String also exists just like in java there is boolean and Boolean
does it a lot smarter than that lol
yeah I don't look smart
No, it does bit logic on it, no need to go down to chars, it compares the raw bits @sturdy oar
you saw nothing 👀
let me delete
I think Java compares hash of the strings?
well first it checks the length i guess
yea
@frigid ember I might sound dumb but does all primitives in C# have wrappers?
just open it in your IDE and look
the codes right on front of you if you have IDE open
memory length hash otherwise a for loop to check it 🤔
oh yeah it actually checks length first
ofc you need to check length first 😛
So C# has String and string and Java only has String 🤨
it does compare character by character
public boolean equals(Object anObject) {
if (this == anObject) {
return true;
}
if (anObject instanceof String) {
String anotherString = (String)anObject;
int n = value.length;
if (n == anotherString.value.length) {
char v1[] = value;
char v2[] = anotherString.value;
int i = 0;
while (n-- != 0) {
if (v1[i] != v2[i])
return false;
i++;
}
return true;
}
}
return false;
}
It makes some sense but I mean does it matter if it’s a prim or not
afterall a string is an array of chars
imo it should be prim
string will prob become a valuetype in vahalla in 40 years
¯_(ツ)_/¯
the hell is Valhalla
a new assassins creed game fendi
in java == actually compares the memory location, an instance comparison. Because of caching, that memory location can be the same for multiple strings. so "a" == "a" would be true since its cached in the constant pool and new String("a") == new String("a)" would be false. Whereas .equals will compare the actual values of the strings (or objects) so both examples would return true because the instancing doesn't matter.
C# is similar, == is a referential comparison. so whether both objects/primitives in question reference the same thing (similar to instancing, but slightly different at the low level), while .Equals does a value comparison.
why do you want primitive string?
@sturdy oar They are the same thing in basically all respects.
Created 2012/10/22 20:00
just to give you an idea on timing
@frigid ember what about javascript then 🤡
what about it
I was wrong about Java compares string hash, oof xD
Javascripts comparisons are much different because its weakly typed.
Yh
Its why == and === exist
Only 3.
=========
And its complicated to explain
if (“a” ========= “a”)
PhP has ===
always prefer === in JS, == just .toStrings() both sides
True
i predict new updates
so == can really hurt performance if toString() is heavy
Basically, in JS: https://owo.oooooooooooooo.ooo/i/gvt9.png
aikar in c#?
javascript
ok
ToString
its a pain in ass changing to c# code style
c# methods start with capitals
oof
JS in 2100 be like
if("a" ================================================================================ "a")
you forgot an =
ye
oh yea
compilation error
nub
line -111
@obtuse rose its only == and ===.
its called jokes
why doesn't Java have the same thing that ECMA Script 6 introduced?
I'm talking about string templates
skidders
i mean a lot of languages have it as well, Ruby, Kotlin, Python...
I think string templates were being added in in like j14 or something
no , you might be confusing with text blocks
i mean those are cool as well, but they should've come a lot of time before
lazy java
so use c#
how do i remove my name so the server thinks im joining for the first time?
i think it's throwing new people in the wild instead of server spawn and i need to confirm it
delete your playerdata from the main world
join
to find your uuid
then find your_uuid.dat in the world
yeah
Just the main world?
couldnt find the file
well its supposed to spawn in a different world then you warp to the main
ty
i found it
Idm the player data should still be stored in the level worl
yeah theres no playerdata saved in the multiverse worlds i guesds
here's hoping it works
then you haven't deleted it from main world
no i did
Gotta delete the player data from the playerdata folder, also have to go through any plugins (like essentials) that stores additional player data.
Also, never ever ever ever use /reload. that's for developers only and should never be used in production
would it possibly take a complete restart to change it?
Well, you need a complete restart for plugins. Full /stop and then start.
yeah but its not a plugin file
As someone who's already taken some courses in Python, would you guys recommend TheNewBoston for Java tutorials?
But again, you need to go through all your plugins and make sure if any of them store player data, to remove your data.
Reload is nice
Again, even if not a plugin, never ever ever use /reload
Its literally only meant for developers
Would be even nicer if plugins used onEnable properly
what problems can it cause?
And onDisable
memory leaks, bad shutdown of plugins, mishandling of so many things.
@naive goblet Its not plugins not using it correctly, its the fact that it fucks with the classloader.
Doesn't matter if you use onenable/disable correctly, it still breaks a ton of shit
Oh nvm I was thinking of plug man
because classloaders
and fuck plugman, even if you want to mess with classloaders, don't use plugmans, at least use BileTools as it gives plugins a chance to attempt to shutdown correctly, verses plugman which just completely wipes the classloader
why did spigot change inventory gui system
Did they?
yea
TheNewBoston? Recommended?
unloas, load, restart
plugins
all there
and open src
But plugman and bile are and other plugins similar to them should only ever be used by developers. They are not meant for production servers or server owners that don't develop plugins.
That’s true
beuh
Still useful
It does some seriously fucked up things with the classloader and can break so damn many things.
Weird it didn’t do it for me
ok nvm ig lol
I'm not hating, its a solution to a problem that doesn't exist.
then u fix it
Just stop the server and restart it.
fork it
Plugman works fine with anything except for the plugins that doesn’t have a proper onDisable
not all big servers can do restarts
@frigid ember Yes, let me just rewrite all of java's classloading system. That's what the issue is, its java's classloading combined with how bukkit loads plugins. Its not something to jut "rewrite"
its server owners being too lazy to stop their server properly because of a lack of understanding of the JVM.
i told u
ugh there's so many plugins that could be holding uuids. im suprised it didn't treat me like a new player in any way by just deleting the playerdata file
Well yeah, @frigid ember because plugins need to hold their own data and can't read and write to the player data files like that lol
But that's why, while the server itself will think you have joined for the first time, whatever plugin is handling teleporting new players isn't because it relies on its own data
I swear ur laughing out loud rn
nah, actually little aggravated because I can't figure out a networking issue.
Ok gl ig
¯_(ツ)_/¯
new idea
Think its actually on discord's end.
anyone want to do me a favor and pop on my server for 2 seconds?
see where it spawns you?
i changed a suspect plugin
but its only been reported once
Can’t rn
Well I’m going to use plugman even more now
Yep
Never got any memory leaks or some stuff being messed up
yup
can anyone pop on for just a sec. 2min thing
i mean the value i changed was TeleportNewbies: true to false
thats probably it
Why not use EssentialsSpawn?
Doesnt that teleport u into a specific world regarding other stuff
i am using Wild
Wth is that
and i think either multiverse or essentials was set up to start you off at spawn
i mean it worked before
but wild i've installed awhile after
its /wild
so i think it was throwing newbies at random places
Config wild then
Would a TreeMap descendingMap sort the map on keys, highest to lowest?
Pretty sure a tree map goes lowest to highest. I'd recommend testing incase I'm wrong and if it does, you can reverse it using Collections.reverseOrder().
No..
Nope it wouldn't
Like, Maps.newTreeMap(Collections.reverseOrder())
Different people have different ways, some prefer using new TreeMap styling, so you could do that instead, but that's the gist.
@wanton magnet I'd suggest just thinking of something basic you'd want to do, changing some mechanics or making your own and then exploring what you need, what you can do with it. Pick something where you'd need some events and then maybe to mess with some items. I always find experimentation can be the fastest way to learn.
Anyone know where I can find out how to apply ItemMeta to an item? I'm just doing a simple sort of thing like giving a stick to someone though I want it to have specific properties.
Can't personally say I've watched any, but apparently The Source Code's are good.
ItemStack#setItemMeta()
Thanks 😛
I'm confused on Collections.reverseOrder() - the demonstrations I found online all use ArrayLists etc.
I'm getting sooo confused with my own code here.
I don't get how this is even working.
Ok, I'd recommend waiting for someone else that might have used TreeMaps a bit more.
I just need the values to be descending.
TreeMap<K, V>#descendingMap() ?
My question was just if descendingMap sorts on Values
descendingMap()
Returns a reverse order view of the mappings contained in this map.
java.lang.IllegalArgumentException: Meta of class tanku.dev.commands.customitems.WhackerStick$1 not created by org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemFactory
Sadly I do get this error when applying the ItemMeta. I've tried several ways to apply it but it may just be an error in my Java knowledge, not sure. I know that it says it isn't created by CraftBukkit, but then how else would I get custom properties 🤔
When I try to initialize the players HashMap with descendingMap, it makes me change the map to a NavigableMap .
@tiny pebble are you making your own ItemMeta lol
At first I was trying to yes, as I thought that was the way to fill out what properties I want haha
ItemStack whacker = new ItemStack(Material.STICK);
whacker.setItemMeta(new ItemMeta() {//all the itemmeta methods});
I'm sure it has to do with the fact that I did new ItemMeta(), though I tried doing it in a separate class as well. Guess I just don't understand ItemMeta
ItemMeta is an interface
oh god, don't do new ItemMeta().
you use ItemStack#getItemMeta
^
its not so much not understanding ItemMeta. Its understanding what an interface is. And in this case, how to obtain an itemmeta object
Ahha alright, so it was indeed my Java knowledge
Yeah, I have a lack of understanding on what an interface is sadly, though I've read up and am learning 😐
https://www.mooc.fi/en/ < great resource for learning java. I believe the first lesson has a whole section about interfaces and inheritance. (I mean, I know it covers it, just dunno how far in it is)
Ah neat. I've had some good resources about learning Java though none ever told me the difference between an interface and a class, kinda lame
is using ternary operator to avoid if condition fine?
like i gotta increase this counter value by 1 if a condition is true
so i do something like counter += (condition) ? 1 : 0
ternary operator is just a shorter way of writing out a conditional that can affect a variable. so its fine.
Fendi, that's fine, as long as you know what you're writing.
i guess I know 😅
So do people here use MCDev? I'm trying to use a Redirect in a Mixin, and though the plugin used to verify the target field, I can't get it to do it anymore. Does anyone know how to make it validate that field?
MCDev? you mean the IntelliJ Plugin?
Yep
yeah I do use it indeed
not really super needed if you don't mind setting up the boilerplate
i have no time to write pom.xml tbh
Fendi, can you get it to validate the "target" field in a redirect statement?
sorry can't help you
I just copy it from other projects of mine
i don't know what you mean lol
I just basically use that plugin to generate listeners and configs
You can just make your own template project with IJ now
you mean a maven archetype?
Like this: @Redirect(method="spawnEntities", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/mob/MobEntity;initialize()V"))
No, like a legit full on project template.
I have no idea what you are doing tbh.
Haven't used it since it was pretty early and was just reducing manual work on boilerplate
I'm trying to write a Mixin.
annotations are pure java, I just have no idea what the point of this is
I mean there's a lot of libraries that try to simplify code by using Annotations
Hi. I run a Minecraft server with Multicraft Spigot and it takes more than 7 seconds for Joining World and to be able to join the server, what affects the span of login. It should only be 1 second at most
SpingBoot. Its annoying when you start, but once you understand spring well, its amazing
Wasn't Spring for web development
I'm writing a Fabric mod, but since Spigot uses Mixins, I thought you guys might know something about this.
or I remember something else
Yeah, it is, I use spring for web dev. Just showing an example of something that uses annotations heavily.
The Android API also uses it a lot
Aikar's ACF uses lot of annotations
@raven robin Honestly, you're way better off going to the fabric help server. Not sure why you started here tbh.
@neat orbit So so many things can effect login time: mods, resource packs, auth, connection speed, location, etc etc.
So, no, it shouldn't be "only 1 second at most" Its completely dependent on so many different working parts.
Its kinda like how a spigot server with no plugins can boot really fast, but a spigot server with many plugins will take longer to boot. Its just the nature of interconnected dynamic systems.
Nova, I did start there; I just didn't get a response. I went here because I thought you'd be familiar with Mixins and/or the plugin.
Its been so long since I've used that IJ plugin, it only reduced boilerplate at the time. ¯_(ツ)_/¯
I mean the thing that I was trying to say , is that like ""default"" java looks better usually to me
or maybe it's just me not being able to use stuff properly , idk.
like I prefer the right way here for example
I mean, depends heavily on what you define as "default" java. Like this reactive code: https://owo.oooooooooooooo.ooo/i/nmik.png
so... is it right to have all of my properties filled out in a separate Java class that implements ItemMeta? and if so, how would I thus apply those properties to my itemstack?
I mean I got ItemStack.setItemMeta(), and I know getItemMeta just returns the current ItemMeta of the item...
ahha, sorry about these questions. i know i'm a bit new but this is how i'm going to learn (meaning i'm going to learn through plugins etc), so if you don't want to answer you don't have to 😛
Don't make your own class that implements ItemMeta.
You aren't understanding how inheritance and interfaces work.
Just retrieve the ItemMeta with ItemStack#getItemMeta()
my main misunderstanding there is what would go in the ()? i'm just confused how i would state the properties i want basically
Methods do not always need parameters
then i guess re-wording my question, how would i state the properties just in general using ItemStack#getItemMeta()?
i bought a plugin 3 days ago and i never received it
Contact the developer
i looking for a plugin that allows you to sell inventory items for money
ShopGUI+? BossShopPro?
I think essentials even has a /sellhand command or something
Finally did it :P
Thanks for dealing with me 😂
I don’t rely on public plugins, just code what’s needed from scratch but better. Maybe working with vault for eco systems about it
is using ternary operator to avoid if condition fine?
like i gotta increase this counter value by 1 if a condition is true
I honestly just think it looks better to if (value) { increase++; }
Oh man let me revert my commit
I fixed anyway by using a super intelligent method concatenation
So I don't need to do it anymore
https://paste.gg/p/anonymous/75e5ef5aa194499fbde61733b3d313f4
Thank you chocolate
@raven robin Spigot does not use Mixins at all. That system was created for Sponge. You may have some luck asking Sponge too if Fabric is inactive atm.
Is it possible to edit the size of every mob via Spigot? Either by editing hitbox/model or the genuine size (other than slime/magma), even if severely difficult?
😛
@tiny pebble all that does is adjust their collision boxes, the size internal that is
theyll appear same on client
so i could change their collision boxes server side, and then use a resource pack to change the model?
it won't change the interaction of the player with the mob
good luck, not sure if thats possible client side
Aikar is there a packet to make the client force crouching
or basically as I call it 'land swimming'
I've seen Entity packet has a 'swimming' field from wiki.vg
When you deposit money into the faction bank, it shows a message that you have donated x amount but when you check the balance of the faction bank, it is 0. How do you fix this? Please and thank you.
Could be a problem with two different plugins colliding, I’d say look it up, if you can’t find the answer on a forum of some sort contact the author
ok
Or take a look at the documentation to see if the factions plugin only works with a specific economy plugin. If so then make sure you got that one ¯_(ツ)_/¯
mkay
LuckPerms is very confusing to me i just installed it today and barely know enough, i'm used to use groupmanager so i dont know how to use it
how does it on bungeecord and spigot
any advice?
I still use bPerms loool
There's a site for helping generate the permissions files and everything.
Check out the luckperms wiki/docs. There's a ton of information there because its way too complex to help with here.
ok i will, thanks for help@worn temple 👍
Not processing the color code it would seem
If a player has a itemstack in their hotbar, what event fires if they right click that?
How would I fix it?
ChatColor.translateAlternateColorCodes('&', "&7◈ &bRegion");
Yeah that's what I'm doing
@fathom shard right click it in the hotbar (as in their inventory is open), or right clicking with the item in hand?
item in hand
Possible that diamond character is messing it up then
@fathom shard PlayerInteractEvent
Get the item in hand, check what item it is
@worn temple
Player target = Bukkit.getPlayer(args[0]);
...
if I do this and check for null, but if the player is offline and I do
target.getDisplayName()
will this cause errors?
It will only error if the args array is empty OR if you attempt to get the display name if it is null (IndexOutOfBoundsException and NullPointerException respectively)
When can the display name be null?
Its marked @NotNull so it can never be null
is it possible to just have a list of keys in YAML? yaml groups: stone: diamond: like this?
or do they need to be matched
is there an easy way to get the default attributes from an item?
What do you mean default attributes?
Hey guys, can free resources depend on premium ones?
Yeah, but it will generally turn people off of them unless they already have the premium resource (ex: extensions for mcMMO)
@frigid ember
How can I send a fake block change?
Player#sendBlockChange requires an instance of BlockData
Packets
material.createBlockData()
Hey guys, how do I fix this
Row region = scoreboard.addRow(ChatColor.GRAY + " ⟐ " + ChatColor.BLUE + "Region");
For some reason the chat color puts a 4 and a 9, I'm using UTF-8 encoding in eclipse
It should look like this
How'd you fix it for the other one?
You got it working for the island display did you not?
No, that's from the server I'm trying to copy
And I can't find this character anywhere
You probably just need to escape it as a code rather than include the actual symbol.
That symbol could be the benzene ring \\U23E3
The symbol you're currently using I assume is \\U25C8
Just include it in your string like: https://owo.oooooooooooooo.ooo/i/tjsa.png
I'm gonna keep looking for the symbol you're trying to find tho
that's one hell of a tld
The TLD is just ooo
just the power domain https://en.wikipedia.org/wiki/.OOO
that's some power
@frigid ember yeah, can't seem to find the symbol, but this one will probably look better anyway: https://www.compart.com/en/unicode/U+29F0
Include it in your string like so: \\U29F0
Don't remove the double slashes
How can I detect when chunks are sent and unloaded for players?
How do i make a compass track someone?
Asking about your attempted solution rather than your actual problem
@EventHandler
fun onClick(event: PlayerInteractEvent) {
player.sendMessage(EventHandler(item, player))
string EventHandler(Item item, Player player)
{
val player = event.player
event.isCancelled = true
if (event.item.type != Material.STONE) {
event.isCancelled = false
return null
}
if (!player.hasPermission("Thing")) {
return "You don't have permission to start this job"
}
val job = getJob(player)
if (player.isSleeping) {
return "You can't sleep on the job"
}
job.start(player)
}
}```
Or
```Kotlin
@EventHandler
fun onClick(event: PlayerInteractEvent) {
val player = event.player
if (event.item.type != Material.STONE) {
return
}
// We don't want people to place stone
event.isCancelled = true
if (!player.hasPermission("job.start")) {
return player.sendMessage("You don't have permission to start this job")
}
val job = getJob(player)
if (job == null) {
return player.sendMessage("You don't have any jobs atm")
}
if (player.isSleeping) {
return player.sendMessage("You can't sleep on the job")
}
job.start(player)
}```
Which is more readable?
the second one
also banning stone on the server is a bit extreme
Lmao, it's just an example
Also seriously don't advise the first one because of the forcing of cancellation
We were comparing it to if around if around if
You force it to true, then force it to false
If another listener cancels it at a lower priority, you're going to break compat
More often than not you don't want to setCancelled(false)
True! 👍
On another note - returning void 🤢
Oh you don't like returning void?
return player.sendMessage() is strange
damn kotlin
I think it's a clean way to end early compared to adding another line
Whenever I see Kotlin, it just furthers my belief that it's a wanna-be Python for the JVM
lol
Hmm, idk I'm not a big fan of Python personally
thx fam
What’s wrong with python :o
It's hard to follow
its whitespaced
And yeah... That lmao
Fair
@worn temple when I do that this happens
scoreboard.addRow(ChatColor.GRAY + " \\U29F0" + " " + ChatColor.BLUE + "Region");
scoreboard.addRow(ChatColor.GRAY + "\\U29F0" + ChatColor.BLUE + "Region");
May need to remove one of the backslashes....
When I remove a backslash I get this
That's what I figured would happen, not really sure why its not processing that. Unless Mc doesn't support unicode?
@worn temple it works with the non-diamond utf-8 characters
scoreboard.addRow(ChatColor.GRAY + "□" + ChatColor.BLUE + "Region");
Ah, probably too new of a character
Do you know the one I pointed out earlier?
Couldn't find it
it is a box
oh the diamond is the issue
yee
@frigid ember shouldnt it be lowercase u
scoreboard.addRow(ChatColor.GRAY + "\u29F0" + ChatColor.BLUE + "Region");
dunno if it matters
It does afaik
and definitely single slash
Actually, that may be it. because it should support those characters
yeah. lowercase single slash should work. I was just copying from the site which was using uppercase, that's on me
what is Material.POTATOES supposed to be for? Material.POTATO is a potato
potatoes = crop, potato = item
ok
ok thanks
does the essentialsX motd show up on join in 1.15?
playerjoinevent, then just get the player object send them a message when they join
just configure EssX to show it or not
how do i configure it? (is it a command or do i need to go into the configs). also is it on by default?
Go into the config. I don't know either way, and I don't think it matters what the default is. If you're asking those kinds of questions, you haven't even bothered to try it yourself. May as well attempt to do something before asking for help.
Is there a way to make an entity use it's walking animation? I'm fine with using NMS but would like to avoid packets.
Packets.
bruh moment
@frigid ember sorry mis-read your question, in the config there is an option to enable the motd
I'm trying to cancel the task inside itself, but getting this issue. Any idea what to do about it?
https://gyazo.com/84eb944bd55e07e34494cb71d147a9ca
Check out bukkit's self cancelling task.
Do you know what it's called?
?jd
Read the docs
How comes that the processId isn't initialized though? Am I not definig it on the first line?
Will do, thanks!
um wasnt that an improvement in java 8, are you compiling at less than 8 maybe
I am compiling in 1.8, that's strange
Solved it this way instead 😛 https://gyazo.com/268ba8d7d834b44de4dac75fae88035d
I've developed a plugin that allows players to ride and control Ravagers. When riding, the player that is mounted to the Ravager cannot see the Ravager match the rotation of the player - it resets to a neutral position (possibly yaw and pitch 0,0.) However, when another player watches the player riding a Ravager, they can see the Ravager rotating just fine. I presume this is a packets issue but I have yet to figure out why this is happening. If you have any insight, I would greatly appreciate it. Thanks!
So Bukkit stops players from moving into solid blocks
How can I disable that for certain blocks?
@woeful mural suggest use BukkitRunnable instead
PlayerMoveEvent seems to not let me allow it
then can just call cancel() or whatever
Ah will look into, thanks!
@pastel fox that’s client side
@nimble stump nono, I send a fake block change to change the blocks to air- and then the server does noclip checks and still blocks players from going in
Ah
There's definitely some way of NMSing the function
That’s gonna be deep in the server logic
You’re gonna have to do some bytecode manipulation or actually mod the spigot
There’s not gonna be an event for that
Yeah, I mean not bytecode I don't think?
I've hacked the permissions before to add wildcard support in my perm plugin
I just made a custom permissionsbase that extends the API one and injected it into the player
But there isn’t going to be an API injection you can do there
It’s gonna be hard coded in a method somewhere
Ah heck okay ty
In that case, annoying but I'll just set the actual blocks to air and send fake block changes to the players who can't pass through
I was hoping for an easy way to avoid that because I'll have to store and keep updating the original block data
Hi, i added some potion effects on creepers on spawn, but when they blowup they also leave a cloud of this effect on the floor and players can get them
@barren abyss tried listening on entity death event and removing the potion effects?
manager.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Server.MAP_CHUNK) {
@Override
public void onPacketReceiving(PacketEvent e) {
Player p = e.getPlayer();
Anyone know how to get the chunk coordinates?
It used to be e.read(0) and e.read(1) but that's not a thing anymore
what is the point of removing potioneffects from a dead entity xd
How can I set weather to thunderstorm in spigot?
from World
setThundering or something like that
Well imma go back to my Bible plugin' development ✝️
for my Minecraft Christian Server
praise be to jeebus
you're becoming real christian don't you
