#help-development
1 messages Β· Page 2195 of 1
click the maven reload button
click the "m"
no
what
the reload button
click the maven tab and click the 2 arrows
π
please
is that a plugin or an api or what
Does someone know what could I use instead of ArmorStands to make holograms?
Right hand side
is this on the side of your screen
nope
How do you use maven and not even know where it's at π
that's from spigot and it makes more block in chunk, but idk how so I'm asking as I wasn't able to find help on google
Multiple monitors pog
then ask the plugin owner
yeah im sorry that isn't there
do you have a pom.xml file?
3 :3
yessir
whats wrong with a second monitor lol
i hab pommers
you did start the project in maven right?
right click it. does it say "Add as maven project" at the bottom?
and not just created a pom.xml file
I'm the plugin owner?
Nothing. I was βpraisingβ him for having multiple monitors.
i asked if it's a plugin or an api and you said its from spigot
π
its right there under where the build stuff is
Yea indicating its from the spigot api xD
Funny guy I
it makes more block in chunk? what does that even mean
it is from spigot, it's a class, it's not a plugin
there will be a "Maven" tab
right
View -> Tool Windows -> Maven
Lmao
declaration: package: org.bukkit.generator, class: BlockPopulator
read this then
ok i have mavne
click the reload button now
whats up with ur google lmaoi
rip monitor
populate(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, LimitedRegion limitedRegion)
ok so wanna add the plugin version here
any ways to add it?
your plugin version
only works in the main class
you can just use a string if you like
bruh
wanna grab it from plugin.yml
get the plugin instance?
Pass in the plug-in instance
Through your constructor
plugin.getVersion() or whatever it is
what
now you can use the api
just follow the fricken thread
he says literally everything there
all the code is spoonfed right to you
pom err
what error
nvm
bruh
Bruh
is spigot resource https://www.spigotmc.org/resources/essentialsk.102473/
omg
Mind sending me that updater framework or whatever itβs called
then get your ID?
mfnalex's updater https://www.spigotmc.org/threads/spigotupdatechecker-powerful-update-checker-with-only-one-line-of-code.500010/
is that what i put
#checkEvery(long, TimeUnit) when
update checker*
wait is the update checker hard coded to only do spigot resources, given that it's taking a spigot resource id instead of a link?
π€
lol
Thanks
moyai
the id
jesus christ
private static final int SPIGOT_RESOURCE_ID = 59773;
it says ID right there
so
new UpdateChecker(this, UpdateCheckSource.SPIGOT, "102473")
he keeps asking me about YOUR api
deveroonie is trying to add it to his plugin
without even looking at the wiki properly
who?
lol why are you making it a string
deveroonie
"bs"
to allow stuff like custom URLS
and to allow using the %%__RESOURCE__%% placeholder
oh that's why you need what I proposed
bruh its all on the thread just look at it
I'll PR it sometime
just write your own updatechecker, problem solved ez
@tender shard is this right
new UpdateChecker(this, UpdateCheckSource.SPIGOT, "102473")
looks good
potions get their color from a template sprite and then apply given color. is it somehow possible to apply this behavior to custom item sprites non potion related too?
for example in paid plugins you can do java new UpdateChecker(this, UpdateCheckSource.SPIGOT, "%%__RESOURCE__%%")
that's why it's a string
the update checker shouldn't depend on spigot ;-;
it doesn't
they would have to be a potion unless you mod it
updaterijg
noone forces you to use %%__RESOURCE
you could also simply not use that
so no, my updatechecker does not rely on spigot or anything else but the bukkit api
immediate update notifs would be so hot
you can do that
lets go
jar goes from 12kb to 42kb
that wouldn't do what he's talking about tho
Nemo addedf the consumer stuff though
its tiny it doesnt matter
he means like he posts an update and all running servers instantly get the message
42kb is nothing
all my plugins are like 1.5 mb
how do i prevent spigot from removing ghost blocks on interaction
couldnt i let my item inherit PotionMeta ?
not sure how that would work in a client-server context
What does codefactor.io even do
adding a new item would need the server and the client to have something installed
yell at you for stupid reasons
custom model data
Idk how i got an A but some abomination of repos get A+
i see so not an actual new item
no
codefactor is upper bullshit
is it possible to make use of the potions color system with a custommodeldata?
i mean you can have a texture that changes based on some properties
just have a bunch of tesxtures with different colors
if you use a texture pack
then probably yes
and set the property in the PDC or something idk how that works
59.3 KB
ik how i can hardcode new item sprites
with bStats and Jeff Media update checker
π
wdym
before i shadowjarred and stopped shading all my libraries my plugin was like 10 mb
you can always generate sprites on the fly and resend them to the client, just dont do that too often
a version that came out 2m ago about to be outdate
10 MB?!
i want to use the potions color system on other items only using a resource pack and custom model data
that's almost enough to run a whole MC server lol
i forgot to remove some libs
like the entire google commons and stuff
use lether armor instead
i basically nebver removed anything from my pom because i forgot
Today I'll show you an exceptionally cool trick on how to design new blocks within Minecraft itself!
βΊSubscribe - http://bit.ly/Subscribe_Sarc
βΊFollow Me On Twitter - http://bit.ly/SarcTweet
βββββββ
Other info:
βββββββ
Music: http://incompetech.com
Sound Effects: http://www.freesfx.co.uk/
it is
he does something similiar
it'S 13.99β¬
nvm Im stupid
how do i convert a string to an offline player
that's because its very useful
you don't
I saw your download thing but then realized, well duh he'd be logged in
any workarounds
a discord message
wtf
yea
LFMAO
wtf
i agre
@tender shard
tryna do !stats player in jda
ty
why cant i download 1.1.0 of my plugon
anyone get any idea?
i know i could just resend it
why do i habe to download latest
but that would send 2 block changes
and i just want to prevent the "air" one from being send
go to "Version History"
yeah i have
then you can download any version
you can download any version from the version history. unless you used an external link
click the "Download" button
then what happened
i think thats a problem for #help-server ?
no
then how is that coding related?
im showing that essentialsk updater works
oh okay
your essentialsk is outdate

