#help-development

1 messages Ā· Page 1764 of 1

young knoll
#

Pro tip: If you have slow internet then SFTP isn't slow

iron bobcat
#

i found this AutoPlug | Automatic Plugin/Server/Java/Self Updater 5.2

ancient plank
#

was gonna say

#

SFTP isn't slow SC_ZERO_THINK

ivory sleet
#

that one was what I got in my mind

mortal hare
#

and you can bypass this via plugins

#

although some plugins download files in the main thread

#

which is bad

#

because it crashes the server

twilit wharf
#

so would I create another folder under src/main/java or where would I do that? or is there a tutorial online that shows you how to do that?

twilit wharf
ivory sleet
#

yes

#

you can keep it in another package just

#

or if you use maven/gradle then you got the possibility to isolate bungee from spigot if wanted

#

which I usually do to avoid runtime-less classes being available at compile time

mortal hare
#

i love how java has IdentityHashMaps

#

while it doesnt have implementation of IndentityHashSet

#

and I need to use this instead Collections.newSetFromMap(new IdentityHashMap<>())

young knoll
#

Doesn't have String.isNumeric either

quaint mantle
#

hashmap = hashset

mortal hare
#

yes

#

but i like encapsulation

#

not dummy values which are visible

ivory sleet
#

HashSet could at any point of time rely on something else but a HashMap tho but yeah

stoic osprey
#

How to set direction a player is facing without changing their whole location

#

idk why I can't remember im being stupid

stoic osprey
#

thanks

#

I tried setDirection and setFacing but didn't think of that being it

merry pulsar
#

Anyone knows how to create per player scoreboard by teams? ; v ;, im trying to make a rank score updates every 10 secs, but i need per player sb teams...

#

soo, if you can help plz hlp mah ; v ;

mortal hare
#

second option would be to send packet to the player

merry pulsar
mortal hare
#

I will literally use IdentityHashmap everywhere I can right now

merry pulsar
mortal hare
#

that's not for you

#

that's just me talking to myself

#

šŸ˜„

merry pulsar
#

ye im just sayin

#

i didn't say that u said it for me

mortal hare
#

all of the methods for the scoreboard

stoic osprey
#

didnt work 😦

young knoll
#

There is also Bukkit#getScoreboardManager#createNewScoreboard

#

Something like that

mortal hare
#

just be careful if you're using scoreboard plugins

#

it can override your plugins scoreboard

#

because client only supports one scoreboard at a time

rough jay
#

So I made a HashMap :
public final HashMap<String, Area> areaMap = new HashMap<>();
I managed to make a new Area (and add it to the HashMap) but how do I remove an Area?
Here's the code to make a new Area:

public void addNewArea(Location upCorner, Location downCorner, String name, Player owner, List<Player> coOwners) {
    if (!doesAreaExist(name))
        areaMap.put(name, new Area(upCorner, downCorner, name, owner, coOwners));
}
mortal hare
#

just remove it from the hashmap?

rough jay
#

there's no method to do so...

mortal hare
#

there is?

rough jay
#

which class?

eternal oxide
mortal hare
#

HashMap

eternal oxide
#

last resort

stoic osprey
mortal hare
#

even tutorials mentions it

rough jay
#

oh

#

thx

mortal hare
#

np

stoic osprey
eternal oxide
#

how often are you doing it?

steady warren
#

Hello

quaint mantle
#

Hello

mortal hare
#

oh hey

steady warren
#

I need some help here! I'm trying to prevent a Item Frame of having its item being taking out

mortal hare
#

i got free performance boost

#

just by literally changing map type

quaint mantle
steady warren
stoic osprey
mortal hare
#

for strings this is useful

terse spade
#

Would y'all mind taking a look at this? The function of the plugin is for a player to die as soon as they step onto the nether roof, and then a custom death message will be sent. The issue is that the custom death message isn't firing, and the even my "debug" output is not firing, so obviously the player's UUID isn't being added to the list.

package com.music4lity.NoNetherRoof.events;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.ChatColor;

public class Listeners implements Listener {
    
    public List<UUID> victimList = new ArrayList<UUID>();
    
    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
        
        Player player = event.getPlayer();
        if (player.getWorld().getName().endsWith("_nether")) {
            
            int y = player.getLocation().getBlockY();
        
            if (y >= 128) {
                player.setHealth(0);
                victimList.add(player.getUniqueId());
            }
        }
    }
    
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent death) {
        
        Player player = death.getEntity();
        UUID playerUUID = player.getUniqueId();
        if (victimList.contains(playerUUID)) {
            
            death.setDeathMessage(ChatColor.DARK_RED + player.getName() + ChatColor.DARK_AQUA + " tried to walk on the Nether roof");
            victimList.remove(playerUUID);
            System.out.println("debug");
            
        }
        
    }

}
quaint mantle
#

if event.getEntity instanceof ItemFrame

steady warren
#

It seems to work

quaint mantle
#
private final Set<UUID> victimList = new HashSet<>();
terse spade
#

Still not getting a death message

quaint mantle
#

that wasnt a fix

eternal oxide
silver shuttle
#

am I stupid or how do I remove a specific string index from a String[]?

quaint mantle
#

strings[i] = null

silver shuttle
#

ty

late sonnet
quaint mantle
silver shuttle
terse spade
quaint mantle
silver shuttle
#

alr ty

stoic osprey
eternal oxide
#

no clue, try it and see what happens

#

start at 1 second to see if ti even works

terse spade
#

Im such a dumbass

late sonnet
golden turret
#

_ _

graceful oak
#

Hey guys so if I have a hashmap to record some information if I wanted 2 values under a key that stood for different things I could just use a list and call 0 and 1 from the list for what I want but is there a more efficient way to do something like this or will this work well

unreal quartz
#

have an object represent whatever you're trying to represent

golden turret
#

^

lavish hemlock
#

using a list will have much more overhead compared to a single object

opal juniper
lavish hemlock
#

personally I like creating a Pair class if I have a lot of areas where two values must be stored

opal juniper
#

just use python

#

tuples ftw

quaint mantle
#

just use rust

#

tuples ftw

lavish hemlock
#

ye I'll surely use either of those in a Minecraft modding/plugin dev setting thanks guys

lavish hemlock
foggy estuary
#

Anyone know how to define a single diamond block instead of every diamond block that gets crafted

#

per example, breaking a single block at a certain location.

dry forum
#

why isnt armorstand.getLocation().setYaw((float) rotat); setting the yaw of my armorstand? ive broadcasted the variable rotat and it is a float but it doesnt rotate the armor stand

twilit wharf
grand flint
#

You know when you are on a wrong version of minecraft, and for example using Paper on the part where usually amount of players is eg 20/100 it says Paper 1.9.4 in red, how could I change that?

#

This thing

ivory sleet
#

In py

quaint mantle
quaint mantle
#
my_tuple = (1, 2, 3) # immutable
grand flint
ivory sleet
quaint mantle
#

why

grand flint
ivory sleet
#

To dynamically be able to build a tuple

#

Maybe I’m overthinking it now lol

