#help-development

1 messages · Page 696 of 1

quasi flint
#

Totally safe to do

#

When doing asm shinanigans

#

I now hold you responsible

#

For me making this mixin asm abomination

ivory sleet
quasi flint
#

Come find meduke

#

You have two weeks

#

Till it's too late

#

And I try to unleash that monstrosity

near mason
#

java

tidal kettle
#

Hello i want to teleport the player to the spawn when he died so i use PlayerrespawnEvent but i didin' work

tidal kettle
opal saffron
#

with scheduler

tidal kettle
#

ok i try

eternal night
#

doesn't the player respawn event have a method to set the repsawn location

#

setRespawnLocation

kindred trellis
#

if i remove api-version from my 1.20.1 plugin will it be backawards compatible to most versions or just the close ones like 1.19?

eternal night
#

I mean, if you want to maintain backwards compatibility, develop against the lowest version you want to support

#

if you want to support 1.8.8 (for whatever fucked up reason, maybe you hate yourself) develop against 1.8.8 spigot api

kindred trellis
#

ok thanksss

chilly hearth
#

how can we delete the resource on spigot

eternal oxide
#

report it and ask to delete

pine forge
#

How can I parse a team entry to a Player/OfflinePlayer instance? Is it okay to use the deprecated getOfflinePlayer(String) method in this case?

quaint mantle
#

you can always write own cache method using idk WeakMap

#

or just a hashmap

kindred trellis
#

whats the event i should be listening to to detect arrow hit a block?

smoky anchor
#

ProjectileHitEvent I believe

kindred trellis
#

thanks ❤️

pine forge
#

i think 1.13 is the lowest you can go which works on all newer versions

eternal night
#

you can certainly still load 1.8 plugins

#

the server has to enable the legacy compat layer

#

which is annoying

pine forge
#

okay whats that

eternal night
#

but that is like, the one upside to spigots backwards compatibility love

#

well, the largest break was the material flattening in 1.13

#

which broke some stuff. So the server has to rewrite the bytecode of some of those old plugins in regards to their usage of the material enum.

smoky anchor
#

wait it does what
it modifies the plugin itself so it can run ?

#

That's hilarious lol

eternal night
#

Yea, the classes loaded are ran through commodore (spigots utility class to transform their bytecode)

quaint mantle
#

compatibility only exists due to wrapper around Minecraft api

#

lol

#

which is kinda stupid as Minecraft api has very useful shit

kindred trellis
#

will my plugin made on 1.20.1 api work on older versions? do i need to remove plugin-api from plugin.yml?

#

well it didnt on 1.16.4 so i may just have my answer but i wanted to make sure

quaint mantle
#

does it run on 1.19?

twilit roost
#

i've made an documented API
how can I make intellij use the documented jar instead of decompiling it?

quaint mantle
#

in settings

#

you can choose the source file for javadocs

twilit roost
#

can it be done automatically by just using the dependency?
or it needs to be set manually everytime?

quaint mantle
#

idk, couldnt it ever figure out

#

so just manually set the source file

#

or find out how to make gradle to use the source file from the maven repo ig

gilded granite
#

what is the event that transfom farmlands into dirt

echo basalt
echo basalt
#

that's for pressure plates

smoky anchor
echo basalt
#

hm interesting

smoky anchor
#

unless you mean natural change from being dry
that would be different event

quaint mantle
#

ass-pressure

smoky anchor
#

yeah~
some guy is working on fixing the docs :D

echo basalt
#

I'd volunteer to clean up the Commodore class because it's ass

#

but I'm not signing no CLA

rocky badger
#

Is there a way to increase performance with a plugin when it comes to crazy high worlds? (512, 1024, ...) How do you do this? Spigot 1.20+

echo basalt
#

You mean build height uhh

rocky badger
#

Aye

echo basalt
#

Well it's the same as all other performance improvement guides

quaint mantle
#

break your world into multiple worlds

echo basalt
#

Identify the problem

#

Come up with a solution

#

Like using heightmaps n shit

rocky badger
#

Might have to look up that shit since I don't know about it

#

Also, how would I be able to identify the performance issues?

echo basalt
#

Profiling etc

#

Look at what can be a potential problem or point of failure

smoky anchor
#

Or "optimize a plugin to work with big build limit"

rocky badger
#

Well

#

Does it already exist?

echo basalt
#

In a perfect world it doesn't have to

rocky badger
#

I just want something that eases the user and server load when they are on the server

echo basalt
#

Well

#

what load?

rocky badger
#

I would guess chunk loading

echo basalt
#

It's not as simple as high limit = bad

rocky badger
#

Since each chunk is times 4

rocky badger
#

I'm just a man with a plan and i don't know where to start 😄

quaint mantle
#

multithreading?

smoky anchor
quaint mantle
#

slap on it multithreading, always works

#

/j

smoky anchor
#

each chunk gets it's own thread

#

can't see any downsides lul

quaint mantle
#

yes

#

you can always break chunk into multiple chunks

rocky badger
#

Yeah, there is a mod for that

#

Cubic chunks

#

I checked with them is they had some kind of plugin, but no luck

misty ingot
#

ok so im using acf-bukkit and I am registering my command everything but when I use it in-game, it gives me the "unknown command" message

I have op so i believe i have the permissions required to use the command

gilded granite
# smoky anchor

No but like when there is no water near like how to make the farmalands always hydrated even if there is no water

smoky anchor
#

that would be the physics event I think?

tall dragon
#

like default command

misty ingot
tall dragon
#

show the code

misty ingot
#

yep just copying

#
@CommandAlias("punish|p")
public class PunishCommand extends BaseCommand {

    @Default
    @CommandPermission("sentry.admin.punish.menu")
    @Syntax("<player>")
    @Description("Open the punishment menu for punishing a player")
    public void onOpenPunishMenu(Player cmd_user, @Values("@AllPlayers") OfflinePlayer target) {
        Inventory menu = getPunishmentMenu(cmd_user, target);

        informPlayer(cmd_user, "&aOpened punishment menu for &c" + target.getName());
        cmd_user.openInventory(menu);
    }
}
#

nothing in console

#

I have been trying to troubleshoot for an hour i have no idea whats wrong here

gilded granite
twilit roost
#

im mvn installing my project
the project has its dependencies

when I use the project as dependency in other projects, those dependencies are missing
how can I install the project with those dependencies?

misty ingot
#

did you register the listener

gilded granite
#

yes

twilit roost
misty ingot
#

more brackets in the if please

#

make it print something in console and see if it prints when the farmland hydrates

smoky anchor
# gilded granite Its not working

I think you need to use getSourceBlock
But try to create a void world and print everything you can from that event in case that doesn't work

tall dragon
#

dont rlly see anything wrong with that hmm