Enssentialsk is already a plugin
uh
ππ
how can I make more ores generate, anyhow except using ChunkGenerator please
i am pretty sure Essentials + [any letter of the alphabet] is already taken
essentialskock
EssentialsΓ
lol
just make the ores drop more items 
yea bro
is there a way to get the playtime of an offline player (ignored)
the word Essentials isn't trademark worthy anyway
gamers is this static abuse? https://paste.md-5.net/wiyohikuju.cpp
im trying to win an argument
Possibly
hm that depends. if you ever need more than one config file? yes. If no? no
how do i check if args is player
Just pass the file path int he constructor
and not droping more items from ores
i'd rather put the stuff you have in the setup method into the static constructor of the class
it's spelt "gaymer" btw
mbmb
static {
//your setup code
}
I always use this for custom config files https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/de/jeff_media/jefflib/ConfigUtils.java
lmao
noone
how do i prevent spigot from removing ghost blocks on player interaction
ive tried jeff lib already, redlib suprememcy π
of course redempt's lib has some useful features but so does mine
it's not like you'd have to choose between one of them lol
there's a method to show fake blocks to players, listen for clicks and call the method again
but then it would send 2 block changes to the player every time he clicks, is there no way to just disable / cancel it?
?
what does jefflib have that redlib doesnt
tons of stuff, check it yourself https://hub.jeff-media.com/javadocs/jefflib/
package index
yeah tuples are weird
one should rather create a custom object instead of using tuples
but what if i am weird
can you link me the github
lmfao
then I love you π
do you want to be loved by me though? probbaly not
yes i do