quaint mantle
ivory sleet
#

Ah

quaint mantle
#
build = TupleBuilder()\
    .append(5)\
    .append(10)\
    .build()
ivory sleet
#

Smart

grand flint
twilit wharf
#

I am trying to use the BungeeCord channel

young knoll
#

?pdc

foggy estuary
verbal nymph
#

My IDE gives me a warning when I register my commands, saying that setExecutor might throw a NullPointerException here. Obviously, I'm only using it on commands that exist so, so there will never be such an exception. Is there a way to get rid of the warning without doing an unnecessary null check?

getCommand("collect").setExecutor(new CollectCommand());
grand flint
#

Is there a way to check what version a player joins the server on?

quaint mantle
twilit wharf
#

Getting all servers on a BungeeCord Network

next plume
verbal nymph
quaint mantle
#

yes its fine

subtle folio
#

Im having this issue whenever I try to add a player to an array list, they arraylist size doesnt change,

#

QueueManager ```java
public static ArrayList <Player> queue = new ArrayList<Player>();

public void addPlayer(Player player) {
    queue.add(player);
}

public void removePlayer(Player player) {
    queue.remove(player);
}```
#

Npc rightclick.java


    @EventHandler
    public void onNpcClick(NPCLeftClickEvent event) {
        if (event.getNPC().getId() == 1) {
            Player p = event.getClicker();
            qm.addPlayer(p);
            p.sendMessage("You have been added to the queue");
        }
    }```
eternal oxide
#

what do you mean teh size doesn;t change?

proud basin
#

clouds

young knoll
#

That list is static

subtle folio
#
QueueManager qm = new QueueManager();

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

        Player p = (Player) sender;
        if (args[0].equalsIgnoreCase("size")) {
            p.sendMessage(qm.queue.size() + "");
        } else if (args[0].equalsIgnoreCase("inqueue")) {
            if (qm.queue.contains(p)) {
                p.sendMessage("You are in the queue.");
            } else {
                p.sendMessage("You are not in the queue.");
            }
        }```
young knoll
#

You should be referencing it statically, or it should just not be static

subtle folio
#

i tried it not being static to no avail

#

so i was in the process of converting all to static

proud basin
#

What's inside of QueueManager?

#

ArrayList?

subtle folio
#

the first embed of code

#

is the queuemanager

#

yea

proud basin
#

and what's the issue?

subtle folio
#

the arraylist size isnt increasing whenver i add my player to the arraylist

eternal oxide
#

