#help-development

1 messages · Page 915 of 1

inner mulch
#

Is a try catch more expensive than an if check (npe)?

lost matrix
#

Yes

#

By magnitudes

inner mulch
#

:(

lost matrix
#

Also catching an NPE is very dirty

inner mulch
#

I was gonna be fancy and try something that might be null so it is faster but when the error happens its much slower i suppose

dry forum
#

its so i can assign an offset to an armorstand

also cloning appears to be what is messing up the yaw, and the issue with this code is that Location newLocation = stand.getLocation() creates the new armorstand where the old armorstand is, not the new central location so i tried to fix this by doing Location newLocation = location.clone().add(offset.x, offset.y, offset.z); and the armorstands yaw is messed up again

lost matrix
dry forum
#

1.20.4

#

<version>1.20.4-R0.1-SNAPSHOT</version>

lost matrix
#

Then cloning should make no difference.

#

Because getLocation() from an Entity always returns a clone

#
        for (Offset offset : offsetArmorStandHashMap.keySet()) {
            ArmorStand stand = offsetArmorStandHashMap.get(offset);
            Bukkit.broadcastMessage("Original: " + stand.getLocation().getDirection());

            Location newLocation = stand.getLocation().add(offset.x, offset.y, offset.z);

            Bukkit.broadcastMessage("Original with offset: " + newLocation.getDirection());

            ArmorStand armorStand = (ArmorStand) location.getWorld().spawnEntity(newLocation, EntityType.ARMOR_STAND);

            Bukkit.broadcastMessage("Applied: " + armorStand.getLocation().getDirection());
        }

Give me the output of this pls

dry forum
#

this doesnt use the central location though it uses the location of the original armorstand

#

so it isnt really what ill be using in practice if you still want me to test it?

lost matrix
#

Ok lets take a step back. Explain to me what you are trying to do.

dry forum
#

i have a location called location which is the central location that all armorstands should spawn around with their offset being applied

i have an armorstand called stand which is the original armorstand that the new armorstand will have its yaw/data/equipment taken from

i have an armorstand called armorStand which is the new armorstand that is cloned with the offset applied

i basically want to clone a set of armorstands from 1 location to another, like schematics but for armorstands

lost matrix
# dry forum i have a location called location which is the central location that all armorst...

Alright, first of all: Your Offset class is just a Vector which already exists in Spigot.

You should create new Classes for this:
pseudocode:

class ArmorStandStructure {
  offsets: List<Vector>
  piece: ArmorStand
}

Here is an example for such a structure class:

public class ArmorStandStructure {

  private final List<Vector> offsets;
  private final ArmorStand original;

  public ArmorStandStructure(ArmorStand original) {
    this.offsets = new ArrayList<>();
    this.original = original;
  }

  public void addOffset(Vector offset) {
    this.offsets.add(offset);
  }

  public void pasteAt(Location center) {
    for (Vector offset : this.offsets) {
      Location copyLocation = center.clone().add(offset);
      copyLocation.setDirection(this.original.getLocation().getDirection());

      ArmorStand copy = center.getWorld().spawn(copyLocation, ArmorStand.class);
      
      // Optional: Copy the original armor stand's properties to the new armor stand.
      copy.setHeadPose(this.original.getHeadPose());
      copy.setBodyPose(this.original.getBodyPose());
      copy.setLeftArmPose(this.original.getLeftArmPose());
      copy.setRightArmPose(this.original.getRightArmPose());
      copy.setLeftLegPose(this.original.getLeftLegPose());
      copy.setRightLegPose(this.original.getRightLegPose());
      copy.setBasePlate(this.original.hasBasePlate());
      copy.setArms(this.original.hasArms());
      copy.setGravity(this.original.hasGravity());
      copy.setVisible(this.original.isVisible());
      copy.setSmall(this.original.isSmall());
    }
  }

}
#

Usage would be something like

    Player player = ...;
    ArmorStand original = ...;
    ArmorStandStructure structure = new ArmorStandStructure(original);
    
    structure.addOffset(new Vector(1, 0, 0));
    structure.addOffset(new Vector(0, 1, 0));
    structure.addOffset(new Vector(0, 0, 1));
    
    structure.pasteAt(player.getLocation());
remote swallow
#

Any nerds here know of a heavy obsfucator (not to use on spigot) that has a gradle plugin or some gradle support. Like it has string obf, and a load of stuff to make code flow irregular mayb even decomp crashing, oh and free

chrome beacon
#

so you modify it and then spawn

#

instead of spawn then modify

chrome beacon
#

you could use ProGuard though

#

and as always it will be bypassed quite easily

dry forum
# lost matrix Alright, first of all: Your ``Offset`` class is just a ``Vector`` which already ...

well ive modified it a little

    public void paste(Location center) {
        for (Offset offset : offsetArmorStandHashMap.keySet()) {
            ArmorStand stand = offsetArmorStandHashMap.get(offset);

            Location copyLocation = center.clone().add(offset.x, offset.y, offset.z);
            copyLocation.setDirection(stand.getLocation().getDirection());

            ArmorStand armorStand = center.getWorld().spawn(copyLocation, ArmorStand.class);

            armorStand.setGravity(stand.hasGravity());
            armorStand.setInvisible(stand.isInvisible());
            armorStand.setInvulnerable(stand.isInvulnerable());
            armorStand.setHeadPose(stand.getHeadPose());
            armorStand.setLeftArmPose(stand.getLeftArmPose());
            armorStand.setRightArmPose(stand.getRightArmPose());
            armorStand.setSmall(stand.isSmall());
            armorStand.getEquipment().setHelmet(stand.getEquipment().getHelmet());
            armorStand.getEquipment().setItemInMainHand(stand.getEquipment().getItemInMainHand());
            armorStand.getEquipment().setItemInOffHand(stand.getEquipment().getItemInOffHand());
            armorStand.getEquipment().setChestplate(stand.getEquipment().getChestplate());
            armorStand.getEquipment().setLeggings(stand.getEquipment().getLeggings());
            armorStand.setArms(stand.hasArms());
            armorStand.setBasePlate(stand.hasBasePlate());
            armorStand.setBodyPose(stand.getBodyPose());
            armorStand.setLeftLegPose(stand.getLeftLegPose());
            armorStand.setRightLegPose(stand.getRightLegPose());

            Bukkit.broadcastMessage("x: " + armorStand.getLocation().getYaw());
            Bukkit.broadcastMessage("y: " + stand.getLocation().getYaw());
        }```

but the armorstands still arnt facing the same way as the original armorstands, but the debug messages are returning the same thing
lost matrix
remote swallow
quaint mantle
#

yo guys just a quick q

dry forum
quaint mantle
#

does anyone know how it would be possible to make a void world with end structure

#

and with biomes

#

would it be possible

#

like this guy did it

lost matrix
#

Yes its possible

quaint mantle
#

pls tell me how

#

i searched for a week

#

no answer

chrome beacon
lost matrix
quaint mantle
#

how would i do that

#

and would the world have biomes???

#

they are rlly important

chrome beacon
#

Do you know Java?

quaint mantle
eternal oxide
#

Add more overrides as you need```java
public class VoidGenerator extends ChunkGenerator {

@Override
public void generateSurface(WorldInfo info, Random random, int x, int z, ChunkData data) {

}

@Override
public boolean shouldGenerateNoise() {
    return false;
}

@Override
public boolean shouldGenerateBedrock() {
    return false;
}

@Override
public boolean shouldGenerateCaves() {
    return false;
}

}```

quaint mantle
quaint mantle
#

i also need forge for chunk generator @lost matrix ?

remote swallow
#

Religion of sus obsfucator when

lost matrix
quaint mantle
#

yes ik but

#

in general no one wanted to help

chrome beacon
#

There are plenty of one block plugins and mods

#

just use one of them

quaint mantle
#

i cant find them

#

there are the plugins of oneblock that respawns

#

i want one block thats just a grass block

#

but the problem is i need the end structure to spawn and i need biomes

eternal oxide
#

?paste for me

undone axleBOT
mighty gazelle
#

?gui

lean pumice
#

what is the repo of multivgerse core?

shadow night
lean pumice
#

but i dont found the repo

#

not the dipendency

chrome beacon
#

It's literrally the first result

lean pumice
#

repository in the pom

#

like this:

<repositories>
      <repository>
          <id>spigotmc-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>
#

but of multiverse core

chrome beacon
native ruin
lilac palm
#
int amountToSell = event.getItemStack().getAmount();
ItemStack item = new ItemStack(event.getItemStack().getType(), amountToSell);
HashMap<Integer, ItemStack> returned = player.getInventory().removeItem(item);
ItemStack itemCouldNotRemove = returned.get(0);
int amountCouldntRemove = itemCouldNotRemove.getAmount();```
native ruin
#

You might want to remove event.getitemstack instead of item, but I'm not sure because you havent told your problem yet

lilac palm
#

I will do as you advised:

#
int amountToSell = event.getItemStack().getAmount();
        ItemStack item = event.getItemStack();
        HashMap<Integer, ItemStack> returned = player.getInventory().removeItem(item);
        ItemStack itemCouldNotRemove = returned.get(0);
        int amountCouldntRemove = itemCouldNotRemove.getAmount();```
native ruin
lilac palm
granite owl
#

sometimes when i run mavens clean task and then try to run the package task maven does not include any resources(except for class files) to the resulting jar, am i too stupid to use it?

#

which then obv results in runtime errors

echo basalt
#

TIL that sound distance attenuation only works for mono tracks

#

If I add a custom sound to my resourcepack and I toss it in stereo it doesn't do the distance volume thing

chrome beacon
#

yeah

mortal hare
#

random shit you'll never need #1: if you set row height to 50 in microsoft excel you will get perfectly rectangle cells

chrome beacon
#

random shit you'll never need #2: excel ||\s||

slender elbow
#

until you need to manage your finances monkaW

tardy delta
#

finances in excel lol

chrome beacon
#

then you use google sheets

grave vigil
#

How would I go about making something that has several inventories that can be opened and closed, but when the inventory is closed, it returns back to the previous inventory?

mortal hare
#

doesnt even have list styles

chrome beacon
#

At least it's free

mortal hare
#

use libreoffice

#

if you want options and freemium

chrome beacon
#

never tried libre office

mortal hare
#

its great

#

its like msoffice

#

but like lighter

#

its not big chungus like ms office

#

it only takes 500mb

#

while office 3gb at least

#

and has like 99% features of it

#

although ui is not the same and you might need to get used to it

#

but you can fix that by turning on theme that's provided by default in the options that makes libreoffice have ribbon bar

slender elbow
#

the only reason i use google workspace is because i don't need to download software anywhere tbh

#

but most importantly, it fits my needs

mortal hare
#

i mean my uni is oriented around m$ so all the requirements of styling are very strict and around microsoft office suite and gl implementing them with google docs

slender elbow
#

sucks to be in your uni ig

mortal hare
#

wanna have a header with a number automatically apended when you create one

#

google docs nope, you need to click on list icon for each of it and apply it manually

#

because we havent added list styling for like 10 years of google docs existence

#

kinda embarrasing tbh

tardy delta
#

life would've been a better place if we started using markdown instead of ms word

mortal hare
#

i use markdown

#

on my notes

tardy delta
#

same

mortal hare
#

with vscodium

#

i love it how it autoformats for you

#

and you dont have to bother to make it readable

tardy delta
#

worst part about college is when you gotta work with other people and they start using ms word

slender elbow
#

google docs 100% does have an option to number pages automatically lol

tardy delta
#

then you open a random file and the whole formatting breaks

mortal hare
#

not even gonna mention that markdown is literally copy pasteable

chrome beacon
#

It does

mortal hare
#

section headers

chrome beacon
#

?

#

wdym

mortal hare
#

the name of section

#

paragraph title

#

wtf it is called

#

idk

chrome beacon
#

What about it

mortal hare
#

you can have a title for a section right

#

but you cannot make it automatically assign a number with it

#

in my uni rules every header should have a number attached to it like:

1.1 Foo
bla bla bla bla

#

you can have it in google docs

chrome beacon
#

if you make it a numbered list you can do that

mortal hare
#

but applying it is pain the ass

#

yes but you cannot have it as a style

#

so that if you click on header style it would apply that list automatically like in ms word

slender elbow
#

yeah so, moral of the story, use the tool that fits your needs

chrome beacon
mortal hare
#

list styles exist

#

in ms word and libreoffice

#

in which you can attach list style to a normal style

#

and it would apply that list automatically when you assign that style to a particular text

tardy delta
#

heeheehee talking about unneeded complexity

mortal hare
#

That saves me a lot of time

chrome beacon
#

You can do that in docs too?

#

You can modify the heading styles

mortal hare
#

yes, but you cannot attach the list style to it (it doesnt apply list to you after you applied it)

mortal hare
#

it strictly rates your docs based on your skills in ms word

#

to format according to their rules

#

🙂

tardy delta
#

lol

mortal hare
#

its due to the fact we were taught to use advanced ms word things (columns, styles, sections, etc) since we were 12 in schools

#

and unis expect at least some kind of skills with it

#

blame my country for that

tardy delta
#

wrote most of my papers in libreoffice

mortal hare
#

lets be just nerds and use LaTeX

tardy delta
#

my teacher uses it

#

cant seem to get used to it

mortal hare
#

its like programming language but for text

eternal night
#

not writing in latex is a wild choice xD

dry hazel
#

typst is also decent

celest gate
#

hey so when I go to load up my server it says my plugin doesn't work. this is the console error and I don't understand whats going on?
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "com.belak.test.Testing.getCommand(String)" is null at com.belak.test.Testing.onEnable(Testing.java:12) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:525) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:439) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:584) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:403) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:255) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:968) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:293) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3610-Spigot-6198b5a-19df23a] at java.lang.Thread.run(Thread.java:1589) [?:?]

dry hazel
#

did you define your command in plugin.yml?

celest gate
#

do I need to get a description for them?

dry hazel
#

commmands

celest gate
#

oh

#

LOL

dry hazel
#

you have a typo there

#

yea

celest gate
#

wait i dont think i saved it

#

LOL

#

yeah its still saying the same thing :/

#

oh my

#

i had

#

3 M's

#

okay at this point im just spamming the chat. its saying the same thing still

#

nvm i got it

zinc moat
#

Is there a way of getting the players exp lvl?

#

like how it is exactly in minecraft

#

^ nvm

#

actually

#

the methods of getting them return weird stuff

#

does anyone else know a good method of geting the players xp

#

that is not (img 1 )

river oracle
#

the return value you will never be what you execpt

#

for whatever god damn reason

#

I still have no clue what the fuck either of those methods return lol

#

even with the javadoc

zinc moat
#

Guess what

#

me neither

#

they reutrn numbers

river oracle
#

I've got a method for you one second

zinc moat
#

but there very weird

#

i already found one

river oracle
#

oh

#

k

zinc moat
#

player.getlevel();

#

it returns what it says on the xp bar in minecraft

#

but thanks for trying to help!

#

appricate it

river oracle
#

I thought you wanted total experience points

#

you gotta make a util method for that one lol

zinc moat
pastel juniper
#

So using this I get the packet that I want, which is the Digging one, the problem is that I can't find the status(started mining, stopped)
@EventHandler
public void onPacketReceive(PacketReceiveEvent event) {
if (event.getPacket().getClass().getSimpleName().equalsIgnoreCase("PacketPlayInBlockDig")) {
StringBuilder message = new StringBuilder("Receive packet ")

                .append(event.getPacket().getClass().getSimpleName()) //
                .append(" from ");
        
        if (event.getRemote().getPlayer() != null)
            message.append(event.getRemote().getPlayer().getName());
        else
            message.append(event.getRemote().getAddress().toString());

        this.getLogger().info(message.toString());
    }
}
lost matrix
#

You need to write the class into the config if you want to do that.

lost matrix
umbral ridge
#

how much in bytes or KB is a block? Or how much, is one chunk in KB? When player joins the server, it has to request the server to load chunks, if they aren't already, and then it starts downloading them, but how much data does the player need to download or how much does its client downloads per chunk?

#

I think if there are less blocks in a chunk, chunk in total has less data so the faster is loading

#

I'm doing world (spawn) optimizations

lost matrix
#

This completely depends on the chunks content. Chests or other tile entities can inflate the size a lot.
Also chunks are sent in batches.

umbral ridge
#

What are batches?

#

Also is there a formula or any online wiki for this? for blocks sizes in bytes or kilobytes

#

can you get the block size in bytes or any other.. from Block object?

lost matrix
#

Sure. But this is tremendously irrelevant information.
What do you need this for?

umbral ridge
#

I'm doing heavy optimizations

#

And am also curious how much data does a client have to download lol

lost matrix
#

There is a 99% chance that you will hurt either the servers or the players performance.
The server already does a lot of optimizations in the back when it comes to chunk packets as they get compressed and

#

and sent in batches

umbral ridge
#

Yeah I'm just curious how much data is there

#

Where do I look for this?

lost matrix
#

Getting reliable values from this might take a week or two.

#

I would simply recommend you to listen for outgoing packets, look into their byte buffer and check the size of the packets directly.

umbral ridge
#

Alright thanks!!

lost matrix
#

This sounds usable

#

This would directly allow you to limit the bandwith for each client if you really want to.

torn shuttle
#

anyone happen to know if it's at all possible to change the trident model with a custom model in the resource pack without using optifine?

worldly ingot
#

The actual in-world model? No

lost matrix
#

Its an entity, so you can only replace it with a single texture.
Worst case: Make it invisible and mount an offset item model on it.

pastel juniper
young knoll
#

Idk if the trident can be invisible

lost matrix
#

Isnt it just a projectile entity?

pastel juniper
#

Still I can't get the EnumPlayerDigType

#

any ideas???

lost matrix
young knoll
#

Only living entities can be invisible afaik

pastel juniper
#

Minecraft 1.18.2 Protocol 758

lost matrix
lost matrix
young knoll
#

Won’t work well if you want to use it with loyalty

lost matrix
#

Next step is break into mojangs studio and fix their code, then force push on main and release

young knoll
#

Lol

#

Use a packet listener to tell the client it’s a snowball ig

lost matrix
#

Hm, might be wonky when the client tries to interpolate the movement for loyalty etc

pastel juniper
#

I tried this:

Field digTypeField = event.getPacket().getClass().getDeclaredField("c");
digTypeField.setAccessible(true);
event.getRemote().getPlayer().sendMessage(String.valueOf(digTypeField));

I got this:
private final net.minecraft.network.protocol.game.PacketPlayInBlockDig$EnumPlayerDigType net.minecraft.network.protocol.game.PacketPlayInBlockDig.c
private final net.minecraft.network.protocol.game.PacketPlayInBlockDig$EnumPlayerDigType net.minecraft.network.protocol.game.PacketPlayInBlockDig.c

minor jetty
#

What does it mean "Proxy lost connection to the server" using bungeecord newest version coding my own limbo

lost matrix
minor jetty
young knoll
#

Presumably the proxy has its own keepalive system

pastel juniper
minor jetty
#

I send normally JoinGame its loading for few seconds

#

and then this error

lost matrix
#

Meaning the proxy hasnt received anything back from the server in a while

minor jetty
#

After i change codec stated to PLAY?

minor jetty
#

ik there is whole 40 points straight what to send

#

But what is needed

pastel juniper
#

I figured it out

minor jetty
#

just to connect player

young knoll
#

I wonder if the proxy sends serverbound keepalives to the backend server to check if it’s alive

lost matrix
#

Not 100% sure what he is asking

minor jetty
minor jetty
lost matrix
minor jetty
#

Everything is fine, i change state to GAME, send JoinGamePacket but then its Loading Terrain.... and "Proxy lost connection..."

lost matrix
#

The client needs some information on how the world looks like and where he is about to spawn

minor jetty
#

Nothing else just connect

lost matrix
#

I would have to dig for that

young knoll
#

What version

void vapor
#
public class NPCManager {

    static Map<UUID, EntityPlayer> npcMap = new HashMap<UUID, EntityPlayer>();

    public static void Spawn(Player player) {
        GameProfile gameProfile = new GameProfile(UUID.randomUUID(), player.getName());

        WorldServer worldServer = ((CraftWorld) player.getWorld()).getHandle();

        EntityPlayer npc = new EntityPlayer(MinecraftServer.getServer(), worldServer, gameProfile, new PlayerInteractManager(worldServer));

        Location loc = player.getLocation();
        npc.setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
        npc.setCustomNameVisible(true);
        npc.setCustomName(player.getDisplayName());
        npc.setInvulnerable(false);
        // Ajouter le NPC au monde
        worldServer.addEntity(npc);
        npcMap.put(player.getUniqueId(), npc);

       }

    public static void unSpawn(Player player) {

        EntityPlayer npc = npcMap.get(player.getUniqueId());
        if(npc != null) {
            npc.getWorld().removeEntity(npc);
        }

    }
}```
#

Hey, why i got this error ??
[01:31:14 ERROR]: Encountered an unexpected exception
java.lang.NullPointerException: null
at net.minecraft.server.v1_9_R2.EntityTrackerEntry.broadcastIncludingSelf(EntityTrackerEntry.java:327) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.EntityTrackerEntry.d(EntityTrackerEntry.java:292) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.EntityTrackerEntry.track(EntityTrackerEntry.java:218) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.EntityTracker.updatePlayers(EntityTracker.java:178) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.MinecraftServer.D(MinecraftServer.java:874) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.DedicatedServer.D(DedicatedServer.java:403) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.MinecraftServer.C(MinecraftServer.java:723) ~[patched_1.9.4.jar:git-Paper-775]
at net.minecraft.server.v1_9_R2.MinecraftServer.run(MinecraftServer.java:622) [patched_1.9.4.jar:git-Paper-775]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_392]
[01:31:14 ERROR]: This crash report has been saved to: /home/GameServer/lobby_01/./crash-reports/crash-2024-03-02_01.31.14-server.txt

young knoll
#

If it’s latest you also need to handle the configuration phase

void vapor
#

i'm in 1.9.4

minor jetty
minor jetty
void vapor
#

nop

young knoll
#

It’s trying to send a packet to everyone nearby the NPC and the NPC itself

#

The NPC’s connection is probably null

void vapor
#

i just want to create a NPC clone of player

minor jetty
#

Bdw there was lack of position packet

torn shuttle
#

anyone know if it's possible to make custom armor models using optifine resource packs?

#

not just modifying the skin but actually changing geometry

#

to a custom model

young knoll
#

With optifine? Probably

minor jetty
#

Well bungeecord amaze me

#

I send simple KeepAlivePacket when player is connecting to limbo

#
overflow in packet detected! VarInt too big (max 5)

I receive this

#

i copied packet protocol from bungeecord source

young knoll
#

Pretty sure it should be a long

minor jetty
#

100% i write long

cursive kite
#

I am using TabCompleter for commands but the behavior makes no sense, if i return Collections.emptyList() for no completions it sometimes still lists players names while other times it properly does not display any

#

I can't figure out the behavior behind it

young knoll
#

Returning null lists players names

#

Returning an empty list should not

cursive kite
#

That’s the weird thing the behavior is not consistent

#

Sometimes it works sometimes it does not

cursive kite
#
    public List<String> getCompletions(CommandSender sender, String input, String[] args) {

        if(!sender.hasPermission(Permissions.adminSettingsAccess)) {
            return Collections.emptyList();
        }

        if(args.length == 1) {
            return null;
        }

        if(args.length == 2) {
            return UserSettingManager.getSettingsNames().stream()
                    .filter(word -> word.toLowerCase().startsWith(args[0].toLowerCase()))
                    .collect(Collectors.toList());
        }

        if(args.length == 3) {
            return Arrays.asList("true", "false").stream()
                    .filter(word -> word.toLowerCase().startsWith(args[1].toLowerCase()))
                    .collect(Collectors.toList());
        }

        return Collections.emptyList();
    }```
#

That is my code

#

but tab completing does this

lilac palm
#

How do I get all yaml configs inside of a folder?

rough ibex
#

get all files in a folder and filter by .yaml

#

or you could get all files and put them through a yaml parser to see if its valid YAML

white root
cursive kite
#

😦

worldly ingot
#

Also,

if (args.length == 2) {
    return StringUtil.copyPartialMatches(args[1], UserSettingManager.getSettingsNames(), new ArrayList<>());
}

if (args.length == 3) {
    return StringUtil.copyPartialMatches(args[2], List.of("true", "false"), new ArrayList<>());
}
#

Simplifies your two streams there a bit

cursive kite
#

Just made it to simply the parameters a bit lol

    public List<String> onTabComplete(CommandSender sender, Command cmd, String label, String[] args) {
        return getCompletions(sender, args[0], args);
    }```
#

That works perfectly!

#

Not too sure how it is different besides simplicity but it works

ancient heart
#

Guys I need help with plugin development.

#

I can't figure out how to get the block facing (relative to the world not to another block) and how to get all that information by finding the block through coordinates.

#

I need to get the block name in a usable format (preferably string) and if that block is a observer I need to get the block facing relative to the world

#

It would be nice if I could make a function that takes the block as input and returns the name of the block and if that block is an observer, returns the OBSERVER - [ORIENTATION] as a string

#

I've been trying to do this for 3 days, the spigot javadocs aren't helping. I've read through them several times and I can not figure this out.

#

Any and all help would be insanely appreciated

drowsy helm
#

through the Block class you can do getType to get the material and use getDisplayName() to get it's name

#

I'd really recommend hunting through the forums and using google, saves you heaps of time

worthy star
#

!paste

#

eh

#

?paste

undone axleBOT
worthy star
#

why i keep getting this error

#

for scoreboard

#

im trying to make scoreboard.yml file for changing lines and stuff

#

but i keep getting error

#

everytime i start the server

white root
#

I dont think you defined your main class in your plugin.yml correctly

worthy star
#

now i get this

#

this is right, no?

worthy star
#

nvm that

#
        Map<Integer, String> scores = new TreeMap<>(Collections.reverseOrder());
        for(int i = 13; i > -1; i--) {
            scores.put(i, manager.getLine(i));
        }``` is this smart? i feel smart
#

lol

#

quick question

#

would i need to do something so i can use placeholder api? i use skript and i want to be able to put variables there, there is an addon for it that lets you create placeholders like %data_kills% will be for example {data::kills::%player%}

ancient heart
#

i found out i couldve just world.getBlockAt(x, y, z).getBlockData().getAsString()

#

And if its an observer it literally says its orientation in the string as facing=east for example

#

I have been searching for something like this for a week and a half...

sullen marlin
#

You want to code your plugin relying on strings ???

ancient heart
#

Actually it is insanely easier

#

Javas class hyperabstraction bullshit only makes things considerably harder to mentally parse

#

this way i can literally just
blockString.contains("east");

#

and i have the logic i need

eternal night
sullen marlin
#

As opposed to blockData.getFacing() == BlockFace.EAST ?

ancient heart
#

yeah well unfortunately that doesnt work

eternal night
ancient heart
#

getBlockData() doesnt give anything that can give the facing

eternal night
#

You have to cast it

#

there are specific sub-interfaces

ancient heart
#

it only allows for block to block relative facing

eternal night
#

like a few

ancient heart
#

i am aware i read the javadocs

#

they are incomprehensible so i gave up after a week

eternal night
#

if instanceOf checking is over your paygrade in java you should go back to learning java

ancient heart
#

i simply do not yet have the java knowledge to deal with all that

ancient heart
#

but the only thing i enjoy about java is the occasional C type syntax for basic stuff like logic loops and variables so ill figure it all out

#

I'm not doing something too complex anyways

#

I'll definitely post the results here though, once im finished.

eternal night
remote swallow
#

i do not understand how to do that in java yet so i will make it harder for myself to learn that

eternal night
#

for anyone that reads it, pls don't base your shit off of strings.

if (world.getBlockData(x, y, z) instanceof final Directional directionalBlockData) {
    final BlockFace facingDirection = directionalBlockData.getFacing();
}

is the way safer alternative

worthy star
#

why whenever i add a command to my code plugin breaks

#
    private DataManager dataManager = ZyptrikBoard.getInstance().getDataManager();

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

        File boardFile = dataManager.getBoardFile();
        if(!(boardFile.exists())) {
            FileConfiguration config = dataManager.getBoardConfig();
            try {
                config.save(boardFile);
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }

        sender.sendMessage(Utils.color("&aReloaded the config file. (scoreboard.yml)"));

        return true;``` code
#

its registered in the main class and plugin.yml

eternal night
#

what does "plugins breaks" mean in this regard?

worthy star
#

1 sec

#

oh shit

#

LOL

#

im dumb af

eternal night
worthy star
#

i put wrong name in the main class

worthy star
#
[10:50:34 WARN]: Unexpected exception while parsing console command "reloadscoreboard"
org.bukkit.command.CommandException: Unhandled exception executing command 'reloadscoreboard' in plugin ZyptrikBoard v1.0-SNAPSHOT
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R3.CraftServer.dispatchCommand(CraftServer.java:999) ~[paper-1.20.4.jar:git-Paper-430]
        at org.bukkit.craftbukkit.v1_20_R3.CraftServer.dispatchServerCommand(CraftServer.java:984) ~[paper-1.20.4.jar:git-Paper-430]
        at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:501) ~[paper-1.20.4.jar:git-Paper-430]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:448) ~[paper-1.20.4.jar:git-Paper-430]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1515) ~[paper-1.20.4.jar:git-Paper-430]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1216) ~[paper-1.20.4.jar:git-Paper-430]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[paper-1.20.4.jar:git-Paper-430]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "me.hothifa.zyptrikboard.managers.DataManager.getBoardFile()" because "this.dataManager" is null
        at me.hothifa.zyptrikboard.commands.ReloadCmd.onCommand(ReloadCmd.java:22) ~[ZyptrikBoard-1.0-SNAPSHOT.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        ... 9 more```
#

now i get this

#

when i do the cmd

eternal night
#

your data manager is null

#

ZyptrikBoard.getInstance().getDataManager(); returns null at the point of instance creation

worthy star
#

ok wtf

#

its not

#
    ...
    private DataManager dataManager;
    ...
    public DataManager getDataManager() {
        return dataManager;
    }```
remote swallow
#

?paste the whole class

undone axleBOT
echo basalt
#

do you ever create a new instance?

worthy star
#

if you mean data manager

remote swallow
#

no the main class

worthy star
#

ok

#

there

remote swallow
#

you arent ever setting data manager

worthy star
#

wdym

#

i do

remote swallow
#

no you dont

#

what line are you setting it if you are then

worthy star
#

oh shit

#

1 sec

shadow night
#

lol

worthy star
#

i think i should quit

#

im too dumb

#

sos

#

im still new to java

shadow night
worthy star
#

that too

#

uh wtf

#

last question

#

i made a command to reload the plugin and create the scoreboard.yml file, but when i do it and it creates the scoreboard.yml is empty

#

its not in the code

worthy star
#

that is fixed

#

now i get error saying the scoreboard.yml is empty

#

its not tho

inner mulch
worthy star
#

yea but idk where to learn

#

like

#

there is a new youtube tutorial but it doesn't show the things like plugins

#

i need to pay for that

#

and all other tutorials are quite outdated or people stopped them after few parts

inner mulch
worthy star
#

i check source codes of plugins

#

i checked simple score's

#

i thought i would see like tons of classes

#

there was just like 4 packages and few classes

inner mulch
#

I'd recommend jsut start doing something you like and when there are problems ask here or google

terse ore
#

is the website working for you guys?

chrome beacon
#

yes

terse ore
#

oh now it works

#

weird

inner mulch
sullen canyon
worthy star
worthy star
inner mulch
#

Then you know what you want, right?

#

If you know what you dont wnat you should knoe what you want

inner mulch
worthy star
inner mulch
#

Do a chatmanager

#

Filter Bad words

worthy star
#

ok

#

good idea

#

i'll make like config.yml with list of words

#

because i suck making custom configs xD

sullen canyon
worthy star
#

like wordsyml

inner mulch
worthy star
#

uh what

inner mulch
#

Savinf every Single word will kill Performance

worthy star
#

i decided to learn what regex is then forgot to :)