misty ingot
#
    public void registerCommands() {
        BukkitCommandManager commandManager = new BukkitCommandManager(this);

        commandManager.registerCommand(new PunishCommand());

        // --- all players ever "@AllPlayers"
        commandManager.getCommandCompletions().registerCompletion("AllPlayers", context -> {
            List<String> nameList = new ArrayList<>();
            for (OfflinePlayer player: Bukkit.getOfflinePlayers()) {
                nameList.add(player.getName());
            }
            return nameList;
        });
    }
smoky anchor
misty ingot
#

yes yes I know about the case issue, its just easier to not have to hold Shift every 2 seconds but dont worry this was just a test I do infact normally use lowerCamelCase

#

the §c is very placeholder

#

and i found the issue

#

I removed @Values("@AllPlayers") and now it works, wonder whats wrong with that

tall dragon
livid dove
misty ingot
misty ingot
#

and they like to look at your code

gilded granite
livid dove
#

Fair

smoky anchor
smoky anchor
#

ok it seems to be BlockFadeEvent

misty ingot
#

fixed now

smoky anchor
misty ingot
#

so bro didnt check if the event actually ran when that happened

#

but used the event

#

and then complained

gilded granite
#
    public void onBlockFade(BlockFadeEvent event) {
        if (event.getBlock().getType() == Material.FARMLAND && event.getNewState().getType() == Material.DIRT) {
            event.setCancelled(true);
        }
    }```
smoky anchor
#

nice code
what about it

gilded granite
#

Im testing

#

3s

#

yes it worked thx

smoky anchor
#

how about you test first and then report back if you have to

#

ok, glad it works

scenic onyx
#

hello, I'm trying to make a plugin, this doesn't work. Don't put blocks in the HashMap

public void storeOriginalBlocks() {
SkyWarsLocation skyWarsLocation = new SkyWarsLocation(skyWars);
World world = skyWarsLocation.getPos(1).getWorld();

Location minLocation = skyWarsLocation.getPos(1);
Location maxLocation = skyWarsLocation.getPos(2);

for (int x = minLocation.getBlockX(); x <= maxLocation.getBlockX(); x++) {
    for (int y = minLocation.getBlockY(); y <= maxLocation.getBlockY(); y++) {
        for (int z = minLocation.getBlockZ(); z <= maxLocation.getBlockZ(); z++) {
            Location location = new Location(world, x, y, z);
            Block block = location.getBlock();

            // Controlla se il blocco non è aria prima di memorizzarlo
            if (block.getType() != Material.AIR) {
                originalBlocks.put(location, block.getType());
            }
        }
    }
}

}

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
tall dragon
smoky anchor
tall dragon
smoky anchor
#

anything with state really

hushed spindle
tall dragon
#

looks solid

hushed spindle
#

all data driven ofc, no hard coded recipes

#

modifiable with gui shit

scenic onyx
smoky anchor
#

?paste

undone axleBOT
scenic onyx
scenic onyx
smoky anchor
#

im also gonna pretend the BlockPlaced list does not have a different name scheme from originalBlocks

#

can we see SkyWarsLocation.java ?

hasty prawn
#

My only guess is that pos1 is bigger than pos2

twin venture
#

hi how i can get the ids of old minecraft items?
for example item 68 in version 1.6.4 what is it?

scenic onyx
scenic onyx
twin venture
#

will that give me the version specfic item?

smoky anchor
hasty prawn
#

You should send the relevant config

scenic onyx
hasty prawn
#

Yep just as I thought, your y and z in pos1 are both larger than pos2.

#

Therefore it's never iterating over them, you're only saving blocks on the x axis

#

And if they're all air, your map will be empty.

#

Should be using Math.max(pos1.getX(), pos2.getX()) and Math.min(pos1.getX(), pos2.getX()) etc

scenic onyx
hasty prawn
#

No, just use Math.max and Math.min on each coordinate

scenic onyx
#

i test it:
public void storeOriginalBlocks() {
SkyWarsLocation skyWarsLocation = new SkyWarsLocation(skyWars);
World world = skyWarsLocation.getPos(1).getWorld();

Location minLocation = new Location(world,
    Math.min(skyWarsLocation.getPos(1).getBlockX(), skyWarsLocation.getPos(2).getBlockX()),
    Math.min(skyWarsLocation.getPos(1).getBlockY(), skyWarsLocation.getPos(2).getBlockY()),
    Math.min(skyWarsLocation.getPos(1).getBlockZ(), skyWarsLocation.getPos(2).getBlockZ())
);

Location maxLocation = new Location(world,
    Math.max(skyWarsLocation.getPos(1).getBlockX(), skyWarsLocation.getPos(2).getBlockX()),
    Math.max(skyWarsLocation.getPos(1).getBlockY(), skyWarsLocation.getPos(2).getBlockY()),
    Math.max(skyWarsLocation.getPos(1).getBlockZ(), skyWarsLocation.getPos(2).getBlockZ())
);

for (int x = minLocation.getBlockX(); x <= maxLocation.getBlockX(); x++) {
    for (int y = minLocation.getBlockY(); y <= maxLocation.getBlockY(); y++) {
        for (int z = minLocation.getBlockZ(); z <= maxLocation.getBlockZ(); z++) {
            Location location = new Location(world, x, y, z);
            Block block = location.getBlock();

            // Controlla se il blocco non è aria prima di memorizzarlo
            if (block.getType() != Material.AIR) {
                originalBlocks.put(location, block.getType());
            }
        }
    }
}

}

#

try

hasty prawn
#

that... certainly is one way to do it

scenic onyx
#

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... IT GO

#

@hasty prawn tanks

hasty prawn
ripe moat
#

I couldn't find anything about it on the boosted yaml wiki, so how would i do it? java YamlConfiguration config = YamlConfiguration.loadConfiguration(file);

#

as i said, i am using boosted yaml

hasty prawn
#

No idea what boosted yaml is but that's how you'd do it in just regular ol spigot

ripe moat
#

boosted yaml is an yaml library for java, but anyway, i only know how you would do it in yamlconfiguration

#

and that's what i wrote

hasty prawn
#

Well, you're asking in the wrong spot then.

But, I found this on their GitHub:
YamlDocument config = YamlDocument.create(new File("config.yml"), getResource("config.yml"));

I'm guessing that's what you're looking for.

ripe moat
#

oh, i didn't know that it created the file (the one with yamlconfiguration)

grim ice
#

what If i drop 1 emerald

#

then 2 breads

#

what will u do?

#

will u just say "invalid argument" then scam me out of my items?

hasty prawn
grim ice
#

u need a way to retrieve the items thrown

hushed spindle
#

the items will just stay stored in the cauldron

grim ice
#

itll just scam u out of ur items?

#

oh

#

but i saw they disappear

#

when u throw them

#

lol

hushed spindle
#

you can get em out with shift-clicking

grim ice
#

i see

hushed spindle
#

or breaking/moving

pine forge
#

Is there an event for a player joining or leaving a team or a way to hook into /team command (which is a vanilla command)?

pine forge
smoky oak
#

ah

#

actually it still implements cancellable

pine forge
#

yea for this example

#

but shouldnt be used for logic of one specific command

#

only for logic that applies to all commands

ivory sleet
#

it just says command logic

pine forge
#

yes and all of the examples can be specified under "command logic" but thats obviously not the definition theyre talking about

#

What i believe they mean (taking into account the examples) is that this event should be used for logic thats executed for every command the same

ivory sleet
#

I’d say its for, pre processing

#

Hence the name

smoky oak
#

i mean i cant find any other command event

#

so unless you're registering every 10 letter combination as a command use this one

ivory sleet
#

I mean you can always replace the command, or/and wrap it and delegate

pine forge
#

okay

#

So ill just check for /team join and /team leave

ivory sleet
#

I mean yeah thats one way

pine forge
#

theres another?

ivory sleet
#

Or you just go with the event callback

pine forge
#

ill just use the event

#

thats easier

ivory sleet
#

Myea sure

eternal valve
#

I have a 1920x1080 guim and I want it to appear when I type /shopgui but I can't find it, can you help me?

halcyon hemlock
#

What packet is used for the enderdragon flap?

#

can we modify it?

eternal valve
#

.minecraft\resourcepacks***\assets\minecraft\textures\guis\shopgui\Shop_GUI.png

remote swallow
#

i doubt you can use a fullscreen gui with shopgui

gilded granite
#

how can i prevent Flying is not enabled on the server without changing it into the server.propreties

remote swallow
#

you would need a custom plugin that can workout where the player is looking using coreshaders

shadow night
gilded granite
#

yes right

gilded granite
#
    public void onPlayerKick(PlayerKickEvent e) {
        if (e.getReason().equalsIgnoreCase("Flying is not enabled on this server")) {
            e.setCancelled(true);
        }
    }```
