#help-development

1 messages · Page 1820 of 1

vale ember
#

нифига себе

peak gulch
#

thxx

ripe sun
#

ок

thorny python
#

I can only understand ok so far

ripe sun
#

плагин Geyser нажимаю на npc открывается меню я выбрал в меню сервер команда выполнилась в консоли и меня не куда не тепнуло
если что это мобильная версия
поддержка

vale ember
ripe sun
#

его учить просто

quaint mantle
#

Да-да

ripe sun
#

да

ripe sun
#

the Geyser plugin I click on the npc opens the menu I selected the server in the menu the command was executed in the console and I didn't achieve
anything if it
supports the mobile version

quaint mantle
#

Where are you from?

vale ember
#

как много людей разговаривают на русском здесь

proud basin
#

uhm help Error: Unable to access jarfile Nitrous

ripe sun
quaint mantle
#

ikr

#

Just wondering why does he need to learn russian

chrome beacon
ripe sun
quaint mantle
#

Легко тебе говорить

ripe sun
#

да

vale ember
#

на самом деле не очень простой

unreal quartz
#

how strange

quaint mantle
#

Далеко не простой

vale ember
#

слишком много исключений

quaint mantle
#

один из самых сложных в мире^^

ripe sun
#

ну не знаю )

ivory sleet
#

English only people

peak gulch
#

plugin
String name = plugin.getConfig().getString("player-name");
What i should put in the plugin place

#

im using exectuor

ripe sun
vale ember
ivory sleet
#

Due to moderation purposes, and it’s a rule btw

peak gulch
quaint mantle
#

it isnt really polite

peak gulch
vale ember
#

agree

#

nothing bad in speaking other languages

scarlet sun
#

Hello. Does any1 have a plugin that supports 1.17 - 1.18 and it detects only first time join and random teleports you? Idk if i should write it in server help or development help, or somewhere else

ripe sun
ivory sleet
peak gulch
vale ember
ivory sleet
#

?

ripe sun
#

the Geyser plugin I click on the npc opens the menu I selected the server in the menu the command was executed in the console and I didn't achieve
anything if it
supports the mobile version

vale ember
#

"Rules are mostly made to be broken" ©️ Douglas MacArthur (1880-1964)

quaint mantle
ivory sleet
quaint mantle
#

Hey is it possible to check every time a command is run though console?

#

PreprocessCommandEvent or smth

#

ah

#

thank you

#

Thats only for players though

fervent rampart
#

Must be possible to test the CommandSender is Type of ConsoleCommandSender, is it?

#

or "not-type Player"

ionic hatch
#

i know, this sounds very stupid, but why can i not do use Replaceall to replace all "(" in a String with ChatColor.WHITE?