inner mulch
#

Ok

worthy star
#

isn't regex like ?i>l/x

#

or smth

#

some symbols with in the word

inner mulch
#

Yes you can use it to not lose your mind when filtering words

worthy star
#

is this right website to learn it

worthy star
buoyant viper
#

i mean

buoyant viper
#

theres lists for those pretty sure

worthy star
#

i found this on first search

sullen canyon
worthy star
#

i understood 0 words there

#

lol

#

🤷.

terse ore
#

can you fake the biome where the player is just to change the sky appearance?

ocean hollow
#

is there an event to find out that the player has opened his inventory?

worthy star
#

i don't think so

inner mulch
#

Tjere is the achivement of openinh it for the first time

#

Judt reset it every time

ocean hollow
#

i don't think that is correct solution

inner mulch
#

Okay but there is no other one

#

Because its Client side

#

This is the only server side notice

#

Either this or nothing

earnest forum
#

There’s literally InventoryOpenEvent

inner mulch
#

Okay but player inv is client side

earnest forum
#

No it’s not

#

That wouldn’t make sense

slender elbow
#

IOE does not fire for the player's own inventory, it is client side

earnest forum
#

You can call get inventory on the event and check if the inventory is instanceof PlayerInventory

slender elbow
#

which will always be true unless they have something else open

