#help-development

1 messages · Page 576 of 1

noble lantern
#

theyre like a chest

hallow jackal
#

If that were the case casting it to Sign would work, but it does not

noble lantern
hallow jackal
#

It also raises an error in console

noble lantern
#

ah wait

#

sec

#

check if the block is a TileEntity

#

if tile entity instance of sign

hallow jackal
#

That's what I've been trying but my ape brain cannot figure out how to go from BlockData to BlockState

wet breach
#

Blockdata should have a method to get blockstate

hallow jackal
#

If there is I can't find it

#

Block does have said method tho

noble lantern
#

you can create an empty one

#

not sure if thats what you rly want tho

wet breach
#

Yeah well not sure how you have blockdata without having a block instance to begin with

hallow jackal
#

i was looking for a getBlockState

wet breach
#

But yeah burchard beat me to it

#

But i am on a phone so lol

noble lantern
#

:p

hallow jackal
#

i'll try that and report back

noble lantern
#

i need to push this update

wet breach
noble lantern
#

now that you mention it this fork join pool only has one worker

hallow jackal
#
BlockData imaginarySign = Material.OAK_SIGN.createBlockData();
event.getPlayer().sendBlockChange(playerLocation, imaginarySign);
event.getPlayer().openSign((Sign) imaginarySign.createBlockState());

Raises this: java.lang.IllegalArgumentException: Sign must be placed

Player#openBook does not seem to like fake signs i'm afraid

wet breach
#

I said a sign needs to be placed and that api method only works on first placing of a sign lol

#

It will take time for api to change and update for 1.20 features

hallow jackal
#

openSign isn't a 1.20 feature i believe

#

it's an open sign editor packet under the hood if i'm not wrong

#

either way

#

protocollib time it is then

wet breach
#

As been told earlier

#

The only time you could edit signs with the api from player instance was when the sign was first placed to open that sign editor window

#

But since signs can be re editted now, we should expect the api to change and allow for the sign editor to open at any time uwu

hallow jackal
#

isn't that what Player#openSign does in the first place?

kind hatch
#

It’s supposed to

wet breach
#

It opens the sign editor but as i said the protocol didnt allow the sign editor to open again for said player and sign once it was closed

#

It doesnt stop plugins from editing the sign, but players however would need to destroy the sign and place it again to open that editor again same is true through the api

#

But 1.20 i guess changes that

#

But we would need to wait for spigot api to update to make use of it as well

eternal night
wet breach
#

I should go start testing some 1.20 features out

eternal night
#

I am confused as to what API is missing KEKW

wet breach
eternal night
#

I mean, openSign sends those packets

#

iirc on spigot it forgets to set the allowed player uuid

#

but beyond that, it should function

wet breach
#

Well never hurts to check implementation. Just because the api methods are there doesnt necessarily mean they work as it should lol

eternal night
#

handle.setAllowedPlayerEditor(player.getUniqueId()); // Paper KEKW

#

this one might be the problem rn

#

as I guess it is missing on spigot

wet breach
#

Its not hard to patch something to make it work without really updating it accordingly

eternal night
#

but is required for the server to allow re-edit

somber scarab
#

may someone help me understand what I need to do to use another plugin's API in mine?

#

I ma lost.. I know I need to add a repo and a dependency in POM but where do I get the infor in there from? And is changing hte POM all what I need?

wet breach
remote swallow
somber scarab
#

okay..

wet breach
#

You can also install the dependency to local repo too

#

Under whatever name you want

somber scarab
#

ahh this is weird

wet breach
#

Downside of this is that if you push this say to github anyone who tried to compile wouldnt be able to auto download that dependency

wet breach
somber scarab
#

cuz I wanna make 2 worlds and customize them. then use world edit to do some copy pasting

remote swallow
somber scarab
#

ahh thank you

#

how did u find that??

remote swallow
#

search up the plugin, find its github, check read me, wasnt there so checked the wiki and found it

hallow jackal
somber scarab
#

thanks alot

hallow jackal
#

BlockData#createBlockState() is not listed in the 1.19.4 api docs btw

wet breach
#

Anyways have work to go do. Be back some time later lol

hallow jackal
#

np, ty for your efforts 🫡

somber scarab
#

IS MY SERVER GETTING HACKED???

#

21.06 06:15:06 [Server] [INFO] at com.nickuc.login.ζΠΨθμδμθγκΣηω.b(:83) ~[?:?]
21.06 06:15:06 [Server] [INFO] at com.nickuc.login.ζΠΨθμδμθγκΣηω.a(:75) ~[?:?]
21.06 06:15:06 [Server] [INFO] at com.nickuc.login.ςμκΔΣιζρΛξΨιθφΠ.c(:204) ~[?:?]
21.06 06:15:06 [Server] [INFO] at com.nickuc.login.ςμκΔΣιζρΛξΨιθφΠ.run(:138) ~[?:?]
21.06 06:15:06 [Server] [INFO] at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:82) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3790-Spigot-ddcbdcc-b2322fe]
21.06 06:15:06 [Server] [INFO] at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[spigot-1.20-R0.1-SNAPSHOT.jar:3790-Spigot-ddcbdcc-b2322fe]
21.06 06:15:07 [Server] [INFO] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
21.06 06:15:07 [Server] [INFO] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
21.06 06:15:07 [Server] [INFO] at java.lang.Thread.run(Thread.java:833) ~[?:?]
21.06 06:18:59 [Disconnect] User /20.4.48.76:51286 has disconnected, reason: Disconnected
21.06 06:22:49 [Disconnect] User /20.4.48.76:48822 has disconnected, reason: Disconnected
21.06 06:26:29 [Disconnect] User /20.4.48.76:41250 has disconnected, reason: Disconnected
21.06 06:30:19 [Disconnect] User /20.4.48.76:43870 has disconnected, reason: Disconnected
21.06 06:34:13 [Disconnect] User /20.4.48.76:44026 has disconnected, reason: Disconnected
21.06 06:38:07 [Disconnect] User /20.4.48.76:51936 has disconnected, reason: Disconnected
21.06 06:41:58 [Disconnect] User /20.4.48.76:53276 has disconnected, reason: Disconnected

#

WTF IS ζΠΨθμδμθγκΣηω.b

remote swallow
#

obsfucated class name

somber scarab
#

okay... <,<

#

im hosting a server for lgbt and other minorities, so it's not unlikeyl someone might wanna destroy it or crash it

dawn hazel
somber scarab
dawn hazel
#

Yeah your safe

#

I’m pretty sure that plugin is a payed plugin

#

So unless u cracked it u should be safe lol

somber scarab
dawn hazel
#

Hmm

#

You probs still are safe

#

Usually only payed plugins that obfuscate their classes

somber scarab
#

yeah ik just dont what that error is....

#

it just started today

remote swallow
#

report it to the dev ig

somber scarab
#

but i didnt update or change anything

dawn hazel
#

What error?

somber scarab
remote swallow
#

nlogin

somber scarab
remote swallow
somber scarab
#

