#help-development
1 messages · Page 2276 of 1
?
google "1.19 spigot"
Should be first link on top
idk why this chat blocks the name of that website
yeah that site
I tried to make a guide from the spigot site and nothing came of it. (Tried through Buildtool)
search up "spigot download"
first link
not spigot
bukkit?
yes
Why so? Ive used it for years now
^
i tried buildtools
illegal for them to host, but not illegal for us to posses or download
But the download is stuck
wait a while BT can take a little while
BT normally takes me like 5-10 mins
its not a ItemStack
That is getting the numerical ID of a Material
which is for old asf minecraft
like back when if you wanted lapis lazuli you needed to add a duarbility tag lmao
any tuts out there teaching you how to add multiple version support to ur plugin?
You basically just develop for the lowest version you want to support
no but I wanna add more versions
like my plugin is currently 1.17
I want to add 1.8 support 3
*2
so what would i need to do to change all of it then
Usually youd have to use maven/gradle
someone get the bstats graph
And write a bunch of abstractions
Or use reflection
But then you lose compile safety
you won't be able to compile
you can compile with that code above
its from NBApi
that class is in NBTApi, the MinecraftVersion one
I cant cause the items I have added are from 1.17 only
Are they config options?
nop
Well you won’t be able to support 1.8 then regardless
Presupposing you use materials from more modern versions
yeah theres a bunch of api changes from the 2
Well unless you’d wanna change that ofc
like inventory names and new events
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html#getMaterial(java.lang.String)
This method is helpful for multi version materials
If the materials invalid for the server it should just return null
and you can handle it from there
Yeah a lot of things have been changed and obviated
You can borrow NBTApi's MinecraftVersion class, but its not gonna work fully for 1.8 -> 1.17 if your project is on 1.17 right now
eg inventory name getting was changed to getView().getName() in like 1.12
i see that error a lot in older plugins
and PrepareAnvilEvent is another big one i see alot too
or AnvilPrepareEvent, whatever tf its name is
oh god 1.8 anvil handling ._.
With this code, how am I meant to get a return from world? https://paste.md-5.net/yixabuxuta.java
or any other flag
and this line confuses me
PROCESSORS.get(element).andThen((acc, list) -> list.clear()).accept(accumulator, commandArgs);
I've never seen this before
andThen
Accept
I googled it but I'm not getting a great result
This looks like code from smile
hahaha
I'm not entirely a beginner, I'm somewhere near intermediate
obviously not at whatever level that is
Well you clearly haven’t touched the BiConsumer but yeah
It’s usually not needed
Because code can often be represented with more clear intent
Ive never used them before either tbf
So I did a quick google and it says it doesnt return a value, BiConsumer
Optionals and Completable future 
I understand that code, but I'd never use it
HOWEVER
the biconsumer instance itself does have some methods
Such as andThen
Since a BiConsumer is effectively just a class with a single method that you override
And andThen is just a helper method at most
its basically saying, get "this" and then do...
so how do I get a return?
You don;t "get a return" from teh Processor. Its passing into a lambda
which it then processes with teh accumulator, args
So is there another way?
I'd have to read back what you are actually attempting to do
ok#
well all your code goes in the WorldCreationAccumulator
in teh complete method you do your actual world creation
force, world, type you process teh values passed to define your world creation
right
thats one way
and just to be clear im doing world creation stuff
it was just the example he gave me
eg```java
private WorldType = WorldType.NORMAL;
public void type(String name) {
type = WorldType.valueOf(name);
}
and I can show you my actual code if it helps give you some perspective
so
Thats a bit annoying
Sure
Actually
Does assert key word work in the plugin?
But it doesn't seem so It keeps skipping my checks
https://youtu.be/tj5sLSFjVj4 @shadow zinc
Full tutorial for Lamba expressions in Java.
Complete Java course: https://codingwithjohn.thinkific.com/courses/java-for-beginners
Lambdas in Java can be very confusing and hard to understand for a beginner Java learner, but they don't have to be. Lambda expressions allow you to create a method implementation as an object, and you can learn ho...
broadcast length of args
whats this for?
For you to learn at a deeper level what runnable, consumer, bi consumer, function, bifunction really have to offer
Yes
But you need a jvm flag to enable it
But it’s usually not prefer to use assert in actual production because it slows down the code a bit
So it might not work... 😦
Precisely
I just wanted to minimize the lines 🤷
You can write a validation function other wise
static void validate(boolean expression)
or sth
how to prevent player from getting stuck in the wall when teleporting to random coordinates?
Tbh I have one 😂 But assert looked cooler
You’d have to check adjacent locations recursively until you find a 1x1x2 spot
Ye
It’s one of the ancient keywords people stopped using due to JUnit being significantly more reliable and performant
(As assert was mainly used for tests)
I have so a very long teleport
i love this guy
https://www.youtube.com/watch?v=YpS0Jh5yqIw
I would want merch with quotes from this video
How to write horrifically awful Java code!
Complete Java course: https://codingwithjohn.thinkific.com/courses/java-for-beginners
Any fool can write good Java code, but it takes an expert to create truly awful, unreadable, impossible-to-maintain Java code. That's what we'll be learning in this lesson!
What makes code bad? There are many ways yo...
Lol
Well I guess I should use this method 🤷 (AssertionError is handled by plugin as a command failure and won't cause any issues)
sir you have a double s in your string
Not the assertion error
It’s not meant to be caught like other normal unchecked exceptions
Why not?
If it throws it means something went terribly wrong under wrong assumptions
Which I assumed in the command 🤷
For instance the class Objects.java throws it in its constructor as a way to tell that it should not work to create an instance of Objects
The handler only handle the commands not general
(Not to be confused with Object)
you should have your own runtime exception instead
Then
It’s much more expressive
and reusable for that part
Ye
Though UnsupportedOperationException is better suited there
doesnt that extend runtime exception
It Looks very much as If IllegalArgumentException is the correct one
For utility classes to dissuade their instantiations assertion error is used
Or in the collections framework
Then whether that’s the best choice is another part
Ye
I guess I'll use CommandException then 😉

I thought assert will work... but since it does not, Custom exceptions are ok
Ye
ChatColor#of in 1.18?
Assert is pretty much useless anyhow
Yes
You’d use bungee chat tho @frozen cedar
(Since as aforementioned we have JUnit)
It May Prove usefull for IDEs
My assumption was that assert will work so I made my API catch AssertionError and handle that
Given that assert will be a NOP in prod
Hmm how do you mean? Like to disable inspections?
But I can change the API 🤷
Well to explain to the IDE that a value is actually not null
Well Objects::requireNonNull exists
Requires EEA
EEA?
Eclipse external annotations
I want to make a system where players can put an item in a menu and can retrieve those items through a different means later and when they reopen the menu, the same items with the same nbt properties will be there. How should I go about storing this? I want it to be scalable to hundreds and thousands of players, not just a config file, system memory or something that can easily break
And given that Objects#requireNonNull is a Generic Method, Eclipse will get a Heart Attack either way
I usually use my own requireNonNull Method due to that
sounds like a bit of a problem concerning Eclipse
It's an issue that is inherent to null checking
Well in IntelliJ requireNonNull, a null check or well if you really need… assert, all three work (or @SuppressWarnings)
Myeah null sucks anywa
hopefully you guys null every var after used
Sorry, I only use the operand stack
(Not to be confused with the frame Stack)
Scalability in terms of what? Throughput?
First you do need the vertical scalability, but assumes you’ve maxed that out sounds like you wanna have some underlying datastructure there
anyone can help pls ^
why am I getting this error?
First of all, you're using Paper (This is spigotmc), second you're using 1.8.
Third, something you did threw a NullPointerException. Can't tell more as I don't know your code
You missed some of the error. the very next line tells you where teh error originated
Hey, I'm trying to verify if a item has a specific display name but the name has color. I tried to add the color to the verification and only the string without color but these 2 tries doesn't work. How do I do that?
don;t identify items by their name
?pdc
?pdc store a flag in the PDC
Oh okay thanks
how can I replace/remove biome from generating, like removing the oceans in blockpopulator
Biome is an Enum so I guess you'd have to custom gen your world if you want to exclude a biome.
frick
well you could specify the biomes to use in teh WorldCreator generator settings
how
frick again
what is the best way to identify a player?
is there like a unique id or something?
uuid
how do I obtain it?
thanks
never store player instances in some kind of collection too
will it be the same when they rejoin?
yeah
can you obtain a player instance from a uid?
thanks ppl
Bukkit.getPlayer(uuid) yes
WorldCreeator has a BiomeProvider you can set.
i guess check the docs
is it of the builtin java type UUID?
yes
I found this
Field biomesField = BiomeBase.class.getDeclaredField("biomes");
biomesField.setAccessible(true);
if (biomesField.get(null) instanceof BiomeBase[]) {
BiomeBase[] biomes = (BiomeBase[]) biomesField.get(null);
biomes[BiomeBase.DEEP_OCEAN.id] = BiomeBase.PLAINS;
biomes[BiomeBase.OCEAN.id] = BiomeBase.FOREST;
biomesField.set(null, biomes);
}
but I have only Biome class and no BiomeBase
don't mention 1.8 here or people will send you death threats 👀
💀
lmao
because people can't stand someone uses other version than them
that version is older than my grandma thats the issue
you see?
this one is good fr 💀
https://pastebin.com/kG4e1Z4t anyone know why this would be lagging my server? its supose to load a schematic using FAWE over a period of time so its kind of in rows which it does fine on a small scale but i have a relatively small schematic (20x20x40) ish and it crashes my server ;p im loading it over 1000 ticks so its not like its all being set at once
Does somebody have run Spring Framework inside plugin?
Why would you run spring inside a plugin? Do you really need all the features of spring?
Custom BiomeProvider https://github.com/DerFrZocker/Single-Biome-World
Like its more handy then using raw implementation of http server or websocket
It's pretty bulky for a plugin.
Ye I know
Doesn't justify it
Also did you run 1.8.8 build tools?
What does doesn't work mean
What? You shouldn't be compiling build tools?
Just download the jar from spigot
What's the error
check also your java version you is trying to compile 1.8.8 version because needs java1.8 or lower
you have java 9 or higher version installed?
maybe versions are confliting in %PATH%
😄
oh yeah, its patch script
And this is the latest version of buildtools from the website?
seems to someone wrote \r manually in file instead of enter newline?
seems that is considering \r (carrigage return) as non newline char
hey guys, I'm trying to access the firstPlayerSpawn and secondPlayerSpawn from a different class and for some reason I can't even access them in my getter method, I tried using public but that's not possible. any ideas on what I should do? ```java
public class SetLocationCommand implements CommandExecutor{
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(sender instanceof Player) {
Player p = (Player) sender;
switch(args[0]){
case "1":
Location firstPlayerSpawn = p.getLocation();
break;
case "2":
Location secondPlayerSpawn = p.getLocation();
break;
}}
return true;
}
public static Location getLocation(byte b){
switch(b){
case 1:
return firstPlayerSpawn;
break;
case 2:
return secondPlayerSpawn;
break;
}
}
}
I just compiled 1.8.8
Are they public and static?
They are variables
i think static will not work
oh god
Not fields
since its per player i think right?
Either way they have to be via an instance or static
no these are supposed to be static locations