#

as far as the server is concerned, unless something else on screen, the player always has its inventory opened

#

because the client simply does not send any open screen packet for their own inv

slender elbow
inner mulch
#

Oh

upper hazel
#

I would like to know if anyone has any template, information, ideas, etc. on the topic of creating an error handler from configs

#

preferably via annotations

#

like lombok

#

or in runtime

lost matrix
#

What does an error handler do for you and why does it need to be loaded from configs?

upper hazel
#

Well, check the resulting value from the config and log their error, displaying the user so that he understands where he made a mistake.

lost matrix
#

So you want to check for wrongly populated configs and tell the user what he did wrong?

upper hazel
#

yea

#

and it would be cool through anatomy

lost matrix
#

Runtime annotations will require reflections.
What do you want the annotations to do?

glacial narwhal
earnest forum
#

Dont run the task async

lost matrix
upper hazel
#

generated the same verification code as in Lombok during compilation

glacial narwhal
earnest forum
#

just run task timer

#

.runTaskTimer

lost matrix
earnest forum
#

theres a non async version

upper hazel
#

I understand it. It would be like an addition

glacial narwhal
earnest forum
#

Yes, runTaskTimer does what you want

echo basalt
#

not necessarily the case

lost matrix
#

No

echo basalt
#

but a decent rule of thumb