msg.replaceAll("(", ChatColor.WHITE.toString());```

the IDE literally gives an error because  of ``) expected``, even though the ( is clearly inside quotation marks
quaint mantle
#

PlayerCommandPreprocessEvent

#

help

fervent rampart
vale ember
ionic hatch
ripe sun
#

the Geyser plugin I click on the npc opens the menu I selected the server in the menu the command was executed in the console and I didn't achieve
anything if it
supports the mobile version

vale ember
#

though it's kinda stupid imo

ionic hatch
#

it is!

fervent rampart
ionic hatch
#

yep, i checked

#

after like 5 minutes more of searching i found the answer on the holy texts, aka stackoverflow :D

#

oh Geyser, i have run geyser before!

#

can you rephrase your question @ripe sun , i have a hard time understanding it

fervent rampart
ripe sun
ancient plank
#

this channel isn't the place to get help for a plugin, this channel is for if you're writing code and need code help

gaunt hatch
#

Did gradle version change with needed to update to java17?

fervent rampart
#

I think not, what does this two things have to do with each other..

gaunt hatch
#

version restrictions.

#

when i updated to 16 with 1.17 i had to go to gradle 7

quaint mantle
#

You need gradlew 7.3

gaunt hatch
#

thought so thx

#

7.3.0?

fervent rampart
#

obv.

#

But it hasnt changed. Gradle in this version is compatible in both ways

gaunt hatch
#

7.0.2 would not build it failed

#

So no its not compatible

fervent rampart
#

There are some versions in between, would be interesting to see which does actually build the new versions and which doesnt.
I'll always keep the latest version

hasty prawn
#

7.3 is required for Java 17

#

Nothing before should work, or atleast, not fully

fervent rampart
gaunt hatch
#

Now the fun part all the nms changes lol

#

oh crap that is right org.json.simple is gone in 1.17 well lol

smoky oak
#

there's a few reasons bukkit/spigot exists and this is one of em

quaint mantle
#

Hello! How to remove a permission ?

gaunt hatch
#

shadow jar time 🙂

sullen marlin
#

switch to gson

#

json simple is very outdated

gaunt hatch
#

hmm never palyed with it before

#

does it read and write the same way?

sullen marlin
#

similar if you deserialize to JsonObject

lavish hemlock
#

but in most cases you should just serialize/deserialize directly to your data class

hasty prawn
#

confusedCat I'm not even using LivingEntity in that entire class what's goin on here

gaunt hatch
#

Yea have been meaning to build something like that just to lazy to lol

quaint mantle
mystic sky
sullen marlin
#

read the docs of your permissions plugin

#

you can negate by prefixing with - usually

mystic sky
quaint mantle
#

No

#

I'm coding a plugin

mystic sky
#

Oh

quaint mantle
#

and I need to remove a permission

mystic sky
#

Then, just remove the permission u added before.

quaint mantle
#

attachment.unsetPermission(); doesn't work...

quaint mantle
#

It's been already 5h I'm trying to fix it

mystic sky
#

What version do u want the plugin.

quaint mantle
#

1.8.8

mystic sky
#

I use on 1.8x unsetPermission#

quaint mantle
mystic sky
#

should work

quaint mantle
#

Isn't working here..

#
  1. Try on newer version
mystic sky
#
PermissionAttachment example = perms.get(player.getUniqueId());
example.setPermission("hello.hello", true);
quaint mantle
mystic sky
#

Turn false

quaint mantle
#

I will try, since I saw many people saying It's bad

mystic sky
#

well it's bad

#
perms.get(player.getUniqueId()).unsetPermission("hello.hello");
smoky oak
#

a unset permission just falls back to the default specified in plugin.yml (true/false/op)

tardy delta
#

hmm time to make a 2.0 revision of my plugin

quaint mantle
#

It worked with false

umbral spindle
#

System.out.println(test.toString().length()); how would I make this broadcast instead?

tardy delta
#

Bukkit.broadCastMessage

umbral spindle
fervent rampart
#

Whats the error?

umbral spindle
#

Required type: string
Provided: int

tardy delta
#

provide a string

tardy delta
#

Integer.toString() / String.valueOf

glossy scroll
mystic sky
#

tasbien How not

tardy delta
#

smh i'm the guy who uses Integer.toString

umbral spindle
tardy delta
#

yes

umbral spindle
#

Bukkit.broadcastMessage(Integer.toString(test.toString().length())); gave me an error

fervent rampart
#

Bukkit.broadcastMessage(String.valueOf(test.toString().length()));

tardy delta
#

just the same but whats the error

fervent rampart
#

Not actually the same. There are some differences

copper scaffold
#

How can i edit this to customize it?

umbral spindle
tardy delta
#

check for the playerloginevent

#

check if event is disallowed by a ban

tardy delta
#

its on console

fervent rampart
umbral spindle
#

I was typing the wrong command thats the issue -_- :(

copper scaffold
zealous osprey
#

Im assuming the #serialize method for ItemStacks is there so you can store the item in a file, but Im getting an error

#

Nvm, I have found a resource that nicely explains serialization in general

quaint mantle
zealous osprey
#

Well then I had the completely wrong idea of what that method does

umbral spindle
#

How would I get the first 3 characters of a string?

tardy delta
#

substring

#

(0, 3) iirc

#

3 is not included right?

umbral spindle
#

wdym

tardy delta
#

there is no slice in java

zealous osprey
tardy delta
#

ah

fervent rampart
#

oh sry xd

tardy delta
#

wait isnt it 0,3

zealous osprey
#

wait, yea it is 0, 3; python does 0, 4

#

bonk

tardy delta
#

stupid python

#

dont blame me

zealous osprey
#

indeed, but we are doing it in IT class in school :(
And we are "learning" oop with it

tardy delta
#

bae

#

we have c#

#

school is so stupid

umbral spindle
#

I'm trying to format something as like ?e?? (scientific notion) how would I get the first 3 numbers of a number (not string)

tardy delta
#

str.substring(0,3)

zealous osprey
#

Integer.parseInt(str.substring(0,3))

wicked lake
#

Convert it into a string, substring it, then convert back to integer

#

^^^

tardy delta
#

also doesnt the DecimalFormat class provides scientific notation?

ivory sleet
#

yeah it does

tardy delta
#

ah yea

visual tide
#

is it possible to hook into watchdog and have some code execute when the server hasnt responded in a while?
or would i be better off making such a detector myself

ivory sleet
#

You can pass a DecimalSymbols instance to it or smtng iirc

mortal hare
#

when do the UUIDs for offline players are being generated

onyx shale
#

On theyr first join

umbral spindle
onyx shale
#

Afaik its likely the same every time as its generated based on the username

mortal hare
#

{"name":"Dovias","uuid":"bf35cc01-5df1-355c-aaa6-44ed8a1bbbd7","expiresOn":"2022-01-12 22:33:33 +0200"}

#

for example

tardy delta
#

dont make a string an int to make it back a string

mortal hare
#

in usercache.json there's an expiration date for UUID

tardy delta
#

isnt that the cache expiration date?

mortal hare
#

does that mean UUID will be regenerated after the expiration?

visual tide
#

yes

umbral spindle
smoky oak
#

why do UUIDs expire???

visual tide
#

cause theyre not tied to an account when used in offline mode

smoky oak
#

ah

visual tide
#

just dont touch offline mode

smoky oak
#

testing plugins

visual tide
#

its more trouble than its worth

smoky oak
#

still good for testing stuff

onyx furnace
#

Hi

i asking for help, or atleast advice,

im not much satisfiet with minecraft world generation.... is just repetitive fractal.... i wanna make a continent... about size 30k x 30k where are biomes logicaly chained a sourounded togrther by climates... (on north cold... over moderate, subtropic and tropic on south) and i dont know how achieve it.... with generator help...

i looked many world generators but no any can solve my problem... your abandoned project with map from image feature was closest to solving it... but is dead....

thanks
any ideas?

thanks

onyx shale
mortal hare
#

doesnt that make plugins vulnerable to this expiration date

#

imagine storing UUID in the database

#

for a cracked player

onyx shale
#

Even if it is generated its not a problem as its always gonna be using the same name to generate the same one

mortal hare
#

and the fetched data after expiration date is stale

mortal hare
#

or does the server contain some kind of unique SALT key to generate the UUID

umbral spindle
onyx shale
#

Dont think it has,uuids are generated based on the username so its likely that all servers will have the same uuis

visual tide
mortal hare
#

It caches user data, the cache entries expire on a certain date and they'll need to be re-fetched from Mojang servers.

#

^ its the date for NMS for trying to retrieve the UUID from the mojang servers, if that fails UUID doesnt update until its updated.

sterile token
#

Hi! Any useful link that talk about netty injection on Spigot?

misty current
#

if you want to listen for packets, https://www.youtube.com/watch?v=rst3-wE14OQ&t=1s

Love the video or need more help...or maybe both?
💬Join us on Discord: http://discord.gg/invite/fw5cKM3
Thank you for tuning in to this episode of TheSourceCode! ❤️

If you enjoyed this video make sure to show your support by liking , commenting your thoughts, and sharing for all your friends to see and learn!

All code is available on Github:
...

▶ Play video
sterile token
umbral spindle
#
                String test3 = (e.substring(0,3));
                Integer Result1 = int.valueOf(test3);
                Integer Result2 = ```
how do I make result2 1/100 of result1
indigo moth
#

Not sure where I would ask, but I got a question about spigots rules. Being have they made a change to animal breeding mutations (brown pandas, blue axolotl) I've bred over 2000 axolotl and nothing has come from it yet so figured I'd ask

noble lantern
noble lantern
#

Unless your asking a question about the breeding api?

indigo moth
#

Whos that lol

noble lantern
#

whos who?

mortal hare
# indigo moth Whos that lol

this is the channel for java/other programming language plugin development, not for questions about server configuration

indigo moth
#

ngl i dont know anything about this im just trying to get my friend a christmas present, thanks 😄

mortal hare
indigo moth
#

done

noble lantern
#

?

umbral spindle
#

so Integer Result1 = Integer.parseInt(test3);?

noble lantern
#

Yes and try/catch NumberFormatException

umbral spindle
#

Integer Result2 = Result1.; what would I do for this though?

noble lantern
#

One moment i actually have code from an old project for this method

#

Use that method

umbral spindle
#

I'm very new and this is very confusing

