#help-development

1 messages · Page 594 of 1

unborn sable
#

Where would I store a villager's profession and trades when transferring it to a spawn egg? I've looked for examples of what other people have done but none have shown storing the trades too.

flint coyote
#

I still don't hold player instances anymore after some people told me it's bad pratice. Although it does not break anything (yet)

hybrid spoke
#

lol nah

torn shuttle
#

"people" also say static is the spawn of the devil and should never be used, "people" are not smart

hybrid spoke
#

it really doesnt

#

my internet sucks, perfectly

flint coyote
#

I mean that's true but when you should generally not save Entity instances it's a fair point to say that it's wrong to give Players a special treatment.

hybrid spoke
#

weak reference the player key if you are a pussy. but real men diamond hand their data till the end

distant wave
#

how would you guys drown player?

hybrid spoke
#

with my hands

flint coyote
#

That's pretty boring for a God, ngl

distant wave
#

i tried cancelling the playermove event but then the player wont go to bottom

hybrid spoke
flint coyote
#

Either give the player a downwards velocity or only cancel the move event when it's upwards

merry mountain
#

set movement speed to zero?

flint coyote
#

yes

#

If you want to make it a little smoother you can also get the players velocity and just change the Y

unborn sable
#

Where would I store a villager's profession and trades when transferring it to a spawn egg?

tender shard
#

in the spawn egg's meta's PDC

unborn sable
tender shard
#
ItemStack item = new ItemStack(Material.SOME_SPAWN_EGG);
ItemMeta meta = item.getItemMeta();
PersistentDataContainer pdc = meta.getPersistentDataContainer();
cinder abyss
#

Hello, how can I change biomes foliage color (using nms ?)

torn shuttle
#

tfw you accidentally fix a bug

ancient plank
torn shuttle
#

well I guess I'm not complaining

tribal valve
#

how to do this

torn shuttle
#

I sort of see how I fixed it but man

icy beacon
#

new String[] {"a", "a"}

tribal valve
#

oh thanks

icy beacon
#

why an array though

#

use a list, or better, a set

tribal valve
#

how

icy beacon
#

?learnjava

undone axleBOT
tribal valve
#

i know java

icy beacon
#

then you know how to create a list/set

tribal valve
#

okay

#

why set better than list

icy beacon
#

i don't really know but i'm pretty sure that when you don't want to modify the contents it's better for performance to use a set

opaque scarab
shadow night
#

hey guys, I've asked how to hide player armor using protocol lib already, but I didn't get any further. I tried doing it by just writing all the stuff myself and I tried copying code from some wrapper and using it, which didn't work too. Can anybody help me with that?

tribal valve
icy beacon
#

microoptimisations schnitzel

shadow night
#

micro fr

unborn sable
tribal valve
icy beacon
#

set is an interface, hashset is an implementation

#

you can't just use an interface

tribal valve
#

and how

torn shuttle
icy beacon
#

trying to upload an artifact update to maven central, getting this error:
Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @3c0036b
this is not my first time uploading an update to maven central, but with this particular artifact it's the first time. pom: https://pastebin.com/0ZjDuWTV
the error is given out by nexus-staging-maven-plugin:

[INFO] --- nexus-staging-maven-plugin:1.6.7:deploy (injected-nexus-deploy) @ TrUAPI ---
[INFO] Performing local staging (local stagingDirectory="G:\PROJ PLUGINS\fdev\TrUAPI\target\nexus-staging\staging")...
[INFO]  + Using server credentials "ossrh" from Maven settings.
<then the error comes in>
ancient plank
zealous osprey
opaque scarab
icy beacon
# tribal valve why

you can google "how to create a set java". maybe you claim to know java well, but you need to be able to google

torn shuttle
#

oh no... it's not fully fixed D:

torn shuttle
#

god this is so cursed

icy beacon
charred blaze
#

hey

#

Fatal error trying to convert Chat v1.0:net/multylands/chat/listeners/Book.class
org.bukkit.plugin.AuthorNagException: No legacy enum constant for WRITABLE_BOOK. Did you forget to define a modern (1.13+) api-version in your plugin.yml?

#

somewhy my plugin does this ^

charred blaze
#

im on 1.16.5

icy beacon
#

artifact maven central failure hwelwpwe

unborn sable
zealous osprey
tribal valve
#

do i need to add everything with .add?

icy beacon
#

someSet.addAll(Arrays.asList("a", "a"))

zealous osprey
#

well you could do something like:

private final Set<String> someSet = new HashSet<String>(Arrays.asList("a", "a"));
tribal valve
#

thanks

icy beacon
#

yeah and also it's not necessary to specify HashSet<String>, just do HashSet<>

ancient plank
zealous osprey
#

Also every HashSet is a Set, so you can still use the docs

tender shard
zealous osprey
torn shuttle
#

I am in an absolutely epic amount of muscle pain right now

tribal valve
opaque scarab
shadow night
unborn sable
tender shard
#

getClickedBlock

#

although getCLickedPosition should not be null for right clicks

tribal valve
zealous osprey
#

what?! XD

tender shard
#

asd

icy beacon
torn shuttle
#

life is pain

unborn sable
# tender shard getClickedBlock

Getting that block's position is suffocating villager if clicking on a wall (clicking on a wall with a normal spawn egg works)

tribal valve
zealous osprey
tender shard
tribal valve
#

`# asd``

icy beacon
#

😭

tender shard
#
Block blockToSpawn = event.getClickedBlock().getRelative(event.getClickedBlockFace());
#

sth like that

tribal valve
#

asd`

#

oh

tender shard
#

btw getClickedPosition() shouldnt be null and it's not null for me

tribal valve
#

how i can rotate lit tnt to player's head rotation

#

so it's looking at player's face

unborn sable
tender shard
#

ofc, getCLickedPosition is an offset only for that block

sterile breach
#

Hi, how to get a custom head with texture?

tender shard
#

get the block's location and add the vector to it

unborn sable
tender shard
#
        Block block = event.getClickedBlock();
        Vector vector = event.getClickedPosition();
        Location spawnLocation = block.getLocation().add(vector);
tribal valve
#
                    TNTPrimed thrownTnt = (TNTPrimed) player.getWorld().spawnEntity(player.getEyeLocation(), EntityType.PRIMED_TNT);
                    thrownTnt.setVelocity(player.getLocation().getDirection().normalize().multiply(FCore.GetInstance().getConfig().getDouble("throw-force")));
                    thrownTnt.setRotation(20, 50);
                    player.getInventory().getItemInMainHand().setAmount(player.getInventory().getItemInMainHand().getAmount() - 1);