lost matrix
#

Yes

earnest forum
#

you are doing runTaskTimerAsynchronously, just do runTaskTimer

lost matrix
echo basalt
#

I've got no context I just came here and saw that 😛

lost matrix
upper hazel
#

so any ideas or anything similar

lost matrix
glacial narwhal
echo basalt
#

In short, async context when interacting with the bukkit api has like 3 safety levels:

  • Should be fine (when it's just sending a packet. Think particle effects or sendBlockChange or something)
  • Eh not a good idea (varies by case. You can change inventory contents async but you can't open or close an inventory async)
  • no. (Bukkit will often stop you. This is your typical world / entity manipulation)
#

:)

upper hazel
#

serilization

earnest forum
earnest forum
#

where Integer.MAX_VALUE is, is how long it takes to repeat

#

Integer.MAX_VALUE is a really large number so its going to repeat like never

#

for example

#

.runTaskTimer(0, 15*20L) would repeat every 15 seconds

lost matrix
# upper hazel wdym

Writing an annotation processor requires you to hook into the compiler and generate jvm bytecode during compilation.
If you have no experience with compiler architecture and bytecode generation, then there is an exactly 0% chance of you
writing that.

I would highly recommend simply writing a bunch of code that checks for malformed values in configs.
This could be done with reflections and annotations, or with some classic code.

glacial narwhal
earnest forum
#

so if you want to add a delay for it to start, you can change where i've put 0 to however long you want

hushed spindle
#

what method would i have to use to check if a task has finished, with a Scheduler#runTask() task that is

#

would isCancelled() simply return true when its done

sterile flicker
#
public static void setBlockInNativeChunk(World world, int x, int y, int z, int blockId, byte data) {
        net.minecraft.server.v1_12_R1.World nmsWorld = ((CraftWorld) world).getHandle();
        net.minecraft.server.v1_12_R1.Chunk nmsChunk = nmsWorld.getChunkAt(x >> 4, z >> 4);
        BlockPosition bp = new BlockPosition(x, y, z);
        IBlockData ibd = net.minecraft.server.v1_12_R1.Block.getByCombinedId(blockId + (data << 12));
        nmsChunk.a(bp, ibd);
    }``` why doesn't this method change the blocks type and data 1.12.2
#

I'm making a colormatch mini game and the original settype is too slow

twin venture
#

hi , uhh anyone good with math and if checks?

slender elbow
#

i sure hope any programmer is good with if checks

twin venture
#

iam making a menu for levels , so user have that level or higher , it should be unlocked , if user don't have that level yet in the db , it will be locked . and the material will be changed to dpend on that

#

anyidea , what is the best way to make a check to see if user claimed the reward or no?

#

UUID , int level , opned boolean?

earnest forum
#

map of <UUID, Boolean> should work

twin venture
#

and check if that level is opned? if so , set lore to opned ,if not set it to ready to be claimed

#

they are diffrent levels

lost matrix
twin venture
#

can i do a new table , with the levels user unlocked , claimed?

#

uuid , int , boolean?

#

or is it bad?

lost matrix
#

Sure you can do that. But as soon as the player joins the server you should load pretty much all his data

twin venture
#

yeahh

minor junco
rapid vigil
rapid vigil
lost matrix
#

?1.8

undone axleBOT
rapid vigil
earnest forum
#

Anyone know if there is an easier way to convert from spigot EntityType to an nms EntityType than just doing a switch?

rapid vigil
#

Thanks so much Shadow :D

earnest forum
#

thing is the nms EntityType isnt an enum

#

its this

grim hound
grim hound
earnest forum
#

it doesn't look like theres an easy way to do from string, like a valueOf

grim hound
lost matrix
# earnest forum its this

Use this key in the nms registry

NamespacedKey key = Registry.ENTITY_TYPE.getKey(EntityType.ALLAY);
grim hound
rapid vigil
earnest forum
#

i'll try what 7smile7 said

grim hound
#

it returns the optional of an exisiting value if it exists

#

and an empty optional is it didn't find it

worldly ingot
#

What about CraftEntityType#bukkitToMinecraft()?

earnest forum
#

yeah i ran .get() on it and there wasn't a value

grim hound
#

so basically an alternative of returning a null

grim hound
mighty gazelle
umbral ridge
#

hey

#

how do you open a book to a player? with text in it

worldly ingot
#

Create yourself a WRITTEN_BOOK ItemStack with all the necessary BookMeta

#

Pass it to that method

lost matrix
earnest forum
#

I am trying to create a dummy entity class that has no pathfinding goals, but I'm getting an error when trying to create one:
dev.yada.spawners.entities.DummyEntity cannot be cast to class net.minecraft.world.entity.monster.EntitySkeleton

public class DummyEntity extends Monster {

    public DummyEntity(Level world, EntityType entityType){
        super(EntityType.SKELETON, world);
        this.setBaby(false);
        this.setCanPickUpLoot(false);
    }           
    protected void registerGoals() {
        this.goalSelector.addGoal(0, new FloatGoal(this));
        this.goalSelector.addGoal(1, new LookAtPlayerGoal(this, Player.class, 8.0f));
    }
}
lost matrix
earnest forum
#

This didn't happen when I had a class extending a specific monster, like extends Zombie, but I wanted to get around creating a dummy class for every kind of monster I want

#

is there not any way around it?

worldly ingot
#

Okay... so... ehm... we made changes to CraftBukkit that enforce types in the hierarchy

lost matrix
worldly ingot
#

You can get around this hackily if you really want to, but I would just opt to make classes for the types you need

earnest forum
#

is there a way I could get the class type i want through an EntityType enum?

#

like for example i have a method that inputs ZOMBIE and then i get DummyZombie as a generic or something

worldly ingot
#

Not really, no. What's your goal here?

#

Dummy entity, obviously, but what's the end goal?

mighty gazelle
earnest forum
#

Creating a spawner plugin that spawns mobs which have no ai, but can still move around (get pushed, hit, etc)

#

which is why im using nms as opposed to using #setAI

worldly ingot
#

There is an EntityTargetEvent if you wanted to cancel that instead if they're spawner entities

sterile flicker
#
public static void setBlockInNativeChunk(World world, int x, int y, int z, int blockId, byte data) {
        net.minecraft.server.v1_12_R1.World nmsWorld = ((CraftWorld) world).getHandle();
        net.minecraft.server.v1_12_R1.Chunk nmsChunk = nmsWorld.getChunkAt(x >> 4, z >> 4);
        BlockPosition bp = new BlockPosition(x, y, z);
        IBlockData ibd = net.minecraft.server.v1_12_R1.Block.getByCombinedId(blockId + (data << 12));
        nmsChunk.a(bp, ibd);
        modified.put(new BlockPosition(x, y, z), CraftMagicNumbers.getBlock(Material.WOOL).getBlockData());
    }
    public static void update(Player player) {

        HashSet<net.minecraft.server.v1_12_R1.Chunk> chunks = new HashSet<>();
        for (Map.Entry<BlockPosition, IBlockData> entry : modified.entrySet()) {
            net.minecraft.server.v1_12_R1.Chunk chunk = ((CraftWorld) player.getWorld()).getHandle().getChunkProvider().getChunkAt(entry.getKey().getX() >> 4, entry.getKey().getZ() >> 4);
            chunks.add(chunk);
            chunk.a(entry.getKey(), entry.getValue());
        }

        for (Chunk chunk : chunks) {
            PacketPlayOutUnloadChunk unload = new PacketPlayOutUnloadChunk(chunk.locX, chunk.locZ);

            PacketPlayOutMapChunk load = new PacketPlayOutMapChunk(chunk, 65535);

            EntityPlayer ep = ((CraftPlayer) player).getHandle();
            int dist = Bukkit.getViewDistance() + 1;
            int chunkX = ep.getChunkCoordinates().getX();
            int chunkZ = ep.getChunkCoordinates().getZ();
                if (chunk.locX < chunkX - dist ||
                        chunk.locX > chunkX + dist ||
                        chunk.locZ < chunkZ - dist ||
                        chunk.locZ > chunkZ + dist) continue;
                ep.playerConnection.sendPacket(unload);
                ep.playerConnection.sendPacket(load);
        }

        //clear modified blocks
        modified.clear();
    }``` why doesn't it update the blocks? 1.12.2
lost matrix
worldly ingot
#

Ah you don't want wandering either

earnest forum
#

yeah

#

0 pathfinding

#

so if my spawner spawned type is zombie, I want to spawn a DummyZombie

echo basalt
#

setAware?

earnest forum
#

same for skeleton, etc

sterile flicker
# sterile flicker ```java public static void setBlockInNativeChunk(World world, int x, int y, int ...
for (int platformRow = 0; platformRow < 4; platformRow++) {
            for (int platformCol = 0; platformCol < 4; platformCol++) {
                for (int rowIndex = 0; rowIndex < 16; rowIndex++) {
                    for (int colIndex = 0; colIndex < 16; colIndex++) {
                        DyeColor randomColor = colors.get(random.nextInt(colors.size()));
                        PartyUtils.setBlockInNativeChunk(Map.party, (int) (Data.firstPlatformBlock.getX() + (platformRow * 16) + rowIndex), (int) Data.firstPlatformBlock.getY() - 1, (int) (Data.firstPlatformBlock.getZ() + (platformCol * 16) + colIndex), 35, new Wool(randomColor).getData());
                    }
                }
            }
        }
        for (String pl : SumeruParty.players) {
            Player p = Bukkit.getPlayerExact(pl);
            PartyUtils.update(p);
        }``` I'm doing a colormatch minigame and I'm looking for a more productive method than settype
echo basalt
#

setAware is just setAI but can move

#

no clue why you'd use nms

worldly ingot
#

Yeah, that's the better alternative

echo basalt
#

Color match eyeszoom

#

what's that about

sterile flicker
#

blockparty

echo basalt
#

AH

#

I don't remember the exact way we did it like 3 years ago

sterile flicker
#

is there a way to optimize this because settype slows down the server very much?

earnest forum
#

can't find setAware?

#

I've got a LivingEntity and theres no setAware method

#

only see setAi

mighty gazelle
earnest forum
#

nevermind, had to cast to Mob

lost matrix
mighty gazelle
lost matrix
inner mulch
#

does some1 know how i can make something like bukkit with their @EventHandler so methods are called if annotated?

mighty gazelle
remote swallow
#

use reflection, get the class, loop methods, check if field has annotation and there you fgo

umbral ridge
ivory sleet
#

@lost matrix u have used redisson right?

ivory sleet
#

so if I query a topic (reliable topic), and I dont specify a codec, what is the default codec

lost matrix
#

Come vc i need a walkthrough for something

ivory sleet
#

lol

#

ok but

#

u answer my question also lil goof

mighty gazelle
#
@EventHandler
    public void onPlayerInteractOn(PlayerInteractEvent event) {
        String prefix;
        prefix = ChatColor.GREEN + "" + ChatColor.BOLD + "[DolfiMC] " + ChatColor.GRAY + "";
        Player player = event.getPlayer();
        if (event.getHand().equals(EquipmentSlot.HAND)) {
              // That will be Execute 2 Times
            if (event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
                if (event.getItem() != null) {
                    if (event.getItem().isSimilar(playerhideritemon())) {
                        for (Player allPlayer : player.getWorld().getPlayers()) {
                            allPlayer.showPlayer(player);
                        }
                        player.sendMessage(prefix + "Du hast alle Spieler Versteckt");
                        player.getInventory().setItem(player.getInventory().getHeldItemSlot(), playerhideritemoff());
                        event.setCancelled(true);
                    }
                }
            }
            if (event.getAction().equals(Action.RIGHT_CLICK_AIR)) {
                if (event.getItem() != null) {
                    if (event.getItem().isSimilar(playerhideritemon())) {
                        for (Player allPlayer : player.getWorld().getPlayers()) {
                            allPlayer.showPlayer(player);
                        }
                        player.sendMessage(prefix + "Du hast alle Spieler Versteckt");
                        player.getInventory().setItem(player.getInventory().getHeldItemSlot(), playerhideritemoff());
                        event.setCancelled(true);
                    }
                }
            }
        }
    }





river oracle
#

how do you people who actually post plugins embed images on your plugins

#

I tried using imagur and it won't embed on the resource page😭

#

spigot only handles 5MBs in its image cache iirc so Idk what to do

chrome beacon
#

need smol gif

river oracle
#

I'm making epic handle it I'm losing my mind

#

this is why I work with epic lol

#

back to slaving away at the docs

chrome beacon
#

ebic

river oracle
#

ebicepic reference

chrome beacon
river oracle
#

Markdown >> BBCode

ivory sleet
#

void update(K key, BiFunction<K,V,V> updater) {

}

#

@inner mulch

remote swallow
twin venture
#

any idea how i can fix the sqllite file is java.sql.SQLException: [SQLITE_BUSY] The database file is locked (database is locked)?

river oracle
#

and yelling at me

#

that's why I keep you around

remote swallow
river oracle
#

especially the later part

young knoll
#

kek

river oracle
#

💀 I'm fired

#

I'm so fired

remote swallow
#

how am i gonna fire you

#

you own everything

young knoll
#

It's called a hostile takeover

river oracle
#

uhm actually nerd_glasses we have equal access

remote swallow
#

doubt that

river oracle
#

well besidfes the discord

#

you can't really do that

remote swallow
#

you own the group on github

river oracle
#

init how I setup the perms?

remote swallow
#

they are equal except i cant delete you

#

i think

river oracle
#

oh

river oracle
#

I thought you could lmao

remote swallow
#

ill check

twin venture
#

iam using HikariDataSource

river oracle
remote swallow
#

uhhhhhhh

#

coll can do it

#

huh

#

we do have equal perms

river oracle
#

see you could run a hostile take over

worthy yarrow
#

@young knoll fire y2k for me, so he can start on CabernetMC

remote swallow
#

github is reckless

river oracle
remote swallow
#

is that fuckin cheese mc

worthy yarrow
#

No

river oracle
#

Cabernet is a type of grape

worthy yarrow
#

Basically wine mc

remote swallow
#

why are you starting a grape mc while being in cheese land

#

im telling john wisconsin

river oracle
#

oh fucking fair

worthy yarrow
#

Because cheese pairs very well with Cabernet wines

river oracle
#

I should name it Four-YearCheddarAndCabernetMC

worthy yarrow
#

Still lots of time to debate the name

ivory sleet
#

@inner mulch

remote swallow
#

cammombear

ivory sleet
#

<T extends A | B>

worthy yarrow
#

Though you were quite strongly opinionated when it came to CabernetMC the other day

river oracle
#

oh true I was

#

the name is sticking

#

maybe

worthy yarrow
#

Like I said you still have lots of time so don’t rush the name, make sure it’s good

worthy star
#

is there a snippet for coloizing components, like the translate thing in ChatColor

#

like color("#123456Hello &aWorld")

grim hound
#

How do I properly unsign a message?

#

Since I intercept and prevent some message packets from being delivered to the client. But I also save them and send them when the time comes. However that kicks the player out in some cases

#

For some unvalid signing

#

Or the feedback messages are sent "Couldn't deliver the message: <message>"

grim hound
#

As packet classes

ivory sleet
#

@inner mulch

#

im back btw

inner mulch
ivory sleet
#

ye join general

sage patio
#

Hey, what player#hasPlayedBefore checks for? the data in the world or usercache

chrome beacon
#

world probably

sage patio
#

thanks

chrome beacon
#

You can always try it and see

sage patio
worldly ingot
#

Yes, it checks for the existence of the player's dat file

    @Override
    public boolean hasPlayedBefore() {
        return getData() != null;
    }
#

(getData() being the NBTTagCompound from the world's playerdata folder)

worthy star
#

?paste

undone axleBOT
worthy star
#

@inner mulch apologize for ping i get this error, can you help me making the chat filter? i'll really appreaciate it and won't forget it for rest of my life
https://paste.md-5.net/wepakemuha.pl

#

so i used this code in some listener class , but it sends errors

#

the errors is above

worthy star
#

what ?

#

uh wtf?

inner mulch
#

if i click on the link discord tells me to not open it

#

because it downloads something

worthy star
#

idk lol

#

now?

chrome beacon
#

Discord gets confused by .pl

#

it's fine

worthy star
#

.java works

inner mulch
#

okay, where is the code?

chrome beacon
#

Looks like a nullpointer

worthy star
#

wait 1 sec

#

i think

#

i'll try smth

#

btw is the code good? xD

#

i tried a for loop to get the word from the split message

#

so it doesn't do like class will be deleted because it has ass

#

i fixed it but now nothing happens

#

:)

#

ohhh

#

i got it

#

it doesn't ignore the case of word

#

i think im smart

#

i did something

#

how do i use the ignore case for contains

#

because there is nothing for it

umbral ridge
#

why not use regex?

worthy star
#

🤷

#

i couldn't find a made regex list for all bad words

#

i found one and its for gay and some idk what

umbral ridge
#

Here's how I would do it:

  • Split the message by space, in an array.
  • Run a for loop through the words and for each word check if it's in a bad words list.

But that's not very optimized. For a much more optimized version you should use functions from List. convert the String array to List. etc..

worthy star
#

thats what i do

#
        String msg = Arrays.toString(String.valueOf(event.message()).split(" "));

        for(Object word: Objects.requireNonNull(main.getConfig().getList("words"))) {
            if(msg.contains(word.toString())) {
                event.setCancelled(true);
                player.sendMessage(Utils.color("&cYou can't say that word. " + "(" + word + ")"));
            }
``` :)
umbral ridge
#