oh wait it says this..
21.06 06:15:06 [Server] Craft Scheduler Thread - 82/[ERROR] [nLogin] Failed to spoof start packet for cuute

#

cuute isnt logged in my player history

#

ah fuck it.. ill deal with that later

remote swallow
#

you running bungee?

somber scarab
#

spigot

#

why im here

remote swallow
#

we do bungee dev and server support here too

somber scarab
#

oh cool..

remote swallow
#

i was gonna guess it'd be someone trying to spoof their name to an unshielded backend

remote swallow
#

bad

somber scarab
#

ah.. they also had a VPN from the netherlands

remote swallow
#

if you do end up using bungee make sure the backend servers arent accesable from outside or use bungeeguard

somber scarab
#

okay... ill just stick with spigot i guess

#

im getting an error with maven is trying to resolve dependancies

#

says com.onarandombox.multiversecore:Multiverse-Core:jar:4.3.1 was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt.

remote swallow
#

?paste ur pom

undone axleBOT
somber scarab
#

okay

#

thing is.. it's using the wrong repo to get the wrong dependency

remote swallow
#

you using intellij?

somber scarab
#

yes

remote swallow
#

reload maven

somber scarab
#

i did

#

that happened after the reload

remote swallow
#

ah

#

would love to know why its not searching the others while its deffo on the last one

somber scarab
#

id post pics but this fucko @undone axle insists on treating me like trash

remote swallow
#

very much a cafebabe moment

somber scarab
#

!verify BlueNova_123

undone axleBOT
#

This account is already verified!

somber scarab
#

FUCK YOU

remote swallow
#

email support or something

somber scarab
#

?support

#

?support

undone axleBOT
somber scarab
remote swallow
#

dont bully cafebabe

#

shes in all ur jars

somber scarab
#

<.<

remote swallow
#

shes the first 4 bytes of every class file

somber scarab
#

lmao jar

#

🫙

#

that's deff the correct repo....

#

idk wtf

#

oh

remote swallow
somber scarab
#

it worked when i used the force snapshots flag i nthe command

somber scarab
remote swallow
#

im gonna say it'll be the artifact id of the dep

somber scarab
#

but in plugin.yml is just WorldEdit

remote swallow
#

it depends what they put in plugin.yml as the name

somber scarab
#

i found it

#

okay now lets download the plugin..

noble lantern
#

again another moment of stupidity right here wondering wtf is going on only to realize im making my entire forEach async instead of making each index async smfh Facepalm

#

"why dis all on worker"

sage dragon
#

Hey!

I'm currently working on a small quest system.

I need to check how much the player recieves when breaking a plant.

I tried this:

e.getBlock().getDrops(e.getPlayer().getInventory().getItemInMainHand(), e.getPlayer())

But for some reason, it only outputs 1 as the amount.
It works just fine with ores, so I thougth it would do the same for crops.

Is there something special for crops?

somber scarab
#

ye crops only always drop one.

sage dragon
#

But what the player actually recieves is not just one - Especially with Fortune 🤔

remote swallow
#

block drop item event

somber scarab
#

o.

remote swallow
echo saddle
#

what is best method to get NBT data from itemstack these days?

remote swallow
#

nbt-api

sage dragon
somber scarab
#

Weird question, how do you get to code plugins as a job?

#

it's interesting.. is it just "make a hit paid plugin"?

remote swallow
#

make some free plugins, update them, keep people happy and make sure stuff looks good, make a few of them and people see you as a talented dev and would pay you

somber scarab
#

hm aight interesting

echo saddle
#

is there a way to get the NBT data without using a third party plugin?

remote swallow
#

nms

echo saddle
#

ok, so if i'm using nms to extract the nbt from an itemstack, how to i get it into a string using mojang mappings

remote swallow
#

one min

#
net.minecraft.world.item.ItemStack nmsCopy = CraftItemStack.asNMSCopy(ItemStack);
CompoundTag tag = nmsCopy.getTag();
String tagAsString = tag.toString();
echo saddle
#

Right and that worked fine for reading, but i can't figure out how to put a string to CompoundTag.

remote swallow
#

just as data saving?

echo saddle
#

I'm able to do before without the mappings using MojagsonParser.a(string)

#

as in convert nbt string into a CompoundTag

remote swallow
#

lol

#

screamingsandles is down

#

oh wait it isnt

noble lantern
#

anyone know what thread Executor this is?

somber scarab
#

@remote swallow okay never mind.. maven shut up but I cant seem to use Multiversecore in my code.

#

its known class

#
MultiverseCore core = (MultiverseCore) Bukkit.getServer().getPluginManager().getPlugin("Multiverse-Core");
somber scarab
remote swallow
#

does it allow you to import it

somber scarab
#

Cannot resolve symbol 'MultiverseCore'

echo saddle
#

that's exactly what I was looking for! Thanks epic

somber scarab
#

no

remote swallow
#

hover over it and see if an "Import class" appears

somber scarab
#

its known

#

only says create class of name

#

'multiversecore'

remote swallow
#

invalidate caches

#

File > invalidate caches

somber scarab
#

already doing it

#

wait

somber scarab
remote swallow
#

im gonna guess its failing to add the dep somehow

somber scarab
#

that made it stop whining but the lib isnt there still

#

weird

remote swallow
#

one min

#

ill open ij

somber scarab
#

I can see multiverse in my resolved dep list

#

i wish i could send pics

#

can i send them in dms?

remote swallow
#

sure

echo saddle
#

is there an equavalent for NBTTagList?

remote swallow
#

ListTag

echo saddle
#

thanks

remote swallow
#

feature was added

hallow jackal
#

Which PacketContainer methods do I need to use in order to fill the two fields required for this packet?

#

I can't decypher protocollib's docs

wet breach
somber scarab
buoyant viper
#

never used protocollib so thats a fat shot in the dark from a quick glance at its wiki and javadocs

wet breach
#

You sometimes need to grab the datawatcher too

ocean hollow
#

how can i use particles to make a line from one player to another in the form of a parabola? I don't know math

wet breach
#

You need math

ocean hollow
#

like that

wet breach
#

Circle math too

#

Time to break out them pi's

timber prawn
#

Heyo! I am messing around with projectile vectors and I have come to a screeching halt when trying to figure out when an arrow has either stopped moving (hit a wall) or it has hit a entity. My thought was to do .getVelocity of the projectile and try to compare it to 0 but I haven't gotten any results.

ocean hollow
wet breach
#

No you are not

timber prawn
timber prawn
ocean hollow
#

this is 3d

wet breach
#

Well use a global boolean that can be set from projectile hit event that can be checked from your code

timber prawn
tender shard
# remote swallow feature was added

yeah they answered the github issues on the same day, both answers basically were "yeah it's already added but not on the website yet" lol

remote swallow
#

lol

wet breach
#

Your checks have to be in some kind of runnable or loop anyways. So it shouldnt be that hard to check a boolean at some point to see if it is set

wet breach
quaint mantle
#

o bello, mi serve un favore, rendi Open Source tutte le risorse Premium, altrimenti altrimenti ti faccio trovare gli amichetti sotto casa

