#help-development
1 messages · Page 985 of 1
I wish java had a method to just round something to X decimals
isnt that in Math#
tbh didn’t understand much 😭
What are you trying to achieve?
Presumably you could do it via some bit stuffs
Ik you want to modify offline players inventories, but for what use case?
true, but that*s effffoooort
Me when i have to do anything
action triggered by an http request to remove items from a player and add those to another
I got so annoyed today by discord not being able to auto update on linux
That im writing smth to jsut do it for me
i pretty much have the rest of the code in mind but just that part makes me stupid
i have literally no idea on how to edit the playerdata
wait, instead of editing offline player data, how can i make it edit the inventory once the player’s online? so no data corruption risks and other unstable stuff
Save the changes that need to be made and listen for the join event
how could i store a change of a determined player and make the action run on determined itemstack for determined amount
i have no clue
save a snapshot of the leave inventory, when they rejoin apply the snapshot
yoo can someone explain how i can do async tasks?
?scheduling
Epic is right, read the Wiki first, if you've understood the basics, and need help with a certain application for them, you can ask here!
Now I’m curious of what an advanced bukkit task looks like
Anyone have any thoughts on this UML diagram i've made for an assignment?
If you'd implement anything differently?
Log the action to a db. Check db for actions to perform when player logs in. Now dont need to worry about offline stuff or modifying files directly
You should actually not have http requests perform actions directly to avoid some potential bad things
As well as it makes it easier to log as well in case later you need to verify or whatever
Missing visibility?
I don't see +-#~
also don't know what solid black arrowhead means
did you mean hollow arrowhead
also check your amount constraints, not sure 0..* is valid for everything
Pretty sure the black arrow means can you get to the next thing from the previous directly and association is just that they are associated with each other but you cant directly get from one or the other.
hm
For instance if you have an abstract class you cant just directly create those but indirectly
But they could extend another class at the same time
So they are associated but not directly
i can't run spigot-server project,because i Could not find artifact org.spigotmc:minecraft-server:pom:1.20.4-R0.1-SNAPSHOT in minecraft-libraries (https://libraries.minecraft.net/)
This isnt to be confused witj convenience methods which can enable you to get info from one or the other if that makes sense
how do i find the artifact org.spigotmc:minecraft-server:pom:1.20.4-R0.1-SNAPSHOT ?
i just wanna know how the spigot-server runing,because i wanna to be a contributor in spigot-server project
Think a good example is a spigot player and craft player. They are associated with each other but you cant directly get from one or the other if i recall
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
No coll used wrong command
kek
I choose to blame someone other than myself
Lol
god bless you
Just fyi that is the bot. But you are welcome
ok,thank you. 😘