from what you have shown (other than the non static access of a static list, there is no reaosn for it to not grow

subtle folio
#

:/

proud basin
#

Can you show more?

#

Nothing there really helps

subtle folio
#

what other can I show

eternal oxide
#

could you perhaps be creating a new manager each time?

subtle folio
#

QueueManager qm = new QueueManager();

#

i may or may not being exetremly dumb, but i think i am

eternal oxide
#

as you show yrou code disjointed theres no way for us to tell

subtle folio
#
package net.ntdi.sumocombo.listeners.logic;

import net.ntdi.sumocombo.commands.staff.CloneDuel;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;

import java.util.ArrayList;

public class QueueManager {

    public static ArrayList <Player> queue = new ArrayList<Player>();

    public static void addPlayer(Player player) {
        queue.add(player);
    }

    public static void removePlayer(Player player) {
        queue.remove(player);
    }

    public static void removeAll() {
        queue.clear();
    }

    public static int getSize() {
        return queue.size();
    }

    public static Player getPlayer(int index) {
        return queue.get(index);
    }

    public static Player getNextPlayer() {
        return queue.get(0);
    }

    public static void group(Player p) {
        if (getSize() >= 2) {
            Player player1 = queue.get(0);
            Player player2 = queue.get(1);
            DuelManager.copyWorld(Bukkit.getWorld("Airena"), "duel_" + player1.getName() + "_" + player2.getName());

            queue.remove(player1);
            queue.remove(player2);

            player1.sendMessage(ChatColor.GREEN + "Your queued duel with " + player2.getName() + " has been started!");
            player2.sendMessage(ChatColor.GREEN + "Your queued duel with " + player1.getName() + " has been started!");

            player1.sendMessage(ChatColor.GRAY + "Teleporting to the duel arena...");
            player2.sendMessage(ChatColor.GRAY + "Teleporting to the duel arena...");

            player1.teleport(new Location(Bukkit.getWorld("duel_" + player1.getName() + "_" + player2.getName()), -3.5, 52, 4.5, -135, 1));
            player2.teleport(new Location(Bukkit.getWorld("duel_" + player1.getName() + "_" + player2.getName()), 4.5, 52, -3.5, 45, 1));

        } else {
            p.sendMessage(ChatColor.RED + "Waiting for 2+ players to join the queue");
        }
    }
}
``` QUEUEMANAGER.java
#
package net.ntdi.sumocombo.commands.staff;

import net.ntdi.sumocombo.listeners.logic.QueueManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class QueueCheckCommand implements CommandExecutor {

    QueueManager qm = new QueueManager();

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

        Player p = (Player) sender;
        if (args[0].equalsIgnoreCase("size")) {
            p.sendMessage(qm.queue.size() + "");
        } else if (args[0].equalsIgnoreCase("inqueue")) {
            if (qm.queue.contains(p)) {
                p.sendMessage("You are in the queue.");
            } else {
                p.sendMessage("You are not in the queue.");
            }
        }

        return true;
    }
}
``` QueueCheckCommand.java
proud basin
#

if that's static why not access it doing QueueManager.queue?

young knoll
#

^

eternal oxide
#

your queueCheckCommand is using its own queue manager

young knoll
#

Should still work though

#

Because static

proud basin
#

Coll you look like a static

subtle folio
#

should i add static to the front

#

so like Static QueueManager qm =...

eternal oxide
#

only IF his queue is really static. If it is his IDE would be screaming at him about non static access

young knoll
#

True, but it would still compile

eternal oxide
#

oh he made all methods static

subtle folio
#

yea

young knoll
#

Unless doing instance.<something static> somehow doesn't point to the same thing as Class.<something static>

eternal oxide
#

Yep, I see no reason for your queue to not grow if you add more than one player

subtle folio
#

im adding more checks in place

#

to see whats the root cause

eternal oxide
#

are you ever calling group?

subtle folio
#

thats my queueing function

#

so not yet, i wanna get the queue to actually work for adding and removing

#

that ill add that into play

eternal oxide
#

are you adding two actual players to test?

subtle folio
#

yes

#

also it works now, had to rename to static for everything

#

thanks for the assitance

#

šŸ‘

arctic moth
#

i need help with custom enchants

  1. how do i make it only work on picks?
  2. how do i make it conflict with certain enchants?
#

ok i think ik how to make it conflict but idk how to make it only work with picks

young knoll
#

Depends

#

Are you injecting into the enchantment class, or are you doing pdc

arctic moth
#

im doing the extends Enchantment

#

so ye injecting

young knoll
#

How are you applying the enchantment

arctic moth
#

wdym

#

by applying

young knoll
#

Adding it to items

arctic moth
#

oh i didnt do that yet

young knoll
#

Well, you would check for the right item then

arctic moth
#

but i think ima make it from enchanting table, book, etc. like the normal mc enchants

#

do they work with those

#

custom enchants

young knoll
#

Not automatically

arctic moth
#

oh

#

how would i make those work

young knoll
#

Events

#

EnchantItemEvent, LootGenerateEvent, and

#

Uhh what was it

arctic moth
#

lol

young knoll
#

VillagerAcquireTradeEvent

arctic moth
#

wait would it show up in enchanting tabl

#

with the event

#

lol

twilit wharf
young knoll
#

Define show up in the enchanting table

arctic moth
young knoll
#

You can modify the suggestions in the PrepareItemEnchantEvent

#

But I don't think it works with custom enchantments because the client has no translation key

empty comet
#

Inventory not matching on InventoryClickEvent

patent horizon
#

cant seem to find the packet play out class

#

are you talking about the wiki or nms?

young knoll
#

It will have an affix

#

Like PacketPlayOutMapChunk

patent horizon
#

oh nvmd

#

i dont know how to read correctly

ivory sleet
#

?jd-bc

patent horizon
#

huh?

subtle folio
#

Hey me again, I need to make a countdown but its in a static function and I need to use static variables but the variable stays after the countdown is done, not getting reset. What can i do?

#
SumoCombo.getInstance().getServer().getScheduler().scheduleAsyncRepeatingTask(SumoCombo.getInstance(), new Runnable() {
                @Override
                public void run() {
                    if (nume != -1) {
                        if (nume != 0){
                            player1.sendMessage(ChatColor.YELLOW + "" + nume + "s");
                            player1.sendMessage(ChatColor.YELLOW + "" + nume + "s");
                            nume--;
                        } else {
                            player1.sendMessage(ChatColor.YELLOW + "GO!");
                            player2.sendMessage(ChatColor.YELLOW + "GO!");
                            nume--;
                            canMove.remove(player1);
                            canMove.remove(player2);
                            canMove.put(player1, true);
                            canMove.put(player2, true);
                        }
                    }
                }
            }, 0L, 20L);```
#

my code

patent horizon
#

why do you need to make a static function

subtle folio
patent horizon
#

because?

subtle folio
#

becuase I call a static arraylist

patent horizon
#

...

young knoll
#

You shouldn’t make any of it static

ivory sleet
#

Static will make your code a global mess

young knoll
#

?static

#

Aww

ivory sleet
#

Kinda spaghetti

#

Coll that is to be added soon, I shall promise

patent horizon
#

im 99% sure you can grab static data in public methods

#

i do it for my static maps

young knoll
#

You can

subtle folio
#

hmph ig ill remove and see what happens

young knoll
#

But again, you should avoid static

patent horizon
#

well

ivory sleet
#

Using static makes your code not unit testable which sucks

young knoll
#

My plugins have a few static final constants and that’s about it

patent horizon
#

static is ok for data vars that get used across classes right?

ivory sleet
#

no

patent horizon
#

then what do you do for hashmap and such

subtle folio
#

i use Queue q = new Queue();

ivory sleet
#

Create a repository/registry/manager class

young knoll
#

Create methods to access it

patent horizon
#

cause hashmaps return null values when accessing them across classes

subtle folio
#

wouldnt that be bad if the thing werent static..

ivory sleet
#

And encapsulate the damn data structure

young knoll
#

No they don’t?

patent horizon
#

then i must be doing something terribly wrong

young knoll
#

Yes

patent horizon
#

oh you know what it probably is

young knoll
#

When you are learning java, pretend static doesn’t exist

#

It will help you a lot

patent horizon
#

im creating the instance for the class that grabs the hashmap in the constructor so the values dont exist yet

ivory sleet
#

Only solace static provides is the fact that it’s faster than other stuff in Java, though at the cost of zero object orientation

young knoll
#

Sounds like a micro optimization

ivory sleet
#

Yeah it is lol

#

Arguably a de-optimization but ye

young knoll
#

I have my bStats and plugin IDs static

patent horizon
young knoll
#

And some util methods, and a few enum sets of materials, that’s about it

ivory sleet
#

For true constants, pure methods, helper methods, singletons static, inner classes, identity keys, sometimes immutable objects, static is fine imo

young knoll
#

The singleton topic is still a hot debate

ivory sleet
#

True

#

I mean the design pattern as a perfectly justifiable use case

young knoll
#

Like my managers and registries could all be singletons, but I don’t have them like that

ivory sleet
#

It’s just that most spigot devs are obsessed with it

patent horizon
#

singletons?

ivory sleet
#

yes

young knoll
#

Classes that will only ever have 1 instance basically

ivory sleet
#

getInstance,
somethingInstance

patent horizon
#

oh yikes

young knoll
#

Your plugin class is a singleton

patent horizon
#

are they just used for like startup and shutdown?

young knoll
#

An enforced one at that

ivory sleet
#

and they can be used for configurations or something

patent horizon
#

ah

young knoll
#

And technically managers and registries and the like

ivory sleet
#

With that being said, having an upper interface to make it mockable is highly recommended

young knoll
#

Mockable?

ivory sleet
#

😳

#

Yeah

ivory sleet
# patent horizon ah

Speaking of static singleton, an unjustifiable imprecise use case is if you only need one instance of something

#

When you start setting up unit tests you’ll realize how you often will be creating tons of instances of that very class

young knoll
#

Ah

#

I’ve not done much with unit tests, only a bit in college

#

I mostly work with other games, so it isn’t really an easy option

ivory sleet
#

Oo yeah ah

patent horizon
#

yeah so uh i started java over the summer

#

so im understanding a good 20% of what you're saying

#

lmfao

ivory sleet
#

Anyways mocking is a technique when we control an object in a certain way to make our tests pass

#

Often it requires us to extend the already existing class of the object

#

And override logic

#

That’s why interfaces are nice for precisely that

young knoll
#

Ah

#

I should probably do more unit testing stuff

#

I’m sure one day it’ll be very useful

ivory sleet
#

Yeah, tdd is supposed to be fun, which probably would be the case if I didn’t get my tests to fail all the time

young knoll
#

I think mini posted a minecraft unit testing project the other day

ivory sleet
patent horizon
#

uhm

ivory sleet
#

Oh that was integration tests

patent horizon
#

ok so im doing nms rn

ivory sleet
#

But yeah almost the same

patent horizon
#

how much of the params do i need to use to get the bare minimum to work

unreal quartz
#

mocking people for things out of their control šŸ˜”

patent horizon
young knoll
#

Can we mock Mojang for some of the weird stuff that goes on inside minecraft

ivory sleet
#

Lol

patent horizon
#

like squid ai

vast junco
#

How can I store a short string in the nbt of an itemstack?

young knoll
#

I’m convinced some of the code is basically an SCP

ivory sleet
#

But I don’t work with packets that much

patent horizon
#

hm ;\

#

also the wiki says things like entity id and uuid

#

im not sure how i get the uuid if the entity doesnt exist yet

#

and i dont know what an entity id is

young knoll
#

Doesn’t the packet constructor just take an entity

patent horizon
#

so just make a EntityChicken and then shove it through the PacketPlayOut method?

young knoll
#

Depends

#

What does the constructor for the packet look like

patent horizon
#

contains entity type, coords, velocities, etc.

young knoll
#

The constructor does?

patent horizon
#

...

#

you have me second guessing what a constructor is

young knoll
#

For PacketPlayOutSpawnEntity?

#

Or whatever the packet is

patent horizon
#
    public PacketPlayOutSpawnEntity(int var0, UUID var1, double var2, double var4, double var6, float var8, float var9, EntityTypes<?> var10, int var11, Vec3D var12) {
        this.c = var0;
        this.d = var1;
        this.e = var2;
        this.f = var4;
        this.g = var6;
        this.k = MathHelper.d(var8 * 256.0F / 360.0F);
        this.l = MathHelper.d(var9 * 256.0F / 360.0F);
        this.m = var10;
        this.n = var11;
        this.h = (int)(MathHelper.a(var12.b, -3.9D, 3.9D) * 8000.0D);
        this.i = (int)(MathHelper.a(var12.c, -3.9D, 3.9D) * 8000.0D);
        this.j = (int)(MathHelper.a(var12.d, -3.9D, 3.9D) * 8000.0D);
    }```
it's just this right?
#

or is it the stuff right after the class gets created

young knoll
#

Yeah that’s it, I just figured it would be simpler

patent horizon
#

mhm

young knoll
#

Huh

patent horizon
#

kinda sucks this server doesnt support pictures

#

i guess they dont have enough moderation for that

young knoll
#

It does

#

You need to verify

patent horizon
#

ah

young knoll
#

This may help you figure out what each parameter is at least

patent horizon
#

omg public static final int FISHING_FLOAT = 90; this right here

#

perfect

young knoll
#

Looks like it’s mostly x y z and velocity

patent horizon
#

mhm

#

i just get tripped up with the entity type and data and stuff

#

since im guessing it's not the typical EntityType.CHICKEN

ivory sleet
#

int but it’s called fishing float, interesting Mojang, very Interesting

patent horizon
#

that's mojang?

#

i thought this was all spigot or bukkit's interp. of the source code

ivory sleet
#

Oh that not mojang oops lol

patent horizon
#

lol

#

what are wrappers

ivory sleet
#

Hmm depends but usually a class which encapsulates an instance of itself

young knoll
#

The game used to refer to the fishing bobber as ā€˜unknown’ iirc

patent horizon
#

😬

#

i think the bobber is the weirdest entity in mc

ivory sleet
#

class B {
void doStuff();
}
class C {
B b;
C(B b) {this.b=b}

void doStuff() {b.doStuff();}
}

#

I’d call C a wrapper for B

#

But generally wrapper is a very vague name

#

As there are different types of wrappers

#

(Which has official names)

patent horizon
#

so what i got out of that

#

is a wrapper is a class that just calls another class

ivory sleet
#

Yeah

patent horizon
#

well that seems useless

#

maybe even redundant

paper viper
#

suppose you have logic from library A, and logic from library B

#

and you dont want your users to shade both libraries

#

you can have a wrapper class for library A and library B

patent horizon
#

dont know what shading is

paper viper
#

and have methods which call from them

paper viper
patent horizon
#

oh well making a class that calls from multiple classes seems a lot more useful than calling one single class

paper viper
#

not necessarily

ivory sleet
#

Anyways if you’re truly interested in wrappers look up
Proxy
Bridge
Adapter
Decorator
Composite

paper viper
#

^

ivory sleet
#

They’re all different kind of structural design patterns regarding wrapping in one or another way

#

There are some behavioral ones as well but skip that lol

paper viper
#

another good example, NMS

#

ProtocalLib is a good wrapper with NMS so it translates the raw packet classes into usable API

#

So you don't have to write code using NMS and you can use just ProtocolLib because the library wraps the NMS classes

ivory sleet
#

Yeah splendid example

patent horizon
#

protocollib seemed interesting

#

but doesnt have what i need for my current project so i had to skip out

#
    @EventHandler
    public void chickenPacket(PlayerInteractEntityEvent event) {
        WorldServer world = ((CraftWorld) event.getRightClicked().getWorld()).getHandle();
        EntityChicken chicken = new EntityChicken(world);
// 'EntityChicken(net.minecraft.world.entity.EntityTypes<? extends net.minecraft.world.entity.animal.EntityChicken>, net.minecraft.world.level.World)' in 'net.minecraft.world.entity.animal.EntityChicken' cannot be applied to '(net.minecraft.server.level.WorldServer)'
        Location loc = event.getRightClicked().getLocation();
        chicken.setLocation(loc.getX(), loc.getY(), loc.getZ(), 0, 0);

        EntityPlayer player = (EntityPlayer) event.getPlayer();
        PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(chicken);
        ((CraftPlayer)event.getPlayer()).getHandle().b.sendPacket(packet);
    }}```

alright so im getting that error in intellij
quaint mantle
#

but if protocollib broke then everything will break, it is a big project ngl

young knoll
#

It did break a bit at the start of 1.17

patent horizon
#
                     @NotNull net.minecraft.world.level.World world)```
