#help-development

1 messages · Page 681 of 1

smoky oak
#

wait youre playing chess?

tender shard
#

who plays chess

smoky oak
#

coll aparantly

young knoll
#

No ICBMs are not legal in chess

smoky oak
#

theres a gambit coined that

#

rank 1 to rank 8 queen trade

hybrid spoke
pseudo hazel
#

okay well ill keep it in mind for the future, I dont really mind with this plugin but its good to know someone is having enough fun to repost it

smoky anchor
#

Does ICBM stand for InterContinental Ballistic Missile ?

smoky oak
#

yea

smoky anchor
#

how is that related to chess
wtf did I miss

hybrid spoke
#

how did i mess up so badly

tender shard
#

yeah that was funny

hybrid spoke
#

thought BOOM CHECKMATE

#

and then WHY DOES IT NOT END

smoky oak
#

i once almost fools mated someone

#

then i forgot how

#

not my proudest moment

#

i stg cipher if you make a 18+ joke

hybrid spoke
#

the best checkmates are the ones you did accidentally

#

gg

tender shard
#

gg

#

next time, don't set it to 10 minutes pls lol

hybrid spoke
#

what else

smoky oak
#

3+0 blitz

hybrid spoke
#

we can play blitz if you want

tender shard
#

isn't there an option to set a time per move instead of a total time

smoky oak
#

nah its too late

#

my iq is already dropping

tender shard
#

i had only 1 minute left

hybrid spoke
#
Chess.com

Login to your Chess.com account, and start enjoying all the chess games, videos, and puzzles that are waiting for you! If you have any issues while logging into your account, do not worry. You can recover your password, or drop us a message and we will gladly help.

smoky oak
#

my elo is somewhere around 300 even when im awake so imma say no lol

hybrid spoke
#

1 day per move

smoky oak
#

alright i shouldnt have said that

#

you two have fun

tender shard
hybrid spoke
#

yeah you can play your move tomorrow

tender shard
#

oh ok I'll accept it then

smoky oak
#

yep we aint going to see those guys until october

hybrid spoke
tender shard
#

I did accept it and I also already did e4 but then somehow it ended?

hybrid spoke
#

huh

#

wait

smoky oak
#

wrong 1 day timer lol

hybrid spoke
#

ah no there it is

smoky oak
#

you choose the one where the board needs to stay active im guessing

hybrid spoke
#

its on your dashboard

#

daily parties

tender shard
#

ah yeah, it somehow switched to another site after I confirmed the first move lmao

hybrid spoke
#

gotta install it on my phone so it notifies me

tender shard
#

nice I found the train

smoky oak
#

hey alex

tender shard
#

reminds me of Freeman's Mind

quaint mantle
#

how do i change item drops on BlockBreakEvent?

#

and check if there were item drops?

young knoll
#

BlockDropItemEvent

quaint mantle
#

okay.

#

appreciate it.

#

do i just change the items in the List<Item> ? I am guessing it is a list because could be many items in case a chest with items is broken?

young knoll
#

Yes

naive loom
#

The fadeIn and etc was introduced in 1.9? When is the method introduced?

trim lake
#

I have some array list of ItemStacks. How to prevent removing 2 same ItemStacks?

naive loom
#

use a set

#

if they are completely identical that will prevent that, but if not just before adding to the list check.

trim lake
#

I can and want have to identical ItemStack in list thats okey. You can get 2x 64 cobblestone for example

#

Thanks gona try it.

tender shard
trim lake
#

Wait.. you cant .get something from set like you can from List?

tender shard
#

Sets are unordered

#

You can loop over them or stream them

#

But there is noch thing as a „first element“

trim lake
#

Oh fuck... Im just making GUI where player can chose items. If they are 2 same ItemStack if chose both of them and remove from menu (you can chose every item only one time). And thats what I need to fix.

tender shard
#

Use a list then

#

Or a SortedSet

trim lake
#

I was using list

#

Let me better explain.

#

If I click one red wool. One should replace green glass

#

thats oke, but another one get deleted as well

#

thats a issue

#

I hope that's maybe understandable xD Player will get the first 5 slots (the green one) after closing GUI

vital yacht
#

The list should only remove the first instance

vital yacht
trim lake
#

Sure but will be hard to undrestand probably 😄

#

Maybe I will need send whole class?

#

?paste

undone axleBOT
vital yacht
#

Whatever is relevant

trim lake
# vital yacht Whatever is relevant

Probably this:

@Override
    public void handleMenu(InventoryClickEvent e) {
        ItemStack item = e.getCurrentItem();
        Player p = (Player) e.getWhoClicked();
        if (item == null) return;
        if (item.getItemMeta().getPersistentDataContainer().get(new NamespacedKey(PersoKits.getPlugin(), "function"), PersistentDataType.STRING) != null) {
            String function = item.getItemMeta().getPersistentDataContainer().get(new NamespacedKey(PersoKits.getPlugin(), "function"), PersistentDataType.STRING);
            if (function.equals("removeItem")) {
                ItemMeta meta = item.getItemMeta();
                meta.getPersistentDataContainer().remove(new NamespacedKey(PersoKits.getPlugin(), "function"));
                item.setItemMeta(meta);
                kitVaraint.remove(item);
                optionItems.add(item);
                inv.clear();
                super.open();
                return;
            }            
        }
    }
vital yacht
#

Can you send the whole class?

trim lake
#

yup

#

the item im clicking one shoudl execute this code

#

(items affter barrier)

vital yacht
#

I’m line 103 it looks like you remove from the list every time

#

I’m on my phone right now so it’s kind of hard for me to see what’s going on

trim lake
#

umm line 103 is this for me

vital yacht
#

In the method setMenuItens right after the first if statement

trim lake
#

Yea, thats should not be issue, or wait...

#

Yea, you are right.. What I want to do, is already chose items not display in arrea to chose (afterr barrier). But Im removing the item already after choosing the item. And then when I open inventory Im removing that item again.. Because that working whit same ArrayList...Thanks a lot!

vital yacht
#

No problem

drowsy sandal
#

any idea why STRENGTH isnt on potion effects in spigot java docks?
Was looking for make
%player_has_potioneffect_<effect>%
Work

robust helm
#

if thats what u r searching

drowsy sandal
#

works thanks

cursive kite
#

I am trying to set a permission to be only available when given but not op

#
  core.admin.commandspy:
    default: false```
#

I set this in my plugin.yml but the OP users still have access

vapid grove
#

Anybody know a good tutorial to learn custommodeldata on spigot forumns

#

i remember seeing one that also included stuff like blocks w/ block states n such

#

but i cant find it

sullen marlin
cursive kite
#

I have my own checking permission function

        if (!(sender instanceof Player)) 
            return true;
        if ((!sender.hasPermission(permission)) && (!sender.hasPermission("core.*"))) {
            if (notify) {
                if (getRankFromPermission(permission) == null) {
                    ChatUtils.sendMessage(sender, Prefix.permission(), MessageUtils.noPermission());
                    return false;
                }
                ChatUtils.sendMessage(sender, Prefix.permission(), "&7This requires rank " + RankManager.getRankFromPermission(permission).getPrefix() + "&7.");
                return false;
            }
            return false;
        }
        return true;
    }```
#

And the player does not have any "*" permissions

sullen marlin
#

Is there a perms plugin installed

