#help-development

1 messages · Page 334 of 1

quasi flint
#

send 3 packets ig XD

earnest forum
#

rotate can mean instantly go to the end

vital sandal
#

it is all what it said .....

earnest forum
#

not very descriptive

vital sandal
eternal oxide
#

if the location hasn't changed much the client extrapolates movement

hushed spindle
#

does anyone happen to know where a server's recipes are stored? or does it actually alter the jar when recipes are removed

quasi flint
echo basalt
#

this guy wants interpolation

earnest forum
#

is there a method like that

#

in java or spigot

echo basalt
#

just look into linear interpolation

#

basically

#

progress = number/total

#

number = total * progress

#

so like

#

let's say you want to go from 90 to 180

quasi flint
echo basalt
#

in 2 seconds

#

2 seconds = 40 ticks

quasi flint
#

I think Client does some Interpolation alread

echo basalt
#

so each tick, you do increment = (end - start) / totalTicks

vital sandal
quasi flint
#

It doesnt Work

echo basalt
vital sandal
#

and that is not smooth either

quasi flint
#

You see that the rotate head Packet doesnt work

#

Because the console yells at you to Teleport the entity

echo basalt
#

You need to use a scheduler and all

vital sandal
#

wep it take too long to rotate

quasi flint
#

I dont See the Problem yet

#

You want it to be smooth

#

But Not too slow

echo basalt
#

you want it to be smooth, so use a scheduler

#

with a decent speed

quasi flint
#

^

echo basalt
#

I got a whole system for that

#

gotta record tho

vital sandal
#

well that is what i avoided

quasi flint
#

?

#

Well you tried

#

But it obviously doesnt work

#

So that is the most elegant solution to your problem

echo basalt
#

you gotta actually put effort

humble tulip
echo basalt
#

Distance means like

#

it does 5 degrees per tick, for example

humble tulip
#

Does the timed one take a distance and the distance one take a time?

echo basalt
#

timed is just like

#

20 tick constant between locations

humble tulip
#

You should make a constructor that takes anglePerTick for distance and an angle and totalTime for time

#

Just a suggestion

#

But that's a really good name

#

I'm bad at naming stuff

echo basalt
#

if the footage is laggy blame my integrated gpu

remote swallow
#

smh

#

why are you using igpu

#

why are you using fawe

vital sandal
# echo basalt this is timed

not that smooth compared to this https://youtu.be/qBOpTJtWogI?t=877

Learn how to create an NPC! The super-easy way using packets and NMS!

Patreon:
https://www.patreon.com/codedred

Donate to me :)
https://www.paypal.me/CGMax

Join my discord:
https://discord.gg/zMzXSgk

------ Links ------

Download Eclipse: https://www.eclipse.org/downloads/packages/release/2019-03/r/eclipse-ide-java-developers

Download Spig...

▶ Play video
echo basalt
#

that's because I didn't put in the effort

worn tundra
#

lmao

echo basalt
#

at least the code looks minimally simple

remote swallow
#

hippity hoppity im putting a copyright on that property

echo basalt
#

idk it's just something I made in like 2 hours

#

50 dolla

#

I also made it look at the player's feet instead of eyes

vital sandal
#

i am stimulate the gun shifting or shaking (no idea what that called)

#

it should be less than 1 tick for it :l

buoyant viper
#

recoil?

vital sandal
vital sandal
dire marsh
#

why do you want to teleport the entity

#

what is the problem you are facing

#

teleports don't interpolate

#

rotation + headlook packet is used for changing yaw and pitch

dry yacht
#

Wow, what a discussion! xD Maybe I'm missing something, but I don't get what's so complicated about making the entity rotate smoothly.

humble tulip
#

They're using teleport ig

dry yacht
#

Why tho? I don't see what's keeping one from using the PacketPlayOutEntityHeadRotation and call it a day.

remote swallow
#

no pitch

dry yacht
#

Not true?

remote swallow
#

i dont see a 2nd byte or int anywhere on here

echo basalt
#

headrotation is locked to yaw

#

it's stoopid

dry yacht
#

That's something stupid I wrote like a year ago, and it was smooth as butter.

dry yacht
#

I already forgot, haha

#

But none the less, I still don't understand why you'd calculate the interpolation of rotations serverside. That just sounds kind of wrong.

humble tulip
#

Is the first packet even needed?

dry yacht
#

Not sure, try it

humble tulip
#

Oh wait the head and body can rotate independently

dry yacht
#

I guess, didn't work with it for a while

humble tulip
#

The body doesn't have pitch tho

#

That's stupid

#

Mojang does whatever they want ig

dry yacht
#

It feels to me like they kinda screwed the pitch up there, yes, haha

humble tulip
#

Sending head pitch with body rotation packet

#

Actually i feel like the first packet isn't needed

#

But i cba to test since i dont need this

dry yacht
dry yacht
dry yacht
humble tulip
#

Wow

dry yacht
#

But I guess that this is still too slow for @vital sandal, xD. No idea if you could make that happen faster by cranking out a ton of pre-calculated teleportation packets. Also not sure if it would actually be worth avoiding the minor delay you're having with the proper method.

haughty granite
#

do you have a best practice tutorial for versioning on github with a spigot plugin? I confess I don't know what files to send and what files to ignore

remote swallow
#

send the src folder, and any build files

#

eg pom.xml

vivid skiff
#

Is normal that even if i cancel the block break event only if the broken block is a Large Fern or a small one, some times the block breaks?

humble tulip
#

Are you spam breaking it?

vivid skiff
#

Yes, with the hand

humble tulip
#

It's a desync thing

#

Try to place a block where the fren should be

#

Fern

vivid skiff
#

Im doing that i done that when the large fern i breaken by a player it replants a small one that grows after 5s, but some times the small one is no more replanted

#

I tried to add a delay to but nothing changes

haughty granite
remote swallow
#

idk what the default is

next plume
#

This is what I use for .gitignore:

# Eclipse
.classpath
.project
.settings/

# Intellij
.idea/
*.iml
*.iws

# Mac
.DS_Store

# Maven
log/
target/
dependency-reduced-pom.xml
#

If you do git status before doing commits, it will show you any modified/untracked files, and you can add them to .gitignore if you don't want them in your repository.

haughty granite
#

yes I am familiar with github on jetbrains

next plume
#

Looks like most of mine might be covered in that default file.

quaint mantle
#

how do i get a player with their UUID?

#

in string form though.

remote swallow
#

Bukkit.getPlayer(UUID.fromString(string))

rotund ravine
#

If they’re online^

tardy delta
#

getOfflinePlayer

#

or be happy with null

humble tulip
#

Well yeah

keen charm
#

Hey there!

#

When I break bamboo, it gets detected as AIR.

#

How can I solve it?

tardy delta
#

show code

keen charm
# tardy delta show code
package dev.eymen.events;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;