noble lantern
#

    public int getPercentOf(final int toGet, final int percentage) {
        return Math.round((toGet * (percentage / 100.0f)));
    }```
#

ugh

#

stupid discord formatting...

mortal hare
#

why havent i wondered about this class earlier

#

this is a godsend for returning collections which are not meant to be modified

noble lantern
hexed hatch
#

Anyone know a snazzy way to get the items a player drops on death? Apparently, you can get the ItemStack drops from a player drop event but not the entities themselves

noble lantern
umbral spindle
#
    public int getPercentOf(final int toGet, final int percentage) {
        return Math.round((toGet * (percentage / 100.0f)));
    }```
this in the main class?
mortal hare
noble lantern
noble lantern
#

But yeah Collections are nice

quaint mantle
#

Anyone knows why this thing can't resolve

noble lantern
umbral spindle
#

so Integer Result2 = E2.getPercentOf(Result1, 1);

quaint mantle
noble lantern
#

eg variable names are camelCased

mortal hare
# noble lantern You can just clone it then?

that's the point i dont want to neither clone or modify the list, i just want for other people to access the view of the list safely, Collections static class provide a wrapper to make existing collection safe to read and impossible to write without copying the objects

noble lantern
#

and class names are UpperCase

noble lantern
quaint mantle
noble lantern
#

okay thats not a command rip

noble lantern
mortal hare
#

yea

quaint mantle
noble lantern
quaint mantle
noble lantern
#

If your using maven + build tools you need to install-file the buildtools jar IIRC since your importing it from a local file

#

As its not coming from a central repository

quaint mantle
#

I have this

gaunt hatch
#

getting a error on the spigot level

#

seems entityplayer and entityliving are clashing

noble lantern
#

I havent done too much NMS, but i think you import BuildTools.jar via maven with install-file commands

#

ill get you an example

umbral spindle
#

Result 1 = 123
Result 2 = 1
its meant to be 1/100 of the original?

noble lantern
#

well no since your setting 2 to equal 1 which isnt 1% of 123

umbral spindle
#

oh is it because its Integer not number

noble lantern
noble lantern
quaint mantle
umbral spindle
#

1/100 of the first one

noble lantern
#

Whatever button opens your maven command line

#

Thats what it is for me, its differnt for you

noble lantern
noble lantern
#

Why are you using a Integer as the second result then

noble lantern
#

and then reimport maven

#

that dependency should resolve after its isntalled to your repo

umbral spindle
#

I made it a double it went
350.0 ---> 4.0

quaint mantle
quaint mantle
umbral spindle
#

got it working.

sterile token
#

I cant find how to register a custom netty channel on spigot/proxy side

#

its really exaust

noble lantern
misty current
#

you can modify the existing one

#

injecting code into it

noble lantern
#

god why cant discord format code correctly

noble lantern
umbral spindle
misty current
#

can anyone use citizen's api?

noble lantern
misty current
#

how can you make an npc attack a player

noble lantern
#

oh that i never doen

But you would likely need to give it an AI + a Trait

sterile token
noble lantern
#

Maybe ask in citizens discord?

misty current
#

i did

#

but ehh the api support is kinda slow

noble lantern
#

weird they added a whole feature for me in like a day

#

maybe authors are busy this week

#

its close to christmas time almost so maybe people are on vacation

misty current
#

i mean i asked stuff sometimes and i got replies but few hours later

#

i've been checking a bit around but i can't really find either a trait or a method to make an npc attack

noble lantern
#

Maybe something with BahvaiorStatus by chance?

misty current
#

i don't understand how that stuff even is usefuk

#

i can't even get the npc

quaint mantle
#

I used mvn install:install-file -Dfile="C:\Users\Sohqil RF\Desktop\BuildTools 1.8 - Copy\" -DgroupId=server -DartifactId=net.minecraft -Dversion=1.8.8 -Dpackaging=server but i got an error

noble lantern
misty current
#

traits already took me a while

mortal hare
#

i've built my own packet entity api

misty current
quaint mantle
# noble lantern send the error

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project bukkit: The specified file 'C:\Users\Sohqil RF\Desktop\BuildTools 1.8 - Copy\Bukkit\"C:\Users\Sohqil RF\Desktop\BuildTools 1.8 - Copy\" -DgroupId=server -DartifactId=net.minecraft -Dversion=1.8.8 -Dpackaging=server' not exists -> [Help 1]

noble lantern
#

you didnt point it to the file

misty current
#

am I supposed to pass the npc in the constructor

noble lantern
#

you pointed it to a directory

noble lantern
quaint mantle
mortal hare
#

i've managed to get entity metadata, entity targeting, movement tracking api's working on my lib

noble lantern
zealous osprey
#

Sry to budge in, I had a quick question about particles, is there any way to define a time for them to exist, or do I need to replace them using a scheduler?

quaint mantle
#

What file should i point

misty current
#

hm lemme try to use the navigator

noble lantern
misty current
#

maybe you can make it follow an entity instead of a location

noble lantern
misty current
#

yeah

mortal hare
misty current
#

might as well check that later

quaint mantle
# noble lantern BuildTools.jar

The specified file 'C:\Users\Sohqil RF\Desktop\BuildTools 1.8 - Copy\Bukkit\"C:\Users\Sohqil RF\Desktop\BuildTools 1.8 - Copy\BuildTools.jar"' not exists

noble lantern
#

that should defo be helpful they have npcs that attack

misty current
#

aight thanks

misty current
#

ima try few things before

noble lantern
#

pu BuildTools.jar inside your project folder

#

and make the path BuildeTools.jar

hexed hatch
mortal hare
#

in my API, you can make your own entity trackers, you can even make packet entities track other server living entities not only the players themselves only.

noble lantern
#

i forgot that cant isntall from external foolders

mortal hare
#

i've made flying bat NPC yesterday 😄

quaint mantle
noble lantern
#

It uses the local directory eg project directory

#

it wont use C:\ or D:\ etc only ./ or /

mortal hare
#

BATMANNN

noble lantern
#

Thats actually pretty good pathfinding

#

for it not to just run into walls constantly

mortal hare
#

That's just literally server bat being tracked by packet entity

#

you can even see Bat in the clip

sterile token
#

Hi

noble lantern
#

ahh so your basically overriding bat AI

mortal hare
sterile token
#

Which netty maven version use the bungeecord?

mortal hare
#

that include no NMS at all

arctic moth
#

the getEntityType in EntityShootBowEvent doesnt seem to work is it getting the projectile type or smth?

mortal hare
#

im just listening to the entity's movement and sending them back to the player as packet entity's movement via packets

mortal hare
#

its packet level

noble lantern
#

ahh

noble lantern
arctic moth
#

well its not seeming to work

#

i did a check for if it was a skeleton and the thing didnt log

noble lantern
#

is the skeleton vanilla?

