#help-development

1 messages · Page 940 of 1

tawdry echo
#

i have other method to insert user and it works

#

but for arena not

chrome beacon
#

.

#

.

arctic monolith
#

hello, I have weird question. Is this possible to create "mud" plugin? I have only one idea how to create it but I think it will overloading server. My idea is to summon this Powder snow packets on runnable every tick, on some area like 5x5. Is this possible at all?

#

and whether such a package exists at all?

solemn meteor
ocean hollow
#

This piece of code does not work for me (it is not mine). How can I fix this?

public class v1_20_R2 implements SkullSkinSetter {
    @Override
    public void setSkullWithSkin(Block b, String base64Skin) throws Exception {

        b.setType(Material.PLAYER_HEAD, false);
        
        Class<?> gameProfileClass = Class.forName("com.mojang.authlib.GameProfile");
        Object gameProfile = gameProfileClass.getConstructor(UUID.class, String.class).newInstance(UUID.randomUUID(), null);
        
        Class<?> propertyClass = Class.forName("com.mojang.authlib.properties.Property");
        Object property = propertyClass.getConstructor(String.class, String.class).newInstance("texture", base64Skin);
        
        Object propertiesMap = gameProfileClass.getMethod("getProperties").invoke(gameProfile);
        propertiesMap.getClass().getSuperclass().getMethod("put", Object.class, Object.class).invoke(propertiesMap, "textures", property);

        
        Object handle = b.getChunk().getClass().getMethod("getHandle").invoke(b.getChunk());

        Class<?> blockPositionClass = Class.forName("net.minecraft.core.BlockPosition");
        Object blockPosition = blockPositionClass.getConstructor(int.class, int.class, int.class).newInstance(b.getX(), b.getY(), b.getZ());

        @SuppressWarnings("unchecked")
        Map<Object, Object> tileMap = (Map<Object, Object> ) handle.getClass().getMethod("E").invoke(handle);

        Object skullTile = tileMap.get(blockPosition);

        if(skullTile != null) {
            skullTile.getClass().getMethod("a", gameProfileClass).invoke(skullTile, gameProfile);
        }
        b.getState().update(true, false);
    }
}

acoustic pendant
#

Hello guys, I have a doubt.

For a plugin that requires many events but the events required vary depends on how the config is configurated how would be the best way to register those events?
All events even if they are not used and just put a return in the first line
Or only events that are going to be used?

solemn meteor
arctic monolith
acoustic pendant
arctic monolith
solemn meteor
#

my bad for not clarifying

acoustic pendant
chrome beacon
#

Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...

cinder abyss
#

Hello, how can I spawn an experience orb with a different size?

chrome beacon
#

Their size is dependent on how much xp they give

#

if you want to fake their size you can do so with ProtocolLib/PacketEvents

cinder abyss
#

Hum okay, so I have two questions:

  • Is there a limited size?
  • Can I get the xp a xp orb give?
#

the max is 64 int

#

or is that a 32?

cinder abyss
#

but I can push to the limit?

chrome beacon
#

int limit

#

so 32

cinder abyss
#

okay thanks

#

wait, is something like Clumps already in spigot?

#

oh yeah already :/

chrome beacon
#

yes

cinder abyss
#

let's just make it easier x)

severe cave
#

I have been trying to make a quick command to teleport players between worlds (1.20.4, Spigot). However, listing all available worlds only shows the worlds with the levelname provided in server.properties, and not other save files. I am using Bukkit.getWorlds to list the worlds and getServer.getWorld to access the actual worlds. What am I doing wrong, and what is the correct solution?
I haven't found any information about this online, so I'm sure it sounds like a stupid question...

icy kelp
#

I need help I know hardly Java.( I don't know classes and objects) How I can fix it ```package org.cheese.naukaconfigu.Utility;

import com.sun.org.apache.xpath.internal.operations.Bool;
import org.cheese.naukaconfigu.NaukaConfigu;

public class Zmienne {

private final NaukaConfigu plugin;

public Zmienne(NaukaConfigu plugin) {
    this.plugin = plugin;
}

public static String join_message() {
    String join_message = **this.plugin**.getConfig().getString("join_message");
    return join_message;
}

public static Boolean allow_Heal() {
    Boolean allow_Heal = **this.plugin**.getConfig().getBoolean("allow_Heal");
    return allow_Heal;
}

}``` The problem is in **** to make it you easier

solemn meteor
#

it only works when the event fires up

#

if it doesnt, then you dont need to

#

but if it does, I guess you could put a return line in the first line

acoustic pendant
solemn meteor
worldly ice
restive mango
#

Anyone know how to convert net.md_5.bungee.api.chat.BaseComponent[] to net.minecraft.network.chat.BaseComponent[] ?

lost ledge
#

What's the best way of converting a locale string from Player#getLocale() to a java Locale object?

chrome beacon
#

getLocale won't always match a java Locale

lost ledge
#

how does paper for example convert the locale string to a java locale in their Player#locale()?

chrome beacon
#

Split getLocale by _ and use Locale(String language, String country)

#

Just guessing

#

Going of javadoc

lost ledge
#

was hoping there was a simpler way, but i guess that's the way to go then. thanks for the help!

restive mango
#

Or, in general, just a system/some guidance for constructing net.minecraft.network.chat.BaseComponent[] would be fantastic. 🙂

echo basalt
silent quiver
#
        Vector directionMiddle = middlePoint.toVector().subtract(middle.toVector()).normalize();

        drawLine(middle, middlePoint.clone().add(directionMiddle.multiply(BLOCK_SIZE * 2)), 0.025);

        double yaw = Math.toDegrees(Math.atan2(-direction.getX(), direction.getZ()));
        double pitch = Math.toDegrees(Math.asin(-direction.getY()));

        Vector3f rotationVector = new Vector3f((float) pitch, (float) yaw, 0);


        EntityArmorStand entityArmorStand = ((CraftArmorStand) armorStand).getHandle();
        entityArmorStand.setHeadPose(rotationVector);```

some1 know why the armor stand is not looking right to the line particles?
lilac dagger
#

strong feeling the calculation is wrong

#

for yaw and pitch

silent quiver
#

hm, i really hate maths

lilac dagger
#

maybe it takes radians?

#

so degrees are wrong

restive mango
silent quiver
# lilac dagger maybe it takes radians?

wahts annonys me is that the spigot .setHeadPose methods use euler angles, which greatly lose the precision of a rotation, and vector3 is completely the opposite of euler angles xyz and zyx etc

lilac dagger
#

i was thinking the same, if it's not the math it's something to do with order or degrees/radians

silent quiver
#

i really dntknow let me see radians

lilac dagger
#

minecraft works mostly in radians as far as i know

silent quiver
#

now the armor stand dont rotate lul

#

worse i had already worked on this before with holograms

#

but i lost the src, where it displayed a customized message, but i only made it rotate 90 degrees and not completely

slim gate
#
player.getWorld().spawn(player.getLocation(), TNTPrimed.class, (tnt) -> tnt.setYield(0));

this doesn't work in 1.20.4

#

java.lang.NoSuchMethodError: 'org.bukkit.entity.Entity org.bukkit.World.spawn(org.bukkit.Location, java.lang.Class, org.bukkit.util.Consumer)'

chrome beacon
slim gate
#
> version
[21:33:44 INFO]: Checking version, please wait...
[21:33:44 INFO]: This server is running Paper version git-Paper-459 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 88419b2)
You are 2 version(s) behind
Download the new version at: https://papermc.io/downloads/paper
Previous version: git-Paper-439 (MC: 1.20.4)
#

its paper but

chrome beacon
#

Recreate the issue on Spigot

slim gate
#

yep it's paper oops

worthy star
#

is there something in java for formatting numbers ? (1000 -> 1,000) or i have to make a method

lilac dagger
#

i can give you mine

#

wait, there is

#

wait a second

#

obviously from the if choose what you need

quiet ice
#

You can also use String.format

lilac dagger
#

but that's quiet slow

#

i don't like it personally

#

it's way too generic

quiet ice
#

Well you can always compile the format expression ahead of time to a Formatter

lilac dagger
#

still quiet slow

#

i mean now it depends on the task, if you call it once in a bluemoon is fine

#

but if you update it every tick for a hologram or something it'll feel

quiet ice
#

I don't think there is actually a large difference here

#

Plus you should really avoid hardcoding the separators

#

Use the player's locale whenever appropriate, which you can then easily stuff into the formatter

lilac dagger
#