#

but setting WorldServer to World doesnt change anything

young knoll
#

WorldServer extends world

patent horizon
#

ye i assumed it would

#

not sure why giving it exactly what it asked for is bringing up a problem

#

would i need to also insert that first param

quaint mantle
#

wait did you forgot to put the chicken in the param?

#

looks sus

patent horizon
#

yeah i think i just need to add the entity type

#

oh wow

#

just took a look at the entity type class

#

feel stupid

#

wait no that was bukkit entities

#

is there a reason as to why all these parameters need to be this.a, this.b, this.c

#

seems like laziness to me

quaint mantle
#

its deobfusticated

patent horizon
#

well obviously not very well if the DE obfuscation has param names that still seem obfuscated lmfao

#

cannot access net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity

#

im getting this error when compiling

young knoll
#

You can’t magically get names back without mappings

patent horizon
#

uh

#

whats that supposed to mean

young knoll
#

The decompiler can’t get the original names of the methods back

patent horizon
#

oh right

#

cuz of deobfuscation

#

so what can i do to fix it

golden turret
#

@patent horizon what is your problem

patent horizon
#

cant access the original methods from nms when compiling my plugin

golden turret
#

which are the errors

golden turret
#

did you added the spigot to the pom/build.gradle?

patent horizon
#

yeah

#

you just turn spigot-api into spigot right?

late sonnet
patent horizon
#

hmm

#

my kody simpson tutorial said otherwise lol

#

do you know the pom stuff?

#

or where to find it

late sonnet
#
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
patent horizon
#

would i replace spigot or just add another one?

late sonnet
#

try add... i not use nms so many then i forget xd

patent horizon
#

Could not find artifact org.bukkit:craftbukkit:pom:1.17.1-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)

summer scroll
#

Use spigot build tools

patent horizon
#