arctic moth
#

ye

noble lantern
#

is the event itself firing?

arctic moth
#

idk

#

should be

#

ye it is

noble lantern
#

i would log the EntityType

#

and see what its returning

arctic moth
#

ok

noble lantern
#

Can you show some code?

#

And this EnchantInventory is the one not getting loaded/not handling click events?

sterile token
#

Is there any code example about getting netty INSTANCE of spigot server or bungee server? Please i cannot find anything!!!!

noble lantern
sterile token
#

Do you know?

noble lantern
#

It has to be related to how your checking the inventory on click events

noble lantern
# sterile token Do you know?

You have to code dive through the like original mojang jar cause thats the code that actually handles opening the server iirc

#

You can look through spigots code too but i highly doubt it would open the TCP connections with netty there

#

Besides why do you even want netty?

sterile token
visual tide
#

is it possible to hook into watchdog and have some code execute when the server hasnt responded in a while?
or would i be better off making such a detector myself

sterile token
#

Please dont tell use message broker!!!!

noble lantern
#

idk all to well how netty works in itself but why dont you make your own instance when the plugin starts and handle it that way?

visual tide
#

spigot watchdog

#

the thread monitor

#

which kills the server if the main thread blocks for too long

noble lantern
misty current
#

i've found the method

#

to make it attack a player

#

i'll finish to code it tomorrow

noble lantern
#

specifically these 2 things

noble lantern
visual tide
sterile token
visual tide
#

also while looking for the watchdog class i found this

#

very sneaky

noble lantern
#

superSneaky

ivory sleet
#

yuh tho thats decompiled code?

visual tide
#

yeah cuz im too dumb to find the source

ivory sleet
#

🥲

visual tide
#

just finding the patch files

sterile token
noble lantern
#

it shows right up

visual tide
#

then im incredibly blind

noble lantern
sterile token
#

Im happy!!!

noble lantern
#

That bukkit source

#

Idk where watchdog file is

#

or else ide find it myself

sterile token
#

I think i know which class its the netty one on Bungeecord. Do you think that the correct class?

noble lantern
#

from NMS, to patches, to bukkit source, to build tools

visual tide
#

thanks!

quaint mantle
#

civis Bukkitus sum

sterile token
#

Hi! Anyone can tell me how i can do ch#method() with reflections? I want to access the value ch

#

Until now

ivory sleet
#

thats just a formal argument?

vague drift
#

hello

#

does anyone know how to change this to 1.18? what can be used?

timid timber
#

does anyone know why vault api isn't working with maven?

quaint mantle
vague drift
quaint mantle
#

even minecraft stop that lul

vague drift
#

1.17 exists

quaint mantle
#

wait then idk what is your jar idk

junior briar
#

would entity metadata be persistent?

sullen marlin
#

No but persistentdatacontainer is

paper viper
#

Brigad is already provided in the server for newer versions right?

young knoll
#

yes

ivory sleet
#

1.13+ iirc

paper viper
#

Yeah

pliant tundra
#

whenever my server restarts, the custom enchantments that i put on my items are gone, how can i prevent that

late sonnet
pliant tundra
late sonnet
#

and are added to the items?

#

if you not specify if the enchantment is compatible then this method not works and need addUnsafeEnchantment

pliant tundra
late sonnet
#

remember custom enchantmens are not displayed in the item "lore" by client-side

pliant tundra
pliant tundra
#

i have a thing that updates the lore

late sonnet
pliant tundra
waxen plinth
broken hare
#

Hey how can I set NBT data on items?

pliant tundra
# waxen plinth Can you show how you implemented them
package io.github.narutopig.bors

import io.github.narutopig.bors.util.General
import org.bukkit.NamespacedKey
import org.bukkit.enchantments.Enchantment
import org.bukkit.enchantments.EnchantmentTarget
import org.bukkit.inventory.ItemStack
import java.util.*
import javax.annotation.Nonnull

class EnchantmentWrapper : Enchantment {
    private val name: String
    private val maxLevel: Int
    private var conflicts: Array<Enchantment> = arrayOf()
    private var cost: ItemStack

    constructor(key: String, name: String, maxLevel: Int, cost: ItemStack, conflicts: Array<Enchantment>) : super(
        NamespacedKey.minecraft(
            key
        )
    ) {
        this.name = name
        this.maxLevel = maxLevel
        this.cost = cost
        this.conflicts = conflicts
    }

    constructor(key: String, name: String, maxLevel: Int, cost: ItemStack) : super(
        NamespacedKey.minecraft(
            key
        )
    ) {
        this.name = name
        this.maxLevel = maxLevel
        this.cost = cost
    }

    fun getCost(level: Int): ItemStack {
        val newLevel = General.power(2, level - 1) * this.cost.amount
        val newCost = cost.clone()
        newCost.amount = newLevel
        return newCost
    }

    @Nonnull
    override fun getName(): String {
        return name
    }

    override fun getMaxLevel(): Int {
        return maxLevel
    }

    override fun getStartLevel(): Int {
        return 1
    }

    @Nonnull
    override fun getItemTarget(): EnchantmentTarget {
        return EnchantmentTarget.BREAKABLE
    }

    override fun isTreasure(): Boolean {
        return false
    }

    override fun isCursed(): Boolean {
        return false
    }

    override fun conflictsWith(@Nonnull other: Enchantment): Boolean {
        return Arrays.stream(conflicts).anyMatch { enchantment: Enchantment -> enchantment.key == other.key }
    }

    override fun canEnchantItem(@Nonnull item: ItemStack): Boolean {
        return true
    }
}
#

its in kotlin but hopefully you can understand the gist of things
also all the enchantments are instances of this class

waxen plinth
#

Jesus

waxen plinth
pliant tundra
waxen plinth
#

I mean

#
public class HelloEnchant extends CustomEnchant {