remote swallow
#

i feel like reason is an enum

#

oh it is a string

#

sysout the reason before the if and check if it has different punctuation

shadow night
#

It does sound like just disabling it in the server properties is easier

lilac dagger
#

can you edit server.prop from within spigot api?

halcyon hemlock
#

but for world settings etc you can I guess

hasty prawn
#

I mean you can change the setting and then just disable the plugin until they restart

halcyon hemlock
#

is auto updating plugin against spigot tos?

eternal oxide
#

you can check for updates, but auto updating (in many countries) would be illegal.

#

It would likely break servers too.

remote swallow
#

a command eg /pluginname update would be allowed probably, as well as a full changelog and confirmation with confirmation it shouldnt break anything

ripe moat
# hasty prawn Well, you're asking in the wrong spot then. But, I found this on their GitHub: ...

ChatGPT says otherwise (i know you can't always trust chatGPT, but still)


config: This is a variable of type YamlConfiguration that you're declaring. It will hold the loaded configuration data from the YAML file.

YamlConfiguration.loadConfiguration(file): This is a static method call on the YamlConfiguration class. It takes a File object (denoted by the file variable) as a parameter. This method reads the contents of the specified YAML file and parses it into a YamlConfiguration object.```- ChatGBT
#

It says that it doesn't create the file

#

maybe i'm just dumb tho

shadow night
#

GiBiTi

slender elbow
#

lol, that isn't even remotely useful

#

most notably because they aren't using bukkit's yamlconfiguration system

hasty prawn
#

Atleast according to their docs.

ripe moat
#

Oh, so YamlDocument.loadConfiguration(file);?

eternal oxide
#

Why are you using boosted?

ripe moat
#

Got it recommended and they explain it like it has advantages 🤷🏻

eternal oxide
#

Its pointless to use it over teh provided SnakeYAML unless it has somethgin you specifically want to use

quaint mantle
#

it is stupid that spigot doesnt ship with dfu

eternal oxide
#

especially as you don;t know how to use it

brisk estuary
#

What do you guys think about using reactive streams in a plugin?

quaint mantle
#

reactive stream?

ivory sleet
#

one of those java libs?

#

or just streams from the std lib

quaint mantle
#

like the asynchronous stream?

slender elbow
#

i mean it just depends on how you plan to structure the rest of your plugin

#

if you are using something like lettuce alongside d4j, then sure lol

quaint mantle
#

i aint reading all that

slender elbow
#

blah blah functional blah lazy message driven blah blah

#

@eternal night uwu

eternal night
#

I mean, given how little IO your plugin preferably is doing

brisk estuary
slender elbow
#

what if my plugin is doing ALL of the IO

#

all of it

eternal night
#

well, unless it is on the main thread it doesn't count

#

that is where all the cool people do ALL of the IO

slender elbow
#

real

quaint mantle
#

also, how good it would be for events

#

reactive streams

slender elbow
#

it just depends on how you structure the rest of your plugin really

#

there is no black and white answer

small current
#

since everybody is dead in general can we sell plugins in spigot with ways other than paypal?

#

come to #general to answer

quaint mantle
#

hey, can I check somehow if an player has an minimum amount of an item anywhere in the inventory?

distant wave
#

if i save this as a file where will it be stored? will it be in same directory as config.yml?

lilac dagger
#

no

distant wave
#

then where should it be stored?

lilac dagger
#

i don't think it's even a valid path for windows

#

it'll store it at the root

distant wave
lilac dagger
#

or some security exception

distant wave
#

but where how do i make store there?

#

i just wanna use it for serialization

lilac dagger
#

the root of your pc

smoky oak
distant wave
#

btw can serial uid be completely random?

smoky oak
#

depends how its generated

ivory sleet
slender elbow
#

yeah it'll be relative to the working directory

distant wave
#

alright

slender elbow
#

jvm serialization is kinda monkaS

slender elbow
distant wave
#

anyways, how do i make store the file where the config file is?

#

i dont want to be laying on random spot

lilac dagger
ivory sleet
#

:)

rough drift
#

Is there a way to wait until the latest.log is written so I can read it? (Required for some debug stuff)

distant wave
#

its being written until the server is closed

eternal valve
smoky oak
#

how do i change the log level?

distant wave
#

you cant read it iirc since it would be used by other program, thread will be terminated if you close the server

distant wave
smoky oak
#

no

remote swallow
#

log level of what

smoky oak
#

console doesnt print anything lower than 'Info'

#

i want to see everything

remote swallow
#

custom log4j config iirc

distant wave
#

theres nothing lower than info?

#

or is it

smoky oak
#

you clearly never have used Logger#log(Level, String)

smoky oak
remote swallow
#

you need a log4j.xml or something like that

distant wave
#

but bukkit doesnt use log4j2 right?

#

bukkit uses java api logger

remote swallow
#

log4j2.xml

#

spigots looks like ```xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" packages="com.mojang.util">
<Appenders>
<Console name="SysOut" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
</Console>
<Queue name="ServerGuiConsole">
<PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" />
</Queue>
<Queue name="TerminalConsole">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
</Queue>
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
<Policies>
<TimeBasedTriggeringPolicy />
<OnStartupTriggeringPolicy />
</Policies>
<DefaultRolloverStrategy max="1000"/>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="info">
<filters>
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
</filters>
<AppenderRef ref="SysOut" level="info"/>
<AppenderRef ref="File"/>
<AppenderRef ref="ServerGuiConsole" level="info"/>
<AppenderRef ref="TerminalConsole" level="info"/>
</Root>
</Loggers>
</Configuration>

smoky oak
#

i dont think i can just rebuild the server lol

remote swallow
#

you just put in in the root

#

along with spigot.jar

smoky oak
#

hm

#

im assuming i change the level=info to level=finest

#

?

remote swallow
#

all probably

smoky oak
#

lright lemme test this

#

nope

#
[18:16:42] [Server thread/INFO]: Moterius joined the game
[18:16:42] [Server thread/INFO]: Moterius[/127.0.0.1:59536] logged in with entity id 286 at ([world]-90.0105074814872, 78.0, -42.8679230480403)
[18:16:47] [Server thread/INFO]: Moterius issued server command: /test
[18:16:47] [Server thread/INFO]: Test method for library build being recognized
>
io.github.moterius.VectorParticleLib.Echo.printHello(); //-> 'Library build' message
Echo.logger.log(Level.FINEST,"Logging FINEST log message");
return true;
#

its not in latest.log either

remote swallow
#

id you change line 23 too

#

if it still doesnt work look on spigot/paper forums and see if theres anything

smoky oak
#

already did

#

i changed all 'info' to 'finest'

#

maybe the file aint getting loaded?

#

ah

remote swallow
#

it should do, check online for a better wiki

smoky oak
#

you need to provide an argumet for the run script so its getting recognized

#

its indeed not reading the edited config

#

but apparantly that breaks other stuff

remote swallow
#

might not need the entire config from spigot too

ornate mantle
#

does ServerBound mean the packet is heading to the server?

hasty prawn
#

yes

ocean hollow
#

why that is null

smoky oak
remote swallow
#

finest isnt a thin in that logging then

#

use all

remote swallow
smoky oak
#

oh that did it thx

#

test time

ocean hollow
# remote swallow show more code
    @EventHandler
    public void playerJoin(PlayerJoinEvent event){
        lastMove.put(event.getPlayer(), 0);
        playerTimer.put(event.getPlayer(), new AfkLogic(event.getPlayer(), 0, plugin));

        notMovingTimer(event.getPlayer());
    }
``` thats all
smoky oak
#

ooooh it logs skin strings

#

ewogICJ0aW1lc3RhbXAiIDogMTY5MzI0MDE5OTg1OSwKICAicHJvZmlsZUlkIiA6ICJiYTA5MWI1MWEyMWM0NzEwYTRkNTc5OWYyNDBjY2Q2YSIsCiAgInByb2ZpbGVOYW1lIiA6ICJNb3Rlcml1cyIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS80MzcyMGZiOWI5YmE1NDY1MjIxMDFjMTdiOTQwOGU2ZDA2ODk3NDczNjZmYmUxYTM0NmNmMDQzYTAxZGIyZmQiCiAgICB9CiAgfQp9

#

lol

remote swallow
ocean hollow
#

in that class

remote swallow
#

why is it static and public

ocean hollow
#

is this the problem?

remote swallow
#

might be

#

cant tell without the entire class

livid dove
# ocean hollow

Due to memory leaks and GC shenanigans I'd suggest not using stuff like players as keys

remote swallow
#

this class is screaming that you dont know java

remote swallow
#

maps dont need to be static, the events and command should be in their own class and uuid should be used not player instance

remote swallow
#

its with the location isSimilar

ocean hollow
#

why then when saving the location, the world is zero?

remote swallow
#

either the world isnt loaded yet and it doesnt have a world or the location is broke

ocean hollow
smoky oak
#
if(cond) return
else if(cond) { ... return}
``` or ```
if(cond) return
if(cond) { ... return }
``` and why?
ocean hollow
#

1st case: do this if, else do that if.
2nd case: do this if, do that if.

remote swallow
smoky oak
#

aside from 'use variation 2'

brazen badge
#

anyone knows how to use NexEngine?

chrome beacon
#

Probably

#

?ask

undone axleBOT
#

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

slender elbow
#

what if that is the question? 🤔

chrome beacon
#

Then I gave them the answer

slender elbow
#

true

onyx fjord
ocean hollow
#

thanks, problem is solved

brazen badge
orchid trout
#

they have documentation and a discord server

#

nvm

#

thats enginehuib

brazen badge
vital ridge
#
double mx = Math.cos(Math.toRadians((yaw + 90.0F)));
        double mz = Math.sin(Math.toRadians((yaw + 90.0F)));
        mc.thePlayer.motionX = forward * moveSpeed * mx + strafe * moveSpeed * mz;
        mc.thePlayer.motionZ = forward * moveSpeed * mz + strafe * moveSpeed * mx;

can someone help me understand a bit why the motionX and motionZ are calculated this way? It's a code from a function which makes the player move when he presses WASD, mx and mz just represent the direction he is moving to.

#

Ik that mx and mz are important because they are either negative and positive and that is very important since that determines in which direction you move the player.

orchid trout
#

thanks

kindred sentinel
#

Why the same tropical fish in inventory and when i'm trying to get it's color+pattern has different names?

#

Gray flopper & Black Tang

#

But the other fish has the same name but only one color...

smoky anchor
#

You have a resourcepack, maybe that one changes it ?

kindred sentinel
smoky anchor
#

(or are you editing the lore with a resourcepack)

kindred sentinel
#

i removed all resourcepacks

#

but the same name

#

it's really weird

ocean hollow
#
    public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {
        if(!(commandSender instanceof Player)){
            return true;
        }

        Player player = (Player) commandSender;

        AfkLogic afkLogic = playerTimer.get(player.getUniqueId());

        player.sendMessage(player.getUniqueId() + "");

        if(afkLogic.isStarted()){
            afkLogic.disableTimer();
        }
        else{
            afkLogic.startTimer();
        }
        return false;
    }``` why if I use a command, then AfkLogic is null.
#

as I understand it, it does not work only while using the command

tall dragon
#

what is playertimer and where is it coming from

ocean hollow
tall dragon
#

thats probably whats happening

tall dragon
#

nvm it does

smoky oak
#

I'm damageing an entity, and the lastDamageCause and EntityDamageEvent is crucial to be updated correctly. Do i have to set the last damage cause first, or deal the damage first?

kindred sentinel
#

i tried everything ._.

                        System.out.println(tropicalFish.getName());
                        System.out.println(tropicalFish.getBodyColor());
                        System.out.println(tropicalFish.getPatternColor());
                        System.out.println(tropicalFish.getPattern());

but even color isn't the same

tall dragon
#

ur not getting an error in onJoin?

ocean hollow
#

I solved this problem, this helped me

#

thank you guys

tall dragon
#

o u used multiple instances of the whole AfkManager

#

ahh right, right

#

😄

ocean hollow
#

I don't know how I didn't think of this before

tall dragon
#

just saying. ur doing some pretty bad practises there as well

#

like morice said

#

and you are creating a task for every joined player

#

which is sub optimal

#

especially since that task runs every tick

ocean hollow
tall dragon
#

for every single player

tall dragon
#

could even be async as far as i can see

ocean hollow
#

ok, i'll do that

tall dragon
#

every single tick for every player

#

💀

eternal valve
#

what does minecraft ascent height do, I know that it is max 256x256, for example, I put 256x256, I will put this gui in the bottom right corner, how many ascent and how many height it should be...? or is there anyone who can throw me the ascent and height wiki?

ocean hollow
#

I think the height can be any, and the ascent can be any, but less than the height

#

ascent only works vertically. if you want to move horizontally, then you need to use negative spaces, you can search the Internet about them

#

why square?

lilac dagger
#

you don't really wanna do sqrt

young knoll
#

You should use distanceSquared unless you need to display the distance

#

In which case you kind of need the actual distance

twin venture
#

hi , iam stuck at something weird iam on 1.20.1 , and iam trying to get getOppositeFace of a sign

undone axleBOT
#

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

twin venture
twin venture
#

the real sign is behind

#

i mean infront

#

this is the behind

ocean hollow
#
        Bukkit.getScheduler().runTaskTimer(plugin, task -> {
            tasked.forEach(player -> {
                AfkLogic afkLogic = playerTimer.get(player);
                if(!afkLogic.isStarted()) {
                    if (lastMove.get(player) >= 20 * 5) {
                        afkLogic.startTimer();
                    }
                    else {
                        if (Bukkit.getPlayer(player).getLocation().distanceSquared(lastLocation.get(player).clone()) <= 0.05){
                            lastMove.replace(player, lastMove.get(player) + 1);
                        } else {
                            lastMove.replace(player, 0);
                        }
                    }
                }
                else{
                    if(Bukkit.getPlayer(player).getLocation().distanceSquared(afkLogic.getLocation()) >= 8) {
                        afkLogic.disableTimer();
                        lastMove.replace(player, 0);
                    }
                }
                lastLocation.replace(player, Bukkit.getPlayer(player).getLocation());
            });
        }, 1, 1);``` so this code will be more optimizated?
eternal oxide
#

checking every tick is serious overkill

ocean hollow
#

but how to do otherwise?

#

I can put 2 ticks), I think there is no replacement for this method