You need to cache your words list

worthy star
umbral ridge
mighty gazelle
#

How can I create a GUI?

umbral ridge
#

each bad word would have its own regex, I'd probably think this through and spend an entire day on it

worthy star
#

where is best way to learn how to use them in java, i couldn't find something useful on yt and google

lost matrix
mighty gazelle
lost matrix
worthy star
#

oo nice

worthy star
lost matrix
worthy star
#

you can find some mc developments tutorials on yt too

tardy delta
#

oh god those are awful

tardy delta
#

now learn about early returns

inner mulch
#

so many germans on this discord xd

shadow night
#

ofc

#

everbody is ein Deutscher here hahahahaha

inner mulch
#

you too?

dry hazel
#

nein

inner mulch
#

ok

shadow night
#

lmao

icy beacon
#

?paste for code walls pleasee

undone axleBOT
eternal oxide
#

1.12 packets using 1.16 API?

#
  1. Why are you sending a destroy packet to all other players. You never sent the spawn packet to anyone but the player.
  2. You can;t use 1.12 packets and 1.16 API. pick one version.
#

are you running it on a 1.12 server?

#

now you are spawning a new stand for every player except for the one joining

tardy delta
#

hmyes this better be a font issue

grim hound
#

this is how my file reading turns out

#

it messes up polish characters

