#help-development
1 messages ยท Page 1466 of 1
Im coming into this with almost no knowledge on creating a minecraft client, should have mentioned it beforehand
when you decompile, its pretty much going to decompile with random class names, method names etc
yeah, I can see that lol
the mappings, clears up some of this and maps some of the obfuscated parts back into something legible
a.class
https://launcher.mojang.com/v1/objects/374c6b789574afbdc901371207155661e0509e17/client.txt this is the latest version mapping
that step is called remapping
so before you decompile, you use the mappings file that mojang provides, use a tool that can use said mappings, and remap the jar first. This way when you decompile, some of the code is legible and makes sense
mojang doesn't release mappings for the entire code, just to code that is mostly relevant such as world classes, player classes etc
use a tool that can use said mappings, and remap the jar first
Do you mean the ide(in my case intellij), or is there another tool for this?
ProGuard
there is another tool
ah
ProGuard doesn't remap @lofty mulch
what tool then?
https://github.com/ShaneBeeStudios/McDeob found this github project, dunno if it's what im looking for
https://github.com/Porama6400/MCMapper
@stuck kindle
I use this one
mainly because it will download the mappings for you
so what's about the decompiler?
just have to put on the command line which version you want ๐
ah, and after I run that I can get the jar of the version, which I can then modify?
not yet
so after you use that tool, you are going to then decompile the jar
I personally use Fernflower
y not forgeflower
however there is other decompilers
I can't use intellij's built in decompiler?
intellij is fernflower
l
oh
steps
- run https://github.com/Porama6400/MCMapper, get the jar
- decompile
- modify?
then compile
then compile yeah
put it into versions and run
Well can't compile
ah i forgot the lib things
no recompiling?
have to fix decompiler stuff before recompiling
โ
jesus I've read the word compile so many times it doesn't seem like a word anymore XD
well @wet breach just let him do 3 first steps first
no it's not lol
lol real quick XD
decompiling took a lots of time
that long?
it takes a few minutes
but its going to take you longer since you never done it before
and never messed with the various options of fernflower ๐
such as needing to kill LVT
Class.forName("me.superischroma.spectaculation.item.SMaterial"); // ensuring materials are loaded prior to this
for (SMaterial material : SMaterial.values())
the complie mark this red
bruh I've never really had to decompile except for a couple mods/plugins I wanted to look into
class.forname?
@stuck kindle yeah that is easy decompiling
yep
you can use fernflower or https://github.com/MinecraftForge/ForgeFlower/releases/tag/1.5.498 lol
this is a bit more advanced then just decompiling plugins XD
Class.forName() throws exception if a class hasnt been found
great way to detect if the class is loaded by class loader
alright, downloaded the git project
Fernflower is literally Intellij IDEA's built in java decompiler
tbh I prefer using ForgeFlower lol
btw error is not from Class.forName
anyways, you have some information, just start playing around with it @stuck kindle ๐
and just know, that if things don't go right its fine
just start over and try again XD
alright
can anyone help me?
wait
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.
depends how far they get before they get to a spot where backing up is necessary @lofty mulch
idk
now that's a fatass enum class right here
i think it's neccessary for the first time
what I mean, is they could screw up the decompiling probably the first 6-8 times ๐
๐
question is why would you include the every single item in the game
half of them aren't used
multivers i suppose
uhhhhh
support building project
you dont have to install gradle
just use gradlew.bat <task>
it's going to use gradle wrapper to build
I've used gradle like 3 times so uh
gradle does what maven does just differently. So its another build system
use which ever you prefer
prefer using gradle in my case โฟ
sometimes is better
gradle isn't better most everytime lol
for most projects you will see the exact same performance
kotlin dsl is kinda slow
idk I like maven
maven is stable
maven has the ability to compile concurrently as well as you can give it more resources, most people just don't bother to learn this
it seems more cleaner
lol
than to deal with xml's
uhhhhhhhh
not really
but it's good for custom scripts
without creating new plugin
i use it cause i dont have to deal with like 100 warnings
lol
m4v3n is good
what I like about maven, is the ability to create custom plugins super easily to do whatever it is you want
gradle is good too
that's your choice lol
Ngl im not a big fan of xml structure because of how much unnecessary ending tags and beginning tags it creates tho
Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_271 contains a valid JDK installation.
?
i couldn't imagine writing complex project pom xml by hand
i fixed it, and its now granted a new error
Error occurred while enabling Spectaculation v1.0-SNAPSHOT (Is it up to date?)
java.lang.Error: Unresolved compilation problem:
Unhandled exception type ClassNotFoundException
at me.superischroma.spectaculation.Spectaculation.onEnable(Spectaculation.java:129) ~[?:?]
its like writing a static website
can you dm me
invalid jdk installation? Do I need to use another version or something?
did you miss the part about custom plugins?
lol
literally can make maven plugins do anything you want it to
I am pretty sure if you are using maven
nvm found the solution
odds are you are a developer
im just dumb
i never developed a custom maven plugin
learn more learn more
super easy
there's plugins
alr
like shading stuff
is pretty useful
or compiler plugin
apart from that i haven't used them much
im more interested in C langs right now than Java idk
well, if you don't like maven's xml stuff all that much
you can just create a plugin to use whatever config style you want
i mean its not bad with autocomplete
most of the things are autocompleted anyways
since markup is pretty easily autocompletable
compared to other syntax languages
cmake is pretty powerful build system for C
well either way, just like to point out mavens versatility since most forget that making custom plugins is a thing for maven >>
you literally have a separate "programming language"
with for loops
variables
and its cross platform
can be
well cmake is cross platform yeah
your code on the other hand, not necessarily so
yep
if I am making cross platform projects, I only worry about windows and some linux distro's
I don't care for apple
how do I build with gradle? tried running gradlew build but keep on getting
Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_271 contains a valid JDK installation.
probably simple
need JDK of java 1.8
or just install an updated version of java that is java 11 or higher
where the JDK and JRE are not separated
I have java 8 and se dev kit 13
ah, then its a path problem
you need to manually point gradle to the JDK directory instead
currently windows has the JRE set as the default java version on the path
Tried using
SET JAVA_HOME=C:\Program Files\Java\jre1.8.0_271
in cmd prompt
apparently this worked for some
even if that worked that directory is incorrect for the JDK version
the directory you have is for the JRE version, which is not the one you need
there you go
that is the directory for java jdk 13
you can use that, or use the 1.8 jdk
personally I would stick with java 11 or higher
Alright, I'm going to need some math help here because I just can't stand vectors. So I basically just literally want to spawn an X by Y wall in front of the user. Suppose the following examples:
P -> Player
W -> Wall
In the case the user wants a 5x5 wall:
W W W W W
P
(birds-eye view. It is 5 blocks across, 5 blocks height, and 1 block thick)
For an even number like a 4x5 wall:
W W W W
P
(birds-eye view. It is 4 blocks across, 5 blocks height, and 1 block thick)
tried it, same error
Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_271 contains a valid JDK installation.
here is the code I got so far:
public void buildMapScreen(
@NotNull final Material mat, final int width, final int height, final int startingMap) {
final Vector direction = location.getDirection();
final Location center = location.clone().add(direction);
final Location rotate = location.clone();
rotate.setPitch(0);
rotate.setYaw(location.getYaw() - 90);
final Vector rotation = rotate.getDirection();
final Location blockLocation = center.clone().add(rotate).subtract(0, width / 2f, 0);
rotate.multiply(-1);
final int initialX = blockLocation.getBlockX();
final int initialZ = blockLocation.getBlockZ();
final World world = Objects.requireNonNull(location.getWorld());
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
final int map = startingMap + x * y;
final Block block = blockLocation.getBlock();
block.setType(mat);
}
blockLocation.add(0, 1, 0);
blockLocation.setX(initialX);
blockLocation.setZ(initialZ);
}
}
(location -> player location)
(sry for interrupting)
It's looking for C:\Program Files\Java\jre1.8.0_271, is there a place where I can change where it looks?
@paper viper to get an even square it has to have odd numbers
all good
uh you should be able to set somewhere in the gradle file where to look
or you can mess with the windows path environment settings
which there are tutorials on doing that
just google setting java environment variable for windows
ok
@paper viper ok, if you want to spawn a wall in front of the player why do you need vectors?
I need to get the direction the player is looking at, get that direction location but 1 block in front of them
and spawn the blocks there
my english is shit
lmao
ay it finally works
Nevermind...
right as i say it
ill figure it out tmr cause Im way too tired rn and my brain won't function properly, but ty everyone for the help
gn
declaration: package: org.bukkit.entity, interface: Entity
returns the cardinal direction, thus no need for vectors lol
Ah
vectors are handy, but not needed for most things. They come i handy when you don't have all the information and need to dynamically do stuff inside of a box
or if you need to figure out trajectories
but you pretty much have all the information, only thing you just need to obtain is the direction for the player and then put a wall where you want based on the players location ๐
Weโll build a wall and make vectors pay for it
build a wall?
@plush citrus
Has anyone tried to make a better Roller Coaster plugin than Train Carts'
wdym by rotated
like upside down and sideways
otherwise, can't really have a decent roller coaster plugin XD
the cart can but the player no
Interesting
I want to create a plugin where I need to store extra data with blocks in the world. To do this I thought I would implement my own data system whereby whenever a chunk loads I load the extra data and whenever it saves I save the data. ChunkLoadEvent works for the loading, I thought ChunkUnloadEvent where event.isSaveChunk() is true would world work for saving but it doesn't. When you stop the server and all the chunks are saved this event isn't fired. It also isn't fired with the /save-all command (I guess because the chunks are not being unloaded, only saved). How do I listen for chunks saves no matter what?
@mystic ivy this has already been done for you
declaration: package: org.bukkit.persistence, interface: PersistentDataContainer
How do I use this with blocks?
With items it's like this itemStack.getItemMeta().getPersistentDataContainer(); but I didn't think you could do that with blocks because they don't have NBT data. (Or at least non-bockentity blocks don't)
ah ddint know persistentdatacontainer didnt have an interface for blocks, only entities and items
but yeah redlib has something like that
i do not consent
how do I get a Player object from AsyncPlayerPreLoginEvent
or is that not possible as the player doesn't exist yet or whatever
cause my hashmap uses Player objects and not uuid, if i can't get a Player out of it I'd have to rewrite lotta things
any good title api for 1.8 to 1.16?
public static void sendTitle(Player player, String mainTitle, String subTitle, int duration, int fadeInTime, int fadeOutTime) {
PacketPlayOutTitle times = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.TIMES, null, fadeInTime, duration, fadeOutTime);
PacketPlayOutTitle title = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.TITLE, IChatBaseComponent.ChatSerializer.a("{\"text\":\"" + ChatColor.translateAlternateColorCodes('&', mainTitle) + "\"}"), fadeInTime, duration, fadeOutTime);
PacketPlayOutTitle sub = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.SUBTITLE, IChatBaseComponent.ChatSerializer.a("{\"text\":\"" + ChatColor.translateAlternateColorCodes('&', subTitle) + "\" }"), fadeInTime, duration, fadeOutTime);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(times);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(title);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(sub);
}
ty
I'm using protocollib to cancel certain chat messages (from plugins), but how would I check if a message is sent from the server or a player chatting if the chatformat is changed? java ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(ChatTest.getInstance(), Server.CHAT) { @Override public void onPacketSending(PacketEvent event) { // Determine if the message is from a player or a plugin using Player#SendMessage } }); @ me please <3
Iโm serious man, come on
i thought you were Rayrnond
I am.
but you just said you're serious
Iโm very aware of that. Iโm trying to check if the packet is sent from a player sending a chat message OR a plugin sending the player a message.
Connection connection = DriverManager.getConnection("jdbc:sqlite:" + file.getAbsolutePath());
i found this
i thought getConnection must be an URL
gradle or maven
module bungee reads package net.md_5.bungee.api from both bungeecord.api and bungeecord.chat, the chat and the api arctifact both have classes in the net.md_5.bungee.api package so this is impossible?
test and find out
simple log message when the packet is sent/received, tells you a lot about when it's being used
I also to tried to exclude, but that breaks my program because I am using the chat module
what happened here
Could not find method compileOnly() for arguments [org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
@maiden briar you cant use modules with bungee/spigot
Yes, but it's a feature from Java 9+
And if Minecraft goes over to 1.17, it will probably use this feature
Hi does anyone know how to get the chunks of a pasted schematic and load them? I am using FAWE
worldedit has a discord
Did you add the repo?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Migrating from an exisiting project is too hard
Depends, it can be confusing if never done before
Ah yeah sad I got here too late then
and if I have any future projects I would def start with gradle
๐๐
there is no easy way to migrate yes?
It usually takes 2 seconds to do
I have a problem with my Maven multi-module project: If I have a distribution module which compiles the other 3 modules, I only get one module-info.java (distribution module), the others are away
it just sounds so useful
Install gradle there first
Then we can go inside the terminal in your project and write gradle init
cool
I use windows btw ๐
ohhh
Should be fine regardless
I'm on linux just cause the development server and the panel runs on linux so yeah
I mean gradle is java so it should be 100% cross platform
True
the only non-cross-platform java programs are badly made ones
I mean most java programs made without other OSes in mind works just fine
Yeah
@paper viper ๐
Anyways go ahead and finish that guide on how to install gradle and then lmk
ok gradle init, then?
no?
eric@EricPC:~/IdeaProjects/gamemanager$ gradle init
Starting a Gradle Daemon (subsequent builds will be faster)
BUILD SUCCESSFUL in 1s
2 actionable tasks: 2 executed
yes
Then it should be no problem
build.gradle and all the shebang
Pog
now intellij is asking me if I want to load the gradle build scripts
well a bit
Do that
when I was making forge mods
Oh yeah
but back then it was just download template, run a few setup commands
and gradlew.bat build
Like maven the tasks can be found at a sidebar to the right
gradlew.bat runClient
breh
distributionUrl=https://services.gradle.org/distributions/gradle-4.4.1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
4.4.1 nice
gonna make that 7.0.2 real quick
Ah yeah
Download https://services.gradle.org/distributions/gradle-7.0.2-bin.zip finished, took 1 s 380 ms (112.06 MB)
Starting Gradle Daemon...
Gradle Daemon started in 462 ms
BUILD SUCCESSFUL in 4s
now I pressed the little button and what next
the refresh thing
I do know Im gonna need this button a lot
ah yes helpchat
Yeah
do I follow this?
If you just wanna set the plugin up
Im tryna migrate
Didnโt you finish that?
oh so I do the set up thing now?
Yeah the build.gradle
cool thanks
https://www.spigotmc.org/wiki/build-you-spigot-plugin-with-gradle-groovy/ I did write this in case you need some goto
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
ok I got a newest gradle on my PC
since it was like 4 or smth
now I do get a choice
which do I choose
I ran gradle init
@ivory sleet
Uh what does it say
Yes
Groovy or kotlin
Groovy
ok
More people use groovy so in the start I recommend groovy
in this guide
it said to add some lines to pom.xml
but I dont have that file?
do I create it
Wait did you use maven before this?
no?
Okay then skip that
kk
what do I make the group be
the first 2 layers on my package name?
hk.eric.plugin
and my group name would be hk.eric?
Uh yeah you could go with that. Buts itโs usually your domain in reverse
I personally think starting with maven as your dependency manager is more appealing in the Spigot environment.
I dont have a domain~~~
It really doesnโt matter tbf
Go with the package name lau
You can always change it later
that's just my username, Imma just make it hong kong
Yeah, groupId becomes slightly more crucial when you publish your jars but yeah as of now itโs quite insignificantly important
You have quite a bit more resources and more people will be able to help you.
But in the end it doesnt really matter that much
also iirc some ppl link the gradle version and the version in plugin.yml?
how do I do that
Most of those who actually help use Maven though. Only the odd couple of helpers use gGradle
there should be multiple help-development channels
to help multiple people at a time?
when multiple people ask for help, it makes mess in one chnanel
So uh in your build.gradle
processResources {
expand "pluginVersion": project.version
}```
then in your plugin.yml
```yml
version: ${projectVersion}```
At this point my DMs have become a help-development channel ;/
๐
rip
Not really true imo
Uh howโs your build.gradle looking
/*
- This file was generated by the Gradle 'init' task.
- This is a general purpose Gradle build.
- Learn more about Gradle by exploring our samples at https://docs.gradle.org/7.0.2/samples
*/
plugins {
id 'java'
}
group 'EE.ric'
version '1.0.0'
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
}
processResources {
expand "pluginVersion": project.version
}
?paste
add mavenCentral() in the repositories block
Pog
Oh
Uh so where is your classes located
main is at hk.eric.main
No like the folders
you shouldn't pick your technologies based on how much support is available for them alone
${projectRoot}/src/hk/eric/main.java
Thatโs the issue
Not sure where you got that idea from, but thats not what I said.
you will have to move them to
src/main/java/hk/eric/main.java
that's what it looked like you were implying
Sure but the convention is this
also, Gradle has an entire official wiki with pretty much everything you'd ever need to know on it
SO does Maven
so they're both equal in terms of available support then
No, in this channel/Spigot the majority use Maven so support is better for Maven
true
I was really just saying that he's likely going to find it harder to obtain support here for gradle then maven, but which he chooses is upto him, as alwasy
ah fair enough
do I have to
do you have to what?
include the plugin.yml and sutff
I am here so new gradle users can live a pog life
yes
in the java folder aswell
No
src/java/resources/plugin.yml
src/main/resources/plugin.yml
ok
Ok
Conclure wake up :kekw:
main is the name of the source set
Nice of you to volunteer to be the official Gradle support for Spigot ๐
yeah I came here too because Conclure told me people were hating on Gradle in the Spigot Discord again lol
which, as I found out, isn't true, but hey ho, I'm here now lol
it recommended me the directory name resources when I create new
yeah it does that
it knows that folder is recognised as resources
and it can pick up from Gradle that main is the name of the source set
Missing property (projectVersion) for Groovy template expansion. Defined keys [pluginVersion, out]
show build
Could not copy file '/home/eric/IdeaProjects/pluginname/src/main/resources/plugin.yml' to '/home/eric/IdeaProjects/pluginname/build/resources/main/plugin.yml'.
Missing property (projectVersion) for Groovy template expansion. Defined keys [pluginVersion, out].
what build
a.k.a your build file
Did you add the processResources expand thing
sorry if that wasn't immediately clear ๐
processresources expand DONG
lol
Lol
typical pisscord
/*
- This file was generated by the Gradle 'init' task.
- This is a general purpose Gradle build.
- Learn more about Gradle by exploring our samples at https://docs.gradle.org/7.0.2/samples
*/
plugins {
id 'java'
}
group 'EE.ric'
version '1.0.0'
repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
}
processResources {
expand "pluginVersion": project.version
}
linux discord is the least maintained branch ever
change me mind
Yeah and then did you reload the gradle project?
linux discord is the same as windows discord
the electron binaries are just different
the whole point of using electron is that they don't need to spend effort on actually making it work on different environments
yeah idk
they just write a webpage and then bundle in a browser and call it an application
maybe electron on linux alr have a back/forward feature
and they just implemented it again
ik electron is a chromium
ripcord also has back/forward
I did but still
and also tabs
no I mean 1 back/forward button triggers twice
what is that supposed to mean
like when I press the mouse 4
it triggers once
and when I release mouse 4
it triggers again
sounds gay
okay so what did you put in plugin yml
and plugin.yml is located in /src/main/java/resources/plugin.yml
name: PluginName
version: ${projectVersion}
author: EEric
main: hk.eric.pluginname.main
api-version: 1.16
load: STARTUP
commands:
Lol
me si so blid
why not just directly use project.version in plugin.yml
I think this is like one of the gradle overheads
You would have to define those variables then if thatโs possible
last thing
It doesnโt automatically interpolate variables like that
how do I make it auto-deploy
Elaborate
like after I run, auto-copy it to a sftp server
run => Run pluginname[build]
and after it builds successfully
copy the result to a sftp
just make it deploy
Misscord
Sure they do
not when you're building with gradle
ok
You have configs but yeah using gradle is better
but probably not ideal
^
i mean, you could use your os to mark the target directory as a remote directory and hook it up to the ftp serbur
aaaaaand another crash
and that'd make it happen without an ide at all
Im starting to believe discord hates me
discord hates all living things that aren't pedophiliac furfags
so furries that likes kids?
wait I just realized
why is there a text channel in voice channels
there's usually a tts enabled text channel in the voice section
for the people without mics
I see
Hi everyone. Using Bungeecord, if I set a permission from it to allow of using command /gamemode in servers, does it has to work? I ask because I added to me that permission, but it doesn't work.
is there a way to tell apart fire tick damage from fire and fire aspect?
No I mean
Fire and lava also sets you on firr
Tell apart the fire tick damage from that and FA apart
fire aspect and all other things that set you on fire all increase the same fire tick value
they're not tracked separately
you can do that by using the point, where it set's him on fire. so smt like
int cause = 0;
if(set on fire by lava/fire){
cause = 0;
} else if(set on fire by fire-aspect){
cause = 1;
}
//and so on
and later just check for that
if i am not too tired
the player can be on fire from multiple causes at the same time
they could be punched with fire aspect and be standing one foot in fire and another in lava
you could update it then
yes but standing in the fire would only add a few ticks
lava adds significantly more
if you only update based on the last damage cause, you could sit in lava and accumulate 5 minutes worth of fire ticks
and then walk through fire for a split second, and your plugin would consider all of the fire_tick to come from the fire, rather than the lava, where it actually came from
you'd have to record a linked list of 'timestamps' and then expire those away as they wear off
true. i'm too tired lol
Thanks for the answer.
Is there an actually good client for discord on linux?
It's been freezing completely every time I open it and wait for an undetermined amount of time
Ever since I upgraded to 21.04
just use your simplified design electron shitshow, goy
What
you don't need well designed or well performing software
What do
i added linux support lmao
does anybody know how to fix this? https://paste.md-5.net/wojiliyura.js
1.8 version it works on 1.9+
Which line is 62
...
xD
he marked it e = getNMSClass("PacketPlayOutTitle").getDeclaredClasses()[0].getField("TIMES").get((Object) null); // 62 code
How can I copy a banner's pattern onto another banner without messing up extra NBT on the other item?
okaay
Is there any packet wrappers for 1.16
PacketWrapper is compatible with 1.16
Olivo idk why but the getNMSClass gives me error https://paste.md-5.net/idijosuwen.md
it clearly says why
i clearly dont know why it tells me array problem
because the array index is out of bounds
which array
the only array involved
the version?
getNMSClass("PacketPlayOutTitle").getDeclaredClasses()[0].getField("TIMES").get((Object) null)
yes
it does with getNMSClass("PacketPlayOutTitle")
i don't know because I don't have line numbers
there is an array access on line 80
and it is out of bounds
this is 80 instance.log(""+getNMSClass("PacketPlayOutTitle"));
the code you're looking at and the code that is being executed aren't the same then
getNMSClass is not present in the stack trace
which means that the execution has either not reached that method call, or has already passed it
I think there are a bug with the signs i cant get the lines or edit the lines when i get the sign with a location.
Code:
if (loc.getBlock().getState() instanceof Sign) {
Sign sign = (Sign) loc.getBlock().getState();
Bukkit.broadcastMessage(sign.getBlockData().getAsString());
Bukkit.broadcastMessage(Arrays.toString(sign.getLines()));
Bukkit.broadcastMessage(sign.getLine(0));
}```
Output:```
[15:18:31] [Server thread/INFO]: minecraft:oak_sign[rotation=8,waterlogged=false]
[15:18:31] [Server thread/INFO]: [, , , ]
[15:18:31] [Server thread/INFO]: ```
Ant yes there are text on the sign
okay
When are you calling that
after a SignChangeEvent
That's why
the data has not changed at the time of that event being fired
^^
it is cancellable, which most of the time means that the event is fired before the thing happens
Use the event to get the sign lines
in this case, the "thing" is the sign changing
should do like runTaskLater
^^
i am calling a method to update signs
then use the setter methods on the event if they are present
can somebody help me create a title using nms i dont know whats with it
imagine if there was api for it
imagine if the all apis didnt work bcz of the array error :)
the array error is coming from your code
ohh omg thank you that really fixed my error even tho i literally copied this src code https://github.com/ConnorLinfoot/TitleAPI/blob/master/src/main/java/com/connorlinfoot/titleapi/TitleAPI.java
and then we go back to the answer I gave you the first time around
subtitleConstructor = getNMSClass("PacketPlayOutTitle").getConstructor(new Class[]{getNMSClass("PacketPlayOutTitle").getDeclaredClasses()[0], getNMSClass("IChatBaseComponent")});
array index out of bounds would indicate that there are no declared classes
again, imagine if there was some sort of api for this thing developed by a community
rather than a myriad of scattered and broken and dead libraries
imagine if in five fucking years the 1.8 community would have managed to, i don't know, fork the API and backported and added the missing things to it
then link here the best api for it ever
imagine developing software for an ecosystem that isn't dead
point is that your life choices revolving around 1.8 were bad ones and 1.8 sucks
and the "community" around 1.8 sucks too and never gets anything done
okay well then tell me how to fix it? Class<?> chatSerializer = getNMSClass("IChatBaseComponent").getDeclaredClasses()[0];
and the thing that will help me?
i said the thing that will help me
that is the thing that will help you
for fixing the error rly
if you use a modern version, you can delete all of that shit tier code
and the error disappears
oh thanks that actually fixed my error ๐
you're welcome
What Material type is END CRYSTLA? im running 1.8.8 (1.8.9) AND DONT TELL ME IT DOESNT EXIST since this is what the website says:
Can I change blocks drops?
@warm galleon help your fellow 1.8 plebian
?????
?paste
can someone take a look at this?
https://paste.md-5.net/muzapapalu.cs
you need to pass it an additional parameter
probably the cause of the death, not sure
which parameter?
the one it needs
there are two overloads of the getStatistic method
one takes a Material
the other takes an EntityType
i just want to look how many ... a player has done
for example how many blocks he broke
i don't think that is tracked
only on a per-material basis
also, follow the proper naming conventions
and btw the lock command you made better still gives me an error while trying to put a lock on a normal block for example dirt
what is the exception and what is the code i wrote
org.bukkit.event.EventException: null
that is not the exception
wanna see the whole error?
EventException means that some exception was thrown in an event handler
null is the exception message, which doesn't exist
the actual exception is down below in a Caused by: block
EventException itself tells literally nothing
ClassCastException: org.bukkit.craftbukkit.v1_16_R3.block.CraftBlockState cannot be cast to org.bukkit.block.TileState
this is the actual cause
now the code
give me the code
just scroll
you should link code separately as doing this fucks the line numbers
._.
at io.github.FourteenBrush.MagmaBuildNetwork.PlayerListener.onContainerClick(PlayerListener.java:65) ~[?:?]
means something happened on line 65
the first line of your code according to this paste is 70
if you insist on including them both in the same paste, place the code first and the stack trace later
65 is this: if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
well that can't possibly throw this exception
end crystals are entities lol
yea
the material for end crystals was added only way later
so the answer you're looking for is "it doesn't exist"
you have changed something since you got this stack trace
kek get rekt
i think it would be fixed when i fix this
Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_16_R3.block.CraftBlockState cannot be cast to org.bukkit.block.TileState
yeah, but I want you to learn how to read an exception
so we're doing it the hard way around
damn so my duels plugin cant have crystal pvp? damnnnnnnnnnnnnnnnnnnn
lmao
update to 1.16.5
or id have to mak them right click something and spawn in a end crystal
ow wauw
easy solution
hack naw
1.8 sucks
replace if (!(blockState instanceof TileState) || (blockState instanceof Lockable)) return;
with if (!(blockState instanceof TileState && blockState instanceof Lockable)) return;
seems more logically
i havent tested it yesterday so i assumed it worked
until i saw the error
hey guys
i used vault api
but when i load it into mc
it says no vault found
even tho plugin is on server
[18:38:18] [Server thread/WARN]: [Bot] Loaded class net.milkbowl.vault.economy.Economy from Vault v1.7.3-b131 which is not a depend, softdepend or loadbefore of this plugin.
[18:38:18] [Server thread/ERROR]: [Bot] - Disabled due to no Vault dependency found!
[18:38:18] [Server thread/INFO]: [Bot] Disabling Bot v1.0
[18:38:18] [Server thread/INFO]: [Bot] Disabled Version 1.0```
add it as a depend
your plugin probably enabled before vault, so the economy wasn't initialized properly yet
how can I fix this
read
add it as a depend
how?
depends
compare the descriptions of depend and softdepend
Can I change blocks drops?
with a datapack yes
imma change it to depend
Plugin?
listen to block break event or whatever and drop shit
no good way of going about it without a datapack really
ik
well, maybe with nms but i wouldn't necessarily qualify that as good
I'm asking if there is a way to do it using plugins
I already saw that I was just replying to Origi#2953
@wraith rapidsI figured out it gives me errors when right clicks a block that cannot be locked (even if i didnt execute /lock set)
better yet use BlockDropItemEvent ๐
I'm using vault for checking permissions, and if I update a player's permissions while they are offline, it doesn't "register" until they log back in. Is this what's supposed to happen?
Offline players have no permission attachment so can't have any permission sunless online
yeah but I thought if you used vault it would allow checking permissions of offlineplayers?
You can via Vault, but it would also depend on your permission plugin.
Then your perms plugin doesn't support offline players, or you are doing something wrong
do you happen to know if pex doesn't support offline players?
reject pex return to luckperms
pex is a fucknuggery of reflection hell I'm surprised it supports anything still.
or GroupManager ๐
it works if the player is offline, but if I was to update the player's permissions while they were offline then check it with my plugin, it doesn't work until they log back in
so yeah looks like im switching to luckperms, thanks lmao
I want to set a large area (like 100x100x100) to air, but I imagine if I do that all in a single tick it'll be terrible for performance. What would you guys recommend doing to minimize performance lag?
async that mf
oh no
a queue and do x number of blocks per tick
^^ this
no
no need for async
I have a question about command arguments. How to specify what type what arguments need to be?
For example if I want a command /spawnmob <mob> [amount] - how do I say that the first argument needs to be a mob? (so that chat can autocomplete and show potential options). Or /god [player or @something] - how do I get the @something part automatically as a list of entities or players?
you only async if you REALLY know what you are doing
Guess I won't use async then LMFAO
declaration: package: org.bukkit.entity, enum: EntityType
I'm such a noob
check if args[0] is a entitytype by trying to parse it
if it null or whatever
then it isnt a mob
You can't specify the argument,ent directly unless you hook into brigadier
But you can validate them in the onCommand method
and for amount try to parse int in a try catch
You could fill in onTabComplete all mobs for the appropriate arg
I understand the classes, but I don't know the syntax in the onCommand() function.
What syntax
IntelliJ
I specifically need to know about @something. How to check that? (@a, @s, @e ...)
i think it's like
if EntityType.valueOf(args[0].toUpperCase()) == null
or whatever
What mc version?
xd
Check if the argument starts with @
1.16.5
And then I have to manually check if it is @e or @a or @s ...?
Ah, those arguments
Thank you so much!!!
No problem ๐
Will this show in the chat as autocomplete too? (I don't specifically need this, but I am just curious)
Ok, thank you.
YES YES YES YES YES
so I have these tmings,.
well.....
whats the difference between async and sync
This video covers a high level overview of what multithreading is and why we need it when developing software
Multithreading Playlist: https://www.youtube.com/playlist?list=PLrSqqHFS8XPaV5ZyNXL0IYwbTnh_wZCYU
anyone explain that? lmfao
getChunk loads the chunk
World.isChunkLoaded
.
int x = loc.getBlockX() >> 4;
int y = loc.getBlockY() >> 4
Some bit shifting can convert your location to chunk cords
I was thinking on deviding by 16
how would I do that lmfao
I literally just send the code for it
Dividing causes issues with negative coords iirc
Yeah that too I guess
I have a hashmap with integers (price) and itemstacks you can buy for that price. When I left click an item in a gui I want the previous item in the list to show & right click would be the next item in the list. What'd be the best approach for this
The integer is actually the key :smug
I only just started so any chance is fine
OH, ur right.
Hadn't even considered that at all.
Anyway, that's switched now
That doesn't answer my question tho
Well it depends on what you want the next entry to be
Any item or next sorted by price
left click = previous item in list, right click = next in list
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
if clicktype is left click
switch
That's not what he's asking
if right click
Yeah no shit
._.
Is this going somewhere
store the item a player is on ig and then check for it when they do clicks
and when click just replace item in inventory ๐คท๐พโโ๏ธ
You're not helping
he's asking what the best approach is that's what i'd do i mean
Yeah hold on let me get my IDE
is there something like Player#setInventory(PlayerInventory)?
There is setContents and getContents
yeah i am getting this error Caused by: java.lang.IllegalArgumentException: Invalid inventory size; expected 36 or less
could u show us what ur doing
so something like this...
ya?
You are getting the contents of a larger inventory and trying to set it to a smaller one
VariablesHandler.getPlayerInventories().put(player.getName(), player.getInventory());
Yes ๐
what the hell... variables handler
Alright, thank you very much
you shouldnt use global variables
private static HashMap<String, PlayerInventory> playerInventories = new HashMap<>();
dont abuse static
wdym
My old self says no.
@vestal dome how did you do the about me?
just a question where is it? xd