ive installed build tools

#

dont really know how to add it to my project

undone pebble
#

you'd need to run it as well, simply downloading it is pointless

summer scroll
#

Okay, use the spigot dep and then remove the -api part

patent horizon
#

yup

#

done that

summer scroll
#

that's it

patent horizon
#

hmm

#

and i get nms?

summer scroll
#

yes, you can access nms, packets

patent horizon
#

that wouldnt explain why i cant access the functions

summer scroll
#

show full pom

undone pebble
patent horizon
#

yeah the other dude told me to get a craftbukkit dependency

summer scroll
#

no, dont use craftbukkit

#

also you need to run the build tools first

patent horizon
#

run?

#

like when you install it through gitbash or?

summer scroll
#

run the version that you want to use

#

javaĀ -jarĀ BuildTools.jarĀ --revĀ 1.17

#

or this one
javaĀ -jarĀ BuildTools.jarĀ --revĀ 1.17.1

patent horizon
#

oh in the gitbash?

#

ive already did that step

#

i have all the spigot, bukkit, craftbukkit, etc. folders

summer scroll
#

oh

#

you still can't access nms, packets?

patent horizon
#

nope

#

do i need to put the buildtools jar in my plugin resources?

summer scroll
#

do you have error on the pom?

#

no, you dont need to put that

patent horizon
#

i dont have any errors in the pom

#

it cant access PacketPlayOutSpawnEntityLiving but it can access EntityTypes and EntityChicken

random epoch
#

Try invaliding caches and restarting your ide

patent horizon
#

nopers

#
package me.wally.cybercade4.Lobby;

import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntityLiving;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.animal.EntityChicken;
import net.minecraft.world.level.World;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;

public class ChickenPacket implements CommandExecutor {

    public void chickenPacket(Player player, Location loc) {
        World world = ((CraftWorld) player.getWorld()).getHandle();
        EntityChicken chicken = new EntityChicken(EntityTypes.l, world);
        chicken.setLocation(loc.getX(), loc.getY(), loc.getZ(), 0, 0);
        PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(chicken);
        ((CraftPlayer)player).getHandle().b.sendPacket(packet);
    }


    @Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
        if (s.equalsIgnoreCase("chickenPacket")) chickenPacket((Player) commandSender, (((Player) commandSender).getLocation()));
        return false;
    }
    
}
#

am i missing something?

#

wow ghost pinging 😐

summer scroll
#

are you using java 16 for that project?

patent horizon
#

1.8 correto or whatever

summer scroll
#

1.17 require java 16

patent horizon
#

oh right

#

outdated compatibility only works with spigot api

#

lol

#

is there an easy way to change jdk versions without making a whole new project?

summer scroll
#

yes

#

open project structure

#

ctrl+shift+alt+s

patent horizon
#

so uhh

#

the language of java didnt astronomically change when going from 8 > 16 right?

summer scroll
#

yeah, nothing breaks

patent horizon
#

awesome

#

wait so if i leave the server while an entity packet still exists does it automatically get destroyed?

summer scroll
#

yes it will

patent horizon
#

ah ok groovy

quaint mantle
#

you shouldnt do that

#

it will not save

patent horizon
#

if i make a player think they're riding an entity created from a packet, can they just walk around normally?

quaint mantle
#

you should go to the pom.xml

#

then do this:

summer scroll
quaint mantle
#
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>```
#

the ${java.version}

#

you replace with 16

#

or 17 if you want

#

or you can do

    <properties>
        <maven.compiler.source>16</maven.compiler.source>
        <maven.compiler.target>16</maven.compiler.target>
    </properties>```
#

this it will convert the whole project and promise it will always in java 16

#

while the project structure only change the language to java 16, but not save it to maven...