you can do some static Map<UUID, PlayerPositions> and that class PlayerPositions will hold these two positions
dont have static locations, if another player executes that command, they will be changed
and that Map you can make it static
they are not player-dependent, they are supposed to be global
check this
that's the point
then you check uuid in Map, if contains fine take and update values, or else add new
dont see a reason to use a switch or a byte too
E F F E C I E N T
also switch on java isn't well optimized by compiler
?paste
I will just initiate the variales outside the onCommand method and set it to them, screw getters and setters
^
Tech debt doesn't exist it can't hurt you
basically steal some spawnpoint code from another mini-game's code
I smell large design flaws and bad practices
oh gimme amin
no lol its spigot
bakin rn, want some?
don't work emoji as image :/
not Spigot, thats paperspigot
No keep that shot away from me
ah
any ways to keep phyisics state on falling block on paper?
Wtf is paper spigot
tf is paperspigot?
i was doing an airdrop like system, but falling block just got teleported to floor
Who doesn't know what Paper||Spigot|| is?
SpigotPaper?
a spigot with a piece of paper in it
an work around i did, was using an minecart with an blaze mounted in 🤣
🗞️
Yes
U know what paper spigot is
😋
wtf is spigot
I'm not even joking I actually have no clue lol
wtf is craftbukkit
Where is the whereami command
its paper lmfao