``` the rotation doesn't work
unborn sable
shadow night
#

guys, I tried printing out the packet,
PacketContainer[type=ENTITY_EQUIPMENT[class=PacketPlayOutEntityEquipment, id=85], structureModifier=StructureModifier[fieldType=class java.lang.Object, data=[com.comphenix.protocol.reflect.accessors.DefaultFieldAccessor@646a96ae, com.comphenix.protocol.reflect.accessors.DefaultFieldAccessor@70c4151e]]] wtf is this

tender shard
#

wdym?

tender shard
tender shard
shadow night
#

like, what are those fields and how do I get anything without it erroring about that being out of bounds

torn shuttle
#

fun mystery for all ages, what kind of math error causes this

icy beacon
#

seems fine to me?

torn shuttle
#

nope

icy beacon
#

what's the matter

opaque scarab
torn shuttle
#

there's a space just over halfway up

icy beacon
#

oh

opaque scarab
#

They are not aligned

#

But I have no idea what would cause that

icy beacon
#

bet it's off-by-one shit

torn shuttle
#

right now I'm wondering if there's some kind of rounding issue in rsps

#

they all get placed using the same math so if it was off by one they would all be off by one

icy beacon
#

ah

shadow night
torn shuttle
#

I would assume I either messed up the scaling but if that was the case I would expect it to just sort of gradually spread I think

#

or some rsp nonsense

shadow night
#

it has only the integer

#

and only one

sterile breach
#

Hello,

    }
        ItemStack head = new ItemStack(Material.PLAYER_HEAD);
        SkullMeta meta = (SkullMeta) head.getItemMeta();

        meta.setOwner(texture);

        head.setItemMeta(meta);
        return head;
    }

why i get a default head?

torn shuttle
#

just why

tender shard
torn shuttle
#

off by 4.5 rsp units seemingly arbitrarily

icy beacon
#

i've seen you doing texture stuff for the past multiple weeks or something

#

and it is interesting but i ahve no clue what this is

tender shard
#

he's building a bone-cube structure, duh

icy beacon
#

ah, of course

torn shuttle
#

tower defense game and at the same time a plugin that manages custom models similar to modelengine but open source, gplv3 and free

icy beacon
#

oh wow ok

#

that is impressive

timid hedge
#

I am not getting any errors but the lines on the sign is noget being setted
And my group is admin

    @EventHandler
    public void onChange(SignChangeEvent e) {
        Player p = e.getPlayer();
        if(e.getLine(0).equalsIgnoreCase("health")) {
            if(isPlayerInGroup(p.getPlayer(), "admin") || isPlayerInGroup(p.getPlayer(), "h-admin")) {
                e.setLine(0, "-----");
                e.setLine(1, "HEALTH");
                e.setLine(2, "Click here");
                e.setLine(3, "-----");
            }
        }
        if(e.getLine(0).equalsIgnoreCase("absorption")) {
            if(isPlayerInGroup(p.getPlayer(), "admin") || isPlayerInGroup(p.getPlayer(), "h-admin")) {
                e.setLine(0, "-----");
                e.setLine(1, "ABSORPTION");
                e.setLine(2, "Click here");
                e.setLine(3, "-----");
            }
        }
    }

    @EventHandler
    public void onInteract(PlayerInteractEvent e) {
        Player player = e.getPlayer();
        BlockState bs = e.getClickedBlock().getState();
        if(bs instanceof Sign) {
            Sign sign = (Sign) bs;
            String line1 = sign.getLine(1);
            if(line1.equals("ABSORPTION")) {
                e.getPlayer().addPotionEffect(PotionEffectType.ABSORPTION.createEffect(999999, 4));
            }else if(line1.equals("HEALTH")) {
                e.getPlayer().setHealth(20);
            }
        }
    }
}
icy beacon
#

?paste

undone axleBOT
icy beacon
#

text wall

onyx fjord
timid hedge
#

How do i refresh a sign?

echo basalt
#

blockState#update

timid hedge
#

Ohh..
I though it was something ingame...

onyx fjord
torn shuttle
#

I think I might have a clue

#

rsp model limits are -16 to 32

#

which is exactly where this is messing up

sterile breach
dry forum
#

i want to overlay a player's skin on an image as if they are sitting down, any ideas on where to start with this?

timid hedge
onyx fjord
#

why do you want java 8

timid hedge
#

Becuase this plugin is for 1.8

onyx fjord
#

💀

timid hedge
#

What is wrong with that?

onyx fjord
#

a lot is wrong

timid hedge
#

...

tribal valve
#

how to get the message that player typed in, but just the command, without args

kind hatch
#

Check the command name?

#

Command#getName()

onyx fjord
timid hedge
timid hedge
#

Why?

tribal valve
onyx fjord
#

youll find out yourself

timid hedge
#

Dude, just explain

onyx fjord
#

exploits, dupes

shadow night
onyx fjord
#

this will give you the first word

timid hedge
remote swallow
#

yeah

shadow night
#

Yea

timid hedge
#

But these bugs and exploits can be fixed

onyx fjord
onyx fjord
tribal valve
shadow night
#

Playing is not that bad, but supporting 1.8 is hell

#

You get no new features

timid hedge
# onyx fjord who is gonna fix them

It depends on what kind of bugs you think

There is a bug with string, water and tripwire hooks then you can just do so you cant get tripwire hooks

onyx fjord
#

who is gonna fix bugs and exploits

echo basalt
#

?1.8

undone axleBOT
shadow night
echo basalt
#

1.8 is nearly 8 years old

#

All for a version riddled with exploits like log4j

onyx fjord
#

i mean at least log4j is patched

shadow night
#

Just drop support

timid hedge
echo basalt
#

log4j is probably patched in spigot

#

but not in the client

tribal valve
echo basalt
onyx fjord
cinder abyss
# ancient plank Try looking into the source of this plugin https://www.spigotmc.org/resources/pr...

something interesting :```java
public class BiomeBaseWrapper_1_17R1 implements Biome {

private String fogColor, waterColor, waterFogColor, skyColor;
private String grassColor,foliageColor;

@Override
public BiomeBase build(String fogColor, String waterColor, String waterFogColor, String skyColor) {
    return build(fogColor,waterColor,waterFogColor,skyColor,null,null);
}

@Override
public BiomeBase build(String fogColor, String waterColor, String waterFogColor, String skyColor,String grassColor, String foliageColor) {
    this.fogColor = fogColor;
    this.waterColor = waterColor;
    this.waterFogColor = waterFogColor;
    this.skyColor = skyColor;
    this.grassColor = grassColor;
    this.foliageColor = foliageColor;
    return build();
}



public BiomeBase build() {
    //void generation
    BiomeSettingsGeneration.a gen = (new BiomeSettingsGeneration.a()).a(WorldGenSurfaceComposites.p);
    gen.a(WorldGenStage.Decoration.j, BiomeDecoratorGroups.W);

    BiomeFog.a biomeFogCodec = new BiomeFog.a()
            .a(Integer.parseInt(fogColor, 16)) //fog color
            .b(Integer.parseInt(waterColor, 16)) //water color
            .c(Integer.parseInt(waterFogColor, 16)) //water fog color
            .d(Integer.parseInt(skyColor, 16)); //skycolor
            //.e() //foliage color (leaves, fines and more)
            //.f() //grass blocks color
            //.a(BiomeParticle)
            //a(Music)

    if(foliageColor != null)
        biomeFogCodec.e(Integer.parseInt(foliageColor, 16));
    if(grassColor != null)
        biomeFogCodec.f(Integer.parseInt(grassColor, 16));

    return new BiomeBase.a()
            .a(BiomeBase.Precipitation.a) //none
            .a(BiomeBase.Geography.a) //none
            .a(0F) //depth ocean or not // var3 ? -1.8F : -1.0F
            .b(0F) //scale Lower values produce flatter terrain
            .c(0F) //temperature
            .d(0F) //maybe important, foliage and grass color
            .a(biomeFogCodec.a()) //biomefog
            .a(BiomeSettingsMobs.c) //same as void biome
            .a(gen.a()) //same as void biome
            .a();
}

}```

onyx fjord
#

mmm i love obfuscated code

shadow night
timid hedge
#

But why dosent the lines on the sign not get updated?

    @EventHandler
    public void onChange(SignChangeEvent e) {
        Player p = e.getPlayer();
        if(e.getLine(0).equalsIgnoreCase("health")) {
            if(isPlayerInGroup(p.getPlayer(), "admin") || isPlayerInGroup(p.getPlayer(), "h-admin")) {
                e.setLine(0, "-----");
                e.setLine(1, "HEALTH");
                e.setLine(2, "Click here");
                e.setLine(3, "-----");
                e.getBlock().getState().update();
            }
        }
        if(e.getLine(0).equalsIgnoreCase("absorption")) {
            if(isPlayerInGroup(p.getPlayer(), "admin") || isPlayerInGroup(p.getPlayer(), "h-admin")) {
                p.sendMessage("ewadad");
                e.setLine(0, "&8&m---------------------------");
                e.setLine(1, "ABSORPTION");
                e.setLine(2, "Click here");
                e.setLine(3, "&8&m---------------------------");
                e.getBlock().getState().update();
            }
        }
    }

    @EventHandler
    public void onInteract(PlayerInteractEvent e) {
        Player player = e.getPlayer();
        BlockState bs = e.getClickedBlock().getState();
        if(bs instanceof Sign) {
            Sign sign = (Sign) bs;
            String line1 = sign.getLine(1);
            if(line1.equals("ABSORPTION")) {
                e.getPlayer().addPotionEffect(PotionEffectType.ABSORPTION.createEffect(999999, 4));
            }else if(line1.equals("HEALTH")) {
                e.getPlayer().setHealth(20);
            }
        }
    }
}
onyx fjord
#

idk

stuck notch
#

guys help out

#

i keep getting this error

#

for my plugin

onyx fjord
#

worked fine for me on newest versions

ancient plank
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

upbeat hornet
#

Is it possible in 1.20.1 to save itemstack with 100% of their data (PDC, nbt, etc) through restarts?

upbeat hornet
#

Itemstacks are serializable ?

cinder abyss
#

hello, how can I get a biome temperature with nms ? (or spigot)

onyx fjord
worldly ingot
#

Block#getTemperature()

shadow night
#

What

cinder abyss
tribal valve
#

how i can hide commands with tab

#

so players cant tab them to see everything

#

and just see the commands that i want them to see

deep oxide
#

Do I need to make a new class for every custom command?

tribal valve
#

yea

deep oxide
#

rr, thanks

tribal valve
#

well, you can do one command for everything, like: /cmd fly (the rest of the command), /cmd gm (the rest of the command)

#

but not recommendetd

upbeat abyss
#

im back lmfao, how do i shade mongodb into a plugin?

upper hazel
#

a strange situation, but how to get players who are under the sun is more optimized than each time checking in which world the players are and whether the block is on top

upbeat abyss
#

how do i shade mongodb into a plugin?

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>shade</id>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <artifactSet>
                        <includes>
                            <include>org.mongodb:mongo-java-driver</include>
                        </includes>
                    </artifactSet>
                    <relocations>
                        <relocation>
                            <pattern>com.mongodb</pattern>
                            <shadedPattern>my.package.xxx.mongodb</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
            </plugin>```
