#help-development
1 messages · Page 859 of 1
Then if you have a config variable with the FileConfiguration don't forget to set it
if your settings value into config don't you have to save it and then reload? Maybe i have done it all time wrongly
if you want to load a changed file, then saving what you have in memory is pointless because you'd only load what you have just saved.
What if I made an implementation of configuration or whatever you implement that uses nbt
you NEVER want to load a file that you have just saved half a second ago
it never makes any sense
Is there a way to turn off the light of redstone?
Isn't light client sided
No
I don't think so
Oh weird i have had problems with data not being saved if i just reload the file. Instead of first saving and them reload
It isn't? Damn
yes ofc data isn't saved if you load the file
I just want to make something like optimization, when redstone is turned on it has light so with a lot of mechanisms it overload the server
if you first save and then load it again, then why do you load it at all? if you just saved it anyway, you already have all the data you need
So is there a way to turn off the redstone light?
right, thanks mfalex
You’d have to do some crazy stuff with internals me thinks
In addition, it is quite possible that this will not optimize but will only worsen the situation...
Algum brasileiro aqui pode me ajudar ?
what?
I need some help, when I try to add one of my plugins inside my external library and try to call some method of that plugin that I added, it ends up causing this error: package com.yorkans.factions does not exist
I dont understand so much english xD
are you using maven or gradle?
maven
did you add the other plugin as <dependency> to your pom?
that plugin is one that i created, and i cannot do a dependency, or i dont know how
Imagine this is your first plugin: group de.jeff_media, artifactId Drop2InventoryPlus.
Now you run mvn install on that project in the maven tab. Now, you can add it as dependency to your other project:
<dependency>
<groupId>de.jeff_media</groupId>
<artifactId>Drop2InventoryPlus</groupid>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
mvn install basically just makes your project available to other projects
really ?
yes
i'll try
I just wonder what would he do if you have replied "no"
Hi, I'm very new to learning to make plugins (even tho I have a bit of experience with Java) and tried for quite some time now to create a simple 'Hello World' Plugin for a Bukkit server (I know this here is a Spigot Discord, but I couldn't find a bukkit Discord and really have no clue to solve my issue). This is the Code:
import org.bukkit.plugin.java.JavaPlugin;
public class HalloWeltPlugin extends JavaPlugin {
public void onEnable() {
this.getLogger().info("Hallo Welt");
}
public void onDisable() {
}
}
According to the Compiler there are Symbols he can't decipher in line 1 (It points at the dot between java.JavaPlugin), in line 3 (there it points at the J in JavaPlugin) and in line 5 (there it points at the dot between this.getLogger() ). I tried a bunch of stuff but I just can't figure out how to solve it. I hoped someone here could give me a hint in the right direction.
are oyu using maven or gradle?
I think maven, at least there are maven jars in my servers library, and no gradle jars
So... Does it really work?! I always use System.out.println instead of "this.getLogger().info"...
😂
sout is bad because it doesn't identify your plugin
I don't think so
Just FYI Bukkit died years ago. Bukkit will celebrate it's 10th death-year in august
ok I suggest you to read my basic tutorial on how to setup IJ and maven for a simple plugin: https://blog.jeff-media.com/how-to-create-your-first-minecraft-plugin-using-the-spigot-api-and-maven/
Thank you : )
You should use some logger function. Although I personally prefer the SLF4J logger over the JUL logger, but that [the JUL logger] is about as good
np! if you follow that step by step, you should basically end up with a working hello world plugin, then you can just expand that.
Maybe it's better just to use minecraft plugin to intelij idea for people who is new to plugins?
using IJ's build system will just hinder you when you need anything more than building a jar
i dont think so, the pom it generates is cursed and you won't understand what those options do
for example it adds the shade plugin in a totally outdated version, and even sets createDependencyReducedPom to false, why?
imho it's better to copy/paste my example plugin and read all the comments to understand what those options do
createDependencyReducedPom is only really useful for APIs that have the shaded jar uploaded as a separate artifact
Ok, you're right
ofc once one knows those options, sure the IJ plugin is quicker. but to get started I'd rather write it from scratch once
back to the eclipse days
that is true but there also is 0 advantage in diabling the reduced pom
it's just an additional setting that might cause problems later and doesnt give any advantage now
Actually there is in this very specific case
Outside of the specific case that I just mentioned, there is no real use
what's the advantage of disabling it?
I do it in order to compile https://stianloader.org/maven/de/geolykt/starloader/launcher-sponge/4.0.0-a20240110/ for example
why wouldnt it compile with dependency reduced enabled?
just saw, mc-dev merged my PR to remove disabling dep reduced by default https://github.com/minecraft-dev/MinecraftDev/pull/2116
Because then you'd no be able to consume transitive artifacts by default.
It only removes dependencied that are included in the artifact. Why would someone need them twice?
So either you depend on the shaded artifact (which would make a great time for version conflicts) or depend on all the transitive deps manually - not great either.
Exactly. The dependenc reduced pom also only is for the shaded artifact. If you upload both, the normal pom is still there for the unshaded artifact
There is only really a single pom regardless of the classifier of the shaded artifact
You seem to be confused with what an artifact is in maven - frankly, it can be anything. In this case the shaded artifact is just a file and shouldn't be confused with being a separate addressable project. The shaded classifier is identical to the sources or javadoc jars (in function from the eyes of a maven resolver).
Also the dependency-reduced pom is much more than a simple file. For as long as it is uploaded it will be an additional file (for whatever reason), but once installed on a maven repository it will replace the original pom
That worked, thank you so much!
np
yeah I got that wrong, but still when I deploy both the shaded and unshaded artifact and have dependencyReducedPom enabled, the deployed pom still includes all the dependencies, so I don't really understand how not disabling dependency reduced should create any issues?
uh I'll look it up in a sec but I don't actually think that it will
How do I check if a "MOVE_TO_OTHER_INVENTORY" moved the item or if the inventory was full and no action happened
You’d probably have to check if the other inventory can accept it
https://repo.jeff-media.com/#/public/com/jeff-media/example-dependency-reduced/1.0
the pom includes snakeyaml with the original compile scope even though createDependencyReduced is true
Via looking for matching stacks that are not full or empty slots
Dang it
although if the dependency reduced pom isn't getting deployed (which it isnt) then I really don't understand what its purpose is lol
I'll test it in a bit, don't worry. I have botched a few releases lately I just realized so there is a good reason to reupload jars regardless :)
i always thought that when deploying both the shaded and unshaded artifact, there'd be the reduced pom for the shaded artifact and the original pom for the unshaded artifact, but it seems like the reduced pom isn't deployed at all, so I really wonder what it's purpose is supposed to be then
from what I just found out though, the deployed pom is always the original pom, no matter whether dependencyReduced is enabled or not
https://stianloader.org/maven/org/stianloader/launcher-micromixin/4.0.0-a20240113/launcher-micromixin-4.0.0-a20240113.pom that is not the case for me, strangely enough. I wonder why that is the case?
Does anyone have a recommendation for an NPC api/library which supports 1.20.4?
citizens
depends which light. The redstone itself changing is client side as that is just a change in the state of the redstone itself. As for the light it illuminates however that is server sided
and here's the deployed version (the same, viewable in browser) https://repo.jeff-media.com/public/com/jeff-media/example-dependency-reduced/1.0/example-dependency-reduced-1.0.pom
Could it be my <shadedClassifierName>shaded</shadedClassifierName>?
maybe, i added that so that it deploys both .jars
without that it'd only upload the shaded .jar
oh wait
yours
Yeah we both have the attached thingy
I also used a shadedClassifierName before (i used with-dependencies) and it was the same result
really weird lol
23:52:37 [INFO] Installing /var/lib/jenkins/workspace/launcher-micromixin/dependency-reduced-pom.xml to /var/lib/jenkins/.m2/repository/org/stianloader/launcher-micromixin/4.0.0/launcher-micromixin-4.0.0.pom
The maven-install-plugin deploys the dependency-reduced-pom for me (see https://stianloader.org/jenkins/job/launcher-micromixin/13/console)
that also happens when you set a shaded classifier name?
https://repo.jeff-media.com/#/public/com/jeff-media/example-dependency-reduced/1.1 i just deployed it again with a shadedClassifierName and it still only deploys the normal pom
have only tested with it
Yeah I was about to say - what even is the point of the dependency-reduced pom if it doesn't show up in your repo?
Hm, I use maven-install-plugin 2.4 which is like age-old. Could be the issue? I'll see if I can update it
https://repo.jeff-media.com/public/com/jeff-media/jefflib/jefflib/13.0.4/jefflib-13.0.4.pom
it also seems to upload the normal pom for all my other stuff (that all ahve dependencyReduced enabled). not just for this example project
but then, yeah, what's the point of that file if it's neither installed nor deployed
i'm using the default maven-install-plugin, 3.1.1 as of my mvn version
Me too, but I'd assume fedora is a bit outdated
Or well for some reason my CI server uses maven 3.8.6 which comes with version 2.4 while my system uses maven 3.9.1 which comes wtih version 3.1.0
Ah, that is because my CI server is on fedora 38 for whatever reason. Time to look how to update that.
well that starts of great
🥲
Well for some reason I both have Adoptium and Zulu as installed repositories. I guess I'll just ditch the former (which I don't even remember having downloaded).
since debian finally added adopt 17 in the official repo, I didnt have to mess with any repos for java anymore
I believe I have the azul zulu repo for Java 6
Hey I'm currently trying to track a whether a player is afk or not, that works fine so far, but when a player is afk and another player moves the player via pushing him, the playermoveevent triggers and tells the server the player isnt afk anymore, any suggestions?
💀
You could mess with disabling pushing for the afk player
Is there a boat move event?
Or look for camera movement to consider them not afk
Yeah, for whatever ungodly reason people wanted a Java 6 port for one of my projects. Later on they wanted Java 5 but I said no until they can provide me an adequate JDK for that
declaration: package: org.bukkit.event.vehicle, class: VehicleMoveEvent
Oh thanks
how do i track a cameramovement?
is there a specific event?
most reliable way is to listen to incoming ServerboundPlayerInputPacket and cnosider everything else to not be an actual movement
does this packet only register a players input?
Yes
Lol wat
Please tell me the project is from 10 years ago
Well guess twice: It's the legacy modding community
Pretty sure you can get literally anything to run java 8
yeah it's what the client sends when a player moves (or jumps)
Java 9 is where the issues start
And people weren’t requesting java 6 support in modern times
there is probably no nice and easy event for this and i need protocollib right?
Nah, my project is from two years ago
yeah protocollib would be easiest
okay
It's my wonderful micromixin library
java 6 = 2006 = i was in 6th grade :X
At least I was born at that point in time
Also don't worry, it uses MRJ to make use of newer Java features where appropriate (why the hell did Java 6 not have Throwable#addSuppressed?)
Regenerating griefed chunks after specific period of time
Cause it is used from try with resources which java 6 didn't have
Ah, makes sense though
In the end I made my own very horrifying version of addSuppressed
It's really just cosmetic ain't it?
Yeah, thankfully
You could just throw the original exception without it?
It also includes a line telling the user to update their java - twice for good measure
Man why doesn’t the Bukkit api work with java 6
I could also do a netty and say No further information. Update your java lol
Encounter an unexpected error: It is not 2006
and then craftbukkit even has the audacity to require java 17! what a shitty software!
Ikr
@tender shard yep, same thing even with an updated version of maven. Wonders of technology - you don't even understand them
I'd hesitate a guess that it isn't me, it's you somehow.
that's so cursed. I'm on maven 3.9.5 btw on mac. -but I doubt that makes a difference - would be very weird
that would be hilarious if it uses a different file for linux andm ac
but then why does this happen for all my other libraries as well, both on mac and windows and over at least 3 different maven versions? o0
Ye new maven broke / changed behaviour with dependency reduced pom and shaded artifact attached
That's why bukkit also has dependency reduced pom false now
It uses the dependency reduced pom for the main artifact, which makes no sense given the main artifact isn't shaded
Should have used gradle
alex will convert to gradle
I assume it's a bug but I'm not sure
how can the maven version itself even have sth to do with this, it's the shade plugin that's solely reponsible for it, isnt it?
It isn't a bug from what I'd say
I mean shade plugin I think
But it is behaviour that isn't great
I think it is a bug cause it makes no sense otherwise
md if i were to learn gradle plugins properly would you make a special source plugin remapper offical
It has something to do with how default settings are set up under maven's XML ast
I won't make it, you can
gradle isn't even able to produce a proper pom.xml at all though
Sure
No conditional setting defaults exist under maven that I am aware of
How come so? I haven't seen any grave issues with it yet as long as you know what you are doing
gradle's publish-maven plugin sets all dependencies that it decides to include in the pom to runtime scope iirc
Well it uses compile for everything
im using protocollib and i'm listening to for a packet, depending on the packet call a custom event. Why do i get an error saying that i may only call my custom event synchronously even tho im not explicitly calling it async? Does calling an event in a packetlistener make it async or something?
Probably
Yes
However it does make sense once you know how a maven resolver works and these are the correct scopes
compile only is provided
implementation -> runtime makes little sense imho
You need to make your event Async (true to super constructor)
By default packet listeners are async
not for me. I have added those comments after I tested all those scopes
Well you wouldn't want it on the compile-time classpath of API consumers?
is there a detailed tutorial for the use of the event api, so i can look into this further?
Maven 3X sadly doesn't have a whole lot of scopes - but thankfully maven 4 will change that
if it's implementation and I publish the shaded artifact, I don't want it to appear in the pom at all
?nms for me
and if I use api shouldn't it be provided?
oh yeah, it doesn't know about dependency-reduced poms or stuff
api stuff is still on the runtime classpath
it uses some gradle-only file for this stuff IIRC, but ignores it for the pom
well when I tried it, all api dependencies ended up as compile in the generated pom
on the other hand, gradle changes with every version, so I guess it might be different between gradle 8.3 and 9 and 7.X
i dont remember on which version I tested it but probably 9.0 or 8.3
Yeah - I have to agree that it isn't great, but I cannot really blame gradle for that as it just uses the best equivalent it can find
yeah there's probably a gradle plugin that lets one specify what it should use for the pom for each dependency
why would it need to produce one?
ultimately dependencies only need to be in the manifest
pom is handy I suppose if you want transitive dependencies
yes, for this
anyway, i guess the proper way to get a working dependency-reduced pom for the shaded artifact, and a proper original pom for the unshaded artifact, is to set shadedArtifactId in the shade plugin instead of using a classifier
then one'd just have one artifact for the shaded version and one for the original one with their respective poms
im currently trying to find the packet do you know where i can find the protocollib's name?
I can only tell you the proper (NMS) name: ServerboundPlayerInputPacket
the name on wiki.vg is Set Player Position
protocollib will be Play.Client.Something
Play.Client.POSITION
and Play.Client.POSITION_LOOK
POSITION is actually moving around and POSITION_LOOK is moving the head
@inner mulch
why can't protocollib just use the mojang package names 🥲
thanks
Yeah plib has weird names
Probably because they are super old
I guess before mojmap you just had to make it up
yeah true
but I wonder why there's no page that links all those names together
Set Player Position vs Play.Client.POSITION vs ServerboundPlayerInputPacket
totally different
im currently listening to Play.Client.POSITION and it is fired without the player moving?
is this a good way to handle nms packet (to improve readability with your project):
i feel like its really nice
literally just this to send a hologram:
Hey everyone. I am trying to create a library with some cool functions so i dont have to copy them over everytime i am creating a new plugin
I currently did everything, (but then how i normally create a library) but it gives big time errors
So i was wondering. is there anyone here who created a library themselvs or knows of a library which i can see the source code of just so i can see how the gradle stuff is done for it
That would greatly help me if that was possible :)
new PacketAdapter(CityBuildCore.getInstance(), ListenerPriority.NORMAL, PacketType.Play.Client.POSITION) {
@Override
public void onPacketReceiving(PacketEvent event) {
if (event.getPacketType() == PacketType.Play.Client.POSITION) {
//code
}
}
}
);```
hm maybe it's not the right one? what I used to do to find out the protocollib name is to just print out ALL received packets's classes
oh thats smart
you could e.g. listen to PlayerMoveEvent and print "player moved", then also print out all incoming packet class names, then check your log which packets appear shortly before "player moved"
and that should be the correct one
might also be that the POSITION packet is sent from time to time without them moving, in those cases the xxA and zzA fields probably both will be 0
oh that could be the reason
i guess i would need to check for changes too
seems like both packets use the absolute coords and not just the moved distance
im currently checking and it seems like the POSITION packet is called every now and then
yeah probably. you can probably just check whether the packet's X and Z (should always be getDoubles().get(0) and .get(2)) are the same as the player#s current X and Z, if yes they didnt move
if will try that
although I'm only guessing all of this, I have no idea if any of this is true lol
just as general info on wiki vg
in this case the data types have to align with the protocollib ones
but wiki vg is based on the data type in the actual buffer
so in some cases wiki vg might claim something to be a byte whilst minecraft inside nms represents it with an int
so sometimes people run into issues and get confused, just know wiki vg isn’t exactly documenting NMS
hi, i have kinda a complex problem with packets. idk where else to turn to. i run a server with a magic plugin that creates a good amount of particles. this used to be manageable, but at some point they got unmanageable at higher player counts. the type of lag i see is not one that spark can easily track; the tps doesn't go down and the server thread seems to be in good health (see example). instead what happens is the ping gets very high, people start 'teleporting' around, and eventually some of them are kicked due to timeout (but not all) and the server never crashes, but other plugins like discordsrv get bogged down and miss their scheduled tasks that are on different threads. someone called this network overload, and after some testing, i confirmed it is worsened by more of these particles. however this wasn't always a problem, and the magic plugin hasn't changed. i think another plugin is duplicating/copying packets or something and overloading the network, but i'm at a loss for how to track these particle packets to find the source of the problem. i was wondering if there's a way to track them. i have protocollib and i figured another plugin is messing with that, but when i debugged all the packet listeners, none of them had to do with particles. any help would be appreciated
is there a good way to track all packets
specifically worldparticles packets
bc i think there's a plugin doing weird shit with them and overloading my network
yeah im not reading ur wssay
i dont want to self advertise
so
but there’s alternatives to protoxollib
just so you know
the 'essay' is there so ppl would respond with things i didn't already know, no offense
this was my tldr
in general
yes? theres libraries that do that
such as?
anyone know any decent jda modal util thing
how would i track packets with packetevents
like if a plugin were somehow manipulating packets
would i be able to determine which
you mean those "forms" in discord?
yeah those are modals
ya
what's wrong with JDA's builtin stuff?
its long
i have 15 lines for a 4 entry modal
and thats with it going through a small util method
hm idk I always only use JDA 5
im also using jda 5
the example in their javadocs doesn't look too bad though?
okay that’s a different question than the tldr
its long and i dont want like 10 lines for a 2 entry modal
it was in the 'essay' you didn't want to read
if they’re not using packetevents then you can’t specifically check what changes they made
the reason i want to track packets is bc i think a plugin is manipulating them and causing overload
find out
which plugin itnis
and then we can move on and look intobwhy
thats the best approach
this is kind of an
?xy
if you find out which packet plugin
is causing this load
we can look intonit
and move on
but if you want to do it your own way go ahead
@aztl in the worst case you could use ignite and mixin into the relevant packet classes and see if there is suspicious activity from there. Injecting into the netty pipeline would be another way to go about this. Regardless this is a rather complicated problem as you stated earlier and I suppose I am of not much better help (especially given that such diagnostics will probably take a while), but those would be the ideas I'd have from the first go.
Ah bruh they seriously left
Well - their loss
So right now I have a map that does something and uses a class as a key. However I ran into a bit of an issue. Because the craft classes aren't in this map all of the keys will return null. e.g. org.bukkit.craftbukkit.v1_20_R3.inventory.CraftShapedRecipe inherits, but isn't org.bukkit.inventory.ShapedRecipe
Isn't that where generics can come in?
is there any way to get around this or should I just make my own data structure for this
not super useful here
it's the key so how would I express that type in the key
this.functions = new HashMap<>();
functions.put(ShapedRecipe.class, new ShapedUncrafter());
functions.put(ShapelessRecipe.class, new ShapelessUncrafter());
It’s possible to extract the Bukkit interface from the impl class
guh that's annoying my own data structure it is ig I wonder if I can actually get O(1) probably not huh
¯_(ツ)_/¯
prolly just an ArrayList with a loop then of Class#isAssignable
You might get away getting the interfaces that a class implements but that is hacky his grandfather (as some Germans would say 😉)
You don’t want to use Class.getInterfaces?
I mean I could
but then I have to loop over every interface anyway
isAssignable is probably just as effective here
Or just assume it is the length of 1
that's dangerous with CB
Pft
Me omw to add more interfaces to the recipe impls
But why?
Fun
ShapedRecipe already extends CraftingRecipe
I mean I just realized this wouldn't even be very good because I'd need to do a map#get call on every interface
Yes but that isn’t the impl
CraftShapedRecipe or whatever should only implement ShapedRecipe
Yeah, but it shouldn't get the super-interfaces
mmmmmm
well not every recipe is guarenteed to be Craft though
that's the thing
so either way its to map calls ig
is hacky his grandfather
erm what? 😄
"X sein Großvater" - never heard that?
Ugh it is kinda like ItemStack
Where there is a Bukkit and CraftBukkit version
Blah
never lol
Well now you did
thanks!
Probably is an Odenwald thing then
@young knoll I've decided I'm kinda gonna use your idea. On the first run I'm going to iterate and find it's bukkit type and then cheat and add it to the map after it's run once so it never has to do a calculation for that type again
Anyways use my genius "ClassWrapper" API to cache isAssignableFrom on the fly for maximum performance!
Well probably a bit overkill since you don't want to compute the frames of classes
Convert Pitch and Yaw to Quaternion
Sorry, I might be wrong, but I haven't found weakhashset that acts like queues, but there might be some weak queues or weak arraylists in java or other utils.
Oh tysm! It work!
Suppose you are planning the design of a command framework system. And you have to think about how to structure the classes taking into account that there may be commands that have no arguments and commands that contain sub-commands. But arriving at a final result where you would have to be able to support commands in tree format, how would you design it?
Similar to bukkit's ConfigurationSection
Make it so we could create an instance of a VeranoCommand (or whatever name you wish), then we could call getArg(String arg)
oh allright, something like a Command class with common things and 2 implementations, one for commands which dont have any direct association like a health command and compose one, like /faction which has many arguments and sub commands as childs
Like how a n tree works
Inside getArg, it would check if String[] args length is enough
If not, it returns null
yes i know all how to design it. But i have some issues withing childs of childs
Else it would return a CommandSection (or whatever you wish to name)
Are you current free? Maybe i can ask specific questions
That CommandSection would also track the length of String[] args in case the dev wishes to do getArg(String arg) again
As of passing it on constructor
HI
how to send data from plugin to plugin
?xy
Hello!
Is there a way to 'convert' a set of commands into plugin code?
(I want to 'convert' these for example: /summon armor_stand -227.50 74.00 -15.50 {Silent:1b,Small:1b,Invisible:1b,NoBasePlate:1b,Motion:[-4.5,2.0,0.15],Tags:["travel"]} and after that /ride {player} mount {the armor stand})
No idea what you mean with converting commands to plugin code
this is easy to do
ok how
Well there is numerous ways you can do this
from the intuitive to the very archaic of ways
There is not really a special way of "sending data from plugin to plugin" because all plugins
are loaded by the same classloader in the same jvm, meaning you have access to all the data of all plugins.
However, if you want to notify other plugins about special functionality being executed, then you can simply
implement a new Event and fire it. Other plugins can subscribe to them.
I've recently tried using javalin in a spigot plugin and I had some error, I found out from a gh issue it's due to the modified classloader or whatever. Can somebody explain what that means and why that could possibly break a library
💀
I mean, you can write some code that achieves exactly the same.
But there is no way to automatically convert a command to code. There are thousands of different ways
to write code that results in the same functionality.
Have your receiver be the dependency of the sender and interact with a common interface
thre isn't a single class loader in the JVM, while it is true there is a singular classloader that all others derive from, this doesn't mean two classloaders below it are equal
so something in one classloader doesn't automatically mean it is discoverable by another
unless its a parent or a child then most times it is
Hmm
the only thing that is important is as long as the JVM can find it, not that other things in the JVM can find it
there are methods however to find something in another classloader, its just not automatic is all
Are you sure that this is a javelin problem?
Because this problem usually occurs for CDI frameworks which use classpath scanning
for its dependency injection.
No idea, but I found some description of that issue on their github. It's something about classloaders and the solution is just switching the classloader to the classes one and then switching it back
how exactly is javalin obtained?
are you shading it?
then there is a dependency it needs access to that for whatever reason isn't being accessible from the plugin loader
idk what javalin does, but what error are you getting though?
it just seems that javalin/jetty uses the current thread's context class loader to search for something and that doesn't have the dep, so you temporarily have to swap it with your plugin's one for instantiation
The one that the github issue shows in that codeblock, something about a websocket thingy class missing or something
it doesn't show the error
not sure how you are expect me to know what java.lang.run refers to when its not complete
I don't remember if I had the exact same error, but I think yes
[ERROR] java.lang.RuntimeException: javax.servlet.ServletException: java.lang.RuntimeException: Unable to load org.eclipse.jetty.websocket.server.WebSocketServerFactory
...
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.websocket.server.WebSocketServerFactory```
and this class is present in your project?
what is the best event option to choose to impose an effect on a player if there is a certain item in his main hand?
No idea, didn't try looking it up, but it worked fine in a standalone app
But ig this sounds like an explanation
the javalin people blogged about it https://javalin.io/tutorials/javalin-and-minecraft-servers
not sure why it uses the context class loader in the first place though
Which seems unnecessary though if its a library. Why would it need to search for something that is supposed to be contained in the project already? Only thing I can think of is if its trying to find a JVM lib instead
which also makes sense
the easy solution if its a JVM lib, is to see if said lib can just be included as well 🙂
sometimes jvm libs have alternative libs to be used in projects instead
since you can't guarantee the JVM environment your application will run in
Reminds me of doing C, you have to make fifty different same functions that work on different platforms
well at least with java its just that not all JDK's are equal
Luckily
even if they are, not everyone sets up their environments the same
You can set it up differently?
to me it seems like it's just searching for implementations of a class using ServiceLoader or something similar
you can exclude JVM libs arbitrarily
or you can add
just because there is default ones doesn't mean these are concrete
There is System Libs and User libs too
system libs are included in the JVM regardless of the user, where as user ones depends which user invoked java
I love java for not forcing me to make three different implementations of the same function because of os differences
lol
anyways, probably worth though figuring out what is its trying to find
seems a bit short sighted on the developers part that they make use of the class loader to do some kind of searching
knowing its error prone
But it has probably been patched in newer javalin versions, I just need to support java8 lol
oh that could be
well searching for services is common for example, but it's on them or one of their dependencies that it uses the context class loader for whatever reason
Don't you just love this discord
can always learn something new 🙂
Yeah, especially when I can't work on a plugin I enjoy...
never read a timings report if you're asking that
if you had paid attention to the conversation or just scroll up, the solution(s) should be fairly obvious
Hello, guys. I have this code for getting EntityType from String. java EntityType mob = Arrays.stream(EntityType.values()) .filter(EntityType::isSpawnable) .filter(e -> e.name().equalsIgnoreCase(item.getMessage().replaceAll(" ", "_"))).findAny().orElse(null);
And I only want to get passive mobs
Probably then filter EntityType#getEntityClass isAssignableFrom(Mob.class)?
Or Creature.class
Ye, already got it. But thanks
i want to make so that the player can't destroy map blocks, and idk if i should like get all of the blocks on start and check if desteoyed block is inside a list of map blocks or if i should make a list at the start of the game that contains all of the blocks player placed
I don't know if there's method in SpigotAPI, but if there wouldn't be I would just listen for playerPlacedBlock and add it to list then listen to playerDestroyBlock and check if list contains this block if not cancel. Idk if searching through list with huge amount of objects would cause performance issues but ye
or adding nbt data to block
I had a plugin like that
im just wondering about performace, if like 8/16 players would just crash the server by placing blocks so much and destroying them real fast, the list would probably store about 2k blocks
so yea im just wondering about performace
ye that's the problem
so you can add nbt data/ persistant data (depends if you want to remeber blocks after restart)
hmm
wouldnt that be removed on block place?
wdym
nah i dont, im making bedwars like plugin
so setting metaData to block would be good
or just check how other popular bedwars plugins do it
okay ill check thanks
What is the best way to save hash data to a file when the plugin is turned off or immediately ?
or do autosave
As far as i know there's no way to save if server crashed or force closed
but if you want to save on normal stop
that looks like you need to use a database
what is the safest option
just saveConfig onDisable
^
i not can i need file
what
just saveConfig onDisable, and if you are aware of crashes, just save your config every 30 seconds smth like that using bukkit scheduler
I was told to put it in a file.
but as RaydanOMG said you should use database
And why you using String as money
Just use Integer
or in case your economy is a bit fucked a long
this was scheme
i use double 👍
Hi, i need help registering the kills and the deaths of a player in a virtual inventory that i created but this seems to not function... any help? https://pastebin.com/Mp368U8n the problem with this is that the itemmeta doesnt show up
also im a beginner at spigot development so I'm sorry for the mess
That code is going to cause problems
They way you've written it means it only works for one person at a time
can you fix it please? i'm desperate
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
hi, I would like to add a store system to my plugin (with inventories) with submenus for individual categories ecc. What would be my options to implement this, or is there a library that can help me?
There are plenty of inventory libraries to choose from
IF, InventoryGui and InvUI just to name a few
sqlite is file based
if I have some objects with strings that should be empty/not exist, would it be better to use "" or just null?
Empty and not exist are two different things.
In general, use "" for empty and null for non-existent.
this is redundant
statistics track this
just pull the info from there
or I at least I am pretty sure it does
you probably have to set back the item into the inventory
This has probably been asked a lot but does World#hasStorm guarantee that it's raining if it returns true?
and if not, how could I figure out if it's raining?
if i want make a public method for an item how i have to do it?
whether it's raining or not depends on the biome
i want to get an item everytime with the same name etc and for that i put it in a method but what method?
public ItemStack getMyItem() {
return myItemStack;
}
??
smth like that u mean?
ItemStack freeze = getItem(new ItemStack(Material.ICE), "&aFreeze", "&aQuesto Item ti permettera' di freezare la persuna su cui farai tasto destro!");
return freeze;
}```?
If I get an instance of an itemstack and put it in two different inventories, will it still be considered the same itemstack and be linked like using an update suppressor or does bukkit do something against
no, you should store that itemstack in a field instead of recreating it everytime
how that's my problem
Sounds like a java skill issue to me
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
now i understand how to do it thx
Anyone knows why this item display is getting bigger with every rotation?
I'm new to display entities, it's really interesting.
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.
because you add 0.1 to the rotation every tick
But that is'nt the width and height right?
https://misode.github.io/transformation/ click the "unlock" button for leftRotation, then you can see what you're doing
what are you trying to achieve by changing the leftRotation?
if you want to rotate it, change the location's pitch/yaw and teleport it
Now i see, thanks for your help for clearing things up!
Hello, quick question, I want to create a plugin on minecraft in java, and I ask myself the following question, how to communicate with my database?
Is there an ORM like EF in C#?
Should I do my sql queries manually and convert them to java obj?
Is there a lib that allows me to map my SQL requests directly to my objs?
What do you advice me ?
multimap work with "for" correct?
ORMLite maybe?
Multimap itself is not Iterable but you can get a Collection<Entry<K,V>> with Multimap#entries()
If you had to make a plugin that uses a database, would you use it?
so this will not work?
forEach != for-each loop
i never used it but I also avoid sql as much as possible
really?
yes
.forEach will work as you'd expect
for(Entry<String, String> entry : multiMap) will not compile
how will it work in this case? what is it like - key->value, key-value2, key2-value, key2-value2 ?
in 1 step
Performs the given action for all key-value pairs contained in this multimap. If an ordering is specified by the Multimap implementation, actions will be performed in the order of iteration of entries(). Exceptions thrown by the action are relayed to the caller.
To loop over all keys and their associated value collections, write Multimaps.asMap(multimap).forEach((key, valueCollection) -> action()).#
i done smth like that
public static ItemStack getFreezeItem() {
return freezeItem;
}
private static ItemStack createFreezeItem() {
return getItem(new ItemStack(Material.ICE), "&aFreeze", "&aQuesto Item ti permettera' di freezare la persona su cui farai tasto destro!");
}```
but i'm getting nothing when i do smth like that:
``` if(player.getInventory().contains(Inventories.getFreezeItem())) {
player.getInventory().remove(Inventories.getFreezeItem());
}```
I think you don't need to check contains when removing stuff
but if the player doesn't have that stuff?
remove should check that, atleast that's what ij always tells me
Any easy way to decipher whether it's a rainable biome?
Is it a known issue that from time to time plugins throw a "NoSuchMethodException" on some types? A reload "fixes" the issue, but I have never known what is causing it to happen
don't replace your jar at runtime. Reloads are a pretty nasty concept.
Thank you. That is probably it :p
Yea, but if I would reboot rather than restart, it would have taken hours of my life at this point 💀
you can look into hot-swapping
I just run older versions cuz they load fast 💀
Hot swapping, meaning only building files with detected changes?
That wouldn't make much sense when you build a .jar that is a single file on itself
Hot swapping is when you replace class files afaik
there are certain jvms out there that you can hot-swap class in
lemme see if I can find you the article
Ah right. Thx
Disclaimer : this is an updated version of the Hot Swapping guide by PiggyPiglet, updating the installation process and adding instructions for VSCode.
⚡️ Hot Swapping Guide ⚡️
ℹ️ Info
Hot swapping (in relation to software) refers to the process of seamlessly swapping out executing code in a...
There's still a chance it'll break
Yea for sure ^ in which case, you'd need to restart
So, if you ever have issues you can't fix or even find, restart
but for like small changes where you just end up changing a couple numbers of if statements
it should work well
Hey I got this problem
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.
from some reason my config can't be loaded on 1.8
and it is strange it worked before
works on latest version
I used those yaml validators files is fine
but this error is sayign there is special charact at 9387 position
and nothing is there
send your config
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.
this is code which is loading that file
Oh Lord, you have a manual configuration for all the commands
it's probably juyst the diamond symbol
That is dedication mate 🙂
so any one can translate how they want
I pray they aren't all on the same class
nah
and it is not diamond
I tried use BoosteYaml and it load it with not problem
I made it intentional like that
he he
oof
I need one hour first to figure it out where is what 🤣
?paste
this just looks beautiful
so i often get an exception like this
https://paste.md-5.net/ajonoxejil.bash
which happens in a consistent but strange way. i have custom guis in my plugin and the error occurs when i join a server, open a gui, leave and rejoin the server, and then open up a gui again
as far as I can tell CancelledPacketHandleException occurs when a packet is sent to the player asynchronously, but as far as i know i'm not doing that. a couple guis are building items asynchronously and then inserting them into the menu with a callback, but it happens to any gui and not just those
any idea how i could go about finding out where i'm apparently sending a packet async?
You could also just create placeholder line(s) that automatically are aggregated and populated with each descriptive command node there is. And additionally (programmatically) create key / value pairs in your configuration being the description of each command
That makes things a lot better but so do you
is a base64 decoder the best for saving inventory contents in a db, or is there another approach?
I mean, most DBs should just support plain binary ?
so i should convert the inventory into binary?
Well depends on how you serialise your inventory
im currently not really doing anything with the inventory
The popular approach is to just use the bkkit object output stream
you can serialize it to an object output stream and push that to the database no? If your database doesn't support that you could add some kind of adapter that handles the underlying conversion / queries
Which is nice in my case because I just wrote a system to convert between multiple inventory sync projects
so, whats the bkkit object output stream, can you provide an example or a ressource so i can get more into this?
thanks
one questions how long will/can that string be?
Well you just gave me to much info in on sentence
I would like some visual representation what u just said 😅
Base64 encoded so quite long
so there is not a real max?
no
okay
how can i change a magma cube's size
You call setSize on it
That's not how you cast and call a method on one line
oh i fixed it
I have this code:
@EventHandler
public void onItemSwap(PlayerItemHeldEvent event) {
Player player = event.getPlayer();
if (!isActivated.contains(player.getUniqueId())) return;
event.setCancelled(true);
for(Player onlinePlayer : Bukkit.getOnlinePlayers()) {
if (onlinePlayer.getUniqueId() == player.getUniqueId()) continue;
onlinePlayer.sendEquipmentChange(player, EquipmentSlot.HAND, event.getPlayer().getInventory().getItemInMainHand());
}
player.getInventory().setHeldItemSlot(event.getNewSlot());
for(Player onlinePlayer : Bukkit.getOnlinePlayers()) {
if (onlinePlayer.getUniqueId() == player.getUniqueId()) continue;
onlinePlayer.sendEquipmentChange(player, EquipmentSlot.HAND, new ItemStack(Material.AIR))
}
}
And it's supposed to make the item invisible on item swap if it is activate. But for some reason, it does activate, it does get the players, but it doesn't send the equipment change packet...
I cancel the event because I need to make that happen after the slot has been changed, so I change it myself, since the PlayerItemHeldEvent happens before you switch an item.
Does anyone know why it doesn't work?
public void onEntityDamage(EntityDamageByEntityEvent e) {
ArmorStand fire = (ArmorStand) e.getDamager().getWorld().spawnEntity(e.getEntity().getLocation(), EntityType.ARMOR_STAND);
fire.setInvulnerable(true);
fire.setArms(false);
fire.setVisible(false);
fire.setHelmet(new ItemStack(Material.GOLD_BLOCK));
fire.setVelocity(new Vector(5, 0, 5));
Bukkit.getScheduler().runTaskLater(IranSkyEntities.getInstance(), () -> {
fire.setHealth(-1);
}, 10L);
}
am i doing this right? i want it to be an effect that moves and then dies
If you want to modify a spawned entity used the spawn method that accepts a consumer
That way it can be spawned with the settings you want instead of spawned and then modified
how can i kill an entity
Call remove on it
so what exactly is the goal here
Killing -> set its health to 0
Removing from the game -> call .remove() on it
Try isDead or isValid
Attribute modifiers or something idk I'm not a magma cube
did you heal it yet
setting max health to 10k doesnt set current health to 10k
LivingEntity#setHealth() lol
public void setEntityStats(LivingEntity entity){
entity.getAttribute(Attribute.GENERIC_ARMOR).setBaseValue(sDefense);
entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(sHealth);
entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(sHealth);
entity.setHealth(sHealth);
try{entity.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE).setBaseValue(sDamage);}catch(Exception ignore){}
entity.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(sSpeed);
}
heres what i did
why are you setting generic max health twice
was an accident
before a hit
yet another hypixel skyblock copy