public class BlockBreak implements Listener {
    @EventHandler
    public void event(BlockBreakEvent e) {
        e.getPlayer().sendMessage(e.getBlock().getType().name());
    }
}
#

Update: Both bamboo and sweet berries gets detected as AIR.

tardy delta
#

lol

keen charm
chrome beacon
keen charm
#

💀

#

My brain

brittle loom
#

Hello, I'm having a trouble finding a way to tell if a packet is getting shown or not. Here's what I've tested, although they all return the same values even when destroying the entity packet. If anyone can help, it would be much appreciated. ```@Override
public boolean isShown() {
System.out.println("Valid: " + this.entityArmorStand.valid);
System.out.println("Removed: " + this.entityArmorStand.isRemoved());
System.out.println("is Dead or dying:" + this.entityArmorStand.isDeadOrDying());
System.out.println("isNull: " + (this.entityArmorStand == null));
System.out.println("Bukkit: " + (entityArmorStand.getBukkitEntity() != null));
System.out.println("Bukkit valid: " + (entityArmorStand.getBukkitEntity().isValid()));

    return this.entityArmorStand.getBukkitEntity().isValid();
}```Here's the method I'm using to destroy the entity packet ```Remain.sendPacket(player, new ClientboundRemoveEntitiesPacket(armorStand.getId()));```
frank kettle
#

for some reason when i try to make holograms with armorstands and place them really close to blocks below they get like black words(as if they are inside the block and so that changes), is there a way to bypass this? like if I use packets will this be fixed?

hasty prawn
hasty prawn
tender shard
#

what even is a marker lol

#

i mean erm

#

how does one create one in vanilla

eternal night
#

you can just summon it

#

its a normal entity type

hasty prawn
#

^

tender shard
#

oh ok

#

i thought maybe you could somehow craft them or sth idk

hasty prawn
#

nop

frank kettle
eternal night
#

concerning that the server does not even send them to clients that would be weird xD

#

wait

tender shard
#

huh

eternal night
#

that is nor a marker

#

they are talking about a marker armor stand

#

not the marker entity

#

two different things

tender shard
#

what the heck is a marker entity

#

lol

hasty prawn
#

Yeah what is that LOL

eternal night
#

as I said

#

an entity

hasty prawn
#

Yeah but what does it do

eternal night
#

it is purely there for map makers

#

to mark locations etc

#

its cheaper than an armor stand tho

hasty prawn
#

ah

eternal night
#

not synced to the client

#

no tick logic

#

no gravity

#

etc

hasty prawn
#

ultra stupid armor stand then

eternal night
#

pretty much, but kinda nice over armor stands unless you need visuals

frank kettle
#

does the entire code inside onDisable run? or should I stop writting stuff in it?

#

🤔

tardy delta
#

is using an interface as an utils class generally considered good practice if that class is stateless?

remote swallow
#

all the code that can run will run

frank kettle
#

what does "all the code that can run" mean

#

so does it influenciate the time the server takes to close? (like, does it go through all the code no matter what) or does it stop midway if server closes too quick? 🤔

remote swallow
#

some stuff cant run in the time the plugin has to disable

#

most stuff will run, but there is stuff like world creation etc that wont have enough time to run

tardy delta
#

it blocks the server from closing

chrome beacon
frank kettle
#

oh okay

#

im using it to save data from the plugin

#

and force players to quit and save their data since playerquitevent doesnt get called when they get force kicked on close

wary mountain
#

hi, i tried making a plugin using maven and i dont know why, but it cant find my plugin.yml, i put it under source folder as usual

chrome beacon
remote swallow
#

^^

wary mountain
#

o

wary mountain
chrome beacon
#

What's the error? And how are you building the plugin?

wary mountain
#

oh i dont have image access

#

thats annoying

remote swallow
#

?img

undone axleBOT
desert loom
wary mountain
#

thats my project setup, and the error is just the standard plugin yml not found

remote swallow
#

how do you build

wary mountain
#

intellij

remote swallow
#

how

#

which button

wary mountain
#

artifacts

remote swallow
#

which artifact

chrome beacon
#

So you're not using maven

#

ok

wary mountain
chrome beacon
#

Time to use maven to build your plugin

remote swallow
#

which artifact do you press to build

chrome beacon
#

See the maven tab on the right side

wary mountain
#

yea

chrome beacon
#

Open it and find package

#

Then double click that

#

It should then use maven to build your plugin

wary mountain
#

oh yea

#

[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

thats a bit concerning though

tardy delta
#

warnings dont matter

patent fox
#

how can i show a player his hands while he is invisible? using packets

wary mountain
remote swallow
#

show your pom

wary mountain
#

thats not really spigot tho

remote swallow
#

?paste

undone axleBOT
chrome beacon
wary mountain
chrome beacon
#

You have two options to load it

#

The first one is shading it with the maven shade plugin

#

The second only works for 1.17.1+ but it's the libraries feature

wary mountain
#

which ones easier to understand

#

the plugin is 1.18+ so im fine

chrome beacon
#
libraries:
  - "net.dv8tion:JDA:5.0.0-beta.3"

^^ this is the libraries feature

#

Add it to your plugin.yml

#

also update JDA in your pom so you're using the same version

chrome beacon
# patent fox ?

You need to make the player only invisible to others. You can intercept the potion effect packet to achieve that

wary mountain
#

nice it works, thanks

tender shard
#

there's both hidePlayer and hideEntity

chrome beacon
#

I just assumed they wanted the potion effect

tender shard
#

oh

#

maybe

wary harness
#

it this something to worry about

#
WARNING: Illegal reflective access by retrofit2.Platform (file:/C:/Users/krist/.m2/repository/com/squareup/retrofit2/retrofit/2.9.0/retrofit-2.9.0.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of retrofit2.Platform
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
wary mountain
#

or can the discord side be separate

vast raven
#

PotionEffectType doesn't have a .valueOf() method, any clues?

hazy parrot
#

In first, it's all in same jar

quiet ice
#

Otherwise - yes - there is something to worry about

#

oh, the comes from an internal library...

#

Yeah - then it is pretty much a coinflip whether it is an issue or not

chrome beacon
#

?conventions

worldly verge
#

anyone know a way to implement the text here?

tardy delta
#

wha

worldly verge
#

srry

#

I was gonna send an image

tardy delta
#

?img

undone axleBOT
worldly verge
#

tnxc

remote swallow
#

thats an action bar

worldly verge
#

mmm

tardy delta
#

Player#Spigot#sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("text here"))

#

?scheduling to keep it from sending cuz it dissapears after a few ticks

undone axleBOT
tardy delta
#

?scheduling

undone axleBOT
tardy delta
#

bruh

quaint mantle
tardy delta
#

bruh

quaint mantle
#

You just pass a String and then you choose the naming convention you would like to convert.

tardy delta
#

so basically for noobs that dont know java conventions and thus dont know how to use that library either?

quaint mantle
#

No, I mean people who are actually integrating stuff to their IDE

tardy delta
#

if you have a bit of common sense, dont you apply the right conventions yourself already?

tender shard
#

wtf is screaming kebab case lmao

remote swallow
#

whats kebab case in the first place

quaint mantle
#

With what I just provided, you can name your class “hELLOwORLD” and it would apply the right convention without needing to write the code for converting it.

quaint mantle
tardy delta
#

💀

livid dove
#

So what do people think of utilising async more but by cheating out bukkit usage?

E.g: Plugin that checks if a large ammount of blocks meet 5+ Y conditions and then deciding to do Z thing.

-Set the various potential options for what the check will determine as a non-bukkit representation and store somewhere (in the async code, in a yml etc could utilise hashmaps?)
-scan every block you need to scan and save the property being checked as an int in an array

  • ASYNC: Do the check based on the created int array against the properties saved
    -Each property that meets the check will fill a new int array of 1's and 0's (or multiple ints if there are multile actions
    -Send it back to the main thread and, via a hashmap, do the actions now the checks are done based on the numbers presented in the int array
tender shard
remote swallow
tardy delta
#

if you make it an ide integration first

quaint mantle
tender shard
#

ooh

#

powershell

#

Do-something

#

sucks so hard

quaint mantle
remote swallow
#

would you just use reflection or something to actually change the class name or something

tardy delta
#

not possible

#

this whole lib sounds like a stupid idea

chrome beacon
livid dove
#

Okay i'll spin this (lecturer in the house ya'll lol)

I think the points made by others here are valid, but the underlying concept could be spun on its head to be utilised as a team-based lib to allow teams to set a standard across a team in terms of naming conventions for stuff that arnt already established (like say how to name variables, create guis etc) to ensure a more stable, easy to bug fix code any dev in the team can sift through and understand relatively easily

tardy delta
#

so much reading

#

i have the feeling my eyes are dying

livid dove
tardy delta
#

whats a spaget

livid dove
remote swallow
#

spaghetti

tardy delta
#

you would be surprised

livid dove
#

Proof or it didnt happen

tardy delta
#

proof of what

dry yacht
tardy delta
#

people are weird

shrewd saddle
#

Does anyone know how to make a minecraft plugin that connects to somekind of webhook and receives Tiktok follow alerts then spawn like a zombie on all the players in the server :P Or is this not the discord/ channel for that :P

tardy delta
#

💀

shrewd saddle
livid dove
dry yacht
shrewd saddle
#

Filthy? I think you could sell it on tiktok for alot of money :P

#

If you would want

shrewd saddle
#

I just want one for my own tiktok streams

livid dove
# dry yacht Poetry!

Coders who read poems are less likely to make ~~Spigot ~~Spaget plugins. Change my mind

remote swallow
#

maybe

dry yacht
livid dove
#

Its okay guys

#

ill take one for the team

shrewd saddle
#

Tiktok doesnt but you can use Tikfinity which has an option for webhooks trough ifttt

dry yacht
livid dove
#

@shrewd saddle who would the target audience be, why would they wish to buy it and what is the appeal in general of the idea

livid dove
#

*jokingly of course

#

im not an asshole lol

dry yacht
tender shard
livid dove
dry yacht
shrewd saddle
#

Well I saw this tiktok account doing it... they had like 1000 people watching because it is interactive with the people on the stream. You could add some kind tiktok gift = Spawn zombie or something like that. then The tiktokkers would get donations because of it

livid dove
rough drift
#

gifts pay -5

#

So yeah

#

your plan is failed

#

donos*

shrewd saddle
#

Yeah thats the only thing that sucks but its interactive and you could get followers because of it

rough drift
#

and then what

shrewd saddle
#

Wdym?

rough drift
#

Like what's the goal

dry yacht
#

Profit?

rough drift
#

Isn't tiktok not even monetized

shrewd saddle
#

There is lots of things that you can do when you get out of that

#

No its not but there are alot of businesses that want big tiktokkers to promote their shit

rough drift
#

Well fair point, but you still don't get a profit out of it unless you sellout

shrewd saddle
#

Also I just want to learn a bit of java and this is a big challange for me

#

And just for fun make a challenge of the tiktok streams.

dry yacht
rough drift
#

Well it's simple really, figure out how receiving events from the IFTTT webhook works, then when a message arrives just do

<T extends Entity> World#spawn(Location, Class<T>, Consumer<T> consumer)

shrewd saddle
#

Well I made this plugin that already spawns a zombie on me when I type some sorth of command so yeah that worked :P

#

Yeah I got that just the webhook shit I couldnt get to work

#

Even chatgpt couldnt get it to work so I thought maybe one of you guys could help me out

tardy delta
#

tokenizer kinda slow Enter an expression or type exit() to exit: sin(12*6)+rad(e())^4-1 Took 12.5µs to solve Took 0.5µs to solve Took 10.5µs to solve [✔] Result: -0.7461715709788503 (6805.4 µs)

dry yacht
tardy delta
#

ah sysout is also slow asf

dry yacht
shrewd saddle
tardy delta
#

simple sysout call taking 900µs 💀

#

synchronisation go slow

dry yacht
shrewd saddle
#

Not really its cool it can do all these small things :) its not made for programming

dry yacht
#

Well, it does what most devs do: Scrap together stuff from others and glue it together to get as close to the actual solution as possible. Lol

shrewd saddle
#

Hahaha Yepp

dry yacht
#

While producing a spaget, also like most devs. xD

shrewd saddle
dry yacht
livid dove
# shrewd saddle Would you want to help me with it? :)

This is development help, not development do it for you mate.

I dont say this meanly, I say this as coding is a really good skill to learn and i'd suggest you learn the craft yourself and not need to ask others to help.

Hell your learning process itself could provide content for your viewers

livid dove
dry yacht
shrewd saddle
#

You can try to sell it through me?

dry yacht
tardy delta
#

ill probably add a gui too

shrewd saddle
#

When people ask how I got it Ill just send them to you and you can sell it to them

dry yacht
livid dove
#

Always interesting to see other dev's approaches

tardy delta
tardy delta
#

lemme just make a push this evening

livid dove
dry yacht
tardy delta
#

wdym working example

shrewd saddle
livid dove
#

you know the "here is a cool example of how this can be utilised"

tardy delta
#

if thats what you mean, here you go

livid dove
#

So. and do forgive me , its an input based calculator ?

tardy delta
#

yes

dry yacht
cold field
#

Is spigot still using it's own mappings instead of the one provided by mojang?

rough drift
#

yes

tender shard
#

?nms

quaint mantle
cold field
#

Mh, is spigot mappings complete as mojang is?

#

Bc I was thinking of directly using spigot mappings

remote swallow
#

spigot mappings have every class moj maps do, just named differently

#

life saver

chrome beacon
#

1.19.3 doesn't use Spigot mappings anymore iirc

livid dove
#

So the ultimate spigot dev conundrum:

-Haz code
-Nicely structured
-Allows the effective deletion of a particular enchantment from every armor piece in chests, shulkers in chests, player and any other wacky container (offline and online) in under 3 minutes for an entire 7k*7k world...
-Wants to show off when full finished and polished
-...... is in kotlin

How bad i gonna get rinsed here? ;0

chrome beacon
#

Older 1.19 versions still have Spigot named classes

tender shard
tender shard
wary mountain
tender shard
#

whats your code

#

because if it thinks that the channel is null, then I am like 1000% sure that the channel is indeed null

remote swallow
#

jda

#

forgot how painful that was

tender shard
#

I like JDA

remote swallow
#

i dont

tender shard
#

what's painful is to invite your own bot to your server lol

#

have you seen my quizbot epic?

regal scaffold
remote swallow
wary mountain
regal scaffold
#

What would cause a trash like that.

remote swallow
#
  • doing struff like that is pointless
tender shard
#

does your bot even have the proper intents in the discord developer portal?

tender shard
#

which ones does it have?

remote swallow
#

JDABuilder.createDefault(token).setStatus().setActivity().build().awaitReady()

wary mountain
#

oh

remote swallow
#

?main too

wary mountain
#

before it was BotDriver

remote swallow
#

whats your plugin called

wary mountain
#

IPCBot

tender shard
#

tbh I always call my main class Main

remote swallow
#

call it ICPBot

remote swallow
tender shard
#

that'd suggest that the plugin is a bot

#

it's however a plugin

#

soooo

#

if at all

#

call it IPCBotPlugin

wary mountain
#

oh yeah

remote swallow
#

there is a lot wrong with this code lol

tender shard
#

the channel however should not be null if the bot can access it

#

you sure the ID is correct? might wanna invite me to that server for a second? 😛

wary mountain
#

i mightve messed up its permissions when inviting

#

not sure

tender shard
#

the permissions are usually not the problem, but rather the intents

wary mountain
#

weird request but sure just leave when youre done (its the id for general)

#

ill dm it

remote swallow
#

none of those things cause exceptions, you build twice, have very unneeded variables

wary mountain
#

yeah i should prob just set builder build as a static global variable

#

then its only done once

remote swallow
#
public JDA jda;

@Override
public void onEnable() {
    jda = JDABuilder.createDefault(token).setActivity().setStatus().build().awaitReady();
    // do stuff
}
tender shard
#

hm permissions are definitely correct and the ID obv too

#

you probably didnt wait until the bot is ready

wary mountain
#

yeah

tender shard
#

do awaitReady()

#

after you build()

wary mountain
#

im used to discord dot net so im still getting used to the whole jda thing

remote swallow
#

also change that code to match what i sent

tender shard
wary mountain
remote swallow
#

static bad

tender shard
#

and why public

remote swallow
#

i use lombok

tender shard
#

I'd make it a private NON-STATIC field

#

because the JDA isn't describing anything about the class

remote swallow
#

and i just like if a var has a getter i make it public

#

idk why

tender shard
#

yeah I kinda also dislike useless getters but everyone's angry if you make your fields public

lusty mesa
#

Can someone help me with this problem:
[SCHWERWIEGEND] Exception in thread "main"
18:34:00 [SCHWERWIEGEND] java.lang.RuntimeException: Invalid configuration encountered - this is a configuration error and NOT a bug! Please attempt to fix the error or see httpsww.spigotmc.org/ for help.

tender shard
pseudo hazel
#

having useless code is a nono

remote swallow
#

?stacktrace

undone axleBOT
lusty mesa
pseudo hazel
#

the only reasons for getter functions is if there is more logic to it

tender shard
#

anyway, send the full stacktrace

#

there should be many more lines

livid dove
#

So erm what did folks think of the wild funni async man? 😄

remote swallow
#

dawat

lusty mesa
remote swallow
#

im too tired to read

#

way too many letters

tender shard
lusty mesa
remote swallow
#

?paste

undone axleBOT
tender shard
undone axleBOT
livid dove
#

so rather than say 100 material checks on blocks you've scanned... you scan the blocks, give each of em a int value or string value etc etc, throw them into an async task that does the checks based on that non bukkit value.

lusty mesa
remote swallow
#

once we get the link of the paste we can help

tender shard
#

unfortunately most people disagree

wary mountain
#

yeah it was the await

pseudo hazel
#

well they are dummies

tender shard
#

?services

undone axleBOT
remote swallow
#

?services

undone axleBOT
remote swallow
#

fuck

tender shard
#

gg epic

subtle adder
#

LOL

#

ty

#

c:

remote swallow
#

i misspelled it

#

then didnt get it in in time

subtle adder
#

sorry sorry i didnt know

ivory sleet
#

@subtle adder for the record, do not send in multiple channels,

subtle adder
#

noted 🫡

remote swallow
#

a wild conclure appears

livid dove
#

Better way to explain

#

For tasks that have multiple checks being done as opposed to large ammounts of bukkit tasks being the issue

#

because checks on stuff that , tbh u dont need the bukkit api for is stinky

dry yacht
tender shard
livid dove
# dry yacht Absolutely nothing wrong with that

Ngl I give a small tear of pride and joy when I see that someone has a 30+ class plugin with multiple packages and see that the UTTER LEGEND had the common sense to call their main class GOD DAMN MAIN! IT ISNT HARD PEOPLE! 😎

#

sometimes being too clever with your code makes it hard for others to appreciate it
Simple can be better, sometimes :L

regal scaffold
#

Can vault get the price of a sellitem?

tender shard
#

what is a sellitem?

chrome beacon
#

Vault is for handling player economy

#

Not for interacting with prices

regal scaffold
#

But it's connected to an economy, if I need to get the price I need to hook straight to the sell plugin then?

tender shard
regal scaffold
#

Thanks

livid dove
compact haven
#

inb4 compile error

livid dove
#

This is a given

compact haven
#

speak for yourself

subtle adder
#

I can't post in the forum ):

remote swallow
#

is it bad i only started working on betteritemconfig again earlier dlg

subtle adder
#

I've had my account for 3 years and it won't let me post in the services & recruitment, could I please post here? 😄

chrome beacon
#

No

remote swallow
#

you need to post elsewhere to get access there iirc

chrome beacon
#

If you can't post you contact one of the developers offering their services

dry yacht
# tender shard i think the same

People who say that it's bad practise don't understand the underlying problem people are trying to warn others about by saying that it's "bad practise". It only is if your FQN is no longer unique, which would mean that your last root-subpackage isn't a unique project-name, which in itself would be total insanity. Other than that, it's completely fine. You're the boss in your own namespace.

compact haven
#

u don’t know how many projects I have that are forever “on the back burner”

livid dove
#

Anyway erm...

livid dove
remote swallow
#

ive got like 1 other project im working on

#

i just somehow managed to not work on anything

livid dove
remote swallow
#

for 3 days or whatever its been

remote swallow
dry yacht
livid dove
#

Also noone commenting on my async suggestion xD

#

Let me inovate

remote swallow
livid dove
#

Let me invoatteeeeeee

remote swallow
#

then realised it takes effort

#

and ditched them

dry yacht
remote swallow
#

it is not

dry yacht
chrome beacon
tender shard
#

fuck you discord

livid dove
chrome beacon
remote swallow
#

discord dying again

#

embeds are taking forever to embed

tender shard
#

yeah

compact haven
#

Alex

#

why do you have 116 repositories

dry yacht
#

That's not that much, lol

livid dove
#

Btw real talk why the ever living hell is not literally every large computational plugin using taskchain

compact haven
#

that’s is much

tender shard
#

it's all on JEFF-Media-GbR

dry yacht
#

I have 74 or something, and I'm depressed af and only work in bursts. 116 is not much for somebody who probably does a lot more than me.

It's called extracting and isolating reusable functionality while also keeping it separate. Why not make use of the free archive service GH offers us? lol

remote swallow
dry yacht
tender shard
tender shard
compact haven
#

and Jeff-Media-GBR is your account

dry yacht
#

Aight, I've seen enough, I'mma head out

tender shard
#

binge drinker is just sth like this

dry yacht
#

Nah, cool project! :D It's just that I thought it sounded like something completely different. Like a spigot plugin about getting drunk, haha

tender shard
#

lol

#

no 😦

dry yacht
#

Kinda hesitant to click that, not gonna lie

#

What's it about? xD

pseudo hazel
#

this

#

its a link to that message

dry yacht
#

Oh, okay, xD. No idea of their URL layout, as I'm a discord noob. Thanks for clearing that up.

tender shard
#

Daddy/StepSister is my anti piracy library

compact haven
#

but named completely intentionally

#

Alex wdym by “pain to compile”

#

you literally can’t

#

like you don’t even have the artifacts anywhere

quaint lark
#

Who knows how to disable possibility to Push other players
I can move a player from spawnpoint to warzone . How to disable it

austere cove
#

bois i has generics question.

@Override
public boolean addAll(@NotNull Collection<? extends E> c) {
    Preconditions.checkNotNull(c);

    Stream<? extends IdentityEntry<E>> stream = c.stream().map(IdentityEntry::new);
    return set.addAll(stream.toList());
}

This works, but

@Override
public boolean addAll(@NotNull Collection<? extends E> c) {
    Preconditions.checkNotNull(c);

    return set.addAll(c.stream().map(IdentityEntry::new).toList());
}

this does not

#

and idk why

#

set is a Set<IdentityEntry<E>>

compact haven
#

@austere cove I wonder if you wrap the stream & map op with a cast it’ll work?

#

it’s gotta just be too unspecific most likely

tardy delta
#

what does the error message say tho?

eternal night
#

you are not specific enough with the generics yea

compact haven
#

ah yeah I know why lol

#

because the one without the variable is a

eternal night
#
Stream<? extends IdentityEntry<? extends E>> stream = c.stream().map(IdentityEntry::new);
#

is technically what you are getting

#

which is not applicable to addAll

austere cove
#

yes ik that but I don't have to cast it to Collection<? extends IdentityEntry<E>>

rotund ravine
#

return set.addAll(c.stream().Stream<? extends IdentityEntry<E>>map(IdentityEntry::new).toList()); idk if java has smth like this.

#

It's just dumb with generics sometimes.

eternal night
#

yea

pseudo hazel
#

is it possible to create an itemstack that is like a stack (64) of pickaxes or saddles

rotund ravine
#

yes

pseudo hazel
#

can you enlighten me

#

is there a simple method for it?

rotund ravine
#

no

pseudo hazel
#

oh

#

so like how hard are we talking

#

It just needs to be visual

austere cove
#

im convinced there's no way to make it a oneliner

#

weirdge

eternal night
#

you can just cast the elements up

austere cove
#

nvm

#
@SuppressWarnings("unchecked")
@Override
public boolean addAll(@NotNull Collection<? extends E> c) {
    Preconditions.checkNotNull(c);

    return set.addAll((Collection<IdentityEntry<E>>) (List<?>) c.stream().map(IdentityEntry::new).toList());
}

mega cursed

eternal night
#

.map(e -> (E) e)

#

😏

compact haven
#

pepe_kek that will work won’t it

austere cove
#

that works too big brain

#

certified java moment

eternal night
#

or <E>map(Function.identity())

#

for the cool kids

compact haven
#

mfw

eternal night
#

tho @austere cove the best way would probably be .map(IdentityEntry<E>::new)

#

before you go off with a cursed solution

austere cove
#

going with return set.addAll(c.stream().map(IdentityEntry<E>::new).toList()); which seems to work

#

cheers

eternal night
#

🥳

austere cove
#

mfw i need a concurrent implementation of a set with identity semantics

compact haven
austere cove
dry yacht
pseudo hazel
tender shard
remote swallow
#

motherfucker what

tender shard
#

oh yeah that makes sense

#

also verano calls me "mfalex" everytime

#

EVERYTIME

remote swallow
#

verano when we say alex: "yo"

tender shard
#

"who pinged me"

compact haven
#

mfw means my face when KEKW2

#

I guess it could also be motherfucker what

#

but I never thought of it as that

sonic cosmos
#

i tried with chatpgt solutions but none worked and i have no idea what i should do

austere cove
#

Can't really help if you don't give the relevant parts of your code

#

i.e. the kits class (and maybe the item stack builder)

regal scaffold
#
    private void generateLevel() {
        new BukkitRunnable() {
            @Override
            public void run() {
                    cancel(); <-----------------
                    return;   <-----------------
            }
        }.runTaskTimer(plugin, 1, 1);
    }

If I call this method using generateLevel() what will cancel() and return do to the task

austere cove
#

#cancel() will cancel the task for future scheduling, return breaks out of the method scope

regal scaffold
#

so return will make the timer run again and cancel() will stop until generateLevel is called?

tardy delta
#

returns makes code that comes after the cancel isnt being executed

regal scaffold
#

And will cancel() wait until generateLevel() is called again? Like it fully cancels the task/

austere cove
#

wdym wait until the method is called again

regal scaffold
#

Like this task in only started when generateLevel() is called

#

How can I stop the task completely until generateLevel() is called again

#

Is that what cancel does

austere cove
#

?
Every time you call #generateLevel() you schedule a new task
You schedule it on a timer for some reason, but you cancel it on the first run

regal scaffold
#

When I cancel() a task that doesn't mean run again right away right. That's a proper cancel to stop

outer river
#

hello guys, i would like to know if there is a better way to modif config files IG with a gui than writing tons of code like that, thx

river oracle
#

Methods

#

Lot of that looks like repeat code

outer river
#

yeah i think i'll do this, thx

dry yacht
austere cove
#

just add an nbt tag that stores the config path and value type (create an enum for your minutes hours thing), then on click just fetch the path and value type and set it accordingly

outer river
austere cove
#

Also, "".replace(...) does nothing, and you should use the ChatColor class

regal scaffold
#

Is it better to use scoreboard apis to make them or is it just better to make your own. Personal usage

dry yacht
outer river
#

yeah i understand

dry yacht
tender shard
regal scaffold
#

Really alex, that bad huh

tender shard
#

yeah

#

it's because the vanilla scoreboard system is a mess

dry yacht
#

Not if you're in full control and don't run next to another plugin which also tries to update assigned scoreboard instances. It's fine I guess, but it still obscures what's actually going on. The API is just designed in a way which barely aligns with how people actually think about it.

tender shard
#

I'd use FastBoard if I was you

regal scaffold
#

FastBoard the best? alr

tender shard
#

FB is the only one I know

tender shard
#

check out the spigotmc resources list

#

1 sec

#

wtf why doesnt the resource list list XMaterial in that section lol

regal scaffold
#

Wasn't featherboard a thing before

tender shard
regal scaffold
#

Still has api

#

hmmmm could just replace all

tender shard
#

idk, I never did any custom scoreboard things

regal scaffold
#

Thing is currently already have a plugin doing scoreboard so I need to make sure I can override it

tender shard
#

is it, by any chance, TAB?

regal scaffold
#

it is indeed lol

tender shard
#

tab also got an API iirc

regal scaffold
#

Technically I could use placeholders instead of direct api hook

tender shard
#

sure

regal scaffold
#

Meh tho

#

Oh wait it does have an api

#

Man feather board looks so much cooler tho hehehe

tender shard
#

idk I guess tab could do the same things

#

and tab's open source

pseudo hazel
#

just man up and do it yourself ,then it looks as cool as you can get it

dry yacht
regal scaffold
dry yacht
tender shard
#

tell this to angelchest 🥲

regal scaffold
#

XD

#

CMI 🤣

#

Or the entire songoda....

tender shard
#

oh CMI deserves to rot in hell

regal scaffold
#

so does songoda

tender shard
#

CMI is the only plugin I ever rated 1 star on spigotmc

compact haven
#

I don’t want something that can do everything mediocrely

tender shard
#

cmi author literally ignored my bug report for over a year, but added a feature request I made within a week

regal scaffold
#

It's as bad as songoda it's actually crazy

#

@tender shard nice api lol

#

I guess I gotta use placeholder api instead

tender shard
dry yacht
# compact haven I don’t want something that can do everything mediocrely

By someone who scrapped together a thousand features into a single spaget of a codebase. I'd love to know what I'd run on my server, so I'd have to study the codebase, if it's even available. The time it takes me to wrap my head around crap is probably twice the time it takes me to build something smart and concise myself.

wary mountain
#

JavaPlugin getserver().getip function dosent work

#

getport does though

tender shard
#

it does work

#

getIP returns the listening IP

#

which is 0.0.0.0 or ::1 in 90% of cases

#

even if you could get the output of e.g. ip a, it might just give you your internal IP, e.g. 10.0.0.2 or sth

#

so yeah you need to do a http request to find it out

wary mountain
#

well server ip

#

not your ip

undone axleBOT
wary mountain
#

that includes dns

regal scaffold
#

alex I was gonna try using your lib but I couldn't go through seeing all I could do I probably did things that your lib can do. I even have it added to pom loll

pulsar parcel
#

Hello, I want to make custom mob and I found some guide on spigot. But it's outdated, so I can't extend EntityZombie class. Is here any way how to do it on 1.19.2 spigot api? Ps the guide is: https://www.spigotmc.org/threads/tutorial-creating-custom-entities-with-pathfindergoals.18519/

wary mountain
#

i put config yml in same place as plugin yml right (resources)

tawdry python
#

I'm using blockbreakevent for when I break a carrot, it returns the drops, but it always returns only 1 drop, how can I do it?

#

Okay, but won't it generate lag to check if it's a carrot every time it falls? I want to do this with carrots and potatoes. Imagine that the player has a cactus farm, it won't generate lag for each cactus he drops, does he check if it's a carrot?

#

I'll check if it's a carrot or a potato and add it to a list

wary mountain
#

ok it seems having it as a plugin seems to have some issue since if two servers are running the plugin one overrides the other

#

so what should i do to fix that

torpid blaze
#

Hey, I am currently working on a plugin where the player should see specific stats for him in the scoreboard. First I tried to use the MainScoreboard because I use it in combination with teams, but this didn't work. Now I try to use a NewScoreboard().
What I do:
Get the Scoreboard of the player. If it is equals to the MainScoreboard, I get a NewScoreboard. Then I unregister the old ovjective and save this to the players scoreboard. Now I generate a NewObjective, add all the scores and than save it back to the player.

At the first time it works. The Socreboard is shown to the player. But it never updates.
I already outputted the values and the number is changing I want to display but the scoreboard is not updating.
Anyone any ideas?

#
 Scoreboard score = player.getScoreboard();
            if (score.equals(Bukkit.getScoreboardManager().getMainScoreboard()))
                score = Bukkit.getScoreboardManager().getNewScoreboard();

            Objective objective;
            if (score.getObjective("stats") != null) {
                score.getObjective("stats").unregister();

            }
            objective = score.registerNewObjective("stats", "stats", ChatColor.BOLD + "" + ChatColor.GREEN + "Stickfight Stats");
            player.setScoreboard(score);

            score.getObjectives().forEach(o -> System.out.println(o.getName()));

            objective.setDisplaySlot(DisplaySlot.SIDEBAR);

            System.out.println(map.getPlayer(player.getUniqueId()).getDeaths());

            objective.getScore(ChatColor.BLACK + "+----------------+ ").setScore(7);
            objective.getScore(ChatColor.BLACK + "      ").setScore(6);
            objective.getScore(ChatColor.WHITE + "Map: " + ChatColor.YELLOW + map.getName()).setScore(5);
            objective.getScore(ChatColor.BLACK + "    ").setScore(4);
            objective.getScore(ChatColor.GREEN + "Kills: " + ChatColor.DARK_PURPLE + map.getPlayer(player.getUniqueId()).getKills()).setScore(3);
            objective.getScore(ChatColor.RED + "Deaths: " + ChatColor.LIGHT_PURPLE + map.getPlayer(player.getUniqueId()).getDeaths()).setScore(2);
            objective.getScore(ChatColor.BLACK + " ").setScore(1);
            objective.getScore(ChatColor.BLACK + "+----------------+").setScore(0);

            System.out.println("updating");

            player.setScoreboard(score);
#

This is my method

#

for updating and showing the first time

subtle temple
#

anyone know how I can plant seeds. I thought I could set air block to seeds but im getting illegal argument exception

#
java.lang.IllegalArgumentException: Cannot get data for not block BEETROOT_SEEDS
torpid blaze
#

why do I need teams

subtle temple
#

🤞

undone spindle
#

hey something totally not spigot related but does someone know hot to make a thread that is like doessnt die. in the end i wanted to use it in spigot so i can put different sections of my plugin in threads

#

sooooo its not smart?

#

threads are never safe tho

#

and i think i still want to try just for the fun of it

#

exept if its really bad

#

would you happen to have a documentation?

undone axleBOT
undone spindle
#

thx 🙂

subtle temple
# subtle temple 🤞

no shot
java.lang.IllegalArgumentException: Cannot get data for not block BEETROOT

sullen marlin
#

Beetroot is not beetroots

subtle temple
#

oh, theres like a million materials. my bad

#

lets try that again

#

perfect 🙂 thank you everyone

humble tulip
mellow pebble
#

im making bungeecord plugin and i want to get instance of bungeecord but idk how should i import it and do it i know from past that there was like

net.md_5.bungee.BungeeCord;

but not anymore in 1.19 so any help myb ?

glossy venture
#

is there a way to inject invocation handlers into an interface, like using java.lang.reflect.Proxy but on an already existent instance?

#

like

interface A {
  default void hello() { }
}

class B implements A { }

class Injector {
  void inject(B b) {
    // idk how to do this
    // but lets just say here i want to make hello() say Hello World
    injectInvocationHandler(...);
  }
}
quiet ice
#

wut

frank kettle
#

for some reason a "simple event"(trying to debug to figure error) is not getting called.

@EventHandler
    public void onTreeBreak(BlockBreakEvent e) {
        Player p = e.getPlayer();
        p.sendMessage("breaking block");```