That's cute
The bot deserves love too
good morning
I am currently planning to make a custom plugin on my 1.19.4 server, is there a developer docs for 1.19.4?
And what about functions/classes, are they still the same despite different minecraft version/java?
?wiki
spigot api mostly, nms fuck no
?jd-s as well
nms?
Net Minecraft Server
?nms is basically raw networking internals which you should avoid using
ah i thought ?nms was a diff one ig
How can I make a cooldown for an item. Not like a p.setCooldown(Material, time)?
Would I just use a hashmap or something?
yea thats what i did
HashMap<Player, Integer> PeaShooterCD = new HashMap<>();
@EventHandler
public void OnRightClickWithPeaShooter(PlayerInteractEvent event) {
if (event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
if (event.getItem() != null) {
if (event.getItem().getItemMeta().equals(Items.PeaShooter.getItemMeta())) {
Player player = event.getPlayer
if (PeaShooterCD.isEmpty()) {
new BukkitRunnable() {
@Override
public void run() {
PeaShooterCD.remove(player, 1);
}
}.runTaskLater(RandomRoomGen.getPlugin(), 20);
}
}
}
``` smtn like this should work atleast it worked for me
there might be holes in it since i broke down a much larger script to get this and didnt really proof read
might not be the best way to do it but its how i did it
private final HashMap<UUID, Long> cooldown;
public Consumption() {
this.cooldown = new HashMap<>();
}
if (!cooldown.containsKey(p.getUniqueId()) || System.currentTimeMillis() - cooldown.get(p.getUniqueId()) > 20000) { // 20 seconds
cooldown.put(p.getUniqueId(), System.currentTimeMillis());
p.setSaturation(20);
p.setFoodLevel(20);
} else {
e.setCancelled(true);
}
Think this should work, right?
try it
puts the players uuid in at the system time, then if they try it again it checks if 20000 ms has passed
yeah that should work
try it and see
i think it should work
did it work cause i might do that too XD
that loos better than what I did
?tas my beloved
Do BuildTools normally take a long time?
30 seonds up to 5 minutes, depending on your PC
Huh, it's been minutes and it's currently on Starting clone of https://hub.spigotmc.org/stash/scm/spigot/builddata.git
I'm guessing that's normal
oh that sounds like an internet issue
Yes. But since I'm an optimization freak, I'd do it with just one Map#compute call
wdym?
You don't need to call for get and put
You can just use one #compute
Put this whole thingy in the compute
Func
does anyone know why this happens?
yo byte buddy is op
it just doesn't work
Seems dangerous
let me know if you figure it out, been looking at that for three months now
a clean install usually removes the warning
but it's still weird
i think it has to do with jdk 21 and compiling down to java 17
but that makes no sense, it should work just fine either way
tried making the interceptor class public?
the javadoc of MethodDelegation#to says:
Delegates any intercepted method to invoke a static method that is declared by the supplied type. To be considered a valid delegation target, the target method must be visible and accessible to the instrumented type. This is the case if the target type is either public or in the same package as the instrumented type and if the target method is either public or non-private and in the same package as the instrumented type. Private methods can only be used as a delegation target if the interception is targeting the instrumented type.
ooh
yeah it works xd
damn
I spent so long solving a silly issue like this
I got another error tho
Caused by: java.lang.IllegalStateException: Class already loaded: class net.minecraft.server.dedicated.DedicatedPlayerList
how do I load only my own class
and none of the subclasses
show the code and entire stack trace
thanks for the help ZlataOvce
how i can do rebuild the ore every 10m same Boxpvp
Hey guys
So I’m starting over with making my ban plugin, bc I wanted to implement a data storage, and 2 commands to get data out of that .txt file. Like /isplayerbanned <player> checks in the data storage txt file if that player is banned, and /banreason <player> checks the banreason of that player. I am now stuck at banning players when online and offline
They told me to use getUniqueId but I’m not sure how
Here’s the code https://paste.md-5.net/juzidakohu.java
please use a set
simply have a text file with an uuid per line ig
also use Path instead of File and Files.newBufferedReader and stuff
just recommendations
I’m not that experienced with those
has to do with JFX
i keep getting that same warning from somewhere else
it is better to have an interface with implementation or a method as an argument for template code
i have no idea why i'm getting this error, anyone wonders why?
if (params.get("auth-token") != null && params.get("auth-token").get(0).equals(authToken)) {
String strMaterial = params.get("material").get(0);
String amount = params.get("amount").get(0);
if (Material.matchMaterial(String strMaterial) != null) {
Material material = Material.matchMaterial(strMaterial);
}
res.status(Http.Status.OK_200);
res.send("Sent '" + amount + "' from " + from + " to " + to);
} else {
res.status(Http.Status.UNAUTHORIZED_401);
res.send("Invalid auth token");
}
remove String in Material.matchMaterial
I created a custom entity class that extends EntityZombie. It's called SupremeZombieEntity. I spawned it in and now under entitydamageevent I'm checking if the entity hit (my entity) is instanceof SupremeZombieEntity, but the if check returns false and says its an instanceof CraftZombie cuz entity zombie is it's parent class, I don't rly understand why it works like that if the object created and spawned in the world was SupremeZombieEntity.
a kind of general java question: I have a class (e.g. Myclass extends MySuperClass) where I call the super constructor. The super constructor itself passes this to another method. Would myInstance instanceof Myclass in that other method still work?
i think you could give it some metadata, like "CoolZombie", and then if the damager has that metadata you do whatever you need
so the constructor passes itself?
yes im pretty sure taht would be true the instaneof thing
thanks!
as you are passing a instance of the subclass
and then in the superclass you are checking if its the subclass
im not 100% sure, test it out before you build your code around this
now I'm getting confused. Let me give you an example:
class MySuperClass {
MySuperClass() {
foobar(this);
}
}
class MyClass extends MySuperClass {
MyClass() {
super();
}
}
public boolean foobar(MySuperClass clazz) {
return clazz instanceof MyClass; // true or false?
}
wait actually it prob works, but may i ask why u are doing this, maybe there is a better solution as this sound like an anti pattern to me
I need to distinguish between multiple different child (?) classes that all extend a base class
alr but why? do you want to change method behaviour based on that?
yes
alright in this case, go into ur subclass and just override the methods
depending on which one is which I want to change some behaviour in other classes
i think if i understand correctly you can simply override the methods
not really
this will make it much cleaner
since it's otehr classes
let me adapt my example:
class MySuperClass {
MySuperClass() {
new TheBigThing(this);
}
}
class MyClass extends MySuperClass {
MyClass() {
super();
}
}
class TheBigThing {
TheBigThing(MySuperClass clazz) {
if (clazz instanceof MyClass)
// do this
else
// do that
}
Hello, I get this error when trying to build 1.20.6 with buildtools and mojmaps (paste.md5 isn't working so I put a txt)
ah found some garbage online compiler. Apparently this indeed returns true
how can someone get their uuid? server is offline mode
e.getUniqueID()
e?
what’s the problem with that?
would it fuck up if i use it with premium and non-premium users?
was half expecting you to try to get the UUID associated with a playername straight from mojang
if it was an authenticated premium account i could’ve done that
the server already does that in online mode
but as it’s offline i would need my players to run the command and use e.getUniqueID()?
as I said getUniqueID works in both online and offline mode. The only difference being where the UUID comes from
you need to have your proxy be in online mode while your servers are in offline, then Player#getUniqueId will return the correct uuid
alright
i’m running paper standalone tho
i just need the uuid to get OfflinePlayer as string is deprecated
im pretty sure then there is not authentication at all
It's funny how minecraft basically comes with a built-in way to pirate the game
if you are just running offline mod
why does it even come with online and offline mode lol
will it get the associated uuid of that player even on offline standalone?
probably just for servers, so they don't spam the api a bunch
they’re asking for it tbh
why? If you have a proxy authenticate a player once instead of authenticating every player every time they switch servers it significantly reduces the load on the auth API
it's useful
remember when LAN parties used to be a thing? :')
That was a thing if u were playing bedrock
I always used it on bedrock
This is a post from 2012 sir
Guys I need help in something pls
So
Im (re)making a ban plugin, that implements a storage data txt file, where I could retrieve some info with these 2 commands /isplayerbanned (checks if the player name is in the file) and /banreason
So I’m now stuck at the point to ban players offline and online
The plugin must also check if that username given is a real username
Here’s the full code
The problem is now to ban players offline and online, both using getUniqueId. And retrieve info with the commands I gave
getOfflinePlayer can take a username to look up
Also I would recommend a more proper storage format
Either something like json or a datapbase
So Player target = Bukkit.getOfflinePlayer()?
But is there a way to not differentiate between online and offline players?
getOfflinePlayer should also retrieve online players
ooh thats going to confuse him 🙂
#isOnline be like
Indeed, I’m confused
So I wrote the thing, but it tells me to put an UUID inside the brackets
You can also do a string
OfflinePlayer#getPlayer 🔥
should throw an error if offline
then use offline
ALWAYS work with OfflinePlayer for a ban plugin
yeah most certainly
You only need a Player Object to send them messages or kick.
surround it with a null check, getPlayer in there
yeah that too
that's what I meant
OfflinePlayer offlinePlayer = ...
if(offlinePlayer.isOnline()) {
offlinePlayer.getPlayer().sendMessage(...)
}
What should come after the =
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
^^
yes sir
Bukkit#getOfflinePlayer right?
yes
is there a less ugly way to do this?
if (Math.abs(Math.abs(pl.x()) - Math.abs(spawnPos.x())) > 50
|| Math.abs(Math.abs(pl.y()) - Math.abs(spawnPos.y())) > 50
|| Math.abs(Math.abs(pl.z()) - Math.abs(spawnPos.z())) > 50) {
all I'm checking is if one location is more than 50 blocks away from another location
location#getDistance
is vector math really more efficient here?
I somehow doubt that
distance uses a square root and those aren't really efficient are they
you asked for a less ugly way
that is still comparably efficient*
or Math.abs(location.subtract(spawn).toVector().length))
.length does the same thing as getDistance though
you sure that it works? In case I am at x -1000 and the spawn is at x 990 then this is going to say I am 10 blocks away
I like the part where they say Teach Them
I was hoping to avoid Math.max and Math.min for that
But it asks for an uuid
We can only say the same thing so many times before we realize you don't listen or don't learn
I read what u guys said, but I don’t understand what u guys mean
Because you don;t know java basics
which we told you to learn
You don;t understand method arguments
So no matter how many times we tell you something, you do not understand it.
Has anyone here already handled setting many blocks in a world at once while also moving the player? I am having issues where after setting tons of blocks and teleporting the player to this place, the player's client freezes for some seconds. Why would that be?
I also see these warn messages in the console, should I worry?
[09:33:50 WARN]: Block entity minecraft:furnace @ BlockPosition{x=534, y=167, z=71} state Block{minecraft:air} invalid for ticking:
[09:33:50 WARN]: Block entity minecraft:furnace @ BlockPosition{x=534, y=166, z=71} state Block{minecraft:air} invalid for ticking:
god dammit this chat filter can kiss my butt
Isn’t it String[args]?
That’s easy
double sx = spawnPos.x();
double sy = spawnPos.y();
double sz = spawnPos.z();
double px = pl.x();
double py = pl.y();
double pz = pl.z();
if (Math.max(sx, px) - Math.min(sx, px) > 50
|| Math.max(sy, py) - Math.min(sy, py) > 50
|| Math.max(sz, pz) - Math.min(sz, pz) > 50) {
pc.get_Bukkit().teleport(spawnPos);
}
I don't know if this is more or less ugly
what
you updated a Block type without updating/removing teh TileEntity
Minecraft blocks id is in 8 bits = 256 blocks but in the newer version we have more blocks so where does these go ?
yo
what packets does the player need
to join the game
like after everything when just "Joining world..." stays
numeric IDs haven't been a thing in
several years
each block type has a namespaced key, minecraft:obsidian, minecraft:nether_portal etc
minecraft:waxed_weathered_cut_copper_stairs
what about the waxed lightly weathered cut copper stairs
the lightly was removed before it made it to release afaik
nooooo
thanks
br how do i verify i see no link in the conversatioon
!verify
Usage: !verify <forums username>
@remote swallow how do i link my spigot to discord?
you have
thats not spigot read the "This might take up to one day for the data to update"
or could u plese tell me y mmoitems is not working on my server?
shows me this
@remote swallow
i'd like to push player towards another entity however, i dont want player sprinting + jumping to affect the velocity, how can i do that?
@remote swallow
i cant help with mmo items as i dont own it or know anything about it
if that's suitable in your situation you could make him sit on another entity and then move the entity he is sitting on, but I guess this is not what you need
not gonna work i think
.distanceSquared?
gonna be much faster than Math.min Math.max Math.min Math.max Math......
if hytale has a plugin system like minecraft, can you make an api?
so do spigot developers have such an idea?
If a platform has a plugin system, it already has an API
then what happens to spigot and bukkit if minecraft has a special api for this?
how do i disable make camel dashing or make it weaker?
minecraft doesn't have the best api; they just modify the entire server 🙃
(craftbukkit, paper, etc)
then let me change my question to this:
can you make an api to create plugins in hytale?
has that game ever seen the light of day lol
"sir, this is a wendy's"
isn't hytale the reason for minecraft's latest big updates?
??
big copium
package wtf.justmammtlol.plugins.LiquidREST;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class CommandUUID implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender instanceof Player) {
Player player = (Player) sender;
player.sendMessage(player.getUniqueID().toString());
}
return true;
}
}```
you can already play some of the changes via the experimental datapack
some of the expected changes are also listed in the minecraft.wiki article for 1.21
i have no idea
someone knows?
that's odd
i think it's getUniqueId()
Without the capitalised D at the end
yeah
i mean for spigot
new events or methods
wpw..
there is some of the experimental api as well
this makes sense but also doesnt wtf
see e.g. Crafter block interface
🤷
well i have a question for u
luckperms can steal my db variables ?
wat
????
i mean it sure isn't mine mine
let me check docs
but how works this system :D?
bro
your permission data is uploaded to a site where the editor frontend takes it from, it is assigned a unique id that you need in the editor to access, and after some time that data expires
there's a method on there for #setJumpStrength
it doesnt work
mind you that it isn't a direct modification access to your permissions data, since you still need to apply the changes that you make in the editor in your server
it exists cuz it extends AbstractHorse
I gather that they both use the jump strength attribute because of that
ive honestly never touched a camel though
cant say
isDashing Link icon
boolean isDashing()
Gets whether this camel is dashing (sprinting).
Returns:
dashing status
setDashing Link icon
void setDashing(boolean dashing)
Sets whether this camel is dashing (sprinting).
Parameters:
dashing - new dashing status
alright ty
that doesnt do what i do
fucking double click
wdym ?_ 😄
No con didn’t D:
#general message gg ez
D:
true
soo
general exists
oml
??
upgrade your maven shade plugin
any specific command?
just replace the version with 3.5.3
I don't see my message
Maybe I need to resend it
So, hello, I get this error when trying to build 1.20.6 with buildtools and mojmaps (paste.md5 isn't working so I put a txt)
How can I make particles go slower? Because when I spawn them from clicked block they shoot and fly far away.
public class HookahEvent implements Listener {
@EventHandler
public void onBrewingStandClick(PlayerInteractEvent e) {
Action action = e.getAction();
if (action == Action.RIGHT_CLICK_BLOCK) {
Block clickedBlock = e.getClickedBlock();
if (clickedBlock != null && clickedBlock.getType() == Material.BREWING_STAND) {
Player player = e.getPlayer();
Location location = clickedBlock.getLocation();
player.spawnParticle(Particle.CLOUD, location, 10);
}
}
}
}
yeah, but not when I copy paste my error
idk why
Set the speed value for the particle
I believe the arg is called extra
does anyone know why this happens?
oh
Yea so
pretty much always call getResourceAsStream on the classloader
not a specific class
what does this do then?
read up ^
this is why you use descriptive names instead of one-letter names 😛
Class.getResource can take a "relative" resource name, which is treated relative to the class's package. Alternatively you can specify an "absolute" resource name by using a leading slash. Classloader resource paths are always deemed to be absolute.
if it was "clazz" i bet lynx could've answered this question at least 2 minutes faster
facts 
c.getResourceAsStream()
c must be a class or classloader, duhh
and in this case it was vital to know which one exactly
then I can't use it as class?
I thought this was the relative placement to the Class
id do class.getClassLoader().getResource
ye, seems like it did
?
basically cancel it without making the player (passenger) outside and the vehicle inside
The client extrapolates movement. You can;t cancel a move event and not have the client attempt to guess its location
If you allow it to move teh client will always make a guess. You can;t prevent it
this is annoying
possibly, disable any AI, read teh steer package from the client and calculate your Location and teleport as required.
No idea if steer packets still get sent when there is no AI
do u know what the steer packet is in protocollib
I've never used it
oof
crap it doesnt tell me where the new location is?
so thats why u told me to calculate it :-:
oh wait it has xyz
im confused, what's the difference between VEHICLE_MOVE and STEER_VEHICLE
steering no ai mobs for whatever the damn reason works
i feel like cancelling the packet will work
cancelign will NOT work
dawg
It might
dubai is here cuz whoever built it didnt listen to people, they told him it wont
tas
I've told you a few times, you are seeing teh horse move away because your client is predicting the movement and you cancelling the move event is resetting the position
u gotta be smart
crap
you have to disable AI to prevent teh client moving the horse at all.
it didnt work cuz u said it wont
listen to the steer packets, calculate the location and terleport the horse.
u cant teleport vehicles
its an entity
you can teleport entities
it yoinks the passengers
How to get block metadata and only if it has metadata run event. I have made a plugin in which when player do a right click on brewing stand spawns cloud particles.
or remount the passenger, but then you get jerky passenger movement instead of the horse
?paste spam
dear lord
why are most java pastes .cs
oh, so you can just get and save inventory state using methods of that object?
Blocks do not have MetaData, only Items or Blocks with TileEntities
How can I check if item was given by cmd?
set a PDC tag, as you already do
So not all brewing stand will spawn particles
but you have to transfer that to the placed TileEntity when its placed
the PDC will not copy over from teh item to the Block. You have to do that yourself
can you please give a link on spigot docs
don't understand what I need to do
how owuld i do that
i have a class that writes and reads from and to a yml file. the writing works completely fine - it sets the value to the correct value. though, after restarting the server and joining, it reads the file correctly the first time, and every time the plugin tries to read the value after that, it always returns the original value, as if the plugin is somehow caching the value?
wdym the first time, are you changing the value externally?
no, literally the first time it reads from the yml file after a server reboot it works fine, then every attempt afterwards returns the same value no matter what
Im thinking about creating object that would manage GUIs via inventories, so far I came up with 3 methods to retrieve, save and initialize certain inventory, but im thinking if I should list GUI listeners in separate object such as on item click etc.
until you restart the server
so I would eventually end up with two objects, one for managing inventories and one for managing events inside those inventories
would that sound like an okay plan?
same value as in the value from before the reboot?
what
ofc its gonna return the same value from after the restart, what am i not understanding
I can recommend this
?gui
ocp
How do i get an nms item stack and how do i import it, there is a plugin i am updating myself that is using that
it is like this rn
net.minecraft.server.v1_13_R2.ItemStack nmsStack = CraftItemStack.asNMSCopy(itemStack);
😔
same way just with a different package
where can i get the maven dependecy for craftbukkit?
?bt
it isnt on maven, you need to run bt
follow this guide
?nms
why do i need to do it myself, isnt there a copy somewhere on internet or smth
weird laws, you cannot distribute it but people can sell their plugins
?dmca
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
distributing plugins != distributing the spigot core
When compiled Spigot contains Mojang code so its illegal to distribute a compiled jar.
before you say paper
the jar paper distribute doesnt contain mojang code but downloads it at first run which puts it in a legal grayzone
if you give a thief a lockpick you aren't doing a crime
because you build it yourself
Why aren't ocelot Sittable entities
bc you are not redistributing but building it yourselkf
iirc you cant tame them anymore
its cats now
buildtools redistributes the code tho
no
you can
buildtools has no mojang code it
iirc it downloads a server jar and decompiles it
it downloads the minecraft jar from mojang and patches it
so building it urself means u can get the code but you cant download a prebuilt binary
yes basically
correct
You are allowed to build stuff
blame the dmca
the print code is executed when someone enters the server. the console displays "impl a" and "false" and then crashes. With debugging, I came to the conclusion that pluginmanager.ispluginenabled() was the reason for the crash, so I removed the line and the crash stopped. Why does it happen?
?dmca
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
who did the dmca
Did you know forge or fabric installers both do the same thing as buildtools?
Well, dunno about fabric tbh, but forge does the same thing basically
what a fart
honestly it was fair
They had some good reasons
like what
is it not written here
link isnt resolving
it is
mojang owned bukkit but didnt make it public so had people basically doing paid work for free
Bukkit's Retirement(top)
On August 24th 2014, the old Bukkit Development Team decided to retire the Bukkit project, due to a decline in development interest and a lack of new blood for contributions.
Mojang's Takeover(top)
In response to Bukkit's announcement, Mojang revealed that they had secretly owned the Bukkit Project for a few years, and revoked the Bukkit team's access to all bukkit resources (github, forums and others).
Wolvereness(top)
Wolvereness is someone who developed CraftBukkit. He was one of the largest contributors in the codebase. After the aforementioned event had occurred, he filed a DMCA takedown.
okay so how would you feel if you went and volunteered for this small company that you think is only a few people with not that much behind it and it turns out to be a giant corp
he isnt
it is what it is
he only made it harder for the users not the big company
🤦♂️
if you contributed and made most of craftbukkit and it turned out to be for mojang i dont think you'd be very happy
Wasn't the license also not properly enforced or some shit like that
wait where does this specify the vehicle being moved
corporate bs goes a long way
villager could hold emeralds in the past? i saw a method called .setRiches() for carrying emeralds
if you hold something they want to buy they'll show an emerald
dont they store stuff in chests and composters?
they use them but dont store anything
i always thought they could wtf
sounds like uve been playing modded
i prob got this false memory from seeing filled chests
wtf this is the best thing to ever exist
i can teleport the flippin vehicle
why isn't this in spigot
I know there was a PR for teleporting entities with passengers
Idk if it ever got merged
but im still confused what vehicle its moving, i never specified an entity id
its sent to the client so it moves teh vehicle the player is in
that makes perfect sense, but how does it get reflected server wide
if the player is not in a vehicle its ignored
other clients get a position update packet for the entity
explain why not...
the first time you read the file after a restart, it returns the correct value from the yml file. every time you try to read the file after that initial read, it will return the value it was originally when you first read the file instead of the value present in the file
e.g. if you read the file when the server just started up and it was true, then changed the value to false and read the file again, it'll still return true.
but when you restart it resets this
so it's caching or something
each time you read from the config you are readign from memory
memory does not get updated if you manually change a value in the file
i'm not manually changing it
i'm changing it via #set()
and then doing #save()
and it updates correctly in the file
Then I (as well) have no clue what you are saying
.
if you call save and the file IS saved, then your memory and file are correc t
ye not shit, there isnt a file watcher on it
where is the incorrect value?
if you change thhe file externally, it wont update int the FIleConfiguration
https://paste.md-5.net/eroqozezes.java the setValue() method is what is saving it
[21:28:31 WARN]: Horse (vehicle of dsfdfs) moved too quickly! -33.42654376457838,1.0,-9.631125290821956 can this be bypassed when using this
please dont use lazy initialization, it only complicates things
i dont know what that means
what does that mean!
what does what mean
reproducing in a minimal environment...
reproduce it without extra code to worry about
where are you using the SaveManager?
Hey, could someone help me?
I'm trying to configure my gpg key in intelij idea and did all the steps, but now it says this when trying to commit
gpg: skipped "mykey": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object
public void GiveEffect(Player player) {
String PlayerUUID = player.getUniqueId().toString();
boolean toggled = manager.getValue(PlayerUUID);
this.SendConsoleMessage("toggled: " + toggled);
if (toggled) {
player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 255, false, false));
} else {
player.removePotionEffect(PotionEffectType.NIGHT_VISION);
}
}
this
gonna need a bit more than that mate
so where are you defining manager?
I mean, I have made al the steps in git
and when trying to configure it in intelij
have done that
idk i dont use the gui tools for git
But this appears when trying to configure the key
do you have a eprivate key
i have just made it
What is the more modern version of NBTTagString and NBTTagList?
but for some reason it says that
for the last i found ListTag, for NBTTagString i found StringTag however its constructor is private
in mojmaps ListTag for tag list and StringTag
use value of most likely
wdym
the method valueOf
I think i'm missing signing in into space
how can i read a OfflinePlayer inventory?
if i transform it to Player, #getInventory() wont work
i just need to check if offline player's inventory contains at least an itemstack
how much would that be difficult
Define difficult
long and intricated process
first line of the class:
SaveManager manager = new SaveManager();
Ehh, not really
i have no idea tho, i was looking at projects like OpenInv but there's no clear info on how to use them in development
NoClassDefFoundError: net/minecraft/nbt/Tag aaaaaaaaaa
they use nms and mofiy the dat files
it is remapped
?paste ur pom.xml
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier></dependency>
looks remapped to me
that is spigot remapped
you need to remap back to obsfucated
read the docs again
?nms
please shot me, rereading...
no idea on how to do it myself
check source to see what they do
do i need the fancy plugin too?
bang on
would be one line of code if it werent be a chest
can i ask as imple question:
What are Mojang mappings?
Mojang is obfuscating certain method and field names before shipping Minecraft. That means you will have a very bad experience when you want to access NMS in the classic way, because most fields are simply called “a”, “b”, “c”, etc. Fortunately, Mojang decided to release their obfuscation map, which means that you can actually use the same names that the Mojang developers are using.
Why?
chest?
why they obsfucate?
because obfuscation is a thing
why obfuscate then release the mapping
✨ legal reasons ✨
we learning the loopholes with this one 🗣️ 🗣️ 🗣️ 🔥 🔥
well i just need to know if the inventory contains at least an itemstack but have no idea on how to use NMS and NBT @tardy delta r
dont either
solution: learn or use a library where someone handles that for you
you know any library?
How can I close brewing stand's gui?
@EventHandler
public void onBrewingStandClick(PlayerInteractEvent e) {
Action action = e.getAction();
if (action == Action.RIGHT_CLICK_BLOCK) {
Block clickedBlock = e.getClickedBlock();
if (clickedBlock != null && clickedBlock.getType() == Material.BREWING_STAND) {
Location location = clickedBlock.getLocation();
if (Plugin.specialBrewingStands.containsKey(location)) {
Player player = e.getPlayer();
player.spawnParticle(Particle.CLOUD, location, 10, 0, 0, 0, 0.1);
player.sendMessage("§fВы затянулись");
}
player.closeInventory()
https://wiki.vg/Protocol_FAQ does anyone know where I could find this for the previous versions?
What I tend to do is to check when that version was released and rollback within its history a few days after that date
@grim hound
wayback machine?
No, there is a history on every page
It was removed. SPELL_MOB now allows you to add custom alpha values, making the AMBIENT one absolete
You're welcome Elon
does anyone know why this screen won't go away? For context, I'm trying to let the player join whilst blocking the packets from the server (internal mechanic, the server doesn't even send the packets because of it)
The version is for both 1.20.1
and this is my packet send order
is this protocollib?
scary
since when is Main responsable for logging? no logger?
forgive me my questions but i have nothing to do atm
Is possible voice chat without client-side?
what the fuck can the guy do about the fact that this is minecraft's protocol
yes
wddfwdwdw() beautiful
it's my own class
yes
how?
it would've been nice if there was a builder for this
it would be even longer
what are you on about
and a builder doesn't even make sense here
it's alright
returning to the question
this is how I make em chunks
cuz the author forgot the set methods for these
VarHandle?
what for?
you dont realize how slow reflection is
This is
a testing stage
- All of this will be
static finalwhen it'll work
- If I was worried about speed, I would use
Unsafe
again
does anyone know how to have it progress to "Loading terrain..."
https://wiki.vg/Protocol_FAQ because
the wiki covers that if you're struggling
im wondering if its already disallowed to directly mmodify variables using field offsets 🤔
but I can't even get past "joining world" xD
what packet even initiates the "joining world" screen? Login?
I have no idea
probably Login Success
been a while ago since i implemented packets and it was in minestom
since it ends the login phase
I would want to know what initiates "Loading terrain"
?maven for me
groq says so yes
Hey, i cannot commit to github because it says i don't have a private key, i have tried to set the gpg key but it says the same thing... I've searched in google but no post seems to work... do someone know how to solve this problem?
intelijj says that it Cannot find suitable private key
what about "Loading terrain" then?
The packet that initiates the "Loading Terrain" screen is the Chunk Data packet (0x07)
~ ai
would make sense
how do i add nms to an existing project?
yeah I saw that "center chunk packet"
but wtf is that
it's a normal chunk packet
but with some identifier the client recognizes
talking about this?
Hello do you know why I can send information to my server via sockets but when I try to response with my server the client does not get the response I used BufferedReader
That crash my client side
yes
talking about spigot? what crash
what special identifier?
very clear to me /s
Execution failed for task ':compileJava'.
Could not resolve all files for configuration ':compileClasspath'.
Could not find org.spigotmc1.16.5-R0.1-SNAPSHOT.
if your using maven or gradle dont add jars to artifacts
?maven
add mavenLocal() to your dependencies block
that link ^ has a link for gradle at the bottom
it's modules
Execution failed for task ':compileJava'.
Could not resolve all files for configuration ':compileClasspath'.
Could not find spigot-1.16.5-R0.1-SNAPSHOT-remapped-mojang.jar (org.spigotmc1.16.5-R0.1-SNAPSHOT).
Searched in the following locations:
file:/Users/mariopizzano/.m2/repository/org/spigotmc/spigot/1.16.5-R0.1-SNAPSHOT/spigot-1.16.5-R0.1-SNAPSHOT-remapped-mojang.jar
still dont do it
if you want to use remapped with gradle you need a 3rd party pluin
wasn't i supposed to use remapped buildtools har?
you are but you dont add it to artifacts
?nms has something on for gradle
build.gradle
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'maven-publish'
id 'io.github.patrick.remapper' version "1.4.0"
}
group = 'wtf.justmammtlol.plugins.LiquidREST'
version = '0.2'
shadowJar {
}
dependencies {
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
compileOnly 'org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT:remapped-mojang'
compileOnly 'net.essentialsx:EssentialsX:2.19.0'
compileOnly "com.github.MilkBowl:VaultAPI:1.7"
implementation 'io.helidon.webserver:helidon-webserver:2.6.4'
implementation 'io.helidon.media:helidon-media-jsonp:2.6.4'
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
tasks.remap {
version.set("1.16.5")
}
tasks.build {
dependsOn(tasks.remap)
}
repositories {
mavenCentral()
mavenLocal()
maven { url 'https://ci.ender.zone/plugin/repository/everything/' }
maven { url 'https://repo1.maven.org/maven2/'}
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven {
url "https://repo.essentialsx.net/releases/"
name "Essentials releases"
}
maven {
name "papermc"
url "https://papermc.io/repo/repository/maven-public/"
}
maven { url 'https://jitpack.io' }
}
test {
useJUnitPlatform()
}```
i did what was needed from the ?nms guide
theorically
how should i add nms pre 1.17?
your stuck with obsfucated
so remove the patrick remapper and remapped-mojang classifier
how do i work with nbt if nms isn't available on 1.16.5
there's no way im using a, b, c, d
update then
the consequences of using 1.16.5
imma kms istg
What's the packet when player logs out from the server? PacketType.Login.Server.DISCONNECT does not seem to work (I am using protocollib)
how do i even update now
you could use mcp reborn to have at least any idea what stands for those methods
Salut il y aurai un français qui s'y connais en nms?
Je connais en nms un peu mais mon connaissances en francais est mauvais
I also speak English 🙂
PlayerQuitEvent
yeah but is there really no way to catch it with packets? Just wondering
?xy
nothing I can do about it
Ok, well I have a problem I dev an ap for a launcher (az launcher launcher of funcraft) I sent a message to the creator he replied to me and to create classes but I manage to set what he puts but he asks me for a notchian and I don't know it...
how do i get the int code of a bukkit chatcolor
md is asking what you're trying to achieve and why you need a packet listener to do this over just the PlayerQuitEvent that Bukkit provides you, which is essentially an API, version-independent packet listener for plugins.
What about the PQE is insufficient?
I got it, but tbh I could just use the PlayerQuitEvent as md_5 said. Although the thing is that I have a system which works mostly with packets and does not really interact with bukkit api, that's why I was asking about packets
When life gives you lemons, you make lemonade. Same goes with PQE
When life gives you PlayerQuitEvent you make PlayerQuitEventade?
Yes coll, that's exactly what I've meant
are you sure you didnt mean to say when life gives you the wheel you use it
There are multiple instances of disconnecting
declaration: package: com.comphenix.protocol, class: PacketType, class: Play, class: Server
Also you probably won't get a packet if the connection just closes
So it's really unnecessarily bad design what you're trying to do
I’m think if your system works mostly with packets, your system is flawed
does Simon still own the Hypixel server, or is someone else in charge now?
simon still owns it to what we know
pretty cool. I still remember when I first joined back in 2013 or 2012 when it opened, I can't quite recall
I didn't have a premium account back then; I only got one in 2014 when a friend gave me his because I heard that Hypixel had launched their server
God, he used to make the best adventure maps with Rezzus
Making a library system for a project atm, it's just going to work inside of the console
I finished up a method to register users. Any thoughts or anything you guys would change?
public void register() {
User newUser;
String input;
System.out.println("User registration");
// Student or Librarian account creation selection
System.out.println("(S)tudent or (L)ibrarian?");
input = scanner.next();
while (!(input.equalsIgnoreCase("s") || input.equalsIgnoreCase("l"))) {
System.out.println("Unknown response. Please try again.");
input = scanner.next();
}
if (input.equalsIgnoreCase("s")) {
newUser = new Student();
System.out.println("Creating new student account...");
} else {
newUser = new Librarian();
System.out.println("Creating new librarian account...");
}
// Choose username
String[] chosenUsername = {""}; // Container for chosen username
boolean userNameTaken = true;
while (userNameTaken) {
System.out.println("\nPlease create a username: ");
chosenUsername[0] = scanner.next();
userNameTaken = library.getAllUsers().stream()
.anyMatch(user -> chosenUsername[0].equalsIgnoreCase(user.getUsername()));
if (userNameTaken) {
System.out.println("Username \"" + chosenUsername[0] + "\" is unavailable. Please try again.");
}
}
newUser.setUsername(chosenUsername[0]);
// Choose password
String confirmedPassword = "";
boolean passwordsMatch = false;
while (!passwordsMatch) {
System.out.println("\nPlease set a password: ");
String password1 = scanner.next();
System.out.println("Confirm your password: ");
String password2 = scanner.next();
if (password1.equals(password2)) {
confirmedPassword = password1;
passwordsMatch = true;
} else {
```
System.out.println("Passwords do not match. Please try again.");
}
}
newUser.setPassword(confirmedPassword);
if (newUser.isLibrarian()) library.addLibrarian((Librarian) newUser);
else library.addStudent((Student) newUser);
}```
Not trying to get u guys to do the work for me, just eager to learn lol
Here is the UML diagram again
That method is part of the LibrarySystemUI class
Example of it working:
Generally, try to not print a new line after questions
the output rn looks pretty noisy
The code looks alright tho 👍
okay, will keep that in mind
Just doing it for fun to learn Java?
I do
not lying fr
gonna put this in prod right away
hell I've even enjoyed programming in C/C++
What about JavaScript
typedef int $;
$ _=~!+[]()->$*{}();
:I
jokes aside C++ is pretty okay imo
gee i wonder where you got that from
the internet
I'm not even gonna ask
not a magazine
yeah, like inflicting it
yes
but also no
but yes
have you ever seen both of us in the same place at the same time?
sometimes
look at your phone wallpaper
Oh no e-dating
im doing it for a project, but i wanna learn how to make it better for fun. it works, and i have everything needed for an A
but I just wanna learn, ya know?
Yeah, I can't really see anything wrong with it aside from maybe just extracting out your passwordsMatch assignment to the initial if condition
Schrödinger’s e-dating
This isn't even valid
it is tho?
Nope
passwordsMatch = password1.equals(password2);
if (passwordsMatch) {
confirmedPassword = password1;
} else {
System.out.println("Passwords do not match. Please try again.");
}
how not
ohh okay
That's really it just at a quick glance, and even that's a nitpick tbh
Code style is mostly pretty clean 🙂
Crash the jvm if passwords don’t match
and will this help me download more ram?
Fuck it. Bluescreen the computer
well, $ cannot be used as a type alias with typedef
valid identifiers in C++ cannot contain $ general
[] isn't a valid expression by itself
-> is used for member access but there is no object before it
{} defines a block but it comes after -> which is not allowed
have you ever heard of a lambda?
Have you ever heard of the basics
I very much have
A baby sheepda
it comes after the return type, not after the ->
it's part of the lambda declaration
it's part of the lambda, more specifically the captures
Looks like you haven't. Btw () at the end tires to call something but the preceding expression is not callable. Variable names like _ are allowed but discouraged, as names beginning with an underscore are reserved for use by the compiler and standard library
a lambda is very much callable
You can definitely call a lambda :p
_ is discouraged but perfectly legal
1.16.5-R0.1-SNAPSHOT.