  public HelloEnchant() {
    super("Hello", 1);
    addTrigger(EnchantTrigger.MINE_BLOCK, (e, l) -> {
      e.getPlayer().sendMessage("Hello");
    });
  }

}```
#

This is all the logic required to implement an enchant

waxen plinth
#

It's from my library

#

That is my better solution

scarlet sand
#

can anyone answer a simple question for me please

#

how the hell do i get the specific field components

#

thats all i want

#

chatcomponents.getfield(0) only works for chat messages

#

i need all messages like death messages

#

sometimes the field is a

#

sometimes the field is components

#

and its pissing me off

sullen marlin
#

?xy

undone axleBOT
scarlet sand
#

i want to cancel any message thats sent to players with a certain string (the ${ string)

pliant tundra
#

anyone know how i can add nms to my dependency list in maven

scarlet sand
#

including death messages

sullen marlin
lavish hemlock
#

Probably because of the Log4j exploit

#

?log4j

undone axleBOT
scarlet sand
sullen marlin
#

Yes, but it’s already been fixed

scarlet sand
#

i dont give a shit about the server i already have that fixed

#

i need to fix it for clients

#

because they dont know how to update forge

sullen marlin
#

Most forge versions are fixed iirc

#

In any case there’s like 2763 plugins that do this already

lavish hemlock
#

If they don't update their client, thats on them.

sullen marlin
#

And how is ${ getting in a death message anyway?

lavish hemlock
#

Item names

scarlet sand
#

because you can name a sword or name a zombie?

lavish hemlock
#

<player> was killed by <player> using <item>

#

or whatever

scarlet sand
#

and even then i dont want to have to worry about any commands either

#

simplest would be to just cancel any message packets being sent from the server to the player with that string

lavish hemlock
#

You probably just shouldn't care.

#

As I said, their fault if they don't update their client.

pliant tundra
#

?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 names and nicknames of a member.
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.

pliant tundra
#

?help 2

quaint mantle
#

ima run all 11 of those plugins

pliant tundra
#

how do i get the name of an enchantment (the actual one)
like Sharpness

young knoll
#

Isn't there a getName

pliant tundra
hasty prawn
#

Does anyone have any idea how this is happening? That entire class doesn't import nor reference at any point LivingEntity.

young knoll
pliant tundra
#

like in the item lore

young knoll
#

The key should basically be that

mystic sky
buoyant viper
lavish hemlock
buoyant viper
lavish hemlock
#

someone should make a Log4j patcher patcher

buoyant viper
#

o fuk

mystic sky
mystic sky
waxen plinth
buoyant viper
quaint mantle
#

i thought they would do something like cancel the message then send a jndi back to the client or something to troll them back lol

wicked lake
buoyant viper
#

if they try jndi it just sends it back @ them

noble lantern
#

Yet its specifically null checked in that method and returned?

#

Exact ide error btw

#

I assume this is just an intellij thing? Because if this ran during runtime it wouldnt be possible for playerDirectory to be null

buoyant viper
#

probably intellij thing

noble lantern
#

Okay i can just add @SuppressWarnings("ConstantConditions") to the top of the class but i dont really want to do that as something else might be null i want to see hmm

#

guess ill just suck it up and use this annotation

buoyant viper
#

couldnt u put it at top of method instead?

#

or at that specific line?

noble lantern
#

I could but my goal with this method was to reduce the code size

#

and i dont want to shove annotations on top of multiple methods

quaint mantle
#

so just dont care about it

#

why do you even need to care about it lol

buoyant viper
#

^ also an option

#

sometimes u just gotta ignore the ide

noble lantern
#

Because the warning bothers me xD

#

OCD

quaint mantle
#

i always thought that writing a single line of code without getting intellij warnings is impossible bro, dont need to care about it lol

buoyant viper
#

if it makes u feel better i have a mod project in C# from a decompiled game that has warnings out the ass bc the dev was pretty Meh and didnt follow conventions

#

i might try and fix them one day but

#

just gotta ignore them...

#

unrelated kind of related note but VS is so ass cheeks at actually showing me errors and warnings so i usually have to restart it to see them

noble lantern
#

Isnt C# debugging kinda ass cheeks in itself though

#

i remember stack traces being useless as hell

#

might of been c++

buoyant viper
#

probably

#

and its a Unity game

#

so its even worse trying to work with

quaint berry
#

?paste

undone axleBOT
quaint berry
#

For some reason it isn't sending a message to the person I told it to but I don't know why

#

Can any of you help?

hybrid spoke
#

means your command have to look like /trust player nqjdjd

quaint berry
#

Oh

#

What should it be?

lavish hemlock
#

Sooo... it's not IntelliJ's fault.

hybrid spoke
quaint berry
#

I'm trying to make it that when you type "/trust (Playername)" it tells the (Playername) that they have a friend request

hybrid spoke
#

so you want the arg length to be 1

quaint berry
#

I did but I tells the command sender not the /trust target

#

But I don't know why

hybrid spoke
#

yeah you are sending the sender of the command the name of himself

buoyant viper
quaint berry
hybrid spoke
lavish hemlock
#

well IntelliJ's assertions use implicit contracts

#

likelihood is that the "non-null" part of the contract wasn't generated

hybrid spoke
# quaint berry How would I change that?
Player target = Bukkit.getPlayer(args[0])

if(target != null) {
  target.sendMessage(player.getName() + " wants to friend you");
} else {
  // targetted player is offline
}

something like that

#

otherwise your Bukkit.getPlayer will remain a dead store

quaint berry
#

Oh

#

Thanks

#

if (target == commandSender) { null } This doesn't work, Do you know what would work?

broken hare
#

Just a question how do deal with picking colours for the return messages?

#

in the chat.

quaint berry
broken hare
#

How do you pick what colours to use?

quaint berry
#

Change the RED to whatever colour you want

#

Did I help?

broken hare
#

Yea it's all good thankyou

hybrid spoke
quaint berry
#

Will this stop it?

#

incompatible types: missing return value

#

Do I type return false?

hybrid spoke
#

return false would mean that the usage will be sent to the sender

#

sent the sender a message that he cant friend himself and return true

glacial sphinx
#

Where I can find what the 1_17_R0 means?

#

And all other stuff like 1_16_R1 etc.

hybrid spoke
#

its the NMS version

glacial sphinx
smoky oak
#

why does Chunk have getBlockAt(x,y,z) but not setBlock? How do i change blocks?
I'd look in the documentation but i cant access it atm for some reason

hybrid spoke
smoky oak
#

theres no set block method hence why im asking

#

so how do i change blocks then

quaint berry
#

It says you can't friend yourself which is good but then it says /trust

#

?

hybrid spoke
smoky oak
#

ah you mean change the block instance

#

i thought that gave a copy

#

thanks

hybrid spoke
#

technically it does

#

but that doesnt matter

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 names and nicknames of a member.
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.

smoky oak
#

is chunk.getblock(int, int, int) faster than both world.getblockat(int, int, int) and world.getblockat(location), and if yes, by how much?

hybrid spoke
#

chunk#getBlock probably invokes world#getBlockAt

#

nvm, the other way around

#

chunk#getBlock would be faster because world#getBlockAt first fetchs the chunk and then returns chunk#getBlock

#

but that shouldnt really matter because it will be unnoticable

thorny python
#

is there a way to run code right after spigot enabled all plugins (completed onEnable() for each plugin)?

smoky oak
#

ok, but i found something else interesting. If searching blocks relative to the player, using location is marginally faster. 10k iterations, time in nano.
im going to assume getBlockAt(x,y,z) converts it into a location

buoyant viper
#

can probably set ur plugin priority to be enabled last and then run ur code there?

thorny python
#

no it is a library

#

so it have to be enabled before other dependents, and finish up with some code when no plugin going to register itself

hybrid spoke
buoyant viper
thorny python
#

hm it look like a weird workaround but ok

#

ty

buoyant viper
#

unless theres an api provided event then idk

unborn dew
#

Would anyone know why on 1.18.1 this would be happening:

[13:26:52] [Server thread/ERROR]: Error occurred while enabling ArmorStandEditor v1.18-31 (Is it up to date?)
java.lang.IllegalArgumentException: Team name 'ASLocked' is already in use
at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[commons-lang-2.6.jar:2.6]
at org.bukkit.craftbukkit.v1_18_R1.scoreboard.CraftScoreboard.registerNewTeam(CraftScoreboard.java:167) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3360-Spigot-f65de01-c2e0bbd]
at io.github.rypofalem.armorstandeditor.ArmorStandEditorPlugin.registerScoreboards(ArmorStandEditorPlugin.java:206) ~[?:?]
at io.github.rypofalem.armorstandeditor.ArmorStandEditorPlugin.onEnable(ArmorStandEditorPlugin.java:88) ~[?:?]

Source for where the scoreboards are:

Main of the plugin:

    //Implement Glow Effects for Wolfstorm/ArmorStandEditor-Issues#5 - Add Disable Slots with Different Glow than Default
    private void registerScoreboards() {
        getLogger().info("Registering Scoreboards required for Glowing Effects");
        scoreboard.registerNewTeam("ASLocked");
        scoreboard.getTeam("ASLocked").setColor(ChatColor.RED);

    }

    private void unregisterScoreboards() {
        getLogger().info("Removing Scoreboards required for Glowing Effects");

        team = scoreboard.getTeam("ASLocked");
        if(team != null) { //Basic Sanity Check to ensure that the team is there
            team.unregister();
        } else{
            getLogger().severe("Team Already Appears to be removed. Please do not do this manually!");
        }
    }

Socreboard handling:

     private void toggleDisableSlots(ArmorStand armorStand) {
        if (!getPlayer().hasPermission("asedit.disableSlots")) return;
        if (armorStand.hasEquipmentLock(EquipmentSlot.HAND, ArmorStand.LockType.REMOVING_OR_CHANGING)) { //Adds a lock to every slot or removes it
            team = plugin.scoreboard.getTeam("ASLocked");
            armorStandID = armorStand.getUniqueId();

            for (final EquipmentSlot slot : EquipmentSlot.values()) { // UNLOCKED
                armorStand.removeEquipmentLock(slot, ArmorStand.LockType.REMOVING_OR_CHANGING);
                armorStand.removeEquipmentLock(slot, ArmorStand.LockType.ADDING);
            }
            getPlayer().playSound(getPlayer().getLocation(), Sound.ENTITY_ITEM_BREAK, SoundCategory.PLAYERS, 1.0f, 1.0f);

            if(team != null) {
                team.removeEntry(armorStandID.toString());
                armorStand.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, 50, 1, false, false)); //300 Ticks = 15 seconds
            }


        } else {
            for (final EquipmentSlot slot : EquipmentSlot.values()) { //LOCKED
                armorStand.addEquipmentLock(slot, ArmorStand.LockType.REMOVING_OR_CHANGING);
                armorStand.addEquipmentLock(slot, ArmorStand.LockType.ADDING);
            }
            getPlayer().playSound(getPlayer().getLocation(), Sound.ITEM_ARMOR_EQUIP_IRON, SoundCategory.PLAYERS, 1.0f, 1.0f);
            if(team != null) {
                team.addEntry(armorStandID.toString());
                armorStand.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, 50, 1, false, false)); //300 Ticks = 15 seconds
            }
        }

        sendMessage("disabledslots", null);

    }
tacit drift
#

and also line 86

#

and also

#

?paste

undone axleBOT
tacit drift
#

for when you want to send large amounts of code

unborn dew
#

Ah good to know, throwing your way now:

ArmorStandEditorPlugin.java L206:
scoreboard.registerNewTeam("ASLocked");
L86 in the same class - Is the onEnable portion.
L88 which I also see mentioned is the call to register the Scoreboards: registerScoreboards();

tacit drift
#

Well

#

there is the problem

#

ASLocked is already created somewhere

unborn dew
#

I knwo that work around is to restart he server but wondering how best to perma fix this. I guess check if scoreboard exists before registering?

tacit drift
#

👍

#

Also, I think teams are stored in scoreboard.dat or something like that (i may be wrong)

unborn dew
#

So basically see

scoreboard = this.getServer().getScoreboardManager().getMainScoreboard();

if scoreboard.getTeam("ASLocked") == null{
  //Create team
} else{
  //Do something if team already exists
}```