#

and probably other too

tardy delta
#

using utf8?

eternal oxide
#

you are not using utf8 encoding

grim hound
#

this is how I read it

#

private static final Charset CHARSET = StandardCharsets.UTF_8;

grim hound
eternal oxide
#

it has to be created and saved as UTF8 also

grim hound
#

this is how I save it

eternal oxide
#

the data you are reading, comes from a file

ivory sleet
grim hound
#

but I am

#

using an InputStream

ivory sleet
#

What ru reading from

grim hound
ivory sleet
#

You’re reading from a file

eternal oxide
#

You can;t use FileWriter as that defaults to teh system default encoding

#

use OutputStreamWriter

lost matrix
#

Conclube help. VC and help me decypher my old code so i can color my stuff.

ivory sleet
#

Im just saying shadow, it can be dangerous to not close() the closable

#

In the finally block

grim hound
#

forgot

lost matrix
#

I will finally block you if no help

ivory sleet
#

im watching movie!

#

Give me like 30min

#

:,)

lost matrix
grim hound
#

an outputstream

eternal oxide
#

OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(path),"UTF-8");

grim hound
#

besides

grim hound
grim hound
eternal oxide
#

You can use whatever you want, just don;t use FileWriter

grim hound
ivory sleet
#

Files.newBufferedWriter(path,charset)