hybrid spoke
#

you usually use the playermoveevent to track movement

#

and a timer, 5 minutes or so, to check if he is afk or not

eternal oxide
#

you could do a much simpler check. set a long on teh player for a timestamp of the last player move packet received

ocean hollow
#

hmm, but then it will take into account pitch and yaw

hybrid spoke
#

from -> to

#

just check for x and z

twin venture
#

Hi , anyone know how to get sign from behind?

eternal oxide
#

Then as God said, check every 15-30 seconds to check the time since they last moved

twin venture
#

using :
sign = (Sign) b.getRelative(event.getBlockFace().getOppositeFace()).getState();

#

b is the clicked block which is the iron_door :p

hybrid spoke
eternal oxide
dire tapir
#

hello how do I save a byte array to a yamlconfiguration properly? for example I save [2,3,3,2,3], but when I save it it outputs
!!binary |-
AgMDAgM=

twin venture
gilded granite
ocean hollow
eternal oxide
#

move event

gilded granite
ocean hollow
#

ohhh, okay

eternal oxide
#

if you receive a move event for a player they can;t be afk, or they are being pushed by water

#

so just store the time the move event fired for them

#

if you want to set them afk after 2 minutes you check (in a task) every 15 seconds or so (no need to be super accurate), do teh math to see when their last move was