but yeah tuples suck
I mean sometimes you just need to return two objects and then a Pair<A,B> is nice
but most of the time creating a custom object that holds both (or more) values is better
no
for example this is something where I consider a Pair to be ok:
public @Nullable Pair<String,Boolean> isItemBlacklisted(final ItemStack item) {
if (!Stepsister.allows(PremiumFeatures.GENERIC)) { // Don't add feature here, gets called for every item on death
return null;
}
for (final BlacklistEntry entry : itemBlacklist.values()) {
final BlacklistResult result = entry.matches(item);
if (result == BlacklistResult.MATCH_IGNORE) {
return new Pair<>(result.getName(), false);
} else if (result == BlacklistResult.MATCH_DELETE) {
return new Pair<>(result.getName(), true);
}
}
return null;
}
If you compile your plugin with a higher version and run it on an older server then yes.
anythin that's only a bit more complex should not return a Pair but something like MethodThatWasCalledResult instead
why not just returning a nullable string?
How might I make a projectile pass through solid blocks?
ah wait
because I need both, the "reason" string and the boolean
i see mb
Thats quite hard to do. In addition the player does compute the expected flight path in parallel which will result
in weird behaviors.
yes
the benefit is that you always know that this object will never change
well
not the object but the reference
that seems kinda dumb
not at all
almost never
still gonna do it
@lost matrix my other thought is a packet based strategy
let urmom = gay
Your first step should be: Canelling the ProjectileHitEvent and see how far you come with that.
gay = more sex though
π€
In what dimension?
I would always make everything final
βThis does NOT prevent block collisions, and explosions will still occur unless their respective events are cancelled.β
says javadocs
Then you need to tinker with nms and/or packets.
Its quite the task.
hm idk you're probably hetero, so imagine this:
You're looking for a sex date. You open Tinder (or any other dating app). You write with some girl for half an hour before you realize she's not interested in you. Meanwhile I already sent my date home again lol.
that's how Grindr works
I wish I knew how to make custom entity classes server-side π
isnt there another gay dating app
like bumbl
or something
erm tbh I don't know. I actually stopped this "dating app" shit a few months ago
thats not gay
Maybe I could tamper with projectile movement AI or something
I only know GayRomeo and Grindr
Grindr is where it at
gayromeo π
only weirdos there >.<
Thats not even close to an uninterrupted chain of causality. lol...
and imajin, imagine: if mfnalex says that someone is weird, they definitely must be weird
so yeah all dating apps suck lol. I just want someone to cuddle with π΅βπ« lol
i thought you had a boyfriend
yeah but he has corona since a week now
im not going out of my way to drive to someones house
oh that reminds me to do a rapid test rn
Get a body pillow 
lightning mcqueen body pillow >
lol
garfield lol
had one since 2009 or something when i was a kid
i have the crocs
i thought it would have decomposed by now
whats a body pillow btw
pillow with body inside it
just a massive pillow u can hug
or do other stuff
waifu body pillows are mid
Mods pls delet
shes 2d