Hmm I thought they were papermc
They used to be paperspigot
Nah theyre name is PaperSpigot in logs
Oh
or spigotpaper
Never noticed
whatever the fuck
pretty sure paperspigot is very old and no longer active
prolly legacy
can I call a function from the main class from a command class?
maybe
They still have its source code as a branch on github tho
do u think global banning from mojang will be a good idea?
nope
i could think lot of trolls reports every second, and people getting banned for no reasons
?learn java
Oof
oneword
well
?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.
Got me
I know I prob can
Player#setFallDistance(0) not working to prevent fall damage?
its basic java knowing the answer to that (not you brush)
but I dont know how
maybe ticking every second
Lol
idk if fall distance is calculated every player move
cancel damage event
EntityDamageEvent should have a getCause
I think that's a thing in Bedrock
because you can do /damage
and specify a cause
No it's not lol
I think it's a bukkit api thing
yall thinking lol? im sure
there is /damage in bedrock
imagine
same thing in java its just not a command
you can damage a player with a specified Entity
but to prevent falldamage for unvanished players, add the unvanished players to a list that clears them from there after x seconds or after taking fall damage
and after that you can figure out what to do 👍
ah yes i post a pic of a warden
Hey, I need to fetch a offline player by their name but I cant lag the server, is there any way to do that?
aight thanks
Make sure to go back to the main thread when using the api
nest runTask in runTaskAsync
runTaskAsync -> getOfflinePlayer -> runTask -> do other stuff
or use some CompletableFuture whatever you want lol
TaskChain :)
dunno what that is
It hasn't been updated in a while though
negative value
and then fall damage is blocked?
my command wont execute. it says the command does not exist even tho I did register it
How would I go about doing that? Because every single video that I watch they all say to replace the texture of an existing block
Did you set the command executor
think so: getCommand("shstack").setExecutor(shstackCommand);
And did you register that in your plugin.yml
?plugin.yml
system.put.print('Plugin Enabled'){ throwing error
uh
You dont see why?
prob the curly brace
I have a feeling someone has lacking Java skills
'put'
like this isnt ugly lmao
Oh it should be comma, my bad
custom block models minecraft <- googled that and found quite a few guides
what
No
I started Java Yestarday, I'm trying to build my first plugin today 🙂
Oh no
lmao
You did not learn enough Java in one day
I did, it was learn java under 14hrs Video
you can't learn enough Java in one day
quite informative
bro
videos are bad
this gotta be a troll
you a pro now
Keep going. You'll get there
it did not pay off clearly, also search for 'tutorial hell', watching one video does not get information in your brain
Just dont jump right to a minecraft plugin
You should learn from other base java projects first
Its like trying to run when you cant walk
i did
Yup yestarday I completed Java, today I'll start with Java Script
quite productive day
this is a joke
troll confirmed
i know how to program in spigot
I like trying and faling, googling tons, repeating until it sits in my brain
stg someone always coming in here thinking this type of stuff is funny
Which is how it should be
No one is able to learn a language in 14 hours
Your brain needs to sleep, and reproduce over and over again before it actually learns
wasnt there a guy who learned spanish within 2 days
I did, now I'll start with Java Script today, ahh its 12hrs long video ;-;
but gotta do it, aim high.
actual languages are different
i could prolly learn a basic convo in spanish in a day
yes much easier
is tomorrow going to be C?
ill sound stupid and no accents, and inpror grammar but ide still do it
this is a help channel, can you at least go to general...
why? if you know java, you know javascript. both is java.
No, one is java language, one is java script
tmrw hes learning to write java from smali code
writing binary
hes gonna jump into binary
Tomorrow he finishes AI
both have java in their name so both is java.
^^^^^
5 hour long binary video
i dont get why people dont understand this common mistake
anyways, I have a question
I want to include a library in a plugin. the library itself is not a plugin, so when I put it in the plugins folder it gets angry. How do I supply a library jar for a plugin to use?
Shade it into your plugin
shade it in
Shade it with maven or gradle
you could try shading it
Which one should I start first Java Script or C?
LOL
add it in your plugin.yml libraries section
i would try assembly
CScript maybe? /s
Java Script more like Java Shit
the entirety of this chat: shade
it is used by multiple plugins
Why not Holy C
lets go write assembly
Good point lol
Name one mainstream program that uses raw C
can we rewrite spigot in assembly
I don't know
I don't use C lol
netflix
same 
windows
no
does this stop it from trying to load as plugin?
Does objective C count as C?
discord
oh shit true
yes, it tells spigot to download it for yoru plugin
yeah i guess most os's would use native c
C++ kek
Anyways guys gtg, was just kidding, mb
since its closest to the cpu
i mean they are using nginx
and nginx is c
but the library itself is not a plugin
its c
Yes, thats why the section in the plugin.yml is called libraries
where does it download them from
I only have it locally
maven
oh ok
if its a local libray you have to shade it into your jar
eh
hmm I don't really want to shade because I want it to be used in multiple plugins on the server
Cope then
yes, create a libraries folder and put it in there
Ir that
that would require a custom jar
wouldnt work if you wanted it public
but you wuld just build spigot yourself
ya that might be it
with your added maven import to it set to shade into the spigot jar
Nevermind I will just make a base plugin that shades the library, and use the library via that
I never cope :P
what gambling games would be good to lose your inventory with
I read this one, but it does not specify how to include it in an external server later on
this only works on a local server I think
my code full of bugs i love it
you just put the plugin into the plugins folder
hmmm
cow flip
its a plugin that works as a library iirc
no I mean the library that's not a plugin
yeah ok
cow flip?
add the dinnerbone tag to a cow and make it like a heads or tales thing
for now i have roulette(roll), coin flip and blackjack
oh good one
wtf thats great
how do you think of that
yep, can add in a slowing effect too
How should I go about returning the result of the loop in my method which only accepts an int as a value?
I think of some rly whack shit
stick around
next idea i come up with might be pure stupidity
burchard wanna contribute
bruh me trying to get a weakreference's value which has no value
return a list
what are you trying to do
have a holder variable
int x;
x = i
return x
why is finalize() deprecated too?
make the initial value -1
It's a util I have for guis but I only wanna fill those slots, it uses an interface which accepts an int for the slot of the item
if getThing == -1 it was invalid
yeah then make some specified "invalid" value ^^
public int getSlot()
int[] stuff = {. . .}
for (shit) {
return thatNumberFromShit;
}
return -1;
}
That would work...?
public int getSlot()
int[] stuff = {. . .}
int returnValue = -1;
for (shit) {
returnValue = thatNumberFromShit;
}
return returnValue;
}
this way is dirtier tho
Aight I'll give it a try, thanks
@noble lantern
what exactly are you wanting to return
not rn working on other things atm 😦
shame on you
cause rn that will always return 13
It's an int for the slot in which an item will go in
So your trying to just get a random slot from there or?
is WeakReference#clear actually useful or can it be ignored?
no, the slots in my array
WeakReferances get cleared when no longer in jvm
oh
then why wouldnt you just return the array?
when no longer in jvm?
nothing holds a reference to it anymore
Cant, my util works off an abstract class that accepts an int
so no need to actually call clear() by your code?
no
Well your gonna have to make a way to get a value other than the first one
That’s why it’s useful for storing Player, World, and other objects similarity
cause rn that only returns the first number and thats it
if your wanting to return all those your gonna need something other than a int
ok that will solve my issue then
ie array
Aight, I'll just copy and paste my code for something that accepts an array and I recon that'll work
thanks
you can transform your code lib
to take a Integer varargs
it would be simple just pass varargs to your single int method in a for loop
that way you can directly work with the array
I'll see
ehm how would I access a shaded library from another project
but like
in that case
ik what you mean
you need to have the other plugin have a scope of provided, and get the instance of the lib from the main plugin
it can be shaded in to, but dont initialize it
but provided is the typical use case for things like that
Base (not a plugin)
BasePlugin (shades Base (Acts as library to access Base))
OtherPlugin (uses BasePlugin, wants to interact with Base (static methods etc..))
basically a middleman
yes
OtherPlugin would import Base as a provided scope (Can be shaded but dont initialize it in this plugin)
OtherPlugin would get a static variable of your lib from its main class in BasePlugin
oh ofc Base is in the scope because BasePlugin has it
a playerquit even is fired for everyone when the server stops right?
should
Yep
just
make sure
OtherPlugin hard depends on BasePlugin
and itll be gucci
nice thanks!
im pretty sure it doesnt
maven shading and that kinda stuff is quite overwhelming tbh
its simple once you get used to it
This might be a stupid question but how do I let players move items in their inventory but not in the menu? and how can I go about differentiating the 2?
getView().getTopInventory()
youll have to check if they did click on top inventory though ofc
ofc
i was wondering how i could initialize a static variable in a non static method lmao
android
basic lmao
ehm^^
yeah took me a good few seconds to realize that thats possible lmfao
android is aids
anything that requires waiting
needs to be async
or the whole app freezes
gotta do ios next year too 🥺
if you ever have an app where you support apple
only like the programming and networks stuff
just drop the support
fun
If I want to replicate a repeating commandblock I would put stuff in a while loop right?
while loop on the main thread will block the server
Ooo
oh so your telling me i cant do this
dunno why a commandblock if you can do it by code too
fuck
i needed to be able to use it differently
ig the impl is terribly bad
i wanted to change around the normal callback listener as i wanted this method to be blocking and return a value
without it its hard to return a value cause its locked in lambda
this is fine to be blocking for this method
just sucks i gotta resort to sleeper thread
Maybe it possible to await the task with a dead line?
never done await in java before
Nah doesnt contain those method just ability to add onComplete listeners
as well as a shitload of other listeners
Its not a normal Java Task its some funky Google transformed task
import com.google.android.gms.tasks.Task;
Yeah figures
CompletableFuture#whenComplete but android...
theyre entire impl sucks for this ngl
gotta love next year college
Is it possible / safe to use paypal api to processes payments ingame? I havent dug into it too deep so it might not even be possible
?paste
lazy fuckers can even type Reource
so like if you want login_button
R.id.login_button
actual front end doesnt suck tho
please ignore my shit styling
And its layed out using xml: https://paste.md-5.net/ifedebazac.xml
But the editor lets you draw/drag around and shit
Sorry for the sudden chat.
Now my question is, how do I get the behavior that when I click on the colored glass, it takes me to another server registered in BungeeCord?
||Also I do not speak English so please forgive me for the difficulty in replying and reading the conversation...||
pmc
do you already have the inventory being set up?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
No but inventory is fairly simple
database is mongoDB so its just an array of objects
yeah bmc not pmc I'm stupid, same idea
the hard part is gonna be the things i want to call units
The game is gonna be a botnet simulator in a sense, i want people to be able to have virtual pcs and they can be upgraded individually/in mass
Thats gonna sucks because people can potentially have thousands of those objects and i need to figure out how ill compress it
Have you seen how many objects minecraft has at once
Big Massive Couch
A few thousand won't be a problem