#

Try without it, maybe it defaults op to everything

cursive kite
#

No permissions plugin, only my checking hasPermission function

sullen marlin
#

Post your full plugin.yml

cursive kite
#
version: 3.0
main: src.sc.main.ServerCore
author: KBS

commands:
  heal:
    usage: /heal [args]
    description: Heal player
  feed:
    usage: /feed [args]
    description: Feed player
  time:
    usage: /time [args]
    description: Set time
    permission: core.command.time
  region:
    usage: /region [args]
    description: Region management
    permission: core.command.region
  warp:
    usage: /warp [args]
    description: Warp management
    aliases: [ warps ]
  clearchat:
    usage: /clearchat
    description: Clear chat
    permission: core.command.clearchat 
[Cut 50 commands from here]
    
permissions:
  core.admin.commandspy:
    default: false```
rare rover
#

md you should change the trash command system (as in adding commands to plugin.yml)

#

its so annoying

#

api's exist but still

#

🙂

sullen marlin
cursive kite
#

Yes, only want to block this one permission from OPs

#

The other's I have in a .java using strings not in the plugin file

sullen marlin
#

Maybe your perms checking function is broke, because has permission will definitely return false

cursive kite
#

I threw it in a loop, returns true

kind hatch
#

Aren't OPs implicitly granted all permissions?

sullen marlin
#

Not by Spigot

vapid grove
buoyant viper
#

the bukkit naming scheme is.... something

vapid grove
#

isnt haste caleld fast digging

#

*called

#

its really weird

buoyant viper
#

iirc theyre based on older internal names

cursive kite
#

I have no idea why it won't remove the permission

eternal oxide
#

are you using spigot and not a fork?

#

your plugin.yml is fine

cursive kite
#

I am using Spigot

eternal oxide
#

any permission plugin?

cursive kite
#

My own methods

eternal oxide
#

then you are granting that permission yourself

kind hatch
cursive kite
#

Good point, I will rearrange that later

#

But I want to figure out why it wont deny the permission

eternal oxide
#

spigot does not grant a permission set to false

#

you are doing that

kind hatch
#

I'd recommend checking normal #hasPermission() to rule out if it's an issue with your method.

eternal oxide
#

are you granting a wildcard admin permission by chance?

cursive kite
#

Hm, i tried normal has permission and it denied it

kind hatch
#

Then it's likely that your if statements are failing. Resulting in your method returning true.

cursive kite
#

i reduced it to a skeleton but it still says true

kind hatch
#

if ((!sender.hasPermission(permission)) && (!sender.hasPermission("core.*")))

This is likely where everything falls apart.

I think core.* encompases core.admin

cursive kite
#

But I never give the user core.*

north nova
#

..

cursive kite
#

Do I need to set core.* to false aswell

#

But I was OP to have access to all commands except this one permission

north nova
#

aren't u supposed to have your own parser to use wildcards?

#

like does spigot support wildcards in permission checks by default?

kind hatch
#

I think it does.

cursive kite
#

Sorry I don't understand, I explicitly check for core.* so if it is given it should pass any of my commands?

north nova
#

have you tried debugging your code?:D

#

like print line by line what's going on?

#

also bukkit permissions api doesn't support wildcards

cursive kite
#

I removed the core.* line and it works, not too sure how this will affect long term but ill have to figure that out next

glossy venture
#

spigot doesnt support .* permission attachments i think

#

pretty sure you need a permission manager which supports it like luckperms

#

which overrides the Permissible so Player#hasPermission works

shadow night
#

how do I do config files in bukkit b1.7.3?

onyx fjord
#

is collection faster than list for adding a ton of elements and then iterating over them?

sullen marlin
sullen marlin
#

Collection is an interface which list extends

onyx fjord
#

set* sorry

sullen marlin
#

LinkedList probably gonna be fastest add then iterate

onyx fjord
#

aight

#

it also preserves the order right

near mason
#

how to drop players inventory items when left?

sullen marlin
#

Yes

#

Playerquit event, iterate inventory, drop item, clear inventory

near mason
#

ok ty

lilac dagger
shadow night
lilac dagger
#

But it's a lot faster for contains and remove

sullen marlin
#

Idk

#

Didn’t it have the config api

#

I don’t remember it being rewritten

shadow night
#

this shits ancient

lilac dagger
#

Nah

#

Definitely this was a thing in 1.7

shadow night
#

beta 1.7.3?

#

or do you mean actual 1.7

lilac dagger
#

Beta?

shadow night
#

yes, you might open your eyes sir

lilac dagger
#

Actual 1.7

#

What are you doing on the beta?

shadow night
#

having fun

#

if you don't let me have fun, I take out my chainsaw ||and go cut some trees in my garden to relax a bit||

lilac dagger
#

Yo, you don't have to be this brutal

shadow night
#

lol

rough drift
#

I just use a LinkedHashSet

#

Works wonders for iter, add, remove & contains

lilac dagger
#

Yeah it's good but keep in mind that space is a thing so if possible use a simpler solution

#

Iteration is still slower than when iterating over an array

#

Which a normal arraylist and hashset is

#

But you're loosing the order for set

robust helm
#

Whats the new method for the deprecated ChatColor::getLastColor?

echo basalt
#

paper moment

lilac dagger
#

Getlastcolor isn't deprecated as far as i know

#

Why's paper deceiding what is deprecated or not?

ivory sleet
#

They deprecate stuff in favor of adventure

robust helm
#

ye ?whereami

lilac dagger
#

But they're supposed to keep compatibility with spigot

ivory sleet
#

Hence the deprecation

robust helm
#

damn i have to wait 10m before i can write anything in papermc discord

ivory sleet
#

Tho once they hard fork they are planning on yeeting those methods quite surely

twin venture
#

Hello again , i have problem with sql code ..
when i click on this and set a nick , it does change

but its not updating in mysql table :
it does not say profile is null , so its saving it , but it does not update the values .. \

echo basalt
#

wtf is that indentation

robust helm
#

wait spigot does not have adventure stuff?

#

No stupid components??

ivory sleet
#

And why images when we have bins

ivory sleet
#

Its called bungee chat

twin venture
ivory sleet
#

But spigot on the other side decided not to deprecate most of string methods

robust helm
#

my next plugins gonna be spigot for sure

#

i hate dealing with components

ivory sleet
#

Which makes it easy to deal with

#

And you have the static factory method that takes a var arg of them so you don’t have to deal with append and what not

echo basalt
#

I wonder if you can use asm to make a class that extends String

twin venture
#

the user exist in mysql , so idk why its not updating the values

echo basalt
#

9/10 chance it swallowed an exception

robust helm
echo basalt
#

I'm willing to do a crazy bet

#

and say it's probably because you added too many spaces to your query

robust helm
#

:)

ivory sleet
#

Tbh I don’t mind adventure or bungee chat for that part as long as there exists api to do the stuff I wanna do

echo basalt
#

I just add support for minimessage and write a bland config with no colors

#

customer can spend the time if they want

ivory sleet
#

Yea

twin venture
#

you were right

echo basalt
#

yeah now that I look at it

#

your query makes no fucking sense

twin venture
#

it update the data , when it exist in the table [save method]

echo basalt
#

yeah but look at the order

twin venture
#

what's wrong with it?

echo basalt
#

it's all mismatched

twin venture
#

oh

#

how i didn't see that

echo basalt
#

don't let AI do the work for you

echo saddle
#

ai bad

#

trust monke

twin venture
#

yeah its fixed thanks .

remote swallow
#

Im pretty sure that sql can be made way shorter

echo basalt
#

I wonder if UUID is a final class or if you can just extend it and override toString to cause sql injection

#

bit farfetched

lilac dagger
#

It's final

echo basalt
#

aw

sage dragon
#

How would I prevent the server from sending the player a specific recipe?

The UndiscoverRecipeEvent does not do this

sullen marlin
#

Whats the point of this

sage dragon
# sullen marlin Whats the point of this

Well, it's just for an easter egg and not actually crafting anything.

I thought it was best to leave the recognition of this "recipe" to the server.

I guess I have to completely handle it myself?

sullen marlin
#

It's only for the recipe book

lusty stream
#

anyone knows whats the easiest way to export custom variables for players into json to api link
so i wanna use the api.servername.net/player/
to get custom plugin variable values like economy, playtime etc..

echo saddle
#

lemme know if you need help with the discord

torn shuttle
#

sometimes I really question my sanity

tall dragon
#

i mean. ur not wrong

chrome ferry
#

what does it actually mean when my plugin is printing something in console called "Skipping block entity with id"

tall dragon
#

are you sure thats your plugin?

chrome ferry
#

Im not doing anything with entities, its an auctions plugin

#

yes

tall dragon
#

pretty sure thats just the server

chrome ferry
#

really confused as i dont warn anything in console

#

Im thinking it could be some sort of spawner possibly that appears in the gui. But why is it using my plugins' logger

tall dragon
#

i dont think its using ur logger

echo saddle
#

The TileEntity isn't matching something it knows?

tall dragon
#

merely that thread

quaint mantle
#

Hey can someone tell me how I can do the friend or foe custom pvp timer thing in my server? I want pvp to be on at random times for like 15 min or it can be on every other 15 minutes

chrome ferry
#

I wonder if its something todo with using im.getBlockState

echo saddle
#

which auctions plugin?

chrome ferry
#

ah yes it is

#

its something with im.getBlockState

echo saddle
#

monke hears a big sucking sound like the sound of a giant vacuum sucking him back in to development...

chrome ferry
#

(which i use to grab items from a container so they can preview it)

#

Does anyone know how i can prevent it from being logged?

echo saddle
#

not really, me and vacuums have always not got along

chrome ferry
#

are u ok

echo saddle
#

i have no idea what TileEntity.java does

chrome ferry
#

CraftBlockStates line 190

#

TileEntity.a

#

:kek

#

idk its an nms thing

echo saddle
#

nms = evil don't you know?

chrome ferry
#

yes

remote swallow
#

nms is only a bit evil

echo saddle
#

ok

chrome ferry
#

obviously im not touching it

#

craftbukkit is

#

bc it needs to :kek

echo saddle
#

i am not one to criticize tho

#

soz, i just don't have enough of a bigger picture to be of help

#

like what is actually trying to be accomplished

#

usually the issue is the approach, not the method

#

at least from experience thats what everyone tells me before i use NMS

chrome ferry
#

well like i said, im not using nms

#

bsm.getBlockState() is actually causing this

#

which is via the bukkit api

quaint mantle
#

Do I have to use Maven with NMS?

remote swallow
#

no

#

but i would recommened it

hazy parrot
#

Official stuff uses maven

#

So it's surely easier

quaint mantle
#

Well alright

sullen marlin
undone axleBOT
chrome ferry
#

or if ur using gradle

#

u can always use pa**rweight-test-plugin

chrome ferry
#

either way i have dont have much information either, im not the server owner just the plugin owner

tall dragon
#

yea it might be caused by something specific on that server

quaint mantle
#

Why do people here hate Paper?

torn shuttle
#

why do you assume people here hate paper

tall dragon
#

we dont

quaint mantle
#

Ah my bad then

chrome ferry
tall dragon
#

this is just not the appropiate place for support for paper

quaint mantle
#

Yeah

echo saddle
#

what plugin and is it reproduceable?

chrome ferry
#

getting more information from the user, i've added a debug lol

#

not fair to report something i dont know much info abt

torn shuttle
chrome ferry
#

so many people report bugs to me

#

and its the stupidest things

#

"WhY is ur warp plugin charging people $077 for teleporting to a warp"

#

bro, in ur config u have 77 at the end

#

💀

torn shuttle
chrome ferry
#

i mean yeah fair enough lol there are some silly people

#

who asks "does ur plugin support 1.8"

#

bro it says on the spigot page

#

"what does the configuration file look like?"

silver robin
#

how to break blocks as a player? for example, with a custom pickaxe which breaks multiple blocks at once, how should i create the blockbreakevent and pass it to other plugins, for those other blocks ?

chrome ferry
chrome ferry
#

BlockBreakEvent bbe = new BlockBreakEvent(PARAMS);
Bukkit.getPluginManger().callEvent(bbe);

tall dragon
#

depending on how many blocks that might not be too performant though 😄

chrome ferry
#

^ yes

#

but u cannot parse multiple blocks in that event either

remote swallow
#

i think

#

might be player.breakBlock

chrome ferry
remote swallow
#

it was player.breakBlock lol

chrome ferry
#

oh now thats neat

#

that must be recent

#

nvm its not

silver robin
#

player.breakBlock seems to be too new (I don't have it in 1.16.5 lmao) but the callEvent is enough since it's up to 9 blocks and lets me associate the player with those blocks

chrome ferry
#

its been there since 1.17.1, yeah it is

silver robin
#

i mean 8

#

yeah 3x3

remote swallow
#

dont wanna double call an event

silver robin
#

^^

#

server already calls the first one anyway

halcyon hemlock
#

How can I create a custom path for the EntityEnderDragon? (1.17.1 nms)

#

Could someone help?

half furnace
#

Hi guys, want to improve my codes practices in java for plugins minecraft 1.8, somebody help ? Send me a tips, tutorials etc...

undone axleBOT
quaint mantle
#

Hey guys, I'm spawning a custom entity with NMS, but the server crashes as soon as I spawn it

#

I set it to spawn when a player joins

smoky oak
#

?whereami

quaint mantle
#

Oh shoot

smoky oak
#

try running it on spigot

#

if it still crashes, its not a purpur issue

quaint mantle
#

Alright

quaint mantle
smoky oak
#

all thats in this log is the server yelling there's no server.properties file

#

you might want to post the code that spawns the entity

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

the spawn method is in MinecraftRigidbody. It basically calls level.spawnFreshEntity(this)

smoky oak
#

nothing obvious jumps out to me there

#

have you tried setting up a debugger?

robust helm
#

How to use a custom library with gradle? I got compileOnly files('libs/ChiccenAPI-0.1-SNAPSHOT-dev.jar') in my gradle.build dependency section and get this error ``
Execution failed for task ':compileKotlin'.

Could not resolve all files for configuration ':detachedConfiguration1'.
Failed to transform ChiccenAPI-0.1-SNAPSHOT-dev.jar to match attributes {artifactType=classpath-entry-snapshot, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
Execution failed for ClasspathEntrySnapshotTransform: C:\Users\Kento\Desktop\ChiccenNetworkPlugins\ChatAndTablistStyling\libs\ChiccenAPI-0.1-SNAPSHOT-dev.jar.
Check failed.

remote swallow
#

mvn install it if you want to do it properly

#

or gradle publish with the maven-publish plugin for gradle projects

quaint mantle
smoky oak
shadow night
#

Why is your org "org.example" and you are using paper it seems

topaz panther
quaint mantle
#

blocks section does not exist.

robust helm
#

ur on spigot discord

valid beacon
#

Hi

#

Guys

#

How make open gui Here bind Q Without holding an object in your hand

chrome beacon
#

You can't

robust helm
#

custom texture pack with invisible item maybe

chrome beacon
#

Yeah you'd need to hide the item ^^

#

I believe you can use F or swap hand though

robust helm
#

that would still need an item, wouldnt it?

chrome beacon
#

Not sure

#

Do some testing on that

#

I don't have my pc atm

robust helm
#

I dont know what u r trying to achieve but maybe HandItemHeldEvent or whatever it is called could work

#

its called when a players changes slot

smoky oak
#

What are the conditions for rain to change into snow?

flint coyote
#

that's based on the biome

shadow night
#

Biome ig?

robust helm
#

isnt it also depending on snow? So if theres no snow it only snows at very high height but when theres a snow-layer it snows

near mason
#

how do i change the chests direction org.bukkit.material.Chest is deprecated

smoky oak
#

fuckin hell its also based on the temperature gradient in biomes

#

its a mix of biome, height, temperature, and of course if its currently 'rainy' weather

#

why don't we have a 'is it snowing' check lol

#

playerWeather is like 'sun, rain'

robust helm
#

and thunder???

smoky oak
#

nope

#

its just if its sun or downpouring anything

robust helm
#

oh theres World::isThundering

smoky oak
#

yea

#

i need to have a precise measure if it's snowing or not

#

like at a certain location

eternal oxide
#

check if the world hasStorm and the location biome

smoky oak
#

thats no very precise, especially considering how temperature maps and randomized snow heights are a thing

#

i dont need approx, i need exact

eternal oxide
#

snow/rain is by biome

#

doesn;t matter about height

smoky oak
#

thats not what the wiki says

eternal oxide
#

if it's World#isStorm() and you are in a biome which supports snow it will snow]

smoky oak
#

hm alright

eternal oxide
#

I've not looked since they added temperature

#

so you may need to check that too

robust helm
#

u could also use Snowable::isSnowy

eternal oxide
#

that will only tell if there is snow on the ground

robust helm
#

and if theres snow on the ground its most likely to snow

valid beacon
#

As I understand it, you can’t make a bind on the Q button if there is no object in your hand?

eternal oxide
#

unless its changed it won;t snow nor rain in desert biomes

valid beacon
#

Dont’ open gui*

valid beacon
#

That is, when you press the Q button, give the player a custom item and pick it up immediately after opening the menu?

robust helm
#

nope

#

u set an invisible item in the players hand all the time

smoky oak
#

sooo i cant see the biome, whats waiting for chunk mean

valid beacon
#

Will the same occupy 1 cell then?

robust helm
eternal oxide
smoky oak
#

nvmind had to toggle it twice

robust helm
#

what cell?

eternal oxide
#

it has to be hasStorm() still

valid beacon
#

Well, if the player constantly has an object in his hand, it will take 1st place

smoky oak
#

@eternal oxide u were wrong, it is random heights

valid beacon
#

Slots

robust helm
#

so no

eternal oxide
#

then it's now based on temperature not biome

robust helm
#

U will actively set the item in the players hand and remove it from everywhere else

valid beacon
#

Thank you

robust helm
#

np

smoky oak
#

where can i see temperatore?

smoky oak
#

ah i meant as a command

eternal oxide
#

that returns the temperature adjusted for height

valid beacon
#

Look at the private message

smoky oak
#

????? placing a block in the rain changes the rain to snow

#

wtf

eternal oxide
#

messes with temperature or height

#

if you break it does it go back to rain?

smoky oak
#

yea

#

also going higher makes the temperature lower

#

is snow just a threshold on temperature

eternal oxide
#

it should

#

yes

#

freezing = snow

smoky oak
#

hows freezing defined?

#

cuz it says its ~0.151 where it switches

eternal oxide
#

no clue but I'd assume zero

smoky oak
#

nah

eternal oxide
#

thats probably just a rounding issue. likely floors

smoky oak
#

why isnt this documented anywhere urgh

eternal oxide
#

I guess as it's fairly new (ish)

smoky oak
#

can i manipulate temperature?

eternal oxide
#

I doubt it

smoky oak
#

well not with the api

#

i can probably manually override it in the mca file but

#

not worth the hassle

eternal oxide
#

each biome has a base temperature level

#

then its adjusted for height

smoky oak
#

yea but that doesnt give me the number that's the threshold

#

man i really dont want to fish through nms to get that double

#

welp i found minecrafts minimum temperature

shadow night
#

well, time to write my own config thingy because 1.7.3 beta don't got it :(

mellow edge
#

can I control (with spigot) cow's direction, for example I give it the final location and it's ai will go to that loc.

lilac dagger
#

pathfinder is not in the spigot api

#

if i have time i might push request some changes to the api

shadow night
#

Why are events in bukkit b1.7.3 so confusing

wide coyote
#

im sorry what

shadow night
#

What's wrong?

wide coyote
#

why are you using 1.7.3

shadow night
#

Beta 1.7.3*

quiet ice
shadow night
#

It's like

quiet ice
#

Also isn't b1.7.3 still hMod days?

shadow night
#

You have listeners for certain stuff, like playerlisteners

#

And then you override the methods like onPlayerJoin, atleast that's what I guess it works like

quiet ice
#

Ah, so I guess they use a system comparable to minestom

#

Or at least the minestom I used a few years ago

upper hazel
#

the question, of course, is not related to the plugin, but related to the serialization of objects, how can they be transferred between the server and the client (java) if the package in which the object is located changes

tardy flame
#

Hey lads, how can you technically implement upgraded plants (with few levels - each time they get better). I know that block ageble have 7 "ages" but does that apply to all plants/crops? How does that work in the case of sugarcane? I thought about using onPlantGrow and skipping (setting higher level for each upgrade) levels, do you think that would work?

zealous snow
#

can someone help me with securing my server from bots/ddos? like can someone put some kind of attack to my server

lilac dagger
#

ddos is more difficult, i remember blocking the attackers manually

opaque scarab
#

!verify Cyrei

undone axleBOT
lilac dagger
#

as for bots, pretty sure there are ways

opaque scarab
#

!verify Pheonix33991

undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

tender shard
#

does anybody know how I can get the source of explosion in HangingBreakEvent? When I e.g. hit a end crystal, getRemover() returns the player instead of the crystal

muted dirge
#

how to findout if player is clicked on a clickable text component?

remote swallow
#

You add the click event to the componemt

muted dirge
tender shard
#

who else would have clicked it

muted dirge
#

but i dont know how to get a boolean or something

#

any thoughts?

tender shard
#

i don't understand the question in the first place

#

you can use whatever command you like for the clickevent

#

you have 100% control over which command is ran

muted dirge
remote swallow
#

You will be best to use click event component and player command pre process event

tender shard
#

why preprocess event? why not just a proper command executor

remote swallow
#

Doesnt need to be a real command if you use pre process

muted dirge
remote swallow
#

Bc it may be something that end user can abuse to gain unfair advantage

tender shard
#

no, you'd just include a secret in the command

muted dirge
tender shard
#

after all they could also just run your arbitrary command if you don't properly register the command

muted dirge
#

then after he clicked turning the boolean true

muted dirge
#

@remote swallowits ok to use a hashmap?

remote swallow
#

Yes

#

Or even a set and just chexk if the uuid is in it

muted dirge
tender shard
#

I'd use a properly registered command with secrets, like this

public class MyCustomCommand implements CommandExecutor {
    
    private final Map<UUID, Function<CommandSender, Boolean>> commands = new HashMap<>();

    public ClickEvent registerCommand(Function<CommandSender, Boolean> command) {
        UUID secret = UUID.randomUUID();
        commands.put(secret, command);
        return new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/myplugincommand " + secret.toString());
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(args.length != 1) return true;
        String secret = args[0];
        UUID uuid = UUID.fromString(secret);
        Function<CommandSender, Boolean> storedCommand = commands.get(uuid);
        if(storedCommand == null) return true;
        commands.remove(uuid);
        return storedCommand.apply(sender);
    }
}

#

and then you can easily reuse it everytime

    public void doSth(Player player) {
        ComponentBuilder builder = new ComponentBuilder();
        builder.append("Click here to kill yourself").event(registerCommand(CommandSender -> {
            player.setHealth(0.0D);
            player.sendMessage("You killed yourself by clicking the message.");
            return true;
        }));
        player.spigot().sendMessage(builder.create());
    }
zealous snow
hazy parrot
#

You can't really block it yourself

zealous snow
lilac dagger
tender shard
#

EntityExplodeEvents gets called when the crystal explodes, but I want to cancel damage done to the hanging only

#

i specifically only want to avoid damage being done from certain explosions (e.g. end crystal) to hangings (e.g. item frames)

lilac dagger
#

i see

#

i'll look and tell you

opaque scarab
#

For some reason, the following code severely lags the server.

public class ImprovedChunkUtils {
    public static Chunk[] getNearChunks(Location loc, int radius) {
        ArrayList<Chunk> chunkList = new ArrayList<>();

        //gets the chunk coordinates of the location
        int centerX = Math.round(loc.getBlockX() / 16f);
        int centerZ = Math.round(loc.getBlockZ() / 16f);

        //iterates through the chunks in the specified radius boundary
        for (int x = centerX - radius; x <= (centerX + radius); x++) {
            for (int z = centerZ - radius; z <= (centerZ + radius); z++) {

                //adds the chunk to the arraylist if loaded
                if (loc.getWorld().isChunkLoaded(x,z)) {
                    Chunk currentChunk = loc.getWorld().getChunkAt(x * 16, z * 16);
                    chunkList.add(currentChunk);
                }

            }
        }

        //converts and returns the chunks as an array
        Chunk[] output = new Chunk[chunkList.size()];
        return chunkList.toArray(output);
    }
}

Does anyone know why, and how to fix this?

tender shard
lilac dagger
tender shard
#

so you load totally different chunks

lilac dagger
#

one of these

tender shard
shadow night
#

I like the old bukkit event system even more than the modern one now suddenly

opaque scarab
tender shard
#

if you want to use "normal" coordinates, use getChunkAt(Location)

shadow night
#

also, it's funny how there is Player#setGameMode but there is no implementation for it

#

also, this feels like I'm coding in like 2014 or something

tender shard
#

wdym? the implementation is in CraftPlayer

past jungle
#

Bro is bisexual

shadow night
#

this is an ancient version btw

#

I sometimes have the feeling I'm even more outdated than I could be but this seems to be the newest build for b1.7.3 lol

#

I wonder how I'd do NBT here lmfao

tender shard
shadow night
#

but I'm pretty sure in b1.7.3 you can't toggle gamemodes at all

#

lmao there isn't even chat in singleplayer

tender shard
#

creative mode was added in beta 1.8

shadow night
#

lmao

#

seriously?

#

there is no way

tender shard
#

that's what chatGPT tells me

shadow night
#

ideal version choice I made here

tender shard
shadow night
#

wait

#

wasn't beta 1.8 like one of the last betas?

tender shard
#

yes, beta 1.8 was the last

trim creek
shadow night
#

hmm, I gotta think

#

I could make my own impl of creative ig

trim creek
#

If you can work with that outdated API, sure you can.

shadow night
#

well, I guess I can

#

just idk about flying

trim creek
#

Now even the Scoreboard is getting an outdate stuff or something, because appearently, Objective o = board.registerNewObjective(); is deprecated.
(actually what is the new method of making Scoreboards??)

shadow night
#

I can make custom creative gui probably, but there are a lot of creative mode aspects

trim creek
#

b1.7.3 is extremely old.

shadow night
#

lmao what are these

tall dragon
#

hardcoded methods for every projectile

shadow night
#

sounds mojang-ey

tall dragon
#

notch go brrrrr

trim creek
#

Seems like this is not the right method anymore... 😮‍💨😮‍💨

shadow night
#

I wonder if these are still a thing

trim creek
#

Still? Not like were?

shadow night
#

player

shadow night
#

I like old bukkit gonna be honest

trim creek
#

Like Criteria.VALUE?

#

Seems like so

#

YAAAAA :D

trim creek
#

Mostly working with packets is not so fucking good for me

#

Use packets just to have tablist? Hell no

shadow night
#

tablist? Who needs that eww

trim creek
#

I like to just highlight the server name, and which server the player is on

#

and sometimes dc and web

#

that's all

#

nothing else

shadow night
#

lmao

trim creek
#

Yep. Very old.

#

Does that still exists today? XD

tall dragon
#

pretty sure thats ProjectileLaunchEvent these days

trim creek
#

It absolutely does

shadow night
#

yeah wanted to say the same

trim creek
#

And is not even deprecated

shadow night
#

lmao what

trim creek
eternal oxide
#

damn jitpack fails to build if a dependency has a newer version class file, even when it's set to provided 😦

tall dragon
#

wow, thats completely useless to exist

#

i love it!

trim creek
#

No error it seems like it works xD

shadow night
#

why

#

why is it a thing

#

who tf is gonna run b1.7.3 plugins on 1.20.1

trim creek
#

I don't know but I sure do wanna poke my eyes from it I guess

trim creek
#

XDDDD

#

(to actually run on 1.20.1 HEHEHEHEEE)

shadow night
#

this version is so old it has no death messages afaik

trim creek
#

I guess it does

#

But only a very few

#

Me footage play b1.8 hihi

shadow night
#

there isn't even a death message in multiplayer I think

#

there isn't even a death event lmao

#

rn I'm curious how modding works here

trim creek
# trim creek Me footage play b1.8 hihi

In this scenario, I have died due to a Zombie killing me, while I was AFK, leaving chat open (I was on a local server, so there was chat), and the creeper did... Find me... Never actually exploding XD

#

Once I closed chat I got the "U DEAD BITCH" screen. XD

shadow night
#

what was the mod thingy here

#

I forgor what it's called

trim creek
#

HMmmmm...

trim creek
#

but maybe it does exists on b1.7.3 who knows?

tall dragon
#

ru running windows 8 or something?

shadow night
shadow night
tall dragon
#

i dont know been so long

trim creek
shadow night
#

looks more like something between vista and seven

trim creek
#

The square screen tells everything

#

I have been using square screens for 10 years bruh

tall dragon
#

hahaha

#

yea i remember having a square screen

#

like 10 years ago

trim creek
#

My current 16:9 monitor is the first 16:9 monitor I have xd

#

AND I AM USING COMPUTERS EVER SINCE I AM 5 XDDD

#

or 6

#

idk

#

xd

shadow night
#

square screens are pretty funs

#

yk, iPads kinda look 3:4-ey

stuck flax
#

Can you modify what commands a player can see?

tender shard
#

PlayerCommandSendEvent

trim creek
#

Yup

tender shard
#

or, much easier - just don't give players perms for commands they shall not see

trim creek
#

So PlayerCommandSendEvent is better.

stuck flax
#

Thanks

#

Thought I'd have to do smth w packets

trim creek
#
public void onEvent(PlayerCommandSendEvent e) {
  e.getCommands().clear(); // I usually clear
  e.getCommands().add("command"); // This should be a valid command. You can also check for a specific permission, so that only players with permission yourplugin.yourperms should see specific commands. See below
  //if (e.getPlayer().hasPermission("plugin.vipcommand")) {
  //  e.getCommands().add("vip command");
  //}
}

This should work.

stuck flax
#

is it safe to modify the collection async?

trim creek
#

What do you mean? Making an ArrayList to add the commands? Non-sense I guess, and I never succeded.

stuck flax
#

Going through each command and removing it if the player doesn't have the right permissions

trim creek
#

I mean if there is a .remove(""); option, you probably can remove all commands you don't want your players to see, but it's just better to clear all the commands, then with assigned permissions, let them see all commands they shall see (as like the example I sent above)

stuck flax
#

Alright thanks

trim creek
#

yw

glass mauve
#

is ConfigurationSection#getKeys ordered?

#

so for example:

section:
  first:
    field: "Hi"
  second:
    field: "Hi"

would config.getConfigurationSection("section").getKeys(false)
give this set:
[first, second]

#

the docs say nothing about ordered/unordered

lilac dagger
#

the nodes are stored inside a hashmap

#

or wait

#

might be linked

half furnace
#

I need help to build a plugin in the best way possible, could you send me tutorials? OR give me tips?

lilac dagger
#

@glass mauve they're ordered

tribal quarry
remote swallow
serene sigil
#

hi, I have a question... is there a way to check the playercount of a server externally? because the player count data is very important and i really need to prevent it from being tampered with.

#

for example if i make a plugin that sends data to a specific socket when someone joined the server, you can modify it

#

i want to prevent that

lilac dagger
#

secure socket

serene sigil
#

how?

lilac dagger
half furnace
#

I want to make a tag plugin that places the tag in the list of players when the "tab" key is pressed, the following, when executed /setTag <tag name> <username> it puts it in the tab like this [TAGNAME] USERNAME

halcyon hemlock
quaint mantle
#

It just disconnects

serene sigil
#

nvm

#

i meant something else

#

i meant that if the Client is modifying the player count

#

not a third party

chilly hearth
#

Hmmm

#

Interesting

serene sigil
#

yea

lilac dagger
#

then it's up to you how you handle the code

#

just encapsulate the data

serene sigil
#

well, the server cant tell if a player just joined or the client did something sus

serene sigil
lilac dagger
#

like good code practice

serene sigil
#

but how does bstats do it?

#

cuz anyone can just fake the plugin usages

remote swallow
#

peope just dont

#

thats literally it

serene sigil
#

lol

#

yea but...

remote swallow
#

anyone can submit data for a plugin if they have the id

chilly hearth
#

E can't I change my username in spigot

serene sigil
#

but isnt there a mojang api for this?

quaint mantle
#

Is it possible to obtain a directional vector from an EulerAngle?

tribal quarry
#

you mean yaw and pitch to directional vector?

quaint mantle
#

No, I mean EulerAngle

worldly ingot
#

PES3_HmmCoffee An euler angle is just a vector if you think about it that way

quaint mantle
#

Like, I guess so, EulerAngle doesn't use yaw and pitch directly

worldly ingot
#

I'm not sure I understand

quaint mantle
#

Hey guys. I'm developing a plugin that makes use of the PhysX native bindings to try and make a physics plugin via block displays. Anyways, when I spawn one of these physics entities, the server just weirdly closes without any crash logs or anything.

worldly ingot
#

Oh...

#

EulerAngles use radians, yeah

quaint mantle
worldly ingot
#

If you want a pitch/yaw/roll vector all you have to do is convert it to degrees 😛

#

Math.toDegrees(radians)

quaint mantle
#

Would that allow me to converse EulerAngle to a directional Vector?

worldly ingot
#

Probably. It would represent the same value in 3D space

quaint mantle
#

Thanks

quaint mantle
#

So, like this?

 @NotNull
    private Vector getAngleVector(EulerAngle tempAngle) {
        double yawDegrees = tempAngle.getY();
        double pitchDegrees = tempAngle.getX();

        float yaw = (float) Math.toDegrees(yawDegrees);
        float pitch = (float) Math.toDegrees(pitchDegrees);

        Vector vector = new Vector();
        vector.setY(-Math.sin(Math.toRadians(pitch)));

        double xz = Math.cos(Math.toRadians(pitch));

        vector.setX(-xz * Math.sin(Math.toRadians(yaw)));
        vector.setZ(xz * Math.cos(Math.toRadians(yaw)));

        return vector;
    }
hazy parrot
#

??

lilac dagger
#

IntMath.pow is superior for ints

rocky badger
#

Hi there. I just started developing my own plugin(s). I am skilled with Java, but less so with plugin development. Is there a place where I can ask all questions on plugin development? Or can I just do that here?

half furnace
#

What this error ?

lilac dagger
remote swallow
rocky badger
#

org.Bukkit.ChatColor is depricated and I have no clue if I should fix this and how I would have to do it.

remote swallow
#

you are using paper api not spigot

rocky badger
#

Is that the reason?

remote swallow
#

paper deprecate string methods to promote using adventure components

rocky badger
#

I see

lilac dagger
#

paper doesn't care about spigot

#

😦

rocky badger
#

I might just change it to Spigot then, to make it more generic

remote swallow
#

spigot api is missing some stuff paper has but it works for more people and you get to publish plugins on spigot

rocky badger
#

Yeah, that's what I understand. However, I'm developing something personal, so I would be the only one with the issue XD

#

Now I have to figure out if I can refactor to a spigot plugin...

remote swallow
#

yeah you can

rocky badger
#

And how XD

remote swallow
#

just change the maven/gradle dep & repo and move to a plugin.yml if you use paper-plugin.yml

rocky badger
#

Ok, I'll see what I can do

remote swallow
#

?maven

undone axleBOT
half furnace
#

@remote swallow
@lilac dagger
my code

package legitey.legitey.handlers;

import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.event.Listener;

import java.net.http.WebSocket;
import java.util.Random;

public class LuckBlock implements Listener {
    @EventHandler
    public void onBlockBreak(BlockBreakEvent event) {
        if (event.getBlock().getType() == Material.STONE) { // Somente para blocos de pedra, você pode ajustar isso
            event.setDropItems(false); // Impede que os itens padrão sejam soltos

            // Lista de itens que podem ser soltos
            ItemStack[] possibleDrops = {
                    new ItemStack(Material.APPLE),
                    new ItemStack(Material.COAL),
                    new ItemStack(Material.IRON_INGOT),
                    // Adicione mais itens aqui
            };

            Random random = new Random();
            ItemStack droppedItem = possibleDrops[random.nextInt(possibleDrops.length)];

            event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation(), droppedItem);
            event.setDropItems(true);
        }
    }
}
remote swallow
#

do you have a pom.xml

slender elbow
#

you are running a 1.8 server, setDropItems did not exist in 1.8

half furnace
remote swallow
#

?paste it

undone axleBOT
rocky badger
remote swallow
rough ibex
#

but yes change your version

half furnace
#

how to change?

half furnace
#

?

remote swallow
lilac dagger
lilac dagger
#

this should work

half furnace
lilac dagger
#

but this will be my last message, i feel like i'm chat gpt

remote swallow
#

cat gpt

lilac dagger
#

you had this

half furnace
#

yeah

lilac dagger
#

so just cancel and set the block to air

half furnace
lilac dagger
#

yes

#

and set the block to air

half furnace
#

how to set ?

lilac dagger
#

event.getblock.settype material air

#

``
private static final Random RANDOM = new Random();
@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
Block block = event.getBlock();
if (block.getType() == Material.STONE) { // Somente para blocos de pedra, você pode ajustar isso
// Lista de itens que podem ser soltos
ItemStack[] possibleDrops = {
new ItemStack(Material.APPLE),
new ItemStack(Material.COAL),
new ItemStack(Material.IRON_INGOT),
// Adicione mais itens aqui
};

        ItemStack droppedItem = possibleDrops[RANDOM.nextInt(possibleDrops.length)];

        block.getWorld().dropItemNaturally(block.getLocation(), droppedItem);
        event.setCancelled(true);
        block.setType(Material.AIR);
    }
} ``
half furnace
#

oh, thanks

#

@lilac dagger why setCancelled and material.air ?

lilac dagger
#

because it'll cancel drops and remove the block

#

not sure if there's an alternative

remote swallow
#

block drop item event if it existed back then

half furnace
#

How do I drop any minecraft items? I want to be able to drop all items but in a single unit, how can I do that?

lilac dagger
#

use a loop

#

and remove the randomness

orchid trout
#

World#dropItem();

half furnace
#

use a loop to iterate the material?

orchid trout
#

you said you want to drop all items

lilac dagger
#

the itemstacks

#

possibleDrops

abstract sorrel
#

What would be the best way to store additional data for players and entities, i'm trying to make a custom rpg stats plugin similar to the way they do it on hypixel skyblock, with health, defense and mana etc.

lilac dagger
#

store in memory?

#

or both?

abstract sorrel
lilac dagger
#

there are 2 ways to store things as i know, in memory or storage

#

like a database

remote swallow
#

pdc

abstract sorrel
#

i'm going to use yml configs to store data

lilac dagger
#

pdc,mysql etc

abstract sorrel
#

and it will load data from config into memory on startup and load data from memory into storage on shutdown

#

what im more trying to figure out is what the class structure should be like

lilac dagger
#

hold your data into objects and store the objects into a hashmap with uuid as key and their object as value

abstract sorrel
#

and those objects implement configurationserializable, so i can store them in config?

lilac dagger
#

same could be said about your yml storage, use key as uuid and value as the values in the yml

#

it's up to you what system you use

#

if you use bukkit then yeah

orchid trout
#

why not set of data and data contains uuid

abstract sorrel
#

so is that the best way to do it then

lilac dagger
#

hashmap and path finding would be easier if uuid is the key

abstract sorrel
#

ok i'll try to code that you might see me back here in a bit if it doesn't work lol

tranquil dome
#

I have a custom entity with NMS for 1_8_R3. Inside the entity I have a spawn method, which spawns the entity and then also sets some NBT tags. See code:

    public void spawn(Location location) {
        ((CraftWorld) location.getWorld()).getHandle().addEntity((this), CreatureSpawnEvent.SpawnReason.CUSTOM);

        setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
        setAI(false);
        //setInvisible(true);
        setSilent(true);
        setAsleep(true);
        setInvulnerable(true);

        System.out.println(this.getNBTTag());
    }

When printing out the NBT tag at the end, it prints out null. In the methods setAI(false) and setInvulnerable(true) I run the following method:

    private void setNBTCompoundTag(String tag, boolean flag) {
        NBTTagCompound tagCompound = getNBTTag(); // Tag is always null

        if (tagCompound == null) {
            tagCompound = new NBTTagCompound();
        }

        System.out.println(tag + ": " + flag); // {} (empty NTBTag)

        c(tagCompound);
        System.out.println(tag + ": " + flag); // NTBTag without the tag set, but does show everything else
        tagCompound.setInt(tag, flag ? 1 : 0);
        System.out.println(tag + ": " + flag); // NTBTag with the tag set.
        f(tagCompound);
    }

In here I get the NBTTag (which is null every time) and it creates a new tag in case it does not exist. It then sets the specific tag to 1 or 0 depending on the flag. This works, because if I print the tag there, it shows that NoAI is 1 and that Invulnerable is also 1. I assume for some reason the f() method does not update the tag for the entity.

These are the other methods mentioned:

    public void setAI(boolean hasAI) {
        setNBTCompoundTag("NoAi", !hasAI);
    }

    public void setInvulnerable(boolean isInvulnerable) {
        setNBTCompoundTag("Invulnerable", isInvulnerable);
    }
eternal oxide
#

tracking range?

#

display blocks have no AI

#

you mean the ViewRange

sullen marlin
#

There's literally an option "display" in spigot.yml for tracking range also

eternal oxide
#

?notworking in that case

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.

tender shard
#

that option is weird though. I set the tracking range to 128 for displays, yet it's still visible at ~155 blocks

#

if one does not change the view range on the entity object itself, it disappears at 80 blocks, even though it's set to 128 in spigot.yml

tranquil dome
quaint mantle
#

Is there a util built into spigot to raytrace from an eye to their target loc?

tender shard
#

World#rayTrace(....). use the eye location as starting point and use a predicate to filter out the entity that you're raytracing for

tranquil dome
#

So it was just a combination of two simple mistakes which made me think something was wrong with the nbttags

sullen marlin
#

There's an API method for noai

tender shard
#

not on their 8 year old version 😄

cursive kite
#

Hello - I am trying to debug some code but my console is only printing [15:07:56 WARN]: java.lang.NullPointerException

#

How do I figure out which class it is in

opal juniper
#

by reading the next lines

opaque scarab
cursive kite
#

That is all it prints

tame coral
#

Check the log file, it might have more info

tender shard
#

looks like you somewhere do getLogger().warning(exception.getMessage())

cursive kite
#

I wish, nope I am not logging anything

tender shard
#

are you sure it's not from any other plugin?

#

or maybe it happens from within a task / runnable, in that case wrap the whole thing into try/catch and print out the exception in the catch thing

cursive kite
#
            FactionValueCounter.startBlockCountingTask();
            }catch(Exception e) {
                e.printStackTrace();
            }```
