#help-archived
1 messages Β· Page 51 of 1
https://paste.md-5.net/hiyipubesi.java is a Main for a plugin I started a few days ago
mmm
Oof
You're using eclipse, you can type it out and then hover over and import, no need to write out the imports yourself
Haven't made a plugin since like 2018 so it's a fat rip
Ctrl + Shift + O
im not understanding it
in onEnabled i hook the events, so that the server knows what events that plugin will use or something like that
Yep
then i have to include the class files in main, right? or do i have to import just the functions? i dont get it
Bukkit.getPluginManager().registerEvents(new PlayerLogin(), this);
PlayerLogin() is the class
that class looks like this ^^ which listens for players logging in
All I'm doing in my Main class is saying to the server "Hey! This class is listening for events!"
i got it now, i thought i had to hook specific events and that PlayerLogin was an event
Commands are registered via the following:
this.getCommand("balance").setExecutor(new balance());
which also needs to go in the onEnable
this.getCommand("balance") <-- tells the server what you would like the command to be, in this example, /balance
setExecutor(new balance()); <-- points to the class that handles this command.
Anyone have any experience with controlling entitites using WASD? Please DM me, I'm going crazy lol. MC version 1.15.2
That's dealt with in the onCommand
I can write up an example one if you want?
Won't take long
On it now π
before i get too deep into it, is it possible to set final fields using reflection?
what do you mean by fields
@minor spruce It was possible but I think they removed that option in the latest java version
You could access a modifiers field and remove the final modifier from the list
ok thanks
i think i'll just experiment with it, just didn't want to get too invested if it wasn't possible at all lol
@flint palm https://hasteb.in/abonadev.java that's how I'd do it
π
this is java not C#
//Check if our boolean is currently true or false and toggle is respectively.
if(Enabled == false) {
Enabled = true;
}else {
Enabled = false;
}
change that to
Enabled = !Enabled;
true
Didn't think of that actually
it's been a while lmao
When it comes to using it prior to removing the item, you simply have to
if(EnableDisable.Enabled) {
//Remove item here
}
so im trying to make my own external library to use in my plugins, but when i mention the main library class in plugin code, the server throws a NoClassDefFoundError
at compile time everything is fine though
is anyone here familiar with this issue?
no it's not
Idk, that's how I've always done my private libraries
set it up like a basic plugin, call the methods
Not too sure, never done it without though
if it is a library, it should extend PluginBase
instead of JavaPlugin
but you could make your library extend JavaPlugin if you want, just have to create it like you do with any other plugin if you do that.
or if its just a library for specifically your plugin, shade it in
currently it doesnt extend from anything
i tried adding a plugin.yml, that didnt work
@hearty trellis you need to shade it in
how do i do that?
Gotta extend javaplugin if you're gonna add a plugin.yml lmao
if you don't want to have to put a library jar on your server
just shade in the files
Theyre asking how to do that
or i guess my real question is: what is "shading in"?
fair
?lmgtfy Maven shade plugin
oh guess it doesn't work here >>
.lmgtfy maven shade plugin
Just want to make sure that there's no replacement for the deprecated damage modifiers
Not really, no. It's just unmaintainable and is subject to removal in the future
When? Not sure.
You're fine to use it for the time being but don't expect it to stay forever
Yeah, I'm just making sure because I don't really want to rely on it if I know that it's (probably) going to be removed
just fyi not everything that is deprecated will get removed
Also given the reason for the deprecation, I don't think it's a good idea to use :)
some of it is deprecated due to "magic"
What does that mean lol
Such as getPlayer(string);
not likely to go, was just deprecated to encourage use of UUIDs
The "magic" thing I mean
(regurgitating information shared a couple hours ago :D)
oh magic numbers
Wha?
should google magic numbers
Oh okay
and then you will understand better
Basically arbitrary hard coded numbers
Though that's not why damage modifiers were deprecated. It was deprecated due to its unmaintainability. If you've ever seen its implementation patch, it's horrendous
Correct. Data values and whatnot were considered magic values
Damage values as well if I am not mistaken?
I was more referring to the comment
Also given the reason for the deprecation, I don't think it's a good idea to use π
not always the case :p
Thanks for all the info :)
Is it possible to check if a player clicked an item with an item already in the cursor. For example if i have a sword in my inventory and i click on it with a slimeball it does something
Yep. InventoryClickEvent's getCursor() will get the item on the player's cursor
Easy, thanks
(will be null if none)
out of paranoia i always check
if (event.getCursor() == null || event.getCursor().getType() == Material.AIR)
Anyone know the code or a link for help with a way to verify a spigot user on spigotmc.org with javascript from a discord bot
It's xenforo
api documentation is public
don't know if they allow public use of the API on spigotmc tho
Ah, so it's there but will only work if they've linked on this server?
Can someone help me pls
how do I make it so I turn like the whole world into lucky blocks
o.O
Bukkit doesn't support modded servers
so. how do you see a resources id
@subtle blade
is it the numbers after the resource name in the url? o.O
nvm
found my answer XD
I was thinking of the actual REST api xenforo ships with :p
@frigid ember xenforo 1 has no api
Is there any free way to verify a spigot user, preferably using javascript through a Discord bot?
It is, yea. Numbers after the resource name
Same for user IDs
omg how many times will I edit that before I'm right lol
Spoken, I sent you a link earlier to the SpigotMC API.
@frigid ember xenforo 1 has no api
@fleet crane
yeah didn't realize you were on XF 1, they didn't add it till 2.1 looking at the documentation
yooo
my peeps
i need someone to make a color enum for me
all the minecraft colors with the color codes for each as their parameter
like GREEN("&a"), RED("&c") etc
Anyone know how i would make it where people spawn in the lobby everytime they join?
@frigid ember teleport them there on playerjoin event?
Yes
I cant seem to find it i in the bungee config
There already is an Enum for the chat colors @granite cedar
Ah bungee
Should be force_default_server in the config @frigid ember
Set that to true
It should then send the players to the server with the highest priority on join
@keen compass already coded my own
@keen compass
any idea to represent a color in a gui
i was thinking to use glass panes or concrete but theres no dark red/lightred versions
Can anyone help our group figure out how to use plugins? weve never done it before and are trying to use shopgui+, mcmmo, and silk spawners. We have essentialsx vault and shopgui+ but we don't know how to use them correctly
@small gorge there shoudl be plenty of tutorials on youtube for each plugin; if not the plugin page usually has an extensive usage guide
We've been trying to follow them but we don't understand what we are doing
The jar file for shopgui+ isn't doing anything @marsh hawk
@small gorge are there any errors in your console when your turn the server on?
this build is outdated, first message we get
we are using the shopgui+ that says it works for 1.15 and the newest version of vault
did you use buildTools to get your spigot jar, or did you download it from somewhere?
from the spigot website
spigot does not distribute server jars from their website, they must be built using BuildTools. Where did you get your jar?
like what site specifically
i don't know, he wont let remote in so im having to do this through him
its working now though
okay. LMK if you need anything else.
we can't get mcmmo at all if you know how that one works.
we just see the commands in the server but never can use them
usually it's as simple as dropping the MCMMO jar in the plugins folder. If you can't use the commands, that's prob a permissions issue. Are you using a permissions plugin?
nope
ah. that's why
and we can't use the commands oped either
i'd recommend luckperms.
basically download this, and drop it in your plugins folder.
he just yelled at me and said nevermind on mcmmo, he does want silk spawners though
@granite cedar could use wool
alright, is silkspawners having the same issue, where it is installed but will not work?
yea
if so, then thats most likely a perms issue as well
@granite cedar or use colored leather armor as it gives you even more colors to play with
you're gonna need a permission plugin if you want to use most of the plugins you install
you could use permissions.yml, but that is certainly the worst way to go about that
how do we use luck perms?
there is documentation for it
morning all, how do i fix that verify user issue, i haven't mc original account[using TLauncher ]
@frigid ember what verify user issue?
it's 4am for me, I don't know if I have to say "Good Morning" x)
3am gang
@keen compass are there any special settings for " jar arguments " ?
am based in Asia sorry π¦
there a way to prevent someone with an armor stand as their passenger from hitting the armorstand?
@keen compass I already set the Java arguments
you mean arguments after the -jar ?
you could toss in -nogui generally not required
@bronze horizon cancel the damage event
@frigid ember where did you get the account if you don't have access to it?
@frigid ember is that a cracked launcher?
the -nogui is default.. anything else?
@frigid ember Buy the game.
@granite cedar yep TLauncher
It can't verify the user because you aren't actually a user.
@lusty escarp sorry, should have specified. also want them to be able to interact with things in front of them like normal
@radiant pollen no other options?
BUY THE GAME
nope that is pretty much it @static pecan what I posted in that link is all you really need. There is tons more arguments but at the moment they are above your level currently
my network will support cracked players no worries
the other arguments require you using a profiler along with GC profiling to tune properly lol
but the ones you have now will do you good for a while
LOL,, well, I am a Windows/Solaris/Cray/RedHat/CentOS and I guess now a MineOS admin by trade... so, not totally above my head, I just have ZERO minecraft experience.
@static pecan for hire?
you can't afford me.. besides, I'm just an admin.... nothing special and definitely not a coder. You guys are way smarter than me...
but alas, thanks very much for the help... I'll be back.
its working thanks all π
ok, I got the data response, but I cant figure out how to grab the "discord": variable from d
res.on('data', d => {
if(d.identities.discord == message.author.tag) {}
});
I dont know how to get it...
@subtle blade Do you know how to get it? I cant find out how.
have no idea what you are using o.O
Hello! Is Player's healthScale change when server join? on 1.12.2
@frigid ember Not unless something actually changes it, AFAIK
Can someone help?
https://timings.spigotmc.org/?url=icijexinad Anyone know what is causing my tps to drop to 10-13 when I go into the PrisonPlots world?
"Try reducing View Distance if it is above 4."
Have you done that?
It's world loading, not a plugin or anything.
There's an issue with something in the world, or your view distance is too high.
@flint palm https://hasteb.in/abonadev.java that's how I'd do it
@frigid ember thanks, its strange for me to do everythin in classes, but i guess ill get used to it
btw, i dont understand the need for whats from line 53
@flint palm Toggle boolean's with with bool = !bool
i guss it should be the same, can a cmd be run as something other than a player or console?
i guss it should be the same, can a cmd be run as something other than a player or console?
@flint palm nah player and console are the only ones you'll run into
Can someone tell me how to get "discord": with
https.get(`https://api.spigotmc.org/simple/0.1/index.php?action=getAuthor&id=${args[0]}`, async res => {
res.on('data', d => {
if(d.identities.discord == message.author.tag) {
message.member.roles.add(message.guild.roles.cache.find(r => r.name.toLowerCase() == 'verified').id);
message.reply('Successfully verified your account!');
} else message.reply('Invalid Discord!\nMake sure to put your Discord Tag under your profile!');
});
});
d = {"id":"642407","username":"SpokenWig620933","resource_count":"0","identities":{"discord":"RedstoneGamer#4122","youtube":"Redstone Gamer123"},"avatar":{"info":"1557348459","hash":""}}
Im using https://github.com/SpigotMC/XenforoResourceManagerAPI with the getAuthor method.
if I setCancelled InventoryClickEvent it replaces the item in cursor with the item clicked, does anyone know a workaround?
AFAIK, just a client-sided visual glitch
How do you detect when an armor piece breaks??
PlayerItemBreak event doesnβt work for armor?!? Any ideas?!?
Plz @ me or dm me
how can i create a timer that, for example, every 1 second, obtain the inventory of all connected players?
how can i block a command?
@flint palm listen for a CommandPreProcessEvent, check the label, if it's one you want to block, set the event to cancelled @flint palm
makes sense, thanks
@flint palm the event is "PlayerCommandPreprocessEvent"
Anyone knows how to fix the issue
with first time join spawn point
it spawns first on wrong location than on the right
there is deley 2sec
is there a way to alter the Ender Dragon spawning sequence, specifically pillar regeneration? I found this: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/boss/DragonBattle.RespawnPhase.html But the only methods fetch the current phase. Is there any way to remove/alter a phase?
I might be stupid but I donβt know how to make players deal more damage... Iβm making an RPG plugin and Iβve made items which you click to add a prefix to your name. How do I make it so somebody with a β[Wa]β prefix deals .75 times normal damage? And how do I make them take that much?
@knotty karma would have to be done with nms afaik
creating a new ender dragon entity and set it's spawning sequence
so basically i have to rewrite the entire resummoning sequence?
aw shit what are those ghost like creatures
damn and i was doing so well before hat thing showed up
Is mob spawning less on servers? I have a mob farm that is increasingly slower than the same exact design in single player. I looked it up and people said to either increase the mob spawn rate or the mob cap in the bukkit.yml file, but I don't wanna do that for the entire server, because then mobs will be everywhere. any suggestions?
like 200 blocks away
i'm 150 in the air and like 100 blocks on the ground from my base, in a mesa, because more water less ground mobs
during day and night it's significantly lower
https://i.imgur.com/sXFOmKR.png
https://i.imgur.com/wqnDWcL.jpg
Do you guys think there is any formula to these layouts or is it just hard coded?
I cannot tell
I have a big problem. I have a minecraft server based on Spigot and I host it at home, and if anyone connects to it, It will crash
Can we ask help about MongoDB?
Provided it's to do with spigot or bungee
Not an issue then, no guarantee you'll get a response too quick though, I've never dealt with mongo and idk who else is here
Haven't for a while to be honest
hmm oki
what about mongo?
Hello, I'm working on a custom terrain generator, and for biomes I'm currently using a system with simplex noise for temperature and simplex noise for downfall, like the way it used to be done in Minecraft. However, this doesn't allow for much variety in biomes. Can anyone help me figure out how to start trying to make something like what Minecraft currently does? I can't really find much information about how it works, so I don't know where to start.
Why do I have to use atomic or final for a forEach loop but not something like (int i : theints)?
for example this gives a compiler error
Guild found = null;
Guild.baseDir.forEach(f -> {
YamlConfiguration ym = YamlConfiguration.loadConfiguration(f);
if (ym.isSet("id") && ym.getInt("id") == id) {
found.set(new Guild(ym.getString("name"), BaseUser.ofUUID(ym.getString("owner"))));
}
});
but this doesnt
AtomicReference<Guild> found = new AtomicReference<>(null);
Guild.baseDir.forEach(f -> {
YamlConfiguration ym = YamlConfiguration.loadConfiguration(f);
if (ym.isSet("id") && ym.getInt("id") == id) {
found.set(new Guild(ym.getString("name"), BaseUser.ofUUID(ym.getString("owner"))));
}
});
?
Is there a way to get the default Minecraft generator? Basically I want my custom generator to handle some chunks, but pass other chunks to the default generator. I have a funtioning way to pass certain chunks to different generators, but I can't seem to find the default vanilla generators
NMS
eeeeeeeeeeeee the whole reason i was doing that was to avoid NMS. i guess there's no escaping it...
yeah basically yes. working with terrain generators will always make you use NMS unless there are some obscure API i don't know of
alright. Where do I even get started with that... I might as well go back to the original problem I was trying to get around, which is modifying how the obsidian pillars in the End regenerate when the dragon is respawned - Where do I find the documentation for that? I looked, and couldn't find anything. Does any official documentation even exist?
i figured
I've found some user made documentation in the past
or in other projects
but none from Mojang of course
I believed NMS only documented for their partner only, like mineplex, cubecraft
probably doesnt go as specific as i need... I found a bit, but the most i found was simple stuff like making NPCs, getting ping, etc
the best way is probably to look at some terrain generator plugin code
and hope you understand it
TerrainControl and OpenTerrainGenerator are both good i'd say
i was unable to find anything that does something remotely close to what i need
i basically need to override the pillar regeneration. I'll take a look at those, but I doubt they handle that.
obsidian pillars?
what are those
like I've never played didn't even know they were a thing in 1.15.2
these bois
the things in the end with the crystals
i generate my own just fine, but they get all screwed up when the dragon is resummoned
oooooh those pillars
thats what happens after resummoning
so basically i was originally gonna override the pillar regeneration phase of the dragon resummoning
but i'd need to use NMS for that and NMS is scary
so i thought i could just hand off main island generation to the vanilla generator
but nope
this happens too
dragon stuff pog
are you trying to override the way mojang generates them?
hmm
will have to do nms but it shouldn't be that bad depending on some things
Is there a way to get the default Minecraft generator? Basically I want my custom generator to handle some chunks, but pass other chunks to the default generator. I have a funtioning way to pass certain chunks to different generators, but I can't seem to find the default vanilla generators
That's exactly what I implemented last night, lmao
nice. Mind sharing how you did it?
Sure, grabbing the link
thanks!
See PM
How can I do this?
I used this Tutorial: https://www.spigotmc.org/wiki/creating-a-blank-spigot-plugin-in-intellijidea/
okay
public class lobby extends JavaPlugin{
Thanks π
Hey, how can I get a random location in a world?
What is the main class?
Sigh. im looking to see if anyone wants to offer me help on maybe something offtopic.
Anyone super good at Rankup3 with Luckperms
if so DM me, just struggling here
use gradle
Hello, i have question about item despawn rate.
Hey, how can I get a random location in a world?
@cold wharf I mean you use Random
I usually use ThreadLocalRandom for random coordinates
should be 3*10E+7
If i set item despawn rate to 3000 (2,5m), if someone drops items it clear these always after 2,5 minutes?
I am new to coding hehe
you know the world default border
30_000_000
you don't want to generate a random coordinate out of there
ah oki
you could also make a dynamic one
World has a getBorder method
or something like that
yes
If i set item despawn rate to 3000 (2,5m), if someone drops items it clear these after 2,5 minutes? Or there is that moment, when all items are clearing every two minutes?
if you plan to have a fixed border you can do
private int randomSafeCoordinate(final ThreadLocalRandom random, final int bound) {
return random.nextInt(-bound, bound);
}
// define the ThreadLocalRandom somewhere ->
private static final ThreadLocalRandom random = ThreadLocalRandom.current();
// generate the X & Z coordinates
private static final int WORLD_BORDER = 29_999_984;
private final int x = randomSafeCoordinate(random,WORLD_BORDER), z = randomSafeCoordinate(random,WORLD_BORDER);
correct me if you see something wrong
hey π
does anyone know how I can reference this item stack?
Tried to do that - they're in the same class
but unfortunately it doesn't work
I'm not sure if I'm misunderstanding ItemStacks, but I put the ItemStack in the OnEnable() so the item is created as soon as the server starts
Does anyone have any good guides for creating custom entities in 1.15
or versions that are close to it.
@formal nimbus new ItemStack(Material.valueOf("DIAMOND_BOOTS"));
???
Oh nvm lol
@sturdy oar thanks! That makes sense π
Also i don't know what that plugin looks like, but I usually avoid doing stuff directly into onEnable()
JetCobblestone, you need to structure your project. When you make a variable, consider what classes/packages will be using it. You should also learn hierarchy's
is there a way I can bring items in from another class like you do for commands?
you pass them as an argument i guess
there are many different ways to organize your plugin
JetCobblestone, you need to structure your project. When you make a variable, consider what classes/packages will be using it. You should also learn hierarchy's
@unreal hedge Yeah, I've been trying π
https://staff.fnwi.uva.nl/a.j.p.heck/Courses/JAVAcourse/ch3/s1.html
@unreal hedge thanks
atm it looks like this
also (this is not an error) but why are you using your full package when calling your stuff
also (this is not an error) but why are you using your full package when calling your stuff
@sturdy oar I'm not anymore, was just trying that to see if it changed anything lol
I mean sometime there are reasons to use full name
if you'll end up looking at Spigot/Bukkit's code it's full of that
wut
O.O
\(._.)/
also the _ need to be escaped i think
\\\_(._.)\_/
lol
You only needed to escape 2 _'s xD
lol I dunno
;P
really? why not
Bc it makes you look noob
π’
I usually see the Main class called like that when you ACTUALLY have the main method
wdym
like if you have public static void main(String[] args) you should call it Main
that is the main Java method
It's convention to name the main class after your project
o
so I would have me.JetCobblestone.firstPlugin.FirstPlugin
yeah
aight
also
I'll keep that in mind for my next one π
packages should follow the convention as well
im not entirely sure myself but I guess they should not contain UpperCase characters
o. I thought packages were lower camel
package names are all lower case
π
π¦
of course discord has a duck emoji
Classes = camel, packages = lowercase
π¬
camelπ¦Ά
camel foot?
yes!
Usually when one of my friends asks for help in his project and he's not following the conventions, I just tell him to fix them or I won't even help
lol
Me, a Lombok user π±
.lombok
F
Anyone use white theme for their IDE
no wtf
i only use light theme for CLion
I use
Tbh. I'm actually enjoy using white theme in Intellj, but not a fan of visual studio code white theme
I don't actually mind the white eclipse theme
but I'm using dark atm
people who use white theme don't care if you use dark theme, but people who use dark theme VERY MUCH CARE if you use light theme
therefore, I use the dark theme
calling a 16yr old a boomer
is wrong
@sturdy oar you didn't answer the question D-:<
well you're missing many features
I don't even have time to list them all
they're way too many
can you download JDKs from Eclipse?
I dunno
can you attach a profiler to your code?
possibly?
can you debug to a remote server?
I've never tried
fuck
π
weebs
Background wallpaper is a neat feature IMO
(as long as it's not at 100% obv)
jesus
o.o
I like that you use final, most definitely, but not in method parameters. π
sr.3
why shouldn't i use it
does final make it a constant?
in methods parameters is kinda different
Makes it not reassignable basically.
it makes it unmodifiable
in my opinion everything should be final
no
unless it NEEDS to not be
??? wtf are you saying
Hmmm
there's no 'abuse'
I use final when it is only needed
lets say I wanna access a variable outside a runnable
final
my convention is using final everywhere
or if im making an api and im sure people should NOT modify it
or if i know i wont ever modify it
dont use final everywhere
why?
such final
Same question as, why not?.
it doesnt look nice
I think final can save you some small performance, very little
if its too many
Lmao
yea actually
but it doesn#t do much in a method
in a class it can help
methods are storing stuff temporarily
it won't help
That's why I hate it in method parameters, unlees it's really needed.
bich is too long
method parameters its not needed, correct, it also makes the method look so long
method parameters there is nothing wrong using it
It actually helps the JVM if I'm correct
Just it won't help much if you are thinking performance wise
like in a class, if you make a variavle final and initialize it, certain emmory is reserved for it, and it is certain how much memory that variable will take
in a method lets say its a small method
i said final variables in classes
..
that site never mentions final method arguments
@sturdy oar they don't make a large difference for methods
methods are just called
i dont think your method will run for long
using final can help if u are making a varaible in a class
u already have a defined value of memory it needs
and that class can be accessed as often as u want
well i have everything final anyway so
*were
thanks
lol
like final everywhere
makes the method arguments sooo damn long
lmao
im just saying performance wise you are not gaining much
possibly nothing at all
you can lose clean readable code tho
how nice
yeah he the one banned from Paper
what did i even do
it succed
someone was going off on me
i said mind their business
and stop
then i got banned
???
lol
i pinged a staff actually
then he said stop
and goes off on me
i stopped
then he pings 6 other staff
hypocrite little guy
LMAO
i say bruh ur pinging 5 other staff
about me
i did one ping
and then i get banned
?????????????
about what
just coding help
180 is enough
You need to provide double?
JVM automatically converts 180 to a double
Ah okay, but not for longs at least
only if the constant is outside the range of int
you can pass 180 to a function that accepts long
Interesting, i had to provide a specific long and could not provide just the integer a while ago
ah ok this only holds for primitive values
ban the player
ez
anyway we need more info
past the whole stacktrace on something like pastebin\hastebin
How do you check if a player is strafing
i wouldn't help him if you knew him :p
lol "ban the player"
@frigid ember
hello
thanks for ping
i said isStrafing
for god damn sak
ill find out myself pce
i already figured out
pce
check the players location
what the heck is strafing
and compare it in a task
strafe
jumping around like an idiot
oh yeah that retard pvp thing
yup
strafe is walking with w and d
at same time
or w and a
one goes slightly faster when strafing
meh
press X to doubt
whatever that plugin is didn't bundle a library properly
Oh, how do I check which one is causing the prob?
it tells you?
Looking at it real quick, DiscordStats didnt shade JDA in correctly
Literally the top line of your paste
@light geyser I got the latest version of JDA
You didnt shade it in, how do you compile your jar?
how to do this with 1.15.2 https://prnt.sc/s7yb4h
Dutchy, ofc with console?
Dev.Cow, InventoryView is used IIRC.
I jut extract the jar and put it in plugins
Is it your own plugin or someone else's?
The plugin is busted or something
My plugin π
You need to shade in the library, or add it to the classpath manually
Ok, so do you use your IDE's export feature or Gradle/Maven?
code is irrelevant
oh?
Ok, right, you'll probably want to switch to Gradle or maven, I can help you with Gradle, but nto with Maven
Your issue here is that you quite simply don't have the JDA classes available in the jar itself
elect but it is there?
im getting the invenotry the correct way but its not get the Name
clearly not
You need to get the name from the inventory view, not the inventory
Yes, but that's referenced
Oh oki
@cold wharf What you'll want to do,
- download Gradle
- In Eclipse, right click the project > configure > add gradle nature
You need to modify your compilation settings so that it will throw jda in there
Not 100%, but pretty sure that you can select what stuff to export with the jar
Using eclipse works too, but I find Gradle more convenient, and its what I use π
Ill check real quick electronic
huh?
heavily recommend getting familiar with maven/gradle if you really wanna get into java dev
electroniccat I don't compile it, I extract it
^^ second that
Export, then at "select resources to export", select the JDA jar
π
export JAR btw, not runnable JAR
click on the arrow next to discord stats and select jda there
in discord stats add a folder called e.g libs, put the jar in that
For future projects though, use Gradle
Makes it a tonne easier π
I can't add that jar to that folder
why not using maven?
eclipse...had very bad experience with it
i mean eclipse isn't that bad but one should use Maven
I made a folder, and was able to drag in a jar just fine π
I don't know what that is
i did but the view is the first thing taht huts me
Maven / Gradle yeah, dont export using Eclipse π
you need to learn Maven/Gradle in the future if you really plan to continue on plugin development
switching to intelij was satisfying
I can't tho Dutch
did you make a package or folder?
DeadSpark but when I build in InteiiJ it can't find plugin.yml which is literally in there
Dutch folder
Odd, try doing it through Explorer instead of Eclipse
a lot of thanks for editing that sentence and I suggest using minecraft development kit with intelij for best experience
MDK is for Forge
lmao
the plugin is for every mod/plugin development...
Though, IntelliJ might have a plugin called that
the plugin is waht i mean
I thought you ment the MDK one can find on Forge's site π
mdk being Mod development kit there ^
What do I do?
Anyways, @cold wharf , I suggest you use Gradle or Maven, and not Eclipse for exporting
How do I do that?
I can only help with Gradle, Maven I cannot unfortunately
then you need to spend some time and study how maven works
WIll it work if I export it from Maven?
it will definetively be easier
yes, you can easily make a fat jar, thus with JDA shaded in, with Maven/Gradle
On Gradle all you need is the ShadowJar plugin, and add the JDA as dependency, then run gradlew shadowJar on windows, and ./gradlew shadowJar on linux
Uhmm
With that, I'm also stuck on a little problem I havent been able to figure out
maven/gradle are basically build tools designed to take over dependency management and building the output
with my plugin I need to delete a world (name known), but this doesn't really seem to work
So now I should download maven plugin and then export this with that and it will work?
So, you would need to actually create a maven/gradle project and throw your stuff into the way it expects
First I unload the world, then use File.delete(), however it doesnt get deleted
Well, no, you'd need to actually create a maven project
File won't delete a folder if it's full
huh, good point. How would you suggest doing it then?
You'd just recurse the directory structure
good afternoon all. can anyone help me with the following crash issue on latest spigot? https://www.spigotmc.org/threads/spigot-1-15-2-immediately-crashing.433384/
or you make the system execute rm -rf world/
dont think thatll work Fendi, since rm -rf world/ is linux only
Cat: Ill give the recursing a go
other than doing that, this won't work?
π€ I can probably use Apache common IO
Yea, they have a util class for that stuff
yep, and Im already using it anyways, so I might aswell here
@finite zealot The problem seems to be the world
yeah I was worried that might be the case π¦
Can anyone can help me install Maven on eclipse?
it is an old world
@cold wharf easier to Google how to do so π
@hidden glade reckon I will need to nuke that world?
Go to Maven's site on how to install maven
good idea. is there a guide on doing that DeadSpark? π
and the upload that world
happy to try that
just download the world play upload it to ur pc play it in single player using latest mc version
that must stabilize the chinks and then upload
np
switch to inteilij
@hidden glade talking to me?
maybe
FileUtils.deleteDirectory(overworldFolder); doesnt seem to work sadly
If so then I gave you the reason for not using the IntelliJ above
converting with singleplayer might help, issue there is that processing the block updates basically went sideways and induced some chunk loading
i have added plugin.yml but intellij doesn't add it to the jar
maven can do that too ^
100% boils down to how you set it up
So can eclipse
But I literally don't even remember the last time I used IJs built in compiler
I don't think I ever have
I never use IDE's build in compiler
well maybe except Visual Studio's compiler for C++
How can i get a Block or Location from a ChunkSnapshot
should
gradle or maven?
plugin.yml is here but after I buid artifacts, it gives error on console saying plugin.yml not found
boils down to your build config
cuz you need to tell Gradle/Maven to include it
and actually export using Maven/Gradle, and not the IDE π
dont do it using IntelliJ, use Gradle/Maven..
For how to, Google "How to export fat jar with maven/gradle"
added maven
if u get the plugin just make new project and everything is ready there
recreate the project with plugin
ok i do
What if it gives error?
dont ask me for nitro
just do it, ti will work
ignore my editing
do it once u install plugin
xD
yes it is and the plugin is for intelij
i didnt use snipping tool
so how was my 4 frame tutorial?
It's the Minecraft development plugin
I didn't try it I am trying something else and if it doesn't work then I will try MDK
I have the x and z of a block in relation to a chunk and the x and z of a chunk, get do I get the xy locatation if the block
wdym "in relation to a chunk"
atleast u understand that lol i didnt get any of his sentence
btw it is not possible to describe a chunk using only x and y
I assume you mean x and z
@remote socket give Player a vaiable lets assume its player use
player.getLocation.getX/Y/Z(); to get the players location in form of coordinates
aah idk if thats what he meant plz dont judge
id like to edit this sentence into grammar rip episode
Yes i meant x and z
I think they mean they have the x-z 0-15 of a block in a chunk?
^ yes
And have the x z of the chunk
correct
They want to do the math and get the coordinate of the block
Nonono all they have is numbers
I do not have a player
yeah i got it
No bukkit variables
^ yes thanks for understanding
Then you should just be able to add those components
which is 16 blocks
So 3,4 is actually 33-48,49-64
or the y variable i have π
yea
That would be the easiest way
Its too early for me to figure out the mathematical way π
...still just vector addition
unless I'm missing something or I still don't quite understand what's the problem
blockX >> 4 == chuckX
true
ah ok, seems like I was not aware of what the chunk coordinates are exactly
yeah ok that makes sense
yeah then shift 4 / multiply/divide by 16
and then you can add
but if chunk already has a method for it, you should use that
Guys what is the name of the usual player inventory?
elytra fly lets players load a lot of chunks within seconds, which can lead to the server files becoming really big/tps becoming low and crashing, is there a fix to this?
would rather not disable elytras, i saw somewhere that there was a plugin that stopped rendering chunks if the player was going faster than a certain amount of speed, is there a public plugin like this?
How do I get the location of top block? I want to get a random locaiton in a world but I also want it to be the top location so like it is not underground
Does anybody know the possible outcomes of CreatureSpawner#getCreatureTypeName()
@cold wharf World#getHighestBlockAt(Location)
Thank you so much
Does anybody know the possible outcomes of CreatureSpawner#getCreatureTypeName()
I really just want to know the format, like will it be Zombie ZOMBIE or zombie etc
@remote socket are you aware this function is deprecated?
@remote socket you should use CreatureSpawner#getSpawnedType(). This returns type... if you convert it toString you will get probably all lowercase zombie
Hey guys! So the plugin I'm working on works perfectly fine, however, I get this error in console and it points to this code here:
for (int z = -1; z <= 1; ++z) {
assert dirblock != null;
block.getLocation();
dirblock.getRelative(x, 0, z).breakNaturally(explosive_pickaxe);
player.playSound(player.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 30, 0);```
specifically this line is where the error is dirblock.getRelative(x, 0, z).breakNaturally(explosive_pickaxe);
and what error?
in console
I mean text of the error?
Hi can someone with knowledge of the WorldGuard API please dm me? π
@sacred wave What could it be?
@median wing are you sure explosive_pickaxe is not null?
no, exploive pickaxe is the itemstack at which I get the display name of
well if dirblock is not null, then explosive_pickaxe must be... nothing else can have null there imho
can you share code where explosive_pickaxe is obtained?
@sacred wave Not in 1.8.8 but yes ill take ur recommendation ty
didn't you mix super_pickaxe and explosive_pickaxe<
@median wing and you are sure that the dirblock.getRelative(x, 0, z).breakNaturally(explosive_pickaxe); line is on line 277?