#

epic

grim hound
kind hatch
#

FileWriter is a convenience class for adding text to a file. Typically you’d want to use an OutputStream or something else.

ivory sleet
#

Well Files.newBufferedWriter/Reader does just wrap around the Files.newInput/OutputStream

#

:)

#

but yea

grim hound
grim hound
eternal oxide
#

yes

grim hound
#

nice, it works

mighty gazelle
#

How can I detect when I click in the Menu on a Item?

inner mulch
#

Guys does anyone know how i can properly work with RLiveObjects from redisson?

kind hatch
mighty gazelle
#

Yes

grim hound
mighty gazelle
grim hound
#

it works in minecraft, so is this a console issue?

kind hatch
#

Probably

#

They running it in different terminal.

#

Like bash for instance

sleek estuary
#

Does anyone know how I get the location of the interacted entity? I'm using protocollib and targetEntity is null in the print code

kind hatch
grim hound
kind hatch
#

You got notepad++?

grim hound
#

ye

kind hatch
#

Open the file you are messing with in it and look at the bottom right.

grim hound
kind hatch
#

It’ll tell you what the file is encoded in.

grim hound
#

utf8

#

this thing

#

is what I'm doing to ensure the files are updated

#

could it be an issue?

eternal oxide
#

are you saving a resounce from teh jar to file?