orchid trout
hallow jackal
#

fixed it, getBlockPositionModifier() & getBlockData() were the appropiate getters respectively

#

if someone could explain me why getModifier didn't work i'd really appreciate it!

orchid trout
#

oh boy, I need a favor, make all the Premium resources Open Source, otherwise I'll let you find your friends at home

remote swallow
#

yeah, it doesnt make sense

orchid trout
#

i blame google translate

hushed scaffold
#

how would i hide the player fully including their armor , held items etc?

#

i tried player.setinvisible but that just hides the player , not their armor too

#

i saw p.hideplayer but intelij screams at me for it being deprecated

buoyant viper
#

could be wrong

hushed scaffold
#

so it would work?

buoyant viper
#

or theres a /better/ method (i think its the one that takes in a plugin argument)

#

should work :p

echo saddle
#

is there an equavalent for NBTCompressedStreamTools that takes CompoundTag?

hushed scaffold
#

i try the top one , it still says deprecated

hushed scaffold
somber scarab
buoyant viper
#

an instance of your plugin ^

#

?di for ways to provide one

undone axleBOT
somber scarab
#
public static FloorIsLava plugin;

    @Override
    public void onEnable() {

        this.plugin = this;
    }
remote swallow
#

smh

#

di is better, only use singleton if you cant pass it about

somber scarab
#

save all bred mobs somewhere

#

and compare

#

once a mob spawns, it stores no way of how it has been spawned

eternal oxide
#

add a flag to PDC on mob I guess?

echo saddle
#

nbtio

sharp kayak
#

How to teleport a player to the center of a block?

somber scarab
remote swallow
#

add a 0.5, 0, 0.5 vector to the location

eternal oxide
#

?pdc

sharp kayak
somber scarab
#

add 0.5, 0, 0.5 vector to the location

sharp kayak
#

still the player gets teleported to a corner instead of the centre

sharp kayak
#
Location playerLoc = p.getLocation();
playerLoc.add(0.5, 0, 0.5);
p.getWorld().setSpawnLocation(playerLoc);
somber scarab
remote swallow
#

try p.getWorld().setSpawnLocation(playerLoc.add(0.5, 0, 0.5)) instead

somber scarab
#

the player doesnt necessarily have to always be standing on the corner of a block

#

ur just moving the player's position by 0.5 x and z

somber scarab
sharp kayak
#

nvm i tried adding the vector to the location while teleporting, it works

remote swallow
#

if you do the adding route id recommned calling the #zero method

remote swallow
sharp kayak
#

ill look into it thx

remote swallow
#

zeros the location, so removes the decimals so you always get the center

remote swallow
#

i just checked it

#

i got the meaning that it remove decimals, not just setting the locaton to 0

eternal oxide
#

a block center is 0.5,0,0.5

#

zero would return a corner

remote swallow
#

yeah

#

you zero then add, so you dont add 0.5 to a like 0.3

eternal oxide
#

ah ok

remote swallow
#

but zero doesnt do what expected

eternal oxide
#

no, its an odd method

#

not sure why it exists on a location

remote swallow
#

yeah

eternal oxide
#

on Vector it has a use

buoyant viper
#

wack

wraith bane
#

I am using the following (every tick) to fake players glowing:

public static void applyPlayersGlow(List<Player> receivers) {
      if (receivers.isEmpty()) return;

      ProtocolManager pm = ProtocolLibrary.getProtocolManager();
      PacketContainer packet = pm.createPacket(PacketType.Play.Server.ENTITY_METADATA);

      List<WrappedDataValue> dataValues = Lists.newArrayList();
      dataValues.add(new WrappedDataValue(0, WrappedDataWatcher.Registry.get(Byte.class), (byte) 0x40));
      packet.getDataValueCollectionModifier().write(0, dataValues);

      for (Player receiver : receivers) {
          for (Player player : Bukkit.getOnlinePlayers()) {
              if (receiver.getUniqueId().toString().equalsIgnoreCase(player.getUniqueId().toString())) continue;

              PacketContainer copiedPacket = packet.deepClone();
              copiedPacket.getIntegers().write(0, player.getEntityId());

              try {
                  pm.sendServerPacket(receiver, copiedPacket);
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }
  }

Having this function be called on a player causes that player darkness effect to "reset" and restart it's animation every time the packet is sent

#

Any idea how to fix this issue?

eternal oxide
#

Why not just use Teams and setGlowing(boolean)?

echo saddle
#

is there any other way to get the nbt data from an itemstack, other than NMS copy using CraftItemStack?

smoky anchor
#

ItemMeta ?
What NBT are you trying to get and why ?

echo saddle
#

I'm just wondering because seems like the import for CraftItemStack version dependent

smoky anchor
#

yes, that it is
Also you can serialize the itemstack to get all the data

remote swallow
#

nbt-api or multimodule nms stuff

echo saddle
#

suppose it's fine. perhaps its better to allow different cb versions, for the nms interface in order to allow more than one version implementation in the jar

#

but the remapper I'm using doesn't support different versions for the same gradle project, so would have to figure that part out to support multiple versions

#

is there a way to get the CompoundTag from an entity?

hazy parrot
#

Why do you need it

#

Why not use pdc

eternal oxide
#

why do you feel you need to use nms on itemstacks at all?

echo saddle
#

because its easier to port code that to rewrite

eternal oxide
#

not usually

echo saddle
#

and this question is about entities

eternal oxide
#

what specifically are you using nms for?

echo saddle
#

everything that wasn't supported in versions since 1.8

#

this code is legacy, so basically the nms is legacy

#

surely most of it now has other means to handle

#

but in this case, i'm setting nbt for leash data

eternal oxide
#

precisely why I'm askign what specifically are you using nms for. There are replacements now

echo saddle
#

and at the time this plugin was written, there was not much support

eternal oxide
#

use teh API when you can

echo saddle
#

because it's 3am, and I would rather find an equivalent method, rather than spend hours rewriting

shadow night
#

How can I change the player skin?

echo saddle
#

not to mention the time and effort to do a full retest of all functionality

eternal oxide
#

I'll keep driving my horse and cart because it's how I've always done it. Doesn;t matter that cars and planes exist now.

echo saddle
#

so, my choices are not to update at all, because I really don't have time to rewrite it now, or put out an update based on same code

#

alright, well, guess i'll leave this plugin using obfuscated nms then

timid hedge
#

Permission: eat Cooldown: '5

tender shard
#

Theres a ' in front of the number

trail coral
#

i spent 6 fucking hours making gui handler classes yesterday 😭

remote swallow
trail coral
wraith bane
trail coral
wraith bane
#

What the warden gives (similar to blindness)

crude sleet
#

Hey, i want to start code some projects. I stopped with Spigot 1.17.

I used BuildTools to generate 1.19 spigot jar but if i import it to eclipse, its not working. I cant import org.bukkit.plugin.JavaPlugin but with my OLD jars (1.16 etc) it works.
Is the jar compiled differently meanwhile?

remote swallow
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

remote swallow
#

maven/gradle is easier

trail coral
wraith bane
ocean hollow
#

how can i make the player prone? (swimming animation)

eternal oxide
remote swallow
crude sleet
wraith bane
crude sleet
trail coral
eternal oxide
echo saddle
#

you want to run BuildTools.jar with the --compile craftbukkit,spigot options to get the jars that you can use in your dependencies like the spigot-api.

eternal oxide
#

no you don;t

remote swallow
#

if you want to use nms without a build system i pray for your sanity

eternal oxide
#

you shoudl not use --craftbukkit switch on buildtools and current versions anymore

#

?nms if you need to use nms

wraith bane
echo saddle
#

and the reason is?

trail coral
noble lantern
wraith bane
#

Yea exactly, that's the only way I could help him

eternal oxide
#

I do it by hand 😉

#

always have

noble lantern
#

menace

#

i could never remember the first line of a pom.xml

eternal oxide
#

It literally takes under a minute to create a blank plugin by hand

noble lantern
#

i just cant be bothered to remember this point, thats why i use the plugins CH_Kek

echo saddle
#

eww, xml

eternal oxide
#

yeah I just copy/paste it 😉

humble tulip
#

How do i create a maven archetyoe?

#

I basically wanna create a multi module project template

eternal oxide
#

I've never messed with archetypes

#

I remember mfnalex was playing about with them and bitching a lot 🙂

tender shard
tender shard
#

it's just annoying to write them

#

using them is great, though

tender shard
#

basically you just put all the files you want to be generated into src/main/resources/archetype-resources

ocean hollow
#

how can i make the player prone? (swimming animation)

timid hedge
tender shard
#

a string is not an integer

#

so getInt("Cooldown") returns 0

#

and 0 * 60 * 1000 is 0

timid hedge
#

So how do i make it to not a string if you know what i mean

tender shard
#
Cooldown: 5
timid hedge
#

But i mean ion the code
Can i do so there isnt 'quotes'

#

Fixed

somber scarab
#

IM VERIFIED

#

it only took me getting kicked and thinking i got banned

humble tulip
#

Lmfao

somber scarab
#

@wet breach IT WORKEDD!!!!

#

(partly)

wet breach
somber scarab
wet breach
#

Well its a small issue

somber scarab
#

when I copy an area, there's not enough memory to copy it and paste it

#

on the void world

trim creek
#

Give more mem to the server or use disk instead of RAM.

somber scarab
#

I get by copying about a few tens of y layers

wet breach
#

Yeah will have to do it in chunks

#

Not hard to accomplish though

somber scarab
#

it doesnt crash

#

i mean

#

manually using the plugin

#

not the API

remote swallow
#

?distro

#

?workdistro

somber scarab
#

wtf even is this

vast ledge
#

a distro

somber scarab
#

ngl it looks sexy as fuck in the video when he loads all that stone

somber scarab
#

but it looks so complicated <.<

wet breach
#

Perfect timing

somber scarab
#

for wat...

wet breach
#

Between me putting the disco gif and your comment uwu

somber scarab
#

ah..

wet breach
#

I was going to make a joke with the distro thing but your comment is better

timid hedge
#

When i am using /preload the cooldown isnt getting updated its only updating when im using the /reload command

PreloadCommand:

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        Player player = (Player) sender;
        Config.reload();
        player.sendMessage("You have reloaded the config");


        return true;
    }
}```

Config class:
private static File file;
private static FileConfiguration customFile;

//Finds or generates the custom config file
public static void setup(){
    file = new File(Bukkit.getServer().getPluginManager().getPlugin("Eat").getDataFolder(), "options.yml");

    if (!file.exists()){
        try{
            file.createNewFile();
        }catch (IOException e){
            //owww
        }
    }
    customFile = YamlConfiguration.loadConfiguration(file);
}

public static FileConfiguration get(){
    return customFile;
}

public static void save(){
    try{
        customFile.save(file);
    }catch (IOException e){
        System.out.println("Couldn't save file");
    }
}

public static void reload(){
    customFile = YamlConfiguration.loadConfiguration(file);
}

}

somber scarab
#

get to work i guess

wet breach
#

Anyways time to drive home

tender shard
#

also why don't you use the builtin JavaPlugin#getConfig() method

timid hedge
# tender shard show some code where you're using the config
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            Player player = (Player) sender;
            if (player.hasPermission((Config.get().getString("Permission")))) {
                if (!cooldown.hasCooldown(player)) {
                    cooldown.setCooldown(player, (Config.get().getInt("Cooldown")) * 60 * 1000, TimeUnit.MILLISECONDS);
tender shard
#

looks okay. anyway, is there any reason why you don't use the builtin getConfig() method?

timid hedge
#

I dont know how to, i found this method in a toturial

tender shard
timid hedge
#

At config.addDefault("Permission", Config.get().getString("Permission"), true); and config.options().copyDefaults(true);
It says Cannot resolve symbole 'config'

shadow night
#

I've seen that default thing called bStats or something like that used for statistics. How do I implement that in my plugin?

remote swallow
tender shard
#

?learnjava

undone axleBOT
tender shard
#

also what the heck is that code supposed to do?

#

config.addDefault(config.get(...)) ??

tender shard
#

no

#

your class is called Config

#

and now you're mixing up the config provided by JavaPlugin with your own FileConfiguration

timid hedge
#

I can just delete my Config class right? if im using the one provided by JavaPlugin?

tender shard
#

yes

quaint tapir
#

for the .setRotation it takes two angles as it's parameters
anyone know if these are in degrees or radians?

tender shard
#

should be degrees, same value as in F3 screen

timid hedge
# tender shard yes

Can i just also delete mig Cooldown class? if im using the on from JavaPlugin?

remote swallow
#

Cooldown isnt a base spigot class

#

if you want cooldowns you still need it

tender shard
timid hedge
#

The Cooldown class, that from the girhub link you have sent

tender shard
#

and what are you going to replace that with?

timid hedge
#

Idk, i was just wondering if it also had that

#

I cant see how i update the config

#

@tender shard ^ do you know?

severe oracle
#

Hi, does anyone know how would I get the array of blocks from a .schem file from worldedit?

stiff blaze
#

Hi, Does HikariCP API Down ?

ivory sleet
#

Don’t think so?

stiff blaze
ivory sleet
#

That just complains about Java version

stiff blaze
#

I use Java 8

somber scarab
#

oh man.. shouldve prolly paste binned this

#

?paste

undone axleBOT
stiff blaze
#

I think it's in this zone

smoky anchor
#

you're asking if a player has a permission for a boolean ?
I am pretty sure you have to pass a string into that method
Doesn't IDE yell at you for that ?
Looked it up, ye it takes string.
The IDE should tell you what is wrong

stiff blaze
#

The program doesn't write any table in my database

timid hedge
somber scarab
#

hey I tried to do workload distro. this is my first time. and I dont know if I am doing it correctly since it is still crashing my server from the memory heap.

I am trying to copy and paste 9 chunks from one world to the other using the world edit API.

I followed the tutorial from this link: https://www.spigotmc.org/threads/guide-on-workload-distribution-or-how-to-handle-heavy-splittable-tasks.409003/

Here is my Workload class:

public interface Workload {
    void compute() throws WorldEditException;
}

The two bins have my other classes; one has my task and the other is the runnable that should distro the task.

task: https://paste.md-5.net/efotejalij.java

distro: https://paste.md-5.net/atosafedag.java

My server still crashed when I call to run() the distro class with one CopyPasteGame object in the Deque.

timid hedge
onyx fjord
#

is it the correct behavior for Comparator.comparingInt() to put the highest ints on the end of the list?

smoky anchor
undone axleBOT
onyx fjord
#
BEFORE SORTING
[12:43:52 INFO]: [Option 3, Option 2, Option 5]
[12:43:52 INFO]: [0, 1, 0]
AFTER SORTING
[12:43:52 INFO]: [Option 3, Option 5, Option 2]
[12:43:52 INFO]: [0, 0, 1]
smoky anchor
#

paste your Config class then

#

Idk why you even have your own if you followed the tutorial

timid hedge
#

I dont have a config class
What do you mean?

smoky anchor
#

Then is your variable called Config ?

#

variable names should start lowercase
Or be fully uppercase if final

timid hedge
#

Sooo...
What do you mean with start lowercase or fully uppercase
What am i gonna do?

smoky anchor
#

It's just that you're confusing me with your naming is all

#

again, send the whole class, not a snipplet, I can't do much with just that

tender shard
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

agile anvil
#

What is "Config" ?

#

Is it a class ?

smoky anchor
#

where is Config then

tender shard
#

do you even know what a boolean is?

#

"eat" is definitely not a boolean

timid hedge
#

You said i should do it on this metod and i am trying?
What else should i do?

tender shard
#

no, I told you to learn basic java

#

many times

#

you seem to have absolutely no idea about java and you keep ignoring all the tutorial links

somber scarab
#

if u want ofc

tender shard
# tender shard you seem to have absolutely no idea about java and you keep ignoring all the tut...

all you do is copy/paste random stuff out of context, then wondering why it doesnt work. earlier, you thought '5' is a number although it's obviously a string.

now you try to turn "eat" int oa boolean, but don't even know on what you should call getBoolean on. You didnt understand the most basic conctepts of java, which is e.g. that methods are always members of either classes or instances of classes. You randomly used "config" in your code without declaring what it is, and didn't understand why it then says "cannot find symbol".

it's a waste of time to try to help you because you keep refusing to learn the basics of java, hence I won't answer anymore until you have finished one of the following tutorials:

#

?learnjava

undone axleBOT
somber scarab
#

my server (or thread in that case) still crashes because of memory heap

wet breach
#

then you need to reduce the memory usage

somber scarab
#

but it still crashes cuz it is not being correctly distro ( i believe)

wet breach
#

distributed doesn't necessarily mean less resources used

somber scarab
wet breach
#

it means you distributing the work load over a longer period of time by using multiple tasks or whatever

somber scarab
#

task is finished slower but doesnt crash and time out the server

wet breach
#

key word is work load, not resource management XD

#

in order to keep resources low, you need redesign so that you make use of object reuse

#

and nulling out stuff quickly that you don't need anymore

#

nulling out quickly allows the GC to more quickly remove it from heap

#

and then you may need to use some JVM args

#

?flags

undone axleBOT
somber scarab
#

bruuuhhh I heard FAWE can do that for me...

#

this just seems so hardcore and intense for just copying 9 chunks

wet breach
#

you are the one with these requirements

#

not our fault your hardware is very limiting XD

somber scarab
#

and delete them

wet breach
#

its not about just the ram

#

you need better cpu so you can more easily have threads, and for your server you should be able to do stuff easily with 6GB, probably only need 4 but, since you most likely have a VM it could be an issue that wherever your VM is in regards to the box's physical ram it may not be ideal

#

this is one of those downsides of trying to run stuff in VM's

#

especially providers that like to over load their boxes

#

have to remember in regards to the physical box, you are not the only user that has a VM running on it

somber scarab
#

UUUGGHHH

#

ILL FIND SMTH

somber scarab
#

@wet breach ill get by with 6 gigs nomatter what.. and youll see!

wet breach
#

I have ran servers with 4GB just fine

#

even had one that ran on just 2 as well

somber scarab
wet breach
#

yeah and I am saying its possible to go further in terms of extremes lol

#

its all a matter of what you know and how much work you are willing to put in to make it happen

somber scarab
#

aint no way im making someone pay for 12 gigs or even more just to run my plugin

#

na ah

wet breach
#

where are you getting 12gb?

#

o.O

somber scarab
#

my plugin is just not light at all. uselessly intense.

wet breach
#

sounds like design problems

#

over time you will learn how to make your code more optimal 😉

somber scarab
#

I have like pigstep playing throught the game in the background and everything

#

itll be a banger plugin

#

best Floor is Lava minigame out there

orchid trout
#

what do i do if the usermanager needs the rankmanager and the rankmanager needs the usermanager?

#

do they make their own instance?

wet breach
orchid trout
#

help on redesign

wet breach
#

use interfaces

orchid trout
#

thaknsk

wet breach
#

this way you have a hierarchy

#

if multiple managers need the same data or info

#

then that info and data gets moved higher on the hierarchy chain

orchid trout
#

can i just make a blank interface?

wet breach
#

what good is a blank interface going to do?

orchid trout
#

uhh

#

nothing

wet breach
#

I mean yeah you can if you just want to have an interface that is named differently to have something later extend it

orchid trout
#

this does feel like an oop problem

wet breach
#

but anyways you will need to implement the interfaces, but using the interfaces though allows your managers to become other managers if necessary as well other then keeping data organized where all of them need access to it

orchid trout
#

i dont know how to use inferfaces here

wet breach
#

seems you found one of your limitations

orchid trout
#

they both have different methods

wet breach
#

and should now do some research and learning in regards to effectively using interfaces 🙂

wet breach
#

seems you have garnered Burchard's interest maybe more may become interested because of it

somber scarab
#

just because ive never done it before, doesnt mean i wont do it

#

ima fkn do it

somber scarab
noble lantern
#

10 seconds??

somber scarab
#

cuz now it takes either one min or crashes the server

wet breach
#

easily do able

noble lantern
#

copy and paste?

wet breach
#

I can tell you right now that it is possible to copy and paste 9 chunks in less then 1 second

noble lantern
#

wait doesnt fawe do workload distribution on its own, cant theyre API be used

somber scarab
#

im my own fawe

noble lantern
#

in that case you should be mega fawe

#

use NBT to edit the world file directly while async 🗿

wet breach
#

seems Burchard was taught the ancient ways

noble lantern
#

i only know the texts, i cant recite them r_baby_cry

wet breach
#

lol

glacial sphinx
#

I need help with setting the exitEndPortal location to a dragon so it won't go to 0, 0, 0 coordinates. Can someone please help me? I am using 1.18 and later versions of minecraft in java 11 ? This is about spawning EnderDragon.

somber scarab
#

:)

#

anyways retesting

wet breach
#

this can be accomplished if you have insane momentum and ram the podium as this will damage you

#

not that this helps or anything lol

noble lantern
#

iirc the ender dragons ai is pretty set in stone without nms right

glacial sphinx
noble lantern
#

its just always goes to 0 0 in any world

glacial sphinx
#

So no fix?

wet breach
#

not sure what you mean by fix, I think its like hardcoded to be 0,0

#

because if you manage to destroy the exit portal, it regenerates after 5 seconds

#

however, the y can be different

noble lantern
#

you could change its pathfinding with NMS possibly for a specific phase?

glacial sphinx
#

Oh. I ment when I spawn it in the overworld.

noble lantern
#

oh just spawning

wet breach
#

good luck doing that with the dragon

#

dragon is technically like 5 entities if I remember right

noble lantern
#

iirc its really challanging hell even hypixels dragons are goofy asl 💀

wet breach
#

its because the end dragon isn't a single entity XD

#

its 5 entities that act as 1

glacial sphinx
#

Well can't I change the AI of one of the entities and copy it over 5 times?

noble lantern
#

i hate the dragon

Il go to fight it f3 + b, and literally hit the boxes and mf sit there like "whatever"

wet breach
#

lol

noble lantern
#

"GoTTa HiT MaH HEaD"

glacial sphinx
#

XD

wet breach
noble lantern
#

maybe more modern versions have it better fleshed out in nms

#

doubt it tho

wet breach
#

and then if the entities get too far apart it just like vanishes but its still alive or whatever

glacial sphinx
#

Well you can change the hardcoded exitEndPortal Location on 1.16.5 and earlier versions.

#

With a NMS class.

wet breach
#

well anything is do able if you resort to NMS

wet breach
#

well almost anything

noble lantern
#

HAVE FUN LMAAAO

#

STILL USES DRAGON PARTS

noble lantern
#

thats is an aids class holllyyy r_baby_cry

wet breach
#

yeah its insane

glacial sphinx
#

Will ChatGPT help with anything?

wet breach
#

maybe? idk ask it

noble lantern
#

chatgpt couldnt help me figure out indexing for paginted inventories, i doubt it could do that

wet breach
#

?tias

#

?tis

#

!tis

terse bough
wet breach
#

ok I don't remember the command >>

glacial sphinx
terse bough
#

On the website is already the 1.20.1 and other versions do not work either

glacial sphinx
#

Ok so you guys are telling me that the only way to change those 3 numbers for the coordinates is to make a custom dragon AI? Can MythicMobs do that or any other mob plugin?

noble lantern
#

looool

#

this poor developer

#

is he okay?

#

someone needs to check in one him in concnered for his safetey he did this all the way back until 1.14 wtf

#

well, either way that class could be useful its from the rideable ender dragon plugin

#

emphasis on could, might be entirely useless

wet breach
glacial sphinx
noble lantern
#

can you show which method you are using exactly?

glacial sphinx
noble lantern
noble lantern
#

still could be usefull

glacial sphinx
#

Yes, but if I put the plugin on a 1.19 server it won't work.

noble lantern
#

no its just if you ever plan on coding it yourself

#

you can checkout other open source plugins and get ideas on how they do it

shadow night
#

how do I get "bungeecord-proxy" with a version besides 1.4.7-SNAPSHOT?

glacial sphinx
shadow night
glacial sphinx
#

You choose witch version to download

icy beacon
shadow night
glacial sphinx
shadow night
#

uhm that's the link to download the bungeecord itself?

#

I need the bungeecord-proxy maven part

#

it should be obvious, this is help development

subtle folio
#

you mean the maven dependcy ?

trail coral
undone axleBOT
trail coral
#

ooh

wet breach
shadow night
#

I tried

#

bla bla bla not found in spigot-repo

#

I have the bungee repo tho

wet breach
#

its located here https://oss.sonatype.org/content/repositories/snapshots

shadow night
#

I have it

wet breach
#

https://hub.spigotmc.org/nexus/content/repositories/public/net/md-5/

#

I suppose you could just pull the bungee repo

#

and compile it yourself

tender shard
shadow night
#

<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-proxy</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

tender shard
#

the only version available on sonatype is 1.4.7-SNAPSHOT

shadow night
#

I don't want 1.4.7 tho

tender shard
shadow night
#

Okay

#

I think I even had an old version of bungeecord cloned somewhere

young knoll
#

Why do you want an old version

#

Bungee is fully backwards compatible

shadow night
#

Nah, I just said

#

I cloned the repo when I saw bungee uses modules for some commands, so I decided to try and make one module

#

Still on my server to this day, the stop command lol

#

I wonder if that could cause compatibility issues tho

#

Or any issues

cinder abyss
#

Hello, how can I make <Entity>#setCustomNameVisible(true); only visible for 1 player ?

young knoll
#

Packets

chrome beacon
#

Teams also work

young knoll
#

Oh yeah

chrome beacon
#
  • assuming you still want to hide names when looking at entity
#

Otherwise you'd need to reimplement that server side

somber scarab
#

Hey guys! I am trying to copy 9 chunks from one world to a void world but things dont seem to work, meaning;

I get the print messages that I copied the correct coords and pasted in the correct coords but nothing is actually there...

        // COPY RANDOM PLACE USING WORLD EDIT

        cs.sendMessage("STARTING COPY AT: (" + gamePlot.plotStart.getX() + ", -64," + z + ") to (" + (gamePlot.plotEnd.getX()) + ", 0, " + z + ")");

        CuboidRegion region = new CuboidRegion( BlockVector3.at(x,-64,z), BlockVector3.at(x+gamePlot.plotEnd.getX(),0,z));

        BlockArrayClipboard clipboard = new BlockArrayClipboard(region);

        ForwardExtentCopy forwardExtentCopy = new ForwardExtentCopy(BukkitAdapter.adapt(FloorIsLava.NORMAL_WORLD), region, clipboard, region.getMinimumPoint());

        Operations.complete(forwardExtentCopy);

        cs.sendMessage("COPY FINISHED...");

        // PASTE IN PLOT

        cs.sendMessage("STARTING PASTE AT: (" + gamePlot.plotStart.getX() + ", "+ gamePlot.plotStart.getY() +", " + (gamePlot.plotStart.getZ()+z_paste) + ")");

        Operation operation = new ClipboardHolder(clipboard).createPaste(editSession)
                .to(BlockVector3.at(gamePlot.plotStart.getX(),gamePlot.plotStart.getY(),gamePlot.plotStart.getZ()+z_paste)).build();

        Operations.complete(operation);

        cs.sendMessage("PASTE FINISHED...");```
