#help-development
1 messages · Page 1819 of 1
3+ years in and still cant write a mavenfile from scratch
same
maybe
welp im that type of people who need a template to work on
but this shit on the top
even with a single line i still need a template bro
i hate to write all of the template for me to make changes later
wait htf do you set a background image?
mwahaha
so apparantly thats a thing now lol
how did you put a background image
???
i wonder if i port everything from spigot to mojang mappings, how long would it take?
4 hours
Is there any way to convert v3 uuid to v4 in PHP?
on a i7
? what do you mean?
like port every methods + fields, etc, from spigot mappings to mojang mappings then make spigot there
😬
prolly would take like 10-20 mins ide imagine if your pcs fast
or it could take 4 hours, never know
Nothing on google?
wait how to port it then?
I'd need 4 hours
nope
tks
No, 3 and 4 are based upon different things
Are you 100% that UUID you have doesnt need to be used through LiteBans API...
i seriously have a feeling LiteBans has an API your able to look at and see how they use that UUID to a Player object
Can't i just make litebans work with nicknames?
i dont think so
it completely has no api
wym it does
Official LiteBans API repo, wiki and issue tracker. https://ruany.gitlab.io/LiteBansAPI/
Oh yes, executing commands and doing fucking raw sql queries api
I didn't find anything about uuids there
does ItemStack's equals test if PDCs are equal?
yeah
modules
what's the chance that two random uuids is equal?
Minor
is it safe if i use random uuid's to identify buttons for event handlers?
almost zero, but its possible
hmm how to fix decompile issue, for example this?
private static final Comparator<Entry<String, FilledProfileResults.CounterCollector>> COUNTER_ENTRY_COMPARATOR = Entry.comparingByValue(Comparator.comparingLong((debug0) -> debug0.totalValue)).reversed();
10 633 823 966 279 326 983 230 456 482 242 756 608 different uuids can exist
the (debug0) in intellij marked it as an object
so it's safe if i use uuids to check whether clicked item is correct button?
so how to fix debug0 then
Define safe
Yeah absolutely
using random really depends on what will happen in your code if a collision does occur
I'd recommend creating a factory and store any generated UUIDs in a List as a WeakReference<UUID>
when you ask for a UUID, you generate one, see if its in your list, if not add it and return it
Thats, like, pointless
Thing is, WeakReference is like coupled to the instance you pass
Don't ignore a possible game breaking action because its unlikely
Is there a way to force items to smelt in a furnace (those are sticks)
Theres actually multiple occurances of this been seen all around mc
In console especially there bug where people get switched with other mods due to clashing UUIDs
A WeakReference will allow the UUID to GC'd when there are no other hard references
Yes but how does that help his case?
as I said, you create a factory you request UUIDs from
any uuid factory method has no guarantee of generating the same uuid instance, it’s basically a value based class
https://www.reddit.com/r/Minecraft/comments/r8zacp/the_game_tried_to_spawn_me_in_as_a_skeleton/
This is actually something recent thats been shown for older legacy versions on ps4
That factory generates a UUID, checks its not being used, then adds/returns it
Hey, my server works on Linux in the background, as a deamon service,
my question is what signal I should send to the spigot server to have the same behavior as executing the stop command on the console?
Yeah, although when Minecraft loads in necessary items, it may end up using a different uuid instance with the same content
he's applying these UUIDs to buttons, so it would not be affected by MC in anyway
He's asking if hsi buttons could end up with collisions in their UUIDs
I'd guess adding to the PDC
Yuh, it’s still a really vague implementation imho, seeing it as there might be a recreation of a uuid at any given implementation of the api, thus breaking the factory’s cache
Thats impossible.
The factory is generating, checking and regenerating upon a collision
Its similar to how Mojang would be generating their account UUIDS
Yes but it’d lose the uuid instance if all hard references are lost making it enqueueable for gc as you said yourself.
Yes, thats the point. When the UUID is no longer in use its GC'd and freed up to be used again
Yes, but as he said, he’s using pdc
Stop being paranoic, the factory is just overenginnering. How WeakRefference would help? Since he uses pdc, he probably wouldnt use the same uuid reference all the time,but convert it to the byte array and store/retrieve from container
On a button, probably in a GUI
How high is the chance that a player has an already in use UUID?
no i mean if i use UUID as identificators for somethign lets say for some HashMap
zero collisions
Pdc requires a type aware token to store and load entries of given types. The implementation does not guarantee the stored instance to be the same when querying, which makes this implementation vague. Not saying it necessarily breaks directly but its definitely not reliable.
cracked server sad noise
I did say if online
oh that
Thats true
I'd not thought about the transitive nature of PDC
Yuh, tho from what I’ve heard it’s basically a glorified LinkedHashMap or smtng
So should probably be fine 
should
wait how quickly do PDC decay? I'm using them for data storage
depends on what, and decay?
like if i go from 1.17 to 1.18 do they still contain their data?
yes
Yeah
thats fine
k
i do that a lot actually
especially for certain item flags you want to deny/allow
oh lol
if anyone ever looks into player data generated by my plubin they'll want to gourge their eyes out
because i store oveer 700 variables like that
fair enough i guess
Does anyone know how to achieve this?
cant you set custom recepies somehow?
apparantly you can
its a one liner
getServer().addRecipe(new FurnaceRecipe(ItemStack, Material);
public static Map<UUID, UUID> member_sprawdzany = new HashMap<UUID, UUID>();```` How to get the first UUID using second UUID ??
grab 2nd uuid then iterate over the map
Value by key?
once its equal print out
You could use a BiMap
lemme look into that ty
BuildTools still fails... https://paste.md-5.net/jukolasofu.cs
?
BiMap<UUID,UUID> map = HashBiMap.create();
map.inverse().get(…);
oh thats interesting
RecipeChoice choice = new RecipeChoice.ExactChoice(this.defaultYamlConfig.getUncookedWoodItem().getItem());
Bukkit.addRecipe(new FurnaceRecipe(new NamespacedKey(this, "charcoal_recipe"), this.defaultYamlConfig.getCharcoalItem().getItem(), choice, 0, 0));
LIAR!!!!! its 2 lines!!
LIED TO!!!
jk xD
ew that formatting
nice works ty
Has anyone seen this before? reference to method is ambiguous
Are you editing a List or Map of some sorts?
System.out.println(reflectedObject.<Class<?>, Integer, Object[]>invokeMethod(String.class, 0, "aTest3"));
invokeMethod(Class<?> returnType, int index, Object... parameters)
invokeMethod(String name, Object... parameters)
These are the methods
probably. It's just a guess
I would assume its because you have Integer as an argument
Your cant use a java keyword as a argument without a value iirc unless your comparing types
System.out.println(reflectedObject.invokeMethod(String.class, 0, new Object[] {"aTest3"})); This works
But without the new Object[] {} doesn't
And the other 2 variations still work
Object… vararg is shitty sometimes
Like since its an array interpretation the argument Object[] could be an array or just an element of the array
If I change it to Object[] parameter it works fine instead of Object...
Thus the ambiguity
Ohh
can i send an error log in here?
yes
just make sure you send code too
The player your getting is null
how
show the code ill tell you how
@EventHandler
public void onMobKill(EntityDeathEvent event) {
if(event.getEntity() instanceof Monster) {
Player plr = event.getEntity().getKiller();
}
}
error + code pls
isnt that correct?
hmm thats not the code thats erroring
oh true
ye wait
public void awardOrbs(Player p, Integer amount) {
int currentamount = PlayerConfig.get().getInt("data."+p.getUniqueId().toString());
PlayerConfig.get().set("data." + p.getUniqueId().toString(), currentamount + amount);
PlayerConfig.save();
int newamount = PlayerConfig.get().getInt("data."+p.getUniqueId().toString());
for(String msg : getConfig().getStringList("messages.orb-receive")) {
msg = msg.replaceAll("%prefix%", getConfig().getString("messages.prefix"));
msg = msg.replaceAll("%amount%", amount.toString());
msg = msg.replaceAll("%balance%", Integer.toString(newamount));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
}
}
Size for custom inventory must be a multiple of 9 between 9 and 54 slots (got 26)
27 not 26
the sized for inventories start at 1
not 0
unless your getting an item from that ivnentory, then it starts at 0
Where is this getting used at
the method is fine
its the p thats null
so where its getting used your passing a null player
yeah, its in SpookyOrbs
its getting used in the entity death
i just forgot to add the whole c ode
wait a sec
kk
@EventHandler
public void onMobKill(EntityDeathEvent event) {
if(event.getEntity() instanceof Monster) {
Player plr = event.getEntity().getKiller();
Random rand = new Random();
double chance = rand.nextDouble();
if(chance <= SpookyOrbs.spooky.getConfig().getDouble("drops.mobs.mob-percent")) {
int base = SpookyOrbs.spooky.getConfig().getInt("drops.mobs.mob-amount");
double newval = base * SpookyOrbs.spooky.getConfig().getDouble("extra.multiplier");
int win = (int) Math.round(newval);
SpookyOrbs.spooky.awardOrbs(plr, win);
}
}
}
do i have to cast player or smth
You need to null check killer because not all the time the entity gets killed by a player
If they die to sunlight etc
OOOOH
Killer will be null
so then
idk why it took my till now to realize that xD
Yes I agree
no just null check plr
if plr null return
did you not read my message
my bad
i didnt reply to you
thats my fault
3 * 9 is 27
3 rows of 9 item slots
its 26 if your accessing it from an array yes
But the actual size starts at one
eg inv.getItem(27) will get IndexOutOfBoundException
but inv.getItem(26) is fine
inv.getItem(inv.getSize() - 1) returns same as the 26
sec
MoneyHash.java:178
show me that method thats near that line/class
The args your passing is empty
How are you sending your command in game?
and is args just from the onCommand method?
if args.length == 0
just remember its same thing as the inventory
if length is one, access it at 0
Should be fairly simple if your using flat file make a file for each players data
it shwos me error
If you do Yaml
what error?
if(member_sprawdzany.inverse().get(member.getUniqueId()))``` code
make sworking with yaml a little easier if you dont like referanceing the YamlObject
well send more code than that
pretty sure that maps empty
public static Map<UUID, Boolean> lista = new HashMap<UUID, Boolean>();
public static BiMap<UUID,UUID> member_sprawdzany = HashBiMap.create();
public static Player member;
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player p = (Player) sender;
member = Bukkit.getPlayer(args[0]);
if(member != null){
if(lista.get(member.getUniqueId())) {
if(member_sprawdzany.inverse().get(member.getUniqueId())) {
}
}```
Why a HashMap of UUID, UUID tho?
you need more??
and what does the error say livelove?
was asking livelore :p
Never seen someone do a HashMap of the 2 same objects before
adadjava: incompatible types: java.util.UUID cannot be converted to boolean
oh right
thx for help
oh shoot i forgot HumanEntity has getName on it
ty!
ngl didnt know you can comment on code like that
(Pls dont look through the rest, i have a big refactoring day tmrw LMAO theres alot of rather questionable things once you get to the crafting section)
yuh
ConfigurationSection::getKeys yields a Set<String> and invoking Set::forEach on it takes a Consumer<? super String> (not UUID) so you'd have to parse the string and convert it to a UUID
probably an obsolete tutorial
ConfigurationSection section = ...;
section.getKeys(false).forEach(key -> {
UUID uuid;
try {
uuid = UUID.fromString(key);
} catch (IllegalArgumentException e) {
//handle if key is not a valid uuid
}
//TODO
});
well you cant just copy paste
does hasKey in 1.18 nms not work anymore?
What can i do
tag.getCompound("FireworksItem").hasKey("tag"), the hasKey does not work
how to spawn a snowman without a pumpkin?
meh ill use protocollib
me?
Snowman.setDerp(true);
Which version is this for? I don't have that (
1.18
What version are you using?
i'm use 1.16.5
So you copied it without understanding
Also key is a string, not a uuid
You already have a uuid
Yeah Snowman.setDerp is in 1.16.5 too.
thanks, I'll try
example, please
Snowman snowman = World.spawnEntity(Location, EntityType.Snowman);
snowman.setDerp(true);
entity = p.getWorld().spawnEntity(p.getLocation(), EntityType.SNOWMAN);
entity.setInvulnerable(true);
I don't have setDerp on spigot 1.16.5
oh
sorry
Silly goose
anyone know any efficient ways to check if a Location is inside an entity's hitbox?
Javadoc says its there... Are you sure you're using 1.16.5?
what?
what do you need help with
what do you mean
at runtime or is it giving you a compiler error?
you mean a ClassCastException?
im askign him
to see what error its giving
how did you even think of writing that
^ this code
oh
i recommend making a helper method
if you are planning to add more
Its not possible
Nope
i have hasmap where itemstack is keys
You could use guava’s multimap
Stores a collection for each key
?paste show me
it's like 600 lines
you sure?
the "handlers" hashmap somehow stores multiple EQUAl itemstacks
as keys
- If i create two identical DeltaStack instances with identical handlers in join event listener, every time i rejoin, the hashmap hold duplicate
- Here the output of "handlers.keySet().toString()" yields two identical itemstacks
Im not going to explain it to you
im making a spigot plugin in kotlin
when i run my dev server, it does not load the plugin
not sure if this is causing the issue but does my pom.xml look correct?
pom: https://pastebin.com/3VmSvzqu
any startup errors
kotlin and maven :I
help
Look over your code closer
[ItemStack{DIAMOND_SWORD x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name=Ruby %REDA%, lore=[Hello, World], enchants={DURABILITY=1}, ItemFlags=[HIDE_ENCHANTS], PublicBukkitValues={customstevechaos:item_id=ITEM_ID}}}, ItemStack{DIAMOND_SWORD x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name=Ruby %REDA%, lore=[Hello, World], enchants={DURABILITY=1}, ItemFlags=[HIDE_ENCHANTS], PublicBukkitValues={customstevechaos:item_id=ITEM_ID}}}]
There’s absolutely no way a hashmap stores two identical stacks
Hashmap checks for that based on its hash
they're identical
Have you compared their hash values?
but STILL they store
values can be anything, key is ALWAYS unique
i believe hashCode is broken on itemstacks
compare their hashes
girl it literally tells you
then how i store them
you don't
learn how to read exception messages
i need to use itemstacks as keys
better store some key in item's pdc and use it in map
try printing their hashes
just do a foreach and do
System.out.println(key.hashCode());
it might be some hash value
1 second
Should be different hashcodes
why do you need item stacks as keys
The error says its null
there might be some things that it doesnt take into account
Hashmap only compares hashcodes
yeah i know
Thats how it works
so they NEED to have different hash codes
I have a bit of an issue. 2 different plugins are trying to set resource packs for the player. One overriding the other. Am trying modify their source code but i cant find a potential solution to it
it says that if they are not equal and do have the same hashcode 2 of them get stored
and equals(...) returns true?
YES
what
You still havent shown us how youre checking this
Bukkit.getConsoleSender().sendMessage(DeltaStack.handlers.keySet().stream().map(Object::hashCode).collect(Collectors.toList()).toString());
isn't it rigjt?
u mean hashmap.toString()?
yea sure
{ItemStack{DIAMOND_SWORD x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name=Ruby %REDA%, lore=[Hello, World], enchants={DURABILITY=1}, ItemFlags=[HIDE_ENCHANTS], PublicBukkitValues={customstevechaos:item_id=ITEM_ID}}}=com.aregcraft.customstevechaos.util.DeltaStack$InteractionHandler@166aafa6, ItemStack{DIAMOND_SWORD x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name=Ruby %REDA%, lore=[Hello, World], enchants={DURABILITY=1}, ItemFlags=[HIDE_ENCHANTS], PublicBukkitValues={customstevechaos:item_id=ITEM_ID}}}=com.aregcraft.customstevechaos.util.DeltaStack$InteractionHandler@3a60360d}
please highlight the identical ones
My bad
interaction handler is custom class
bro! just use pdc
the first one doesnt have lore
it have
Hashmap uses .equals right
Are they .equals
Thats impossible. if hash and equals are the same
Idk something has to be different
{
ItemStack{DIAMOND_SWORD x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name=Ruby %REDA%, lore=[Hello, World], enchants={DURABILITY=1}, ItemFlags=[HIDE_ENCHANTS], PublicBukkitValues={customstevechaos:item_id=ITEM_ID}}}=com.aregcraft.customstevechaos.util.DeltaStack$InteractionHandler@166aafa6,
ItemStack{DIAMOND_SWORD x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name=Ruby %REDA%, lore=[Hello, World], enchants={DURABILITY=1}, ItemFlags=[HIDE_ENCHANTS], PublicBukkitValues={customstevechaos:item_id=ITEM_ID}}}=com.aregcraft.customstevechaos.util.DeltaStack$InteractionHandler@3a60360d
}
Your testing is flawed if your results say you have identical keys
maybe some custom class
Yea this is what i keep sayin lol
i mean i just posted how i checked it
what's wrong with it
Bukkit.getConsoleSender().sendMessage(DeltaStack.handlers.keySet().stream().map(Object::hashCode).collect(Collectors.toList()).toString());
I'm not in teh mood or inclined to go over it. I'm just telling you its physically impossible to happen as you are claiming
THEN HOW IT IS HAPPENING?
how can i check if variable "test" if it gets divided by 5 it's divisible i'm making a killstreak broadcast so if it's the killstreak is an interval of 5 it gets broadcasted, like 5 / 5 outputs a whole number, but 5/6 doesn't
test more
Its not, thats the whole point
How can i power a non redstone block like dirt AnaloguePowerable seems to work only for redstone type blocks
weird hashmap
hi.
i have to call PlayerItemHeldEvent by force, but following code didn't work,
Player p = (Player) sdr;
PlayerItemHeldEvent e = new PlayerItemHeldEvent(p, 1, 5);
Bukkit.getPluginManager().callEvent(e);
can i fix this code work?
?xy
Asking about your attempted solution rather than your actual problem
WAIT
?
How are you TESTING when its called
if i remove PDC from items it works well
WTF IS WRONG WITH PDC?
two identical items with identical pdc are not identical?
@peak granite modulo
what?
they are for me
3
@peak granite I completely messed up haha
ty
forgot about modular division lol
barely use it
use 5 %
XD
Because your pdcs were not equal
Caused multiple items jn the hashmap
they are
Asking about your attempted solution rather than your actual problem
they are created with same method
new ClassA() ≠ new ClassA()
but new ClassA().equals(new ClassA())
You cant just create a variable and expect it to be the same based on its contents
Not necessarily
If PDC didn’t specify a .equals
Then it would be false
if the implementors don't fucked up
Right so does that tell you?
couldnt you just check if the PDCs are the same?
Yea thats also true
?paste
that makes sense as a hashmap stores multiple values for a given hash code if a.equals(b) returns false
It’s impossible for hashmaps to store equal objects with equal hashcodes
And for some reason this person beleieves otherwise
this sql command works fine in sqlite but dont work in mysql
CREATE TABLE IF NOT EXISTS statistic (
id CHAR(36) PRIMARY KEY NOT NULL,
player CHAR(36) NOT NULL,
type VARCHAR(32) NOT NULL,
xp DOUBLE NOT NULL,
FOREIGN KEY (player) REFERENCES player_level(id)
);
mysql error: https://paste.md-5.net/abavumeqoc.md
checking for a key only you would assign has worked for me so far
and then check if the PDC has that key
How do you assign the pdc
update(meta -> meta.getPersistentDataContainer().set(
new NamespacedKey(plugin, path), type, value));
public void update(@NonNull Consumer<ItemMeta> metaConsumer) {
ItemMeta meta = stack.getItemMeta();
metaConsumer.accept(meta);
stack.setItemMeta(meta);
}
what is the value youre setting to the pdc?
"item_id", PersistentDataType.STRING, "ITEM_ID"
theey are created with same method
if ITEM_ID isnt always the same the PDC wouldnt be equal, right?
ITEM_ID is literl text
not variable
oh ok
might be that player_level also needs to be a char
not sure though as i mostly use sqlite
Have you checked the source of itemstack, itemmeta, and namespacedkey?
They might tell you about their behavior
oh lmao
ty for making me realise
if i have a yml value list like this:
Test:
Example: 1
Example2: 2
how can i set both example1 and example2 to 0 (using a loop on the test variable)
(i don't wanna write a line to set each Test.Value to 0, i wanna loop it bc i have more values)
Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_8_R3.command.ColouredConsoleSender cannot be cast to class org.bukkit.entity.Player (org.bukkit.craftbukkit.v1_8_R3.command.ColouredConsoleSender and org.bukkit.entity.Player are in unnamed module of loader 'app')
Does this error just mean that I can't add color to a msg sent to console?
kekw
?
getConfigurationSection(“test”).getKeys(false);
?
Im tired of repeating that twice today so you can search my chat history about getKeys to know what it is
What do you mean really i think i gave you the correct answer?
im using kotlin to make a plugin and my main class is located at
src/main/kotlin/somewhere/something/Main.kt
when the server loads my plugin it gives an error saying that the class was not found
what should i use as my main class in plugin.yml
I seem to get no main manifest whenever I try to run my project without an ide
what's the difference between getSlot() and getRawSlot() in inventoryclickevent?
getSlot is local to the ClickedInventory, getRawSlot is local to the inventoryview as a whole
(iirc)
k
What is the method to get the player's satiety level?
?jd-s
pretty sure you could find the method there
Thanks, I'll take a look.
Edit: I was able to find it. Thank you!
is there anyway to add npcs without nms?
either NPC specialized or nms wrapper
not really
but how can plugins do something with npcs then when it requires nms, doesnt the require a new server jar?
wat
wdym
I mean, I know a lot of plugins which just hook into Citizens API
doesnt it require a modifed server jar to edit nms
you don't edit nms
depends on wym with modify
you just use it
to edit yes, but not to use
but why would you need to edit it
i think i need to read a little up on nms lol
but in principle not splyfof
there is intrumentation and some other stuff
which allows you to change classes at runtime
altho you need to declare an agent in that case
however you can still modify trivial things in nms like field values of instances
(which is basically reflection or unsafe)
so if i wanted to add npcs i could do that with some stuff in a normal plugin
basically yes
yes
ahh that is nice
either with reflection or abstraction
then its just impossible not totally impossible
with that being said, I do suggest using citizens api to circumvent the need of direct nms
well what do i learn from that xd
that would be too easy
but citizens api will require user to install citizens, yes?
Hmm if its for learning purposes then Ig
hmm yeah, unsure but I think they provide some classes you could in principle shade
so no external dependencies with other words, though Idk if this is actually the case
well its gonna take a couple months to do it anyways
is it meaningful to support versions below 1.14.4?
depends
probably depends on what its for
personally I just support latest, or occasionally 1.8.8 if the customer is one of those
also, wtf is wrong with PDC?
if i have two identical itemstacks and they are equal
for some reason if i add same PDC to each of them
they will not be equal
hmm got some code?
how could i do that?
you said you didnt want to use citizens?
the problem is in hashmaps, if i use two identical itemstacks as keys, they override each other, which is normal behaviour, bet when i add SAME PDC to each of them, they suddenly duplicate in hashmap
well i looked into nms stuff for 3 mins and gave up lol
the code is: https://paste.md-5.net/ugajunewuf.cpp,
but the problematic part is "handlers" hashmap and methods at below which add/remove handlers, on every player join, i create new DeltaStack with identical paramteres, but on rejoin, the handler is called twice, and in hashmap, they are duplicated
but if i don't use pdc it works well
whats the best way to "host" a website off the mc server so for example a player types /website and it sends them a link to a website with a button and when you press that button it broadcasts "test" in the chat? i havent found any tutorials for how to do something like this
the api is this: https://wiki.citizensnpcs.co/API
but idk if you need that plugin to be installed
Citizens has an extensive API that can be used for making your plugins work with NPCs or even for adding a brand new character that can be attached to an NPC. Make sure you always are using an up-to-date build of the CitizensAPI to ensure that your plugin works with the latest release of Citizens.
i think i need it to be installed which is what i wanna avoid
See chat component api
that has nothing to do with websites.. ?
ah
run a website with a backend. When button is pressed, you send a request to your minecraft server
yeah i know but how
can a yml value be an item
you can have a yaml node representing it
scalar?
yuh
what's that
you mean itemstack
you can represent an item by mapping out all of its data
because the item object only lives in the jvm instance
yeah itemstack
i mean, sorry to interrupt conclure explanation but
config.set
and config.getItemStack
oh, so u can do that
yeah what manyas saying is probably what you want to do here
does this thing still work today? https://bukkit.org/threads/tutorial-extreme-beyond-reflection-asm-replacing-loaded-classes.99376/
in 1.17 or 1.18
xd
I am actually find difficulty in understanding this concept
transform & byte code manipulate
Yeah that’s one of the more advanced topics in Java
anyone know what the version tag is supposed to be for 1.18.1 in maven for the dependency?
<version>1.18.1-R0.1-SNAPSHOT</version> isn't working for me when I try to build my project :/
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
the official guide says
it shud be latest i think
right but that is 1.18, is it no different for 1.18.1?
maybe you didnt add repo
the NMS versions are same
ok
but bukkit versions are different
I have the repo, I'm updating not starting from scratch
<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
uh
i don't think plugins on 1.18 won't work on 1.18.1
what's the error then
sure, I just like to keep it on the latest version if possible, if the nms versions are same then we're good
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
it says that both are 1_18_R1
btw I am looking for someone who have knowledge about transform & byte code manipulate (modify CraftBukkit/nms class in runtime), I have been stuck in the issue for 3 days already ;_;
wtf r u trying to do?
how do i get slot X of player's inventory
as I say, modify CraftBukkit/nms class in runtime
why
well, change some internal code for certain features, and reflection dont work to replace existing method
is that even possible?
reflection is basically the way of changing classes at runtime
as far as I know, is was possible in java8
?
reflection can change field value but cannot change method body
well it doesnt change classes
and you can actually through reflection set a private field
xd
given that the field must not be inlined
I managed to add new enum by reflection in java 8
ofc ::setAccessible should be invoked first
but no longer available in java 9 ;_;
what the
ya that's real, I just discovered that yesterday
the fuck?
I thought reflection checked for that kind of thing
yeah but that's not reflection
that's classloading
I dont have enough skill rip
eh it's not too difficult
you just need a basic understanding of ASM and JVM bytecode
I've only been programming for 2-3 years but I figured it out pretty quickly :p
well
bytebuddy 🙂
Made this.
It's not finished yet tho.
in modding, yes
wait wait wait wait wait Is it even possible to change method body at runtime????????????????????????????/
that's cool
in mods we have mixins though
oh yeah I have yet to learn anything in regards to OpenGL
I added a star for you (even i dont know how to use it rn xd)
lol game of life
classic example in programming class :3
Well I did heavily document the demo.
ya true, i dont sure how to use it in plugin yet but I see the potential xd
sure :3
what's it actually
oh xd
cool
btw is there any way to use fabric/sponge mixin magic in spigot?
probably no but ya
just asking if there are any similar framework
yall read the bible in minecraft
lol
i always read the bible
i never (cuz im not even Christian)
Just in case I'm missing something. I have a server set to hard. But after each restart it is back in easy. On spigot, maybe a day out of date. Has this bug been addressed yet?
spread religion time
O I interrupted something lmao
dunno
but u can fix it easily
nonreligious rise up
then praise the Big bang
probably difficulty in server.properties been set to easy
we thank the mechanics of entropy for bringing us this wonderful universe
"wonderful"
we praise allah :D
funny word
I mean the config is set to hard. Imma double check rn. But I set it to hard before the server launched. And I keep turning it back to hard in game.
You don't have to be a specific religion to read a book. lol
you do
Whats the point of this library? A readable way to modify bytecode?
No you don't lol
if u read the bible as a muslim or smth that's kinda weird lmfao
modify bytecode at runtime
no you do
create a plugin for the purpose of setting server difficulty to hard when enable then :3
it's mainly so you can apply complex transformers from other sources
aha
Weird or not its not against anything.
Its still a book you can read lol
you can read it but not believe in it
^^^
if you're a muslim at least
can I easily insert my codes into the method body of a given class? :3
soon™️
possible*
I don't know what you mean
like
like
mixin support wen?
I guess he want allow parsing String into code and run it in runtime
/run getPlayer("2Hex").sendMessage("hi");
how do I get the bossbars that are displaying for a player?
it should be possible
since Java has a built-in JS scripting engine
bruh
it just asks u the list of imports there are that looks relevant
although that is an incredibly unsafe concept
like intellij does
it is fairly easy actually if just parsing string to some simple code
no one cares about safety
it's literally an RCE
parsing string to tokens, map to executor to run it
u have to find relevant imports tho
anyway there is actually a way to do it though
# calculator in python, all of my users will be able to use it
math = input('enter math: ')
print(eval(math))
but it prob isnt on my level
totally secure
you could wrap the code within a method + class and send it to the compiler API, dynamically load that compiled class, and execute the method
so yeah it's quite complicated
but that's the cleanest way I can think of
yeah i definitely cant do that
name resolution would be pretty difficult though
and then let every programmer write code in minecraft
how do I get the bossbars that are displaying for a player?
crazier if i learn how to do it myself
which is a terrible, yet fun, idea
: )
also you kinda are limited by the chat size
oh true
anyway Maow will make java-eval at a later point
he is working on sardines, compile-time serializer/deserializer generation
it dont need actually to be java code
do u think it's worth to try and learn how to do it
well then it can't access the classpath
it is doable to implement a simple script language
made a new language then :v
I made a lang once
wtf
stop been furry
no
;_;
this is also just genuinely a bad language though
I don't even remember what this does
thats cool tho
btw the "end program" opcode is yif, you're not welcome
i prob can never learn how to do this lmao
the only thing I made which close to a language probably just an arithmetical parser & calculator
how to find the bossbars that are displaying on a players screen
how to teleport the member to chosen x ,y,z
player.teleport(x,y,z);
Has anyone got openjdk17 to install in a docker container image ?
I have tried to grab it using
RUN apt-get install -y openjdk-17-jre
RUN apt-get install -y openjdk-17-jre-headless
and both come back
E: Unable to locate package ...
ngl i wanna make a plugin called 'Order Me', it be like this:
if u say **give me diamond sword ** then it gives u a diamond sword
scary
but how am i supposed to make this efficient
dont do it
ill have to listen for every possible sentence
that's fairly complex if you want to do multiple actions
._.
i have a lot of time to waste
im from planet minecraft so please give me op so i can test your plugins
sound like a good opportunity to play around design pattern
- you need to consider the fact that player can say:
"give me a diamond sword"
"give me the diamond sword"
"give me diamond sword"
"give diamond sword to me"
"give a diamond sword to me"
"give the diamond sword to me"
use regex maybe
and replace me with the sender
it is a topic about nature language parsing then
:v
it will simply not work
bruh
thee individual over there cometh forth and speaketh thy fears
lol
ill do 5hours everyday
of adding new sentences
after a few months maybe ill be done
you probably need some sort of natural language processing tools if you want your plugin be flexiable
Well apparently Spigot servers on 1.18 also report as CraftBukkit............. shit
go the extra mile and train an AI
how
thxx
you can use Apache's OpenNLP
apt update?
Apache OpenNLP is a machine learning based toolkit for the processing of natural language text.
member.teleport(1,1,1); like this show error
what error
what error
method org.bukkit.entity.Entity.teleport(org.bukkit.entity.Entity,org.bukkit.event.player.PlayerTeleportEvent.TeleportCause) is not applicable (actual and formal argument lists differ in length)
player.teleport(new Location(1,1,1));
thxx
unit tests
But damn you Just do a scripting language with very ugly syntax
its not ugly
its the most understandable
literally
u cant get any better than pure english
u can make stt and get a google assistant in minecraft
honestly even asm would be easier to work with
hey minecraft give me 64 chicken
ah
lol
error
what error
i see
java: no suitable constructor found for Location(int,int,int)
constructor org.bukkit.Location.Location(org.bukkit.World,double,double,double) is not applicable
(actual and formal argument lists differ in length)
constructor org.bukkit.Location.Location(org.bukkit.World,double,double,double,float,float) is not applicable
(actual and formal argument lists differ in length)
oh right
I dont find asm is easy for me yet xd
Hey, is there someone who can help me with some database communication inside of a spigot coded plugin. A little struggle with a HirakiCP.
Was never here so wanted to ask how to ask questions xd
player.teleport(new Location(player.getWorld(), 1, 1, 1));
Hello how would i go about making a map expand over multiple item frames?
I have that before any install in the image but still cant find it, its very werid. Never seen it not find it before.
well
is there any way to rollback an update on Spigot?
it would be far better for me just have a much easier library ;_;
Hello I'm trying to add/remove permissions on join, but my code isn't working. Someone know what is wrong ?
@EventHandler
public void onJoin(PlayerJoinEvent event) {
// Some setup
HashMap<UUID, PermissionAttachment> permshash = new HashMap<UUID, PermissionAttachment>();
PermissionAttachment attachment = event.getPlayer().addAttachment(Aeris.get);
permshash.put(event.getPlayer().getUniqueId(), attachment);
PermissionAttachment perms = permshash.get(event.getPlayer().getUniqueId());
disableAll(event.getPlayer());
perms.setPermission("verus.alerts", true);
permshash.get(event.getPlayer().getUniqueId()).unsetPermission("verus.bypass");
}```
location:
x: 0
y: 0
z: 0``` how to do this in file using addDefault
Problems on Database-Communication (HirakiCP)
who knows Geyser went into the hub opened the menu clicked on the server the command was executed and I was not touched
what's the purpose of permshash
I don't know how permissions works, I followed a tutorial (https://www.spigotmc.org/threads/tutorial-giving-removing-player-permissions.53840/)
burmp
help
Are you having issues with one of your plugins?
??
Geyser I click on the npc the menu opens I click on the server in the menu the command is executed and nothing happens
that's probably no a good way to implement it then
@severe mason
да
@unreal quartz I think i got it, had to update my Ubuntu version from 20.04 to 22.04 in the image. Seems it will not find it in 20.04. Safer anyway on 22.04 cause its there LTS so that should be future proof for a bit.
плагин Geyser нажимаю на npc открывается меню я выбрал в меню сервер команда выполнилась в консоли и меня не куда не тепнуло
если что это мобильная версия
подержка
probably something like
addDefault("location.x", 0) and then repeat for y/z
да