well, this was for servers and i wanted to make sure the behavior will not be affected by each server's locale

lilac dagger
#

i didn't know that

quiet ice
#

Well, paper has a method for it. Under spigot you need to do some voodoo to obtain the locale object from Player#getLocale

lilac dagger
#

well, this'll do for this project, i'll leave it to the server owner to decide the separators

quiet ice
#

Yeah for smaller servers this is quite irrelevant, but once you attract players from outside your home region such behaviour is inexcusable

#

(for the group seperator you should generally use ' anyways, since that is never confused with anything else)

lilac dagger
#

i see, i'll try to apply the player locale if i can

worthy star
#

?paste

undone axleBOT
tidal kettle
#

how can i get a precise file name in the plugin folder?

echo basalt
#

JavaPlugin#getFile

tidal kettle
#

Bukkit.getStructureManager().loadStructure didn't load schematics?

mellow edge
#

I have a really huge plugin that basically uses Player object to store in arraylists everywhere, but then when a player rejoins everything breaks.
Now I have a few options:
-have a wrapper class GamePlayer and just replace the Player object to a new one on a rejoin *the easiest by far
-make it work with UUIDs not sure how to all the code compatible tho
-with strings of player names
What do you think?

mellow edge
#

May I ask why do you think like that

spare hazel
#

Bukkit.getPlayer(uuid)

spare hazel
#

so you replace all the Player.... with Bukkit.getPlayer(uuid)....

spare hazel
mellow edge
#

What about the 1. Solution that I think would be the best (because I do not need to restore the game after the server reload/restart)

#

I see

#

But it will take me as much work for the 1. One as for the 2. One thus I think I should really be focusing on UUIDs?

spare hazel
#

?tryandsee

undone axleBOT
echo basalt
#

bonk

severe cave
#

I have implemented a TabCompleter class for a command and it works as intended, but how do i return a different list based off the current argument index?

    public @Nullable List<String> onTabComplete(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
        List<String> tabCompleteList = new ArrayList<>();
        //how do i change this per argument??
        return tabCompleteList;
    }```
#

(the context for the current command is an online playername then a string from a predetermined list)

mellow edge
# echo basalt Use UUIDs

Ok that will probably be the best and future proof if I want to store the game progress into a flat file

severe cave
echo basalt
#

the array length

tidal kettle
#

someone know how can i paste a schematic?

chrome beacon
#

I recommend using the WorldEdit API

tidal kettle
#

i try but i think i didn't understand something...

#

?paste

undone axleBOT
tidal kettle
chrome beacon
#

?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.

tidal kettle
chrome beacon
#

I'm not going to run that code to find the error

tidal kettle
#

oh

chrome beacon
#

Is WorldEdit installed

tidal kettle
#

on the server ?

remote swallow
#

yes

tidal kettle
#

i install world edit and this time i got another error lol

remote swallow
#

?paste the new exception

undone axleBOT
tidal kettle
eternal oxide
#

use worldguard util methods to convert the world

tidal kettle
eternal oxide
#

you can;t cast a CraftWorld to a Worldguard world

remote swallow
#

BukkitAdapter.adapt(world);

tidal kettle
#

in the cast?

remote swallow
#

no

eternal oxide
#

do not cast

remote swallow
#

replace the cast

tidal kettle
#

ok all work now i think i just messed up my schematic because only the top spawn

silent quiver
wintry lynx
#

I dont know how to use Lambda... How does one do this?

lilac dagger
wintry lynx
lilac dagger
#

then there's no setItem

#

snowball has no setitem

wintry lynx
lilac dagger
#

also doesn't launch projectile require Snowball.class?

wintry lynx
#

Because it works if I just set it after but if there is lag you see the snowball so I dont want to do that

lilac dagger
#

so do it the right way

#

set the class first

wintry lynx
lilac dagger
#

then the lambda consumer

silent quiver
lilac dagger
#

do it like this Snowball.class, thrown ->

lilac dagger
silent quiver
wintry lynx
lilac dagger
#

try harder

wintry lynx
#

Also thrown.setItem dont work either

lilac dagger
#

you're again using this

wintry lynx
lilac dagger
#

then as i said, snowballs doesn't have a setitem method

wintry lynx
wintry lynx
lilac dagger
#

there's no consumer for launchprojectile

prime pebble
#

How can I make a flag system like that? any1 can help?

lilac dagger
#

wait, let me see in which version it was added

#

it's not in spigot

#

there's no consumer for launch projectile

wintry lynx
#

No option to use the deafult

lilac dagger
#

is this paper api?

#

you're gonna break spigot with this

wintry lynx
#

yep

#

I run on paper

#

Likely will never switch

#

There should be a consumer tho tbh

#

In spigot I mean

wide coyote
young knoll
#

Yeah do you have any pictures with a few more pixels?

echo basalt
#

why does that look like just a bunch of dropped items

rough ibex
#

Because it is

#

Its dropped items floating above a head

prime pebble
#

hold on a min

#

there ya go

young knoll
#

They look too big for dropped items

#

Probably armor stands

echo basalt
#

or block displays

young knoll
#

Looks like a PvP server

prime pebble
#

it might be armor stands

young knoll
#

$5 says it’s 1.8

prime pebble
prime pebble
drowsy cosmos
#

Hi there. Why Player#hasPlayedBefore inPlayerLoginEvent always returns false even after rejoining?

river oracle
#

?jira

undone axleBOT
river oracle
#

Make sure you're on the most up to date version of spigot and your test plugin should only try to Recreate this behavior

drowsy cosmos
#

Aight, will do 👍🏻 Thanks!

river oracle
drowsy cosmos
#

It doesn't happen to PlayerJoinEvent tho when I tested. Sokay, I'll test with the latest build and see if it still occurs.

river oracle
#

?jd-s

undone axleBOT
young knoll
#

I’m almost positive that method just checks for their data file existing

#

So make sure their data file is being created and saved properly

river oracle
#

The javasdoc says it's really early in the process

#

So its possible not even that has been loaded yet or sum

young knoll
#

Maybe

restive mango
#

Hello, one last question: I am writing a 1.18 plugin, and I depend on a 1.16 plugin (that still works) which allows players to sit down, and keeps track of players which have sat using a hashmap. In my plugin, I look up this hashmap from the 1.16 plugin and check if players are sitting for certain behaviors, however, this throws a java.lang.NoClassDefFoundError: net/minecraft/server/v1_16_R3/World error.

Any advice?

young knoll
#

You are trying to interact with something that is using 1.16 NMS

#

But you’re on 1.18

restive mango
#

Yeah.

#

That plugin does work, however.

#

Like, I can /sit, and sit down on the server, and that plugin loads/runs properly

#

It's only when I try to interact with that sitting plugin with my own plugin that the error is thrown.

agile anvil
#

You are probably using a feature that is requiring NMS and that is not used without your interaction

#

If you don't have NMS code in your own plugin then it surely comes from the other plugin

young knoll
#

Idk what you’d need NMS for if it’s just /sit

#

Slap em on a marker armor stand and done

restive mango
#

Yeah, but I DO use NMS in my own plugin

#

It's just it's 1.18 NMS

#

lol

#

Both plugins use NMS, one uses 1.18 NMS, and one uses 1.16 NMS

#

any

#

uh

#

advice?

#

i can give code snippets

#

if thou wilt

young knoll
#

¯_(ツ)_/¯

#

Find an updated plugin

#

Or just make your own

restive mango
#

F

native nexus
#

or don't use nms 😉

severe cave
#

How can I have player save files per world? I currently have a main lobby and a main server world, and I teleport the player between these areas. However, inventory, health, effects, etc. persist across teleportation. I want there to be a unique save for each world. How can I achieve this effect?

drowsy helm
#

And if you can't afford two servers, thats a good indicator that you shouldnt be having a lobby world in the first place

astral pilot
#

is ShapedRecipe#shape() case-sensitive?

astral pilot
#

ok thanks

severe cave
#

ig i can take a look into multiverse source code

drowsy helm
#

just keep a file per world with the relevant data

#

then on world change, on join and on leave save and load accordingly

severe cave
drowsy helm
#

would probably be more of a pain in the ass to parse that then store it yourself

#

theres not that many datapoints

ocean hollow
#

how can I use value to set skin for head?

agile anvil
#

What kind of value ? Player name or skin url?

#

The usual work around is to get a GameProfile using the minecraft texture you want (using mc net skin url) and then apply it to the SKULL item or block

alpine urchin
#

to fix it

dawn valley
#

hey anyone help me with an issue
i am trying to do a fake water plugin , i am trying to make it like when a player is in that fake water he gets damage constanstly

BUT it works only with a player is on the surface of the water block i am trying to make it when a player is in the water block its not working

Here is the part of the code :

    private void startFakeWaterDamage(Player player) {
        new BukkitRunnable() {
            @Override
            public void run() {
                Block block = player.getLocation().getBlock(); // Get the block at the player's location
                if (!player.isDead() && block.getType() == Material.WATER && block.hasMetadata(FAKE_WATER_METADATA_KEY)) {
                    double damageAmount = getConfig().getDouble("Damage-amount", 1.0); // Get damage amount from config
                    boolean killPlayerOnEnd = getConfig().getBoolean("Kill-player-on-end", true);

                    if (killPlayerOnEnd) {
                        if (player.getHealth() <= 0) {
                            player.setHealth(0);
                        } else {
                            player.damage(damageAmount); // Apply damage every tick (adjust as needed)
                        }
                    } else {
                        if (player.getHealth() > damageAmount) {
                            player.damage(damageAmount); // Apply damage every tick (adjust as needed)
                        } else {
                            player.damage(player.getHealth()); // Reduce health to 0 if less than damageAmount
                            cancel(); // Stop applying damage if player reaches half a heart or less
                        }
                    }
                } else {
                    cancel(); // Stop applying damage if player dies or leaves fake water
                }
            }
        }.runTaskTimer(this, 0L, 20L); // 20 ticks = 1 second
    }
#

idk what i did wrong

agile anvil
#

How do you define the fake water?

#

I guess that if you place a bucket of fake water, all the connected and resulting water blocks should be fake water right?

#

Then, Player#getLocation should return the location on the feet of the player I guess, so if the player is swimming, the given block should be maybe one or two blocks up

dawn valley
vernal oasis
#

Does isFlying() check if the player is in the air / not on the ground, or just if they have flight enabled?

agile anvil
vernal oasis
#

is there any thingy that does the former?

agile anvil
agile anvil
vernal oasis
#

that would be a uhh @EventHandler location event no?

agile anvil
#

Depends. What do you want it for?
Most of the case I can think of would be in the PlayerMoveEvent yep

vernal oasis
#

that's the thing I'm thinking

agile anvil
#

Because you have to be very careful to check that: the player is not falling, that he is not jumping, etc

vernal oasis
#

Some stupid Flight plugin that takes food from you

pallid oxide
#

there is isOnGround check on player aswell, can be easily bypassed since its clientside check

pseudo hazel
#

also make sure to check if the player is using elytra then

vernal oasis
#

I just refactored some old one, and it takes hunger from you even if you're stood on the ground

pallid oxide
#

then just check if onGround

agile anvil
#

I would also check if the movement is a positive movement. Because I guess you don't want the player to lose food if it is taking a long jump

vernal oasis
pallid oxide
#

isGliding i think?

vernal oasis
#

ty

agile anvil
vernal oasis
#

yeah isGliding

agile anvil
#

Just have a Move event and check if the player is gliding

vernal oasis
#

I keep thinking your pfp is some Roblox pfp, then some Runescape pfp @pallid oxide lol

dawn valley
# agile anvil Then this might be a little more tricky, especially if it can be very huge water...

What would you think about this

    private boolean isPlayerInFakeWater(Player player) {
        Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
        if (block.getType() == Material.WATER && block.hasMetadata(FAKE_WATER_METADATA_KEY)) {
            return true;
        }
        return false;
    }

    private void startFakeWaterDamage(Player player) {
        new BukkitRunnable() {
            @Override
            public void run() {
                if (isPlayerInFakeWater(player)) {
                    boolean killPlayerOnEnd = getConfig().getBoolean("Kill-player-on-end", true);
                    if (killPlayerOnEnd) {
                        if (player.getHealth() <= 0) {
                            player.setHealth(0);
                        } else {
                            player.damage(1); // Apply damage every tick (adjust as needed)
                        }
                    } else {
                        if (player.getHealth() > 0.5) {
                            player.damage(1); // Apply damage every tick (adjust as needed)
                        } else {
                            cancel(); // Stop applying damage if player reaches half a heart
                        }
                    }
                } else {
                    cancel(); // Stop applying damage if player leaves fake water
                }
            }
        }.runTaskTimer(this, 0L, 20L); // 20 ticks = 1 second
    }



    private boolean isInFakeWater(Player player) {
        Location playerLocation = player.getLocation();
        int playerHeight = playerLocation.getBlockY(); // Get the Y-coordinate of the block the player's feet are on
        Block footBlock = player.getWorld().getBlockAt(playerLocation.getBlockX(), playerHeight, playerLocation.getBlockZ());
        Block headBlock = player.getWorld().getBlockAt(playerLocation.getBlockX(), playerHeight + 1, playerLocation.getBlockZ());

        return (footBlock.getType() == Material.WATER || headBlock.getType() == Material.WATER) &&
                (footBlock.hasMetadata(FAKE_WATER_METADATA_KEY) || headBlock.hasMetadata(FAKE_WATER_METADATA_KEY));
    }
vernal oasis
#

oh it is a Runescape one lol

pallid oxide
agile anvil
agile anvil
#

You would like to look at methods like WorldEdit's drain (check all relative water blocks so you can propagate the data)

dawn valley
#

but for propagation idk how to handle this now 😩

pallid oxide
agile anvil
dawn valley
agile anvil
dawn valley
#

i made it like the plugin uses metadata on each block to identify it as fake water

agile anvil
#

Yep I understood that

#

If you don't understand one of the two feel free to ask

tall dragon
#

would probably be more performant

#

also a bit harder

dawn valley
#

been on this since last night its a pain 😭

dawn valley
pseudo hazel
agile anvil
#

This is not an easy problem to be honest because it has a huge performance impact. Feel free to share with us your advancement and ideas so we can help you refine

dawn valley
#
@EventHandler
    public void onBlockFromTo(BlockFromToEvent event) {
        Block fromBlock = event.getBlock();
        Block toBlock = event.getToBlock();

        if (fromBlock.getType() == Material.WATER && fakeWaterBlocks.contains(fromBlock)) {
            markAsFakeWater(toBlock);
        }
    } ```
#

🤔 idk

vernal oasis
#

what's the difference between plugin.jar vs plugin-shaded.jar? and original-plugin.jar

agile anvil
#

And also I'm not sure but there is maybe multiple kind of water block types

eternal oxide
#

plugin.jar is the one you should use. plugin-shaded.jar is identical to plugin.jar. Original is the jar with no shaded dependencies

dawn valley
# agile anvil And also I'm not sure but there is maybe multiple kind of water block types

maybe by changing markAsFakeWater like that ?

    private void markAsFakeWater(Block block) {
        if (block.getType() == Material.WATER) {
           block.setType(Material.WATER);
            block.getPersistentDataContainer().set(new NamespacedKey(this, FAKE_WATER_KEY), PersistentDataType.STRING, "true");
            fakeWaterBlocks.add(block);
        } else if (block.getType() == Material.WATER_CAULDRON) {
            block.setType(Material.WATER_CAULDRON);
            block.getPersistentDataContainer().set(new NamespacedKey(this, FAKE_WATER_KEY), PersistentDataType.STRING, "true");
            block.setLevel(3);
            fakeWaterBlocks.add(block);
        }

    }```
🥲
#

its making me crazy ;-;

hazy breach
agile anvil
#

The water flow is actually the easiest. don't overcomplicate with a list.

For the water flow you just have the handle the event BlockFromToEvent.
If the block from is water and have the pdc, the apply pdc to the To block. (Don't try setting a block, or changing a list or whatever)

#

Then you have one more thing to do (2 in reality):

  • When you place the water in exisiting water lake
  • When the water flow touches an exisiting water lake
#

You should create a method like gatherLake(Location location, int maxRadius) that will return all the connected water blocks to the location in a given maxRadius

#

This is why I say you should inspire from WE's drain method: this command gather all connected water blocks from your location and removes them. You should do the same but instead of removing, just apply the pdc

dawn valley
#

thx ill try those now and let you know how it goes 😢

agile anvil
#

Good luck! Stay motivated this is really interesting ahah

tall dragon
#

you now have a bunch of the fake water out of thin air

ocean hollow
#
        if(loc.getChunk().isLoaded()) {
            PlayerProfile profile = getProfile("https://textures.minecraft.net/texture/" + textureURL);
            Block block = loc.getBlock();
            block.setType(Material.PLAYER_HEAD);
            Skull skull = (Skull) block.getState();
            skull.setOwnerProfile(profile);
            skull.update(false);
        }
    }
chrome beacon
ocean hollow
#

for real?

chrome beacon
#

You're probably running a modded client or smth

ocean hollow
#

Vanilla ☠️

chrome beacon
#

Or are you frequently upading the heads?

#

Updating*

ocean hollow
#

yeah

chrome beacon
#

Show that code

#

Heads might flicker a bit while the client is downloading the skins

#

Should go away though

agile anvil
#

But once more the method "gatherLake" could be use to revert

#

(limited tho)

ocean hollow
ocean hollow
# chrome beacon Show that code
        Block block = loc.getBlock();
        PlayerProfile profile = getProfile("https://textures.minecraft.net/texture/" + textureURL);
        
        if(loc.getChunk().isLoaded()) {
            if(block.getType() != Material.PLAYER_HEAD){
                block.setType(Material.PLAYER_HEAD);
                
                Skull skull = (Skull) block.getState();
                skull.setOwnerProfile(profile);
                skull.update(false);
            }
            else{
                Skull skull = (Skull) block.getState();

                if(skull.getOwnerProfile().getTextures() != profile.getTextures()){
                    skull.setOwnerProfile(profile);
                    skull.update(false);
                }
            }
        }
    }```
#

I can change the head if it is not equal to the new one?

tall dragon
#

that aughta be a big mess

#

with a ton of edge cases

agile anvil
#

True...

#

I think that from the start it's imfeasible in practice

tall dragon
#

haha

#

even then its still. pretty difficult to get a good system going

agile anvil
#

Even with that imagine having to recompute all the water sources everytime. Especially if a player is undecise about where to place its bucket lmao

tall dragon
#

yea thats going to be pretty heavy ;d

zealous ice
#

Howdy, im fairly inept at coding and all that

#

im trying to figure out a way to get the PlayerPortalEvent and EntityPortalEvent to trigger only when using nether portals, as an issue im facing with a 1:1 nether overworld plugin is affecting the end portals as well

#

I cant find any way to differentiate the two portals to ensure that the end doent spawn you in the void

zealous ice
#

thank you!

#

i'll test it out to see if it works

#

might take me a second, not familiar at all

tall dragon
zealous ice
#

ah

tall dragon
# zealous ice ah

if you really need to differentiate there. you could theoretically use getFrom() and use the the block material to figure out which portal it is.

zealous ice
#

Im illiterate, can i post the code here to get a bit of help implementing the get cause for the playerportalevent?

lilac dagger
#

sure

zealous ice
#

package nether;

import org.bukkit.Location;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityPortalEvent;
import org.bukkit.event.player.PlayerPortalEvent;

public class EventsListener implements Listener {

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntityPortal(EntityPortalEvent event) {
    Location from = event.getFrom().clone();
    Location to = event.getTo();
    from.setWorld(to.getWorld());
    event.setTo(from);
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerPortal(PlayerPortalEvent event) {
    Location from = event.getFrom().clone();
    Location to = event.getTo();
    from.setWorld(to.getWorld());
    event.setTo(from);
}

}

#

this is sourced from **omnikeycard / sync-world-and-nether ** on github

tall dragon
agile anvil
#

I think he wants to make the nether portal teleports you to the exact same location of overworld but in nether

#

And do that only for nether and not the end

zealous ice
#

So, the github description is for a 1:1 nether overworld travel, something ive been trying to implement for a bit.

However we faced the problem that the plugin was interacting with the end portals, resulting in funky interactions (teleporting into the void, or in one case the nether, no clue how)

agile anvil
#

So the solution for this would be to check if the To location is in the end

zealous ice
#

neat

agile anvil
#

If this is the case don't change the location

tall dragon
#

jup^

agile anvil
#

And is the plugin intended to also change the location if nether ~> overworld?

zealous ice
#

it should yeah, it makes the portals 1:1 between coords on each

#

im not too worried about entities, just the player interaction

agile anvil
#

If this is the case apply the event only if getFrom world is overworld or nether AND the getTo world is not the end

tall dragon
#

you might also need to mess with PortalCreateEvent though. cuz else ur going to end up with portals at locations other than where u actually spawn

agile anvil
#

To check this you might want to use the name of the world, or the World.Environment

smoky anchor
#

(I believe you could make a datapack with one file, it would replace the vanilla dimension specification and change the scale so it is 1:1 with overworld)

tall dragon
#

though idk if PortalCreateEvent is called before or after PlayerPortalEvent it depends on that

#

if its after it should just create it at the correct destination. if not ur gonna have to generate the portal urself ;dd

smoky anchor
agile anvil
tall dragon
#

lmfao i was just thinking @wet breach aughta know & they are already typing

wet breach
#

if a portal exists, then a create event won't happen

#

but you will still have the teleport event

#

PortalEvent happens just before teleporting and they are about to teleport because they are standing in that portal frame for however long it takes

tall dragon
wet breach
#

create will happen before teleporting

#

portal event happens first

tall dragon
#

ye so create happens at destination of portalevent then?

wet breach
#

so the order is this PortalEvent - > Create - > Teleport

tall dragon
#

yea i figured

wet breach
#

just can't rely on create event always firing

#

but you can check that from PortalEvent

#

as you can figure out ahead of time if a portal is going to get created or not

tall dragon
#

you dont have to tho. if the portal already exists it would be at the correct destination already

wet breach
#

yeah

wet breach
#

using PortalEvent

#

XD

#

can make some interesting traveling methods by slightly adjusting that radius lol

tall dragon
#

yea

#

you can also make linking portals at specific spots very annoying if you adjust that ;d

wet breach
#

lol

#

I remember once not being able to get back to a portal because of that

#

it was 3 portals, 2 in the over world and 1 in the nether

#

you could go through it one way, but not the other well could but you wouldn't end up in the same portal

tall dragon
#

i guess the 2 in the overworld were going to the same one in the nether right? ;d

wet breach
#

yes

#

just on opposite ends of the travel

solemn meteor
#

I get this warning at IntelliJ, and I noticed when packaging a different plugin, it doesnt appear, its just my plugin. I assume theres an easy fix?

lilac dagger
#

you might have the old maven version or something

wet breach
#

well, they are using 3.8.1

#

so that is pretty old I guess

#

what we at 3.11 now?

solemn meteor
#

oh damn

#

do I just update and it goes away?

lilac dagger
#

i don't know, i had the same error and it fixed by itself over time

wet breach
#

nvm, we at 3.9

#

not quite at 3.11 just yet

wet breach
lilac dagger
#

i hope they won't pull a minecraft and go to .10

tall dragon
#

like having Y axis be vertical

#

👏

lilac dagger
#

oh yeah, we all hate y being vertical

#

but z for depth is the worst

smoky anchor
#

.10 makes sense tho
and Fr33styler, your statement is incorrect, I like y being vertical

wet breach
#

actually it makes sense that y is vertical

#

if you take a grid on paper, y is vertical

#

if you stand it up that is how it is in MC. So all mojang did was stood it upright

lilac dagger
#

i thought this was just a joke

#

y is used in math for vertical since before i was born

agile berry
#

Hello, can you help me with this error? Already tried all solutionsn i can find...

[13:05:46 ERROR]: Encountered an unexpected exception
java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
    at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:325) ~[?:1.8.0_391]
    at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:267) ~[?:1.8.0_391]
    at java.util.jar.JarVerifier.processEntry(JarVerifier.java:329) ~[?:1.8.0_391]
    at java.util.jar.JarVerifier.update(JarVerifier.java:239) ~[?:1.8.0_391]
    at java.util.jar.JarFile.initializeVerifier(JarFile.java:402) ~[?:1.8.0_391]
    at java.util.jar.JarFile.getInputStream(JarFile.java:478) ~[?:1.8.0_391]
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:181) ~[patched_1.16.5.jar:git-Paper-794]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:160) ~[patched_1.16.5.jar:git-Paper-794]
    at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:393) ~[patched_1.16.5.jar:git-Paper-794]
    at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:269) ~[patched_1.16.5.jar:git-Paper-794]
    at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Paper-794]
    at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
    at java.lang.Thread.run(Thread.java:750) [?:1.8.0_391]