This snippet is inside a workload distro and loops through the z levels and copy pastes them one by one in a runnable.
I get exactly 50 messages of successful copy paste ( because my plot size is 50x50) but when I go to the pasted coords, nothing is there...
chrome beacon
chrome beacon
#

A copy of a chunk

#

Only includes blocks though

wet breach
#

and can be used in other threads or async

somber scarab
icy beacon
#

how to make a player slowly glide from one location to another? is there a method in that, maybe in nms? or do i just apply calculated velocity and hope for the best lol? i doubt that velocity will work properly because it's not exactly smooth, the movement speed of the player will accelerate and slow back down when applying velocity, and what i'm seeking is smooth transportation without any speed fluctuations

kind hatch
somber scarab
kind hatch
#

Yes, you can do that.

wet breach
somber scarab
#

still no blocks show

brisk estuary
#

hey, if I set a custom name for an entity (a cave spider for example) will it still despawn or does it have the same effect as applying it an itemtag?

somber scarab
agile laurel
#

Hi, new here and to minecraft dev: is it ok to run a scheduled task each 50ms ? I'm looking for a way to poll data efficiently on a bungee proxy

icy beacon
#

velocity is not smooth

#

when applying velocity to a player the speed of the movement changes

#

if i cancel playermoveevent i'm pretty sure they won't be able to move at all

