#help-development
1 messages · Page 2002 of 1
Hey, having some trouble with ItemStack.
I'm coding a plugin that sells items in a chest, I'm using Item ID so I can use spigot to code. It's working fine, but for items with a sub id (i.e. 5118:32) I can't get the ID of it. Any ideas?
This is what I have so far
int Rw = 2;
ItemStack razorwind = new ItemStack(TM + ':' + Rw);
razorwind.setTypeId(TM + ':' + Rw);
None of it was “renamed”
The remapping changes it from the community name to the actual name
I used "WorldServer" before
which now doesn't exist
yeah, its a different name than it usually is
WorldServer is what the community called it because they didn’t know what it was called
Mojang has just released a map that tells the community what it’s really called
with no documentation
cause they dont want us using it
just like how apple will never release their src
Anyone?
Item data
what should I add/edit to the code?
You have to get the itemstack’s data
The type id is the same for all of them if it’s just data values
The data controls what the item is
Can you guide me through it? I'm really lost...
I have a question that’s sort of related to development: Do any of you put Minecraft related development projects on your resume?
Considering it’s been my job for the last 7 years I do
I imagine that data is the number after the collons, so 5118:32 the data is 32?
can we change the color of the sky?
XD while a plugin I’m working on uses light redis messaging and complex sql queries, and is well organized and documented… I’m concerned it may not be technically impressive enough to put on an application to google for example. It doesn’t use any advanced algorithms
im pretty sure im right but with if statements if its just one line for it you can do if(blah) blah(); right?
instead of
if(blah){
blah();
}
yep
Advanced algorithms are less applicable to work than SQL and redis
You’re very rarely writing your own complex algorithms
So, I tried using
ItemStack item = new ItemStack(Material or ID, amount, (short) data);```
But in game it gave me the item with -32 durability, am I doing something wrong?
where’s are you getting data
where should I be getting data?
Seems like it hasn’t undone the remap
bruhHHHH
What server version
1.12.2
🙂 thanks. I mean if they want to test my Leetcode knowledge there’s always the interview for that lol
This is more of a general question, when I was starting my plugin I put in a lot of support for changing things through the console but later realized it was complicating things, should I drop support for console and require a player to execute the commands. I ran out of scenarios for which such functionality would be useful and I'd like some opinions of other people
like is having such support totally useless?
@brave sparrow How do I know if its outputting the unmapped version?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<outputDirectory>${project.build.directory}/output</outputDirectory>
</configuration>
</plugin>
Not useless, depends on the command
If you get that error it’s not working
I'm exporting with maven now instead of Build Artifacts and still getting that
"Cannot access spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/) in offline mode"
i get that when I mvn install
could that be part of it...? does the order of things in pom matter?
Why is it in offline mode
idk man
That seems like something to Google then
normally a flag
so something environment related ig
its a button I hit on accident
now im getting...
Could not find artifact org.spigotmc:spigot:jar:remapped-mojang:1.18.2--R0.1-SNAPSHOT in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
Did you run build tools?
For 1.18.2?
Doesn’t matter
hol up
Oh
why are there no remapped jars..
The remapped jars should have downloaded to my BuildTools folder right?
so, I'm reading through the docs but I'm not entirely sure what to do yet. I just want to get the numbers after the data so I can apply it on a chest GUI. How exactly can I do it?
Ok, the remapped files download to BuildTools\Spigot\Spigot-Server\target
But I know what the data is, I just need to set it. And I can't use setData for some reason.
ItemStack#getData
MaterialData#setData
ItemStack#setData
@brave sparrow
<remappedDependencies>org.spigotmc:spigot:1.18.2--R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
the problem was on this line
ill give u 1 guess..
The —?
mhm...
So, the data I need to get is 32 (because the id is 5118:32). How can I use getData? It says that it can't be an int.
copy paste failed me
MaterialData d = item.getData();
d.setData(32);
item.setData(d);
d.setData(32);
^^
cannot be applied to int
Cast to byte
^
It gave me the item (#5736/0) instead of (#5736/32).
Show us your code
Inventory gui = Bukkit.createInventory(player, 54, ChatColor.AQUA + "Shop");
int TM = 5736;
ItemStack doubleteam = new ItemStack(TM);
doubleteam.setTypeId(TM);
MaterialData DT = doubleteam.getData();
DT.setData((byte) 32);
doubleteam.setData(DT);
ItemMeta dt_meta = doubleteam.getItemMeta();
dt_meta.setDisplayName("TM32: Double Team");
ArrayList<String> dt_lore = new ArrayList<String>();
dt_lore.add(ChatColor.WHITE + "Buy for 1000 dolars");
dt_meta.setLore(dt_lore);
doubleteam.setItemMeta(dt_meta);
Where do you set that item into the inventory?
gui.setItem(10, doubleteam);
Hm
It's into a chest
is that possible to make custom recipe for custom item that i make with itemstack?
like custom item + custom item = custom item
MaterialChoice.ExactChoice
Yes
(Doesn’t work with shapeless recipes)
But I'm not trying to edit it's durability.
for example, wooden planks has the ID of 5 and subId of 0 (so 5:0)
However, spruce wood planks has the ID of 5 but its subID is 1 (so 5:1)
In my case, I want the item to be a double team TM (5118:32) and not mega punch (5118:0 with 32 less durability).
How can I do it?
sorry for the misunderstanding.
it is
Ew
?
Use sponge
I would if I didn't have to code it all again
Durability and the data values are the same thing
It’s confusing
But that’s how it works under the hood
yeah but what would I have to do to get spruce wood planks using only ids?
because it isn't .setData((byte) 32);
so, hypothetically,
int item = 5;
ItemStack wood = new ItemStack(item)
wood.setTypeId(item);
wood.setDurability((short) 1);
would give me a spruce planks wood?
Yes
thats odd
how high is the players eye level when sneaking
1.5 blocks
thx
Thanks for your help, I noticed that it works for vanilla items but doesn't for modded items. Anyways, thank you.
No problem
Anyone know a way to stop bees from choosing a new home?
It looks like md_5 said something about adding these events a while ago but they dont show for me?
The enter even was added. The pollinate has not been added yet
Guessing its EntityEnterBlockEvent which ive been using
Yeah it's that
hey guys
can we change the colour of the sky?
have you checked the docs and googled
sir, if you don't mind, could you send me the link of the docs
I indeed googled
could you perhaps send me a tutorial link or something
because I am new to spigot developement
okay
There aren’t any tutorials for NMS
Well there are, but not for this
Register a custom biome into the registry, and then change the biome ID in outgoing packets to your custom biome
um okay lemme try
I would use ProtocolLib to intercept packets
for something like this, would it work, or does the for() all happen at the same time?
List<String> colours = new ArrayList<>(8);
colours.add("Red");
colours.add("Blue");
colours.add("Green");
colours.add("Yellow");
colours.add("Aqua");
colours.add("Grey");
colours.add("White");
colours.add("Pink");
for (Player value : players) {
int random = (int) (Math.random() * colours.size());
String team = colours.get(random);
setTeam(value.getUniqueId(), team);
colours.remove(random);
}```
because if it happens at the same time then some of the same could get picked
but would that work
Also don't create a new instance of your main class
You have a method in a method
^
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
ok
wait where am i making an instance of my main class
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
ok
what about the problem with this
how do i fix that
Move it outside the method
ok
but it needs to reference stuff INSIDE the method
Pass that stuff to the new method
Via parameters
Or arguments, whatever they are called
Then make the stuff it needs access to instance level
Instead of having it inside a method
ok
so i make an instance?
im so confused
?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.
i knew you werer gonna do that
Which one did you do?
i did the last one
Official javadocs?
yea
?paste
Hi ! I create a Gradle workflow on github and everythings compil correctly with success but when i try to get the artefact via jitpackio the compilation in jitpack failed with this error message. Anyone have some clue to resolve this problem ?
https://jitpack.io/com/github/zelytra/MoreStats/0.0.4/build.log
Use mojmaps
Mojangs mapping
You can find the guide on the release post of your version
It makes the methods use the correct names which solves your issue
https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-2-release.534760/
Scrolldown to developer notes
It's right there. See the NMS section
And the maven info is below
Use that
no
It saves only config.yml
Hello, so how do i add multiple craftbukkit dependencies in maven?
If you are curious what i am trying to achieve, i am trying to get nbt withou any api, for this i need to convert it to craftitemstack and thats the problem, bcs this class path includes version also.
Used buildtools? Yes
read the forum post about 1.18 nms (also in announcements)
And what this should tell me?
Your mom
to access CraftItemStack you need access to Spigot not Spigot-api