solemn meteor
agile berry
#

I have javacord and sqlite dependencies

lilac dagger
solemn meteor
#

warning is still present even after updating

#

Ik its just a warning but I dont like getting warned

lilac dagger
#

so that's why i said they pulled a.10

#

mayber reload?

tall dragon
#

idk i always got thought in school that Z is vertical in a 3d coordinate system

wet breach
tall dragon
#

so sometimes i forget

smoky anchor
#

You guys care about warnings ?

lilac dagger
#

oh yeah

#

i hate warnings

wet breach
#

because while sometimes you can ignore it, sometimes you might not want to

eternal oxide
smoky anchor
#

I have had warnings during build with maven for years, never cared :D
I do not like warnings in code tho

lilac dagger
#

sometimes you have to scroll up to see if the build was a success

#

i guess you can infer that it succeded if you see the warnings

smoky anchor
#

It always says [Build Successful] as like the last line tho ?

lilac dagger
#

but i still scrolled up

lilac dagger
#

what mento showed is what i remembered seeing as the result

wet breach
#

in this case, z does become vertical

solemn meteor
#

again, I probably shouldnt care this much cuz its just a warning

lilac dagger
#

look into your dependencies

#

if you have build plugins look there also

#

update the dependencies and plugins to fix it hopefully

native ruin
#