agile laurel
# somber scarab sure go ahead

Okay thanks ! Basically each 50ms I pull data and add the corresponding event so that the runnable doesn't take too much cpu time and the event queue take events when it has time

icy beacon
#

even when i apply velocity with code

kind hatch
#

You might be able to use the slow falling potion effect, but it's very rigid in its speed.

somber scarab
icy beacon
#

i want horizontal movement, diagonal movement, upward movement, not just downward

icy beacon
somber scarab
icy beacon
#

?

#

actually i think i have an idea

#

i can make a player ride an invisible bat

#

the bat in question

#

can move from A to B with a pathfinder

#

even midair

somber scarab
icy beacon
#

a pathfinder i think yeah

somber scarab
icy beacon
#

but a pig can't fly

#

there's even an achievement dedicated to that fact

#

or there was one

somber scarab
icy beacon
#

if i need to move upward

somber scarab
#

a bee might work as well

icy beacon
#

how else would i move

#

other than fly

icy beacon
quaint mantle
#

if a player has a plugin's custom inventory open, and that plugin is disabled, will the player be able to take from the inventory freely

#

im currently unable to test it

silent steeple
#

well yeah

quaint mantle
#

stupid question ill have to test it eventually

trail coral
icy beacon
trail coral
warm mica
crude sleet
#