#

This is printing the same thing

tender shard
#

what is startBlockCountaingTask() ?

weak meteor
#

i got no ideas for pl

#

someone got smth for me?

cursive kite
#

It use to start my timer but i changed it to just run the method itself so i could attach to a command and spam

#

I just want it to tell me where the error is

glossy venture
#

it should

#

can you debug with print statements

cursive kite
#

It seems to be an issue within a chunk

#

I am counting blocks within claimed chunks for claim values

#

Chunk x8 z14 will null sometimes

#

but not everytime

#

        FactionValue value = new FactionValue();
        for (int x = 0; x < 16; x++) {
            for (int y = 0; y < 256; y++) {
                for (int z = 0; z < 16; z++) {
                    Block block = chunk.getBlock(x, y, z);
                    Material material = block.getState().getType();

                    if(material == Material.MOB_SPAWNER) {
                        CreatureSpawner spawner = (CreatureSpawner)block.getState();
                        EntityType type = spawner.getSpawnedType();
                        if(entityTypes.containsKey(type)) {
                            value.incrementSpawner(type);
                        }
                    }

                }
            }
        }

        return value;
    }```
#

This seems to be making it mad

#

But I just want it to tell me where the line is so i can debug it

#

But i need to know where lol

glossy venture
#

if ur not catching the error anywhere ur server impl is weird, pretty sure bukkit should print the stack trace if an error occurs in a scheduler task

opal juniper
#

well you haven’t shown us the but you log it

cursive kite
#

Thats my log.latest

tender shard
#

where is that weird "start done" thing coming from

cursive kite
#

That is my debugging lol

#

It is counting the spawns in each claim

#

Chunk coords x.z

opal juniper
#

can you show us that class that logs that

cursive kite
tender shard
#

why the hell are you looping over all possible blocks (and without respecting world getMinHeight and getMaxHeight)

#

instead of simply getting all tile entities in that chunk

sterile token
#

What can cause git issues while trying to create a branch? I just run the git init and then git branch <name>

tender shard
#

what is the error msg?

sterile token
#

And i didnt even touch the repo i have just create it

cursive kite
#

I plan to make it also check for certain blocks

tender shard
cursive kite
#

Idk what else to do :p

sterile token
#

I mean i doesnt even allow me to create branch, thats the most weird thing

tender shard
sterile token
#

I just created a new git project by git init and then run "git branch <name>" to create the branch. And then that error

tender shard
#

you first have to commit sth

sterile token
#

oh is that the cause

#

lmao im so dumb today haha

tender shard
#

as mentioned you can also just use the regular way: git checkout -b new-branch-name

#

then you don't have to commit anything first

kind hatch
#

TIL that the local difficulty you find in the F3 menu was just an approximation done on the client. Not information it received from the server.

#

As to why the server doesn't send that information to the client, that's still a mystery. However, recent snapshots have turned the value into question marks to better reflect it.

cursive kite
#

I checked thru my older logs and found 19.08 16:15:42 [Server] [INFO] Caused by: java.lang.NullPointerException 19.08 16:15:42 [Server] [INFO] at org.bukkit.craftbukkit.v1_8_R3.block.CraftCreatureSpawner.getSpawnedType(CraftCreatureSpawner.java:32) 19.08 16:15:42 [Server] [INFO] at src.factions.faction.FactionValueCounter.countBlocksInChunk(FactionValueCounter.java:75) 19.08 16:15:42 [Server] [INFO] at src.factions.faction.FactionValueCounter.countBlocksInFactionClaims(FactionValueCounter.java:118) 19.08 16:15:42 [Server] [INFO] at src.factions.faction.FactionValueCounter.updateAllBlockCounts(FactionValueCounter.java:127) 19.08 16:15:42 [Server] [INFO] at src.factions.faction.FactionValueCounter$1.run(FactionValueCounter.java:137) 19.08 16:15:42 [Server] [INFO] at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71) 19.08 16:15:42 [Server] [INFO] at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)

#

With all my debugging ive moved half the lines around

#

So I can no longer pin point it

#

It seems to happen when player is offline

lilac zenith
#

Does someone know how could I code (also using a texture pack), a progress bar with a text and a number above it? But I don't mean a bossbar, I mean a custom progress bar below the bossbar. Something like this:

#

The progress bar would be dynamic and the "NAME" would be: 'Zombie: 70 HP' for example

cursive kite
#

I got "Caused by: java.lang.IllegalStateException: Asynchronous entity world add!"

young knoll
#

Don’t add entities to the world async

lilac dagger
#

Usually you don't want to use async

cursive kite
#

I was counting the blocks using async so it wouldnt locked up the main thread while counting all the blocks

lilac dagger
#

I can tell you that 99% of your code can be ran in sync

cursive kite
#

Ill try it on sync

lilac dagger
#

Ah

cursive kite
#

The thing is it is counting all players claims and checking for certain blocks

#

Should I keep it sync?

kind hatch
#

Reading blocks should be fine to do async. Modifications need to be done sync though.

slender elbow
#

"it's just reading" doesn't mean it's thread safe

#

take a chunk snapshot sync and analyse it async

cursive kite
#
        new BukkitRunnable() {
             @SuppressWarnings("deprecation")
            @Override
             public void run() {
                 for (int x = 0; x < 16; x++) {
                     for (int y = 0; y < 256; y++) {
                         for (int z = 0; z < 16; z++) {
                             int blockTypeId = snapshot.getBlockTypeId(x, y, z);
                             Material material = Material.getMaterial(blockTypeId);
                             // Perform your analysis based on the material
                         }
                     }
                 }
             }
        }.runTaskAsynchronously(Factions.getPlugin());
    }```