#

if current time > last move + 2 minutes

ocean hollow
#

ok, I'll try to do that.

gilded granite
#

can any1 help me to fix since its not working

remote swallow
#

PacketPlayOutChat isnt a thing

#

anywhere

gilded granite
#

what is it then?

#

its to send action bar message

remote swallow
#

use the api

gilded granite
#

wich?

remote swallow
#

player.spigot().sendMessage

gilded granite
#

is it ServerboundChatPacket?

eternal oxide
#

stop using packets for things which are in the API

gilded granite
#

i prefer packets

#

and less lagging

slender elbow
#

lolno

eternal oxide
#

lies

gilded granite
#

i want to all by client sided

slender elbow
#

sendMessage only sends a packet, nothing else

#

yeah sendMessage doesn't affect the server

eternal oxide
#

there is ZERO point iun using packets for anything you are asking about

#

all you are doing is making your life more difficult

slender elbow
#

Exhibit A:

remote swallow
#

✨ overoptimization ✨

eternal oxide
#

Player#spigot().sendMessage(ACTIONBAR, "message");Works on every modern version

gilded granite
#

Ik how to use it with spigot

river oracle
#

Hmmmmm I wonder what the sendMessage does under the hood

#

no way it sends a packet

eternal oxide
#

you are setting up NMS, remapping (except you are not doing this part correctly) and being version restricted

#

literally making your life hell over using a single line of code

remote swallow
#

no way

river oracle
#

I just thuoght of a good abstract for sending a message with a packet

remote swallow
#

crazy?

river oracle
#

what if we like have this CommandSender class

remote swallow
#

i was crazy once

river oracle
#

and you can send messages to it

#

and that sends the packet

#

don't forget about nms calls though ofc ofc

eternal night
remote swallow
#

yeah they did

#

it was a rubber room

eternal night
#

A rubber room with rats

remote swallow
#

and rats make me crazy

eternal night
#

crazy ? I was crazy once-

#

tho I'd still be crazy if I used NMS to send chat messages

slender elbow
#

that explains it..

remote swallow
#

id be crazy if i tried to async everything and packet everything

dry hazel
#

surely nothing can go wrong

river oracle
eternal night
#

yea i mean

#

if only there was a competently designed NMS mappings viewer

#

then I could just, code it all up in nms 😭

slender elbow
#

now to make a safe API around nms to work across versions

river oracle
slender elbow
#

oh wait a minute

eternal night
#

I think you are ontp something there emily

#

that is a good idea

remote swallow
#

paper-mojangapi

river oracle
remote swallow
#

lynxper

eternal night
#

lynxper stonks

remote swallow
eternal night
#

craftlynxper

tender shard
eternal oxide
#

I don't believe thats possible. Never heard it done before

#

emily crazy too

tender shard
#

well then at least use the proper class name

#

