#help-development
1 messages ยท Page 1040 of 1
well fire resistance allows you to swim in lava unharmed
however all we want is the code to run damage as if it was from fire
not actually set them on fire
Then I suppose it might be a bug. Is someone able to confirm if it exists on your end too?
fire res still lets you get set on fire, you just dont take damage from the fire ticks
Setting damage type to ON_FIRE causes fire sound, but also has knockback.
weird
fire shouldn't have knockback o.O
Walking into ACTUAL fire has no knockback.
right, because the damage from fire doesn't have knockback or shouldn't
yes thats why I said I dont think its normal knockback
yeah has to be this if they tested with fire and still had KB
another test
you could try starvation damage
that also has no KB or shouldn't
It might be teleportation, but I'm not the one doing it.
do you have other plugins on the server?
Not really.
and if you walk into it from the opposite side?
so that is yes
Nothing that would have anything like this.
like does it always knock you back in the same direction?
Seems to go in the same direction every time.
hmm
South-East I would say.
Oh, actually.
I have one idea.
Let me try that out real quick...
try setting the location of the damage?
I remembered the chair plugin had a setting related to damage. This might be it if the chair plugin is malfunctioning.
hence I asked if you had plugins
generally when testing even if you think it might be a bug, you should remove all plugins except what you are testing
so you can be certain nothing else is interfering
Although, turning that setting off did not seem to make a difference.
But I'll try disabling all plugins next.
First make a minimal plugin that is needed to reproduce the issue
Just so you don't report something invalid
Disabling plugins didn't help.
using the builder method for damage, does it help if you set the location of the damage?
Does anyone have idea how should I manage my versions in monorepo microservices architecture ? I decided that every service will have independent version and because of that I have no idea how I should pass each service version to CD. I trough that I can maybe do that with merge request labels but that doesn't really sound good imo
I will try.
Oh, that's interesting. It totally fixed the issue.
can you try regular /damage command with only the type and no location/entity ?
I wonder if that still causes knockback, if so then this is a spigot bug
Explain ๐ค
well I don't have the source, but I am going to assume that without a location or entity set it falls back to the most basic damage vanilla has which happens to have knockback
No knockback from that.
Then I assume spigot has a bug
I don't think it is
To be honest, if that's the case I don't enjoy that default behavior.
since setting location fixes it
It's unintuitive.
if the vanilla command does not deal kb when not specifying the location
the DamageSource should not either
however, using the builder utility is also not a necessity either just fyi for applying damage
just makes it easier
it depends how its implemented. Just because some command doesn't do it, doesn't mean some method implemented shouldn't either
True, but I would assume there would be some parity
pretty sure they want the visual effect
Yes, but I wanted the visual damage effect. And applying the damage effect alone - that also had knockback.
the damaging code stuff existed before the command
Fire damage also had knockback.
Well, I don't have account in the new jira thingamajig. If someone wants to make a bug report about this feel free to take over.
I'm happy that I got it to work somehow. Thank you everyone for your help.
Not quite new but it's worth making an account to report bugs
I've had pretty bad experiences with reporting bugs for open source projects. So I prefer not to.
I mean it likely won't end up being fixed as soon then idk what to say
As long as you got it working ig
I really don't think it is a bug =/
You'd have to crack open vanilla and see
I don't think fire does knock back in vanilla
Maybe it's not a bug, but at the very least it's weird default behavior for calling:
player.damage(1.0)) in my opinion.
not really, it depends if the builder class or the damage api intended to rely completely on vanilla stuff or not
well that isn't what you were doing
I wonder if that happens with monsters too ๐ค
you were using the builder class to apply damage, not just calling the damage method
It was the first thing I tried, but it had knockback.
So the next thing I tried was to use the builder.
In attempt to get rid of the knockback.
right, but my point is the builder class must do something different when you don't specify one of the three options
Iโve realized I can use packet listeners to allow my action bar stuff to play nicely with other plugins using the action bar
Just need to figure out how to only intercept packets that arenโt from my plugin
Hi, I have problem with sending packet using ProtocolLib, can someone help me? I'm new with packets...
This is an exception when I send this method
https://paste.md-5.net/tovetaduwe.sql
public void changeFov(Player player, float fovValue) {
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Client.ABILITIES);
packet.getBooleans().write(0, true);
packet.getFloat().write(0, 0.05f);
packet.getFloat().write(1, fovValue);
protocolManager.sendServerPacket(player, packet);
}
line 18 (as we can see in exception) is this line of code:
packet.getFloat().write(0, 0.05f);
Then there is no float field to write to
Check the nms packet class
which class
The class for the packet you're trying to send
I think I need to send ClientboundPLayerAbilitiesPacket this packet but this is internal which I can not access, am I right?
Open it and see the packet format
?nms
Compare different mappings with this website: https://mappings.cephx.dev
Fields should be listed there
Right that too
it has 4 ints, 4 booleans and 2 floats
version: 1.19.4, hash: 014f43d0e5
what do I have to do with it
No idea
Does plib have a way to print what fields are available
Or any way to find out
Can anyone help me with a plugin? im trying to make a plugin that gives effects depending on what armor trim a player have on their chestplate, and i have a problem with getting the amor trim data, cos its basically not in Itemmeta
im a man btw xD
I know
shows red
i installed the latest java just before doing the plugin to make sure its good
@river oracle could you somehow join a vc for like 3 minutes
oh ok
can i send you a part of the code in dms to see if its alr?
ripp
Yeah no one here is going yo steal your code
It aint the nuclear launch codes
ikr
private void applyEffects(Player player) {
ItemStack chestplate = player.getInventory().getChestplate();
if (chestplate != null && chestplate.hasArmorMeta() && chestplate.getArmorMeta().getPattern()) {
for (ArmorTrim armorTrim : chestplate.getArmorMeta().getPattern().keySet()) {
applyEffectFromConfig(player, String.valueOf(armorTrim.getPattern().getKey()));
}
}
}
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
maybe someone knows solutions?
its my 1st time working with trims so idk if the getPattern is alr
@river oracle
Itโs hasItemMeta and getItemMeta
he before said to change ItemMeta to ArmorMeta
but both ways something else is red xD
You need to cast an instance of ItemMeta to armor meta
to make it the easiest, what exactly to change in the part i sent?
i will steal his code and sell it
ArmorMeta meta = (ArmorMeta) chestplate.getItemMeta
in which exact place do i add it? cos sry but i am rly new to java xD
because basically wherever i change smth with that it goes red again
@young knoll @river oracle
If i regenerate the end, does it regenerate the end or a normal world called end?
You get the item stack from however you are retrieving the player, create an itemstack named chestplate, create an armormeta named meta and cast the item stack meta to armormeta itโs quite simple
ItemStack chestplate = player.getInventory().getChestplate();
ArmorMeta meta = (ArmorMeta) chestplate.getItemMeta;
ItemStack meta = ArmorMeta;
like that? @spice burrow
Install Java 17 at https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot
Hey i am currently updating my plugins
and ran into the issue where the class AttributeModifier is marked for removal
and i need a sort of thing like that at any cost
here is the current code i've written:
meta.addAttributeModifier(
Attribute.GENERIC_ATTACK_SPEED,
new AttributeModifier(
UUID.randomUUID(),
"generic.attackspeed",
-attackDelay(),
AttributeModifier.Operation.ADD_NUMBER,
EquipmentSlot.HAND
)
is there a alternative for that?
paper?
its a bukkit package
hm?
oh right, you can use the one that takes a namespaced key
what do you mean?
there are different constructors
declaration: package: org.bukkit.attribute, class: AttributeModifier
and the one that takes a namespacedkey as constructor isnt deprecated
OH
its because of how vanilla changes things
now i see it
ItemStack chestplate = player.getInventory().getChestplate();
ArmorMeta chestMeta = (ArmorMeta) chestplate.getItemMeta();
// do what you want with the meta here
chestplate.setItemMeta(chestMeta);
not sure why you're trying to set an itemstack to the meta... ArmorMeta is the type... you should probably go back to learning basic java
i probably have to tbh cos i dont rly use it, i used to some time ago, now i mostly use c++
idk much about c++ but pretty sure that requires you to define the type too... same thing in java
btw
i added this and again smth is red bruhhh
share your code and stacktrace please I don't wanna keep guessing at what's wrong
if its red usually it has a reason
maybe hover over it or something to see a message as to why its red
ItemStack chestplate = player.getInventory().getChestplate();
ArmorMeta chestMeta = (ArmorMeta) chestplate.getItemMeta();
chestMeta.setTrim(new ArmorTrim(TrimMaterial.AMETHYST, TrimPattern.BOLT));
chestplate.setItemMeta(chestMeta);
i've never set an armor trim before but this should work
maybe check if the player is wearing a chestplate, but yes should work I think
the thing is to see what trim pattern the player wears to give him an effecr
imma send you the whole code rn
chestMeta#getTrim
i sent you in dms cos it doesnt let me here
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
Hi, I have problem with sending packet using ProtocolLib, can someone help me? I'm new with packets...
This is an exception when I send this method
https://paste.md-5.net/tovetaduwe.sql
public void changeFov(Player player, float fovValue) {
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Client.ABILITIES);
packet.getBooleans().write(0, true);
packet.getFloat().write(0, 0.05f);
packet.getFloat().write(1, fovValue);
protocolManager.sendServerPacket(player, packet);
}
line 18 (as we can see in exception) is this line of code:
packet.getFloat().write(0, 0.05f);
are there any reports with the .setAbsorptionAmount, im trying to set the obsorbtionamount of the enderdragon bow somehow it isnt being set and there is no error
enderdragon.setAbsorptionAmount(Config.enderDragonSettings.get("Phase2Absorbtion").getAsDouble());
System.out.println(enderdragon.getAbsorptionAmount() + " -- " + Config.enderDragonSettings.get("Phase2Absorbtion").getAsInt());
System returns: 0.0 -- 300.0
you need to add a max absorption modifier otherwise it'll be clamped to that value
just like with health, you can't set health higher than the max health attribute, same applies to absorption
how do i change the max value for absorbtion?
doesnt look like there is a method for it
Have the main part of the code compile against the oldest version you want to support
Then add multiple maven modules for different versions
And only load code supported on the running version
its an attribute, same way you change any attribute. either with a modifier applied to the base (preferred) or changing the base value
ah i see, thx
any docs or anything on that?
Just don't use a class from another module unless that module supports the running version
There are many ways of handling that
Just using a switch statement is one way of doing it
You can also use reflection if you prefer that
i meant the whole process
Hi!, I have a problem. How do i code so that if we click an item in the first InvenEvent we can move into the next InvenEvent?
which invenevent?
when the player places a block which had pdc in it can i retrieve the data from the block by:
ItemStack item = block.getState().getData().toItemStack(1); or some other way?
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
?morepdc
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
which event to use
when player places item get pdc from item and put it on block
?
Wait do you want to get the item in the place event
yes
basically player when placing block i need to check if it has certain key stored in pdc
I have InvenEvent_1 and InvenEvent_2. In InvenEvent_1, there is an item that makes us move to InvenEvent_2 if we click it. Do you understand what i mean?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/BlockPlaceEvent.html#getItemInHand()
declaration: package: org.bukkit.event.block, class: BlockPlaceEvent
Does someone here know why everytime I paste a schematic with FAWE API it gets slower progressively? Never used their API before so yeah
use inventory click event
The speed it places depends on the servers performance
there's an inventory
you can then use assuming you have inventories
in your inven evnt 1 and 2
Well I did some tests at first it pasted within ~0.9 seconds and after ~20 pastings it became between 55 to 60 seconds that's what I find really odd about this
can anyone help me thru making plugins multiversioned? i have some issues/questions like how do i use maven modules for that
Hi there. Do you think I should merge my commons into my public plug-in?
Ok, I have coded inven1 and it works. How can we move to inven2 by clicking on one of the items in inven1?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Hey, I'm trying to design a GUI that has 3 heads, each representing either the owners, trusted and members of the current plot the person is standing on. Now i got this error: https://pastebin.com/x1MF64d1
This is my code for the function:
https://pastebin.com/GDJn0u2q
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
wow so helpful
olivo
wdyt?
Yeah shade it if possible
literally just asked a question that you could answer why does that need mind reading
thers nothing to provide for it
.
I DONT KNOW HOW TO USE MODULES AND LOAD THEM
Alex has a guide too iirc
Oh yeah, Olivo. I hav a problem. Wdyt?
link?
Hi there! Today Iโm going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...
Not quite sure what you mean
I have InvenEvent_1 and InvenEvent_2. In InvenEvent_1, there is an item that makes us move to InvenEvent_2 if we click it. Do you understand what i mean?
I see. I appreciate your help.
Only problem is that I'm actually using the libraries feature
libraries:
- "com.zaxxer:HikariCP:4.0.3"
- "org.mongodb:mongodb-driver-sync:5.0.1"
Inside my Commons plug-in, which drastically reduces its size. Shading that commons means shading those libraries inside as well
what would olivo do? ๐คฃ
Add that to your plugins library section instead of shading them
if i dont use nms do i need to do anything or does it support different versions on its own?
like if i set api-version to 1.13
does it just support everything 1.13+?
You'd have to track which events have fired
You can do so with a Map
They key can be the players uuid
I didn't think it could have worked, thank you so much!
if you compile against the 1.13 api and Java 8 then yes
anyone got any idea why this returns an error? Why cant i modify the set?
You're trying to modify an immutable set
but isnt there a general solution to the problem?
These are the sets: ```
java
Set<UUID> plotOwners = plot.getOwners();
Set<UUID> plotTrusted = plot.getTrusted();
Set<UUID> plotMembers = plot.getMembers();
not modifying an immutable set
well the general solution would be not modify the immutable set
you can clone it
yes new HashSet(plotOwners)
and that cloned set will be editable?
You add entries to it during creation
do you really want me to put ?tas again?
i am already trying this
cool
Hey how to get address from ServerConnectedEvent event that client targeting?
Hey,
I am currently trying to remove all vanilla crafting recipes. And i run into the problem that i cannot use Bukkit.clearRecipes(); because of my custom recipes and now i get everytime i restart the server and join errror spamming that the server couldn't find the recipe to give it to the player.
So i need to check if a recipe is a vanilla one and remove it without removing my other ones.
Any ideas?
same fu****ing Caused by: java.lang.UnsupportedOperationException
at com.google.common.collect.ImmutableCollection.remove(ImmutableCollection.java:282) ~[guava-32.1.2-jre.jar:?]
yeah don't try to modify the immutable set
i am not
yeah you are modifying an immutable colleciton
Well that error says you are
i am accessing the second 3
Set<UUID> UnchangeableplotTrusted = plot.getTrusted();
Set<UUID> UnchangeableplotMembers = plot.getMembers();
Set<UUID> plotOwners = new HashSet<>(UnchangeableplotOwners);
Set<UUID> plotTrusted = new HashSet<>(UnchangeableplotTrusted);
Set<UUID> plotMembers = new HashSet<>(UnchangeableplotMembers);```
What's GUIUtils.java:209
plotOwners.remove(currentUUID);
for (UUID currentUUID : plotOwners) {
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(currentUUID);
plotOwners.remove(currentUUID);
plotOwnersName.add(ChatColor.RED + offlinePlayer.getName());
}
Does plotOwners happen to be immutable
plotowners is a hashset i created
Set<UUID> plotOwners = new HashSet<>(UnchangeableplotOwners);
this is the imuteable thing
Set<UUID> UnchangeableplotOwners = plot.getOwners();
Recompile the jar and restart
wait
You're most likely running old code then
hail nah
i dont even need to remove it here
i dont even need to edit it here
dump mistake
what are these blocks?
is there a way to spawn exaclty this guy with code? I mean not the enities because it's fairly easy, but connect the llamas to the villager with leads and set custom trades inside him?
https://i.imgur.com/SMBzo4I.png
Is there a way to get BungeeCord (public) IPAddress based on client connection?
So to where is the client connected?
Are you making a bungeecord plugin?
Am i doing anything wrong, I cannot access NMS in my code and this is my pom.xml
https://paste.md-5.net/cilusureya.xml
like when i built i'm just told no classes in net.minecraft exist
net.minecraft itself is apparently not present
How are you building
intellij build cmd
Make sure you build with maven
Open the maven tab on the right, and run the package task
So the classes are in the IDE? but not available during package?
I created a custom inventory and am trying to cancel item pickup from certain slots, but when I do that it also cancels the player inventory movement. How to do this correctly?
after reloading intellij, it also appears to cry now
Check what slot the player is interacting with and what action they're using
Is Intellij up to date
probably
I believe there was an issue with Intellij for a bit
can't remember exactly what it was so give it an update
and see if it helps
i'm installing 2024.1 so that should hopefully work
well, older intellij versions don't really know about modern java versions like the ones Minecraft is compiled for today, so possibly
๐
slay
I backed up 10 years worth of photos on my boot drive, so that was kind of an expected result
moving it all to an archive hdd now lol
hi, ive been learning plugin dev recently and I was hoping someone could help me with a few questions, dms is easier but here is fine too
lmk cus im doing a plugin vs datapack battle thing with my friend
You can ask your questions here
oh I see
and im tryoing to make it in plugin
tough fight
yeah
hes like really good and i dont know a thing hes also usinf genorators and datap[ack discord severs so ug
So what are you comparing
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
!verify
Usage: !verify <forums username>
The bee api has a setAnger option
i dont have forums
Presumably you just need to keep setting that to > 0
oh well thats not the only option
pproblem
not option
You can also keep setting hasStung to false
well under public Wisp
i didnt come up with name btw
i have bee.setCustomName(ChatColor.YELLOW + "" + ChatColor.BOLD + "Wisbee");
nad it works
bee.setCustomNameVisible(true);
but i tried adding attributes and they dont work
AttributeInstance attribute = bee.getAttribute(Attribute.GENERIC_MAX_HEALTH);
assert attribute != null;
attribute.setBaseValue(100);
bee.setHealth(100);
AttributeInstance attribute2 = bee.getAttribute(Attribute.GENERIC_SCALE);
assert attribute2 != null;
attribute2.setBaseValue(3);
woah cool
thanks
does anyone know why that code doesnt work?
yeah
public class Wisp {
public Wisp(Location location, PluginBattle plugin) {
Bee bee = (Bee) Objects.requireNonNull(location.getWorld()).spawnEntity(location, EntityType.BEE);
bee.setCustomName(ChatColor.YELLOW + "" + ChatColor.BOLD + "Wisbee");
bee.setCustomNameVisible(true);
Objects.requireNonNull(bee.getEquipment()).setHelmet(new ItemStack(Material.YELLOW_STAINED_GLASS, 1));
AttributeInstance attribute = bee.getAttribute(Attribute.GENERIC_MAX_HEALTH);
assert attribute != null;
attribute.setBaseValue(100);
bee.setHealth(100);
AttributeInstance attribute2 = bee.getAttribute(Attribute.GENERIC_SCALE);
assert attribute2 != null;
attribute2.setBaseValue(3);
new BukkitRunnable() {
@Override
public void run() {
if(bee.isDead()) {
return;
}
if (bee.getTarget() == null) {
for(Entity entity : bee.getNearbyEntities(10, 10, 10)) {
if(entity instanceof Player) {
bee.setTarget((Player) entity);
bee.setHasStung(false);
}
}
}
bee.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 120, 2));
}
}.runTaskTimer(plugin, 50L, 100L);
}
}
ngl i watched a tutorial and like customized it to be the wisp
it helped me learn a lot but im still confused by some things
like what
wdym
oh
lol
why the atttributes wont work
and even thought bee.setHasStung(false);
it loses it
even when it target range
So first of when spawning an entity and modifying it directly after you should use the spawn method that takes a consumer
That ensures the entity is spawned with your data
Instead of it being spawned and then modified
oh i see
A helmet on a bee wonโt render
Secondly that code will cause a memory leak
And the speed effect probably wonโt do anything either
yeah those both didint worj lol
oh
You keep the timer running and a bee instance
Regardless of if they're needed or not
You should check isValid and then cancel the timer
^^
isValid also covers isDead
oh im not that advanced... i watched a tutorial and modified it to be the wisp i literally learned Java two days ago
do itemstack serlized string need to have a type adapter for it to work using redis? cuz the data aren't sent
i use redis so when server start (lobby server) it push update of the kit instane to all servers
and in other server there will be a pubsub , that will listen for the pushed data
but for some reason the contents of the kit (itemstacks) is not being sent
oh idk what a serlized is but im running a localhost server
Sounds like an odd way to go about it
why?
Why canโt the servers just pull the kits from a central database on startup
^^
- lobby server start -> load kits from kits.yml -> push them into redis using pubsub -> in game moudle plugin there will be a event to listen for the pushed data
i tried that and Choco told me its not ideal to have kits in database (like mysql)
and other people said the same thing too
They can pull from Redis
I have 3 modules: A and B and then a common module where A and B depend off on. I want to move a class from module A to the common module so module B can use it but the class has a lot of references in module A. If I make common depend on module A then its a circular dependency (common depends on module A and module A depends on common). How do I have the class in the common module so both classes can use it while still having it reference the objects in module A?
Anyways you've probably given them more information
Which is why they told you that
Sounds like you have a code structure problem
if common depends on A, is it really common?
woah you guys are smart
It doesnt depend on A, I am saying IF i depend on A it would be a circular dependency problem
Then donโt
ofc .. someome is trying to help me these past few day's and we made amazing progress .. he is busy the last 2 day's
Your common module shouldnโt depend on any other modules (maybe an api module)
false.
Yeah, it doesnt
the bug that iam stuck on rn is the itemstacks serlized string is not being sent to redis
What should I do to fix the problem though?
well yeah I wasnt saying that either xD
what problem
then im must be stupid lol
the idea was to have it on a proxy (bungeecord) but again there are no itemstack api on bungeecord so how would i load it ..
and it will push it into other servers
IF I depend on A I will have a problem
then donโt do that
or they just use a whole lot of jargon that seems to be intelligent but really isn't.
LOL
My current problem is that a class in common has references in module A but I need to use in it B
hhhhhhhhhhh funny
Not circular dependency, I just pointed it out as why the simple answer would be problematic
Then you need to move those references to common too
yes that's what iam trying to achive right now .. it do send :
- name
- id
- type
- rarity
- other data
but string itemstack is not being sent
so it does depend on module A?
i checked the InstantCreator , i checked configuration nothing is wrong ..
you don't seems to understand my problem ๐
it does send them correctly , my only problem it does not send the serlized itemstack
what did you mean by memoery leak and how do i fix the isDead and isValid thing?
No??
It is trying to reference it but is failing to resolve it obv
types are :
"kits" .. for example
I mean can you build the module without A
No simpler way? I'm gonna have to move an insane amount of classes to do that
if not it literally depends on A, then you have to what coll said and move it over to common
maybe you can use an interface an dependency injection
depends on what kinda thing you wanna move over
We can't really give better advice without knowing what the code is
how could i make a player heal with the natural animation?
i googled it and it was talking about packets but if i do it that way, will the player actually get healed in the server internally or will it just show on the player's screen that they healed
If you do both then both will happen
If you only send a packet nothing will change on the server
so i shuld send the packet then do .setHealth()?
Yeah
alr cool ty
^
Should work
okay all of my attrivutes arent working
i think I got an answer earlier but I didint understand it
bee.setCustomName(ChatColor.YELLOW + "" + ChatColor.BOLD + "Wisbee");
bee.setCustomNameVisible(true);
AttributeInstance attribute = bee.getAttribute(Attribute.GENERIC_MAX_HEALTH);
assert attribute != null;
attribute.setBaseValue(100);
bee.setHealth(100);
AttributeInstance attribute2 = bee.getAttribute(Attribute.GENERIC_SCALE);
assert attribute2 != null;
attribute2.setBaseValue(3);
bee.setAnger(10);
those all should work right? i think it had som,ething to do with the place they were so the attrivtes would update when the bee was spawned
but idk how I woiuld fix that
lmao
so basically it will look someting like this spawnEntity(location, EntityType.BEE, (bee) -> {//stuff about the bee});
idk if thats the exact syntax for the method
but the consumer part is bee -> {}
which means "take this bee, what do you wanna do with it?
phhh
and then you can go and name the bee and make it angry inside of that
public Wisp(Location location, PluginBattle plugin) {
Bee bee = (Bee) Objects.requireNonNull(location.getWorld()).spawnEntity(location, EntityType.BEE);
bee.setCustomName(ChatColor.YELLOW + "" + ChatColor.BOLD + "Wisbee");
bee.setCustomNameVisible(true);
AttributeInstance attribute = bee.getAttribute(Attribute.GENERIC_MAX_HEALTH);
assert attribute != null;
attribute.setBaseValue(100);
bee.setHealth(100);
AttributeInstance attribute2 = bee.getAttribute(Attribute.GENERIC_SCALE);
assert attribute2 != null;
attribute2.setBaseValue(3);
bee.setAnger(10);
thats not it
oh i see, do I put it in the public Wisp thihg
and then the attrivutes go in there i see
thank you
I think you want this one https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/World.html#spawn(org.bukkit.Location,java.lang.Class,org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason,boolean,java.util.function.Consumer)
declaration: package: org.bukkit, interface: World
๐
LOL OKAY WELL THANKS FOR TRYING
last param is a lambda
I don't think you'll know what a lambda is only 2 days after you've got into java :p
do you eat that with mayo?
coding java since 2 years, never really learned what lambda is, dont even know how to use it or what advantages it has, xD
its just a function
k, nice 2 know xD
error: https://paste.md-5.net/ecayaxelip.sql
build.gradle: https://paste.md-5.net/ridiyulase.cs
Before you start talking badly about foundation, I only use it for menus.
How can I solve this error?
Best way to put it is itโs a function without a name
We often pass it around
(() => something)
this is the only thing i know about it
from some old js days xD
Updating intellij fixed the issue
Thatโs the JS lambda function syntaxyeah
good ol discord.js bots
since coding in java ive begun hating js
Iโve always hated js
The only reason I agree to use it is discord bots or web dev
i just love how strict java is, not relative variables, you always know what data types you get
Typescript is a mess frankly
theres no change its gonna return you an array if u want a string for example
in js you never know
You can easily break typescript and get undefined behavior
Since in the end it transpiles to js
no way u are coding 2 yrs in java and never came across lambdas
yeah
that is like fundamental
can be described in one sentence of song lyrics
"I want it my way. Tell me why?" Because I hate learning and just wanna code for the fun
I may do "complicated" stuff and may really overcomplicate my projects, but thats just how i code, unless doing it in a professional setting
Trying out new stuff and coding how I like is the only thing keeping me motivated
which is like 10 years old
A lot of people still use Java 8
I think as of recent pre Java 8 had luckily been eliminated for the most part
But a lot of the industry is on Java 8
thats like the only thing it has
its not
lambda's are not necessary in terms of java
not sure if I would say a lot of the industry. For the most part in regards to the industry its mostly just maintaining and not developing since these places already have their finished product.
if anyone is developing in the industry today right now for java, they are most likely not using java 8
the nifty part with java that makes this more likely is the fact that newer versions of the JVM can run old java code versions
even college doesnt use java 8 \๐คก
A lot of security products refuse to go past java 11
including the jvm/jdk version
not just the language features they use
if u didn't came across lambda that means u never used any kind of stream api, never used completable future, never used threads, never used executors
etc
so i would call that fundamentals
yep
i mean thread takes runnable, that is why i mentioned it
i used completeable futures before, but never really understood it deeply
and runnables have been a thing since java 1 as well
Its like a Promise
used bukkit runables before
i needed them for luckperms api
u definetly know what im talking about, don't need to be nitpicky ๐
threads and executors don't require lambda's
i mean nothing requires lambda
streams are not necessary, and I don't remember if completables require lambda or not
nothing strictly requires lambdas
it can be impl or anonymous class
"implement"?
I personally don't really use lambda's myself. Maybe every once in a while simply because there is a few things where it is a bit convenient but outside of that I don't use them
well i needed to use this
() -> {
for bukkit runables
If you didn't use lambdas for functional interfaces means that you implemented them in a class
So you used lambdas
i used them in the main class
yep
idk what security products you are referring to
So i didn't understand the context
I can't say the r word, what the fuck
I was trying to say "Probably i'm r3t4rd3d" but discord didn't let me send this message
me neither
perhaps talking about stuff using the sun Unsafe? But that isn't security but rather anti-security (for some people, but I'd digress if I elaborate)
I know many people who work in silicon valley based security companies, almost any backend product they have written in java is not greater than java 11
that's most likely existing environments
Won't last for all too long - many environments moved past J11 or even past J17 (some libraries even went completely nuclear and went past J21)
i can't say i've worked with security products, but the several products and environments i've worked with/for were 17 or 21
main thing with security products is everything used has to be tried and tested for at least a handful of years
and they have a certification team that needs to approve any libraries they use
From https://github.com/qos-ch/slf4j/discussions/379 the overall consensus was that SLF4J should move to J17 or even J21.
So if people are pushing SLF4J for such a change, you can guarantee that <J17 is dead (that is, no new projects are written in it) at an enterprise level.
nobody upgrades just for slf4j
Yes, but the opposite is true: SLF4J is likely to stay in line just for these projects
i'm not even sure what your point is tbh
slf4j isn't going to make people upgrade, sure, but it will make people and firms consider the possibility that investing in upgrading could have a net positive return
Sadly I'm a bit pinned with J8 right now unless I decide to delve a bit into cross-compiling C and decide to screw over mac users
No
No but you can listen to every event and print the name with a bit of trickery
Itโs ugly tho
how
?xy
what is that
you've asked a question that doesn't seem to make sense; explain why you want "a bukkit event that fires for all events"
Basically, often there is more than one way to solve a problem
?jd-s
you can register event listeners based on the class as epr the registerXXX overrides
but query how that is going to work anyway, how will it know what to do with each event
true
Yeah, you could use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/plugin/PluginManager.html#registerEvent(java.lang.Class,org.bukkit.event.Listener,org.bukkit.event.EventPriority,org.bukkit.plugin.EventExecutor,org.bukkit.plugin.Plugin,boolean) and obtain the Class instance via reflection
well iโd listen to only player specific events
or events that involve players
and apply some action to a player based in the config
it depends, the only governance in regards to security is whatever the federal government puts out if you intend to use their standards or make products for the use of the government. As for everything else there is really no certification process or should say standardized process. If someone doesn't go past a certain version often times it is because the product is no longer being developed. One of the important things that changed after 11 was reflection. So some things that require reflection will not necessarily work if you go past java 11 without some updating.
but in regards to testing for a handful years, yeah don't need to do this not with java anyways
what is the best aproch to :
(sending custom data bettwen servers in real time and it change in real time) is it possible? iam talking about (creating kits , editing kits , editing cosmeitcs .. sending User updated data )
i used redis but iam stuck on a bug that i don't think its fixable ..
my idea was :
- in lobby moudle or proxy moudle plugin when server start , load kits from kits.yml file.
- push this loaded data into jedis after loading the kits.yml
- have a event pubsub that listen to that chanel when it get a message , then update the data on that server running..
Redis or plugin messages
with redis iam stuck on itemstack serlized string , its not being sent with redis , idk if i need to make a InstanceCreator for ItemStack bcz redis use gson?
what reason is there to have this data present on all servers?
why couldn't the servers just pull this info from one location? o.O
seems you are going about some design in a wrong way or trying to do something differently that doesn't need to be done differently
I don't get that, buildtools applys firstly craftbukkit nms patches, but yet some parts of vanilla code aren't fixed; still have compiler errors. How can then it just construct a jar with maven?
I imagine for the stuff we donโt patch it just copies the already compiled class?
Could be wrong
well I don't get it from the code because it gets complicated with maven and stuff
well its a skywars plugin and for example i edit kits in lobby server , i dont want to copy paste the files into all game servers or arena servers so whats left to do is redis right? i make a pubsub event that listen for updates of the kit , and one for pulling them
and in the lobby server it push them
No that is not all that is left. This is a reason such things as DB's exist like mysql.
So there is more then just the design you are going with that works and accomplishes what you are wanting. It just seems the way you are going is proving difficult or maybe not ideal. So maybe use a different approach.
I also assume this happens, since this is the only logical explanation. Maybe only classes for bukkit and spigot are used, but even if that were true, how would I compile classes if other classes contain errors. I think there is a really simple solution and I just don't get it.
There is patches for craftbukkit and then the repo is cloned to spigot and thn spigot applies more patches
thats funny people here told me its not ideal to have kits , cosmetics data on database (mysql)..
yeah, but spigot patches don't patch errors in nms code afaik.
Are in the end just modified nms files compiled into class files and combined with other vanilla jar class files or does spigot compile all of the decompiled classes into a jar?
Not all classes get decompiled or used. Classes not used get put into an mc jar that spigot depends on and is later shaded in.
ok
the classes that are modified for whatever reason, if those contain decomp errors they need to be fixed
but the classes that spigot doesn't patch are not processed as sources, so they aren't recompiled
so I think I got it, craftbukkit&spigot decompiles classes, applies patches to the files they need (also fixes every error in those files), then only this files are used in recompilation, and are combined with vanilla jar. so in short: not the whole jar is reconstructed, thus classes that are get decompiled but are not used in any way don't need to get fixed?
correct
could someone help me figure out how to downgrade my spigot from 1.21 to 1.20.6 in my pom.xml?
thought this would do it
keep in mind you can't downgrade your server, if the world was generated in 1.21 you can't run it in an older version
oh thats fine, im just using a library that has a conflict with 1.21
and i wanna finish making this while they figure that out
cause i dont have the knowledge to work around it unfortunately
Idk who said this. But if it was me i would use the lobby server to hold master file. Have mysql hold it as a blob. When the file in db doesnt match lobby, upload lobby file to db. All other servers download file from db if they dont have it or when their file dont match.
This way we dont need a bunch of db connections all the time for the data
You can store literal files in mysql called blobs
Syntax error, insert "VariableDeclaratorId" to complete EnhancedForStatementHeaderInit
what the fuck is this bro ๐ญ it says that when i try to loop thru a hashmap
im so braindead bro
javac error messages are very good (not)
As anyone ever used https://github.com/Splodgebox/armorequip ?
ArmorEquipEvent and ArmorUnequipEvent for SpigotAPI - Splodgebox/armorequip
I have it in my code but it will not trigger at all
what do you have in your code? and how exactly did you "use it"?
private Main main;
public Growth (Main main) {
this.main = main;
}
@EventHandler
public void onArmorApply(ArmorEquipEvent event) {
Player player = event.getPlayer();
ItemStack itemStack = event.getItemStack();
player.sendMessage("You have successfully applied " + itemStack.getType());
}
@EventHandler
public void onArmorRemove(ArmorUnequipEvent event) {
Player player = event.getPlayer();
ItemStack itemStack = event.getItemStack();
player.sendMessage("You have successfully removed " + itemStack.getType());
}```
I put what he has added the listener to my main onEnable so its getting called
and will loead but when I Equip the Armor no message is sent
And yes I have it in my maven
The api likely uses other events to call the custom armor events
But it doesnโt tell you to register them anywhere
Yeah I just noticed that
use something like alex's armor equip lib instead
@tender shard merge https://github.com/mfnalex/ArmorEquipEvent/pull/5
So I am using that as we speak but for some reason its not logging the first Armour peace I put on
how do you put it on
Then when I put a second peace on it says the first peace name
Click it then place in invin slot
might be a bug
Done right click too same thing
alex should be around tomorrow to debug it and update it
I meant a spigot PR
dont care didnt ask
Rude
did you even tie your own tie
No
skill issue, i could tie a tie when i was in y3
Ok
the person above coll also says it seems to not work so you get to debug stuff
what's the issue? I thought the issue was related to the other event
they said theyre using it as they spoke and it wouldnt log the first armor, so put 1 on and nothing then put the 2nd on and it would log info about the 1st call
can't help without code
@elder dune send ur code
if it shows the "last" armor, it sounds like they're using getOldArmorPiece() instead of getNewArmorPiece()
@tender shard i've dmed you the code
he asked for code, i sent code
please just send it here
send it here
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I don't understand the purpose of that code. Why re you adding maxHealth when people unqeuip stuff?
Also why are you looping over the normal equipment slots? You should only care about getNewArmorPiece() and getOldArmorPiece()
if newArmorPiece is your item, add to max health.
if newArmorPiece is null and oldArmorPiece is your item, substract from maxHealth
its currently in the process of being made not final, just wanted the event to work first before making the rest of the code fully optimized
not going to do that since its not how its intended
on ArmorEquipEvent
if newArmorPiece is MyObject
maxHealth = maxHealth + extraConfigHealth
if oldArmorPiece is MyObject
maxHealth = maxHealth - extraConfigHealth
just wanted to know why the event won't fire when i apply the armor first time but it will register when i apply the second armor
show your whole event listener code
https://pastebin.com/uWABxqtR simplified the health logic since its not actually related to the issue
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
here is a demo of the issue
Well your code only runs if they already have any armor equipped - so ofc it wonโt run if they equip the first item
to make things more clear
Line 6 in your paste is the issue
Canโt ya just apply a max health attribute to the item
Tldr the event does fire for the first item, youโre just not doing anything in the event.
The event is called BEFORE the armor is equipped (as itโs cancellable). Simply check getNewArmorPiece instead of looping over already equipped armor
its a custom enchant plugin, i've already done all the backend work for applying stats to the enchants and armor these are just management files to do different logic with each enchant
I mean like I said
When you apply the enchantment also apply an attribute
Then the game will handle the rest
this really isn't the issue all the health logic works just fine
removed the code you said and it still doesn't work
as I said, just do sth like this
for example
void onEquip(ArmorEquipEvent event) {
if(isMyCustomItem(event.getNewArmorPiece())) {
// My custom item was equipped - raise max health
event.getPlayer().setMaxHealth(event.getPlayer().getMaxHealth() + 10); // Should use attributes instead btw
}
// Do not use else if, because a player could exchange your custom item with another custom item, so we add/remove max health separately
if(isMyCustomItem(event.getOldArmorPiece())) {
// My custom item was unequpped - lower max health
event.getPlayer().setMaxHealth(event.getPlayer().getMaxHealth() - 10);
}
}
boolean isMyCustomItem(ItemSTack item) {
if(item == null) return false;
// Check if item is my custom item
if(...) return true;
return false;
}
I don't know why you're checkig the already existing items. Also you're completely ignoring the result of getNewArmorPiece(), which is the only thing you'd care about
also you can easily check that the event fires correctly, even on first time
void onEquip(ArmorEquipEvent event) {
Bukkit.getLogger().info("ArmorEquipEvent called");
}
Hey,
I am currently working on a custom item system. And i had to rework some of the code due to the 1.21 update and now i run into the issue where i get the item correctly and in survival everything seems to works fine but when i am in creative and open my inventory or interact in any way with the item ALL attributes i coded on the item are just gone out of nowhere.
My attribute code:
@Override
default HashMap<Class<?>,InitUpdateMethod> getInitUpdateMethods() {
HashMap<Class<?>,InitUpdateMethod> initUpdateMethods = ClickHitDamageItem.super.getInitUpdateMethods();
initUpdateMethods.put(HitWeaponItem.class, itemStack -> {
itemStack.editMeta(meta -> {
meta.addAttributeModifier(
Attribute.GENERIC_ATTACK_DAMAGE,
new AttributeModifier(
new NamespacedKey(CatalyaRPG.getInstance(), "catalya_attribute_attack_damage"),
damage(),
AttributeModifier.Operation.ADD_NUMBER,
EquipmentSlotGroup.HAND
)
);
});
return itemStack;
});
return initUpdateMethods;
}
This is btw not every attribute i am adding discord didnt let me send the whole thing bit its basically the same for every attribute.
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/inventory/InventoryCreativeEvent.html
Use for creative specific actions, inventory stuff bugs out creative <-> survival
declaration: package: org.bukkit.event.inventory, class: InventoryCreativeEvent
no no
i didnt do anything inside the creative inventory
its just like that
it just wipes the attribute data
when i open the inventory or interact with it
and that only inside creative mode
in survival it seems fine
thats why i am so confused
I assume it's the same issue being creative is just buggy
so there is no fix for that?
BTW with normal weapons from the creative inventory this doesn't happen
There probably is, best way I can think of is just disallowing any sort of manipulation when it comes to your item(s) in creative mode
Creative really likes to mess with things not so vanilla
but i don't know how this even is possible or where its coming from
i don't know if its the opening of the creative inv or the loading of the vanilla items etc yk?
All I know is that creative likes to fck with anything inventory/itemstack related
You could wait for someone who actually knows the proper workaround or wtv it may be, best thing that comes to my mind was just this
i mean this wouldn't effect the overall gameplay on the server to much
but for staff its complete ass
alright
but thanks for trying to help
i appreciate that a lot
Staff need your items for what reason though?
i mean those items are obtainable and craftable items
i am basically creating a whole new item system
Just make it known that creative will fck their items up or as I said just dont even allow them to touch in creative I suppose
I feel like there would be an actual workaround, I'm just unaware of it
is there any good nick plugin that supports 1.8 or higher?
the touching in creative would be already to late lol
as i said the items get fu**ed when i just open the creative inv
im looking for one that changes nametag above head, tablist, and chat
then i will just wait i guess
essentials doesnt work and ive been looking for one for years
thank you very much for trying to help :)
Perhaps cancel the inventory open event if their inventory contains your items && are in creative mode?
Sure!
that could be smart yea
i will try that
thanks
No worries! Good luck finding an answer to that haha I never could
i could make one but im not sure if it would be very good
I mean I'd suggest that
You get the bonus of being able to build it whatever way you like with whatever features you want
Only issue being: diy I suppose
When the player switches to creative there is an event for when their gamemode switches, you can save their survival inventory or cache it and then clear it. When they switch back put their items back. Should preserve all the item related things you are having issues with.
that this idea didn't came to my mind fu**ing dissapoints me in myself
that is a great idea thank you!

it may be
essentials interfering with the nick plugins i use
but i have essentials nick disabled in config
EssentialsX
doesnt change nametag
Right, i think libdisguises messes with nametags.
Well does more then that as well lol
But i think it might accomplish what you are wanting.
i think its 1.12 up
As for making a plugin you would need to mess with packets for that if i remember right
yeah
I suppose you could try this. Make the name tag invisible and mount a display entity instead lol
i was thinking about that
thats what some servers do
Since they are entities yes
im working on a kitpvp server
You can use scoreboard to make nametags invisible
So with the text entity option no need for messing with packets and it would be more versatile
never too late to start ๐
Like I said here:
cause
i messed around with so many plugins
for the past 6 hours
and literally none change my name
It doesnt need to be good. Just needs to work. Later on you can have someone else fix it lol
I'm just trying to encourage you to code haha
This is normal with running a server. But if you are low budget and dont want to be stuck with what is available you are going to have to learn to make your own stuff
Good news it only takes like 3 months to become somewhat good with java
You wont be the best, but you will be able to make stuff regardless
I'd say that's true if you commit to java and java only for that three months, if you try to split focus ie: start on a whole new api before learning the language, that will just make your habits bad as well as not learning as much as you should
how would i view my own nametag accurately
because im on lunar client rn and it says my name is still the same
and i got no one to join me
Is there a FallingBlockLandEventโฆ that Iโm not seeing?
Seems that EntityChangeBlockEvent is my answer.
guys i have a question
if i want to create a golden head and i want the head color gold, how i can do that?
Find a skull value of the skull you wish to create and in 1.18+ use this
the reflection is just normal Bukkit.setOwnerProfile
And use this
ItemStack customHead = new ItemStack(Material.PLAYER_HEAD);
SkullMeta skullMeta = (SkullMeta) customHead.getItemMeta();
skullMeta.setOwner("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTA1YTJjYWI4YjY4ZWE1N2UzYWY5OTJhMzZlNDdjOGZmOWFhODdjYzg3NzYyODE5NjZmOGMzY2YzMWEzOCJ9fX0=");
customHead.setItemMeta(skullMeta);
how i can make custom texture to the player head, this dont work, help
Or if you wanna support multiversion, check out the full SkullSupplier class there
Use what I just sent
This
ok
i need to install the plugin first then use this value?
Use this value in the as the "url"
` ItemStack customHead = new ItemStack(Material.PLAYER_HEAD);
SkullMeta skullMeta = (SkullMeta) customHead.getItemMeta();
skullMeta.setOwner("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGFiZDcwM2U1YjhjODhkNGIxZmNmYTk0YTkzNmEwZDZhNGY2YWJhNDQ1Njk2NjNkMzM5MWQ0ODgzMjIzYzUifX19=");
customHead.setItemMeta(skullMeta);`
are this code work? not the texture, are the code has error, because this on 1.20.5+
Then use the reflection version
Read
What
I
Sent
In
Github
public ItemStack createSkull() {
ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short)3);
SkullMeta headMeta = (SkullMeta) head.getItemMeta();
GameProfile profile = new GameProfile(UUID.randomUUID(), "none");
profile.getProperties().put("textures", new Property("textures", "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGFiZDcwM2U1YjhjODhkNGIxZmNmYTk0YTkzNmEwZDZhNGY2YWJhNDQ1Njk2NjNkMzM5MWQ0ODgzMjIzYzUifX19"));
try {
Field profileField = headMeta.getClass().getDeclaredField("profile");
profileField.setAccessible(true);
profileField.set(headMeta, profile);
} catch (Exception e) {
throw new RuntimeException(e);
}
head.setItemMeta(headMeta);
return head;
}
like this right?
@grim hound
Ye
Iโm trying to find an event that fires when a falling block landsโฆ I thought EntityChangeBlockEvent would do it but it appears not toโฆ any pointers here?
Np
What's wrong with it?
I think that block changes cannot be done async
Isn't it impossible to modify words async
I'd find a way 100%
then i will change that
running a custom fork anyway
lol
nop
This makes me wanna ?whereami so hard
spigot/paper fork
nuh uh
why are you hard
he always is
I wanna ?whereami even harder now that you said
Oh wait
Especially when ZBLL is in chat
haha
yup
Anyway, Minestom is op
Their source is just so damn well-written
Like I'm obssesed on optimization
And I have (almost) nothing on them
Very impressively written
that's the reason i need this
I'd like use Unsafe
Any modifications become no problem
Java's src as well
It doesnโt fire when a falling block lands. Idk if thatโs โwrongโ, but itโs not what Iโm looking for.
I think I found it nowโฆ EntityRemoveEvent
Are you sure?
Yes
Also just tested EntityRemoveEvent and got my debug message
So I think Iโm good to go, for my purposes anyway
because i'm making a fork lol
wsg
Hmmโฆ this isnโt quite getting to what Iโd hoped. EntityRemoveEvent letโs me know that the falling block has landed, but what Iโd actually like is to know when a block is created by a falling block landing. Seems I could pull this info from the event but if thereโs an event similar to BlockPlaceEvent which fires when the falling block turns from an entity into a block that would be more what Iโm looking for.
Please tag me if anyone has an answer, calling it a night and by morning I assume this will be a bit buried. Thanks!
I think this was https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityChangeBlockEvent.html ?
declaration: package: org.bukkit.event.entity, class: EntityChangeBlockEvent
How can I open the Blockinventory from a Stonecutter?
If you have the block, you should be able to do smth like #getInventory If I'm not mistaken
Is it possible to use JavaPlugin#saveResource to save a whole folder?
please don't link me https://tryitands.ee/
Well probably yes, but for that you'd need to know the contents of the folder - so it's not a single saveResource call I reckon
?stash Instead I shall link you the stash \s
Oh well, I'm trying to create a PresetsManager that loads the presets (all files inside my resource folder "inventories") only if that folder is present. Since it's going to be open source, I will exclude that folder from git
Do I have to statically name all files inside my resource folder?
Yeah, safeResource can only store a single file.
You could use the protection domain to query the contents of the jar and work yourself backwards from it - but that's a bit overkill and there exist simpler solutions I am not exactly knowledgeable about so I can only present the overkill one.
Doing it statically isn't the approach I'd go with though, even if it is rather easy to pull off
Yeah, it is... However, I'd like to keep it clean and don't really want to "reinvent the wheel." Maybe there's some kind of better
way
(i.e. using MyPlugin.class.getProtectionDomain().getCodeSource().getLocation() - then extracting the jar from that [you'll probably need to fiddle a bit with that, I don't know how to exactly do that either] and throwing it into a ZipInputStream and then iterating over the entries to get what you want)
Well I reckon you can use MyPlugin.class.getResourceAsStream("directory/") to get some kind of directory listing separated by newlines; that being said there is a catch (can't recall what it is though) so I am not too sure about this
I'm looking at Oraxen (Open-Source), which did the same thing
Well... they're using hardcoded names too haha
public ConfigsManager(JavaPlugin plugin) {
this.plugin = plugin;
defaultMechanics = extractDefault("mechanics.yml");
defaultSettings = extractDefault("settings.yml");
defaultFont = extractDefault("font.yml");
defaultSound = extractDefault("sound.yml");
defaultLanguage = extractDefault("languages/english.yml");
defaultHud = extractDefault("hud.yml");
}```
https://github.com/oraxen/oraxen/blob/master/core/src/main/java/io/th0rgal/oraxen/config/ConfigsManager.java
Well I mean, I was completely expecting that you wanted to extract a directory with hundreds of files within it
(4/5 files)
lmao
yeah then there is 0 reason to over-engineer that. All solutions for extracting a directory will be larger than solutions for extracting 5 files
haha, thank you so much for your help ๐
Oraxens code isn't the best
please, enlighten me
This is what I've achieved so far:
https://paste.md-5.net/exizatuxiz.cpp
I believe that was an in general
how??
preparedstatement::setblob
it make no sense to save entire file in databaes..
can i just use mongodb for example?
IM NOT THE ONE WHO CAME UP WITH IT