In Version like 1.19.4 i cant use CraftItemStack or CraftPlayer anymore, is that normal? (The Last Time i coded was on 1.16 ig)

young knoll
#

?nms

shadow night
#

What does NMS decrypt to?

dawn ledge
#

Hi, I know I'm dumb but I'm trying to check if a world exist by doing this : if(getWorld(nom).equals(null))
but the console return me this error : java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because the return value of "org.bukkit.Bukkit.getWorld(String)" is null
Can somebody have an explaination ?

young knoll
#

== null

dawn ledge
#

really ?

young knoll
#

You can't use .equals on something that is null

#

Because it's null

#

null.equals does not exist

dawn ledge
#

ok thanks

#

||i'm so dumb sorry||

upbeat hornet
#

I have this class

public class MeteoriteEventScheduler implements Runnable{

    private final String listName;

    public MeteoriteEventScheduler(String listName) {
        this.listName = listName;
    }

    @Override
    public void run() {
        System.out.println("a");
    }
}

But when I do this:

Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new MeteoriteEventScheduler(list), 1L);

Error (see screenshot)

young knoll
#

Repeating tasks needs 2 longs

#

A delay and a period

upbeat hornet
#

right mb

deft thistle
#

I was wondering why my changes were not taking effect and I just saw that I uploaded the shaded verion of my jar and left two copies of it (the shadeed build and normal build) on the server
🤯 🔫

trail coral
terse bough
#

What should be written to the PacketPlayOutEntityMetadata package at the end, other than the EntityId, since it changed in 1.20.1?

orchid trout
# wet breach use interfaces

im just going to save the plugin instance instead of having rankmanager and usermanager save each others' instances

wet breach
orchid trout
#

oh ok

#

i thought that was better to do

wet breach
#

that is one way to do it, but again its not the OOP recommended way

#

the ideal solution or what some would say the proper solution is to use interfaces or redesign your objects where they are not depending on each other like that

orchid trout
#

usermanager and rankmanager each have like 10 methods and 2 of them do similar things

#

maybe i dont understand interfaces

#

but idk if i should make an interface

ivory sleet
#

there's always never anything wrong with an interface

#

like I can u show u my most recent project and u will see

orchid trout
#

ok

pseudo hazel
#

so everything is wrong?

#

or something is wrong

#

idk

opaque scarab
#

Is there anyway to detect if a leaf block was naturally generated. Leaves only decay if they are naturally placed and not connected to a tree, so they must have metadata storing that, right?

pseudo hazel
#

yes

#

but idk how you get it xD

#

you can see it in f3

#

lol

teal kindle
#

Is velocity recorded in units of meters/second?

pseudo hazel
#

assuming you mean blocks, yes I think so

opaque scarab
kind hatch
#

Leaves have a persistent flag that you can use to check if they are natural or not.

teal kindle
dawn ledge
#

Hi,
I want to use the WorlEdit plugin in my plugin, I add the jar file as library of my project but I don't succed in using it. Somebody can help me ?

I'm trying to paste schematic in the world from my plugin.

wet breach
#

as for units, each block is 1 meter

turbid crest
#

Hello, I'm trying to colourise chat messages with HEX colors. So I want to check with regex if &#XXXXXX is present, my code is:

        System.out.println("Message to colourise: " + message);
        Pattern hexPattern = Pattern.compile("&#[a-fA-F0-9]{6}");
        Matcher matcher = hexPattern.matcher(message);
        StringBuffer result = new StringBuffer();

        while (matcher.find()) {
            System.out.println("found");
            matcher.appendReplacement(result, createHexColour(matcher.group()));
        }

And in the console, I have:
[STDOUT] Message to colourise: &#RRGGBB test

But no 'found'

#

I tried online and my regex should be correct

eternal oxide
#

what ChatColor import?

turbid crest
#

import org.bukkit.ChatColor;

eternal oxide
#

oh sorry your regex isn;t even matching

turbid crest
#

Yes sir

wet breach
turbid crest
#

But my problem here is my regex not matching at all

twilit roost
#

oh my
what have I done :DD

twilit roost
#

uugh xd

turbid crest
flint coyote
somber hearth
#

Hey everyone, not sure what I'm doing wrong but when I try to set an armor stand's pose through the entity metadata packet, my plugin crashes with the error message
No serializer found for class com.comphenix.protocol.wrappers.Vector3F
Not sure why this would happen since the JavaDocs say there's a serializer for Vector3F

eternal oxide
#

I don;t use protocolLib but should you not be using a Bukkit Vector not Vector3f

somber hearth
#

I'll test with Bukkit's vector now, I assumed Vector3f was the correct model since it's provided by protocollib

wet breach
#

think you have to do some converting between 3f and bukkit vectors

somber hearth
#

Got the same error that there's no serializer for bukkit's vector model either

somber hearth
teal kindle
#

Does ray trace result correctly detect entities for short distances (4 blocks or less)? It seems to not work for me

dire crater
#