there is no 1_20_R1 anywhere in NMS class names since a looong time

#

like 2+ years

opal carbon
eternal oxide
#

I've never seen it happen

opal carbon
#

ill test

remote swallow
#

if it does, just check if to and from are the same

past fulcrum
quaint mantle
dark jolt
#

So I made a plugin that creates advancements through creating json files in a datapack using gson but is there a way to constaly have it update soon as something is new in it besides /reload and /datapack enable/disable

pine forge
#

How do you listen for people leaving or joining a team?

sterile token
#

What is the best way for inventories? Comparing themself against ==, equals or via InventoryHolder ?

opal carbon
tidal kettle
#

Hello i want to recup the count value
how i can do it?
code:

on_first_join:
  items:
    -  material: STONE
      count: 1
  messages:
    -  Welcome {{ player }}, on this server!```
sterile token
#

Well its easy

#

I can give you a hand with it

tidal kettle
#

pls yes

sterile token
#

You want to persist the things? Like saving how many blocks they broken

tidal kettle
#

no

#

give the amount of item

tender shard
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
tidal kettle
tender shard
#

with ```yaml

tidal kettle
#

oh

tender shard
#

or ?paste

sterile token
#

bot is down

remote swallow
#

?paste

undone axleBOT
remote swallow
#

nop

sterile token
#

oh weird

remote swallow
#

the command only registers at the start of a message

#

not midway through

quaint mantle
#

hi guys, using playerinteractevent how do i check if a cartography table is right clicked

sterile token
tender shard
#

check if action is RIGHT_CLICK_BLOCK and then check if getClickedBLock().getType() == Material.CARTOGRAPHER_TABLE

#

and also only check one hand, playerinteract event is called once per hand

#

?interactevent

undone axleBOT
#

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

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

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

?comparing inventories

tawny talon
#

Hey, do some of you know how could I make a Nametag plugin that people can apply below the player nickname?

like
<playername>
<tag>

(I just need a start idea)

sterile token
gilded granite
#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
__**Admin:**__

selfrole Add or remove a selfrole from yourself.

__**Cleanup:**__

cleanup Base command for deleting messages.

__**Core:**__

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

__**Downloader:**__

findcog Find which cog a command comes from.

__**Mod:**__

names Show previous usernames, global display names, and server...
userinfo Show information about a member.

__**ModLog:**__

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

__**Permissions:**__

permissions Command permission management tools.

sterile token
opal carbon
# eternal oxide if you get ANY move packets for the player they either moved or moved their mous...
[15:00:38 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] Move packet recieved.
[15:00:38 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] X: -0.5 Y: 67.0 Z: 22.5
[15:00:39 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] Move packet recieved.
[15:00:39 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] X: -0.5 Y: 67.0 Z: 22.5
[15:00:40 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] Move packet recieved.
[15:00:40 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] X: -0.5 Y: 67.0 Z: 22.5
[15:00:41 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] Move packet recieved.
[15:00:41 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] X: -0.5 Y: 67.0 Z: 22.5
[15:00:42 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] Move packet recieved.
[15:00:42 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] X: -0.5 Y: 67.0 Z: 22.5
[15:00:43 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] Move packet recieved.
[15:00:43 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] X: -0.5 Y: 67.0 Z: 22.5
[15:00:44 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] Move packet recieved.
[15:00:44 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] X: -0.5 Y: 67.0 Z: 22.5
[15:00:45 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] Move packet recieved.
[15:00:45 INFO]: [STDOUT] [net.minecraft.server.network.PlayerConnection] X: -0.5 Y: 67.0 Z: 22.5

all without moving (took me a bit forgot to test)

gilded granite
#

how to get all the ? commands?

quaint mantle
sterile token
remote swallow
#

it can be applied to material

#

or action

tender shard
gilded granite
#

nice

tender shard
hasty prawn
gilded granite
#

?ask

undone axleBOT
#

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

remote swallow
tidal kettle
opal carbon
#

and epic thats what it sends it just sends the same coordinates repeatedly

#

since you asked ig

remote swallow
#

the what

sterile token
remote swallow
#

equals inventory view

tawny talon
opal carbon
#

it updates every second even without movement

opal carbon
tender shard
remote swallow
#

guess you just add an if from equals to

sterile token
remote swallow
#

that was to cooleg

#

use equals and InventoryView for inventories

tender shard
#

equals() doesn't really do anything on inventories besides ==

sterile token
#

I have a nightmare because they musnt be matched via title because of obviuously reason

tender shard
#

if in doubt, use equals

#

This is CraftInventory equals()

#

but the underlying inventory doesnt override equals

gilded granite
#

is Amazon CodeWhisperer good with minecraft?

tender shard
tidal kettle
quaint mantle
#

why can’t BlockState be casted to TileState???

sterile token
slender elbow
#

it can ??? if it is

tender shard
#

you cannot cast a grass blockstate to tilestate

quaint mantle
#

is cartography table not a tilestate

tender shard
#

no

quaint mantle
#

cuz it has a gui

#

what

#

bruh

tender shard
#

but it doesnt store anything

#

it's just a block that opens a stateless gui

#

you cannot store any items there or anything

quaint mantle
#

so how do i create a block pdc with a cartography table

slender elbow
#

a crafting table is not a block entity, for example

quaint mantle
#

please don’t say you can’t

undone axleBOT
quaint mantle
#

hm dependancy

tender shard
#

yeah but a tiny one, and it's on maven central

quaint mantle
#

im down as long as it works

tender shard
#

ofc it works, but only in 1.16.3+

slender elbow
#

will it work in 1.4.3

#

pls

#

im need

tender shard
#

YES

#

for you, dear emily, I'll make it work

quaint mantle
tender shard
#

no, why would I

quaint mantle
#

im running a 1.16.2 server

remote swallow
#

why

quaint mantle
#

what is that coincidence

#

nah i mjoking lmao

tender shard
#

1.16.3 is the version since when Chunk implements PersistentDataHolder

eternal night
#

flashbacks to PDC implementation on chunks

tender shard
#

blame lynx for not having added it earlier

gilded granite
#

how do i add custom blocks with pdc?

eternal night
remote swallow
#

im blaming lynx for not adding pdc in 1.8

eternal night
#

TRUE

remote swallow
#

all those 1.8 servers

tender shard
tender shard
gilded granite
tender shard
tender shard
#

and then drop your custom loot

gilded granite
#

Thx

remote swallow
#

do you think postgress is on choco

young knoll
#

What

quaint mantle
#
@EventHandler
    public void onInteractEvent(PlayerInteractEvent event) {
        if (event.getHand() == EquipmentSlot.HAND &&
                event.getAction() == Action.RIGHT_CLICK_BLOCK &&
                event.getClickedBlock().getType() == Material.CARTOGRAPHY_TABLE) {

            Block block = event.getClickedBlock();
            PersistentDataContainer pdc = new CustomBlockData(block, NationAddons.getInstance());

            if (pdc.has(new NamespacedKey(NationAddons.getInstance(), "printing-press"), PersistentDataType.STRING)) {
                event.setCancelled(true);
                printingPress(event.getPlayer());
            }
        }
    }
