#dev-general
1 messages ยท Page 119 of 1
RIGHT
how do you do access? first, second, etc?
yup
possibly
(age: Int, name: String)
I'm thinking this for the tuple type syntax
basically a mini data class
but indexed access is possible
ooooo that sounds fun
It doesnt have to be compiled to be static
i mean
anyone can do pretty much anything if they put their mind to it
stop being so defeatist and just do it
static typed languages are those in which type checking is done at compile-time
I could probably figure it out eventually
but i'm lazy
Joshua Parker's segment from #INTRODUCTIONS (2015) by LaBeouf, Rรถnkkรถ & Turner http://labeoufronkkoturner.com
Full 30-minute version: https://vimeo.com/125095515
Released under a Creative Commons Attribution Non-Commercial Share-Alike licence. #JUSTDOIT
and I don't wanna have to figure out the bytecode format and do interop hacks
Theres a remix for that
compile-time doesnt have to literally mean compile time
It just means the point at which you parse the code into some other format
true
but it ain't really a language if it doesn't kinda work on its own imo
ummm
this isn't anything fancy
There is no language that "works on its on"
like if you're processing shit using Kotlin that ain't a language it's just a processor
besides machine code
i need thoughts on this github colour scheme 
Thats a stupid thing to say then
not too bad
final question regarding consistency
since variable declaration is name::Type, should tuples be (name::Type) or (name: Type)?
::
ok
keep consistency
๐
Only because that slightly looks like odin's shorthand tuple type syntax
IT IS
also imo both languages' syntax is kinda not all that good
LMFAO
Good thing we didnt ask for your opinion
i mean
๐
also val withType: Int = 20 you took that straight from Kotlin lol
https://github.com/SoftwarePantheon/Frigga/blob/master/docs/README.md I don't think it's that ugly
imagine not stealing ideas from kotlin
fun returns: Txt {
=> "Hey"
}
```that's not too bad
the pull and push seems kinda useful
rather than having to use a fucking scanner
the direct stack access is the work of the devil
not in the slightest
imagine not having access to the stack as a property
yield = (toYield::Any) -> _ {
__stack.push(toYield)
__caller.break()
}```
it's so hideous ๐ข
gross
OK
๐
SHUT UP
No need to SHOUT
this is not gonna stand
frigga is literally going to kick the shit out of odin
LITERALLY
Frigga is a WHORE
@topaz bay u really got him good with this one ๐๐
@onyx loom Thank you.
ew
Actual nightmare fuel
It's not my clip, its someone else's audition animation for a project i'm helping run.
I'll let them know though
Thank you.
@cursive breach is that Cinema4D?
Aaaa I fucking hate github packages already
It literally errors out 50% of the time
Also is github actions not working?
Oh there's a reported issue
laughs in setting up a Sonatype Nexus
Lol
Fair, I thought the same but then after trying to get it working on a GCP CE instance for like a month I finally caved, and for โฌ5/mo I get 4 cores + 8GB RAM, thanks to BM pointing out I could get that rather than a lot worse Hetzner VPS for the same price
Tru tru
But I barely have any packages to upload
I might publish my plugins apis separately sometime but eh
Yeah its all about what u wanna do with it I guess. Ima host my site and everything to do with it on there, the nexus, a few discord bots, etc
i wish i hadn't watched that video brent posted
https://paste.helpch.at/nonuvuzufu hm not bad
Automatically generated file
I'll just have people run the command to generate that and send it to me when requesting support
Anything I could add to it?
more hex support
Lmao
Is instanceof particularly slow
Aight lets try taskchain
o why
Because thats convention
I mean... its really not that hard
the github tag
whats that lol?
its a git thing
tags are used to mark a certain point in time
soo...
take vault for example
what do i put for it lol
I havent done anything with tags
use your head
whats the default thing
Im pretty sure jitpack allows you to use a commit hash as a version as well
Don't know though, cause like... central is better
oh wait
If the project doesn't have any GitHub Releases you can use the short commit hash or 'master-SNAPSHOT' as the version.```
Added API details
and examples and whatnot
You have made a mockery of kotlin
lol
you should throw Error instead of RuntimeException
looks cooler
and no need to catch it
hm
I want the runtime exception to get thrown 10 times ofc
na
and call print 10 times
whats the point in that
4head ass
thats not an api
NO
To be quite honest
How else would you use my plugin in yours then sx??
FUCK YOU
Without tha
Fucking stupid bot
people need to be able to listen to the FuckEvent
I mean... its really not that hard
@topaz bay its not about how hard, but its looks โน๏ธ
Using something in something else is not an API
@onyx loom it looks immeasurably better when you follow the conventions though
a set of functions and procedures allowing the creation of applications that access the features or data of an operating system, application, or other service.
Your code being all crammed together is ugly and disrespectful to my eyes
LOL
bruh
i would disagree sx ๐ฆ
did you just say i was disrespecting ur ass??
Well youre a microbrain, so that means nothing to me
class ClassName: extension() {
// blah blah
}
@obtuse gale That is what happens when Im reading and writing at the same time
class ClassName : YUCK
I end up writing what Im reading instead of what I want to actually write
you get ur eyes confused with ur ass?
Any plugins you make in future I should hope hook into Fuck1.8
I will do everything I can in my power to ensure this repository is seen by not another soul.
do you support 1.8 users?
Nope, but I also do not support trash kotlin code
make it better for me
Absolutely not.
lol
yep
I refuse to take part in this heinous atrocity
its sexy i reckon
You've already shattered a large part of my ever increasingly shrinking soul
Thats kind of an oxymoron
increasingly shrinking
you're an oxymoron
We're all morons
cant even remember what oxymoron means :kappa:
NO ONE
im actually massive
An oxymoron is something that seems to directly contradict itself
Well... well no...
Im pretty sure it has to be a figure of speech
Your statement is just false
LOL
yeah an oxymoron is when two words next to each other contradict one another
but oxymorons are only about two words directly next to each other, juxtapositions are what they are called if they aren't directly next to each other (a.k.a two phrases contradict one another)
microbrain
That is not at all what a juxtaposition is
pretty ugly
Thats not really an oxymoron either
aj ima upvote that shit for the idea
the computer screamed at kalibers code
WHAT
downvote it because damn the video is laggy
whats wrong with my code ๐
As you arent using pretty in the sense of beauty, but as an modifier for ugly
Oh I meant AJs
๐
what video is laggy??
yeah fuck ajs code
Or whoever's they were complaining about
๐ข
mine?
not laggy for me
or its my pc
get that shit out of here