#

im stuck on shadedPattern

cinder abyss
#

Hello, how can I use two versions of nms ? Here is my pom.xml :```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>fr.paulem.alot</groupId>
<artifactId>ALOT-maven</artifactId>
<version>1.0-SNAPSHOT</version>

<repositories>
    <repository>
        <id>spigot-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
    <repository>
        <id>sonatype</id>
        <url>https://oss.sonatype.org/content/groups/public/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot</artifactId>
        <version>1.19.4-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot</artifactId>
        <version>1.16.1-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.realityforge.org.jetbrains.annotations</groupId>
        <artifactId>org.jetbrains.annotations</artifactId>
        <version>1.7.0</version>
    </dependency>
</dependencies>

<properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

</project>```

cinder abyss
dry forum
#

i want to overlay a player's skin on an image as if they are sitting down, any ideas on where to start with this?

upper hazel
#

a strange situation, but how to get players who are under the sun is more optimized than each time checking in which world the players are and whether the block is on top

echo basalt
cinder abyss
# cinder abyss how ?

how can I use modules please ? I tried using it doesn't consider my plugin as a java project

echo basalt
quartz spruce
#

Hey I've had a question. How do I make a chart.js webserver line graph into my plugin

#

?

hazy parrot
#

How do you want to display it in Minecraft

#

There is chart.js api for java btw

cinder abyss
#

how can I create a text like this up a LivingEntity (without using displayName)

pseudo hazel
#

armor stand probably

upper hazel
echo basalt
#

nms

upper hazel
#

i not can find

echo basalt
#

Writing a guide rn

#

For uhh

#

grafana :)

upper hazel
#

@echo basalt

tender shard
#

basically you need one "core" module where you got your interface, that all NMS modules implement

tender shard
#

then you create one module per NMS version, each depends on your core module

#

and then you create one "dist" module that shades all the other modules (both core, and the NMS ones)

#

you then add the remapping stuff only to the NMS modules

urban mauve
#

how can i turn off collision ONLY for a mob? i tried entity.setCollidable(false); - doesn't work, tried to add it to Scoreboard Team with collision disabled - doesn't work

tender shard
#

what the heck is this and why did I write it lol

shadow night
#

hmm, cursed stuff

#

what format is modifier 1?

#

array?

flint coyote
#

An array of something that has a toString() method it seems

#

what did you call to get the output?

echo basalt
#

Itemlist

shadow night
#

Itemlist? tf

flint coyote
#

I mean you can check by hovering over packet.getModifier().read(i) (hover over the read part)

#

Should have a type

cinder bobcat
#

Hello Guys !

I'm working on a project rn, and i need a bit of help. Let me give some context :
I have a command, that toggle fly for a player. When he executes it, a 10 secondes timer start. If the timer ends, the fly is disabled. If he re uses the command while the timer isnt finished, the fly is disabled too.
So this is working well.

And now, i want to add some particles around the player while he is flying (while the timer is running)
But my timer is working on a BukkitRunnable, that runs every 20ticks. And i want the particles to be "continuous", more like every 5 ticks (or less). But i cant find a way to make two runnable, that i can stop by hand (with the player do again the command, or when the timer end).
The timer runnable is stopping well, but i cant make the one for the particles work, and also stop it.

I hope someone can help me (working on 1.19.3)

Here is the code :

if (cmd.getName().equalsIgnoreCase("trp")){
            type = TypeTransplanageDAO.getType(player.getUniqueId().toString());
            if (type == null) {
                TypeTransplanageDAO.createType(player);
                type = TypeTransplanageDAO.getType(player.getUniqueId().toString());
            }
            String permission = "trp." + type.toLowerCase();
            if (!player.hasPermission(permission)) {
                player.sendMessage(ChatColor.RED + "Vous n'avez pas la permission d'effectuer ce type de transplanage.");
                return true;
            }
            if (timers.containsKey(player)) {
                BukkitRunnable task = tasks.get(player);
                if (task != null) {
                    task.cancel();
                }
                timers.remove(player);
                player.setAllowFlight(false);
                player.setFlying(false);
            } else {
                timers.put(player, temps);
                player.setAllowFlight(true);
                player.setFlying(true);
                player.spawnParticle(Particle.CLOUD, player.getLocation(), 100, 0.5, 0.5, 0.5, 0.1);
                BukkitRunnable task = new BukkitRunnable() {
                    @Override
                    public void run() {
                        int time = timers.get(player);
                        if (time > 0) {
                            timers.put(player, time - 1);
                            sendActionBar(player, ChatColor.GREEN + "" + time);
                        } else {
                            cancel();
                            timers.remove(player);
                            player.setAllowFlight(false);
                            player.setFlying(false);
                        }
                    }
                };

                tasks.put(player, task);
                task.runTaskTimer(Transplanage.getPlugin(), 0, 20); // Exécuter la tâche toutes les secondes (20 ticks)
            }
            return true;
        }

flint coyote
shadow night
# shadow night

hmm, can I get the actual entity object by using that entity id?

echo basalt
shadow night
#

oh

#

but, how do I get the entity by its id?

dry forum
#

i want to overlay a player s skin on an

echo basalt
#

This is how you get items

echo basalt
#

Although ProtocolLib has a util

shadow night
#

and it's called?

echo basalt
shadow night
#

how do I find the world out ._.

echo basalt
#

get it from the player or something

#

I usually just loop through all entities

shadow night
echo basalt
#

PacketEvent#getPlayer is a thing my g

#

that's the player who the packet was sent to

shadow night
#

wait fr?

#

aaaaaaaaaaaaaaaaaaaaaaaah

spare hazel
#

is there a way to "unregister" an event?

shadow night
spare hazel
#

i use the template from spigotmc article about guis

#

anyone there?

#

helloooooooooooooo

pseudo hazel
#

imagine having patience

spare hazel
#

i waited like 10 minutes

chrome beacon
#

Use the javadocs :p

#

?jd-s

undone axleBOT
pseudo hazel
#

omg 10 whole minutes

spare hazel
#

nothing useful there

pseudo hazel
#

what did you try to find

#

I just typed unregister

chrome beacon
autumn cave
#

Can I read block data async? And do I have to use Bukkit.getScheduler().runTaskAsynchronously or can I also use java threads?

chrome beacon
#

Do keep in mind they should be created sync and read async

quaint mantle
#

How is the best way to keep a player with full healt and hunger

#

How do i set the players held items durability to max?

rotund ravine
quaint mantle
#

I dont why this dosent work and i dont even get the test111 message

            } else if (line0.equals("SHOP")) {
                if (line1.equals("Click here")) {
                    if (line2.equals("To open shop")) {
                        if (line3.equals("")) {
                            e.getPlayer().sendMessage("test111");
                            if (e.getPlayer().getWorld().getName().equalsIgnoreCase("A")) {
                                e.getPlayer().sendMessage("A");
                                new VagtshopA().open(e.getPlayer());
                            } else if (e.getPlayer().getWorld().getName().equalsIgnoreCase("B")) {
                                e.getPlayer().sendMessage("B");
                                new VagtshopB().open(e.getPlayer());
                            } else if (e.getPlayer().getWorld().getName().equalsIgnoreCase("C")) {
                                e.getPlayer().sendMessage("C");
                                new VagtshopC().open(e.getPlayer());
                            }
                        }
                    }
                }
            }
rotund ravine
#

wtf

quaint mantle
#

What?

rotund ravine
#

Based on the code snippet provided, it seems that the conditions are nested, and in order for the "test111" message to be displayed, all the conditions need to be met. Here's a breakdown of the conditions:

  1. The value of line0 should be equal to "SHOP".
  2. The value of line1 should be equal to "Click here".
  3. The value of line2 should be equal to "To open shop".
  4. The value of line3 should be an empty string.

If any of these conditions are not met, the code inside the nested conditions will not be executed, and you won't see the "test111" message.

To debug the issue, you can check the values of line0, line1, line2, and line3 to ensure they match the expected values. Additionally, you can add some debug statements to check if the code inside each if condition is being executed. For example, you can add System.out.println("Condition 1"); before the first if statement, and similarly for the other conditions.

#

Here's an example of how you can modify the code to include debug statements:

} else if (line0.equals("SHOP")) {
    System.out.println("Condition 1");
    if (line1.equals("Click here")) {
        System.out.println("Condition 2");
        if (line2.equals("To open shop")) {
            System.out.println("Condition 3");
            if (line3.equals("")) {
                System.out.println("Condition 4");
                e.getPlayer().sendMessage("test111");
                if (e.getPlayer().getWorld().getName().equalsIgnoreCase("A")) {
                    e.getPlayer().sendMessage("A");
                    new VagtshopA().open(e.getPlayer());
                } else if (e.getPlayer().getWorld().getName().equalsIgnoreCase("B")) {
                    e.getPlayer().sendMessage("B");
                    new VagtshopB().open(e.getPlayer());
                } else if (e.getPlayer().getWorld().getName().equalsIgnoreCase("C")) {
                    e.getPlayer().sendMessage("C");
                    new VagtshopC().open(e.getPlayer());
                }
            }
        }
    }
}

