#help-development
1 messages · Page 1999 of 1
yaml.set("Homes." + player.getUniqueId() + ".X", getPlayerLocation( player ).getX());
where?
is it supposed to be like 358 ?
yes
getBlockX()
thanks
because its a double?
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockPhysics(BlockPhysicsEvent event) {
Block aboveBlock = event.getBlock().getLocation().add(0, 1, 0).getBlock();
if (aboveBlock.getType() == Material.NOTE_BLOCK) {
updateAndCheck(event.getBlock().getLocation());
event.setCancelled(true);
}
if (event.getBlock().getType() == Material.NOTE_BLOCK) {
event.setCancelled(true);
}
if (event.getBlock().getType().toString().toLowerCase().contains("sign")) {
return;
}
event.getBlock().getState().update(true, false);
}```
I have this snippet to prevent note blocks from changing state whenever the block under them gets broken, but it seems like it does this 1 tick later how can I fix this
x, y, z are doubles not ints
yea but block fixed it
now i need to do only for yaw and pitch
that might just be how minecraft works. when updating blocks. not sure on this though
and how
BlockPhysicsEvent has a warning about how much it is called, it might just not be able to since you are blocking the thread
i dont see another way i can do it tho
well what effect do you want to achieve.
I have this snippet to prevent note blocks from changing state whenever the block under them gets broken, but it seems like it does this 1 tick later how can I fix this
^^
sure. but why
you could try the block destroy event as well
uhm how i can make a double into a int (yaw and pitch)
yea i am asking why. there might be a different way.
im making the noteblock server-side completely so i can add extra functionality based on the state of the noteblock
and custom blocks change the state differently
i need to prevent minecraft from changing it
that last one would be called much less as it handles only player events
Cast it
yaw and pitch are floats
Hi guys!!! Question: How can I update my plugin logo, in case it was not originally loaded, but the item responsible for loading was selected?
same principe
yea
Wat
Like in the spigot website?
yea
Hit the change icon button
41.74658 that thing is ugly
(int)
i want it as int not as float
where? 😄
under resource tools on the right side
mybad
It would be under resource tools or edit resource
still float
int i = (int) myFloat
Eemememe...
If you don't mind, could you point a finger at me?
why does hashmap not take primitive types
this is the first time we've uploaded a resource to spigot
because generics doesnt allow primitives
on your resource page, look at the right side. there is a section called "resource tools." use "edit resource icon" to upload one
i just cut my paging file down to like 1 gig so i could have space to installa game
So
How much do I have to donate
To get vip or whatever it is
I can’t find the post about it
I just wanna change my name on the forums
yea, probably any donation tbh
0.01 BTC
why util method
bruh just do int yaw = (int) player.getLocation().getYaw();
do not ask lol
just show it
Location that return player.location XD
bruh
why
lol just do player.getLocation()
I found it
its longer to write that method than to just use player.getLocation() bro
why do u even do that
It’s 10
ah
using old code
wdym
nothing i tested some methods
btw is it open source
u should make ur stuff open source so u can get bullied by other people until you learn
yes yes
but i dont know why its still float
https://github.com/xNotro/SetHome/blob/master/src/main/java/org/xnotro/sethome/SetHomeUtils.java#L16
it isnt
there it is
old one
i know
because are utils
thats some good taste in theme btw
config utils and homeutils
and font
imagine changing intellij colors and font
but please ctrl alt L
lots of themes in there
default > themes
my theme and font
needs some change tbf
i got bored from it
anyways
give lib idea
👌
wait wat
Y
True
small tip if ur copy pasting methods
click the method minimizer thing in intellij
then it will become a one line
u can copy it
💀 I didn't even notice
where to find the source code?
heaven
If you're copy pasting methods probably doing something wrong 
nah
what if u wanna show it to someone
i have it with optifine
lol
but im not gonna give it because it illegal!!!
20 gb file
Something like that.
we need a 1 TB file made of only ';'
LMFAO
100GB if you want it
WHY
Yes
because we can
💀
Poor intellij is still trying to clean up this file
bet u cant make it 1 tb :D
If I had the disk space I would
writes a custom http server just to pretend to have such a massive file
Although, pretty sure that java will fail to send such a huge file. I guess it'd need to be some serial protocol
https://miketheshadow.ca/semicolons.txt 100GB file 
just write a sed loop and append to file
Feel free to download it
package org.apache.commons.codec.digest does not exist
How come this?
Wasn't apache-commons deprecated in spigot for a while now?
@vocal cloud scam
lmao
let me fix it rq
So what is the spigot alternative for DigestUtils?
quick thing, can you check when an item is picked up in inv (so like clicked on cursor, because rn InventoryClickEvent only tells me the item on placing down)
Oh nice. Cloudflare now thinks that I am a threat
bad boy
Okay, force-reloading spigot worked
Planned Removal of commons-lang
The API currently includes a very outdated copy of commons-lang. This API dependency is now deprecated and will be removed from the API and eventually the Server in a future release. Please consider switching to Google Guava (which is a supported bundled API) or using your own copy of the much more recent commons-lang3.
Okay, actually commons-codec should work
buuuut why it dont
Just include & shade commons-codec instead. noone is preventing you from doing just that
my ide is ._.
great ide ._.
How to create a listener like: "Player left-click to another player"?
without damage
Allocate more ram to make ide = =D
java.security.MessageDigest ...
the class has it's issues
dont we all?
so you want to cancel the event?
I need sha512 as well
seems to work
just listen to EntityDamageByEntityEvent and cancel it if both entities involved are players
no
so what do you want
player are in god mode
SHA-512 is supported by java.security.MessageDigest
At least I think so
MessageDigest Algorithms
The algorithm names in this section can be specified when generating an instance of MessageDigest.
Algorithm Name
MD2
MD5
SHA-1
SHA-224
SHA-256
SHA-384
SHA-512
SHA-512/224
SHA-512/256
player doesn't have invulnerability
EntityDamageByEntityEvent will trigger when damage can be applied, regardless if a plugin cancelled it or not
https://docs.oracle.com/en/java/javase/17/docs/api/java.xml.crypto/javax/xml/crypto/dsig/DigestMethod.html yup 17 has both SHA3 and SHA versions
oki
ty
np
uuuh just found out java commons message digest relies on java.security.messagedigest
it would, it is a core language library
I'll just use BCrypt
Does anyone know how to detect a player right clicking with a certain item in their main hand?
PlayerInteractEvent
^
listen for the Interactevent and then get the players inventory and iteminmainhand and compare it
well no
actually
PlayerInteractEvent
PlayerInteractAtEntityEvent
those are two different things
they don't run together
import me.[MY NAME].customitems.items.itemManager;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
public class teleportAbility implements Listener {
@EventHandler
public void click(PlayerInteractEvent event) {
Player player = event.getPlayer();
if (event.getAction() == Action.RIGHT_CLICK_AIR) {
if (player.getInventory().getItemInMainHand().getItemMeta().getDisplayName() == "§6Teleport Stick") {
player.sendMessage("Click");
}
}
return;
}
}```
i have that code at the minite but its not working
first
don't use == on strings
use .equals
== doesn't work
also
second
use PDC
Can someone help? Why code no work?
Hello my code no work
Here's code
public final class fortniteinminecraft extends JavaPlugin {
final boolean hasgun = true; //True if player has gun, false if player dont has have gun
final int ammo = 77; //AMMO
@Override
public void onEnable() {
if(hasgun) Player.SendMessage(Player.shoot()) //Shoot if player has gun and when click
}
// shoot
def shoot() {
Bow bow; //get the weapon
bow.shoot(forward); //shoot forward
return "I shooted, Ammo: ammo - 1" //Tell player that shooted and remove one ammo and tell the player ammo.
}
}
}
I use python more so i can don't know java good, but this must work because i know java because i have google
Error: I don't know what error means but i think it's cool
so either you are a troll
def?
or you are really, really dumb
py function keyword
not in java?
Why
Pyva
^
Pyva :D
This is java
i know
we know
but ur writing ur code half python half java
Oh
and what is that..
Is that why code dont work?
this is just cursed code
no its completely wrong
only thing you got right are strings lmao
wait nvm
true is the only thing you got right
also this is a troll
but its hilarious
so ill go with it
What wrong with my age?
i either don't know if you're a troll
or if you're a kid
either way its fucking hilarious
this is better than the md_5 and wifispy's convo
LOL THIS CONVO
Im not kid
bet
Im huge brain human
Hello i have a problem for use NameTag edit
||```java
[ERROR] null
org.bukkit.command.CommandException: Cannot execute command 'ne' in plugin NametagEdit v4.5.0 - plugin is disabled.
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R1.CraftServer.dispatchCommand(CraftServer.java:907) ~[paper-1.18.1.jar:git-Paper-207]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleCommand(ServerGamePacketListenerImpl.java:2289) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2100) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2081) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundChatPacket.handle(ServerboundChatPacket.java:46) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundChatPacket.a(ServerboundChatPacket.java:6) ~[?:?]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:56) ~[?:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.18.1.jar:git-Paper-207]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[?:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[?:?]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1414) ~[paper-1.18.1.jar:git-Paper-207]
at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:189) ~[paper-1.18.1.jar:git-Paper-207]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[?:?]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1391) ~[paper-1.18.1.jar:git-Paper-207]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1384) ~[paper-1.18.1.jar:git-Paper-207]
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:132) ~[?:?]
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1362) ~[paper-1.18.1.jar:git-Paper-207]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1268) ~[paper-1.18.1.jar:git-Paper-207]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-207]
at java.lang.Thread.run(Thread.java:833) ~[?:?]```||
its really fun
"I shooted, Ammo:" + Ammo-1
also naming conventions
paper
Okay i will try fix
^^^
What ?
you know its a troll
dont mix java and python
return urDiamondsToYou;
Your code does work, and don't let anyone tell you differently
If someone is telling you your code is bad, they're lying. They want you to fail
yep
that's aqua affinity
declaration: package: org.bukkit.enchantments, class: Enchantment
ok
Yes, tahnk but code is no work
i put AQUA and it didnt appear
just try again, your code is perfect. Keep compiling it until it works
but yes, its water_worker
Yes i do will
Yes but no
?
ye
The absolute zenith of human achievement
the greatest conquest of humanity
er meio de sto monno
(it means: "The best of this world", written in dialect, its not perfect tho)
Getting code that is that perfect to run will be a test of perseverance
what is a good enchantment to put in custom chestplate?
that isnt protection or thorns
a custom enchantment that makes laser beams come out of your chest like a plasma ball and zaps everything that comes nearby
stop the DRM things
public class FortnitePlayer {
private final Player player;
private final Gun gun;
private final GameManager manager;
private FortnitePlayer(Player player, Gun gun, GameManager manager) {
this.player = player;
this.gun = gun;
this.manager = manager;
}
public Player getPlayer() {
return player;
}
public Gun getGun() {
return gun;
}
public int getAmmo() {
return gun.getAmmo();
}
public void shootGun() {
ShootResult result = gun.shoot();
if(result.getKill() == null) return;
final FortnitePlayer killedPlayer = result.getKill();
player.sendTitle(
"You killed",
killedPlayer.getPlayer().getName(),
20, 20*3, 20
);
gameManager.updateAdvancements(this);
}
}
public final class FortniteInMinecraft extends JavaPlugin implements Listener {
final ArrayList<FortnitePlayer> players = new ArrayList<>();
final GameManager gameManager = new GameManager();
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onShoot(PlayerInteractEvent e) {
if(e.getAction() != Action.RIGHT_CLICK_AIR) return;
getFortnitePlayerByUUID(e.getPlayer().getUniqueId()).shootGun();
}
private FortnitePlayer getFortnitePlayerByUUID(final UUID uuid) {
for (FortnitePlayer player : players) {
if(player.getPlayer().getUniqueId().equals(uuid)) return player;
}
return null;
}
@EventHandler
public void onJoin(PlayerJoinEvent e) {
players.add(new FortnitePlayer(e.getPlayer(), new Gun(GunType.SHOTGUN, 12), gameManager));
}
}
I made it! It works now. Tahnk, I've been saying all along that the old code looks like python, but you wouldn't believe it.
It way better then old code
but that old code looked so good
Yes but shoot no work 😢
ig youre a pubg fan
me dont understand
same!
no he's a fortnite gamer
No
im so tired
you know whats sun is right?
Thank you very muts
nuts*
yes
Its a fortnite backbling
no real god fotnite plawer
really?, are you one of those players that can replicate the entire empire state building within 5 seconds of hearing a few shots?
No 2 of them
2 seconds?!
No i have 2 dads
huh
that's so progressive
Im fortnite OG
you should've thought about that before you decided to not have a dad
meh you know?, fuck off dads
mine sucks af
lmao
just get a new one then
lets take a nap lol
so true bestie
11:20pm hmm
Okay so we're trying to stop a player from being able to mine any blocks however this code is not working:
@EventHandler
public void onBlockBreak(BlockBreakEvent blockBreakEvent) {
Player player = blockBreakEvent.getPlayer();
if(player != null) {
blockBreakEvent.setCancelled(true);
}
}
Does anyone know what we did wrong?
did you register it!
il take that as a no.
lol
We forgot about registering
getServer().getPluginManager().registerEvents();
in main
takes ur plugin class & event class
cant wait for this to blow up
Thank you!
is there a way to make lore appear before enchantments
without having to hide enchantments name and make a lore for them
Nope
i think its a client side thing
yo pulse
hi
hows life
ah pity...
yeah
wish u the best
, tho have u touched any code recently? 😮
Sorta
I mean i haven't touched my lib for like two weeks
but i do teach a java class still every sat
ah fair
what is the difference between loginevent and asyncloginevent?
theres no asyncloginevent
there's asyncplayerpreloginevent, playerpreloginevent (deprecated) and playerloginevent
Does anyone know how to make it give you an effect when using a normal totem and not when using another custom?
asyncplayerpreloginevent handles the listener callback which is non blocking and thats done when the connection gets initialized and everything
yeah what im asking is all the code in it run async?
login is where the initialization is stabilized
so having that async would be practically useless
yes
thanks
Okay, another question. So we're trying to make it to where when the player left clicks, it summons a fireball of a random explosive power. However whenever we run the command, it says unknown command. Is this code not possible?
public void onPlayerInteract(PlayerInteractEvent playerInteractEvent) {
Player player = playerInteractEvent.getPlayer();
if (playerInteractEvent.getAction().isLeftClick()) {
int explosivePower = (int)Math.floor(Math.random() * 10) + 1;
player.performCommand("/summon minecraft:fireball ~ ~ ~ {ExplosionPower:" + explosivePower + "}");
player.sendMessage("/summon minecraft:fireball ~ ~ ~ {ExplosionPower:" + explosivePower + "}");
}
}```
Is there a limit to how often you can use Player#setVelocity or how big the vector can be?
did you register the command !
ah well, worth a try
once every tick is when it gets recognized
I have made a totem with lore and texture etc., and I want that when using a normal totem it gives you effects and when using the custom one it does not
I don't know if I explain myself
yes and?, read his message
but practically you'll probably encounter weird bugs given a colossal magnitude for a vector
why not summon a fireball yourself.
I'm having this weird bug where I apply a (small) velocity when they walk over a pressure plate
Sometimes it won't launch them at all
What do you mean by that?
Fireball fireball = (Fireball) world.spawnEntity(new Location(world, 0 ,0 ,0), EntityType.FIREBALL);
fireball.setYield(/*your power*/);
fireball.setVelocity(/*your velocity*/);
oh sounds rough, got some code to share? 😮
Ah okay
what event are you using
public void onPlayerMove(PlayerMoveEvent event) {
if(event.getTo().getBlock().getType() == Material.GOLD_PLATE) {
Player player = event.getPlayer();
player.setVelocity(player.getLocation().getDirection().multiply(0.5).setY(0.9));
}
}```
.
aww. i would advize coution using this event like this, it gets called a TON
use playerinteractevent
and check if its a physical action
With a simple if statement and the PDCs of the ItemStacks
does anyone know a some algorithm like base64? I just need to make a string non-human-readable and be able to easily reverse it to the original
doesn't need to be fast, doesn't need to be good, and size also doesn't matter
yes, base64
nah base64 is too common
if people see the string they'll think "oh lets use base64 and check what it says" and that's what I need to avoid
And why is that a problem?
I agree the PlayerMoveEvent is not the best option, but I encounter this issue elsewhere too, so that's not the problem
as said, people will instantly assume it's base64
thx I'll take a look at some of them
MD5, SHA-1, SHA-2, Bcrypt
Ah i see. Just reverse the byte order
yeah that's probably the easiest solution lol
PDCs ? what do you mean?
PDC = "modern NBT"
anyone know why its saying username cannot be null?
heres the database loading string
mongoDataStore = new MongoDataStore(config.getString("database.ip"), config.getInt("database.port"), config.getString("database.password"), config.getString("database.database"), config.getString("database.user"));```
and also that it isnt null in the config
because username != user
You pass null to a method that doesnt allow null
?npe
npe when?
"database.username" != "database.user"
yeah it's always things like "username"/"user", "pass"/"password" etc lol
its always the smallest things u dont notice
yep lol
thats one thing i hate about coding you have to be really precise and exact with what your doing otherwise you arent going to get the results you desire
welp time to see if it explodes this time
imagine if you did not have to be precise
Does anyone know what conditions will prevent a player from applying the velocity they're given through Player#setVelocity?
and the program just kinda guessed
if only computers worked like that
hmm what should we do here. launch the nukes, dont launch the nukes hmmmmm
Thats why i threw away everything String based and just generate configs from classes.
This generates me like 200 lines of config
yea, i stopped using any systems that were String based as well
Friction. But you should change how you detect a player stepping on a pressure plate. Dont use the PlayerMoveEvent for that.
Smile are you good at designing apis? I kinda have a small issue if you’re interested 😅
make everything public static and just throw it at the user
Oh god
cause to actually be able to tell a computer exactly what to do you need a metric fuck ton of code
But sure 😄 what issue do you have?
So yeah Idk if you’re familiar with recent prs, but one of them added comment support, however they just added new methods to the interface ConfigurationSection etc, you know I have been working on this JsonConfiguration pr, and problem is, I have no idea how to deal with the comment contract such as ConfigurationSection::getComments. Do I just throw UnsupportedOperationException or what’s your thoughts?
Changed it to PlayerInteractEvent and checking if the action is physical. Same problem.
thats fun. just fun
Hm so either you create a common interface the two implementations can derive from. (With comment methods being exclusive to the yml implementation)
Or you make them fail fast.
I would prefer an UnsupportedOperationException over null values or empty collections being returned.
UUID.fromString()
Yeah I thought of having another interface, but wouldn’t that break existing api?
As I’d assume many devs use for instance
ConfigSection sec = plugin.getConfig();
sec.getComments();
[relying directly on ConfigurationSection]
Okay, can someone explain this to us?
When we use this command. All of the fireballs seem to change their velocity slowly towards the south.
This is the set velocity command we are using: fireball.setVelocity(player.getLocation().getDirection());
We are just at a lost as to what is happening...
I mean the methods dont change. The class just gets an additional interface or is abstracted from a class. I would have to think about how this
would change the bytecode and if it would break current usages.
Ah i see... ConfigSection is already the yml implementation
I mean... You could still write an AbstractConfigurationSection and let ConfigSection extend that
while having an additional JsonConfigSection...
just a quick question where would i put this?
In ur code
It looks like this issue occurs when (de)serializing.
MongoDB has several default serialization strategies for UUIDs. Look up on how you can enable one of them.
Oo that’s true
Holy shit
Genius
Thanks for enlightening me
🙏
you might need to use #setDirection as well i guess?
Okay
You should use the pre spawn consumer for that.
Fireball fireball = world.spawn(Fireball.class, location, ball -> {
ball.setVelocity(...);
ball.setYield(...);
});
Hello !
I'm holding a future mini-game server.
I have several game servers joinable, when a player clicks a special Item in the game menu, I want to loop through all game servers and get the name of the first that is not full (because a game is 16 players maximum) to tp the player in
My issue is, I don't know how to get the online players size in a server, I've searched on Internet but I didn't find anything
isnt there like Bukkit.getOnlinePlayers(); but I dont know what that returns so you might have to go onto the docs
Collection<? extends Player>
I want to access the number of players on all game servers from the Lobby server
@EventHandler
public void onPlayerSleep(PlayerDeepSleepEvent event){
Server server = getServer();
server.broadcast(new TextComponent(event.getPlayer().getName()+" is sleeping"));
}```
hey so im trying to send a message to all players when someone sleeps using a custom plugin however nothing happens, does anyone know why?
Did you register the listener
From different servers you might need to use plugin messages
how do i do that?
?event-api
Bukkit.getServer().getOnlinePlayers then loop through all of the players in that and send a message to them?
or not
Also I NEVER KNEW THERE WAS SOMETHING CALLED A DEEP SLEEP
lmao
this
bump
How can I make using a totem give you an effect? I have this code and they tell me that it doesn't work because the totem you are looking for is no longer in the inventory xD, and I have thought of other ways but I can't think of anything
Someone help me?
@EventHandler
public void totemMessage(EntityResurrectEvent event) {
if (event.getEntity() instanceof Player) {
Player player = (Player) event.getEntity();
if (player.getInventory().getItemInMainHand().getType() == Material.TOTEM_OF_UNDYING || player.getInventory().getItemInOffHand().getType() == Material.TOTEM_OF_UNDYING) {
for (Player all : Bukkit.getOnlinePlayers()) {
all.sendMessage(ChatColor.GRAY + "¡El Jugador " + ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + player.getName() + ChatColor.GRAY + " ha consumido un tótem!. Causa: " + player.getLastDamageCause().getCause());
p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 6000, 1));
Correct me if im wrong, but doesn't the event only get called when the entity has a totem?
there is no other way to resurrect an entity
nope it always gets called
it'll be cancelled if the entitiy didnt have a totem though
It’ll be cancelled if they don’t have a totem
A PlayerVelocityEvent tells me the first interact event applies a different velocity than what is seen in the code. The second event works perfectly fine. Any ideas why?
public void onPlayerInteract(PlayerInteractEvent event) {
if(event.getAction() == Action.PHYSICAL) {
Player player = event.getPlayer();
event.getPlayer().setVelocity(event.getPlayer().getLocation().getDirection().setY(2));
}
}
@EventHandler
public void onPlayerInteracat(PlayerInteractEvent event) {
if(event.getAction() == Action.LEFT_CLICK_AIR)
event.getPlayer().setVelocity(event.getPlayer().getLocation().getDirection().setY(2));
}```
Interact PHYSICAL occurs when a player tramples farmland, right?
I would assume so
turns out i didnt register it, it works now, got another question have do i change the style of messages? such as color,bold
If you’re using text components, you’ll probably want to use a componentbuilder and use their stylize methods.
Or do this, which, if I recall, requires a string, not a text component.
Which would mean you can use chatcolor codes.
ChatColor is doing nothing
It definitely won’t do anything if you’re using it in a text component. Hence the stylize methods.
ahh ok
server.sendMessage(new ComponentBuilder("test").color((ChatColor.AQUA)));
``` what part of this is wrong?
You need to call .create() at the end iirc
Also you need to make sure you are using the method that accepts components
create isnt showing up as a object.
also im getting ComponentBuilder is abstract; cannot be instantiated error.
delete new keyword
Hey, does anyone know how I can force a villager to move to a certain location?
I tried both the navigator method and also removing pathfinders
you would have to give it a new pathfinder goal
how can i run gradle shadowjar on intellij through the run button
I tried, but the villager seems to ignore pathfinders completely
Make it run a gradle script?
yes
Have you removed all other goals?
Yes
where did u get to that
array = new int[1000] or Arrays.fill(array, 0)
I could set the proxy instance you my own class that extends ProxyServer right?
Ping with answer
umm hi
can a zombie do the animations of the player?
can a giant do the animation of a zombie?
can you please show the sample code
also can you send the link of the docs of animations of entities
the sample code for entity doing some animation
I'm trying to put an org.bukkit.Location into a SortedMap but I'm getting
Caused by: java.lang.ClassCastException: class org.bukkit.Location cannot be cast to class java.lang.Comparable (org.bukkit.Location is in unnamed module of loader 'app'; java.lang.Comparable is in module java.base of loader 'bootstrap')
Entity animations aren’t covered by the api as far as I know
You’ll have to use packets I believe
why are u using a sorted map
Can't even see the code so can't even help
So they remain in a specific order
you can use linkedhashmap to maintain the insertion order
How can I set a block to vine, and have it only on one side of the block?
Example (example used glow lichen):
I have it so I can set it like show in the image below, but I want to set it like the rest of the wall
It’ll be using block data
I don’t remember what the data for vines is
MultipleFacing? Maybe
this one doesn't work, each time that I get the block it always returns CraftBlock not GlowLichen, or vine
You gotta get the block data
welp, I feel dumb for that one, time to investigate further into faces
okay, I can place it on a custom face, time to try to figure out how I can get the face that the player clicks
I'm going back to my code from like 6 months ago and trying to update it, I was using ProtocolLib for holograms and the following used to work but now it's erroring:
//metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class)), 32);
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer(true)), opt);
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class)), true);
//metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(15, WrappedDataWatcher.Registry.get(Byte.class)), 25);
packet.getWatchableCollectionModifier().write(0, metadata.getWatchableObjects());
packet.getIntegers().write(0, hologram.getHoloIDs().get(curHoloLine));
I completely forgot what these are and how they work, I don't even see documentation on them..anyone care to lend a hand?
Error: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Byte (java.lang.Integer and java.lang.Byte are in module java.base of loader 'bootstrap')
Specifically it's the commented out ones that are giving that error
I thought you were dead
Hey baby girl
have u passed me in dev yet
Is this from the project we were working on back in the day?
Hard to say, but I’m not nearly as retarded as I was before
nice nice
Ah, young love.
But I also haven’t really done jack shit in the last year or so
same kinda
Here's the protocol lib javadocs: https://ci.dmulloy2.net/job/ProtocolLib/javadoc/
Never worked with their stuff, but the error would at least indicate that Byte.class should probably be changed to Integer.class
class tree
Or perhaps cast the numerical parameters to bytes.
Whichever avoids an incorrect class cast.
I mean that made the error go away but its still not working
i also lost all these files during my windows 11 upgrade so this is all from a decompiled jar, which did a good job of decompiling into source code but
some things are slightly changed
Whats the best way to figure out what direction a vine is facing? It seems that the whole vine item type has been depreciated in 1.17
Decompilers tend to erase necessary casting, so probably cast the numerical params to bytes rather than changing the class to integer.
Hopefully it's just the decompiler's fault and not ProtocolLib changing.
@granite burrow get the block data, cast it to whichever interface handles directional block data, and you should be able to get the direction from that.
declaration: package: org.bukkit.block.data, interface: Directional
What do you know, it's just called Directional.
thanks ill look into it more thanks for the push 😄
Not a problem. Good luck.
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get((Class)Byte.class)), (Object)32);
This is what the decompiler gave me
God that is so gross
packets are gross
Gross.
declaration: package: com.comphenix.protocol.wrappers, class: WrappedDataWatcher, class: WrappedDataWatcherObject
im probably just stupid
https://ci.dmulloy2.net/job/ProtocolLib/javadoc/com/comphenix/protocol/wrappers/WrappedRegistry.html
declaration: package: com.comphenix.protocol.wrappers, class: WrappedRegistry
There's the most relevant documentation for it.
These docs aren't really helpful to be fair.
Idk where to even start on here like what am I even looking for
and why wont it let me cast to byte?
Are these for static holograms in the world?
Ah
I was going to recommend conceding and using holographic displays
worked perfectly fine before
You've cast 32 to an object, which means it's being autoboxed, so get rid of that cast.
metadata.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class)), 32);
Yeah that's my current
I removed the casts from the decompiler
Like clickable?
And casting 32 to (byte) doesn't fix it I take it.
Lowercase the b.
...bruh.
Rookie mistake.
sadge
Figures crossed that's all it was.
Congratulations on your holograms.
Send IP I want to harass you
Boring
In case you want free Minecraft hosting: https://blogs.oracle.com/developers/post/how-to-set-up-and-run-a-really-powerful-free-minecraft-server-in-the-cloud
I thought this was pretty cool when I read it. I've got a private SMP for just myself and my friends running on it 24/7.
^ In the context of "free" though.
I'm having trouble with BuildTools version 1.8.8 can anyone help please?
It doesn't matter if it's paid or free, but version 1.8.8 is a must for me.
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
@maiden path
Applying CraftBukkit Patches
Backing up NMS dir
Patching BiomeTheEndDecorator.java
Patching Block.java
Exception in thread "main" java.lang.RuntimeException: Error patching Block.java
at org.spigotmc.builder.Builder.lambda$main$2(Builder.java:644)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Iterator.forEachRemaining(Unknown Source)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.forEach(Unknown Source)
at org.spigotmc.builder.Builder.main(Builder.java:595)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
Caused by: difflib.PatchFailedException: Incorrect Chunk: the chunk content doesn't match the target
at difflib.Chunk.verify(Chunk.java:86)
at difflib.ChangeDelta.verify(ChangeDelta.java:78)
at difflib.ChangeDelta.applyTo(ChangeDelta.java:44)
at difflib.Patch.applyTo(Patch.java:43)
at difflib.DiffUtils.patch(DiffUtils.java:70)
at org.spigotmc.builder.Builder.lambda$main$2(Builder.java:632)
... 13 more
i really need help with this
Huh
Never seen that before
Have you tried wiping the folder and starting from scratch?
yes
Try wiping anything minecraft or spigot related from your .m2, resetting the build tools dir, and starting again
Wish I had a credit card for this
@EventHandler
public void PlayerRespawnEvent (PlayerRespawnEvent event) {
Player player = event.getPlayer();
for (Player pl : Bukkit.getOnlinePlayers()) {
if (pl.getWorld().getName().equals("world")) {
player.sendMessage(ChatColor.RED + "You Died...");
player.getInventory().addItem(new ItemStack(Material.DIAMOND));
}
}
}
i want give item when player respawn (after died), but this code not working
Why are you iterating over every player
And why are you checking if their world's name is "world"
You could just...
for (Player p : Bukkit.getWorld("world").getPlayers()) {
...
}```
But I still do wanna know why you're looping over all players to begin with
im using multiverse and just want run the event at "world"
@EventHandler
public void PlayerDeathEvent(PlayerRespawnEvent event) {
Player player = event.getPlayer();
for (Player pl : Bukkit.getWorld("world").getPlayers()) {
player.sendMessage(ChatColor.RED + "You Died...");
player.getInventory().addItem(new ItemStack(Material.DIAMOND));
}
}```
still not work it works!
Alright, so ive been working on trying to get where a vine is facing, however the only way I was able to get this information was through the deperciated Vine material. I tried to instance directional but it doesn't seem to comply with that either any ideas?
Im on 1.17 API
how do i set the colour of a particle
i've been to this wiki right here https://www.spigotmc.org/wiki/colored-particles/ but it doesnt work
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
only some particles can be coloured
is the redstone particle one of them?
yes
well it doesnt seem to want to
alr
p.spawnParticle(Particle.SPELL, newLoc.getX(), newLoc.getY(), newLoc.getZ(), 0, 0.4, 0, 0, 1);
i tried spell too
cuz redstone wasnt working
the wiki said it has to be -
how much u wanna spawn
p.spawnParticle(Particle.REDSTONE, location, am,0,-5,0,dust);
ill try with 1
dust = new DustOptions(Color.RED, 1.0F);
still doesnt work
how would that work?
just a single number is a colour?
Nah it’s this
Didn’t know you needed a float too
Probably
fun fact
if you dont organize your classes by their purpose
youll likely piss off a lot of java devs
You will for sure
time to start organizing alphabetically
hello how can I get which cardinal direction is a player looking?
anyone know how to align the particle with the players head
actually i think i know how
+1 on the y axis.
shouldnt it be 1.6
Player#getHeadLocation
@Override
public void run() {
for(PortalData i : PortalGunEvents.datas.values()){
i.getPlayer().getWorld().spawnParticle(Particle.REDSTONE, i.getBlue(), 3, 0, 0, 0, 0, new Particle.DustOptions(Color.BLUE, 10f));
i.getPlayer().sendMessage("this line has been run");
}
}
can anyone tell me why this code can do literally anything except spawn particles
the "this line has been run" line runs just fine
the particles from when you do the thing in the first place show just fine
im stumped
why is there 5 numbers
on the particle bit?
the 3 xyz values are not colour
idk but it seems to work just fine
for redstone
for the other one
its nothing to do with the particle line itself
its the same line as when u use the rod
actually maybe it is
let me see
ur not giving it a location bro
u put an extra 0
i figured it out
its putting the particle at the last possible place the location can be
i gotta fix that
You can always look at how the command works
how do i check the distance between 2 locations
how to put a fully filled cauldron with water
Distance squares function
Basic algebra
The location class has a distance func
Although it's pretty slow
Hi I am facing an issue, I want the cardinal direction that the player is facing but it is not working
I think there is a problem in this code and it isnt working as intended. can someone help me
int degrees = (Math.round(player.getLocation().getYaw()) + 270) % 360;
if (degrees <= 22) return "North";
if (degrees <= 67) return "Northeast";
if (degrees <= 112) return "East";
if (degrees <= 157) return "Southeast";
if (degrees <= 202) return "South";
if (degrees <= 247) return "Southwest";
if (degrees <= 292) return "West";
if (degrees <= 337) return "Northwest";
if (degrees <= 359) return "North";
return null;
}```
and then
```direction=getDirection(player);
player.sendMessage(direction);```
I am facing east but the direction detected is south
a.distance(b)
Hello 👋
private final HashMap<Player, Boolean> cooldown = new HashMap<>();
@EventHandler
public void onJoin(PlayerJoinEvent event) {
event.getPlayer().setAllowFlight(true);
cooldown.put(event.getPlayer(), false);
}
@EventHandler
public void onFly(PlayerToggleFlightEvent event) {
Player player = event.getPlayer();
if (event.getPlayer().getGameMode() == GameMode.SURVIVAL || event.getPlayer().getGameMode() == GameMode.ADVENTURE) {
event.setCancelled(true);
if (cooldown.get(event.getPlayer())) return;
event.getPlayer().setVelocity(event.getPlayer().getLocation().getDirection().setY(1));
player.playSound(player.getLocation(), Sound.WITHER_SHOOT,1.0f, 1.0f);
cooldown.put(event.getPlayer(), true);
}
}
@EventHandler
public void onMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
Location location = player.getLocation().clone();
if (cooldown.containsKey(player)) {
if (location.add(0, -0.1, 0).getBlock().getType().isSolid()) {
cooldown.put(player, false);
}
}
}
@EventHandler
public void onGamemodeChange(PlayerGameModeChangeEvent event) {
if (event.getNewGameMode() == GameMode.SURVIVAL || event.getNewGameMode() == GameMode.ADVENTURE) {
event.getPlayer().setAllowFlight(true);
}
}```
I have wrote this code for a doublejump function
but I have a problem: If I keep spamming my space key the player will just do a little jump in the air (like a 0.1 block jump)
so smth with the cooldown ist wrong, could some1 help me?
so its smth with the PlayerToggleFlightEvent?
so I have to reduce setY()?
nope
if (cooldown.get(event.getPlayer())) return; you see that line?
make it into
if (cooldown.get(event.getPlayer())) {
event.getPlayer().getLocation().setY(event.getPlayer().getLocation().getY() - .1);
return;
}
try that
oh
also i suggest you use your player object
rather than event.getPlayer
as you already have that
okay 👍
1min :)
Player player = event.getPlayer();
if (player.getGameMode() == GameMode.SURVIVAL || player.getGameMode() == GameMode.ADVENTURE) {
event.setCancelled(true);
if (cooldown.get(player)) return;
player.setVelocity(player.getLocation().getDirection().setY(1));
player.playSound(player.getLocation(), Sound.WITHER_SHOOT,1.0f, 1.0f);
cooldown.put(player, true);
}
```that's a bit better
umm
now I can fly like i am in gamemode 1
but I am in gamemode 0
@EventHandler
public void onFly(PlayerToggleFlightEvent event) {
Player player = event.getPlayer();
if (cooldown.get(player)) {
player.getLocation().setY(event.getPlayer().getLocation().getY() - .1);
return;
}
if (player.getGameMode() == GameMode.SURVIVAL || player.getGameMode() == GameMode.ADVENTURE) {
event.setCancelled(true);
if (cooldown.get(player)) return;
player.setVelocity(player.getLocation().getDirection().setY(1));
player.playSound(player.getLocation(), Sound.WITHER_SHOOT,1.0f, 1.0f);
cooldown.put(player, true);
}
}```
currently thats my event
no no no
whats wrong? :o
np
okay, now I can doublejump again but I can still "hover" when I keep spamming the spacebar
show me what you did
public class DoubleJump implements Listener {
private final HashMap<Player, Boolean> cooldown = new HashMap<>();
@EventHandler
public void onJoin(PlayerJoinEvent event) {
event.getPlayer().setAllowFlight(true);
cooldown.put(event.getPlayer(), false);
}
@EventHandler
public void onFly(PlayerToggleFlightEvent event) {
Player player = event.getPlayer();
if (player.getGameMode() == GameMode.SURVIVAL || player.getGameMode() == GameMode.ADVENTURE) {
event.setCancelled(true);
if (cooldown.get(player)) {
player.getLocation().setY(event.getPlayer().getLocation().getY() - .1);
return;
}
player.setVelocity(player.getLocation().getDirection().setY(1));
player.playSound(player.getLocation(), Sound.WITHER_SHOOT,1.0f, 1.0f);
cooldown.put(player, true);
}
}
@EventHandler
public void onMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
Location location = player.getLocation().clone();
if (cooldown.containsKey(player)) {
if (location.add(0, -0.1, 0).getBlock().getType().isSolid()) {
cooldown.put(player, false);
}
}
}
@EventHandler
public void onGamemodeChange(PlayerGameModeChangeEvent event) {
if (event.getNewGameMode() == GameMode.SURVIVAL || event.getNewGameMode() == GameMode.ADVENTURE) {
event.getPlayer().setAllowFlight(true);
}
}
}
mhm that's correct
could my sever version be the problem? I am using 1.8.8 lol
try increasing the amount you subtract by?
I increased location.add(0, -0.1, 0) to 0, -1, 0 now I cant spam it that much, it will do a little jump like 2 times a second
sadly its still the same :o
sadge
yeah
I had this problem like 6 months ago but back then my Java knowledge was very bad
now I tried to fix it but no xd
the weird thing is: Back then the exact same code worked just fine for other people
maybe there is smth wrong with my build?
what does it mean when an entity is marked for removal?
How can I get the UUID of an offline Player?
maybe this?
well
I have the name of a player
but I need to get the UUID of the player
even if he is offline
you know how to stream an array?
no
https://bukkit.org/threads/uuid-of-offline-players.351874/ this might help
OfflinePlayer::getUniqueId is guaranteed to work
however OfflinePlayer::getName can still return null
thanks you 2, I'll try it
Can Bukkit.getLogger() be used instead of Plugin.getLogger() or I have to adapt my static methods to Plugin.getLogger()? 🤔
you should use the logger provided by the plugin
That it’s dead and will be removed from the world
What were you even trying to do?
Double Jump?
yes
That’s a bad approach
Just use Player#setVelocity
But the problem in your code is in the MoveEvent
HashMap<Player, Boolean> should just be a HashSet<UUID>
Map<T, Boolean> rarely makes sense as its already a binary state: present or not
public class DoubleJump implements Listener {
private final HashSet<UUID> cooldown = new HashSet<>();
@EventHandler
public void onJoin(PlayerJoinEvent event) {
event.getPlayer().setAllowFlight(true);
cooldown.add(event.getPlayer().getUniqueId());
}
@EventHandler
public void onFly(PlayerToggleFlightEvent event) {
Player player = event.getPlayer();
if (player.getGameMode() == GameMode.SURVIVAL || player.getGameMode() == GameMode.ADVENTURE) {
event.setCancelled(true);
if (cooldown.contains(player.getUniqueId())) {
player.getLocation().setY(event.getPlayer().getLocation().getY() - .1);
return;
}
player.setVelocity(player.getLocation().getDirection().setY(1));
player.playSound(player.getLocation(), Sound.WITHER_SHOOT,1.0f, 1.0f);
cooldown.add(player.getUniqueId());
}
}
@EventHandler
public void onMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
Location location = player.getLocation().clone();
if (cooldown.contains(player.getUniqueId())) {
if (location.add(0, -0.5, 0).getBlock().getType().isSolid()) {
cooldown.remove(player.getUniqueId());
}
}
}
@EventHandler
public void onGamemodeChange(PlayerGameModeChangeEvent event) {
if (event.getNewGameMode() == GameMode.SURVIVAL || event.getNewGameMode() == GameMode.ADVENTURE) {
event.getPlayer().setAllowFlight(true);
}
}
}```
Still the same
Still the same
?
shit wrong reply
I hate discord replies
@torn vale what exactly is your question?
I have wrote this doublejumo code (as you can see)
but if I keep spamming my spacebar I hove through the air
like I jump up 0.1 Blocks per jump when im in the air
yk?
yeah that makes sense, since you only remove the player from the map/list if the block 0.5 below them is solid
what should I do instaed?
tbh I don't think you can properly allow double jump at all
so what?
as said, in my opinion you'll have to think of this idea like "kannste net machen, weil... det geht einfach net" :/
hmm okay
at least you can't do it properly since the client simply doesn't send a "player pressed space" packet
abusing the fly mode for this will probably lead to many more problems that you can't fix
the ONLY thing I could think of is making users require other keys like Q ( drop key ) to double jump
because you can actually listen to that key being pressed
but you can't do so for space being pressed mid-air
okay, tyvm
I might be wrong, of course
maybe it is indeed possible without problems, but I doubt it
👍
if you indeed find another way, pls ping me, I'd love to know too 🙂
Okay :)
the best way to do it is through abusing flight, which you're doing yes (unless you put an item in the players inventory that does it), but the vector maths you're using wont get people very far
whats the current issue? is the force just not great enough?
The force is just fine but if I keep spamming my spacebar in midair I will just keep hovering through the air (I do smth like 0.1 block jumps)
its kinda difficult to explain
it disables and enables like 5 times a second so I can spam my spacebar to float in the air
are you able to join my server? There I can show it to you, its kinda difficult to explain it
not currently, could you record it and send it to me?
that looks more like your cooldown script if anything
yeah you do something when the player is on cooldown in the flight event
whats that supposed to do
some1 here told me to add this to my code, idk tbh
do you want to be able to hover like that or is it just a double jump?
replace your event with this and see if it changes anything
@EventHandler
public void onFly(PlayerToggleFlightEvent event) {
Player player = event.getPlayer();
if (player.getGameMode() == GameMode.SURVIVAL || player.getGameMode() == GameMode.ADVENTURE) {
event.setCancelled(true);
if (cooldown.contains(player.getUniqueId())) {
// player.getLocation().setY(event.getPlayer().getLocation().getY() - .1);
return;
}
player.setVelocity(player.getLocation().getDirection().setY(1));
player.playSound(player.getLocation(), Sound.WITHER_SHOOT,1.0f, 1.0f);
cooldown.add(player.getUniqueId());
}
}
(i.e just commenting out that part that does the other velocity thing)
Now I can spam my double jump There isnt a cooldown anymore
OH, no hang on
there
just comment out the other velocity not the entire thing
im half asleep clearly
see if that fixes anything
I am still able to hover and sometimes I can do a second double jump in the air
hovering in the same way?
It feels like I have a bigger cooldown between my hover jumps now but I am not sure
is it still doing it the same way though?
like
last time before you commented out that line it was doing this https://gyazo.com/f809a4866b521597f54fb23c2f4b2a5f
the red squares are jumps
it was adding a smaller velocity that was still allowing you to jump midair on cooldown
which would mean the big initial wouldnt happen again because it was returning
yes
yes but now sometimes (like every 3-4 double jumps from the ground) the initial happens two times
Bump
so you're still getting that slope?
yes
Depends on what version you are on
Also test with something other than a pressure plate too.
@SneakyThrows
public void writeData(DataModule dataModule) {
Gson builder = new GsonBuilder().setPrettyPrinting().serializeNulls().create();
FileWriter writer = new FileWriter(configFile);
writer.write(builder.toJson(dataModule.getPlayerHomes())); // this is line 26
writer.close();
}
&
public class DataModule {
private HashMap<UUID, List<HomeModule>> playerHomes = new HashMap<>();
public HashMap<UUID, List<HomeModule>> getPlayerHomes() {
return playerHomes;
}
this happens
at com.google.gson.Gson.toJson(Gson.java:618) ~[gson-2.8.8.jar:?]
at me.rephrasing.sethomes.config.ConfigManager.writeData(ConfigManager.java:26) ~[sethomes-1.0-SNAPSHOT.jar:?]
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private java.lang.Object java.lang.ref.Reference.referent accessible: module java.base does not "opens java.lang.ref" to unnamed module @2006863f
using java 16
I want to say the way you're calculating when the cooldown finishes is the problem (your way of seeing if a player has hit the ground)
SneakyThrows 👀
could you put a print when the cooldown is removed so you know when its actually being removed vs when we think its being removed
how should I do it instead?
Print it here, right?
im too tired to remember if air is considered solid, I know there is a stupid item that is solid cant remember which
just under that remove yeah
Show your HomeModule class
also you do know that Location#subtract is a thing?
Using the latest version. Will test with different physical events soon
@Getter
@Setter
public class HomeModule {
private String name;
private Location location;
HomeModule(String name, Location location) {
this.name = name;
this.location = location;
}
}
is it the location part
oh, yes
You need to register an adapter for the Location class
it prints when I hit the ground
and if you keep jumping and doing the floaty thing, it doesnt fire at all then?
yes
how can i do that? like a method that takes location returns a writable string describing the location?
yes it does or no it doesnt?
and a method thats vice versa