patent horizon
#
    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>```
#

can i just change that to 1.16?

quaint mantle
#

yeah

#

looks like you use the development plugin for intelliji

patent horizon
#

yessir

quaint mantle
#

so it will have that thing

#

if normal then you have to set the properties like what i do, or just configuration it

#

change 1.8 to 16

patent horizon
#

...

quaint mantle
#

reload maven then it will auto change to language 16

patent horizon
#

and leave out the 1.

manic crater
#

p.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, Integer.MAX_VALUE, 1, true, Color.WHITE));

Anyone know how to fix this issue??

vast junco
#

I just found out that PlayerInteractEvent fires when you drop an item, is there any way around this?

vague oracle
manic crater
#

yeah ik that

#

i did that and it says the "Color" aspect isn't a thing

#

when it is

vague oracle
#

then remove the colour :/

manic crater
#

yeah but i dont want to bc i want colors to be a part of this glow effect.

vague oracle
#

That is not how the glow effect works, im pretty sure you have to be in a team with a coloured display name

vast junco
manic crater
#

even the java docs even states you can

vague oracle
#

send a link

manic crater
#

"Creates a potion effect with no defined color."

vague oracle
#

Im 100% sure its not referring to the colour of the glow

manic crater
#

.....

#

okay then how do i give glow colors..

vague oracle
#

you do know potion particles are coloured

manic crater
#

yes ik that

vague oracle
#

I told you, they have to be in a team with a coloured name

manic crater
#

...

#

yeah but i tried that though

#

and it doesnt work..

vague oracle
#

did you create the team through the plugin

manic crater
#

No bc i did it manually via mc commands before hand./

#

okay i officially am so confused with mc

#

now when i do the cmds in-game it works and yet before it didnt im so confused.

vague oracle
#

/team modify <team> color <teamColor> that will do it, if not then you will have to do player.setGlowing(true);

manic crater
#

ok well that works

vague oracle
manic crater
#

hm

#

ok well thank you anyway for the help.

vague oracle
#

np šŸ™‚

vast junco
vague oracle
#

but why do you need to ignore it, like why are you using the event

timid valley
#

so EntityPickupItemEvent is deprectated? what should i use instead, i want to check when an item enters a player's inventory whether by picking up an item or grabbing something out of a container, what should i use?

Edit: my bad just saw PlayerPickupItemEvent is deprectated but not EntityPickupItemEvent haha

#

Also, is there a way built into spigot to make a player have the glowing effect visible to select players without using packets or protocollib?

vague oracle
#

no

#

i think unless team visibility can have some sort of work round

livid tundra
#

this question

broken hare
#

Hey is the BukkitScheduler persistent? Like does it takes on restart.

quaint mantle
#

no

#

what data should persist here LoL

broken hare
#

I need to run a task every week.

#

and daily.

quaint mantle
#

why so

broken hare
#

To end a weekly contest.

quaint mantle
#

Ig you'd have to reschedule a task everytime

#

Or, maybe, run a task every minute and check if current timestamp equals or more than timestamp you set

broken hare
#

I was thinking of using a external scheduler like JobRunr which has built in persistence

#

Plus we are using redis, so it will be easy to setup with that

#

I was just asking if bukkit did, because if so I would just use that

viscid edge
#

any misplaced {s or }s here?

quaint mantle
#

learn java

hybrid spoke
#

put your return true inside the last bracket and give your if some

#

also strings dont work like this

quasi flint
#

hurts my brain

#

import comman btw

#

and extend or implement command

viscid edge
#

if (command.getName().equalsIgnoreCase(anotherString: "appeal")){

any ideas on missing )s here?

sullen marlin
#

'anotherString: '

#

that's uh not how java works

#

learn java please

#

?learnjava

undone axleBOT
unreal quartz
#

because anotherString: is the intellij hint

quasi flint
#

whats that unknown variablemd_5

viscid edge
#

ah

unreal quartz
quasi flint
#

ouch

young knoll
young knoll
#

Like all java methods should be

quasi flint
#

cursed

#

the more i look into that code

#

the more is wrong

quaint mantle
#

wait i really thought he was trolling

#

oh LOL he really didnt even know how java works?

#

...

tacit drift
sullen marlin
#

an Item is an entity, an ItemStack is an item in inventory

#

you have to drop it, theyre two different things

edgy drum
#

Why it is not working?

if (vaultHook != null) {
            format = format.replace("\\{prefix\\}",
                    vaultHook.getChat().getPlayerPrefix(player));
            format = format.replace("\\{suffix\\}",
                    vaultHook.getChat().getPlayerSuffix(player));
        }else {
            format = format.replace("\\{prefix\\}", "");
            format = format.replace("\\{suffix\\}", "");
        }
        format = format.replace("\\{player\\}", player.getName());
        format = format.replace("\\{message\\}", message);
        return format;

It should replace {player} to player name and etc.

sullen marlin
#

I dont think those \ is needed for replace, only replaceAll

hybrid spoke
verbal nymph
#

What Exception is thrown when it's not possible to parse it to a List? Or even better, how do I lookup Exceptions through Google when it's not stated in the docs? Do I just have to catch a generic Exception here?

(List) drop.get("commands")
ivory sleet
#

ClassCastException

#

But ideally you could just check the type (with instanceof) and then cast

maiden mountain
# unreal quartz

You need at least 5 years of java experience to understand that šŸ¤”

verbal nymph
# ivory sleet But ideally you could just check the type (with instanceof) and then cast

This would be my code now:

List<String> dropCommandsList;
try {
    dropCommandsList = drop.get("commands") instanceof String ? List.of(drop.get("commands").toString()) : (List) drop.get("commands");
} catch (ClassCastException e) {
     dropCommandsList = null;
}

So you would rather first check if (x instanceof String) then else if(x instanceof List) and then in the else block set it to null?

quaint mantle
#

why dont you simply...? just use list.of in the first place?

latent dove
#

ok thats smart

#

i thought his formula was correct

verbal nymph
#

Does List.of(x) accept a list as argument?

verbal nymph
#

Because at that point it's not know what kind of content the list has. The list comes fresh from a yaml file

quaint mantle
#

wow...?

#

you already have that toString

#

and that warning isnt an error right?

#

i guess i will leave it normal there.

verbal nymph
quaint mantle
#

why dont you just use a if check

#

if you use java 16

#

you will have pattern

#

it is the best thing java ever give to me lol

#

wait

#

oh no

#

sorry im dumb lel

verbal nymph
#

Well, the good news is, my code seems to work. I just gotta find out if the instanceof String ever is true, because I'm not so sure anymore šŸ˜„

List<String> commandsList;
try {
    commandsList = dropsMob.get("commands") instanceof String ?                
        List.of(dropsMob.get("commands").toString()) : 
        (List<String>) dropsMob.get("commands");
} catch (ClassCastException e) {
    LoggingUtils.warn("Incorrectly formatted commands for entity " + dropsEntityTypeString + "");
    commandsList = null;
}
unreal quartz
#

what is dropsMob

#

is it a configuration section? or a map from a config?

plush crescent
#

Thank you!

torn shuttle
#

does anyone here actually bother doing TDD for their minecraft plugins?

quaint mantle
#

What is tdd?

torn shuttle
#

test driven development

eternal oxide
#

buzz words

torn shuttle
#

I mean... it's a real thing

eternal oxide
#

it is

torn shuttle
#

it's also widely used, but whether it should be used for games is controversial

quaint mantle
#

Ah, unit tests and stuff?

torn shuttle
#

yep

eternal oxide
#

game development usually progressess too fast for TDD

#

unit tests come once you have teh framework mostly complete

torn shuttle
#

well that's the point of TDD innit

#

you write the tests first

quaint mantle
#

I know devs that do tests

#

but, personally, im not. Just doing static void main and testing stuff which doesnt depend on running server

eternal oxide
#

yes some devs implement unit tests but its not TDD. Its teh actual reverse

#

TDD is driven by the unit test you design.

torn shuttle
#

afaik tdd always puts the tests first no matter where you're at with writing the code

ivory sleet
#

So probably end up with the test fragility problem

torn shuttle
#

another important question, what do you do when you are trying to develop but can't even type properly because you're sore from the gym

#

please send a reply for this one real quickly, it's killing me

azure nova
#

what event is fired when player changes a item location in its own inventory?

quaint mantle
#

So.. I'm looking for some code (that will not be published on the spigotmc website as it violates it's TOS) where if the license of my plugin is invalid, the plugin will corrupt itself. Anyone has any clue how to achieve this? I already have code for checking licenses, so basically just need a function to self-destruct the plugin

#

either delete itself (which I know you cannot do when it's in use) or just break itself.

#

I'm writing code for a client that is known to well, not pay at all and just take your plugin.. I'd like to protect myself šŸ˜„

eternal oxide
#

Simple, get payment up front

surreal briar
#

The net.minecraft.world.entity.EntityTypes mapping was removed?

quaint mantle
surreal briar
azure nova
#

in PlayerInventory#setHelmet() how do u give player empty value? like to set his helmet to air?

tardy delta
#

Null?

quaint mantle
tardy delta
#

O

quaint mantle
#

wasd?!?!?1

#

its from paper discord

#

oh ok...

#

but i think he can set it to air too...

tacit drift
#

a random plugin

#

and when injecting, send the plugin name to you

quaint mantle
#

would it be a cool idea if i break all the spigot things like remove and change things around to make it my own jar šŸ˜‚

chrome beacon
#

Then sell it for 1000$ on mcm

hybrid spoke
tacit drift
#

Yeah but, they wouldn't know which one

hybrid spoke
#

but can't you as a user just remove the code which injects the jar and recompile the jar?

quasi flint
#

execute a cmd console maybe?

#

wait 10sec

#

delete?

tacit drift
#

It would be like virus plugins

#

but, not malicious

hybrid spoke
#

"not malicious" - want to inject a random plugin to destroy another

tacit drift
#

Well, it's a protection measure

hybrid spoke
#

i mean creating a second jar is probably the way to go, but we still are in java. you can just remove the self destruction

tacit drift
#

Allowing wierd obfuscation would make the job easier

#

like crashing decompilers

quasi flint
#

just open a console line window

#

done

hybrid spoke
#

obfuscation doesnt stop them, it just slows them down

tacit drift
#

I saw some jars

#

that if you decompile them

hybrid spoke
tacit drift
#

you see only folders

#

instead of classes

quasi flint
#

yea, i mean windows cmd creating a batch file

#

baboooom

#

while leaving it on

tacit drift
#

I mean, intave has a wierd licensing system

#

they need you to be able to have a folder .intave

#

where there are some files with wierd names

#

And their license it's per machine, you don't need to enter some sort of key

hybrid spoke
hybrid spoke
tacit drift
#

No

#

you add machines per license

#

3 free machines

hybrid spoke
#

so 1 license = 3 servers?

tacit drift
#

the rest are 5€ per machine per month (don't remember exactly)

hybrid spoke
tacit drift
#

So you buy the plugin once

quasi flint
tacit drift
#

And you can use it on 3 machines no extra charge

hybrid spoke
#

define machine. machine = server?

tacit drift
#

if you want to add it to more than 3 machines, there is a monthly payment if i remember right

#

idk if it was monthly or a one time payment

tacit drift
#

ip

hybrid spoke
#

ah

pastel carbon
tacit drift
#

But i think they can see if two machines are on 1 ip

#

that would be the smart thing to do

quaint mantle
hybrid spoke
#

so CraftPlayer now is b or g or whatever

#

no clue of nms

eternal oxide
#

CraftPlayer is Bukkit. It shoudl exist just fine

hybrid spoke
#

but not the way to it, right? still have to go over a method or not

eternal oxide
#

CraftPlayer is fine, but beyond getHandle you have to know the mappings ((CraftPlayer) player).getHandle().playerConnection.networkManager.getVersion()

#

getHandle returns the nms object, so thats where you need to find teh mapping

hybrid spoke
#

yeah good at least i was not totally wrong

quaint mantle
#

what remove the mapping?

#

mojang

late sonnet
#

im sure the spigot API has a method for this.. or maybe im confuse with paper..

quaint mantle
#

huh?

eternal oxide
tardy delta
#

how can i get my plugins instance if no dependency injection is possible?

#

i was thinking about a getInstance method in the main class, but should that return this or getPlugin(getClass())?

eternal oxide
#

why is di not possible?

tardy delta
#

its not really logic to construct and user that you need a plugin instance

#

also for my enum i need a better way

quaint mantle
#

enums shouldnt depend on plugin any way

tardy delta
#

its to access the lang file

quaint mantle
eternal oxide
#

you shoudl probably consider seperating yoru enum and your translation/language

quaint mantle
#

^

eternal oxide
#

keep your enum as a straight enum, then pass it to a translation method

tardy delta
#

hmm

weak adder
#

can someone tell me the method of changing the whitelist msg

#

public class maintainence implements CommandExecutor {
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        sender.sendMessage("The Server is in now maintainence mode");
        Bukkit.getServer().setWhitelist(true);
      

        return false;
    }
}
quasi flint
#

dont thunk thats possible with vanilla whitelist

#

prob have to make ur own

weak adder
#

ok

quasi flint
#

not very difficult

weak adder
#

ok

verbal nymph
#

What would be the difference between the following two lines and which one is preferred?
I'm getting the map from a config file so I do not yet know what kind of data it contains.

Map reward = (Map) configReward;
Map<?,?> reward = (Map<?,?>) configReward;
quasi flint
#

only difference is generics

#

dont think there is more to that

verbal nymph
#

So they will behave exactly the same? I'm actually just trying to get rid of the warnings my IDE is giving me šŸ˜„

tardy delta
#

is a stringlist path also a configurationsection?

quaint mantle
#

what

tardy delta
#

or a configurationsection is

root:
  child1
  child2

and a stringlist is with - blabla?

tardy delta
#

@SuppressWarnings("unchecked") :kekw:

quaint mantle
#

raw use of parameterized classes is not cool

summer scroll
buoyant viper
hybrid spoke
glossy venture
#

a section is an object, a list is an array / a list

#

object = key-value

tardy delta
#

imagine calling your children child1 and child2

torn shuttle
#

hell yeah 10 sonarlint issues down, 824 to go

tardy delta
#

am i wrong or is there a #removeIf(predicate) method in a map?

#

could be in a set or something too

eternal night
#

maps themselves do not offer that method

#

you may however use the entryset

tardy delta
#

aha

visual tide
lean gull
#

how do i get the gamerprofile thingie, and also what is it

#

i googled to see how to get the repository and dependency but someone said it's illegal?

paper viper
#

you can use minecraft libraries repo

#

or i think spigot artifact already has it

tardy delta
#

iirc yes

lean gull
#

ok, thanks
btw do you have any tips for not doing spaghetti code? rn i'm just adding comments for like every line and the code itself is just a big mess

#

i require help

paper viper
#

comments arent necessary if your code is written well

ancient plank
paper viper
ancient plank
#

yw

tardy delta
#

but if you have big chunks of code :kekw:

hasty prawn
#

Some events cannot be cancelled. There's backend logic behind every single event when it gets "cancelled". If an event doesn't have that, it won't implement cancelled.

tardy delta
#

is a permission case sensitive?

#

no i'm making my own

#

ah shit

#

and iirc permission objects are stored somewhere after server shutdown

#

not sure if i can delete the wrong ones

#

no

eternal night
#

As expected from a Map with string keys ?

stone sinew
tardy delta
#

cant you declare variables in a .forEach(e ->)?

eternal night
#

you can

tardy delta
#

well it says this

pastel drift
stone sinew
tardy delta
#

aah first line

crimson verge
#

does anyone have a good tutorial on coding multiblock structures? I found one singular tutorial and it doesn't work for my use case

lean gull
#

i have a method that sets an ItemStack field to an item, that method is run on onEnable in the main class.
however, when i try to get it on an event in another class, it returns null. does anyone know why this happens?
lmk if you need the code

crimson verge
#

uh yeah show the code

iron palm
#

what is the Enderpearl damage cause
(I want to use it in EntityDamageEvent)

tardy delta
#

fall damage

iron palm
crimson verge
#

list of all damage causes ^

#

for future reference

flint oak
#

guys i am trying to translate a class but everytime i try i always get this error

#

[19:54:08] [Server thread/ERROR]: [PlaceholderAPI] failed to load class files of expansions
java.util.concurrent.CompletionException: java.lang.ClassFormatError: Unknown constant tag 117 in class file net/alex9849/advancedregionmarket/placeholders/implementations/RegionCountPlaceholder
at java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source) ~[?:1.8.0_281]
at java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source) ~[?:1.8.0_281]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source) ~[?:1.8.0_281]
at java.util.concurrent.CompletableFuture$AsyncSupply.exec(Unknown Source) ~[?:1.8.0_281]
at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[?:1.8.0_281]
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) ~[?:1.8.0_281]
at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) ~[?:1.8.0_281]
at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ~[?:1.8.0_281]

#

Caused by: java.lang.ClassFormatError: Unknown constant tag 117 in class file net/alex9849/advancedregionmarket/placeholders/implementations/RegionCountPlaceholder
at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_281]
at java.lang.ClassLoader.defineClass(Unknown Source) ~[?:1.8.0_281]
at java.security.SecureClassLoader.defineClass(Unknown Source) ~[?:1.8.0_281]
at java.net.URLClassLoader.defineClass(Unknown Source) ~[?:1.8.0_281]
at java.net.URLClassLoader.access$100(Unknown Source) ~[?:1.8.0_281]
at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_281]
at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_281]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_281]
at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_281]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_281]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_281]
at me.clip.placeholderapi.util.FileUtil.findClass(FileUtil.java:62) ~[?:?]
at me.clip.placeholderapi.expansion.manager.LocalExpansionManager.lambda$findExpansionInFile$6(LocalExpansionManager.java:359) ~[?:?]
... 6 more

#

how can i fix it

crimson verge
#

gotta show us your code :)

flint oak
#

its not my code wait

tardy delta
#

translate a class?

crimson verge
#

what exactly are you trying to do? if this isn't your code lol

tardy delta
#

placeholderapi

flint oak
flint oak
crimson verge
#

so what did you change to try and do that? if you're just configuring a file you can change that in their lang config. this is more of a #help-server question btw

flint oak
#

when i change the api is breaking down

tardy delta
#

smh why did someone told me to store help messages

flint oak
#

what i cant understand you

tardy delta
#

are you using the papi api?

flint oak
#

yes

tardy delta
#

uhm are we looking at bytecode?

flint oak
#

what means bytecode xd i dont know like this terms

proud basin
#

papi

eternal oxide
#

thats a compiled java file

tardy delta
#

well what is this?

#

oh

#

bruh

flint oak
#

i want the change heres

crimson verge
#

i think you are trying to edit the code instead of just configuring the plugin

flint oak
#

yes

crimson verge
#

yeah you don't want to do that

#

you can change the word to match your language without recoding the plugin, there is probably a configuration option for that

flint oak
#

i just trying to translate this words but there is no config yml because its a papi api its in the placeholders api file and its jar

crimson verge
#

what plugin is using papi to say "sold"

hasty prawn
#

Even if you did want to modify PAPI itself, you should fork it on Github and change the source directly, not the bytecode šŸ‘€

crimson verge
#

cause thats where the config would be, not in papi

tardy delta
#

what are you even trying to do?

flint oak
#

i dont know what means bytecode guys i am not a developer

flint oak
crimson verge
#

you want to go into advancedregionmarket folder in your plugins folder

#

there should be some sort of config there to change the words

tardy delta
#

you want to rename a message from that advancedregionmarket plugin?

crimson verge
#

no coding involved

tardy delta
#

^^

crimson verge
#

yeah he just wants to change a message/lang file lol

hybrid spoke
#

just open it and change the content

hasty prawn
#

Open the JAR in Notepad ez

ancient plank
#

xy moment?

crimson verge
#

probably more of a language barrier issue id imagine

hybrid spoke
#

dont you code nowadays in notepad anyways?

hasty prawn
#

Like 99% of the time yes

maiden thicket
#

notepad++ gang

hasty prawn
#

The other 1% is spent drawing out code in Paint

flint oak
hybrid spoke
#

real ogs use editor

flint oak
#

i checked now but i cant do anything

crimson verge
#

anything like that

hybrid spoke
tardy delta
#

then you might be considering to use another plugin :kekw:

hasty prawn
flint oak
hasty prawn
#

messages.yml

crimson verge
#

messages.yml

hybrid spoke
#

messages.yml

flint oak
crimson verge
#

send messages.yml

hybrid spoke
#

actually whats the issue

hasty prawn
#

He's just trying to change a message that a plugin is sending

crimson verge
hasty prawn
#

It's a configuration issue

crimson verge
#

^

hasty prawn
#

Wdym multiblock structures Livvy

hybrid spoke
#

so he does wanna change it by itself or via code?

hasty prawn
#

Like just pasting in many blocks at once?

crimson verge
#

nono like detecting a specific build is in place

#

so for example

flint oak
#

i found sold but there is nothing for free placeholder

hybrid spoke
#

store the location

crimson verge
#

clicking on block x only does something if a specific structure is built in specific area next to it

crimson verge
#

doesnt need anything about placeholder

tardy delta
#

doesnt the worldedit api has something for that?

crimson verge
#

everything ive seen with the worldedit api has been for pasting a schematic

tardy delta
#

verifying structures

flint oak
tardy delta
#

hmm

crimson verge
#

it may have a verifying structures ability but i wouldnt know it

crimson verge
hasty prawn
#

Does WorldEdit maybe return how many blocks were changed? If you attempt to paste the structure, and 0 blocks were changed, that would mean it's valid

crimson verge
#

that should do t

hybrid spoke
#

do you actually have a custom structure generator or do you f.e. want to do smth near a specific tree?

flint oak
#

%arm_regionplaceholder_lunaroda-17_owner%

ancient plank
#

daily reminder that if you're not coding but editing configs for plugins you're not making, that's a #help-server topic

crimson verge
hybrid spoke
#

like the mario party game rebuild?

#

or like extend it?

crimson verge
#

some forge mods have multiblock structures if that helps lol. you build out of blocks a specific build and that registers with the code that it is all one specific structure and you can interact with it

hasty prawn
#

An example of this would be Enchanting Table and it's books, right?

crimson verge
#

think like the blast furnace from railcraft

#

ehhh sorta

#

except it would only work if the books were there

#

for example

flint oak
#

thank you livvy

hybrid spoke
#

either you check for a pattern or if you know what it would be you store the location

crimson verge
#

yeah check for a pattern

#

thats what im trying to figure out lol

#

because i can check for a pattern but only in a circular symetrical way

hasty prawn
#

Guess you could store a map of block types with relative locations

crimson verge
#

like i can check that all blocks around a center item match

#

but detecting it because of cardinal directions changing x and z values is making it weird to do a non-symmetrical structure

#

like brewery has those big barrels and slimefun has the machines

#

if that helps anyone understand what im looking for lmao

hybrid spoke
#

the only idea i have would be to check your area for those blocks and if it contains multiple of them and they are even side by side, true it

crimson verge
#

that was what i was gonna try at first, but i need to edit player location based on the location of the blocks, so i wasnt able to do that (cause it sends the player to the wrong place) :((

#

im gonna look into worldedit api but ive never used it so thats a lil worrisome

hasty prawn
#

Yeah, if WorldEdit can return the blocks changed before actually pasting the blocks you should definitely just use that.

quaint mantle
#

@quaint mantle

solid cargo
#

yo is there any plugin that lowers the server tps?

#

for testing purposes

hasty dove
#

How can i fix VotingPlugin keeps failing to load votesites.yml

solid cargo
#

how dafaq can i disable moving items in a specific gui only?

#

ik its InventoryClickEvent

#

but how do i get the inventory's name

tardy delta
#

a better way is to let your class class extend InventoryHolder and when creating the inv, use Bukkit.createInv(this, name i guess, slots etc) and in the listener check for the event.getInv.getHolder instanceof ... -> cancel

solid cargo
#

but im not using bukkit feature

#

im using InventoryGUI

young knoll
#

No, bad