is there a function for the spyglass zoom stuff or is it clientside?

lilac dagger
#

if you can't you're out of luck i guess

smoky anchor
solemn meteor
#

ykw I give up

lilac dagger
#

you can look into what dependencies the project has

lilac dagger
#

altho i don't think plugins show up there

smoky anchor
agile berry
#

i think it is not a paper, spigot or bukkit problem

#

as i red, it means that i included signed jar in my dependencies

native ruin
quaint mantle
#

are u able to send more than 1 packet at once?

agile berry
#

but i already added excludes, and they didn't help at all

wet breach
zealous ice
#

datapack works

#

thanks lads

agile berry
#
<filter>
    <artifact>*:*</artifact>
    <excludes>
        <exclude>META-INF/*.SF</exclude>
        <exclude>META-INF/*.DSA</exclude>
        <exclude>META-INF/*.RSA</exclude>
    </excludes>
</filter>
quaint mantle
#

i found the packet on wiki.vg but i cant find it in intellij

agile berry
#

Is therre a way to know which dependency is signed?

potent ocean
#

What packet is it?

agile berry
#

💀

dawn valley
#

on water surface '='

#

when i am in the water its not working litteraly tried everything

acoustic pendant
#

How laggy would be a repeating task every 5 ticks that teleports armor stands?

wet breach
#

should just exclude the entire meta directory

agile berry
#

i dont even have compiler

topaz cape
#

how do i get the closest color to a hex color

#

of like legacy colors

#

so red, blue, etc

wet breach
topaz cape
#

i could just use Adventure for it

#

since im already shading it in

wet breach
#

use RGB values, bitshift, then you have your color in hex

#

pretty simple

topaz cape
#

for me doesn't sound so simple

#

o.O

lost matrix
acoustic pendant
lost matrix
acoustic pendant
lost matrix
#

What is your intention with those armorstands

acoustic pendant
#

like, follow the player

#

that's already done

wet breach
#

why not just attach them to the player

acoustic pendant
#

this is the goal (already achieved)

#

the thing is, with 50 players, this may cause lag right? I mean every 5 ticks 50 armor stands are being teleported

lost matrix
#

Ah i see. Btw an item display could make use of interpolation, making the following around very smooth.

lost matrix
acoustic pendant
acoustic pendant
pallid oxide
#

armorstands have just lot more checks than displays those are way lighter

lost matrix
# acoustic pendant yea? okay thanks!

What you can do is evenly separate all players into buckets.
So instead of ticking 50 players every 5th tick, you simply tick one bucket (containing 10 players each) every tick.

This will help you evenly distribute the load over several ticks instead of having one tick where the load spikes.
Also described in:

#

?workdistro

acoustic pendant
lost matrix
#

You should only have one task for this

acoustic pendant
#

and separating tasks with hashmaps

lost matrix
#

🤨

acoustic pendant
#

what

lost matrix
#

So you start a task in the PlayerMoveEvent with a delay of 5 ticks?

agile berry
acoustic pendant
#

let me send

#

it is not finished as I'm changing the code

lost matrix
#

Yeah, again. I would not create one task per player.
Just create a single task when the server starts, and then add/remove players to/from the task.

acoustic pendant
#

I already have an event for that, that's why i can't do that

lost matrix
#

Yes. In that case you add/remove the player and his pet.

acoustic pendant
#

yea, what i'm doing

#

btw

#

to cancel a task i've seen people using cancel(); but that doesn't seem to work

tall dragon
#

if you just would use what 7smile is rightly suggesting u woulnt need to cancel tasks

lost matrix
#

Let me start my IDE and show an example

tall dragon
#

u havent said anything to suggest you can't tho

tall dragon
#

that system easily supports equiping & unequiping pets

acoustic pendant
#

but not all the task will start at the same time

lost matrix
# acoustic pendant .
public class PetTask implements Runnable {
  
  private final Set<Pet> activePets = new HashSet<>();
  
  // Call when pet is spawned
  public void addPet(Pet pet) {
    activePets.add(pet);
  }
  
  // Call when pet is despawned
  public void removePet(Pet pet) {
    activePets.remove(pet);
  }
  
  @Override
  public void run() {
    for(Pet pet : activePets) {
      pet.update();
    }
  }
}
#

You start this in your onEnable and then add/remove pets when they spawn/despawn

#

Never have to manage or cancel any tasks ever

agile berry
#

bruh why can't i exclude signatures from pom.xml?

#
[14:25:41 ERROR]: Encountered an unexpected exception
java.lang.SecurityException: Invalid signature file digest for Manifest main attributes

i trying to fix that for 2 days ahhh

acoustic pendant
#

I think i'm not understanding

#

I mean, I want to move the pet only when the player moves and only towards the player

sand spire
lost matrix
#

*The UUID of the player plox

acoustic pendant
#

yea

lost matrix
#

I mean... if you are careful then you could use the Player as well.

acoustic pendant
#

Ok, i'll try what you are suggesting

#

thanks

tall dragon
#

in pet#update u can just check if the distance to the owner player becomes above a certain threshhold

#

after which u can get moving

lost matrix
# acoustic pendant Ok, i'll try what you are suggesting
public class Pet {
  
  private final Player owner;
  private final ArmorStand bukkitEntity;

  public Pet(Player owner, ArmorStand bukkitEntity) {
    this.owner = owner;
    this.bukkitEntity = bukkitEntity;
  }
  
  private void teleportToOwner() {
    
  }
  
  public void update() {
    this.teleportToOwner();
  }
  
}

This could be a pet (with hard references to make it simpler)

acoustic pendant
#

Yea

#

I'm looking for implementing it in the moveevent 1s

#

Because this will still be following player yaw's

lost matrix
#

With what @tall dragon suggested your impl could be a bit like this

public class Pet {
  
  private static final double MAX_DEVIATION = 0.25D;
  
  private final Player owner;
  private final ArmorStand bukkitEntity;

  public Pet(Player owner, ArmorStand bukkitEntity) {
    this.owner = owner;
    this.bukkitEntity = bukkitEntity;
  }
  
  private void teleportToOwner() {
    Location target = this.calculateTargetPosition();
    Location current = this.bukkitEntity.getLocation();
    double distanceFromTarget = current.distance(target);
    // Doesnt need to teleport
    if(distanceFromTarget < MAX_DEVIATION) {
      return;
    }
    this.bukkitEntity.teleport(target);
  }

  private Location calculateTargetPosition() {
    // TODO: Implement where the Pet should be
  }

  public void update() {
    this.teleportToOwner();
  }

}
#

But its getting pretty spoon feedy already...

acoustic pendant
#

I can stop that if the pet is in the location I want ig

lost matrix
acoustic pendant
#

Like the armor stand will still reach it's destiny but if the player is still, it won't follow it's yaw

#

I don't know if i'm explaining my self

lost matrix
#

You can do that by just ticking the Pet

#

No need for the PlayerMoveEvent

acoustic pendant
sand spire
# lost matrix ```java public class PetTask implements Runnable { private final Set<Pet> a...

I assume I should also use this runnable system onEnable with adding & removing players, because right now I'm refreshing an auctionhouse GUI like this

@Override
    public void decorate(Player player) {
        if (!getInventory().getViewers().contains(player)) {
            return;
        }

        if (task != null) {
            task.cancel();
        }

        task = Bukkit.getScheduler().runTaskLater(CustomItems.getINSTANCE(), () -> refreshInventory(player), 20);
    }```

```java
public void refreshInventory(Player player) {
        for (int i = 0; i < inventory.getSize(); i++) {
            this.buttonMap.put(i, GUITemplates.airButton());
        }
        decorate(player);
    }```
lost matrix
# acoustic pendant wdym with ticking?

You Pet has an update() method.
And this is run every tick as long as the Pet is spawned.
In your update() method, you simply check:

  • Is the Entity too far away from its desired position -> If yes: Teleport to desired Position
  • Is the Entities looking direction too far from the players looking direction -> If yes: Rotate to desired Rotation
acoustic pendant
#

I think that's a great way of doing it

#

Ty!

tall dragon
#

does any1 know what would be the best way of serializing interfaces using gson? with that i mean implementations of the interface of which i dont know the type during runtime. i'll probably have to serialize the classname and then somehow tell gson to use that class for deserializing i guess. but how

lost matrix
twin venture
#

Hi , how i can spawn the fake entity using protocolib in 1.20.4 ?
i tried but didn't understand how..
do i do this?

#

i just wana get the grasp of it

chrome beacon
#

0x01 is the packet id and ProtocolLib already handles that for you

tall dragon
chrome beacon
#

All entities have a unique id

#

It's always incrementing for each entity spawned

#

It's then used to identify the entity in future packets

twin venture
#

so now i can have dfffrent id right?

chrome beacon
#

Random id doesn't guarantee it's unique

twin venture
#

what should i do then?

chrome beacon
#

You can use NMS to get an id to use

twin venture
#

i don't wana use nms , cuz the plugin will support 1.20.4 , 1.19.4 , and older

#

maybe even to 1.13.2

tall dragon
#

or start with a pretty high number. but thats obviously not 100% fool proof either

chrome beacon
#

Then you'll just have to run the risk of it breaking randomly

twin venture
#

ok , can you help me finish it ?
i want it to have gravity / invisiable / and armorstand for 1.20.4

#

just wana see how the code acctully works

lost matrix
# tall dragon sure

Wait i just had a great Idea on how to make this way better.
But let me give you the quick rundown of the current way:
You save the runtime class and data in a top level Json node and then register this as a type hierarchy adapter on your interface.class

#

Ill come back if my new idea works

#
    Gson gson = new GsonBuilder().disableHtmlEscaping()
        .setPrettyPrinting()
        .enableComplexMapKeySerialization()
        .registerTypeHierarchyAdapter(YourInterface.class, new AbstractClassAdapter())
        .registerTypeHierarchyAdapter(AnotherInterface.class, new AbstractClassAdapter())
        .registerTypeHierarchyAdapter(SomeAbstractClass.class, new AbstractClassAdapter())
        .create();
tall dragon
#

would this work with multiple implementations of the same interface?

#

actually yea it does seem like that would work woulnt it

twin venture
#

pretty nice idea , 7smile7

#

think gonna try it xD

lost matrix
# tall dragon would this work with multiple implementations of the same interface?

Yes. Example:
You register for Vehicle interface and have a Car class as well as a Motorcycle class.
Then your serialized data would be:

{
  "@CLASS": "com.shuri.vehicles.impl.Car"
  "@DATA": {
    "Tires": 4,
    "PS": 96
  }
}
{
  "@CLASS": "com.shuri.vehicles.impl.Motorcycle"
  "@DATA": {
    "Color": "Red",
    "Vendor": "Yamaha"
  }
}

And each will get deserialized as their Runtime class again, because you pull the class directly from the json file:
It doesnt need to be inferred or passed anymore.

tall dragon
#

yea this is great, thanks!

tall dragon
#

it might be even better

twin venture
#

can you help me understand what i put in the first paramter?

#

its getbooleans i think bcz its a boolean right?

lost matrix
# tall dragon it might be even better

Yes, my idea includes write a TypeAdapterFactory which scans the type hierarchy of a class to check if it contains an abstract class or interface.
This way you dont even have to register your type adapters anymore 🙂
This + a neat wrapper class. Ill let you know if it works.

sand spire
tall dragon
sand spire
#

1 = 0

lost matrix
twin venture
#

so that for gravity right?

upper hazel
#

20?

sand spire
twin venture
#

ohhhhhhhhhhhhhhhhh

#

starting to understand

twin venture
#

right?

upper hazel
#

block setType

sand spire
twin venture
#

right?

tall dragon
sand spire
#

0, 0, 0, 1, 2, 0, 1 if you start at VarInt

sand spire
twin venture
#

that's pretty easy how i didn't understand that before?

blazing ocean
upper hazel
upper hazel
twin venture
#

if i for example want to send a entity meta for 1.12.2 < ?

sand spire
desert spade
#

hi folks, im trying to run buildtools for 20.4 but keep running into this error.
works fine on other versions, just compiled 20.2 with no issues. does anyone know if there's an issue with 20.4 atm or is this me forgetting how to dev

#
Patching net\minecraft\advancements\AdvancementHolder.java
Exception in thread "main" java.lang.RuntimeException: Error patching net\minecraft\advancements\AdvancementHolder.java
        at org.spigotmc.builder.Builder.lambda$startBuilder$2(Builder.java:617)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
        at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at org.spigotmc.builder.Builder.startBuilder(Builder.java:568)
        at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
Caused by: java.io.FileNotFoundException: work\decompile-c13d4d77\net\minecraft\advancements\AdvancementHolder.java (The system cannot find the path specified)
desert spade
#

yep still doesn't work

sand spire
river oracle
tall dragon
desert spade
#

haven't tried clearing caches, will try that thanks

#

that worked thanks guys 🙏

restive mango
#

Idk why everyone here dislikes nms

#

It’s really powerful

tall dragon
#

who said that

sand spire
#

it looks like chinese tho

tall dragon
#

alot of people use it unnecessarily

lost matrix
#

So much work

#

But if this works i might be able to just throw anything at my uber Gson instance

blazing ocean
#

kotlinx.serialization my beloved

lost matrix
blazing ocean
#

its just way too fun

chrome beacon
#

Configurate <3

blazing ocean
#

hey, better than dealing with jsonobject jsonreader stuff

lost matrix
#

If you properly use Gson then you should never see internals like JsonObject or JsonReader unless you are writing utility for internals yourself.

blazing ocean
#

i dont use anything properly

#

(this is my video cable)

lost matrix
#

Wait, this can work actually

blazing ocean
#

ethernet male to female

#

male to male*

lost matrix
#

But you need en/decoder in your cabels because some of the AVI channels need to be multiplexed on some of the LAN channels

blazing ocean
#

i would honestly be down to build this cable

lost matrix
#

And you could have a wireless transmitter/receiver on those as well.
You sure that this cable doesnt actiually exist?

blazing ocean
#

¯_(ツ)_/¯

near crypt
#

how can I get the title of an inventory? because inventory.getView() ist not working

blazing ocean
#

?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.

lost matrix
near crypt
#

for checking it in the Inventory Click event

blazing ocean
#

check for the actual inventory

#

(object.equals)

lost matrix
# near crypt for checking it in the Inventory Click event

You should never compare titles of inventores for GUIs.
Inventory implements equals() and hashCode().
This means you can simply put them in a Set<Inventory> and check with set.contains()
or create a single inventory somewhere and check if it equals() the clicked inventory.

near crypt
#

oh ok tysm

twin venture
#

is this how i should use it?

#

this is for 1.20.4

lost matrix
proud badge
#

does placing and breaking a shulker remove its PDC?

lost matrix
#

Yes

proud badge
#

damn

twin venture
#

in the terms of performance?

river oracle
#

It's not that hard

lost matrix
# proud badge damn

We added a method a few months ago that lets you copy over the PDC. Can be used in the break and place event.

lost matrix
river oracle
twin venture
river oracle
#

A very silly reason

twin venture
#

but iam not sure if its good idea ..

#

thinking about reflection >_<

river oracle
#

Reflection is objectively worse

near crypt
#

With this code the inventory will never open when I right click air, but the right click air action is checked.

public void onPlayerInteract(PlayerInteractEvent event) {
        if(!(event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR)) return;
        if(event.getItem() == null) return;

        //Variables
        Player player = event.getPlayer();

        //Check for items
        ItemMeta itemMeta = event.getItem().getItemMeta();
        if(event.getItem().getType() == Material.COMPASS && itemMeta.getDisplayName().equals(inventoryName)){
            player.openInventory(inventory);
        }
    }```
river oracle
#

No competition

twin venture
#

gonna try packets and see how its gonna go

sand spire
worldly ingot
twin venture
#

trying to make it diffrent

#

^_^

worldly ingot
near crypt
twin venture
#

sorry to ruin it for ya xD

worldly ingot
#

I mean you're just intentionally making it more difficult for yourself and circumventing the version-independent API

#

but to each their own

sand spire
near crypt
near crypt
#

the inventory will not open when i click the air, only when i click on a block

sand spire
#

change || to &&

near crypt
#

no, why?

#

this makes no sense

sand spire
rapid vigil
# near crypt the inventory will not open when i click the air, only when i click on a block
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
        if(event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.RIGHT_CLICK_AIR)) return;
        if(event.getItem() == null) return;

        //Variables
        Player player = event.getPlayer();

        //Check for items
        ItemMeta itemMeta = event.getItem().getItemMeta();
        if(event.getItem().getType() == Material.COMPASS && itemMeta.getDisplayName().equals(inventoryName)){
            player.openInventory(inventory);
        }
    }``` try this
tall dragon
#

when u right click air ur logic resolves to

if(!(false || true)) -> if(!(true) -> if(false)

near crypt
#

it is still the same problem

tall dragon
#

u want to open the inv when u right click block or right click air?

near crypt
#

yes

tall dragon
#

ru sure its not another check failing

#

like the displayname for example

#

cuz that looks correct

rapid vigil
#

he said it only opens the gui when he clicks on a block so the displayname check should be fine

near crypt
#

yes it is..

#
if(event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR) {
            event.getPlayer().sendMessage("test");
        }```
when i right click air it is doing nothing and when i click on a block it shows me the message "test" twice
#

this is weird..

tall dragon
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
young knoll
#

Right click air only fires if you are holding an item

#

And yeah, the event fires once for each hand

near crypt
#

oh ok but still, it does nothing when i click air

tall dragon
#

well log the action at the top

acoustic pendant
#

I made so if player and the armor stand have a distance of less than 1, to not move the armor stand but that din't work

lost matrix
acoustic pendant
#

me neither lol

near crypt
#
event.getPlayer().sendMessage("" + event.getAction());```
this is never showing me a air click.. the event is not even triggered when clicking air
lost matrix
#

Do you want to check if the Pet is looking in the same direction as the ArmorStand?

acoustic pendant
#

I did this

near crypt
acoustic pendant
#

double distance = owner.getLocation().distance(pet.getLocation());

if (distance < 1)
return;

#

but didn't seem to work

#

nvm

#

now works xd

rapid vigil
#
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
        if(e.getItem() == null) return;
        
        if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
          //Variables
          Player player = event.getPlayer();

          //Check for items
          ItemMeta itemMeta = event.getItem().getItemMeta();
          if(event.getItem().getType() == Material.COMPASS && itemMeta.getDisplayName().equals(inventoryName)){
              player.openInventory(inventory);
        }
      }
  }``` try this
rapid vigil
twin venture
#

hi while using 1.20.4 iam getting this bug .
cannot access org.bukkit.plugin.java.JavaPlugin

#

that's why i don't do newer version :p

chrome beacon
#

.-.

#

Let me guess you tried to depend on the Spigot 1.20.4 jar directly

twin venture
#

get it

rapid vigil
# near crypt yes

try replacing if(e.getItem() == null) return; with if(!e.hasItem()) return; although it probably wont make a difference

near crypt
#

this is pointless.. the event is not even triggered when I click air

rapid vigil
#

well thats weird

near crypt
#

i found the issue

#

the ignoreCancelled was set to true

tall dragon
storm raven
#

hello, I would like with a command to modify only one part of my config file, only, I searched but at times, it changes all my config file, how can I do?

rapid vigil
storm raven
chrome beacon
#

What do you mean by modifies all

storm raven
#

I'll show you just wait a moment

#

my config file before ordering

#

after placing the order

#

instead of modifying only x, y and z, it modifies all my file

wet breach
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

storm raven
#

to modify my config file I do


EthernaPl.getInstance().getConfig().set("general.message.lobby.x", x);
EthernaPl.getInstance().getConfig().set("general.message.lobby.y", y);
EthernaPl.getInstance().getConfig().set("general.message.lobby.z", z);
EthernaPl.getInstance().saveConfig();
chrome beacon
#

Did you edit the config after starting the server

#

manually*

storm raven
#

no

chrome beacon
#

Show us the entire config related code

#

?paste

undone axleBOT
storm raven
#

that's to say ?

chrome beacon
#

how you load and modify the config

storm raven
chrome beacon
#

so ofc it doesn't work

storm raven
#

my config.yml

general:
  error: "This command can only be executed by a player."
  prefix: "&f&l[&cEtherna&f&l]&r "

  message:
    BroadCast:
      ERROR: "&c Please specify a message!"
      prefix: "&f&l[&cAlert&f&l]"
      reload: "&c&l/!\ &fThe server will reload, any changes during reload will be rolled back &c&l/!\\"

    lobby:
      message: "&aYou have just been teleported to the lobby"
      SaveCoMessage: "&bHub coordinates updated."
      x:
      y:
      z:
      error: "&c&lNo coordinates have been defined, use the </sethub> command to define the coordinates"

  check:
    error: "Usage: /viewreports <player>"
    NoneReport: "No reports found for player %player%"

storm raven
young knoll
#

ofc = of course

storm raven
#

how can I resolve the problem?

storm raven
#

but if I delete them, there will be nothing to replace

tall dragon
#

well ur code places it there doesnt it

#

it doesnt need anything to replace

twin venture
#

Hi this is my code for 1.20.4 .. and now i get bugs

storm raven
twin venture
#

should be 0 i think

tall dragon
twin venture
#

everything else is corret right?

storm raven
tall dragon
#

idk seems fine yea

twin venture
storm raven
tall dragon
#

do u have any errors upon server startup?

twin venture
#

i get error here

#

for 1.20.4

storm raven
rapid vigil
# storm raven but that didn't change anything, it still changes all the files

It doesn't matter where you locate the location data in the config because players aren't supposed to edit it via the config when you have a SetHub command. Just make the set path "hub.x", "hub.y", "hub.z" instead and read it from hub. Of course it's better to fix your yaml format to avoid future problems but if you want a quick fix for now that should do.

storm raven
rapid vigil
#

?

tall dragon
#

i cant spot it

rapid vigil
tall dragon
#

i mean i told him to remove the empty values & everything being in general should not cause this issue right?

storm raven
#

otherwise, I can't create a 2nd config file?

#

however I don't know how to create 2 ;-;

rapid vigil
storm raven
#

understood

rapid vigil
tall dragon
rapid vigil
#

you could just save the location directly because Location implements ConfigurationSerializable

storm raven
#

so to avoid other problems it is better to delete the general section

tall dragon
#

set should only replace that at the full path

rapid vigil
tall dragon
#

that would make very little sense

#

docs also say it sets the specified path to the given value

rapid vigil
#

i think the set method is for telling it what to set and saveConfig is what actually sets it

#

didnt u think why set doesnt automatically save

tall dragon
#

yea of course

#

but saveConfig has nothing to do with the replacing part

#

set determines the structure

rapid vigil
#

this yaml issue is giving me braincell lose XD

tall dragon
#

its more likely his original config is somehow empty

#

they should find out if the config from getConfig() before editing actually contains all the fields

rapid vigil
tall dragon
#

yea, im really not sure

#

but im 99% sure set method should not replace everything like that

#

it never has for me

storm raven
rapid vigil
#

show code and file

#

just the part where u set the location

storm raven
#
error: "This command can only be executed by a player."
prefix: "&f&l[&cEtherna&f&l]&r "


BroadCast:
  ERROR: "&c Please specify a message!"
  prefix: "&f&l[&cAlert&f&l]"
  reload: "&c&l/!\ &fThe server will reload, any changes during reload will be rolled back &c&l/!\\"

lobby:
  x:
  y:
  z:
  message: "&aYou have just been teleported to the lobby"
  SaveCoMessage: "&bHub coordinates updated."
  error: "&c&lNo coordinates have been defined, use the </sethub> command to define the coordinates"

check:
  error: "Usage: /viewreports <player>"
  NoneReport: "No reports found for player %player%"
#

Before :

rapid vigil
#

oh you put text in there too, i meant put it separately from any text

storm raven
#

(before after ordering)

#
error: "This command can only be executed by a player."
prefix: "&f&l[&cEtherna&f&l]&r "


BroadCast:
  ERROR: "&c Please specify a message!"
  prefix: "&f&l[&cAlert&f&l]"
  reload: "&c&l/!\ &fThe server will reload, any changes during reload will be rolled back &c&l/!\\"

lobby:
  message: "&aYou have just been teleported to the lobby"
  SaveCoMessage: "&bHub coordinates updated."
  error: "&c&lNo coordinates have been defined, use the </sethub> command to define the coordinates"

check:
  error: "Usage: /viewreports <player>"
  NoneReport: "No reports found for player %player%"
  
sethub:
  x:
  y:
  z:

#

like that ?

rapid vigil
#

remove the sethub from the default config tho

#

make the plugin put it

storm raven
#
error: "This command can only be executed by a player."
prefix: "&f&l[&cEtherna&f&l]&r "


BroadCast:
  ERROR: "&c Please specify a message!"
  prefix: "&f&l[&cAlert&f&l]"
  reload: "&c&l/!\ &fThe server will reload, any changes during reload will be rolled back &c&l/!\\"

lobby:
  message: "&aYou have just been teleported to the lobby"
  SaveCoMessage: "&bHub coordinates updated."
  error: "&c&lNo coordinates have been defined, use the </sethub> command to define the coordinates"

check:
  error: "Usage: /viewreports <player>"
  NoneReport: "No reports found for player %player%"
rapid vigil
#

yes

storm raven
#

like that ?

rapid vigil
#

now try to set the lobby

#

make sure its like that in the plugin's file in the server

storm raven
#

Before

tall dragon
#

could this cause it? somehow its caching an empty config maybe?

rapid vigil
storm raven
#

so what should I do?

tall dragon
#

remove getConfig() lol

#

it does nothing

rapid vigil
#

the first time he sent his code i thought of that but i was like "nah no way it cant do such a thing" but we still not 100% sure

storm raven
#

ahhhh it’s there!!!

tall dragon
#

😂

rapid vigil
#

cool so it was that little line...

storm raven
#

wait

rapid vigil
#

that always happens

#

the supsicious line is always there and you're always suspicious of it at the beginning but you only decide to tackle it after trying everything else lmao

storm raven
#

no it's good

#

really, thank you !

storm raven
#

just, now she's taking something away from me ""

#

Before

#

error no longer has a quote

tall dragon
#

that dont matter

#

its still gonna work

storm raven
#

a ok

tall dragon
#

not actually sure how it decides that

#

it does it seemingly at random lol

storm raven
#

thanks

valid burrow
#

just set a / infront of the "

storm raven
#

to do what ?

valid burrow
#

it wont be shown as an error anymore

#

it marks it as a normal char thus not interpreting it as a string ending or beginning

tall dragon
#

isnt that \ ?

valid burrow
#

yh mb

#

phone keyboards are hard

tall dragon
#

fair

storm raven
#

I can't have a double quote

tall dragon
#

he means these @storm raven

#

put a backslash before them

storm raven
#

otherwise no problem, thank you

tall dragon
#

cuz yml thinks ur string stops at the first " witihout a backslash now

storm raven
#
error: "This command can only be executed by a player."
prefix: "&f&l[&cEtherna&f&l]&r "


BroadCast:
  ERROR: "&c Please specify a message!"
  prefix: "&f&l[&cAlert&f&l]"
  reload: "&c&l/!\ &fThe server will reload, any changes during reload will be rolled back &c&l/!\\"

lobby:
  message: "&aYou have just been teleported to the lobby"
  SaveCoMessage: "&bHub coordinates updated."
  error: "&c&lNo coordinates have been defined, run the </sethub> command to define the coordinates"

check:
  error: "Usage: /viewreports <player>"
  NoneReport: "No reports found for player %player%"
#

like that ?

tall dragon
#

this one seems fine the AucunReport is gone

upper hazel
#

Any ideas about clamping the button and its implementation?

#

in playerInteract for example

astral scroll
#

how can i remove the hit delay?

chrome beacon
#

Increase the attack speed

#

or are you talking about invulnerability ticks?

astral scroll
#

both of them

#

like

#

remove the hit delay but without making it literally combo fly

#

im doing this

#

but i think thats invulnerability

sterile flicker
#
BufferedImage image = ImageIO.read(SumeruTroll.class.getClassLoader().getResourceAsStream("image.jpg"));
                        MapView mapView = Bukkit.createMap(Bukkit.getWorlds().get(0));
                        mapView.setScale(MapView.Scale.NORMAL);
                        mapView.addRenderer(new MapRenderer() {
                            @Override
                            public void render(MapView map, MapCanvas canvas, Player player) {
                                canvas.drawImage(0, 0, MapPalette.resizeImage(image));
                            }
                        });

                        org.bukkit.inventory.ItemStack mapItem = new ItemStack(Material.MAP, 1);
                        mapItem.setDurability(mapView.getId());

                        EntityItemFrame item = new EntityItemFrame(((CraftWorld) target.getWorld()).getHandle());
                        item.setNoGravity(true);

                        item.setLocation(target.getPlayer().getLocation().getX(),
                                target.getPlayer().getLocation().getY()+1,
                                target.getPlayer().getLocation().getZ(), 0.0F, 0.0F);
                        item.setItem(CraftItemStack.asNMSCopy(mapItem));

                       
                        for (Player p : Bukkit.getOnlinePlayers()) {
                            if (p.equals(target)) {
                                continue;
                            }
                            ((CraftPlayer) p).getHandle().playerConnection.sendPacket(new PacketPlayOutSpawnEntity(item, 71));
                            ((CraftPlayer) p).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(item.getId(), item.getDataWatcher(), false));

                        }``` I am trying to display a map with an image on the item frame, but for some reason the frame is empty but enlarged
sleek estuary
#

why dont working?

eternal oxide
#

?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.

restive mango
#

If you want to join me by all means

alpine urchin
#

if you satisfy my quote, sure.

#

@restive mango

clever lantern
#

how can i place for example 9 blocks when player tries to enter an area so he cant do that

#

so it just blocks him

agile berry
#

Guys i'm asking like fifth time, what can i do to fix this error:

[13:05:46 ERROR]: Encountered an unexpected exception
java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
    at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:325) ~[?:1.8.0_391]
    at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:267) ~[?:1.8.0_391]
    at java.util.jar.JarVerifier.processEntry(JarVerifier.java:329) ~[?:1.8.0_391]
    at java.util.jar.JarVerifier.update(JarVerifier.java:239) ~[?:1.8.0_391]
    at java.util.jar.JarFile.initializeVerifier(JarFile.java:402) ~[?:1.8.0_391]
    at java.util.jar.JarFile.getInputStream(JarFile.java:478) ~[?:1.8.0_391]
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:181) ~[patched_1.16.5.jar:git-Paper-794]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:160) ~[patched_1.16.5.jar:git-Paper-794]
    at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:393) ~[patched_1.16.5.jar:git-Paper-794]
    at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:269) ~[patched_1.16.5.jar:git-Paper-794]
    at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Paper-794]
    at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
    at java.lang.Thread.run(Thread.java:750) [?:1.8.0_391]

Already:

  • Tried using filters and excludes
  • Rebuilding the project several times with modified pom.xml
  • different core
chrome beacon
#

You're probably shading something containing a signature

#

You need to exclude it

agile berry
#

i did that?
as someone said, i just excluded entire META-INF/ directory

agile berry
# chrome beacon You're probably shading something containing a signature
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-shade-plugin</artifactId>
  <version>3.2.4</version>
  <executions>
      <execution>
          <phase>package</phase>
          <goals>
              <goal>shade</goal>
          </goals>
          <configuration>
              <filters>
                  <filter>
                      <artifact>*:*</artifact>
                      <excludes>
                          <exclude>META-INF/</exclude>S
                      </excludes>
                  </filter>
              </filters>
              <transformers>
                  <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                      <mainClass>com.timuzkas.linker.Linker</mainClass>
                  </transformer>
              </transformers>
              <shadedArtifactAttached>true</shadedArtifactAttached>
          </configuration>
      </execution>
  </executions>
</plugin>
valid burrow
undone axleBOT
restive mango
sterile flicker
# valid burrow ?tas

it's completely out of place, isn't it obvious that I already tried it when I said "for some reason the frame is empty but enlarged"

restive mango
#

I work for free baby