By checking the debug statements in your console or log files, you can determine which condition is not being met and investigate the issue further.

quaint mantle
#

Okay, its sends Condition 2 and then stops

#

Idk if it could do anything but orginal the text is danish i just translated it to english so people can read it
And at line 2 there stands "Åbne butikken" can the letter "å" have anything to do with it?

rotund ravine
#

probably maybe and probably not

shadow night
#

I wonder how I should do stuff when I don't have access to that mojang Pair class, maybe I'm just a lil too not understanding this

rotund ravine
#

reflection do be good

quaint mantle
sterile breach
#

Hello, i want make an automatique message send with intervalle per player

So i make a bukkit runable in player joinevent ?
Or just a function in player join event ?

flint coyote
#

I would recommend you just add the player to a map in the player join event and then use a single scheduler that iterates over the map

sterile breach
#

And use a bukkit runable ?

flint coyote
#

Yes

sterile breach
#

to put it mildly, the only usefulness of bukkit runable is to execute actions with intervals?

flint coyote
#

normal schedulers can do that, too

#

A bukkit runnable can cancel itself

spare hazel
#

What is the right way to add itemflags to the itemmeta

#

This is what i use and it doesnt seem to be working

meta.getItemFlags().add(ItemFlag.FLAG);
sterile breach
flint coyote
#

Well having one scheduler player will definitly hurt performance more than having a single one. What are your "personal needs" except that it is easier?

flint coyote
spare hazel
#

Yes

#

But theres still things like:

When on main hand:
+10 attack damage

And things like that

flint coyote
#

Does it show it ingame and just does not apply it? Or isn't it shown at all?

sterile breach
spare hazel
#

The itemflag doesnt affect anything ingame

flint coyote
#
ItemMeta meta = this.item.getItemMeta();
        if (meta != null) {
            meta.setDisplayName(name);
            meta.setLore(lore);
            meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
            this.item.setItemMeta(meta);
        }

This is the only ItemFlag I worked with so far and that worked flawlessly

chrome beacon
#

They really should do smth about that name

flint coyote
flint coyote
spare hazel
#

Oh u use addItemFlags

sterile breach
flint coyote
#

no I was responding to Olivo

spare hazel
flint coyote
sterile breach
#

Ah okay

#

Else
No interval custom

Every 15 min loop all players an send message ?

spare hazel
#

No

#

If you loop 15 minutes, a player that joins the server the second before the 15 minutes will be able to talk

sterile breach
#

to know if a player wants to receive the messages, I have an info on him stored in the database, my idde would be the following

when a player joins, I make an sql query to find out if sibil wants to receive them, if so, I add him to an array that contains his name and the join time, every minute, I check if in the array a player corresponds to the current temod, if so I send him the message, is this a good approach to not have a performance problem?

#

Is not a talk permission, simple automatique broadcast

flint coyote
#

If by array you mean map, then yes that's fine

#

basically if you want to send a message every 15 minutes you want to store either the last or the next message time and compare accordingly. Once you sent a message you update the time

#

On join you simply set the join time or jointime+15minutes - depending on how you are comparing the times

sterile breach
#

on the other hand, how to do, if I store the time in ms, and that I check every minute, I have almost no chance of falling exactly on the moment when it joined + 15 min in ms how to do?

flint coyote
#

don't do an exact comparison. Use <= or >=

sterile breach
#

but it won't be exactly 15 minutes anymore

#

Else i can stock the time in minute ?

flint coyote
#

If that's critical then run your scheduler every second

spare hazel
sterile breach
#

No with the map méthode

sterile breach
flint coyote
#

The if-statement will be the same

sterile breach
#

Ah yes if <= 15 MS

flint coyote
#
if (storedTime + 15minutes <= currentTime) {
 // send message
 // store currentTime
}
sterile breach
#

To do that, i add a bukkit runable at
Onenable ?

flint coyote
#

yes

sterile breach
#

And loop all players Evry minutes is not a problem for performances ?

flint coyote
#

nah

#

we are talking about 0-100 iterations, that's nothing

sterile breach
#

Okay

pseudo hazel
#

lol

#

I loop through my players every tick

flint coyote
#

the server does, too

pseudo hazel
#

or every second I guess

#

yeah

#

the server does a lot more

flint coyote
#

ofc

spare hazel
flint coyote
#

0.05ms is not lag. Lag only starts if you exceed the 50ms/tick

tribal valve
#

If I did a spigot plugin will it work with on paper server that is connected to bungeecord proxy?

flint coyote
#

yes

tribal valve
#

Okay thanks

sterile breach
#

Okay, i use bukkit runable or scheluder? What is the différences?

quaint mantle
#

Bro when I try to set ItemStack with pdc to yaml, YamlConfiguration fails.💀

#

And gives unclear Exeptions

flint coyote
sterile breach
#

I need to use it in onEnable ? Or i can add it in commands ?

flint coyote
#

You can use it wherever

tribal valve
#

Also, how would I split my plugin in half, cuz I made my plugin with things that were meant to be on the other server with other plugin, and my plugin contains like fly, gm etc. And also kits, anti-logout, and how would I split it so it's two different plugins, both of these things contains functions, references to the fly, gm section

brave lynx
#

How would i disable players from moving a specific item in the 8th slot in their inventory? I have tried cancelling the event but unfortuantely the players end up duplicating the item

shadow night
young knoll
#

Pair is from NMS

shadow night
#

Oh fuck

#

Well, time to BuildTools

#

Wait, how does NMS decrypt?

tribal valve
#

Try to drop the "duplicated" item and see if it drops or if it disappears

#

Test it in deop and survival

shadow night
brave lynx
sterile breach
#

Someone have an exemple/doc to see how to use bukkit runable méthode

kind hatch
#

?scheduling

undone axleBOT
tribal valve
#
new BukkitRunnable() {
     @Override
     public void run() {
          //methods
          cancel();
     }
}.runTaskTimer(plugin, 1, 1);

//supports lambda expressions, does not allow for internal cancelling, but can be cancelled by storing the task ID.
Bukkit.getScheduler().sheduleSyncRepeatingTask(plugin, new Runnable() {
     @Override
     public void run() {
      //methods
     }
}, 1, 1);