Minecraft had about a Million blocks alone loaded when I last looked at a memory dump
Anyways make your application first. You can worry about tiny optimizations later
does someone know how to use NBT components with the component system from net.md_5.bungee.api.chat? There are components for scores and keybinds but not for NBT data...
Can I maybe send JSON directly? or create my own Component by extending BaseComponent even though it's deprecated?
Don't know if you figured this out, but it looks like you can do Tasks.await(task, 10, TimeUnit.SECONDS);
(the time is optional by the way)
Sadly its a google Task
Not a Java task
o/
prolly would of never found that
oh thats microseconds, should be milli
stupid auto complete
was about to say that
essentials code is fun to look at 🤓
when your on your 4th week of java and pissed at the code
so you just return anywhere to make the code work
i have such things in my code too
ive been trying to avoid angry code syndrome
TCP Client waiting for a response from that server: Hello? u there?
time to finish this stupid google oauth up im tired of working on it
lmao this looks so stupid why dont they use a completablefuture
And dont forget
has litterally all the stuff
they have 5 other ways of doing that
with 2 other libaries that can do that
its a mess
smh
theyre official docs suck
i had to figure this out on combination of sheer luck, looking at multiple google docs, and stack overflow posts from 2014
theyre actual REST is documented good
but theyre java lib sucks
oh no hopefully they wont let me code in kotlin at college
theres legit methods that dont exist on theyre guide when you go to try it
let or make
Is there a method built into spigot to check for a specific armour type?
Like chest, helmet so on
nope
Aight
just look at teh material
Bit messy if I'm checking for every type of chestplate
if arg[arg.length -1].endsWith("LEGGINGS");
or just
enum.getName()
then endsWith
Yeah I was gonna check name comtains as I'll have custom names
but itll still have chestplate, leggings whatever somewhere
when someone gonna ask for help with networking
essentials code?
ye
Like Fiery boots of the fiery order of souls powered by magic from the cave of tern eaten by todert owned by {player}
the mc community doesnt deserve this
I have
🙂
but It's only for me
has alot more just every essentials command tho
for what
setFallDistance(-1) not working too lol
sir
we went through this earlier cancel the damage event
xD
afaik, the Android SDK doesn't include all Java modules. CompletableFuture may not be included. That, or Tasks were added before CompletableFuture existed
CompletableFuture confirmed does not exist on about 6% of android devices
i could add the player to a collection but mehhhr
Which in and of itself is a problem lol
I dropped support for that % just to get CompletableFuture
They probably made it in a reactive way due to that java threads are a bit expensive yk, so a reactive asynchronous style does make a bit of sense
Its just unhelpful for me because i want this stuff sync
atleast a bit
Added in Android 7.0
they dont offer sync options
choco actually showed me something badass
no more thread sleep
still looks pain
the await method which suspends thread activity until the computation is completed (eventually exceptionally)
its all in sync now
I have no use for any async actions google provides, because this method entirely its called async
Which is nice
Just weird they dont offer a get() like future does with Task
It’s similar
yeah just a little more code to work around with
Mye
Well, to be fair, it does have one. It just doesn't wait for a result. It throws an exception if not yet complete
CF has one of those as well iirc
Or well Idk if it’s more, it’s just different from my perspective
Yeah join()
Yep thats why i was doing that thread sleep on isComplete haha
What do you guys suggest where I could learn to code plugins?
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.
Well I know the basics
basics
hmm
how would I remove a single item from a players main hand
if you know java you can google "How to do x spigot"
this is 90% of my time developing plugins
getItemInHand.set current amount -1
and then do what works for you
alright thanks
tip
NEVER
EVER
i mean EVER
run that piece of code in a Runnable/BukkitTask
it leads to dupe bugs
im guessing you learned that the hard way
Opinion on the ability to set the brand of the server?
Elaborate :0
how would i go about creating a scheduler or thing which sets a player to afk after 5 minutes and then kicks them for being afk after 5 more minutes?
well you know on the f3 screen there is the server brand
Oo that’d be really cool
Didnt know whether to introduce api to change it
nah
personally really dislike it
gonna get 9 year olds saying they made a custom jar
you are using software people work hard on for free. the least you can do is keep the branding
^
Is there an easy way to check if a hit in an EntityDamageByEntityEvent is critical?
Mye well if you really wanna change it just doing some packetry shouldn’t be too hard Ig
Hmm that is a point, but at the same time
prolly is doable with reflection too
nopers
i assume that strings stored somewhere
dont think so
Look into ScheduledExecutorService
stackoverflow how to save a list to a database be like
the string is returned from a method iirc
Yep
And also Duration and Instant might be interesting
but yea, if you wanna change the brand name, at least put in the effort and fork
I use those for my log timers haha

lord have mercy on my soul
i dont really think its that big of a deal. Like i dont look at a server and think "wow its a paper server"
i do that if its a custom fork
if it isn't a big deal, then changing it to your thing is also not a big deal and not worth it 🙂
Like "oh wow xyz cool"
Currently struggling to make sonething like this, how should I go about it? https://gyazo.com/0c52a60e3d27e47e3eb3272aecfb3365
bruh i really forgot how to insert a whole collection to a db table? are that just multiple statements then?
fair enough lol
What do you have rn
Do you have any non functional code written
iirc there are plugins for it as well. ¯_(ツ)_/¯
which could use api instead of packets
Nothing really, just multiple drafts
but doesnt matter
It's for something alot deeper then this
again, I think they should put in at least some effort
I wanna get the item and store it in a db and give it to the player when they call for it
I wasn't talking to you xD
but thats not relevent
I was talking to olli
Basically theres gonna be 2 inventories there
You gonna need to wait to use the inventory type to differntiate
ooo
Ah