#

Like this?

quaint mantle
#

chat gpt!?

cursive kite
#

I wanted to see if it would help lol

#

It has not

quaint mantle
#

you could use a CompletableFuture

#

and supplyAsync to supply info and thenAccept to do changes or whatever u want on main thread

slender elbow
#

uh i mean, half the methods there don't exist, getBlockType already returns a Material, and chunks can go lower than 0 and higher than 256, but you should probably constraint the search within your claim boundaries, other than that, you got the spirit lol

cursive kite
#

Unfortunately I am using 1.8 for this plugin

quaint mantle
#

does 1.8 even have chunk snapshots

kind hatch
#

Doubt it

quaint mantle
#

ye

#

i think minehq had to add it themsleves

#

from what I remember

#

in mSpigot

kind hatch
#

One of these days, @Since tags will be added to the docs.
I'll do it myself if I have to.

worldly ingot
#

I genuinely don't think they have any benefit

#

We only support the latest version anyways so

remote swallow
#

its more of a @addedIn since

#

mainly used on javadicks

young knoll
#

Use latest

#

I guarantee it has all methods

tender shard
young knoll
#

Egg

kind hatch
# worldly ingot I genuinely don't think they have any benefit

Can you explain why? I don't understand how better documentation is a bad thing. How does adding those tags advocate supporting older versions?

If one of the pillars of spigot is retaining backwards compatibility, to the greatest extent it reasonably can, then how does adding these tags harm that idea in any way? Java itself has these tags and uses them in their documentation. If anything it's documenting the evolution of the api.

sullen marlin
#

You could probably script it

#

Might be the most sensible way

young knoll
#

Md gave the go ahead

#

Roll out

remote swallow
#

AUTODEVS

#

ROLL OUT