sublime is the superior text editor
This is a prime example of the epitome of idiocy
lol
with 10 files.
sublime is effectively instant
to remote???
I don't believe sublime has built in remote capabilities like vsc
hey would anyone know why my editor colour scheme isn't applying properly?
using Atom OneDark (customised by me)
and half of the colours aren't working properly
most of the keywords are loading properly but the rest of it is just like "nah fuck this"
okay must be an issue with the way it detects Kotlin code since it's detecting Java code just fine
๐ค
is this for intellij?
yeah
make sure you're applying the theme properly
tools > material theme > material theme chooser > atom one dark
yeah
it's working just fine
and some of the colour scheme is working
but most of it isn't
I'm talking about the editor, just the editor, the rest is fine
I've never touched datapacks, is there a list somewhere of all the keywords/constants?
if you go in to editor settings -> color scheme you can see thingys to do with highlighting
@prisma wave Is this proper naming for a package which contains all the format objects?
Or should it be named something more significant?
could call it format or something?
Gonna be introducing inventory objects as well, so I guess I can just subpackage it
follow NLR principle
NLR?
Niall left right
Niall Left Right Naming Principle
--------------------------
Left Right
SomeObject
Object
ObjectManager
Left- Implementations of the object
Right- Owners or users of the object.
Examples:
BukkitPlayer
SpongePlayer
Player <-- Concrete interface or abstract object
PlayerManager
PlayerHandler
Can an admin please add this to the FAQ
Also- my findings
You cannot make your own packets, it doesnt like that
well yes
But you can implement IChatBaseComponent, I'm about to run tests now
there's no registration on the client for them
I tried extended PacketPlayOutScoreboardTeam
FileManager or FileLoader
(All it does it load files into objects)
Niall, slightly annoyed, smh
wtf is NLR
nothing
scroll up
dont worry about it
dont erase it from history!
I can't no, if it had actual arguments to it, then I would, but since it's a meme nah
It aint a meme
@onyx loom what's the syntax for your expansion?
Kind of disrespectful
wym?
is it %random%?
%rng_blah_blah%
ah ok
verified ๐
I mean provide actual arguments and I'll ask Piggy if it's valid enough to be added
what are arguments
also I made it up
Not sure if it actually exists
Ok
I just broke grounds on 1.16
Everything teaches you wrong
Unless I'm wrong lol
Oh my god
Yep I'm wrong LOL
@onyx loom u ready yet?
fixed your bin katsumag
yea sorry, 2minutes. i promise this time xd
kk
probably haven't configured it lol
That would probably be the issue
lemme do it
also did you design these hover thingys on your portfolio?
the reason why you couldn't save btw is because the default is memcached and you need to install that, I've changed it to redis so it should be working just fine now
also did you design these hover thingys on your portfolio?
Wdym @jovial warren ?
Also thx for fixing that
oh yeah @errant geyser i forgot to say I made this https://github.com/knightzmc/mf-gui-kotlin
some kotlin wrappers for mf-gui
What benefits does it provide?
being slightly nicer to look at mostly
gui(somePlugin, title = "Test") {
items[3] = createItem(Material.STONE).toGUIItem {
isCancelled = true
}
}
indentation messed up lol
https://github.com/knightzmc/mf-gui-kotlin/blob/master/src/test/kotlin/me/mattstudios/mfgui/gui/components/ItemBuilderTests.kt but here is an example
don't expect anyone to use it but I said I'd give it an experiment so here we are
Ima use it next time around
aight cool
also did you design these hover thingys on your portfolio?
@jovial warren what do you mean by this?
the thingys that pop out slightly when you hover over them
@prisma wave Imagine not using my fork which adds in inventory types, pfft
:c
imagine using a fork from a 1.8 user
https://img.bristermitten.me/17-28-47-29-06-20.png 1.8 users exposed
๐คฎ
๐
Ah yes lovely fork xD
i hardly use 1.8 anymore, but i just dont think theres anything wrong it ๐
GREAT FORK
i dont see a button on how to update the file ๐ฆ
smh Matt
only the descriptions and stuff
โน๏ธ
Kaliber you have to release a new version and upload the file iirc
into the entrenching pit of legacy software
How does this look BM? https://paste.helpch.at/ovaxucokum.java
There should be a versioning page somewhere
frosty should know ๐ฆ
I've no clue when it comes to the ecloud, soz
rip
@hot hull you don't need the / and I'm pretty sure there's something for getting the name without the extension but otherwise good
ill just upload the jar to GH for now, release it on ecloud tomorrow
Yea there is, I just can't remember what, I know kotlin has a nice method for that
yea
Not seeing the class KM
FilenameUtils?
it's in spigot i'm pretty sure
oh it's in commons-io not commons-lang
ok @errant geyser ready to play? ๐
Slight debate when it comes to using the logger, do I have a static logger instance, or do I just pass in my plugin instance via DI just for that?
https://bin.bardy.me/ how's the logo looking on there guys?
Which is more logical, this
ItemStack item = new ItemStack(material, itemSection.getInt(path + ".amount"), (short) itemSection.getInt(path + ".data"));
or having two methods depending on the version
What would you guys name a scroll method? Yes still stuck on this
Currently I am just using the paginated gui stuff, so it's gui.nextPage
I thought about either gui.scrollForward or just gui.next but idk which one sounds better
gui.next
gui.next
Since scroll could be missinterpreted
Ooh what about gui.scrollNext and gui.scrollPrev?
Anyone got console and an IDE opened?
Could use a quick Bukkit.getServer().getClass().getPackage().getName() printout
it'll be org.bukkit.craftbukkit.version.CraftServer I think
@topaz bay this a bug in the type inference algorithm? https://img.bristermitten.me/18-04-11-29-06-20.png
surely it should be a List<Value>
bc of the contract of requireNotNull
@ocean quartz Lol
Your turning into me
Go with the most extensible
scroll(ScrollDirection.LEFT) e.g
I'm horrible with names
And that sounds terrible to use though
That'll need checks if it's horizontal or vertical gui and a bunch more stuff, i think a simple one sounds nicer
Now to think about how to add horizontal scrolling
Wait, you mean actual scrolling?
@prisma wave Judge https://paste.helpch.at/fobuxubeba.java
@hot hull
Is that clicking or?
I mean yeah you can't really scroll
Yea I thought you meant actual scrolling :p
@hot hull i would use a configurationsection instead of lots of string concatenation
In that case
If a menu can only be either horizontol or vertical
And not both
I'd use next() and previous()
Fixed
Oh god, being both sounds complicated xD
I mean just have a VERTICAL.next/previous,
and HORIZONTAL.next/previous
Would probably make sense
This doesn't auto copy right?
Because then each inventory type can handle implementations of next() previous
Yeah I feel like rename the pages to that too, that way i can just extend paginated gui for the scroll one
Yeah
follow NLR
HorizontalPaginatedGUI
PaginatedGUI
GUI
GUIManager
GUIEventListener
?faq nlr
eh what?
The embedded resource 'plugins/FrozenJoin/inventories/hub.yml' cannot be found in plugins/FrozenJoin-1.2.1-all.jar
Am I missing something or?
lol bad
:c
send your getResources call
Code mr Frost man?
wdym getResources, using this
saveResource(getDataFolder() + "/inventories/hub.yml", false);
Is that not what I should be using 
Enlighten me kind sir
it should be saveResource("/inventories/hub.yml", false) I believe
you don't include the data folder
ah
2 speedy 4 u
๐ฆ
PR or shut up
Is it Java?
link
we're yet to find out where the other items are
or why the lore is in italic
but one day we will find out
Gotta wait for those idiots to fix it
I know the paper team had a meeting today with them iirc
can the paper team tell them to add hex support Everywhere
they had a meeting with whom?
Dipshits at mojang
Damn
Wait so now the client by default uses italic always?
Seems like it (atleast in menus)
ah rip
Everything chat related is an IChatBaseComponent
Ever since 1.8 it's been taking over the old strings
๐
thinking of changing Fuck1.8
instead of it shutting down the server
class FuckYou : Listener{
@EventHandler
fun onJoin(event:PlayerLoginEvent){
if (Bukkit.getServer().version.contains("1.8")) {
event.player.kickPlayer("The owner is a fuckhead and accidentally uploaded the wrong version ยฏ\\_(ใ)_/ยฏ")
throw RuntimeException("Fuck you :))")
}
}
}```
while (true) {
throw runtime exception
}
them make that also call FuckEvent
If i didnt catch the exception that made the code return in past
Why not create a new process to delete the jar โ ๏ธ
Why not make it just delete the entire server
Managed to achieve a good improvement with hex colours
~12x improvement
Pinnacle of performance
๐
@topaz bay Would you say it's a bad idea to have package-private fields on a class?
Example:
//gui class
Inventory inventory = ..
// paginated gui extends gui
inventory.addItem()..
Or would you say package private getter and private member instead?
//gui class
private Inventory inventory = ..
// paginated gui extends gui
getInventory().addItem()..
Make it protected
I think package-private would make more sense though, since it's in the same pacakge
Just don't know if it'd be right to do it or not
Time to coop your nbt class Matt >:)
Do it ;p
@prisma wave requireNotNull returns the non nullable value
But the contract implies that the value isn't null
That is true
But youre also using the method wrong
It implies that the returned value isnt null
Are you using the normal inference, or the new inference?
okay Alt+Enter doesn't seem to work now on this Material UI thing
no idea what I did to it but it seems fucked
Yeah that's why I was thinking it's a bug
If thats a map and youre running the map functions on the entries, why are you calling back to the original map
instead of getting it from the entry?
what's value ^map?
It means there's an implicit return@map
just tells you that it's returning that value to the map yeah
mkay
value is the value it'll automatically return
it's a Kotlin thing
anyway, time to re-install IJ lol
@topaz bay because params is a different map to signature.params
gross
sounds bad
Not really
naming thingys the same when they're able to interact with eachother
Params is the provided parameters, signature params is the expected ones
You should have done keys.mapNotNull(params::get)
delete.
Quoi?
tous
Absolument pas
mais pourquoi
parce que......
Il tout travail
Je comprends pas
travail is work like a job
marche is work like functioning properly
Pourquoi tout le monde parle franรงais maintenant?
๐
@old wyvern pourquoi pas?
Lol
back to google translate
I remember specifically my teacher asking me if the printer was working
And I couldnt figure out why she was asking if it was walking
And she explained this to me
Et pourquoi pas?
I see I see
OH WOW
I would've guessed "rรฉussir" for "works properly" but obviously not
Oh reversing that translation comes out wrong
I just realized this is the same sort of thing as something "running"
clever french people
Very clever
En effet
Do what?
VRAIMENT!!!
lol
Vraiment means somethign else?
Oooooo
Words have meanings based on context
languages ๐
Yes I have barely even heard french like once if at all
If someone was questioning something I said, I would respond with vraiment
In the affirmative
lol
Hey, I'm getting into plugin development and notice that people have me.<username>.<plugin name> as something which I don't know the name of, it also could be a website aswell. What is that and why is it formatted that way?
package names
This beginner Java tutorial describes fundamentals of programming in the Java programming language
Convention
Plus it helps if there are conflicting class names
also since when could you put functions INSIDE of functions in Kotlin?
fun function() {
fun insideFunction() {
fun insideInsideFunction () {
// do something
}
}
}
apparently that's well within Kotlin syntax
no idea when that was introduced
local functions have been around since the start
Supposed to be used when you have recurring code that isnt needed elsewhere
yeah i think it wouldve said which version it was introduced in if it wasnt from the beginning
true
I'd call them embedded functions but idk what they're actually called
They are called Local functions
^
ah okay
damn 2018 me was a dumbass
for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
if (plugin.getDescription().getDepend().contains("KnightzAPI")) {
dependent.add(JavaPlugin.getProvidingPlugin(plugin.getClass()));
}
}```
just found this work of art
catch (NullPointerException e) ๐ฌ
๐
Such a massive disappointment
was?
and at that point u wouldve been coding for like 2 years?
yeah about that long
smh my head
slightly less
i expected better of u
but, forgive me and i can forgive u ๐
ah but I have an excuse
oh ffs what is this
public static User valueOf(OfflinePlayer root) {
for (Map.Entry<OfflinePlayer, User> entry : users.entrySet()) {
if (entry.getKey().equals(root)) {
return entry.getValue();
}
}
return new User(root);
}
uses a hashmap in O(n) time like a boss
๐ค
Welp
I had a dumber period. I started with VB so I had a period where I used a label with the visible flag set to false for a variable
๐
WHAT
visual basic ๐
Yup
that's worse
obviously
Set<T> list = new HashSet<>(); ๐ค
oh just more of my shitty code
I've seen at least 2 api keys just casually committed
lol
I'm trying to register my own placeholders but I'm getting this error:
https://mcpaste.io/5844523b6e6e10d0
The issue is caused by a NPE in my hook class CDPAPIHook.java from calling my getCooldown() method in the class AppleListener.java, here is my return code in the hook class:
@Override
public String onPlaceholderRequest(Player player, String identifier) {
if (player == null) {
return "";
}
if (identifier.equals("cooldown")) {
return apple.getCooldown(player);
}
if (identifier.equals("combattag")) {
return plugin.getConfig().getString("combattag", "value doesnt exist");
}
return null;
}
Then the getCooldown() method and Objects or methods that it refers to:
public Map<UUID, Long> cooldowns = new HashMap<UUID, Long>(); // this stores the UUID of the player and when they ate the apple.
cooldowns.put(p.getUniqueId(), currentTime); // this line is run when a player eats a gapple and does not have a cooldown already.
public boolean hasCooldown(Player p) {
long currentTime = System.currentTimeMillis();
if(cooldowns.containsKey(p.getUniqueId())) {
if(cooldowns.get(p.getUniqueId()) <= currentTime - (plugin.getConfig().getInt("Cooldown") * 1000)) {
cooldowns.remove(p.getUniqueId());
return false;
}
return true;
}
return false;
}
public String getCooldown(Player p) {
final long currentTime = System.currentTimeMillis();
if(hasCooldown(p)) {
final long cooldown = ((plugin.getConfig().getInt("Cooldown") * 1000) - currentTime + cooldowns.get(p.getUniqueId())) / 1000;
return String.valueOf(cooldown);
}
return "0";
}
Any help would be greatly appreciated! ๐
@obtuse gale Was it you who asked something about Map<String, String, String> ?
Use a table?
a what
Table<String, String, String>
oof still cant fix this bungee thing'
rip
Just giving me this cannot conenct to a default or fallback bullshit lol
dude be going mad
Looks like me after I introduce 15 bugs alongside one new feature
oof
What's the class?
Action
:)
[08:48:11 INFO]: Loading inventory: example
[08:48:11 INFO]: Loading inventory: hub
Ayy it works
gross log
[22:18:27 INFO]: [net.kitesoftware.board.KiteBoardPlugin] [KiteBoard] Registered criteria 'PERMISSION'
My dude
you all straightup ignored that guy asking about placeholders 
oh he gone
dont post in multiple channels
Sorry I just saw the channel.
@ocean quartz
https://discordapp.com/channels/164280494874165248/452279708856614912/727335674193117204
Is this legit or edited?
it'll be legit
damn
Can't wait for that to be on spigot
Nah use maps for that
lol
It's better resolution
raid shadow legends ad in chat
lmao
@heady birch that scoreboard is awesome
Thanks
A pain to get working
Had to write my own IChatBaseComponent implementation to improve performance
And now I need to fix normal chat colours ๐
Whats with the normal one
Well for whatever reason my parser is a little broken
So the colours are in the wrong position
&aGreen&cRed&9Blue
Green would be red and red would be blue, blue would also be blue
What
So do I
Fine it's gone now ๐ฆ
Sorry for bullying, confused as to why you're so over complicating it
Uh
Maybe because I don't want 25% cpu being spent serialising and deserialising JSON.
Profiling results are here: https://discordapp.com/channels/164280494874165248/695431668944732270/727223435029119086
EnhancedIChatBaseComponentFactoryProvider
@old wyvern That is legit yeah, the code is on GitHub
Imma try make it read straight from YouTube next
Only fans in chat
Haha I got the parser working, finally ๐
Now I gotta change this:
[net.kitesoftware.board.KiteBoardPlugin] [KiteBoard]
Only fans in chat
this
What
๐คข
@hot hullobjectis a Singleton ๐
this is why Kotlin > Java
public class Singleton {
private static final Singleton INSTANCE = new Singleton();
private Singleton {
}
public static Singleton getInstance() {
return INSTANCE;
}
// methods here
}
```becomes:
```kotlin
object Singleton {
// methods here
}
Beautiful
Yes
I swear there's a way where you instantiate the instance somewhere else
Enums
technically though, enum != Singleton
Singleton is a pattern not a type
since enums don't have any instances, they're just representations of static constants
Enum singletons are also ussually considered better than defined by the static getter
idk never really used enum singletons before
since enums don't have any instances, they're just representations of static constantsValues present for each value of the enum are separate
and I rarely use enums as it is lol
Saying this again, Singleton is a pattern
and yeah true
Not a type
both true
Enums compile to instances
didn't know that
also if they're instances can I set their values?
okay
that are instances of the enum class
ah okay
because I'm working on Octo and I want the messages for commands to be optional and to be able to be changed
Material.STONE for example compiles to ```java
public static final Material STONE = new Material(2);
probably wondering what Octo is lol
using enums for dynamic data doesn't seem like a good idea
I assume some command framework or something
yeah kinda though I plan for it to do more than that
I want to make messages customisable but then not have to get an instance, doesn't sound possible to me
Anyone here used guice for MC plugin?
What logger did you use, inject the Plugin Logger?
@jovial warren you can still set the values stored inside a enum instance
I assume you were planning something like
enum Message {
MESSAGE_1("default msg 1"),
MESSAGE_2("default msg 2");
private String message;
Message(String def) {
message = def;
}
public void setMessage(String replacement) {
message = replacement;
}
public String getMessage() {
return message;
}
}
Ew
yes?
Very ew
What would you suggest different about that?
Not using an enum at all
Why not?
I'll show you what I use and you'll judge when I get home
@heady birch To make that rgb stuff better all the colors should be consistent
Like an rgb keyboard
Instead of each line having a different color scheme
Oh yeah I was just showcasing that it doesn't have to be a rainbow
It's just a showcase so it don't really matter does it
Python has legitamate use cases and is a valuable language for small, lightweight programs. I wouldn't use it for anything major, but for quick mockups its undeniably great
It's concept is undeniably great, it's execution is awful though. And for that reason alone, I say that other scripting languages with a similar concept, and better execution, beat out python.
a perfect example of a language that fits my criteria, is lua
I'm no expert though, and even though I glorify lua, I haven't actually put as much research into it's flaws, as I have python's
it too, could be greatly flawed in it's execution
Julia maybe
Never used it or looked at it
julia is quite nice
julia is supposed to be speedy right?
yeah no lol
yes
their benchmarks are just badly made
It is
that's impossible
not impossible
well
You can read up on it
Only this julia is lacking rn that python has would be libraries for a lot of things
But its comin up
yeah it's good
I'd bet that the benchmarking software used for their c tests is just badly implemented though
the only thing that annoys me is that / is different to รท
so you have to copy and paste the symbol from somewhere
indeed
also that character would be alt + 0247
setup a macro
IntelliJ thinks all my macro keys are the same
switch(e.getCurrentItem().getType()) {
case DIAMOND:
if(player1.getInventory().contains(Material.GOLD_NUGGET)) {
boolean done = false;
int amount = 0;
if(item1.getItemMeta().getDisplayName().contains(Utils.chat("&c&lFRAGMENT &8(( &7Tier I &8))"))) {
for (ItemStack item : player1.getInventory().getContents()) {
if (item != null && item.isSimilar(materials.getFrag()) && done == false) {
item.setAmount(item.getAmount() - 9);
done = true;
}
}
e.setCancelled(true);
player1.getInventory().addItem(item1);
player1.sendMessage(Utils.chat("&aCongratulations!"));
break;
} else {
player1.closeInventory();
player1.sendMessage(Utils.chat("&cDon't have funds!"));
break;
}
}
ERROR: the currency "gold nuggets" cannot be used with the SHOP GUI, I used a contains() to parse through the item name, but now I can't use it as it says (don't have funds).
What's the move hotbar slot event called again? I keep forgetting
PlayerItemHeldEvent?
Yup, thanks
I should probably prefix these with my plugin name right? (To avoid any misshaps)
yeah
Is there a way to stop a process if the Item meta data of both items don't match?
return?
no like
a comparison?
how do we do dat?
so like item1 metadata = item2 meta data then pass through
but else
stop
else return;
item.equals.item
let me show you the code.
ItemStack#isSimilar(ItemStack)
or compare the data
case DIAMOND:
if(player1.getInventory().contains(materials.getFrag())) {
boolean done = false;
int amount = 0;
for (ItemStack item : player1.getInventory().getContents()) {
if (item != null && item.isSimilar(materials.getFrag()) && !done) {
item.setAmount(item.getAmount() - 9);
done = true;
}
}
e.setCancelled(true);
player1.getInventory().addItem(item1);
player1.sendMessage(Utils.chat("&aCongratulations!"));
break;
} else {
player1.closeInventory();
player1.sendMessage(Utils.chat("&cDon't have funds!"));
break;
}
The 2 items are normal golden nuggets, and then nuggets with lore / and custom name, i dont want them to be using normal nuggets to execute this.
I use the isSimilar
but it still does let me use the GUI with normal gold nuggets.
Ima let Sx or BM roast you.
oh am i not allowed to ask here, is the help @ #development or #minecraft ?
You should make a method return a boolean for if the items match. If it was in kotlin you could make an ItemStack extension function, but you're using Java so make a method that compares if the ItemStacks are similar, then the lores, then the names, and whatever else u wanna compare. If it matches, return true and carry on ur code
Also #development is the proper place to ask questions, yeah
You can't have a function inside a function
Outside of your entire function
okay.
This enum names..