grim hound
#

well kinda

eternal oxide
#

just use Plugin#saveResource

grim hound
#

but yes

grim hound
#

it's not what I in all cases

grim hound
grim hound
#

uh

#

the InputStream

#

is fucked up

#

and can't change it

kind hatch
#

I can probably help more with that when I get home.

grim hound
#

pretty sure tis dud

#

is breaking the utf8 formatting

#

since it just kinda

quiet ice
#

Did you try looking whether it is UTF-8 in your jar?

grim hound
#

correct:

quiet ice
#

It wouldn't be impossible that maven or gradle copied the resource in a way that you didn't anticipate

grim hound
grim hound
#

using the intelliJ artifacts

quiet ice
#

uh yeah, then idk how it copies the resources

grim hound
#

but intelliJ still thinks I'm using gradle and pops up

grim hound
quiet ice
#

Normally would mean converting the resource to whatever bullshit encoding is your system default (not always UTF-8)

grim hound
#

how do I check this

quiet ice
#

Unzipping the jar and explicitly opening the resource file as UTF-8

grim hound
#

just did that

#

says utf8

quiet ice
#

Also, input streams are reading the raw bytes. It doesn't matter for input streams which encoding the files are

grim hound
quiet ice
#

So input/output streams cannot be the cause unless you wrap then in a Writer of Reader

quiet ice
#

why would you

grim hound
#

no I mean

#

uh

#

I don't

#

OH WAIT

#

ok I know the exact code that causes this

#

but I still don't know why it does

quiet ice
#

What is said exact code?

grim hound
#

tis

#

since it only occurs when this one is invoked

#

I'm 100% sure

quiet ice
#

Please just use java.nio.file.Files#write

grim hound
#

cuz I also do this

quiet ice
#

Try to use ISO_8859_1 instead of UTF_8 just as a hail mary

eternal oxide
#

not a good idea

tardy delta
#

V::toString, that java?

grim hound
tardy delta
#

looked like reified generics, ig its the same as Object::toString then lol

grim hound
#

Object::toString returns the Object implementation

#

I'm decently sure of that

quiet ice
quiet ice
#

Uhm that would involve me switching the discord client

grim hound
#

there are some other options

grim hound
quiet ice
#

No, just replace the charset you use for writing the file back

#

And make triple sure that your text editor is set to consume UTF-8

grim hound
#

now it just somehow

#

broke the file

#

like when it encountered the first invalid symbol it stopped writing

#

the other lines as well

quiet ice
#

no error in the log?

deep herald
#

anyone know how to get the console command sender in bungee?

slender elbow
#

it will just dispatch a virtual call as usual

dreamy chasm
#

What can cause an event not to fire in some cases?

sullen marlin
#
    private static class Child<X> extends Parent<Void>{}
    private static Class<? extends Parent<Void>> field = Child.class; // error```