#help-development
1 messages ยท Page 422 of 1
on my 1.19.4 jar, obsfucated it exsists
don't you need a custom TypeAdapter for your class?
Well, points for honesty
i might actually
then I suggest you learn. it's a type of class your decompiler doesn;t know about
didn't think of that
talking to them is a waste of time, we already explained 7 times what the issue is, they just keep saying "my decompiler is not the issue"
You mean like this
we told you 8 times already, the issue is that your decompiler doesn't understand records
even md_5 told you that in your bug report
this feels like an extended troll
yeah Imma block them now
LMAO
anyways
alex, do you know how to create a typeadapter? if not, that's fine, i'll look up a tutorial
you mean like this
Your de-compiler does not understand what a Record https://docs.oracle.com/en/java/javase/15/language/records.html class is
Because it can't understand it it can't de-compile it
iirc extend TypeAdapter<Class>
yep, but I do need to override methods and i'm not sure what to put in their body
it's basically just a class that takes in a JsonReader and outputs your custom object, and vice versa
it's like spigot's ConfigurationSerializable interface
thanks
Gson's builtin "generic" serialization thing only works for public fields or stuff that has obvious getters/setters, iirc. might be wrong though
this'll be a long ass type adapter ๐
The projectile is not doing an explosion how do i fix it?
https://paste.md-5.net/qijeqomuhi.java
Because a player is not a projectile
You need to get the projectile and then get its shooter with getShooter
Then check if that is a player
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
public class MyMacro {
private static Minecraft mc = Minecraft.getMinecraft();
private static KeyBinding gKey = mc.gameSettings.keyBindJump;
private static KeyBinding aKey = mc.gameSettings.keyBindLeft;
private static KeyBinding wKey = mc.gameSettings.keyBindForward;
private static KeyBinding dKey = mc.gameSettings.keyBindRight;
public static void execute() {
gKey.setPressed(true); // press the 'g' key to enable
wait(1000); // wait for 1 second
gKey.setPressed(false); // release the 'g' key
// repeat the following three actions
for(int i = 0; i < 3; i++) {
aKey.setPressed(true); // press the 'a' key
wait(18000); // hold for 18 seconds
aKey.setPressed(false); // release the 'a' key
wKey.setPressed(true); // press the 'w' key
wait(5000); // hold for 5 seconds
wKey.setPressed(false); // release the 'w' key
dKey.setPressed(true); // press the 'd' key
wait(18000); // hold for 18 seconds
dKey.setPressed(false); // release the 'd' key
}
}, startTime, repeatTime);
private static void wait(int ms) {
try {
Thread.sleep(ms);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
im trying to make a macro for skyblock ( garden )
18 sec a key, w for 5 sec, d for 18 sec, w for 5 sec again, repeat this loop also hold down the mouse button to break
but i can't make it into a .jar ๐ can any1 help wtf i do now ive the codes already
you sure thats spigot?
Itโs not
in what context?
in the screenshot above there is a text public record
Introduced as a preview feature in Java SE 14, record classes help to model plain data aggregates with less ceremony than normal classes. Java SE 15 extends the preview feature with additional capabilities such as local record classes.
Itโs just a class to hold data
everyone seems to be finding java 15 docs
15 is when it was added
Seems like a you issue
whats craft server in newer versions
CraftServer
craft server as it's bukkit
run a clean/mvn clean on your project
just did, now waiting for paper user dev to do its thing
noobs using paper ๐
non noobs use gradle
if you don;t like living in a cave like me
gradle goes brr
josh shut, you use gradle too
who is josh
coll
i use gradle too and it goes brr
and thats everything
I donโt really find maven much slower
i also dont have to type 9 million tags to add 1 plugin
But xml hurts to look at
mvn package takes 10 seconds normall
kotlin syntax hurts even more
gradlew build takes 2
JSON is faster than YAML
since you should do IO stuff async anyway, it doesn't matter whether parsing takes 0.002 seconds or 0.004 seconds. I'd use YAML if it should be editable/readable for admins, otherwise it doesn't matter what you use
Preferably a db impl if it's not going to be read by people
using gson to load 1100 files went brr
just did it manually
i have been scammed, i thought mc had 1000 items but there are only 700
My take:
Persitence: Json
Configuration: Yaml
my take: everything: json, dumb-proof: yml
i use toml for all my configs
bully this man out
i always use a database apart for config files
recently switched to mongodb but the syntax bothers me
Just abstract it
in what way
Some database interface with methods to get/set values, different implementations for different database architectures
Yeah so exactly what you have now, but make that an interface and extract all the methods
Change that class to DatabaseMongo or something
i only have one storage type so i thought to not make an interface for that
Generally a good idea to give server owners an option, especially for public plugins
I recently did it for VeinMiner, though I still don't support Mongo
future proof
I could, in theory, support it though lol
๐ perfect
hello the java server is just so inactive i cant find anything so if anyone can help me with an offtopic question id really appreciate it:
I'm trying to make an online multiplayer turn-based game (inspired by chess.com), and it currently works as a standalone program, except i can't figure out why external clients cannot connect to my local socketserver. The structure is a relatively simple one (accept socket, create thread, do stuff).
I'm using a ServerSocket instance on my pc on a random port (55285 atm), and the client connects with my ipv6 and the port. It allows me to connect but no one else externally. Then i search stackoverflow and find something to do with pinging the address first, and figure out i can't even ping my own ipv6 (unknown host), so im a bit stuck.
Another idea i had in mind was to use some sort of database instead of a server
now that i look at it, it goes brr
show code
didn't forward the port at your router
wait ur hosting it on ur own pc?
yeah which may be an issue
deciding whether to move it to an ubuntu machine
its just for me and my friends
and no need to flush after calling println afaik
packet based programming ๐
is that a good thing?>
Just quick suggestion, why dont you use smth more convinient, websocket for example
could you explain
Why not using restapi instead?
the program is a standalone java swing app
Websocket instead of plain socket
i've got no clue what all this stuff is
how would i implement that
nothing is on the web
He is playing game, rest wouldnt be good for it
Oh
Search for java websocket, there must be something
just imagine it's a chess game, it's relatively similar
so it's not too complicated, but has to be realtime
Websocket is the way
I have it implemented in some app, if you want I can send you
sure that would help give me an idea on implementation
It's just for sending server stats in real time
it looks quite clean
It's using javalin library ^^
yeah i dont know
it's just my friends just get connection refused: connect as the error
Plain java socket is oldschool
yeah oldschool but idk how exactly to implement websocket
@ServerEndpoint(value="/chat/{username}")
that's the annotation on baeldung
Yeah, it depends on library
but i think it's implying through the explanation that i understand a lot more about sockets
i have a feeling i have the wrong end of it
We also specify the URI where the endpoint is deployed. The URI is defined relatively to the root of the server container and must begin with a forward slash:
Why don't you use SocketIO java?
https://stackoverflow.com/questions/15568700/best-java-server-implementation-for-socket-io
no clue
I use this (server on nodejs, client on java) to forward messages between servers. It's quite good and websockets are faster and secure than tcp sockets, (avoid using UDP unless speed is what you want)
is there a way to do it with just sockets?
socket.io is a websocket library
instead of redoing it in another thing
Yes, you could use SSLSockets
because currently i am able to connect, just my friends arent
thats like the only problem
Maybe you don't have ports open, pretty sure it's a firewall problem
oh
Also note, usually on sockets, you must specify an option or otherwise the socket will pretty sure close the in/out after a message has been sent
I don't remember which option was it, but was available on SSLSocket or smth like that (I haven't touch java sockets a long time ago)
?paste
what does that verified thing mean
Args
who's bernardbertels
it sorta feels like they're post farming but idk
just on the verge of publishing premium plugins, they are
and they've been on spigotmc since 2018 lol
like i don't wanna berate them but they're acting weird
It means a push has been made from a person using a certificate which is in his github account
hmm
how do iget one of those
and whats the point of that?
You can configure your repositories to only accept signed pulls
So anyone except the person with the certificate can push
Install git for windows, it comes with a bundled gpg
Or use the Ubuntu WSL
That's because you don't have any
You must generate one, read the point 2
why do you censor your public key?
I don't want it to be seen
why? you sign every commit with it anyway
Well, I actually tough it was not the public key
could be me
Signing is nice. if it is only for that badge
I sure as hell wouldn't have set it up if it was for nothing
I actually did it because you can configure your projects to reject any push from "untrusted" certificates
I didn't even know it gives you the badge of "verified" on each push ๐
Sure, there is the security aspect but I don't think anyone is taking security seriously
I do ๐ณ
Hi, after some long sleeping and going early to bed. I get up with all my energy and i fixed mostly 90% of the redis library. Just having an NPE issue which i cant find the specific reason, because the property im triyng to get from the json, is there
A lot, I made a runtime security checker for one of my plugins
Can you share the NPE?
Yes ofc, 1m
here you go: (void*) 0
What's that?
nullpointer
Do you mean that thing that is scheduled for removal?
What thing?
That's not a nullpointer, that's a synctax error
SecurityManager
SecurityManager
java.something.SecuritySomething
Nono, I made a different thing
guys
Gals
i did some painful router stuff, anyone available to test my applciation
It checks the runtime to allow access some parts of the API of one of my plugins, as my plugin use a modular API (instead of allowing any plugin to access it)
It manages player accounts and some stuff, and I want to log everything is done in the API and who does it
attack helicopters
since my friends are all dead
my program didnt want to compile cuz i used the secutiry manager ๐
Debugg messages:
[Jedis-Listener] Received from channel=plugin-sync sender=proxy-1 receiver= packet={"packet":"{\"user\":\"michael\",\"text\":\"Hi everyone\",\"uniqueId\":2}","sender":"proxy-1","receiver":""}
Exception is:
Exception in thread "pool-1-thread-1" java.lang.NullPointerException
at dev.alex.net.redis.core.listener.RedisListener.onMessage(RedisListener.java:41)
at redis.clients.jedis.JedisPubSub.process(JedisPubSub.java:156)
at redis.clients.jedis.JedisPubSub.proceed(JedisPubSub.java:125)
at redis.clients.jedis.Jedis.subscribe(Jedis.java:7908)
at dev.alex.net.redis.core.services.BrokerService.lambda$new$0(BrokerService.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
British people
have to specify the model
apache
Probably no match for my Hackloader
apache a-something
AYYY CRUMPETS AND TEA โ ๐บ
(aka UnsafeValues)
No one can beat unsafe
I invite you test it out. If you manage to bypass it, will in fact help me to enforce it
It's very simple so I guess it's also easy to bypass
What's on line 41 of RedisLitener?
it makes me feel like such a cool and experienced programmer naming my methods "adapter" "parser" "validate"
when in reality it just like
Lol
splits a string
access violation can
What makes you a cool and experience programmer is searching a compiling error all the day to finally realise you just missed a ";"
wonder what exception will be thrown if i squish the cpu with a hydraulic press
no ide ?
get the hell out of here error
Code of causing the issue:
@Override
public void onMessage(String channel, String data) {
// Ignoring wrong channel
if (!broker.getChannel().equals(channel)) return;
// Parsing the payload
Payload payload = broker.getRedis().getInfo().getGson().fromJson(data, Payload.class);
if (payload == null) throw new RedisException("[Redis] An invalid payload was received");
JsonObject packet = broker.getRedis().getInfo().getGson().fromJson(data, JsonElement.class).getAsJsonObject();
System.out.println("[Jedis-Listener] Received from" + " channel=" + channel +
" sender=" + payload.getSender() + " receiver=" + payload.getReceiver() + " packet=" + packet);
// Ignoring self data
if (payload.getSender().equals(broker.getServer())) return;
// Ignoring wrong server
if (!payload.getReceiver().isEmpty() && !payload.getReceiver().equals(broker.getServer())) return;
// Parsing the packet
Class<? extends Packet> type = broker.getPackets().getRegistered(packet.get("uniqueId").getAsInt()); // Line 41
if (type == null) return;
// Dispatching the packet
broker.getEvents().dispatch(broker.getRedis().getInfo().getGson().fromJson(packet, type));
}
I code on notepad ๐
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/UnsafeValues.html#processClass(org.bukkit.plugin.PluginDescriptionFile,java.lang.String,byte[]) I mean as soon as one can overwrite the UnsafeValues implementation it's game over thanks to that.
That ignores the fact that javaagents are a thing, which are a even larger attack vector here
variables my man
i made a whole library for myself. I used around 10% of the methods
karma i sent the code of the RedisListener, i didnt do it before. Cuz discord has text limitations
From those lines, which is the 41?
just write in base65536
making a nice packet sending system with redis are we?
did that too once. whole bunch of fun
Yes im doing that tho
i once did it for multiserver stuff
like rank sync
made a whole core for a server that i never even played on ๐
Yes im doing this library, so then i can use it on many plugins i will code on a future
But so far need to find the explanation about the NPE
i did it with lettuce, like it way better
Because the uniqueId element from the packet json is not null
It was first thing i checked from the debug
Karma algo i really aprreciate your help, you have been helping since yesterday
What happens when you print packet#get(uniqueId) before reading it?
I will try it
Okay is giving NPE while parsing the element
Maybe the packet is not being parsed correctly
What happens if you print directly the packet element?
Oh, you are already doing it
maybe the uuid is now invalid. when i did this i had the issue that redis did some weird stuff internally and my packets would end up different
He's not using UUID, he's using ID
lol how the fuck is null, the uniqueId if the payload received contains it?
If you see the packet json object, from the Payload contains the uniqueId property
I think your packet is receiving some kind of "formatting"
Try fetching it like this:
packet.get("\"uniqueId\"")
oh dont tell me its issue caused to primitives types
I don't know
Cuz i used to have something like this before but while getting another json object, from a json object
why is the data escaped like that
I printed json from gson lot of times, and never seen it printing things such as \"key\": value
to be truth, no idea its the Json writter i think
I faced a similar problem, on javascript ๐
ok
The issue was I was storing a json object as string in another json, then stringifying, which was causing the object to be "stringified" twice
Or something like that
oh ok
But that's not the case, you are not setting json data in a json
You are sending a json
Wait ill publisher code
@Override
public CompletableFuture<Void> publish(Packet packet) {
return CompletableFuture.runAsync(() -> {
Payload payload = new Payload(packet, redis.getInfo().getServer(), redis.getInfo().getGson());
payload.setReceiver("");
try (Jedis jedis = redis.getClient().getResource()) {
jedis.publish(this.channel, redis.getInfo().getGson().toJson(payload));
}
}, redis.getInfo().getExecutor())
.thenAcceptAsync((result) ->
redis.getInfo().getLogger().info("[RedisBroker] Sent to channel=" + this.channel + " packet=" + packet.getUniqueId()))
.exceptionally(error -> {
throw new RedisException("[Redis] Packet " + packet.getClass().getSimpleName() + " couldn't be sent", error);
}
);
}```
did you find out what the json is upon sending?
You mean before being sending, right?
right, just before you send it
Just to see smth, i will replace Gson#toJson() to Gson#toJsonTree() on the publisher code
I cant find the problem tho
The json sent and received, are exactly the same
๐
weirdly escaped?
the instance?
y
Objects.nonNullOrElseGet
try new GsonBuilder().disableHTMLEscaping().create()
psuedo code
not sure if thats exactly correct but along those lines
Objects.isNull lol
ok
GUYS IT WORKS
i should ask you
sadly i have no friends to test the next part with
My issue is something related to how json is being converted to string and then parsed back from String
try what i sent instead of new Gson()
Yes im doing that
Same problem tho
hmm weird
Yeah that why
Doesnt make sense, cuz the data being sent and recieved are the same
Also, if its a data parsing issue, must be giving issues while parsing the Payload object and not on that line
okay how are you parsing rn
can u try this?
final JsonParser parser = new JsonParser()
JsonElement json = parser.parse(jsonData);
i add it to the packet parsing
what do you mean with that?
is that "packet" not already a parsed JsonObject?
Reason:
anyone got any ideas on why my socket server throws an exception "Connection reset" when my friends close the program, but my own check (if reader.read() == -1) only works when I disconnect locally
ok well try this instead of the stuff here
Netty wouldnt cause those issues, java plain sockets works for the ass
fairly sure that's the local open socket
saw that somewhere
it will always return true
No, same issue, same shity NPE
Not after the other part disconnects
apparently it will still
Any idea what can be the pboelm?
How are you building the json?
according to some dude on stackoverflow that will always return true unless the server socket isnt working
I also tried using Gson#toJson() instead of GsoN#toJsonTree() but same weird issue
Instead of parsing the JsonElement toString, what happens if you parse it through a Gson#toJson?
How can you null check this?
The same issue
Does redis#getInfo#getGson return a Gson object you've build?
If you dont pass any gson instance via the RedisBuilder, it will just create a Gson instance
Try creating a new gson instance, instead of using the redis one
ok
And print the data before using the Jedis#publish method
What?
also i forget to share the payload class ๐คฆโโ๏ธ
I also try, using gson.toJson() , but the same problem
JsonObject obj = packet.get("packet").getAsJsonObject();
int id = obj.get("uniqueId").getAsInt();```
i mean this
how do i set the texture property of a skull?
h i will try that
That's it
You are right
The json string is "packet": {...
which is why i did not use json for mine :>
this is previous code i was using
that looks right
that code was working perfect
I will move to that old code tho
And see what happens
Thanks tho
If have any other issue i will back, thanks a lot for both of you man
Now appeared conclure
nvm
oh haha
my discord lagged
hi conclure
hai
decent :>
oh nice, did smth happened to U?
this discord really miss you, you are to be really good man here*
@Override
public List<Block> getRoadBetweenPlots(Plot firstPlot, Plot secondPlot) {
List<Block> blocksBetweenPlots = new ArrayList<>();
return blocksBetweenPlots;
}
@Override
public List<Block> getAllRoadBlocks() {
return this.allRoadBlocks;
}
Would anyone have an idea how I implement the getRoadBetweenPlots to get from the getAllRoadBlocks() method all the blocks that are between the two plots?
lol, we have other talented people who help others here
Why over complicating instead of WorldEdit?
Also if you r making a plot plugin, you can make average of both of them WorldEdit and WorldGuard
So then you can allow people easly to enable plot mobs killins, commands, etc by the use of the world guard flags
Well, I already have an almost finished plot system. I just need an implementation of this method and I can't think of anything
oh ok, i thought u were just starting it, to code it
Yeah no problem. So you have an idea?
I think you can make usage of distanceSquared() from Location, but sure if the correct way
Also take in care that Blocks are not weak reference, im not sure how to explain that
ehh okay? Thanks
maybe explain exactly which part of the road you want to get maybe with a picture
I want to get the part between the plots
meaning this?
Maybe getting the center of both plots, and add x/z to both of them (plot size).
Get the space betwen those locations and then get the blocks in that space
Yes. With the border
and not these parts?
๐ฅณ
Yes
ok what ur plot code looking like? im guessing you have some kind of Plot Object
int x = (int) Math.floor((double) location.getBlockX() / (this.getPlotSize() + this.getRoadSize()));
int z = (int) Math.floor((double) location.getBlockZ() / (this.getPlotSize() + this.getRoadSize()));
hmm one way you could probably do it is to find the middle of the 2 locations
the 2 locations being plot 1's mdidle and plot 2's middle
that should effectively return you the middle of the road between those 2 blocks
Plot#getMiddle
then simply construct a rectangle of the appropiate size using that block
middle of the 2 plots
okay thanks
hope that makes sense ?
then u can just expand that middle block to the appropiate size to get the entire road
How Can I Stop People From Book Banning On My Server
And If Someone has been banned how do i undo it
overloading a book with stuff so its too big for the server and means a player cant login without minecraft kicking them
wasnt that fixed?
i guess not ;d
well they could limit the amount of data a book can hold. im not there's already plugins out there that provide this functionality
or they could make it themself.
people got nothing better to do
I don't understand this part. I coded the getter for the middle block. But what now
next part would be a little tricky
u would need to get all the blocks around that location like this
but in order to do that you first need to figure out in what direction to expand
well, these are squares right
the part hes trying to get is a rectangle
ah
Ray casting?
OH well thats what I know it as when i have used it in game development.
basically you use the player as the center point and shoot beams out and that gives you a general consesus of what is currently around you.
Fair enough.
every 20 blocks there's a gap area of 5 blocks where it's road, type deal
you just gotta find patterns
or just asking chatgpt
ask it to make the getRoadBetweenPlots method :<> @echo basalt
there
public String getType(int x, int z, Dimensions plotDimensions, Dimensions roadDimensions) {
// Calculate the size of each plot including roads and edges
int plotSizeX = plotDimensions.width + roadDimensions.width;
int plotSizeZ = plotDimensions.height + roadDimensions.height;
// Calculate the position of the given coordinates relative to the plot area
int relX = Math.floorMod(x, plotSizeX);
int relZ = Math.floorMod(z, plotSizeZ);
// Check if the given coordinates are within a plot
if (relX >= 0 && relX < plotDimensions.width && relZ >= 0 && relZ < plotDimensions.height) {
return "plot";
}
// Check if the given coordinates are on an edge
if (relX == plotDimensions.width || relZ == plotDimensions.height) {
return "edge";
}
// Otherwise, the given coordinates must be on a road
return "road";
}
Help? Even if the Boat location is equal to one of the two endLine corners, it doesn't return true. I'm using 1.19.4
private boolean isInFinishLine(Location location, Map.Entry<Location, Location> endLine) {
System.out.println(Commons.getStringLocation(location) + " COMPARED TO " + Commons.getStringLocation(endLine.getKey()) + " AND " + Commons.getStringLocation(endLine.getValue()));
Location corner1 = endLine.getKey();
Location corner2 = endLine.getValue();
// Create a BoundingBox object with the two corners
BoundingBox boundingBox = BoundingBox.of(corner1, corner2);
// Check if the location is inside the bounding box
return boundingBox.contains(location.toVector());
}```
Not รฑ?
pretty sure that BoundingBox just checks if it's entirely inside
well
shouldn't matter much but still
This was my old method, it doesn't work as well
private boolean isInFinishLine(Location location, Map.Entry<Location, Location> endLine) {
Location corner1 = endLine.getKey();
Location corner2 = endLine.getValue();
double minX = Math.min(corner1.getX(), corner2.getX());
double maxX = Math.max(corner1.getX(), corner2.getX());
double minY = Math.min(corner1.getY(), corner2.getY());
double maxY = Math.max(corner1.getY(), corner2.getY());
double minZ = Math.min(corner1.getZ(), corner2.getZ());
double maxZ = Math.max(corner1.getZ(), corner2.getZ());
return location.getX() >= minX && location.getX() <= maxX
&& location.getY() >= minY && location.getY() <= maxY
&& location.getZ() >= minZ && location.getZ() <= maxZ;
}
maybe Y level checks?
like just print out the values and see what's going wrong honestly
There's nothing wrong:
world:122:74:-520 COMPARED TO world:122:74:-520 AND world:122:80:-518
Check the player inventory for books in the PlayerLoginEvent and just remove the book if it's malicious. For stopping the creation of these books, you can also just check the book in the PlayerEditBookEvent. I guess that's all you can do. You could also remove all malicious books at once in a little maintenance period where you just iterate and process all player data files, that's up to you tho.
public String getStringLocation(final Location l) {
if (l == null) {
return "";
}
return l.getWorld().getName() + ":" + l.getBlockX() + ":" + l.getBlockY() + ":" + l.getBlockZ();
}
private boolean isInFinishLine(Location location, Map.Entry<Location, Location> endLine) {
System.out.println(Commons.getStringLocation(location) + " COMPARED TO " + Commons.getStringLocation(endLine.getKey()) + " AND " + Commons.getStringLocation(endLine.getValue()));
Fun fact I actually wrote a parser that grabbed all the books in the world's NBT and converted their contents to .txt
print the absolute XYZ, not the floored block version
smth like this?
System.out.println("Location: " + location.getX() + ", " + location.getY() + ", " + location.getZ());
System.out.println("EndLine Start: " + endLine.getKey().getX() + ", " + endLine.getKey().getY() + ", " + endLine.getKey().getZ());
System.out.println("EndLine End: " + endLine.getValue().getX() + ", " + endLine.getValue().getY() + ", " + endLine.getValue().getZ());
haha
[17:57:50 INFO]: [BoatRaces] [STDOUT] Location: 122.57116997185557, 74.0, -517.8404439255617
[17:57:50 INFO]: [BoatRaces] [STDOUT] EndLine Start: 122.0, 74.0, -520.0
[17:57:50 INFO]: [BoatRaces] [STDOUT] EndLine End: 122.0, 80.0, -518.0
well
I could cast int and the problem should disappear
well
well
your Z axis is off
like
instead of just checking if the boat's location is within bounds
check if any part of the hitbox is
how is it possible?
no clue how spigot's AABB system works, I use my own https://sourceb.in/axi8YEVD5f
boat.getBoundingBox().contains
type deal
you might need to rotate the hitbox by whatever
smth like this?
Location corner1 = endLine.getKey();
Location corner2 = endLine.getValue();
// Create a BoundingBox object with the two corners
BoundingBox boundingBox = BoundingBox.of(corner1, corner2);
atomicreturn boat.getBoundingBox().contains(boundingBox);```
Well, it's not working
how to make an npc (Citizens api) look at wherever you are standing, but it appears client side only, so its different for each player
try the opposite
boundingbox.contains(boat.getBoundingBox
pretty sure you can just add a trait for that
wdym?
npc.getOrAddTrait(LookClose.class)
just that?
guess
still not?
you won a million dollars
lovely
try using my Cuboid#contains(Cuboid other) method instead
it does partial inclusion
instead of full inclusion
So, you're suggesting me to copy-paste a whole class just for a method!?
Sure, no problem ๐
how does it work?
private boolean isInFinishLine(Boat boat, Map.Entry<Location, Location> endLine) {
Cuboid cuboid = new Cuboid(endLine.getKey(), endLine.getValue());
return cuboid.contains(boat.getLocation());
}
it literally just checks if any of the axis intersect
did you mean something like that?
yeah that works
actually
BoundingBox boatBox = boat.getBoundingBox()
Cuboid boatCuboid = new Cuboid(boatBox.getMin(), boatBox.getMax());
return cuboid.contains(boatCuboid)
literally the same as the location constructor
YOU'RE AMAZINGGGGG
thank you
so
so
much
:)
Any way to create dynamic resource packs? Basically I'm writing a small lib and would like to change the server resource pack based on if another plugin called a function in mine
could just include all those textures in the resource pack and bind it to custommodel data
if its about items tho
not sure about other stuff
dynamic RP would only be possible if your MC server/plugin has access to your hosted website to upload files.
hm
I'll see if something's possible, but I'm not sure how this would work if I'd like to share the plugin
Bump, please reply to me or ping me if you have an answer
you forgot the constructor parameter
private Dialogue plugin;
- public DialogueCommand() {
+ public DialogueCommand(final Dialogue plugin) {
this.plugin = plugin; //here
}
replied to you earlier
damn ๐ญ
How could I depend on multiple nms versions when using moj maps?
maybe I'll join you on the ignored list epic 
modules
^
maven or gradle
nah I know how
ah
you know what
I'll deal with nms later
It's not important rn actually
(Can't be bothered to set it up lmfao)
no idea, havent touched redis
Oh my has
I confused you
With the other guy who was helping me today
The pink color confused me
How would you to do, so redis doesn't listen to self data published?
So what should this line be? getCommand("dialogue").setExecutor(new DialogueCommand>()<); The parentheses I am pointing to via >< are underlined red. I tried making a constructor but still didn't work. The second option is to revert that line back to the faulty version.
you'd pass this
which is the instance of Dialoge you want
or well, your main class
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
I'm using di
When you set parameters in constructor then you need to provide when you use, its logical
Is it possible to get the tags of an entity in java code here? (Example, if I kill an enemy, and it has tag "moebius", award 50 exp)
/summon minecraft:zombie ~ ~ ~ {CustomName:'[{"text":"Z"}]',Health:300,Tags:["moebius"],Attributes:[{Name:"generic.attack_damage",Base:8f},{Name:"generic.max_health",Base:300f}],display:{Name:'[{"text":"Z","italic":false}]'}}
Ok, so my plugin command is fully developed. However, how can I make it show up to be used in a command block?
Have you registered it in your plugin.yml, can it be invoked through the chat? If so, the command block should be able to call it as well.
why do you need mysql if its for localhost anyway?
Why not
Yes: ```commands:
dialogue:
description: Used to make dialogue.
usage: /dialogue (selector) (text)
permission: dialogue
permission-message: You do not have the needed permission to execute this command!
Any idea how i could code that two plots can merge
So I have a command which utilizes the args[0] and args[1] values. However, is there any way I could make args[1] be the rest of the arguments merged into one, because args[1] will contain spaces, and spaces separate arguments?
String.join
Right, but can it automatically join the rest of the arguments, like can String.join join the values of args[1] through args[100]?
if u rlly want to keep it in an array u can use Arrays.copyOfRange(array, from, to) but not sure why you would want that
would it make sense to spread parsing 1000 json files out to a forkjoin pool?
should probably benefit cuz its io?
I am using this line player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(this.word)); Can player be something like @a or @r?
uuid aint a string, maybe its getting hung up on that
it needs a.. ..K
Just go from including 1 to excluding args.length. I'd use a for loop and a string joiner, but I'm sure that there's some fancy abstract way, if that's your cup of tea.
How DO I check those events?
sorry for the caps
?eventapi
does anyone know why my logger just... stopped working? a restart fixed it but it was still a very weird glitch
the last message in the logs was me executing a command, but when i tried /plugman reload it didnt show that one
I am trying to make certain blocks incapable of dropping items. I do not know what is going on.
`@EventHandler
public void onBreakBlock(BlockBreakEvent e){
if(e.getBlock().getType() == Material.IRON_BLOCK ||
e.getBlock().getType() == Material.GOLD_BLOCK ||
e.getBlock().getType() == Material.GOLD_ORE ||
e.getBlock().getType() == Material.DIAMOND_BLOCK ||
e.getBlock().getType() == Material.EMERALD_BLOCK ||
e.getBlock().getType() == Material.IRON_ORE ||
e.getBlock().getType() == Material.DIAMOND_ORE ||
e.getBlock().getType() == Material.COAL_ORE ||
e.getBlock().getType() == Material.EMERALD_ORE ||
e.getBlock().getType() == Material.NETHERITE_BLOCK ||
e.getBlock().getType() == Material.RAW_GOLD ||
e.getBlock().getType() == Material.RAW_COPPER ||
e.getBlock().getType() == Material.RAW_IRON ||
e.getBlock().getType() == Material.TNT ||
e.getBlock().getType() == Material.CHEST ||
e.getBlock().getType() == Material.CHEST_MINECART ||
e.getBlock().getType() == Material.TRAPPED_CHEST){
e.getBlock().getDrops().clear();
}`
To add on to that, is there any way to find out how many values are there in the arguments array?
args.length
Damn I understood nothing
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.
String.join(" ", Arrays.copyOfRange(args, 1, args.length -1)))
Dude am not gonna learn lava for some simple thing
bro just make a list
๐
then pay someone
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
bruh
๐คท๐ฝโโ๏ธ don't complain its how it works
you can't just create stuff without code
Thank you
It works now
UE is trying
idfk what ue is
Unreal
Oh I thought that got the length of characters. How could I get the length of characters in args[1]?
It is kinda coding, blueprints is just a "visual" way to code
it still requires learning
You still need to know what you are doing tho
Otherwise blueprints are useless
Trying to code without knowing to code, is like trying to make a fire, without knowing what fire is
You may eventually make fire, and learn what fire is, but is better to learn, then apply this knowledge to expand your first knowledge
Poor man ๐
it is so horrible that you need to learn to do stuff ๐ญ
in the age of technology! One needs to obtain knowledge!
But it's free! AND EVERYWHERE
Literally internet is the base of knowledge, also you must be cautious, but still
anyways back to my issue where the hell did my logger go
how are you setting up the logger?
but do you use vim in vs code
How to close vim editor, please help ๐ข
:q
No one knows
I Mean BookBan Has To Be Something Very Dangerous
There Has To Be A Public Fix Out There Somewhere
vims fire
i dont interface with it thats why its so weird
mojang fixed it
by increasing the 3MB limit to 30 lol
Hey, can you help me?
so its still possible but literally 10X harder
Aren't you injecting the current logger?
it aiant fixed
just learn java you already have the upper camel case down
i didnt do anything. the logger just, for literally no reason, stopped logging
ok learning java isnt gonna be that easy
my server willl be still in danger
for a while
๐คฏ
Isn't there any log or smth?
I mean
The spigot log file
Maybe the issue is only on the console
well it is but
command line should be more robust than this bruh
[19:46:49] [Server thread/INFO]: Moterius issued server command: /crate forceopen testcrate Moterius
[19:47:42] [Server thread/INFO]: Moterius issued server command: /plugman reload EnchantmentShards
it stopped logging between those two lines
it is still in the log file itself after the server stopped
then you'll need to pay someone
but yeah bookban was fixed in 1.14
iirc
1.14
for a certain definition of 'fixed'
What you could try is to use another plugin management plugin, and see if it stills happening
Plugman is very old
Are you sure that there's no existing plugin available? Sounds like a well known issue. You could also try to get somebody to do it for you, but I guess that's not gonna happen with that attitude, lol
i did the same thing multiple times before. also thats the modern version
and am furious
Well, you only have one option ๐
Create your own logger (jk)
I have no idea of what could be happening
I'm pretty sure is plugman
But there's no reason for it to be causing it
well then why did it work earlier
People who are good at solving problems usually don't do it for free, just saying.
If we only had logs of logger
nods sagely
Not joking, we could see what's going on backend
log settings to finest maybe
Hmmm
I don't think that would fix the problem
In fact it would be worst, you would see almost anything in console
Maybe the loading of your plugin is throwing something
After runing that, doesn't the server eventually crash?
Wait, that's something
After running the reload, the server works fine?
Like, you can join and run other commands
After reloading your plugin with plugman
I have literally no idea what's going on
args[1] is a String so .size()
why would you want the string size though?
hmm a forkjoinpool is kinda useless when you just submit a runnable right
I am using this line player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(this.word)); Can player be something like @a or @r?
theres a method in the Bukkit class for that
what does a forkjoinpool do anyways
selectEntities
it steals work from other workers
as far as i know
could probably use a normal threadpool
rn it takes a second to load 1100 files
yes but not easily. either use NMS/GameProfile or direct edit the player dat file
they can't code
then no ๐
shutdownNow() on another thread
probably want to call shutdown but i also want to block it
cause an access violation in the jvm 
alex is a specialist in that
people dont understand m2 is just the form factor
:(
256 isnt much
Is PlayerQuitEvent called no matter how a player is disconnected i.e. even if kicked or an exception occurs?
if your laptop can support it get a second HD
SSD
kepe your OS and apps on main, then all data on second
disable any swap files on the primary SSD
how does that work bruh
reader closed ig
ah yes loaded 874 files in 244ms ๐
how is it still 234ms when i give it 100 threads
dont question the 100 threads
Im confused af
I even tried doing my own get
what version added config comments support? was it 1.18?
yaml comments are #
thank you
He is asking about parsing
is there some event when server under proxy connects onto proxy?
Cuz it's your drive that is limiting the speed
the cpu is doing nothing else than waiting, more threads just make it wait more
and what if i add all those paths to a list and then distribute it to a threadpool?
lemme guess, that wont do anything
The sword isnt giving me speed, but isnt giving any errors
https://paste.md-5.net/avafoxameb.java
Hey, can you help me?
did you execute package?
oops I didnt
what returns null
when do you toggle the boolean
uh quick sanity check, do placed banners on the ground count as blocks for the block they are in?
is dataEvents null?
ah I think I found the issue, accidentally eval'ed a blockstate with a material
Do any of you know how this is in 1.19.3? In the 1.16.5 this had still worked ๐ฌ
ah WindowsDirectoryStream#iterator goes brr
- That class still exists, just make sure your dependency is correct. Maven/Gradle is preferred because it handles dependency magic for you
- What's wrong with
Bukkit#setMotd()?
Smells funny
I sincerely doubt it, but what else do you call a class that represents a server for Minecraft?
Bukkit#setMotd() does not exist. I don't know what I'm doing wrong, I'm using Maven for the spigot.jar
Oh, my bad. It's under the ServerListPingEvent lol
If you listen to this event, you can call setMotd() there instead
I would have to change it in the PlayerQuitEvent
Why's that?
My system does get from the motd information how a game has ended
Steve
That sounds like a serious misuse of the motd lol
If you're trying to do some cross-network stuff, that sort of information should be kept in a database. Redis, SQL, something of the like
Well, data transfer
Probably Redis for the sake of fast, in-memory key-value pairs. Or pub/sub for that matter
Just started with programming xd
:o
Interesting that you chose motd as your storage medium lmao
It's creative, I'll give them that
Also found this in a plugin from 1.16, do you guys have any ideas for this? :/
Don't even really know why that exists. Seems all the wool is separate anyways
It depends on where it's used
My sword is not giving me the speed what has gone wrong?!
https://paste.md-5.net/mewalubuno.java
I will do a pull request and add it once for all
This annoys me since years
There's Material#creatBlockData or Bukkit#createBlockData
one quesiton guys, I made a custom world generation but when the server restarts it just resets the way it generates to vanilla Minecraft, what could be a way of making it permanent
setting the world generator every time the plugin gets enabled?
set it in onLoad not onEnable
I think multiverse has a feature for that
what about the bukkit generator: thingo in bukkit.yml
You have to set it before worlds load
would that be a good idea? (never used it btw)
okok tysm
how do I set a world a world creator?
hmm
My sword is not giving me the speed what has gone wrong?!
https://paste.md-5.net/mewalubuno.java
if I do a new WorldCreator(nameOfWorldThatAlreadyExists)
it will load the world as it already exists?
would it clone it or load it?
public World createWorld()
Creates a world with the specified options.
If the world already exists, it will be loaded from disk and some options may be ignored.
Load
Last error in the plugin, does anyone have an idea how I can update this?
You don't need nms for that
There is literally no benefit in doing that
A friend of mine wrote the plugin back then, my task is just to get it working again xd How can I do that without nms? ๐ฎ
Using e.g. world.getBlock(x, y, z).setType(color, applyPhysics);
Spigot automatically creates the blockdata for you, meaning that you actually also don't need the map
You are now setting the type twice, this doesn't make sense
Oh
args[1].size() is not working
How can I send an error message if only one out of two arguments are provided?
I am using this line player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(this.word)); Can player be something like @a or @r?
That was eclipse? lol It looks like the default intelliJ colors.
the code highlighing is clearly eclipse tho
ok sorry my mistake, have imported the correct now ๐ฌ
declaration: package: org.bukkit, class: Bukkit
A little while
[23:35:08 ERROR]: [Generation] Error initializing plugin 'Generation-1.0.jar' in folder 'plugins' (Is it up to date?)
java.lang.IllegalStateException: Cannot create additional worlds on STARTUP
hmm
world already exists
[23:35:08 INFO]: [Generation] Loading deep_dark
[23:35:08 ERROR]: [Generation] Error initializing plugin 'Generation-1.0.jar' in folder 'plugins' (Is it up to date?)
java.lang.IllegalStateException: Cannot create additional worlds on STARTUP
at com.google.common.base.Preconditions.checkState(Preconditions.java:502) ~[guava-31.1-jre.jar:?]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.createWorld(CraftServer.java:1164) ~[purpur-1.19.3.jar:git-Purpur-1930]
at org.bukkit.Bukkit.createWorld(Bukkit.java:782) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.WorldCreator.createWorld(WorldCreator.java:474) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at dev.akex.generation.Generation.onLoad(Generation.java:58) ~[Generation-1.0.jar:?]
at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:59) ~[purpur-1.19.3.jar:git-Purpur-1930]
at io.papermc.paper.plugin.storage.ServerPluginProviderStorage.processProvided(ServerPluginProviderStorage.java:18) ~[purpur-1.19.3.jar:git-Purpur-1930]
at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:36) ~[purpur-1.19.3.jar:git-Purpur-1930]
at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[purpur-1.19.3.jar:git-Purpur-1930]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.loadPlugins(CraftServer.java:442) ~[purpur-1.19.3.jar:git-Purpur-1930]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:309) ~[purpur-1.19.3.jar:git-Purpur-1930]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1117) ~[purpur-1.19.3.jar:git-Purpur-1930]
When should i load them?
idk what's theat let me gooogle
Itโs the default value for load:
๐
How can I implement this? Also, it doesn't answer the question.
You parse @a or @p or whatever using that method
And get a list of matching entities in return
It can also use a name or a uuid
Or @e[type=creeper,distance=..100] or whatever fancy selectors you desire
checking bans on uuid? pre login doesnt have a player instance available
Use async player pre login
It also allows you to easily deny it with a kick message
No
it has #disallow(reason, message)
How? Just copy and paste that code?
Bukkit.selectEntities(source, โ@pโ)
For example
The source being any entity
Or a command block
Or console
Anything that implements command sender
Weird that it uses string
What else would it use
would be too much work to implement it with a class ๐ค
U still have to know the magic selectors
just a quick wiki search
I mean itโs more designed for player input I imagine
If you want to grab a bunch of entities yourself itโs probably slightly faster to use world.getEntities and filter manually
what type of inheritance type does a interface have?
other interfaces
Sorry I mean relationship
re-word your question
What relationship does a class have when it implements an interface
is a
it is an implementation
md that's not a relationship type
is this a test or something
No
like is-a or has-a?
yeah I've no idea what he's askign either
probably some sort of object oriented programming course / uml terminology
yeah
sounds about right
composition or sumthing iirc
speaking of tests is there like a library or something for writing tests for plugins
so dependency?
MockBukkit
โค๏ธ
composition consists of has which a strong relationship, so it can't be that
No this is just for work
No
I took an entire course on this stuff in college
Does that mean I remember it?
Nope
do yall ever do like ```
int a = 10;
int b = ++a;
๐ wtf
why not just do a++?
lmaooo
the above would be a= 11, b = 10
No, I do this:
String a = "1";
String b = "0";
int c = Integer.parseInt(a + b);
int d = c + 1;
System.out.println("11!");
actually no, thats wrongh