//with lambda
Bukkit.getScheduler().runTaskLater(plugin, () -> //method(s), 1);
brave lynx
tribal valve
#

Try deoping urself

kind hatch
#

Can't. Creative mode doesn't have good packets.

brave lynx
#

that's unfortunate

#

alright thank you

chrome beacon
tribal valve
#

Wdym I copied that from wiki

chrome beacon
#
scheduler.runTaskTimer(plugin, task -> {
  if (Bukkit.getOnlinePlayers().isEmpty()) {
    task.cancel(); // <--
    return;
  }
  Bukkit.broadcastMessage("Mooooo again!");
}, 0L, 20L * 60L);
#

Taken from wiki ^^

tribal valve
#

Took from other wiki then, also mine has canceling too

chrome beacon
#

supports lambda expressions, does not allow for internal cancelling, but can be cancelled by storing the task ID.

#

Was talking about that comment

tribal valve
#

Ohhh

chrome beacon
#

Also the method you were using there is explicitly stated in the wiki to not be used

tribal valve
#

Oh mb

#

Also, is it better to run one bukkit runnable and just loop through a list of people and update the boss bar or just run a task for every person but after some event or under some condition cancel it??

young knoll
#

Just have a global one and loop

#

It's easier

tribal valve
#

Easier or better performance??

young knoll
#

Both

tribal valve
#

Oh, well then I need to redo my code

unborn sable
#

On the PlayerInteractEntityEvent, how would I get the entity's spawn egg?

sterile breach
#

How a task is executed if i don't set time?

young knoll
#

I don't think we have a method to go from entity to spawn egg

jolly forum
#

Hi, how can eh assign a skin on a bungee cord plugin?

young knoll
#

You would have to make your own map

unborn sable
young knoll
#

yes

chrome beacon
#

or use nms

zenith gate
#

What would cause a PDC key and value not to save? When a player leaves the game 3 values are changed back to false. or they are removed, it alternates.

young knoll
#

Or you might be able to do some fancy string manipulation

chrome beacon
#

NMS could be more useful since it allows for saving exact nbt data

young knoll
#

True

chrome beacon
#

It does depend on what you want though

unborn sable
young knoll
#

Don't use the entity type name

#

Get its namespaced key and use that

unborn sable
young knoll
#

The type

#

I mean I assume they are the same but

unborn sable
young knoll
#

type.getKey.getKey should be what you want

unborn sable
#

is the key a string like VILLAGER

unborn sable
#

Still saying it is null

jolly forum
#

Hey, how can eh assign a skin on a bungee cord plugin?

young knoll
unborn sable
#

Do I need to set it to uppercase?

sterile breach
#

@flint coyote , question, i stock my player in normal map or i use "cooldownmanager"?

young knoll
#

You are adding _spawn_egg to it I assune?

unborn sable
quaint mantle
#

hey, is there an event for activating the portal frame?

young knoll
#

And using material.matchMaterial?

unborn sable
unborn sable
pseudo hazel
#

I did something similar

#

there are oly a few entities that you have to manually adjust

#

in my case there were also spawn eggs for the golems , dragon and wither, but I think those are in the actual games now

#

and then I just checked if the entity type was a mooshroom and if so converted the name manually

#

its not taht big of a deal

young knoll
#

mooshroom should work fine

pseudo hazel
#

and its way better than mapping every entity yourself

unborn sable
#

I think it works without manually set entities

#

name one you would usually need to change

pseudo hazel
#

wdym

unborn sable
#

An entity

pseudo hazel
#

well like I said mooshroom is the only one I found

#

because like you say, the spawn egg material is spelled differently from the entity type

unborn sable
pseudo hazel
#

oh

#

well then you're good ig

young knoll
#

This is why you use the namespaced key instead of the enum name

wet breach
#

o.o

flint coyote
flint coyote
#

Frost on mushrooms

urban mauve
#

can i retrieve from HangingPlaceEvent the entity on which lead placed on?

flint coyote
#

yes there is #getEntity

#

wait, lead? Isn't that event for paintings and maybe itemframes?

young knoll
#

yes

zenith gate
#

What would cause a PDC key and value not to save? When a player leaves the game 3 values are changed back to false. or they are removed, it alternates.

flint coyote
#

never heard of that

urban mauve
pseudo hazel
#

how and when do you add the tags

zenith gate
#

tags get added when the player first joins. they are set to false. when a player creates the double jump book, it turns to true. ( when they right click ). when they leave, they either get set back to false or they just disappear. I set them like this.

        playerData.set(new NamespacedKey(Overhaul_Systems.getPlugin(), "DoubleJump"), PersistentDataType.BOOLEAN, false);
        playerData.set(new NamespacedKey(Overhaul_Systems.getPlugin(), "OverSaturation"), PersistentDataType.BOOLEAN, false);
        playerData.set(new NamespacedKey(Overhaul_Systems.getPlugin(), "Healthy"), PersistentDataType.BOOLEAN, false);
urban mauve
#

is there a way to retrieve block from PlayerLeashEntityEvent?

flint coyote
flint coyote
zenith gate
#

because thats how I was told to do it?

#

more of taught actually

urban mauve
zenith gate
#

I dont remember this was a long time ago.

urban mauve
#

u can create only one in plugin's main for example and then use it everywhere
upd: u need do it cuz everytime u create new same namespaced key

flint coyote
#

Well unless you need multiple instances it does not make sense to create them multiple times. Create a single instance and use that.

#

Could be that this is the reason your values go missing

zenith gate
#

why would it only be these 3 tho? it would be all of them no? I write them all the same, and I have like 20.

flint coyote
#

I'd expect it to be all of them, yes

#

If it works for others and fails on those you should doublecheck if there's any difference in setting/obtaining them

urban mauve
flint coyote
#

Well if he got 20 keys I'd suggest using a class to handle all of them.

#

Therefore also setting and retrieving values for them

zenith gate
#

So all my keys I should put into a class, and get them that way?

urban mauve
flint coyote
#

Could create something like a "PDCManager" interface and implement it in a "PlayerPDCManager". Then declare your keys there and add functions to set/retrieve values based on the player parameter

zenith gate
#

That's also going to be a lot of changes. Like a good hour or 2 of work.

flint coyote
#

Also create an enum for the names of your keys in there

#

Sure is but it's pretty clean

urban mauve
zenith gate
#

Yeah, it doesnt help that im also still learning java, even after the few years ive been doing this. I just redid my 4 plugins over the past 4 days removing all the static methods and doing it properly

urban mauve
flint coyote
#

Would be boring to not learn something new every once in a while

pseudo hazel
#

which is also the worst part

zenith gate
#

or other packages.

pseudo hazel
#

modules and packages arent really teher to learn though

#

they just make things complicated

flint coyote
pseudo hazel
#

itw more about the concepts and structure behind them

pseudo hazel
#

so thats nice

zenith gate
#

Welp, I have a lot of work to go do now lol.

flint coyote
#

That's the spirit

pseudo hazel
#

but anyways, thats likely not even your actual problem toast

zenith gate
#

come again?

pseudo hazel
#

but I guess you will get to that once you made a proper structure xD

zenith gate
#

save me time of work ?

pseudo hazel
#

no I meant the keys dissapearing

flint coyote
#

Ofc it is not. I expect he sets/obtains them differently. So cleaning it up will probably get rid of that problem aswell

pseudo hazel
#

yeah likely

#

it may well be a side effect of something

#

I mean thats all of code

#

but you know what I mean

zenith gate
#

idk what it could be. it was working before. like i created this almost 2 months ago. Never touched it again because there was no need it worked. then it jsut stopped for some reason.

flint coyote
#

Steaf you gonna rename once you turn 24 years old?

pseudo hazel
#

well that would be now actually

#

but

#

no

#

I got this name like 6years ago anyways

flint coyote
#

Because I was named Fabsi23 for years aswell. Did not exactly change it this year though. Was probably with 22 or 23

pseudo hazel
#

its just some numbers after my name since my usual tag was taken ofc

#

and spigot server forces me to use my spigot username

#

lol nice

flint coyote
#

yeah I get that. I was also named Fabsi23 on spigot though

#

still shows it on my profile

pseudo hazel
#

i dont remember why i went for the 23 though

flint coyote
#

I do

pseudo hazel
#

then how are you not named that in discord?

flint coyote
#

I felt like "123 is basic, lets take 23"

#

I renamed on spigotmc aswell

pseudo hazel
#

oh i see

flint coyote
#

Fabsi was also taken once I was allowed to namechange on discord

#

So now I'm Fabsi_ here and _Fabsi on MC

high pewter
#

This isn't me asking for help, I'd like to report some documentation I think is a bit misleading but not sure where this would be best suited. The documentation for the BlockDropItemEvent says

This event will also be called if the player breaks a multi block structure, for example a torch on top of a stone. Both items will have an event call.
Which to me implies that each item will have a separate event call each, but actually means both items will have a single event call between them. This might just be me, but if this anyone else would read it the same way I think this should maybe be clarified

#

Though I feel like it would make more sense for them to be separate event calls, I don't really understand why they're grouped together, so maybe this isn't a documentation issue but actually an implementation issue

brave lynx
#

Hey, quick question, can I hide the 'Ingredients' and 'AppliesTo' in a netherite upgrade smithing template? if so, which flags would I need to hide?

young knoll
#

Probably HIDE POTION EFFECTS

chrome beacon
#

^^

median magnet
high pewter
#

Since I'm gonna have to handle multi-block structures myself, is there a method that returns all blocks part of a multi-block structure stemming from a given block? For example, any signs or torches attached to a block or any part of a chorus "tree" above a chorus stem?

quiet ice
median magnet
#

is there a place to more formally request API additions like this?

young knoll
#

I’m sure something like that could be implemented

#

Although it also shouldn’t be hard to do yourself

undone axleBOT
median magnet
high pewter
# high pewter Since I'm gonna have to handle multi-block structures myself, is there a method ...

Actually the code was easier to write than I thought. Of course, if there's a built-in method for it that would be preferred, but I think something like this should work (haven't managed to test it yet, though)java final Set<Block> pastBlocks = new HashSet<>(); final List<Block> pendingBlocks = new ArrayList<>(); pastBlocks.add(event.getBlock()); pendingBlocks.add(event.getBlock()); while (!pendingBlocks.isEmpty()) { final Block block = pendingBlocks.remove(0); for (BlockFace face : BlockFace.values()) { final Block adjacentBlock = block.getRelative(face.getOppositeFace()); if (pastBlocks.add(adjacentBlock)) { if (adjacentBlock instanceof Attachable attachable && attachable.getAttachedFace() == face) { pendingBlocks.add(block); // Do something with the attached block } } } }

cold pawn
#

Anyone know of a good way to get the position (The head position, body position, and feet position) of an npc in the sleeping pose? The npc's hitbox seems to have shrunk to it's feet, so I want to try and create an artificial bounding box using slimes.

high pewter
#

I've never even thought about the fact that you can have NPCs sleeping, why is that so strange to me, like NPCs are just fake players I shouldn't be surprised that they can do player things lol

cold pawn
#

yeah but for some reason, unlike players there hitbox seems to shrink when they are in that position, which makes no sense to me 🤷‍♂️

dire marsh
#

player's hitbox shrink too wdym

high pewter
#

Ye that's strange, as far as the server knows there is no difference between a player and an NPC other than that one isn't actually logged in, so it must be something to do with the way you're putting the NPC in the sleeping position

#

Orrr that lol

dire marsh
#

also fun fact... you can put wardens in sleeping pose but none of the others, looks kinda funny

high pewter
dire marsh
#

i mean, mojang kinda coded it that way

cold pawn
#

I never noticed that 😅

#

Thats weird

#

wonder why

pseudo hazel
#

feature

dire marsh
#

swimming has different hitbox too

#

it's very annoying when you're fighting players

sullen marlin
#

violence is bad

#

don't fight players

pseudo hazel
#

hmm

cold pawn
#

anyway around the small hitbox's, to my knowledge using slimes or armorstands seems to be what everyone is doing. But the position of the entities are so annoying (especially with the npc turning ever so slightly)

dire marsh
#

oh no im gonna be banned by mojang for encouraging violence

pseudo hazel
#

this was what they meant by bed pvp i pretty sure

high pewter
#

Might as well just disable all PVP on Spigot servers, just to make sure it doesn't give a bad impression to the kids 🙏

dire marsh
cold pawn
#

Making a some what artificial bounding box by placing the entities on top of the npc

#

seems to be the best way I could find

#

Unless I use raytraing 😒

dire marsh
#

ah... yeah well that's gonna be a bit wonky no matter what, because of lag and such

#

i mean you can place interact entities as passengers, but that has limits in terms of hitbox placement

cold pawn
dire marsh
#

it's also buggy as heck... you have to resend metadata to force offset to take effect when you have an interact entity as a passenger on another...

high pewter
#

I mean, I would guess player rotation still applies, so just add your entity "behind" them?

#

If the rotation points "up" instead of "forward", you would just have to add/remove 90 to/from the pitch of that rotation

sullen marlin
cold pawn
#

Getting the npc's location it spawns the slime on the npc's leg, which is also were there hitbox is, is there a way to maybe find the rest of the body using that as an anchor point?

sullen marlin
#

explain it without referencing other implementations

#

"calculating which side of a sign has had colors, dye, or ink sacs used on" does seem trivial without further information

dire marsh
cold pawn
#

Hmm alr, i'll play around with the code and see what I can do

median magnet
# sullen marlin I don't understand what you are asking for there

I thought the other implementation was a good reference, but sure. Take PlayerInteractEvent for example, which most would have used to check whether a sign was being dyed before. If you now want to get the side on which you're using this, you need to do some math based on player vector and block facing to calculate this now, because both sides of the sign can be written on, and anyone wishing to do this is going to need to write their own logic.

Seems ideal to go in the API, and Paper seem to be adding it on that basis too

ancient plank
#

Spigot can't use paper's implementations, else you end up with a whole shebang of pain

young knoll
#

We have to avoid looking at other implementations

median magnet
#

oh, that I wasn't aware of

young knoll
#

Even permission isn’t enough sadly

ancient plank
#

I don't remember the specifics

high pewter
#

I'm curious why permission wouldn't be enough?

ancient plank
#

Just that it's a nono

young knoll
#

The CLA says all code you submit must be your own

high pewter
#

That's... very strange. So, if you collaborate on a code project with someone, you're required to submit it in both your names, even if the other person didn't want to be credited for it? I know this isn't the same situation, but surely if Paper gives Spigot permission to use their code without requiring credit it's roughly the same?

young knoll
#

Pretty much

high pewter
#

Wait I had to Google what a CLA was, and at first glance I thought it was something required for all GitHub contributions, but then other places are talking about adding a CLA to your project, so I can't tell if this is GitHub-wide or if this is specific to Spigot?

kind hatch
#

It's a project specific thing.

#

Some have them, some don't.

young knoll
#

^

sweet sonnet
#

Whats the best way to store a Location as a string

high pewter
#

Ah right, that makes a lot more sense, but then still surely Spigot themselves can choose to not enforce the CLA for a particular request? Like, they can't punish themselves (I realise Spigot isn't a "person" but idk how to properly word it)

eternal oxide
median magnet
young knoll
#

The CLA is in place to prevent another DMCA

kind hatch
#

Spigot likely wouldn't have a CLA if Bukkit didn't get hit with the DMCA.

high pewter
eternal oxide
#

no way to tell where teh code originated, just trust

young knoll
#

Maybe if you had some kind of signed permission

#

But just someone saying it’s okay doesn’t mean that can’t change their mind later

sweet sonnet
eternal oxide
#

Location is ConfigurationSerializable

#

So long as you don;t access the config before worlds are loaded

#

you are safe

young knoll
#

There’s even a convenient getLocation method

high pewter
eternal oxide
#

Safer to have spigots own CLA and require signing for contributions

kind hatch
#

If it ain't in writing, it didn't happen.

orchid gazelle
#

lol I just watched a video about the DMCA of CraftBukkit and now im reading this channel

sullen marlin
#

Cos otherwise wouldn't any "open-source" project be able to just "change their mind" about being open-source
That's exactly what lead to this in the first place

orchid gazelle
#

spigot needs to get built by BuildTools because it would be illegal to distribute compiled binaries of the vanilla server right?

young knoll
#

Yes

sullen marlin
#

separate-ish issue, but yes

high pewter
#

I thought what lead to it was Bukkit distributing Minecraft's code, and I don't recall Minecraft ever being open-source (though it's been a while since I've looked into the Bukkit DMCA thing so I can't remember too much about it)

orchid gazelle
#

so what spigot does is containing the vanilla source code and compiling it because its legal to distribute the sourcecode itself?

young knoll
#

BuildTools downloads the vanilla source from Mojang

orchid gazelle
#

and deobfuscates it?

young knoll
#

Yes

#

And then applies a bunch of patches

ancient plank
#

isn't there a command that has an article explaining the dmca

orchid gazelle
#

those patches are basicly the source of spigot itself?

young knoll
#

?dmca

undone axleBOT
high pewter
#

As I understand it, Mojang doesn't provide the source code, but they provide the compiled code and the mappings required to get the source code from that compiled code. But then, at that point aren't they pretty much just sharing the source code? Like, what's the point of the mappings instead of just providing the actual source? Law is confusing lol

young knoll
#

Yes

#

But we can’t re-host their code

kind hatch
#

Legality is nothing but a confusing mess, but it's their way of making it easier for us devs.

orchid gazelle
#

so Spigot is literally patching the vanilla software to include its changes as well as integrating the Bukkit API

young knoll
#

Mhm

orchid gazelle
#

well, Spigot is patching CraftBukkit and Bukkit which is also maintained by the Spigot Team, and CraftBukkit is patching the Vanilla Server to integrate Bukkit

high pewter
# young knoll But we can’t re-host their code

I understand Spigot not being able to re-host it, but surely Mojang themselves can? Like, they're intentionally making it easy for devs to reproduce the source, so why not just actually provide the source

orchid gazelle
#

why aren't we just applying code changes to CraftBukkit instead of patching CraftBukkit with Spigot?

young knoll
#

Most changes are in Craftbukkit now

#

But spigot still has some patches left

orchid gazelle
#

but why isn't it all in craftbukkit

young knoll
#

It also optimizes things a bit

young knoll
#

You’d have to ask MD more about that

orchid gazelle
#

md? are you here?

high pewter
#

Oh I thought it was like CraftBukkit made no changes other than just opening up an API for developers, so running a Bukkit server without plugins was no different to running a vanilla server, then Spigot actually adds features to make the server more performant, secure or easy to maintain

river oracle
#

No prey much everything Is in craftbukkit besides a few things

#

Don't use craftbukkit api though lol it still lacks features

high pewter
young knoll
#

Mostly components

river oracle
high pewter
#

I thought Components was a Paper-exclusive thing lol

#

Ok I'm guessing that means it is

river oracle
#

Spigot has components just not ok everything

remote swallow
river oracle
#

And everything is behind a spigot interface

high pewter
#

Ah

remote swallow
#

spigot has bungeechat components, while keeping all the string methods available, paper on the other hand

river oracle
#

Eg. player.spigot().sendMessage

young knoll
#

Spigot components only apply to chat messages and books atm

remote swallow
#

paper use adventure components, deprecating all spigot string methods

young knoll
#

But there is an open PR to provide them for everything

river oracle
orchid gazelle
#

and nms-patches under CraftBukkit does the magic and basicly patches CraftBukkit's bootstrappers and loaders into the vanilla software?

young knoll
#

Mhm

high pewter
#

Why can't all developers just be friends 😦

river oracle
#

?

high pewter
#

As in, not DMCA each other lol

#

(I'm kidding btw, I understand roughly why licencing is important, but it would be a lot easier if licensing just wasn't a thing)

river oracle
#

Licensing is very important md_5

young knoll
#

People love their IP

river oracle
orchid gazelle
#

my IP is 127.0.0.1

high pewter
#

For Mojang it's especially important, cos they're a company and need to make a profit, which is a lot harder when people can just re-compile it for free, but between Spigot and Paper it's a bit more ehh, like I still understand why but ehh

young knoll
#

No no not that IP

high pewter
#

I think they realise lol

vapid raft
kind hatch
#

That's a really outdated tutorial.

#

You'll have a much easier time using maven.

high pewter
#

Personally, I find it easier to use Maven (or Gradle/Ant), especially if you're already familiar with Java development

high pewter
#

There is also an IDEA plugin specifically for Minecraft development which setups up a lot of the project for you, but ofc it's good to get in the habit of doing this yourself to familiarise yourself with how it works

alpine urchin
#

i don’t want a company like microsoft to take my library for example

#

abuse it, make money with it

#

and do all kinds of stuff

#

copyright and licensing is important

vapid raft
kind hatch
alpine urchin
#

we need an error

#

to help you

vapid raft
alpine urchin
#

hopper ima go sleep

high pewter
# alpine urchin copyright and licensing is important

As I said, I was kidding. I know it's important and I know why. I even specifically mentioned why it's important for commercial reasons. Just, I think a world where there was no need for licenses (not just without licenses, I mean where it wasn't necessary for everyone to be happy, like where we didn't have to worry about our code being abused) would be a much better one, both for devs and for end-users

alpine urchin
#

licenses don’t only protect developers

#

but specific licenses can also protect the user

#

gpl, does just that

high pewter
#

Like, a world where we didn't need laws to prevent people from murdering each other would probably be a very good one too

young knoll
#

I don’t think laws prevent people from murdering eachother

alpine urchin
#

you dont have a point hopper

#

you’re clearly saying this cause you don’t wanna comply to licenses

#

right?

high pewter
#

Do you think I want to murder people too? 🤨

alpine urchin
#

@young knoll it’s like saying i wish we didn’t need laws that prohibit murder

#

ok?

#

do you wanna murder people

high pewter
#

... no

alpine urchin
#

and go against the laws

#

in place

young knoll
#

Maybe

alpine urchin
#

a license is an agreement, that way everyone is happy

#

you don’t agree

#

don’t use it

#

i can’t imagine a world without licensing and copyright

#

although that wasn’t too long ago

high pewter
#

My whole point is that I wish we didn't have to rely on laws to reduce (maybe prevent was a poor word) murder. If we didn't have laws, the world would be complete chaos and that wouldn't be good. However, in a world where there wasn't chaos without laws (like, humans somehow just inately knew what other humans were ok with and whether it was worth doing something someone wasn't ok with for a positive net benefit, and would also always do what's best), then laws wouldn't be necessary, and life would be a lot easier. Sadly, though, humans aren't perfect, so we do need laws to keep the world in order. For the same reason, we do need licenses, but if we didn't it would definitely be easier

#

Like, if I said the world would be easier if we didn't need to sleep, that's not me saying that we should all just stop sleeping and that I don't want to comply with my wish to sleep, I'm just saying I would quite like an extra 8 free hours every day lol

#

How did we get here lol

orchid gazelle
#

laws could be improved a lot

young knoll
#

A lot of things could be improved a lot

#

But money

orchid gazelle
#

laws are one of the most important things to be improved tho

high pewter
orchid gazelle
#

omfg I hate tracking some object in a video manually

#

tracking cannot be done automaticly sadly

#

it takes like 10 minutes to track an object that is in sight for 10 seconds

high pewter
#

Why are you needing to do it manually? It still takes a bit of time to do it automatically, but it's definitely quicker than doing it completely manually

orchid gazelle
#

idk how it works automaticly

high pewter
#

Which editor you using?

orchid gazelle
#

but heck its a figure in a video game which I had to track my self-animated loading circle on

#

davinci resolve

high pewter
#

If you're applying visual effects to it, use the tracker in the Color tab. If you're adding text or a sprite or tracking it with the camera, use one of the several trackers in the Fusion tab

orchid gazelle
#

im applying a fusion comp

#

but the atmosphere in the game especially is very tinted and same-colored, thats why I doubt any AI would be capable of fully tracking the head of the figure

#

im really new into learning video editing. I really like it, but its very very hard to get into

high pewter
#

You can make it track in B&W so the color won't matter, as long as there is a noticable difference in brightness

orchid gazelle
#

I wanna try this out now. How does it work with a fusion comp?

high pewter
#

I've not tried to Studio version, so if you're using that you might have a better chance with one of the Studio trackers, but usually it's the planar tracker you need

orchid gazelle
#

I am using the free version

high pewter
#

Then you find a frame where the object you want to track is clearest, draw around that object, extend the outer box so that it covers the maximum distance it should reasonably travel in a single frame, set the starting frame and use the video player like buttons to track forwards/backwards until it tracks everywhere you need that tracking information. You can then apply that planar transform onto the loading circle

#

If you don't get a good result, you can manually adjust individual frames and have it do everything inbetween automatically and there's plenty of other options you can change to limit it to only the information it should require to find the object (such as the B&W one I mentioned earlier)

orchid gazelle
#

where even is the planar tracker

high pewter
#

I think just Add > Tracking > Planar Tracker

orchid gazelle
#

I only see Surface Tracker, Cloud Tracker and Point Tracker

#

1 sec

high pewter
#

Lemme open up Resolve lol, I'm just going based off memory rn

orchid gazelle
#

alright

high pewter
#

I'll move into #general

orchid gazelle
#

okay

coarse finch
#

any of yall know why i get cannot cast CraftZombie to player? its for this bit of code java if (config.getBoolean("freeze-command.negate-attack")) { // this is the line it errors if (event.getDamager() instanceof Player player){ if (frozenDict.get(player.getUniqueId()) != null) { event.setCancelled(true); } } }

high pewter
#

A zombie isn't a player, and besides that's supposedly not even the line that's erroring?

coarse finch
#

the error points to that line

#

im not assuming an entity is a player anywhere

high pewter
#

Ye, in which case it's not the casting causing the error (which it wouldn't cos you're only casting if it's actually cast-able i.e. instanceof Player)

young knoll
#

Show the actual error

high pewter
coarse finch
high pewter
#

Ye I assure you that the first line won't be line 83, you aren't trying to cast on that line

young knoll
#

Make sure the code on your server is up to date

coarse finch
#

it is

high pewter
#

It's either that or you're mis-reading the line numbers

unborn sable
#

Is there a method that lets the server run a command for a player? (Nvm I think player.chat() can do it)

coarse finch
#

heres the whole function im not casting anywhere ```java
@EventHandler
public void EntityDamageByEntityEvent(EntityDamageByEntityEvent event) {
if (config.getBoolean("freeze-command.negate-damage")) {
if (frozenPlayers.get(event.getEntity().getUniqueId()) != null) {
event.setCancelled(true);
if (event.getDamager() instanceof Player attacker) {
attacker.sendMessage(ChatColor.RED + "This player is frozen!");
}

    }
}
if (config.getBoolean("freeze-command.negate-attack")) {
    if (frozenPlayers.get(event.getDamager().getUniqueId()) != null) {
        event.setCancelled(true);
    }
}

}```

unborn sable
high pewter
unborn sable
#

since I want an operator command to run commands and chat as someone else

high pewter
#

Oh fair enough

high pewter
# coarse finch heres the whole function im not casting anywhere ```java @EventHandler public vo...

frozenPlayers.get(event.getDamager().getUniqueId())
I'm guessing frozenPlayers is a Map<Player, ...>, meaning this will be get(Player), meaning it must try to cast event.getDamager().getUniqueId() to Player in order to run the function, but you're not checking if event.getDamager().getUniqueId() is actually an instance of Player (in fact, it won't be, it'll be an instance of UUID) so this produces the error

coarse finch
#

its HashMap<UUID, Boolean>

young knoll
#

It wouldn’t cast like that anyway

fossil coral
#

Hiii, I was wondering if I could add a custom villager profession, and use a resource pack to change it's look

tranquil prairie
#

?paste

undone axleBOT
tranquil prairie
sullen marlin
#

no

#

pointless doing it async if you just .get though

young knoll
#

.get blocks until it’s finished

#

You need something like .thenAccept or .whenComplete

young knoll
#

The builder will be empty when your return runs

tranquil prairie
young knoll
#

Oh wait ur using .join

#

So ur still blocking

tranquil prairie
#

Sorry for the questions but I dont understand the topic too well

dawn flower
#

how do i add metadata directly to an item from a string? kinda like minecraft's /give system (example: /give (player) (item){metadata})

pseudo hazel
#

the only way I have found is by using Bukkit.getUnsafe().modifyItemStack on an existing item stack

#

but if anyone has a better idea, please let me know too xD

ionic terrace
echo basalt
#

Bukkit.getItemFactory().createItemStack(input)

dawn flower
#

cuz im accessing it from a string

young knoll
#

That’s very cool

glad prawn
#

🥵

echo basalt
#

lots of cool methods

ionic terrace
#

ooooo

echo basalt
#

Some might be paper specific

young knoll
#

A lot of those are

#

Sadge

echo basalt
young knoll
#

Does give me some ideas tho

ancient plank
#

uwu

fervent robin
#

Does PlaceholderAPI support returning placeholders async?

#

I am using completable futures

echo basalt
#

there's something called caching

#

run the future once in a while and cache the value

high pewter
#

How can I check if a given Block is Attachable? I'm stuck, cos all the implementing classes for Attachable are deprecated in support of BlockData and none of the implementing classes of BlockData implement Attachable, which seems to suggest Attachable is useless but then why isn't it itself deprecated and what can I use instead?

echo basalt
#

Hangable

high pewter
#

Hangable only includes Lantern and MangrovePropagule- I need to check for any block which requires another block for support, such as torches, signs, chorus fruit, ladders...

echo basalt
#

Pretty sure I went over this before

high pewter
#

Hm?

echo basalt
#

yeah around here

sullen marlin
high pewter
#

Not sure what you mean, sorry

fleet comet
#
list.add(entityPlayer?.uuid!!)

    connection.send(ClientboundPlayerInfoRemovePacket(list))
    connection.send(ClientboundRemoveEntitiesPacket(getEntityID()))``` I'm using this to send a removal packet, but it isnt working and isnt removing npcs, anybody know why?
unborn sable
#

Is inventory.firstEmpty() being null the best way to check if a player's inventory is full?

kind hatch
#

It's not a perfect solution as it only compares empty slots. Ideally you'd want to check if the item you want to add is compatible with existing stacks in the inventory.
You might be able to do that with Inventory#addItem(), but I haven't tested that myself.

unborn sable
kind hatch
#

That's shouldn't be possible. #addItem() only adds items. It can't remove any existing ones.

unborn sable
#

No, it doesn't give the item if the inventory has no space for it

kind hatch
#

Well, that's to be expected... If the inventory is actually full, meaning all slots filled and the item they are trying to pickup doesn't match any existing slots or all existing slots that match are full, how could it add the item?

unborn sable
#

Is there any way to check so I can drop the item at their location instead of adding it to the inventory?

kind hatch
#

Yes, according to the docs, #addItem() does return a HashMap of any item that it couldn't add. So just check if the map is empty and if it's not, iterate over it and spawn the items.

minor otter
#

How is block breaking damage stored on bedrock compared to java?

unborn sable
kind hatch
#

The integer is the slot number. The itemstack itself should contain the amount.

unborn sable
upbeat abyss
#

yo i need some help

#

sending error now

kind hatch
#

You can iterate over Map#values()

#

If you need the keys, Map#keySet()

unborn sable
#

Ok

kind hatch
#

If you need both, there's a weird thing where you have to iterate over Map.Entry<K,V>

upbeat abyss
#

WHY THE FYCK WILL IT NOT LET ME SEND IT

unborn sable
#

Java is weird, my main language is JavaScript lol

#

You aren't verified

upbeat abyss
#

[20:53:00 INFO]: [FancyBrewersPlugin] Enabling FancyBrewersPlugin v1.0-SNAPSHOT
[20:53:00 ERROR]: Error occurred while enabling FancyBrewersPlugin v1.0-SNAPSHOT (Is it up to date?)
java.lang.NoClassDefFoundError: com/mongodb/xxx/mongodb/MongoClient
at net.tonepvp.fancybrewers.FancyBrewersPlugin.onEnable(FancyBrewersPlugin.java:51) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:407) [patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:359) [patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:318) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:408) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:372) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:327) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:267) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched_1.8.8.jar:git-PaperSpigot-445]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_371]
Caused by: java.lang.ClassNotFoundException: com.mongodb.xxx.mongodb.MongoClient

#

there

echo basalt
#

ew 1.8

upbeat abyss
#

HCF server plugin

#

you're lucky i ported it to from 1.7

kind hatch
# unborn sable Java is weird, my main language is JavaScript lol
Map<String, Integer> myMap = new HashMap<>();

for (Map.Entry<String, Integer> entry : myMap.entrySet()) {
  entry.getKey();
  entry.getValue();
}

That's how you can iterate over the entry set if you need both values. Weird formatting, but apparently you gotta be specific.

#

There's probably some lambda equivalent, but I'm not good with streams.

uncut herald
upbeat abyss
#

i fucking tried

uncut herald
#

dame bro

upbeat abyss
#

idiot

uncut herald
#

nice embed fail tone broski

upbeat abyss
#

this is why your mother doesnt love you tk

sterile breach
#

Hi

        String result = PlaceholderAPI.setPlaceholders(p, "%essentials_is_teleport_enabled%");
        if (result.equalsIgnoreCase("yes")) {
            return true;
        } else {
            return false;
        }

why i never got true?

dull schooner
#

Hey guys, is there a way to remove enchantment restrictions without manually getting the event and doing all the math to choose enchantments and levels?

#

Cause i need that to work with everything related to enchanting, like anvils, enchanting tables and villagers

placid moss
#

i think the result is true/false not yes or not

#

i presume

humble lynx
#

Does anyone here know if you can create a resource pack with multiple skins for a single entity, and depending on the NBT data inside the entity it chooses the skin to pick from?

manic furnace
#

How can I spawn a Village with my plugin?

glad prawn
shut sphinx
#

hey guys, just a quick question
how can i detect if a gliding player is being boosted by fireworks

eg: something like this:
if (player.isGliding() && !player.isBoosting())
??

thanks guys!!

tribal valve
#

?learn

#

what's the command

#

For the learn links

torn shuttle
#

does anyone here happen to be very familiar with custom resource pack models and can tell me exactly how the origin of a model works?

#

I think it's limited to -16 to +32 but I don't really see it moving

tribal valve
#

or do you just edit the json

#

?learnjava

undone axleBOT
tribal valve
#

Oh found it

shut sphinx
quartz spruce
jolly forum
#

Hi, how can I use bungeecord to put a skin on a player?

tribal valve
#

Bungeecord? This is spigot

#

U doing a spigot plugin?

#

Or a bungeecord plugin?

tribal valve
jolly forum
#

bungeecord

jolly forum
tribal valve
#

So lobby is a spigot?

jolly forum
tribal valve
#

Hub*

jolly forum
#

But I want to do it under bungeecord

tribal valve
#

So u making a bungeecord plugin?

jolly forum
#

Yes

tribal valve
#

Proxy - bungeecord
Hub - spigot
Other server - spigot
To what server you're making plugin

jolly forum
#

Proxy

tribal valve
jolly forum
#

How yes

#

sorry

#

But bungee don't have a server

tribal valve
#

But how do you want to put the skin on player if you use proxy to do it

#

Proxy is just connection, there's no player or world in it

#

It just forwards you to lobby

#

You would need to do a spigot plugin and put it in all you're servers (beside proxy)

jolly forum
#

I tried to do it with SkinRestorer but it can't find the url and I don't understand how to do it.

quartz spruce
jolly forum
jolly forum
#

I'd like it if when you join the proxy it would put a skin with the SkinsRestorer api except that I don't know how to put a skin that is attributed by a url.

tribal valve
jolly forum
#

Okay, but I still don't know how to do it

tribal valve
#

Learn spigot

#

On player server join -> get player, get textures, apply textures to player, done

jolly forum
#

Thanks

#

getTexture?

tribal valve
#
Player player = event.GetPlayer();
        String skinUrl = "https://zone-delta.xyz/api/skin-api/skins/" + player.getName();
        //SkinData skinData = new SkinData(skinUrl);
        try {
            //ZoneDelta_Bungee.getSkinsRestorerAPI().setSkin(player.getName(), "https://zone-delta.fr/api/skin-api/skins/" + player.getName());
            main.applySkin(playerWrapper, skinUrl);
        } catch (SkinRequestException e) {
            throw new RuntimeException(e);
        }
        System.out.println(player + " +++ " + skinUrl);
jolly forum
#

??

#

You edit my code ?

tribal valve
#

Just changed the ProxiedPlayer to Player

#

You cant do anything to player in proxy cuz THERES NO WORLD IN PROXY

#

Also the skin doesn't replicate to lobby

torn shuttle
tribal valve
#

I'm pretty sure theres free programs

#

Like blockbench

#

It also has web version

tribal valve
torn shuttle
tribal valve
#

What do you want to do

torn shuttle
#

control models via api in-game in spigot servers for free and under a gplv3 license

tribal valve
#

Control models via API?

torn shuttle
#

that's what I said