bruhhh my server broke

eternal oxide
somber scarab
#

omfg at this point, I'd just paypal someone 20 bucks who can actually help me figure out how to wrk with this WorldEdit API

#

llike fr

somber hearth
somber scarab
#

I cant copy paste!!!

somber hearth
eternal oxide
#

have you checked the packet on wiki.vg?

somber hearth
eternal oxide
#

then place 3 floats

somber hearth
#

in an array?

eternal oxide
#

getFloat().write(0,3F) etc

somber hearth
#

How do you write the other two floats to the same index?

eternal oxide
#

it accepts 3 floats so it has 3 indexes

#

.write(1, etc

somber hearth
#

The packet takes multiple rotations though, at index 16, it takes the head rotation which is 3 floats and at index 17 it takes the body rotation which needs 3 more floats, which is why I assumed I needed to pass a Vector3f for each rotation

somber scarab
#

Something's just wrong with me trying to copy paste

eternal oxide
#

I'd suggest try an array then

#

you may even find protocolLib has a defined getter for Rotations

somber hearth
#

Alright I'll try with that, what serializer do you use for an array?

eternal oxide
#

I don;t use protocol lib at all

echo basalt
somber scarab
echo basalt
#

I am here

#

your lord and savior

somber scarab
#

So okay.. how do I start..

#

one sec lemme type

echo basalt
#

Well

somber hearth
#

Oh okay, is there someone I can ask who is experienced with protocollib?

echo basalt
#

What do you have..

somber scarab
#

?bin

echo basalt
#

?paste

undone axleBOT
somber scarab
#

?paste

undone axleBOT
somber hearth
# echo basalt Yes hello

Oh dope, so basically my issue is I'm trying to set the pose of an armor stand with the entity metadata packet but having an issue trying to serialize the Vector3f, with this error message
No serializer found for class com.comphenix.protocol.wrappers.Vector3F
Here's the line of code causing the error
WrappedDataValue(20, WrappedDataWatcher.Registry.get(Vector3F::class.javaObjectType), Vector3F(-90.0f, -20.0f, -20.0f))

echo basalt
#

Alright so

#

There's a getVectorSerializer method

#

I'd rather use that one

#

And then you pass protocollib's vector3f wrapper

somber hearth
#

Ah right, forgot those methods existed, testing that now

dawn ledge
#

Hi can somedy help my with that : error: package com.sk89q.worldedit.extent.clipboard does not exist import com.sk89q.worldedit.extent.clipboard.Clipboard; ^
I have added the jar file as library of my project it don't want to build.
I'm using itellij

echo basalt
#

There was a weird format change in 1.19

#

and might've changed in 1.20 (again)

somber scarab
#

This is my gameLobby class:https://paste.md-5.net/mapisemedi.java

All what matters about it is the constructor. There, a random section of a pregenerated world is selected, the selection is a fixed size everytime but random coords so that no game has the same map.

I want to copy this selection, paste it in a different void (also pregen-ed) world where there are "plots".

That selection is then pasted in a "plot" and players will be teleported to play.

WHAT I HAVE NOW:

Players get teleported in the "plot" but even though my console debug prints work, no blocks are present.

WHAT SOULD HAPPEN:

The plot gets its copied section of the pregened normal world pasted in the plot and then players should be teleported.

echo basalt
#

Seems like you're using the 1.19 method so nothing to worry about

echo basalt
#

So if you can, I'd suggest using that and skipping over all of the headache

#

Otherwise

echo basalt
#

It does all the crazy void world pasting and schematic management for you

#

It can save schematics to a database, has world pooling, grids

#

etc

#

But let's say you don't want to use cosmos

#

First let's start by splitting your logic so you have a minimum understanding of what's going on

somber scarab
#

yea..

echo basalt
#

btw something tells me you're not passing a world here

#

but maybe the world's already on your main editsession

somber scarab
#

the editSession has the world

echo basalt
#

Still let's split this

somber scarab
#

okay..

echo basalt
#

We'll start with this

private Clipboard createClipboard(World bukkitWorld, CuboidRegion region) {
  BukkitWorld worldEditWorld = new BukkitWorld(bukkitWorld); // go figure

  try(EditSession session = WorldEdit.getInstance().newEditSession(worldEditWorld)) {
    Clipboard clipboard = new BlockArrayClipboard(region);
    ForwardExtentCopy copyOperation = new ForwardExtentCopy(worldEditWorld, region, clipboard, region.getMinimumPoint());

    Operations.complete(copyOperation);
  } catch(WorldEditException error) {
    error.printStackTrace();
  }

  return clipboard;
}

private void pasteClipboard(Clipboard clipboard, Location targetLocation) {
  BukkitWorld worldEditWorld = new BukkitWorld(targetLocation.getWorld());

  try(Editsession session = WorldEdit.getInstance().newEditSession(worldEditWorld)) {
     Operation operation = new ClipboardHolder(clipboard)
      .createPaste(session)
      .to(BlockVector3.at(targetLocation.getX(), targetLocation.getY(), targetLocation.getZ())
      .ignoreAirBlocks(false)
      .build();

    Operations.complete(operation); 
  } catch (WorldEditException error) {
    error.printStackTrace();
  }
}
somber scarab
#

id legit tip you if you help me understand how to use this API

river oracle
#

?paste (forr mee guys)) sorry

undone axleBOT
somber scarab
opaque scarab
#

Is there an easy way to detect if a block is a leaf block, without having to specify every type of leaf?

somber scarab
#

but you can check if the type string contains the world "LEAF" in it

echo basalt
#

So you can for example do like

somber scarab
#

all that to copy and paste... <.< what API is this..

echo basalt
#
Clipboard clipboard = createClipboard(gameWorld, new CuboidRegion(-10, -10, -10, 10, 10, 10));
pasteClipboard(clipboard, new Location(voidWorld, 0, 128, 0));
#

type deal

#

I had to figure this out myself

somber scarab
river oracle
#

I'd say it does a fairly good job at basic introductions as well

somber scarab
#

have you went to their server to ask questions?

river oracle
river oracle
echo basalt
somber scarab
#

they treat ppl like maggots bruh

echo basalt
#

took a while

somber hearth
echo basalt
#

this is how I do it on cosmos

echo basalt
#

Not for the wrappers

#

Which is why those methods exist

somber hearth
#

Ah good to know, thanks for the help

echo basalt
echo basalt
#

Gotta go to the gym in like 10 minutes

#

Anything else anyone?

teal kindle
#

Does ray trace result correctly detect entities for short distances (4 blocks or less)? It seems to stop working if the entity is too close to the start location

echo basalt
#

uhh it kinda depends, it's accurate from my experience

river oracle
echo basalt
#

but you need to lower the ray size

echo basalt
#

Today's leg day

river oracle
echo basalt
#

Well

somber scarab
echo basalt
#

should be fine

somber scarab
somber hearth
somber scarab
#

but it in a bukkitscheduler?

#

bukkitscheduler.runTask();

echo basalt
#

runTask is sync

#

runTaskAsynchronously is not

teal kindle