and go from there?
tacit drift
#

do not try to encapsulate much

unborn dew
#

Hrmmm ok. Just wondering how best to proceed 🙂

tacit drift
#

pretty much just

#
if (Team#getTeam("ASLocked") == null) Team#registerNewTeam("ASLocked");
#

wait no

#

yeah you do you, I am a bit tired

#

🤣

unborn dew
#

No worries, thanks for helping though 😄

tacit drift
#

but yeah, in the future just look over the javadocs and read the error

#

and if you didn't knew already, look in the error to see where it comes from

iron palm
#

is there any damage cause in damage event for a created explosion?

vale ember
#

how to remove everything from item's PDC?

ivory sleet
vale ember
#

it work on 1.14.4?

#

i don't see

stack.getItemMeta().getPersistentDataContainer().getKeys();
ivory sleet
#

The meta is just a configuration

tacit drift
ivory sleet
#

You need to set it back

vale ember
#

ik

#

i mean there's no getKeys method

ivory sleet
vale ember
#

1.14.4

ivory sleet
#

Maybe this was added quite recently

vale ember
#

and how to do that on 1.14

ivory sleet
#

Idk, might have to operate on the implementation

eternal night
#

updating is generally a good idea 👍

#

but yea, you would have to look at the impl

vale ember
#

yeah updating is good, bot i want to support 1.14.4

eternal night
#

Well you'll have to jump into the implementation then

vale ember
#

i found workaround, storing all keys that i ever added in list

ivory sleet
#

That’s a better way as it wouldn’t interfere with other plugins which also use pdc api

vale ember
#

you mean other plugins editing same item?

ivory sleet
#

In principle yeah

vale ember
#

that's bad

#

i want to delete EVERY entry

#

i clone itemstack

#

than delete everything

#

and check whether they're equal

#

cuz PDC don't implement correct equals method

eternal night
#

it does not ?

ivory sleet
#

Pretty sure it does

eternal night
#

it just equals the internal map

#

all of the nbt tags also have correct equal methods

vale ember
#

same items with same PDCs are duplicating as hashmap key

#

but same items without PDC don't

#

=> PDC is the problem

eternal night
#

Can you pls try to replicate this in the latest version btw

vale ember
#

idk i want to support 1.14

eternal night
#

if the hash function of the pdc is broken you should notify the spigot maintainers

#

no but like

vale ember
#

mb they added correct impl in newer

eternal night
#

for the sake of the project

#

oh ?

vale ember
#

idk

#

maybe

#

i didnt try

#

but i want to use 1.14

eternal night
#

pretty certain the hashcode and equals function existed since the introduction

ivory sleet
#

Only thing I can think of is like a broken PersistentDataType’s type’s hashCode

vale ember
#

that can be the reason

#

i think

eternal night
#

the types are not stored in the pdc tho

eternal oxide
#

are you really adding EXACTLY the same data to both PDC?

vale ember
#

THEY are generated by SAME METHOD WITHOUT PARAMETERS

#

AND NOT EDITED THEN

eternal oxide
#

Not really what I asked. Is there any way your method could add different PDC data

vale ember
#

version?

eternal night
#

ehhh

#

idk

#

01 Mar 2020 was the date this was added

buoyant viper
#

oh pdcs r bukkit api? idk y but i thought they were part of spigot instead lol

eternal night
#

most new API is bukkit api

buoyant viper
#

hm

eternal night
#

well

#

whatever you want to call it

#

spigot maintains the bukkit api

#

so eh

buoyant viper
#

yet it has spigot specific things itself .. smh

eternal night
#

does it ?

buoyant viper
#

.spigot() methods no?

eternal night
#

OH

#

yea

#

Well the concept of spigot patches still exist

#

¯_(ツ)_/¯

#

a result of some fun minecraft server software history

buoyant viper
#

this games history is something alright

lilac dagger
#

has anyone registered custom entities yet?

ivory sleet
#

I did it once with 1.7.10 nms

chrome beacon
#

Registering entities is a mess in 1.18

#

Avoid it if you can

lilac dagger
#

i can't

#

one of my projects really need it

#

not sure why they don't load

#

1.17 just worked without any fancy stuff

#

not sure what they changed

smoky oak
#

how do i best generate a known structure via plugin? Speak, how do i store it in the plugin, and how do i put it into the world?

quaint mantle
#

whats the correct way to update block data

#

i.e store it

#

and update it at a later date

#

atm im just re-setting the type to what it originally was

#

but id like to keep the block state next time

eternal oxide
#

it all depends on the block

sonic phoenix
#

Hey! Could it be that IntelliJ IDEA packages the classes without modules when packaging from a child module? I had to specify the class without any modules prefix, otherwise, it would fail

hexed hatch
visual tide
#

im making my own version of spigots watchdogthread, and and i've got a bit of a problem. spigot watchdog does busy waiting, sleeping in a basically infinite loop. is this a problem/can i do this a different way?

quaint mantle
#

ask @sullen marlin

#

he doned this all by himself he should know what to do

visual tide
#

thanks clyde

thorny python
#

I got NoClassDefFoundError for asm class when enabling my plugin ._. but I supposed to already add them into built jar

#

basically use any third party dependency seems always give NoClassDefFoundError, despite I have added flatten classes into the plugin jar

buoyant viper
#

are u using the right jar when ur putting it in plugins

thorny python
#

uh probably

#

because there is org/mydependencies/... folder inside the jar

#

uh maybe because I did not add classpath into the manifest

thorny python
#

well, doesnot work ;_;

#

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<configuration>
<artifactSet>
<includes>
<include>org.ow2.asm:asm</include>
</includes>
</artifactSet>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
Did I make any mistake in pom? I am super confusing because I can actually see the package & classes I need in the jar but spigot still produces NoClassDefFoundError

eternal oxide
#

Spigot doesn;t use the manifest

#

if you want to include something and are having issues with shading, use the libraries entry in the plugin.yml

thorny python
#

I am checking it out, thanks

noble lantern
#

Does TabCompletor need to be registered like an event?

thorny python
#

it need to registered like a CommandExecutor iirc

eternal oxide
#

implement TabExecutor and it does both

#

then just register with the normal method

noble lantern
#

I am using a custom Command handler, so i inject a BukkitCommand into the Bukkit CommandMap

So im not sure how this changes reistering TabCompletors

thorny python
#

okay more confusion: I added asm into libraries entry, and spigot download the dependency when load my plugin, then I get NoClassDefFoundError again when enable the plugin ._.

ivory sleet
#

you need to pass it through both ::setExecutor and ::setCompleter

eternal oxide
noble lantern
ivory sleet
#

nope

#

the strategy interfaces only exist for PluginCommand

noble lantern
#

I kinda forgot how to use the default bukkit command API

ivory sleet
#

lol

noble lantern
#

I dont think my command would get registered to that map though

ivory sleet
noble lantern
#

I register my commands like this

noble lantern
#

Or would it pickup commands from Bukkit CommandMap as well?

#

yep they do

regal dew
#

w h a t is that background

noble lantern
#

its this

noble lantern
regal dew
#

obtrusive background lol

noble lantern
#

So it just uses getPluginCommand under the hood

noble lantern
#

barely even notice it while using the ide tbf

regal dew
#

its barely readable 😅

#

but eh whatever works ig xd

visual tide
#

so it wouldnt really be a problem

ivory sleet
#

dont think so, I mean have you tried (yes I know multithreading and concurrency is hard to test)?

visual tide
#

not yet

#

just asking before i get bombarded with "tf you doing that's basically illegal"

ivory sleet
#

lol

hybrid spoke
#

how else would you want to keep a thread alive

quaint mantle
#

if (!Thread.isAlive) Thread.hospital.keepFeedIt;

visual tide
sacred schooner
#

is there a way to get these progress updates from a plugin? having set the plugin to load at startup this sounds like a possible thing to do but I couldn't find much on google

opal sluice
sacred schooner
opal sluice
sacred schooner
#

how would I know how much has loaded?

opal sluice
#

I guess that you can look at the chunks loaded

#

that's what the loading points out

sacred schooner
#

hmm

#

that sounds like a good idea

opal sluice
#

if you know your spawn area

#

you know the number of chunks that should be loaded

sacred schooner
#

sad, it doesn't seem like this event gets fired when the default world loads on server startup

opal sluice
#

That's because the world load before the actual plugin manager loaded is embedded in the server jar

sacred schooner
#

ah, I thought doing "load: STARTUP" might've some how made it so the plugin loaded before the world

#

I was especially thinking that because the load message appears before the world loading

opal sluice
#

It does load before the world is loaded

#

but the world's load is server side, you can't interact with it

sacred schooner
#

oh... sad

ivory sleet
#

hmm thought registering the event callback in onLoad would do the trick

opal sluice
#

But doesn't the events register loads up after the server is up ?

vale ember
#

anyone know good command creating APIs that don't require install plugin dependency?

vale ember
#

it's shit

opal sluice
#

Oh.

vale ember
#

i need to parse arguments to integers, doubles

#

and so on

opal sluice
#

You can do it... ^^'

vale ember
#

yes

#

but it requires more code

#

there's CommandAPI plugin

#

which makes everything clean and easy

opal sluice
#

Make your own api then

vale ember
#

but it requires it to install it

vale ember
#

?

sacred schooner
mortal hare
#

what would happen if you get map's value view: Map.values() and add another element via: Map.values().add(), will this throw UnsupportedOperationException or what?

ivory sleet
#

Depends on implementation

#

But mutations made on the collection object of the map’s values should be reflected on the actual map.

#

At least some I think

mortal hare
#

with remove() it makes sense, since it does not require a key

#

while .add() method only requires an object

#

and not the key

#

this could break the whole map implementation

ivory sleet
#

Yuh that might yield a UOE

#

Or if it gets mapped to the null key

glossy scroll
#

It does not support the add or addAll operations.

#

@mortal hare

mortal hare
#

thanks ❤️

glossy scroll
#

good question tho, had to look it up myself!

smoky oak
#

I need to get the world coordinates of a chunk's 0 0 0 block, how do i do that?

#

or rather the location there

mortal hare
#

chunk's corner coords are afaik X*16 Z*16

glossy scroll
#

chunk.getX() << 4 and chunk.getZ() << 4

#

will return the x and z coordinates of the world

mortal hare
glossy scroll
#

or you could do chunk.getBlock(0,0,0)

glossy scroll
smoky oak
#

bitshift or chunk.getBlock faster? i need the biome in that chunk (its nether so it should be the same regardless of height)

glossy scroll
#

are you in 1.18?

smoky oak
#

ye

glossy scroll
#

the biome is NOT the same regardless of height

smoky oak
#

even in the nether?

glossy scroll
#

correct

smoky oak
#

i need to know with a simple/fast check if there's a warped forest or a crimson forest through that chunk

glossy scroll
#

also multiple biomes can be in one chunk, i think u know that though

smoky oak
#

in the 0 0 corner

#

and my idea was 'check 0 64 0' of that chunk

#

correction only the warped forest check needs to run

mortal hare
#

since 1.16, biomes are being generated in three dimensions, not in two.

#

that means two or more biomes can exist at the same chunk at different heights

smoky oak
#

i know that but i need to know with a good chance of being right if there's a warped forest in that chunk

glossy scroll
#

i wouuld use this

#

with chunk.getX() << 4 and chunk.getZ() << 4

smoky oak
#

it tells me to implement methods for biomeProvider?

glossy scroll
#

world.getBiomeProvider

smoky oak
#

cant i just call getBiome on world directly?

glossy scroll
#

you could but it would return the biome at the highest point in the world. It's deprecated and subject to future removal

smoky oak
#

actually

#

probably only the last one

#

hence why im asking

glossy scroll
#

oh youre right

#

i didnt see that in the jd

smoky oak
#
Biome biome = chunk.getWorld().getBiome(chunk.getX() << 4, 64, chunk.getZ() << 4);
        boolean warped = biome.equals(Biome.WARPED_FOREST);```
#

?

#

ah wait that has to be ==

glossy scroll
#

no 🥄

chilly haven
#

arrow1.setVelocity(arrow.getVelocity().rotateAroundY(Math.toRadians(30))); Why does this not work?

smoky oak
chilly haven
#

well its like a tripleshotbow

#

so it adds arrow to the sides whe shooting

#

when

glossy scroll
#

have you tried adding to the yaw direction directly

proper shore
#

how can I check the player jump event?

eternal oxide
#

There is no jump event

crisp forum
#

If there was he would do :/

proper shore
eternal oxide
#

depends how accurately you need to check

#

You could check the jump statistic when it increases, but it would not be accurate timing wise

glossy scroll
#

there is a complicated packet check

eternal oxide
#

else you could check the block below the player in teh Move event and check they are not crouching

proper shore
#

when player touches space one time I want to run code

eternal oxide
#

You can;t detect key presses

#

not unless they trigger some event, and space doesn;t

mortal hare
#

well space triggers jumping

#

but its not always the case

eternal oxide
#

It doesn't trigger any spigot event

mortal hare
#

for example fly state

smoky oak
#

why is structure on the bukkit api page 403 forbidden?

#

i just want to know how to place one

solid cargo
#

yo what exception does the server throw if there is no suffix found for a player? nullpointer, right?

smoky oak
#

probably

#

how do i access the files there?

glossy scroll
#

annotated with @urban grotto

#

LOL

#

oops random ping

smoky oak
#

neither of those is working

new File(getDataFolder(),"resources/nether_house_blue.nbt")
new File(getDataFolder(),"nether_house_blue.nbt")
solid cargo
#

ah it throws IllegalStateException then?

glossy scroll
#

IllegalStateException - if this team has been unregistered

eternal oxide
smoky oak
#

well i dont want to save files i already have

#

how do i access them then

thorny python
#

._. I put my jar file into resources folder for maven to package it, but somehow maven corrupt the resource jar file

eternal oxide
#

then don;t try to get them as a file

smoky oak
#

i know there was some stream weirdness but i cant recall how

solid cargo
glossy scroll
#

if its not registered on the server

#

a team object can exist without it being registered

smoky oak
#

can i just cast that to structure?

proper shore
#
    public void jump(PlayerMoveEvent event){
        Location firstPosition = event.getFrom();
        Location lastPosition = event.getTo();
        Player player = event.getPlayer();
        Block block = player.getWorld().getBlockAt(lastPosition.getBlockX(), lastPosition.getBlockY(), lastPosition.getBlockZ());
        if(Math.floor(lastPosition.getY()) > Math.floor(firstPosition.getY()) && !player.isFlying() && lastPosition.getY() - firstPosition.getY() != 0.5 && block.getType().isAir()){
            System.out.println("Jumped");
        }
    }

I'm using this code for check whether move event. Is there any better way to check it?

eternal oxide
#

no

thorny python
glossy scroll
glossy scroll