#

would that work

spare hazel
#

what is a good way to disable first person view?

young knoll
#

A mod

remote swallow
young knoll
#

I thought you meant @worldly ingot

#

Kek

remote swallow
#

totally

quaint mantle
remote swallow
#

it is

#

im surprise

spare hazel
#

wait block PDC exists?

tender shard
quaint mantle
#

in BlockPlaceEvent is there anyway to check the display name of the itemstack when its placed, so for example check if a dirt block named "test" is placed

tender shard
#

?blockpdc

undone axleBOT
tender shard
#

while we're at it, I can also advertise MorePDCTypes

#

?morepdc

undone axleBOT
tender shard
#

Arrays, Maps, Collections, etc as PersistentDataTypes :3

spare hazel
#

yes

#

i used that

tender shard
#

it could even store a Map<Material,TreeSet<List<String>>>

#

but I hate treesets

#

don't use them

spare hazel
#

@tender shard you literally made a library for EVERYTHING

tender shard
quaint mantle
tender shard
#

anyway you can get the item that is used to place using getItemInHand()

quaint mantle
#

nah im interested in the tags

tender shard
#
ItemMeta meta = ...;
meta.getPersistentDataContainer().set(someNamespacedKey, PersistentDataType.STRING, "my custom item lol");
#

or: Why you should NEVER use NBT tags again! Spigot 1.14.1 added the biggest improvement that (in my opinion) ever made it into the Bukkit API: The Persistent Data Container (PDC). It can be used to store custom data on Entities, TileEntities, and ItemStacks. Using a bit of math, it can also be used to...

spare hazel
tidal kettle
#

is it possible to make a foreach like this or no?
for (int i : getConfig().getList("on_first_join.items").size())

gilded granite
#

How to do pdc for blocks?

tidal kettle
#

because it dfon't work

sterile token
#

So in conclusion which is the best way for inventories i didnt really get a conclusion??

spare hazel
spare hazel
undone axleBOT
sterile token
tender shard
quaint mantle
#

so like this

tender shard
quaint mantle
#

itemMeta.getPersistentDataContainer().set(new NamespacedKey(NationAddons.getInstance(), "printing-press"), PersistentDataType.STRING, "custom");

if (event.getItemInHand().getItemMeta().getPersistentDataContainer().has(new NamespacedKey(NationAddons.getInstance(), "printing-press"), PersistentDataType.STRING))

#

would that be g

tender shard
#

yes

quaint mantle
#

fire

tender shard
#

but you should rather cache your NamespacedKey

#

instead of recreating it everytime

quaint mantle
#

how do i do that

#

WeakReference fr

tender shard
#
private final NamespacedKey itemIdKey = new NamespacedKey(myPlugin, "item-id");