its fine
how do i prevent spigot from removing ghost blocks on interaction
myes gimwe huggs
woah wtf
if i saw that irl i would be scared as fuck
Cancel the event
im seeing it online and im scared asf
Send another packet
oh I'ma try that
got five tags for that image, tells alot.. 
It was a joke lol
Or block the initial one that changes the block back
U may have to actually send the packet
I'ma try that too
bad pillow
bruh they really deleted it
you can either cancel or resend
whats wrong with it
generally doing both works best
not ryan reynolds
the girl on the left was pulling her panties off
this too
I love this discord
my point
yes
dont you like that?
Oh yee
no banana no fun
Alllllright
Β―_(γ)_/Β―
on other discord, discussions about "how fast can you get laid" are quickly ended once staff joins. BUt here, the opposite is true lol
Ima log off
dont ban me btw
do you think choco likes waifu body pillows
just don't talk german too much
/ban @tardy delta
nah choco has a gf
optic pretends to have one too but I'm not so sure about whether that's true lol
no proof not read
The server i was dev on forgot to remove my perms
real*
all of my exes turned out to be sociopaths so im chillin single right now π
friends are temporary
good choice! my last gf was kinda weird too
victory is forever
"my ex gfs made me gay"
lmao
my old friend LITERALLY turned my crush gay
i was so mad
"my ex gfs made me gay"
Relatable π
haha
how get friends
you know, there's also one additional adventage when being gay: girls on the internet won't find you creepy, because they know you're not interested in them anyway
what are gfs btw
this entiere server is fully of virgins
geographical forages
german firearms
so yeah 100% can recommend being into dudes
+1% if he's one of the baguette ones
π
it's spelt "baguette person"
sorry my bad
np :3
There is no gf here but I have extra time xd
Pff imajin having gfs
everyone who's younger than 25 and wheighs less than 70kg is always wecome at my place lol
π
or at least "looking younger than 25"
a newborn fits this criteria
anyway lets stop this
π€¨
we're not in #general ol
we help if someone has a question so
i guess it's ok as long as we dont ignore them
true
I always invade this chat by accident
what would be the equivalent of new File(File, String) in java's NIO?
lmaooo
using the Path of that file
once choco got a gf the dog in the pfp got replaced
path string
nio uses Paths instead of Files. The concept of a File is weird anyways.
File.toPath().resolve(String) is this right?
sad
wdym? Conclure is the person who has a dog in the pfp. Choco has himself + his gf as pfp
new File(path)?
choco used to have one of his huskys in the pfp
oh didnt know
//initialize Path object
Path path = Paths.get("D:file.txt");
//create file
try {
Path createdFilePath = Files.createFile(path);
System.out.println("Created a file at : " + createdFilePath);
} catch (IOException e) {
e.printStackTrace();
}
doggie
discord should add auto indenting
D:file.txt
that works?
shouldnt it be D:\file.txt
whenever i copy paste code from somewhere in my ide it always ends up like
int blah = 0;
int blah1 = 1;```
D:file.txt is a valid uri
didnt know, mb
So what
Just reformat it. Autoformat is the most important makro you should know.
no i meant like
sth like that
eclipse user detected
those weird formattings only happen when you mix tabs and spaces
No
yes
yes
eclipse is shitty. the only advantage of eclipse is that it's open source
Eclipse It has less RAM and faster than Intellji
But for beginners, intellji is better
well yes but the balance between good features and ram usage
β€οΈ Eclipse
Notepad does use even lass ram and is even faster. Thats not a good selling point.
Intellij community edition is open source too
vim > intellij
vim is bruh
vim intellij plugin x)
is that a thing lol
:wq
You go away you fossil. 
i'm using ultimate though :<
It does not have a good environment
ye lol
You see the irony in this one, do you?
Do you really need that though
no, not at all
vim uses hjkl or something to move the cursor
No xd
It has code-with-me which is quite nice. And extended database integration.
then why is eclipse better
yeah both are nice. unfortunately I dont need any of those lol
To gain that Ram has less can understand like me
?
Yes
Code with me works without Ultimate. And you can use another program for databases
how much ram does IJ use?
0 if you keep it closed
With the databases i can write my queries using auto completions because Intellij knows the model and actually understands the dialect.
Let me show send something recent
I mean depends
Hm interessting
Wait ij helps u write sql?
Code completion for raw sql when writing code.
Actual useful completions when sending queries from Intellij
Looks neat
YOOO
no more strings
well its a string stilll but
code completion
syntax highlight
Unfortunately i dont have ultimate so we just write our queries and hope it runs
I mean you still have Strings but they are automatically parsed. No more syntax errors π
400 quid
yah
thats a lotta money
incl. VAT Β£478.80
16 bit floats exist?
I get it for free because im a student 
uni?
Its called
PV double precision NOT NULL
oh
Yeah. But you can also get it if you are in school.
gaymers, reloadConfig(); does not reload new data inputted in the config.yml until i erload the plugin
thanks
should work fine, unless you're caching the old config object
You need to get a new config object
my school email worked aha
is there some sort of government list of school email
extensions? whats the word
Is it a .edu mail?
no it's my own school's domain email
I guess you aren't the first one with that domain to register
Yeah some schools are listed for instant approval. Nice yours worked right away.
my school doesn't have isic or an edu Mail ._.
its a relatively known school in england might be why
well
warwickshire
I would highly suggest that you dont manually install your IDEs now but use Jetbrains Toolbox instead.
This way you can keep them up-to-date and if you want to work in another language then you can get
the other IDEs as well.
if can be used to either locate your school or yourself, then please delete it
warwickshire is massive
we only have an internal school mail system
so with that i can set a different attack speed for each item?
at what length is a line of code too long
if you need to scroll
itβs just these streams making it kinda long
Depends on how big your screen is 
i like your thinking
rip
I usually have a cap in between 120 and 150
120 for public projects
i keep emailing myself things that i probably shouldnt have
i just noticed my github account is called "StayWithMeSenpai", i think i should rename it and remove the anime profile picture
stretch across 3 monitors
font size 5
efficient code π
what were you doing when you made that
Make it 3 and use one of those
sus
its literally the png ive sent
Guys for setup server which one is better? localhost or ||minehut||
beta version of my point and click adventure: (windows x64 only)
i will not be downloading a rar file from some random german guy
interesting character design https://gyazo.com/fc980a85dedce22cf61a248b8608178b
haha yeah that's Pippen
in real life he looks exactly the same
you have to get rid of the dude sitting oh the touch, to get to the second level
you can get rid of him by cooking the fish that you can find inside the right side of the couch
but to do so you first have to get drunk
Ok wtf.
that game is inspired by my real life friends
this is some peak gameplay
looks like unreal engine 5 was used.
Visionaire Studio
I have even bought it for this weird game lol
it's a bit like unity
Are you from the lower half or from PreuΓen?
whut
how do split a component, since yk its not a string
I am from MΓΌnster, if that's your question
Yeah Escape key kills the game
so do not use it lol
Ok thats waay up
yeah it's almost netherlands
Adventure?
What type of component
what "component"?
an bungee component?
probably
since he said "?" after you asked "adventure" @lost matrix
Sounds like a 1.8 problem. What spigot version are you using?
I'm trying to split a message, but how I'm doing it the message is a component so like ykk
Asking about your attempted solution rather than your actual problem
because "why"
What are you trying to do in the first place?
no I simply wonder why you only want to cancel blockbreaks depending on the player's Y position
well it's exactly what you're doig though
i think he is trying to stop players from glitching up
rapidly placing blocks
that are being cancelled
u know how they are there for like a tiny amount of time
Use an anti cheat. The server basically sees this as flying because the blocks never exist on the server side.
preventing stuff like this is "tedious" at best
Then they should not be able to glitch up unless you are doing some bad block placing cancels that replace the block with air one tick later.
Check if the block they clicked to place the block is air then cancel
Just write in your rules that it is not allowed to glitch up.
Then they wont be able to do it because it would be against the rules of the server.
check if they land on an air block
and then cancel the movement / roll them back
first time I tried something like that Can you guys say my faults/mistakes to me?
- The first method is obsolete.
- You should specify fade-in and fade-out times.
- Show more of your code and properly format it using your IDE
- The first method is obsolete.
Oh really?
It does nothing besides calling p.sendTitle.
Why would you call that method instead of the one from Player?
Oh like to said I tried something like that first time. I'm trying to get used/learn to these methods. Just I have seen some codes like that and I wanted to try this.
help
With?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Btw Thanks For Everything!
The setClickEvent is giving me errors, I tried multiple ways of sending a link but none are working.
link.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "url"));
ComponentBuilder is much nicer
example: #setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://www.youtube.com/watch?v=dQw4w9WgXcQ"));
takes abt 1 ms to create an inv and populate it
How often do you do that?
i wanna do it on join
you got me
but i'm thinking to generate them as needed
haha π
:'(
most of the time it's gonna be like 4-5 invs on join to load up
Usually guis are built when needed
ill save that screen for later
So its a storage gui... which is still a gui.
well yeah
guess i can change how they are generated
it was a pain to follow the logic but ill write some pseudocode and change it
But that doesnt matter. Observer pattern -> load the data always. -> Create a gui when needed to interact with the data.
that was my original plan
then realized it was easier to load all the guis on join
now i may go back to generating as needed
Are the guis just multiple pages of a single storage space?
ye
Do you use a gui library?
nah
Any paginated gui LiBrArY you can recommend?
isn't there one called pagination
inventoryframework
thats a library not an api tho
do you have links so I can check them all out
lmao
:D
Its quite hard to recommend one because most that ive used had trashy implementations and i
ended up writing my own gui library.
Im currently forced to use Triumph. I dont completely like how they implement their guis but
its performant and the API is easy to understand.
Actually let me write a very quick storage GUI with Triumph to show that its quite easy.
Assumption: the data is stored as List<ItemStack>
Never heard of it, I'll check it out
looks very promising
just opened the source code
and found them naming a nsk
with a capital letter
:O
a what
namespacedkey
oh
@lost matrix Just lookedat Triumph
can it do the scrolling inv for storage?
wait actually i dont wanna do that
Sure. Im currently writing a mock up using the paginated one. But you can also just do a vert/horiz scrolling one
can lead to dupes since i want admins to also be able to open the invs as well
and they have some obsession with ifs and elses and they never use switches or ternary operators
Who?
IF
they also have trouble naming methods but it doesnt really matter since theyre documented
lol...
lmao
It doesnt look too bad
ye except they have some methods with repeated implementation
e.g
public ShulkerBoxGui copy() {
ShulkerBoxGui gui = new ShulkerBoxGui(getTitleHolder());
gui.inventoryComponent = inventoryComponent.copy();
gui.setOnTopClick(this.onTopClick);
gui.setOnBottomClick(this.onBottomClick);
gui.setOnGlobalClick(this.onGlobalClick);
gui.setOnOutsideClick(this.onOutsideClick);
gui.setOnClose(this.onClose);
return gui;
}```
ive seen this a million times, just with different types
#clone π’
actually its a bit different from on to another
but they can just make a list of inventory components
and copy them instead of hard coding it to the amount of components in each type
also what the
if (rawSlot == 0) {
getFirstItemComponent().click(this, event, 0);
} else if (rawSlot == 1) {
getSecondItemComponent().click(this, event, 0);
} else if (rawSlot == 2) {
getResultComponent().click(this, event, 0);
} else {
Β―_(γ)_/Β―
without the documentation, it would be real hard to maintain this lol
I think the design is pretty solid
how about Component[]
Component component = this.components[rawSlot];
if (component != null) {
component.click(this, event, 0);
}
What events allow player getting damage?
EntityDamageEvent
EntityDamageEvent
Entity#damage
Oh ok, so EntityDamageEvent is the master event right?
yes master π
Thanks
No. Event is the "master" event
idk what you mean
By master i ref if i cancel entity damage it doesnt allow any type of damage
Because im calling it, and them i dont know why im getting damaged
braindead question but like how do i retrieve the "Potion of xyz" name from potions without custom display name? xD
Wait
Can I listen to all events
And cancel them
Ig except player join event
By listening to βEventβ
iirc you cant
No, Event is Abstract
you can still put it as parameter π
Well you can, but it will never trigger
why
cause it doesnt make sense, you should listen to a specific event instead
wdym?
Yeah
More context pls
I have cancelled EntityDamageEvent, and if i fell from high, i have damage
Show your code
all
i ill open intellij because if not it a mess
Sorry for time, but my intellij didnt want to respond
IDK why it consume 4gb of ram
Registered your event ?
And i have 32gb so idk
Yes
try debugging it
Wait
Also you shouldnt cast to player without checking
Because i need to 2 diff flag, one only for player damage and second for animals
HMn?
Whats the problem?
Just do a check in the EntityDamageEvent
Oh the javadocs are updated
I never realized
For some reaon i coding on 1.18.8 and where looking on 1.8 javadocs
Please dont kill me
π
didn't know 1.18.8 is out already
You are from the future
Wait 1.18?
1.18.2 is the latest one
Thats impossible, unless you have ALL warnings and errors turned off
or your IDE is Notepad
Dont disable any warnings at all. Correct them.
Actually something that is really annoying me is that whenever I change some code that was used in other classes it doesn't immediately point out to those classes that there's an error now.. any way to fix it? In eclipse it was instantly, intellij somehow not doing that for me
Yes happen to me
I alo hate github copilot, because it recommend some method that i dont want it
But if i press tab it write the whole fucked code
disable it then if it's doing more bad than good
So it helpful but sometime itds anoyying
I dont know why VSCode has a really good github copilot extension, but the IDE is really slow
Lmao looking the docs, how the heck i get the player so?
I dont find the method
It doesnt contain any getPlayer() neither getEntity()
declaration: package: org.bukkit.event.entity, class: EntityEvent
My bad
Hello guys, I have a question. I want player first click Choose Block in GUI and then select item in inventory. I make first part but in "Case" I dont know how can I make second part
Have two fields:
ItemStack first
ItemStack second
And then simply check if both where selected
Any ideas for how I could compress this?
private int checkCrop(Location location, Material material, boolean twoMaterials, Material secondMaterial) {
location.add(0D, 1.0D, 0D);
int amount = 1;
final Block blockAtLoc = location.getBlock();
if (!twoMaterials) {
if (blockAtLoc.getType().equals(material)) {
if (blockAtLoc.getBlockData() instanceof Waterlogged
&& ((Waterlogged) location.getBlock().getBlockData()).isWaterlogged()) {
location.getBlock().setType(Material.WATER);
} else {
location.getBlock().setType(Material.AIR);
}
amount = amount + this.checkCrop(location, material, twoMaterials, secondMaterial);
return amount;
}
} else {
if (blockAtLoc.getType().equals(material) || blockAtLoc.getType().equals(secondMaterial)) {
if (blockAtLoc.getBlockData() instanceof Waterlogged
&& ((Waterlogged) location.getBlock().getBlockData()).isWaterlogged()) {
location.getBlock().setType(Material.WATER);
} else {
location.getBlock().setType(Material.AIR);
}
amount = amount + this.checkCrop(location, material, twoMaterials, secondMaterial);
return amount;
}
}
return amount;
}
I'm pretty sure it could be compressed, but I can't figure out how
ah
early returns
hmm actually
return and increment in one line
dont negate boolean if youre going to use an else
- Early returns (as said above). Also for loops use conditional + continue statements
- Use variables please
- Use methods so the code can be easier to read
- If you want to learn how to write good code, watch Uncle Bob
Rabobank Livestream 2019 with Uncle Bob | A session about clean coding
The program:
09.00 Uncle Bob - Part 1
11.00 - Break
11.20 - Uncle Bob - Part 2
12.30 - Lunch
13.30 - Breakout sessions (NO LIVE STREAM)
15.30 - Uncle Bob - Part 3 - Including Livestream.
#werkenbijRabobank #RabobankIT #unclebob
(it's 8 hours, but you can skip to important parts)
π
conclure certified
pulse double certified
The thing that was from is from like a year ago, I was attempting to re-write it and make it one method instead of three like I had
No no no
I've been working on remaking the plugin for too long
Making it 1 method makes it worse
Divide it into smaller methods
Have one big method and have it call smaller methods
and those smaller methods call smaller methods
I know
there's a fundamental rule, every line in a function should be at the same level of abstraction elephant
A very very loose rule you can follow is that if your method is more than 2 indentations you should probably write another separate method (but obviously it's very loose)
by having colossal functions you most likely violate that rule
I dont know why but many coders uses them in variables
it varies
its really extrange;
int $1;
int $2;
Specially in objects they uses
xD
Java OFFICIALLY says not to use $
looks like php
correct
I actually use 0 after method names sometimes
I team #NextJS
ye same
just internal stuff
This seems better and actually uses a loop instead of re-running itself every time
private int checkCrop(Location location, final Material material, final boolean twoMaterials, final Material secondMaterial) {
int amount = 1;
while (twoMaterials ? (location.add(0D, 1.0D, 0D).getBlock().getType().equals(material)
|| location.add(0D, 1.0D, 0D).getBlock().getType().equals(secondMaterial))
: location.add(0D, 1.0D, 0D).getBlock().getType().equals(material)) {
if (location.getBlock().getBlockData() instanceof Waterlogged
&& ((Waterlogged) location.getBlock().getBlockData()).isWaterlogged()) {
location.getBlock().setType(Material.WATER);
} else {
location.getBlock().setType(Material.AIR);
}
amount += 1;
}
return amount;
}
mhm
But i use Typescript instead of javascript
aaaaa
you fourten?
pro tip, use variables
lol
that conditional
oh boy
also
amount += 1;
if else if else if else if else
nothing seems better lol
you know
seem to be decompiled, not many uses final on method constructors
rust officially bad x)) /s
no u
I forgot that existed
i think python is more better than that shit (rs=
does anyone know any good cross compilers out there that are like free and accessible
i feel like i rip my brains out trying to find os disks to run virtual machines
for like c++ and stuff
I did
fourten?