🤣
bump
I already did but i need to access multiple of them (multiple mc versions) and i cannot import two spigot in maven at the same time so i dont know what to do
You use modules
What does that mean?
But what does it have to do with maven import?
each of my answers is directly relevant to the question you asked
this is amazing
i need to use this
To access CraftBukkit you depend on Spigot not Spigot-api. To access version dependant NMS you read the forum post about 1.18 NMS. To handle multiple versions in a project you use Java modules.
It's amazing until you realize it's solely responsible for locking down all of Java's cool internal code :p
well fair
but it can also lock down my cool internal code
Well like, all except I think sun.misc and/or sun.reflect
eh
why
how
when and where
and who
Auoeke is a friend of one of my friends
That's who
When? 13 days ago
How? Reflection will always beat corporate assholes
Why? Because sometimes you just need it
Where? Good question
but
Oh and also
i want my modules private
ham
i am now sad
Encapsulation is just an illusion
Modules are a burden on the Java age
why would anyone want to do that?! o0
Java should be more open for internal bullshit
yes but modules are really useful
Combine IO and Streams/Lambdas, you'll know why.
I don't know why
- its a great way to stop other devs from accessing code you shouldn't access
like internals
Yeah that's what I don't like
that would break the lib
Who the fuck cares if they break the lib?
It's their fault
They see a package named internal
They see it has 0 documentation
Yet they stumble their way to a broken state and it's my fault?
I'm too lazy to doc anything
me too but I don't include it in the released javadocs
by doc i mean i add 2 lines of text and a @return
is there an api for timed item generators?
hold on
give me a second and ill make it
i already have a maven repo for you to use
ok nice
wtf is a timed item?
yes
ah
I really like making libs
and can they have holograms with countdown
lmao make it every 3
according to wikipedia "3 times a day to 3 times a week" is normal poop frequency lol
p -> {
try {
Files.walk(p)
.forEach(p -> {
try {
// ...
} catch (IOException e) {
e.printStackTrace();
}
});
} catch (IOException e) {
e.printStackTrace();
}
};
(And all of this is still mandatory even if you propagate exceptions)
I just use SneakyThrows for this 🙂
for now ill just add item spawning, then ill work on holo api
afaik sneaky throws doesn't propagate exceptions
same lol
and it's not intended
imagine not, not using methods
it's also technically the same thing as this
seems like I didn't understand what the uncheck thing is for
I don't personally think uncheck should be used
oki
tysm ike voodo
because I believe all exceptions should be checked
ALL?
even OutOfMemory?
Well no
catch(Exception e) {}
Actually why is OutOfMemory even an exception type?
lets go
what else should it be?
iirc doesn't it crash the jvm as soon as its thrown?
It shouldn't be an exception
no
It should be part of the JVM itself
well the exception doesn't crash the jvm, the jvm just dies
well no
All types under Error, really
you can be out of memory and still work fine
They're not intended to be caught so why allow them to be caught??
if you dont create new objects etc, you dont need more ram
one could easily recover from OOM by eg clearing unused lists or sth
But yeah my point is that unchecked exceptions shouldn't exist
The dev should have to either explicitly ignore or explicitly handle an exception
ping me when you're done
Like, for example
The number parsing methods are kind of a shitshow tbh
To everyone mocking me for using light mode - this is the reason
It is unconventional to use exceptions for handling control flow due to the cost of handling exceptions
Get sum fuckin' curtains then
but I like having some light when it's day lol
Yet, there is no way to check if a number parse was actually successful
Blinds exist too
sure you are a dev?
At least, not without catching the format mismatch exception or whatever it's called
Which, just so happens to be a RuntimeException
Even though you will likely want to handle it
But then for the cases where you don't need to, it's also annoying!
This is why you should just be able to decide, explicitly, whether you want to handle an exception or not
@raw ibex btw don't mind the fact that its not fully finished, i am working on alot of things for it rn xD
It shouldn't be down to the exception's type
I only know that I am hungry
(I've also never really liked how "magic" exception types tend to be)
what are "magic" exception types?
Re-read that sentence
how are exception types "magic"?
They have semantic meaning on a language level just from being a subclass of another type.
What makes Throwable so special, hm?
that's true
And then the specific superclass matters too
RuntimeException/Error are unchecked while Throwable/Exception are checked
ALSO
Nobody likes declaring multiple exception classes
Especially when you need to support all the constructor combinations
My point is:
panic!("The bees have escaped.") Rust does it so much better.
I hate the old slimefun API
// Old Slimefun API
try {
final Class<?> slimefunItemClass = Class.forName("me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem");
final Class<?> slimefunBackpackClass = Class.forName("io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack");
final Method getByItemMethod = slimefunItemClass.getMethod("getByItem", ItemStack.class);
final Object result = getByItemMethod.invoke(null, item);
if(result == null) return false;
return slimefunBackpackClass.isInstance(result);
} catch (Throwable ignored) {
}
look at those package names
Oh god
Welcome to:
"I don't know enough Java to make good code, but I know enough Java to make something work."
sounds like notch talking about himself lol
Notch is a based
didn't he tweet some homophobic and racist things a few years ago?
Yeah
Well actually no I think it was like
Just transphobic stuff
Idk
Somethin' offensive that everyone got upset about
I legitimately cease to care though, as it does not concern me
lol
I mean that's not exactly homophobic
It's just controversial/offensive
telling people they deserve to be shot just because they have another opinion lol
also r/unpopularopinion is awesome
There's a chance it's satirical because of the "By a photographer" addendum.
Or
Not satirical
"With a gun"
but at least intended to be a half-joke
Subversive dark comedy
Bullshit that they wiped his face off the game he made tho
Like I think he's still in the credits
But he's not mentioned in the splash text anymore
well after all he sold it
after all it's oracle java now and not sun microsystems java
Yeah but that doesn't make it justifiable
I don't personally believe in pride or whatever
well I don't agree with him but I don't wanna be shot so I'd rather not answer on twitter
but... rainbow flags
rainbow flags are awesome
we all commit crimes
yeha ok
I don't need to go to a parade or put the word "gay" all over my profile just to validate to myself that I'm gay.
lol
Anyway I believe in ex-convict rights too
the biggest crime you can do is to run craftbukkit on a server
In fact, prisoner rights
no no no
Recently Biden released some kind of like
but you can get drunk there and make out with other people
is to run cardboard on a fabric server
joe biden released a fabric server?!
thats the real crime
It was like a bill or smthn
no
joe biden should sign a bill banning the use of 1.8 but I guess the congress needs to do that instead
this is a crime, cardboard just uses so much reflection
formed and renewed
and loads like 6 plugins
So, effectively the U.S. banned private prisons
Which is a step in the right direction 👍
why do I always turn this chat into offtopic lol
I should get banned for the sake of everyone else
Because this chat is basically just general-2 but idiots sometimes come in here
oh yeah true
asking java questions and stuff
Yeah
yes
indeed
like me
unpopular opinion: the last 2 seasons of the office are actually awesome, people just hate them because michael is gone
why did you spoil
you little
- I am not compatible with a lot of the gay people outside of my circles.
- I have a boyfriend why would I fuck some other dumbass-
huh? that's common knowledge
michael left the series because he wanted more time with his family
I didn't watch it yet
my family is like "eh nah its not good"
they don't like the office
but i do
the office is so awesome
I know many people who don't like it
I uhhh
they are all stupid
agree, i only managed to watch one episode tho
I like
oh
the first episode is the worst
I just watch the clips sometimes
it gets better with every season
the first episode is literally the most boring one
Am I allowed to skip it
yeah
alex
ike
the whole first season is quite boring
oh
you'll like it once you watched the rest, though lol
Am I allowed to skip the first season
I'd suggest to start with the last or second last episode of season 1
ohk
the best episodes are
- finale (last episode)
- goodbye michael (end of season 7)
- stress relief (season 5)
- dinner party (season 4)
oh
and Threat Level Midnight lmao
season 7 I think
Oh I didn't know there was an actual ending
I just thought it was like
One of those shows that goes on forever
there is but I must not spoil it here
I think I've watched the whole show 20 times already lol
once I'm finished this time, I'll go watch scrubs again
Most of the time when it comes to long shows
I just watch the clips
Like sometimes YouTube recommends me House M.D. clips and I'm just like
"Yeah, why not?"
house is awesome too lol
Although I have seen Death Note two times so far
Kinda three if you count the fact I've watched like 10 analyses of it
Wait
Well
I've seen it four times
I've seen Breaking Bad three times, if you count the analyses :)
oh I can't wait for the next season of better call saul
Oral History? Where's the Ana-
lol
yeah
ugh
15.82 x 3.89 x 23.5 cm
amazon actually precisely states the size of a book
@raw ibex would something like
public class ItemSpawnAction implements TimedAction {
@Override
public void execute() {
// Do your item spawning here
}
@Override
public boolean repeat() {
// Check if the action should be repeated
return true;
}
@Override
public long delay() {
return 20; // One second delay, you can change this however you want
}
}
be nice?
you can also override async()
but i wouldn't raccomend that
what the greg is TimedAction?
its a timed action
Custom interface or smthn
yeah but where does it come from
yes
its in my lib lmao
i am asking them if they like that
they wanted smt to spawn items at a certain interval
and i made it a lib
why don't they just do a repeating task lol
Run every 10 seconds:
World.spawnItem(...)
because my system allows for changing the time
the BukkitScheduler allows that too
so bw for example has 3 things:
Diamond I
Diamond II
Diamond III
on each of these the time changes, its much easier in my way imo
instead of lambda shit
Ike can you send a link to your lib? I wanna look at it, I'm bored
Hey, lambdas are fine >:(
"Lambda shit"
LAMBDA SHIT?
yeah i like lambdas
bro your lambda took a shit on my rug
instead of lambda shit, lambda's aint shit
go clean it up
i love them
You don't need to use lambdas to use the bukkit scheduler.
“That rug really tied the room together.”
But you are supposed to...
Exactly the same thing
one of the best bad movies ever
WHERE'S THE MONEY LEBOWSKI
You are supposed to use lambda and not create an anonymous inner class
maow did you watch Airplane?
I haven't yet, unfortunately
you must do so
fun fact: the german title of "airplane" is "die unglaubliche reise in einem verrückten flugzeug"
jesus
"the incredible journey in a crazy plane"
thanks for the fun fact now I'm a better developer
yeah we always make movie titles a bit overly verbose
np!
The bukkit scheduler has existed long before lambdas did.
Moreover, he could make a legitimate class extension as well.
CTRL + Z
don't you use git?
Have fun unfucking that.
this level of noob disgusts me
it's in META-INF or sth I guess
META-INF/maven/pom.xml
unless you excluded that... in your pom
lol
no i didn't
At least now you probably won't make that mistake again.
oh and i fucked up intelli
Oh we actually have good weather for once o0
is there ANYTHING you did not fuck up?
Ike aren't you the dude who doesn't like fish?
The onosecond
onosecond?
When 'undo' won't do. • Sponsored by Dashlane, the password manager. Get a 30-day free trial at https://www.dashlane.com/tomscott • MORE BASICS: https://www.youtube.com/playlist?list=PL96C35uN7xGLLeET0dOWaKHkAlPsrkcha
Written with Sean Elliott https://twitter.com/SeanMElliott/
Graphics by William Marler https://wmad.co.uk
Audio mix by Graham Ha...
Yoko Ono second
talking about yoko ono: fun fact, I once puked at the entrance of the building where john lennon was shot
should you include your pom.xml on gh
Yes
erm yes, obviously?
The pom is necessary for building
And
Testing
And running
And everything else
then i am retarded
(Also dependencies)
of course the pom belongs on github
So, why would you exclude it from GH?
what doesn't belong on github are your .iml files
Yeah
Although there's actually some stuff under .idea that should apparently be kept
erm
did you exclude the pom in every of your projects?!
I'd recommend using GitHub's gitignores repo
that one has a pom
semmieboy_yt
?
he's the other person in the proj
ah
Amateurs
Today I made a video that's just Pigstep. No modifications, so it might be loud. Just listen to the video!
Lena Raine: https://www.youtube.com/channel/UCbUHGz_K9jhvbQjfXdJUwxA
he only has one video on youtube
Amateurs everywhere
which is just pigstep
The least clickbaity you can get.
Personally I really like Pigstep
It fits the Nether vibe
Even if it's not at all similar to C418's tracks
https://github.com/IkeVoodoo/OmniLib @tender shard fixed
lol I found a 12 year old video of a friend of mine destroying a clock in school https://www.youtube.com/watch?v=bx2pgvEJubc
deploying to nexus
So wait
You know how to deploy to Nexus
But you don't know that you're supposed to commit your POM?
yes i have my own repo
exactly
You are a special kind of stupid, Ike.
lol
he is retarded
he already admitted that
leave him alone
No :)
god arrived
my repo does not have SSL
Oh shit it's god
and i have no clue why
shi nice
Ayo god can I have $10
whats the magic word?
should I get a chicken döner or a calf döner?
since we're in #help-development imma ask a question:
how the fricc do i add SSL to nexus
wrong.
i am too retarded for that
mixed
chimken nuggies
well, using your webserver
i uh
Oh I didn't know heaven was doing equality quotas and shit
let me guess - you run it directly from docker without any reverse proxy?
Awomen
i let nexus be the webserver
I am not even using docker
i just started up nexus
lmao
sin!
hot awoman*
then set that up for SSL
awooo
just one woman
tf is a reverse proxy
d
oh thx
a webserver that redirects your requests
glad I could help
this is my apache vhost config for my nexus:
<VirtualHost *:80>
ServerName hub.jeff-media.com
Redirect 301 / https://hub.jeff-media.com/
</VirtualHost>
<VirtualHost *:443>
ServerName hub.jeff-media.com
ServerAdmin webmaster@jeff-media.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/hub.jeff-media.com-access.log combined
DocumentRoot /var/www/hub.jeff-media.com
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /nexus/ http://10.0.0.104:8002/nexus/ nocanon
ProxyPassReverse /nexus/ http://10.0.0.104:8002/nexus/
RequestHeader set X-Forwarded-Proto "https"
Redirect 301 /nexus /nexus/
<Location /javadocs/>
ProxyPass !
</Location>
ProxyPass / http://10.0.0.104:8001/
ProxyPassReverse / http://10.0.0.104:8001/
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/jeff-media.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/jeff-media.com/privkey.pem
</VirtualHost>
should i use nginx of apache
the one you are more used to
I just piggyback off of Sonatype's OSS repository
I use apache since I know how it works
i am not used to
then use nginx
Since ✨ Maven Central publishing
shit
shat
my corona warn app tells me I met someone who was positive on march 4th
L
F
anyone know how to get the breaking sound of a block in 1.18
hm
i have everything working
theyve changed the nms in 1.17
yeah thats how u used to do it
but theyve changed something
and i dont know how to do it anymore
how did you do it before 1.17?
also cant find any pages
u get the nms block
and then somethin about keys
it was complicated
i tried it in my version but some stuff was missing
no, english
Only English is permitted in this server
@tender shard
what does make someone a good java programmer?
and what knowledge is required to be a considerably good java programmer?
net.minecraft.world.level.block.Block
A
?
@tender shard ñ
I'd argue it's someone who understands the language, conventions, and surrounding libraries (AKA ecosystem).
whats the iblockdata
and objects
there is so many books and things to be considered
how do i get that/
I never read a Java book
sorry no idea, never used NMS blocks before
Eh you can skip Java EE
can u check if BlockData is castable to iblockdata
It's only necessary if you're working with enterprise code
@round finch you created plugins?
@manic crane Stop pinging everyone.
i make plugins
Ok men
@manic crane
but never publish any
@manic crane ü
No problem
i dont know why i still use eclipse
Ü
intellij is so much better
ah yes, FactoryFactory classes
Ok ok
😂
Please
The only thing that could tempt me away from Eclipse is better module handling in InteliJ
kikba you can reply without ping
like this
Many money ?
nms doesnt come up on the spigot javadoc website?
of course not
how to turn off ping in reply
Are you asking if plugins pay well?
mojang mapping?
me low money
Same
2 USD, 10 USDT :p
the crypto of which I can't use because it's on the wrong chain
how do i do that
how do i like replies
oh got it
yes, but can i only like replies?
OMG I CAN ALSO LIKE NON_REPLIES
anyone know how to use nmsBlock.StateById()?
im not sure what to put in for the block id
who's spamming?
reeee
my config.yml sucks
why?
but not in the good way, I suppose
messy?
I wouldn't mix messages with normal config options
make a separate messages.yml file
yeah mfnalex idea sounds good
- my method name sucks too because of config XD
order and understandable
leaving no confusion
should make 2 class for single and multiple home?
1 single home and an other for multiple
Homes:
so no more confusion
i mean if they're only allowed to one
maybe they should only be able to use first home
🤷♂️
default -> /sethome
optional -> /sethome test
that is my idea
the option is to you!
i just thought to select first in list
so they can only changed that
if multi homes was off
me, trying to setup nginx
"modify" what?
i mean they only can change first home in list
homes:
if they dont have more 1 home add home
if multi homes is off
one select lemme get paint
you mean to use 1 list for single and multiple?
paint it lol
for only one home you dont even have to create more than 1 home object
just make it mutable
does anyone have any clue about how to add ssl to nginx
think i missed the topic. whats the topic on the homes thing?
there's probably a billion results for this on gnoogle
Multi homes and single
basically you can probably just run certbot and it does everything automatically
check for Permission Homes + number
so
default -> /sethome
default -> /sethome test (without the option to make it off)
thanks for this idea
talking about maximum homes how should be done>
in config? homes.max: 40
and for code ?
homes.max. + interger
Hmm
Multi Home System
no idea, I'm watching the video of bear grylls drinking his own piss
make a watch2gether
oh
it's only a 1.41min video lol
lmao
long enough to watch it together
Permission node is the way
Hm
damn
highest
then they're dumb enough to have duplications
dublications
😂
dub dub dup
of course you could loop the permissions strings
and get the highest
to solve that
but dont loop 1 to 100
if player has homes.100
fair enough
hm
this ..honestly tru
you could give different max homes perms to different players
or groups
Hello 👋
Ive tried to create a stomp function (you sneak, fall down fast an do damage to all entities around you)
public class PlayerToggleListener implements Listener {
@EventHandler
public void onPlayerToggle(PlayerToggleSneakEvent e) {
Player p = e.getPlayer();
Location l = p.getLocation();
if (l.add(0, -1, 0).getBlock().getType().isSolid()) {
return;
}
if (!p.isSneaking()) {
return;
}
if (p.isSneaking() && !l.add(0, -1, 0).getBlock().getType().isSolid()) {
while (p.isSneaking()) {
p.setVelocity(p.getVelocity().setY(2.0));
}
}
}
}
But I have 2 problems:
1.: After this my DoubleJump wont work anymore
public class DoubleJump implements Listener {
private final HashSet<UUID> cooldown = new HashSet<>();
@EventHandler
public void onJoin(PlayerJoinEvent event) {
event.getPlayer().setAllowFlight(true);
cooldown.add(event.getPlayer().getUniqueId());
}
@EventHandler
public void onFly(PlayerToggleFlightEvent event) {
Player player = event.getPlayer();
if (player.getGameMode() == GameMode.SURVIVAL || player.getGameMode() == GameMode.ADVENTURE) {
event.setCancelled(true);
if (cooldown.contains(player.getUniqueId())) {
return;
}
player.setVelocity(player.getLocation().getDirection().setY(1));
player.playSound(player.getLocation(), "minecraft:custom.jump-1",0.1F, 1.0F);
cooldown.add(player.getUniqueId());
player.setAllowFlight(false);
}
}
@EventHandler
public void onMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
Location location = player.getLocation().clone();
if (cooldown.contains(player.getUniqueId())) {
if (location.add(0, -0.5, 0).getBlock().getType().isSolid()) {
cooldown.remove(player.getUniqueId());
player.setAllowFlight(true);
}
}
}
@EventHandler
public void onGamemodeChange(PlayerGameModeChangeEvent event) {
if (event.getNewGameMode() == GameMode.SURVIVAL || event.getNewGameMode() == GameMode.ADVENTURE) {
event.getPlayer().setAllowFlight(true);
}
}
}```
DoubleJump.class
2nd: My Server crashes after doing my stomp and I cant rejoin (I have to kill the whole process in order to join again)
Does 1.13+ versions still have the possebility to add custom items somehow? I recall older versions utilizing the ability to use resource packs to assign new textures to item variants that dont exist in the vanilla game
but variants aint a thing anymore
CustomModelData
can you give me a link to some sort of tutorial if you know of a good one?
bet its while (p.isSneaking()) { p.setVelocity(p.getVelocity().setY(2.0)); }
^
Yep, because you're on the main thread there, you've basically frozen the entire server until the player unsneaks, which they'll never get the chance to do, because you've frozen the main thread.
nope, since the boolean will never change
unsneak = new event called with a different boolean
or did he use players sneaking
He grabbed the player object.