//
@EventHandler
public void onEvent(...) {
  // use the key now
#

just store the NamespacedKey in a field

quaint mantle
#

oh yeah sounds good

tender shard
#

that also avoids typos if you need it in more than one place lol

#

I usually have a class that only stores all my NamespacedKeys

#

or have them all as public final field on the main class

#
public class MyPlugin extends JavaPlugin {
  public final NamespacedKey whateverKey = new NamespacedKey(this, "whatever");
  // ...
remote swallow
tender shard
#

sure that also works if you dont have an instance

young knoll
#

We love fromString

remote swallow
#

isnt the constructor deprecate

tender shard
#

yes

#

but in old versions, fromString does not exist

remote swallow
#

who uses old versions

near mason
#

i didnt know that

lilac dagger
#

quiet a lot of people

near mason
#

i used new NamespacedKey(PluginMain.getPlugin(PluginMain.class), "key") everytime

tender shard
#

yeah that's ofc the best way

#

well using getPlugin isn't exactly

#

but it's fine, I mean it only runs once

quaint mantle
#

anyone got that plugin that outputs the artifact into any directory

tender shard
#

maven or gradle

quaint mantle
#

maven

tender shard
#

If you’re using maven for your Spigot plugins (which you should do), it’s easy to make maven automatically save your plugin’s .jar in your plugins folder. There’s two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...

quaint mantle
#

damn maven can do that

#

fire

tender shard
#

it would be preeetty sad if it couldnt do that

tall dragon
quaint mantle
sterile token
quaint mantle
#

i aint doin allat

sterile token
#

he?

#

allat, what thats i dont udnerstand spigot english its really weird.

tender shard
#

<meta property="og:title" content="This is the embed's title">

quaint mantle
tender shard
tall dragon
tender shard
#

just google "html open graph meta"

tall dragon
#

i see, thanks so much

tender shard
#

np

tender shard
#

the thing where water comes out

quaint mantle
#

yeah but what is spigot english

#

like u have american english, british english

#

but spigot english?

tender shard
#

spigot english is like this:

help guys my plugin not workings?? I using intellij but error when startup help plz

quaint mantle
#

lmao

#

hahaha

sly falcon
#

Hiya! is anyone able to make it happen to create an API to make sure that specific cases happens, such as setting block, opening the crate for the user and so on 😄 ?

Please @ me if u know how Or if you know a plugin which already does this ^^

tender shard
quaint mantle
sly falcon
tender shard
tall dragon
valid burrow
#

what is a smart way to load a config? I have a huge config and i need parts of it in many different classes what would be the smartest way to load all of it

tall dragon
#

by loading all of it

valid burrow
#

yh but like do i create a different class for it? or do i do it in the main? like im not sure if theres like a general way

#

cause i couldnt find anything about it online

#

but just loading it onEnable seemed kind of stupid me

tall dragon
#

why

#

seems like the best place to me.

tender shard
#

Loading it in onenable is usually the way to go

valid burrow
#

well first of all i need to pass in like 50 things in the get command if i want to use multible things of thew config

#

wich gets really confusing

#

well thats the whole reason actually yh

tender shard
#

Then turn your config into a data class

valid burrow
#

alright ill see what i can do

tidal kettle
#

on my config.yml : test: test:16 how i get the test and the 16?

remote swallow
#

getString("test").split(":")

willow yacht
#

How to check if Color is set? Because if player doesn't have color i got error```java
@EventHandler
public void onProjectileHit(ProjectileHitEvent e) {
Entity hitEntity = e.getHitEntity();
if (!(hitEntity instanceof Player)) {
return;
}

if (e.getEntity() instanceof Arrow) {
    Arrow arrow = (Arrow) e.getEntity();
    Color color = arrow.getColor();
    int red = color.getRed();
    int green = color.getGreen();
    int blue = color.getBlue();
    String hex = String.format("#%02x%02x%02x", red, green, blue);

    switch (hex) {
        case "#7ebff1":
            Bukkit.broadcastMessage("Freeze Arrow");
            break;
        default:
            Bukkit.broadcastMessage("Normal Arrow");
    }
}

}

tender shard
#

are you actually identifying your custom arrow by its color 🥲

#

you should use PDC tags instead

#

also why do you need the color as string?

tribal quarry
tender shard
#

sure, that'd work too

burnt sand
#

Agree but colors is also fine

tall dragon
#

i used to do an invisible code on line 0 of the lore 😂

#

like 5 years ago

hybrid spoke
#

i compare via material

young knoll
#

Remember tho

#

Metadata often doesn’t get cleaned up

gilded granite
#

how i can overide a minecraft command

smoky oak
#

create a command with the same name

#

different topic, does anyone know why a zombie spawning in and starting to attack a player does not trigger the EntityTargetEvent?

manic hamlet
#

Is there a way to prevent pirating premium Plugins effectively?

gilded granite
#

obsfucate it

quaint mantle
#

you cant

manic hamlet
quaint mantle
#

you would need some type of kernel driver to check if someone's pirating your game

#

so you simply dont, just deal with it

manic hamlet
#

And manual verification is forbidden right? Like the Plugins works only half until you verify yourself

quaint mantle
#

verification servers are kinda bullshit

#

you can always create your own verification server on localhost anyways

manic hamlet
#

Dang you're right

#

Yea i better deal with it

#

Anyways thank you very much!

quaint mantle
#

Minecraft accounts works becuz you need to use them to get into servers

#

and most people use them anyways

ivory sleet
#

don't put effort into them, they will find one or another way to pirate ur product

#

usually kids with no money that run their little servers :>

quaint mantle
#

you can always make foss plugin and add donations site and beg people to donate lol

ivory sleet
#

:,)

quaint mantle
#

which can work

#

something like, per month pay

#

never make one time pay donations

#

becuz if you do, you wont get money from people who forgot to unsubscribe from your donation thing

smoky oak
#

alright time to heed my own message
Event e -> print e.name

quaint mantle
#

why not use $

#

if you have one value

smoky oak
#

never mind i idiot forgot to register the event

quaint mantle
#

and just add another $ into the name for every nested lambda

#

if you already know the type why give it name lol

tender shard
#

other than that? no

#

alternative is to make it open source, SOME of those illegal websites take down open source plugins on request

#

not all of them, some even sell them

lilac dagger
#

i've seen them

#

imagine making money on someone else's work

tender shard
#

yeah quite unoriginal lol

#

i'd probably feel bad if I'd do that

young knoll
#

Spigot api is someone else’s work

lilac dagger
#

but it doesn't have a price tag

tidal kettle
#

how i can get the default, Vip and Vip+

#

?

tender shard
tidal kettle
#

(this is in config.yml)

tender shard
tidal kettle
#

yes i alredy know that but how i can get it in a variable

#

like it is a list?

#

or string?

tender shard
#

List<String> kits = …;

tidal kettle
#

bruh

#

i try list and string but not this

tender shard
#

Its a configurationsection, getKeys gets a list of… well… the keys inside it lol

tidal kettle
#

why this don't work

#

am i dumb?

#

or something

sterile token
#

Is this a map list or config section?

quaint mantle
#

try .getStringList

young knoll
#

Because a configurationSection is not a list

tender shard
#

getConfigurationSection(…).getKeys(false)

tidal kettle
tender shard
#

Thats a List of strings

quaint mantle
tender shard
undone axleBOT
#

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

sterile token
tidal kettle
#

?error

tender shard
#

?paste

undone axleBOT
tender shard
#

Or screenshot

tidal kettle
tender shard
#

oh right, it returns a Set<String>, not a List<String>

#

if you want to have it as list, do this

List<String> kits = new ArrayList<>(getConfig().getConfigurationSection("kits").getKeys(false));
#

otherwise, just do Set<String> kits = getConfig().getConfigurationSection("kits").getKeys(false);

tidal kettle
#

thx you that work know 😄

tender shard
#

np

tribal quarry
# manic hamlet Yea but that does not prevent pirating

Most people use stuff like proguard (I think fr33 does that), and some (I mean some really important plugins like intave), as far as I asked & not being sure (not knowing the exact thing they do), they use ZKM as main obfuscator and load classes through secured class loader, downloaded everytime on boot.

#

proguard is common with android sdk

#

And it has a gradle plugin (I think)

young knoll
#

Can’t download on boot

#

Not with a spigot premium plugin anyway

quaint mantle
ivory sleet
quaint mantle
#

i’m gonna make a spring boot plug-in

quaint mantle
ivory sleet
#

thats a lambda paramater variable

slender elbow
#

var var = new var()

onyx fjord
#

not for any "protection"

#

main purpose of proguard is optimization

#

it shrinks bytecode, removes unused methods etc

onyx fjord
#

no point of using that

short whale
#

heya, im trying to get a function from worldguard on to simple score, i want to be able to see what worldguard region im in. But i cant get it to work. Anyone know how to do it?

#

Im not even sure im at the right place to ask for help, if anyone know anything, or just knows where i should ask instead id really appreciate it :)

wet breach
#

worldguard uses its own player object as well just fyi

#

so you will need to use its method to convert a player to a WorldGuard Player

#

also, worldguard uses vectors as well

#

the link I gave contains this info as well, just have to browse around

short whale
#

Great, Thank you very much :D

wet breach
#

also Worldguard has events you can listen to

#

which if I recall there is one for entering regions

#

ok nvm, just has a single region event which isn't all that helpful

short whale
wet breach
#

you can, just have to implement a hook for it is all. For some reason I thought WG had some other events that were helpful that it itself ran

#

but the current API docs state there is only a single event and that is for pvp XD

#

but good news you now have the docs to look at stuff which should be more helpful 😛

#

also they have a discord as well

short whale
short whale
#

But thanks again :D

tribal quarry
opal carbon
#

some portions of them are automatically deobfuscatabale

#

portions

#

key word

whole surge
#

Hello. Why does my placeholder doesn't parse color?

young knoll
#

Did you run it though translate alt codes

whole surge
#

what?

young knoll
#

ChatColor.translateAlternateColorCodes

whole surge
hazy parrot
#

&b is not color code minecraft can understand

young knoll
#

You need to use §

whole surge
#

💀

young knoll
#

Also what in the JavaScript are you doing

whole surge
#

i didn't know java then

#

thanks

dark jolt
#

Is there a way to automatically update a datapack after something has changed instead of doing /reload or /datapack enable/disable. I made a plugin where it generates json files in a datapack for a custom advancement to count ride counts

tender shard
#

why don't you just load the advancement directly, without that datapack?

dark jolt
#

I can do that? First time working with anything with advancements

tender shard
#

if you got the json, you can use Bukkit.getUnsafe().loadAdvancement(...)