the class is registered as an event(it has another event in it, playerInteractEvent which is working fine) but it is not working at all, it's not sending a message when i break a block 😐 idk what to look for anymore, has anyone have had this issue?
quiet ice
glossy venture
#

no

#

idk how proxies work but i should theoretically be able to set an invocation handler on an instance right

#

or is that not how it works

frank kettle
#

the class is registered as an event(

#

it has another event in it and works fine

#

im now separating into 2 classes

quiet ice
quiet ice
#

Unless you wrap your object

humble tulip
#

Besically you wanna overridde some methods?

quiet ice
#

But you can't just change the way a method behaves

frank kettle
#

the event is still not being called even on different class with everything registered fine 😐 my only possibility is if there's another function with the same exact name and that is "corrupting" which class to be called.

humble tulip
#

Basically when you create a proxy instance it creates an instance with empty methods

#

You can add a handler which handles method execution

glossy venture
#

ok ima explain my thought process

i thought that proxies work by telling the jvm to, when a method is called, redirect that call to an InvocationHandler if it is somehow marked as a proxy class

so what i want to do (which seems entirely possible if it works like this, only problem is the protections in place) is set an InvocationHandler on a normal object and mark it as a proxy

glossy venture
#

with empty methods

humble tulip
#

But you need to replace your origonal instance with your proxy instance as well as pass the original instance to your handler

glossy venture
#

hm

dry yacht
humble tulip
#

Not sure what it does internally but it's pretty much the same effect

#

Lemme show u an example

glossy venture
#

that would slow down normal calls a lot tho

humble tulip
#

Well I'm not sure

#

You can test it

dry yacht
frank kettle
#

pm = Bukkit.getPluginManager();

#

the event is not getting called at all and no error

tall dragon
#

lowercase class names

dry yacht
#

Says "the whole classes", gets excerpts again. :(

humble tulip
#
public class Main {

    private static List<String> names = new ArrayList<>();

    static {
        names.add("Steve");
        names.add("Alex");
    }

    public static void main(String[] args) throws Exception {
        names = (List<String>) Proxy.newProxyInstance(List.class.getClassLoader(), new Class[]{List.class}, new ListHandler(names));
        names.add("Test");
        System.out.println(names);
    }

}
frank kettle
#

whole classes would be too much

humble tulip
#
public class ListHandler implements InvocationHandler {
    private final List<?> list;

    public ListHandler(List<?> list) {
        this.list = list;

    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        if (method.getName().equals("add"))
            return false;

        return list.getClass().getMethod(method.getName(), method.getParameterTypes()).invoke(list, args);
    }
}
#

@glossy venture

dry yacht
humble tulip
#

all this does is disallow the addition of items to a list

frank kettle
#

the rest of it shouldnt be affecting when the class is being registered, has listener and everything after doesnt matter since first line is not working and plugin is not giving any error.

humble tulip
#

what are you using proxies for?

frank kettle
#

why would anything after affect when there's no error

humble tulip
#

also i just realized, return list.getClass().getMethod(method.getName(), method.getParameterTypes()).invoke(list, args); is useless

glossy venture
#

you can use InvocationHandler.invokeDefault as well

tall dragon
glossy venture
#

for default methods

frank kettle
glossy venture
#

not here tho

humble tulip
#

return method.invoke(list, args);
can be replaced with this

tall dragon
#

?paste the entire class

undone axleBOT
tall dragon
#

or we cant see much

dry yacht
# frank kettle the plugin is not giving any error

What do you expect us to tell you? Oh, that's issue #837482, BlockBreakEvent is known for that! You just gotta add some of special #18283 and #21912 and it'll work again.

How the hell are we supposed to know your mistake with that little code. Obviously it doesn't work, so no point in arguing why.

humble tulip
glossy venture
frank kettle
#

i want to know if the names affect at all

humble tulip
#

what is @ActionCall?

glossy venture
#

and then have a method

... void inject(Object service) {
  // make say(...) call some action
}
tall dragon
glossy venture
dry yacht
# frank kettle this ^^

No, why would they. Bukkit queries your class' method declarations and saves methods which are annotated by @EventHandler in it's caller list, the name is pretty much irrelevant.

tall dragon
#

but in theory that shoulnt be a problem

glossy venture
#

those are the methods id want to proxy

#

action calls can be remote

#

so cant just directly call them

compact haven
glossy venture
#

this next best thing

compact haven
#

They do a lot of cool JVM libraries, would check them out if you haven’t already

#

Mirror, Overlord, Mimic, etc

glossy venture
#

sick

#

love fucking around with the jmv

#

jvm

#

but dont think this will work either
dont even know if what im trying is possible

#

need to inject an invocation handler into an instance

#

not create a new proxy

compact haven
#

oh PikaThink

dry yacht
sullen marlin
humble tulip
sullen marlin
#

sad that it doesnt seem people use this

compact haven
#

Not many

humble tulip
#

and then replace the instance with the proxy

glossy venture
#

yeah but the instance probably wont be an interface

humble tulip
#

that's fine

glossy venture
#

and proxy requires that

#

or not

humble tulip
#

no

glossy venture
#

hm

humble tulip
#

look

glossy venture
#

wtf

sullen marlin
#

we are we using proxies again

humble tulip
#

i sent my example

glossy venture
#

java.util.List is an interface tho

humble tulip
#
    private static List<String> names = new ArrayList<>();

    static {
        names.add("Steve");
        names.add("Alex");
    }

    public static void main(String[] args) throws Exception {
        names = (List<String>) Proxy.newProxyInstance(List.class.getClassLoader(), new Class[]{List.class}, new ListHandler(names));
        names.add("Test");
        System.out.println(names);
    }
public class ListHandler implements InvocationHandler {
    private final List<?> list;

    public ListHandler(List<?> list) {
        this.list = list;

    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        if (method.getName().equals("add"))
            return false;


        return method.invoke(list, args);
    }
}
glossy venture
#

i mean the wrapped instance doesnt have to be

humble tulip
#

look at this

glossy venture
#

yeah ik

humble tulip
#

wait you mean the class u wanna override is not an interface?

glossy venture
#

ill just drop the idea not rlly necessary anyways

humble tulip
#

then proxies won't work

glossy venture
#

possibly

#

yeah

humble tulip
#

u can use the thing sent above

glossy venture
#
service.say("gg");
// vs
MyService.ACTION_SAY.call("gg");
dry yacht
glossy venture
#

first is obv nicest

humble tulip
#

won't said list be in the permission plugin?

dry yacht
# humble tulip where's the list to replace tho?

https://github.com/BlvckBytes/PermissionChangeListener

Not sure if this is cross-version, it was just a hack I did once to achieve something in my personal playground. Thought it'd be worth isolating, as it seemed interesting. You can have a look through, it's very very concise.

GitHub

Listen for permission changes on all online players - GitHub - BlvckBytes/PermissionChangeListener: Listen for permission changes on all online players

humble tulip
#

So permission plugins need to submit the permissions a player has to bukkit?

glossy venture
#

nah they can inject a permissible i think

#

full idea:

public class MyService {
  public static final ActionSpec ACTION_SAY = ...;

  @ActionCall(action = "say")
  public void say(@Param("str")String str) { }

  /*
    some other shit
    this is why i cant use an itf
  */
}

public class ActionManager {
  // ...
  public <T> T init(T service) {
    // proxy all @ActionCall methods to
    // call their respective actions
    //
    // in this case, say(String str) will
    // call ACTION_SAY.call(ActionManager, new Object[] { str })
  }
}

/* somewhere */ {
  MyService service = ...;
  actionManager.init(service);
  
  service.say("gg"); // calls the action 
}
dry yacht
humble tulip
#

ohh

glossy venture
#

yeah but perm plugins can override it and inject it with reflection

#

directly into the craftplayer thing

dry yacht
humble tulip
#

i thought permission plugins just told bukkit that i will handle permissions now so bukkit just forwards permission checks to the plugin

dry yacht
humble tulip
#

never needed to look into it

#

so i just assumed wrongly all this time

glossy venture
#

unless its not been set by the plugin yet

quiet ice
#

I love how weak y'all are.

glossy venture
#

or the plugin resets it

dry yacht
glossy venture
#

the perm plugins dont create a proxy right

quiet ice
#

Just use Objectweb ASM to create a new wrapper class

glossy venture
#

they just override permissible

dry yacht
glossy venture
#

ah

#

aight ima go

dry yacht
# humble tulip never needed to look into it

I did, as I worked on virtual furnaces and wanted to instantly stop processing a furnace a player lost permissions to. Like, if a server gave you another instance for a few hours, that would have had no other way of achieving this. I don't want to poll regularly, I want to be interrupted.

pseudo hazel
#

what is the purpose of the InventoryHolder interface?

drowsy helm
#

its supposed to represent an object/entity that holds an inventory

#

but alotta people use it for inventory library stuff

pseudo hazel
#

like what

drowsy helm
#

to identify custom inventories

pseudo hazel
#

oh

#

but basically it's kinda useless

quiet ice
#

yep

pseudo hazel
#

kinda annoying you need to implement it though for creating inventories using bukkit.createinv

#

or do you

#

wait I just noticed that humanentity is also an inventory holder

dry yacht
# pseudo hazel but basically it's kinda useless

It seems to be the unified way of getting inventories of entities and blocks, so calling it completely useless is maybe a bit harsh. It just has this one inventory getter method in it, that's it.

pseudo hazel
#

well sure, I meant that I dont really have to care about what I do for it

#

as long as it gets something it should work

#

or do I like for example make the player the holder if they are the one to open it

dry yacht
#

Oh, when using Bukkit#createInventory you can just leave that at null. But you could also pass a player, as it's already an InventoryHolder.

pseudo hazel
#

okay I see

dry yacht
#

I just never saw a need for that, so I always set it to null.

pseudo hazel
#

well i think imma use null since at the time of creating the class that holds the inventory the player isnt there yet in some cases

#

thanks for the explanation

dry yacht
pseudo hazel
#

true, may have been a bit of an X/Y question since I am trying to find out why Inventory.setMaxStackSize doesnt work how I want it to

#

like I am trying to set the size to 100 but it doesnt go higher than 64

#

but it also goes to 64 on tools and stuff

#

just not beyonf

#

but if I set that on teh players inv instead of my gui's inventory, it does seem to work

dry yacht
#

That's kind of a client-side limitation, I think. The client also limits your max book-pages, for example. There are actual hard-coded limits for some numbers. I still remember that you could stack two 64's of potions in the old days, no idea how this behaviour changed over time tho.

pseudo hazel
#

hmm

dry yacht
pseudo hazel
#

yeah

#

for the player s inventory

#

but not for the top one

#

which is where I put i items by code, but before adding each item I am setting max size

#

I can work around it for now since I just wanted to get stackable tools, but still its kinda annoying it doesnt work the way as advertised

glacial shell
#

Hey so I was following a tutorial and when I tried to do something with the ItemManager its red but idk how to import whatever it is, because the tutorial doesn't really show:

    @Override
    public void onEnable() {
        super.onEnable();
        this.getLogger().log(Level.INFO, "BetterPicks Successfully Loaded!");
        ItemManager.init();
        this.getServer().getPluginManager().registerEvents(new MultiBreakPickaxeEvent(), this);
pseudo hazel
#

im not familiar with any ItemManager

#

what tutorial are you following

#

and whats this manager supposed to do

glacial shell
#

"Creating a Multibreak Pickaxe (Minecraft Spigot Plugin) Tutorial" by SyntaxError , supposedly the ItemManager is supposed to like register an event I made in an item

around 24:01

dry yacht
quaint mantle
#

how to i turn on piston duping? in my server

pseudo hazel