setDisplayName
ok no shit lol
what about their health
are you doing getHealth or their health attribute
and are you updating it after it takes damage
Is it possible to execute a piece of code when a player enters a defined space?
if yes, how?
Well, if you have stuff like world guard, there are events for that
if you don't you end up basically having to check either on PlayerMove or every tick if a player is in the area you defined
oh rip
seems overkill
i often get this error
https://paste.md-5.net/ajonoxejil.bash
and it indicates the player is sent a packet asynchronously, but how can i figure out where that's happening?
is that the entire stacktrace ?
yup
theres no reference to my code
hence why its hard to find
it specifically happens with custom inventories if that matters
Well I expected it to at least have some context on where the "CancelledPacketHandleException" is thrown but rip
Hi
How can i reforward command from bungee to server? for 1.19+ clients?
Like sc.unsafe().sendPacket((DefinedPacket) new Chat(e.getMessage())); no longer work it kicks the player but works fine for below 1.19
So now i tried
sc.unsafe().sendPacket( new SystemChat(e.getMessage(), ChatMessageType.SYSTEM.ordinal() ) ); but that does not work either :S i see bungeecord use systemchat
ive been pondering this bug for a week now lol
Well I mean, ValhallaMMO seems closed source so I guess not much to look at ?
its open
link pls
oh i didnt? fuck
ah yes, I explained it there but alr. It's supposed to make the item the player is currently holding invisible by fake packets to all the players every time a player changes item in the hand
How would I do that with worldguard?
also my apologies in advance for the horror you will face in this repo
is this replicable ?
like, can I replicate that by just downloading the plugin and running /skills
the stacktrace indeed does not give much
its very replicable, though the version on spigot isnt whats on github
its a rewrite
but it specifically only happens when someone joins, opens a gui, leaves and joins, and opens a gui again
which is like ???????????
so you're basically not allowed to relog
thought that maybe its because some guis build their items asynchronously and populate the menu with a callback but making it all sync again didnt resolve it
👀
thought that it might also be with some packet listening which is also async, but removing that also didnt work
so I am very new but am just trying to make a simple plugin that will send me to my hub server, I have a test command which works but I am just confused on why my server is saying that i am using a legacy plugin.
[09:34:26 WARN]: [org.bukkit.craftbukkit.v1_20_R1.legacy.CraftLegacy] Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!
[09:34:27 WARN]: Legacy plugin first_plugin v0.0.6 does not specify an api-version.
it says I do not specify a api-version but I do https://pastebin.com/7unzGrW8 any ideas on the stupid mistake I made?
gui population can be done async iirc
could it be because im using InventoryHolder for the custom guis
because i know thats a sin lol
ew
I looked into it
Basically all vanilla inventories copy the entire holder when you call getHolder
And that in turn copies the entire inv
There is no problem when the check passes, it's when it fails that's the problem
i understand why its a sin but its like a relic of the past when i didnt know any better and i just havent gotten around to improving that
still shouldnt be throwing CancelledPacketHandleException though right
I mean, probably easiest for you would be to just attach a debugger and go for it
Should be api-version not api
debug how
like, intellij debugger
ive already checked if the gui is being opened async and its not
tysm
throw a breakpoint
wait you can do that with plugins?
how do you do that, you cant run plugins just like that can you
the thing that is basically fucking you is PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel())
well you start the server with the flags
that IJ provides
and then you just attach
like, you add -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 to the start script
and then you can do a normal remote jvm debug configuration
¯_(ツ)_/¯
issue is, server mappings will fuck you
woah
so like, you cannot jump into the server code to see what happens
if you want a tutorial to forllow
additionally, add -Ddisable.watchdog to your startup to disable the watchdog
otherwise your server will kill itself after like 10 seconds of the main thread being stuck at your break point
thats rad
now the question is where the hell do i put my break point lol
my code wasnt referenced at all
when i change it to api-version it throws this error in the server console https://pastebin.com/rFzeCw1w
and in vscode it also give an error saying this, but it says the error is at 1:1
Missing property "api".yaml-schema: PocketMine plugin.yml
Bukkit plugin.yml
The unique name of plugin.
Source: plugin.yml
I'd just smack it on top of your skills command and then step over
ill see if that does anything
should only be the major version, so use '1.15'
You don't need the extra 0
that worked, ty
?whereami
i did a test and it seems like the entity's health is 43 when it spawns
I'm guessing this will create a lot of lag?
public class PlayerMoveEventListener implements Listener {
@EventHandler
public void onPlayerMoveEvent(PlayerMoveEvent event) {
if (event.hasChangedBlock()) {
Player player = event.getPlayer();
Location to = event.getTo();
if (to.getBlockX() >= -225 && to.getBlockX() <= -223 && to.getBlockY() >= 73 && to.getBlockY() <= 77 && to.getBlockZ() >= -16 && to.getBlockZ() <= -14) {
//code
}
}
}
}
no
oh ok
it literally jumps straight to the error the moment it gets to the menu creation part, like it doesnt even step through the gui constructor or the open() method
do you know what i can do with that lol
straight to this
Why should this? You're basically just performing value comparisons
Isn't gonna do a lot
ah actually i just had to put break points in those methods too, didnt realize that
exception is thrown at Player#openInventory() it seems
which i guess would be the packet thats apparently sent async
because it checs every single time i (or another player) move
I mean on a nanosecond scale (maybe even millisecond) it will definitely have a performance "impact", but that just counts to premature optimization
Build the thing first and test your performance after with whatever you're doing there
oh alr
I have this code (not full):
@EventHandler
public void onItemInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
ProtocolLibrary.getProtocolManager()
.addPacketListener(new PacketAdapter(ShardPlugin.getPlugin(), PacketType.Play.Server.ENTITY_EQUIPMENT) {
@Override
public void onPacketSending(PacketEvent event) {
if (!isActivated.contains(player.getUniqueId())) return;
for(Player onlinePlayer : Bukkit.getOnlinePlayers()) {
if (onlinePlayer.getUniqueId() == player.getUniqueId()) continue;
onlinePlayer.sendEquipmentChange(player, EquipmentSlot.HAND, new ItemStack(Material.AIR));
onlinePlayer.sendEquipmentChange(player, EquipmentSlot.HEAD, new ItemStack(Material.AIR));
onlinePlayer.sendEquipmentChange(player, EquipmentSlot.CHEST, new ItemStack(Material.AIR));
onlinePlayer.sendEquipmentChange(player, EquipmentSlot.LEGS, new ItemStack(Material.AIR));
onlinePlayer.sendEquipmentChange(player, EquipmentSlot.FEET, new ItemStack(Material.AIR));
}
}
});
}
And that creates a java.lang.StackOverflowError.
onlinePlayer.sendEquipmentChange(player, EquipmentSlot.HAND, new ItemStack(Material.AIR));
And it get's generated in this line ↑
Any idea why?
ah ok
Erm you shouldn't add packet listeners in (such) an event to begin with
yeah though that, but where should I put it then
Do it on plugin load up
you only want to register one of those listeners
and create a method to get the isActivated method?
doing it on every interact event is gonna blow that the fuck up
is activated doesn't seem to be a method
I guess so, if you want to stick to this desigm
what other options are there then?
Use a set please, instead of a list unless you allow duplicates. Your lookup will be O(n) in worst case whereas a hash set has constant lookup
But you have other issues with sets so
I mean I can't type them out rn I'm on my phone
But you can do it like that yeah, if you want to stick to this make it static or use a static getter or whatever, but I recommend anything else but that
ah ok
How I'm can use 5 size like hopper? But minimal it 9.
Someone know how do it?
Inventory inventory = ((Hopper) block.getState()).getInventory();
Inventory ui = Bukkit.createInventory(null, 9, UIname);
ui.setContents(inventory.getContents());
InventoryType.HOPPER
even if I put it in an onEnable() method, it still throws a java.lang.StackOverflowError
does anyone have an idea here ↑
Oh tysm!
I mean what is happening is that you receive the entity equipment packet and then send another one, triggering this method to be executed again
you could fix this by putting every player that you send it to in a Set (for example your isActivated) and do not send any more equipment changes when a player is within that set
@plucky skiff
well what I want is to make the player items invis if it is activated, now I'm actually getting this weird error for some reason: java.lang.NullPointerException: plugin cannot be NULL. which doesn't make sense since it shouldn't be null
well debug when your plugin is null and when it is updated
whereever this exception is thrown
?paste
oke ty
forgot about that lol
it happens on line 24
which, in the decompiled code is import org.bukkit.plugin.java.JavaPlugin;
oh wait
You're setting plugin after that
no
you assign plugin = this after
??
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
how can i change glow color
?learnkotlin
step 1: dont
rate my new phone
6
is the file saved as UTF8, did you set maen/gradle to compile as UTF8, and did you also load the file using UTF8?
is this not loaded as utf-8
it's great though
EntityPickupItemEvent
thx ❤️
you need to set project.build.sourceEncoding to UTF-8
can I do that in my main parent pom
idk, I always set it in every pom to be sure
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>```
👍
and then check if the file is actually saved as UTF8 in your IDE too
after that run mvn clean on the parent pom, then try again
ok thanks
in 1.8 how can i get the material of a dye?
It would be a magic damage value
isnt it always inc sac?
or some other bullshit
lapis? That's an ink sac
Hey, i have installed git on my pc , but when i try to upload my code to git, i get an error saying its not installed, any idea?
How are you trying to upload
what you say, lapis? Never heard of that. ohh, you mean ink sac!
Integer ids and data values were funny
*an
im using this, but nvm now it sent it to github, but it just created an empty repistory
You need to commit your code
and how do i do that
using the commit button
which git exectable is selected here?
or the commit command
Probably need to add the files you want
i thought it said "git not installed"?
i said it in my last message, it ended up working after i launched intelij again
how? do i drag and drop them?
No
show a screenshot of your project structure
I use the cli so I have no idea how to do that in Intellij
?conventions ;/
I'd just remove the .git folder, then create a new git repo with with Git -> Create Git Repo (or however it's called) and then try again
the.gitignore?
but just for fun, you could try right-clicking the src folder and check if you see Git -> Add
yeah i dont see it
i see that button but when i click it nothing happenes
if you now go the git tab again, do you now see some files you can commit?
inside intelij idea?
open your project in file explorer and remove the .git directory, then run git init manually (or use Git -> Create repo in IJ)
where is the .git file
It's a folder in the root of your project
Windows will hide it by default, you need to enable hidden folders
and how do i do that
Ok ill try that if other things dont work, but why cant i commit my files tho?
Hey; si tu veux je peux t'aider en voc !
I assume you do not have git installed on your PATH
Mon dieu
Quoi? x)
I asked 20 minutes ago for a screenshot of your git settings
Ils sont partout
why is everyone speaking baguette now
Is there a way to check all entities in 30 blocks of other entity without checking all entities on the server?
I like bread 🥖
Whatever, my french isn't that great. Despite it being my native language on paper
It's alright, this is supposed to be an english speaking server anyways
You like pain?
My german is better, but meh
Yeah, I like 🥐 too
Same
Never spoke it, but seems cool though
Do you like it just like that or with something in it
Thanks!
Depends, sometimes chocolate but most of the time nothing
I really like it with chocolate
Classic
yes, only check entities in the same world
ty
Oh well, i managed to get it to work (i just reinstalled bit and restarted my pc)
nan tranquille j'ai pu géré, j'ai juste restart mon pc et git
D'accord ça marche, n'hésite pas une prochaine fois si tu as un quelconque problème
Le pain language intensifies
All good
Damage it?
The only way I'm aware of is nms ;/
😭
You might set the fire ticks, but that is beyond hacky
nice way
not sure if that would drop anything though. And might not be what you want visually
I think boat doesn't have animation of fire
it would just drop
even with 1 tick
Ah then it is a decent method
Use VehicleDestroyEvent, check if the vehicle is a boat, if yes then create the item stack for the boat, & drop it naturally in the location where the boat was "broken"
I don't think that is what they want
Ah, they want the items that drop when you actually break the boat? Like the sticks and stuff?
ye
I see
help, why does packet listener say that "java.lang.NoClassDefFoundError: com/comphenix/protocol/events/PacketListener".
(i am very bad at coding, and am activey trying to figure out how packets work)
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
manager.addPacketListener(new PacketAdapter(plugin, ListenerPriority.HIGH, PacketType.Play.Client.PICK_ITEM) {
@Override
public void onPacketReceiving(PacketEvent event) {
Player player = event.getPlayer();
PacketContainer packet = event.getPacket();
ItemMeta handMeta =player.getInventory().getItemInMainHand().getItemMeta();
if (handMeta.hasCustomModelData()&&player.getInventory().getItemInMainHand().getType()==Material.SCUTE) if(handMeta.getCustomModelData()==2){
event.setCancelled(true);
}
}
});
Are you on maven?
yup
You most likely forgot to install ProtocolLib on the server
