#help-development

1 messages · Page 957 of 1

unborn breach
#

going to help server then :/

soft hound
#
// BlockBreakEvent
System.out.println(event.getBlock().getBlockData());
if(!(event.getBlock().getBlockData() instanceof Ageable)) return;
System.out.println(2);
CONSOLE OUTPUT:
CraftBlockData{minecraft:wheat[age=7]}```

It never prints out the 2
worldly ice
#

make sure you're using the org.bukkit.block.data.Ageable import and not the entity one

soft hound
#

Ahhhh silly me, thank you !

worldly ice
#

np!

#

yeah thats a thing that is really easy to mess up

proven musk
#

are there any libaries that let you add custom enchantments?

drowsy helm
#

plenty

proven musk
#

is it even possible to customize like

#

because ones ive found add weird guis that aren't vanilla enchantment system

drowsy helm
#

that would be a plugin then not a library

proven musk
#

right

#

do u know any good ones

drowsy helm
#

nah never really used any so not any i can recommend, I do know theres a few though if you search it on spigot

#

but I'd recommend just coding it yourself, it's not too complicated to do

#

and you get more flexibility

proven musk
#

idk how I would do it

#

im very new to development

#

I know u would add lore? to make it show up

#

but idk how to make it work with anvils and enchantment tables and stuff

drowsy helm
#

ah yeah might be a bit complex for your then

proven musk
#

theres just alot of stuff to worry about

#

anvils, grindstones, enchanted books,

drowsy helm
#

but no 1.20.3 support

proven musk
#

ah

#

no good

#

im on 1.20.4

drowsy helm
#

idk if there will be much libs that support it atm

proven musk
#

grr

#

theres one thats perfect for 1.18

#

so theres no way it would work with 1.20.4

drowsy helm
#

dang i really thougth there would be more

#

i've seen heaps in the Help dev forum but xenforo search sucks ass

proven musk
#

if its like

#

a private server I can take a open source plugin and update it to work in 1.20.4 right

#

that wouldn't be too hard

drowsy helm
proven musk
#

hmm but these enchantments arent real right

young knoll
#

You always had to

#

But the more “proper” way to do it is pdc

proven musk
#

can you add custom blocks

#

its very difficult in vanilla

#

im kinda assuming its similar

young knoll
#

Correct

proven musk
#

damn

#

you can't add a ton other than custom items right?

#

everything else u need to do workarounds

young knoll
#

The items are technically workarounds too

proven musk
#

yeah but you can give them custom textures

#

everything else you need to replace stuff right

young knoll
#

Not really

#

You can do custom blocks with display entities

proven musk
#

yeah

#

ok so this doesn't allow images but when defining a command u have to define its permissions? what does that mean what do I put there

#

it just says "yourplugin.yourcommandpermission"

#

how do I set that up

young knoll
#

It’s just a string

#

Whatever you want the permission to be

proven musk
#

idk what that means

#

im so new to all this

#

what would I put if I just want it to be available to everyone

#

I tried to look it up but i cant find anything

young knoll
#

Anything

#

But then add it to the permissions section and set default: true

#

I think you can also just not include it

proven musk
#

oh ok

proven musk
#

is there a way in eciplse to just click on button or key and have it export all the right files

drowsy helm
#

are you using maven?

young knoll
#

Set up maven or gradle

#

And then use the build options from those

drowsy helm
#

also check out IntelliJ, eclipse is outdated garbage 🙂

young knoll
#

literally still actively updated

proven musk
#

(right)

drowsy helm
#

nope

proven musk
#

oh

#

im stupid then

#

uhhh

#

ok im so confused about player xp

#

so theres getxp which is a float? for some reason

#

and then getLevel

#

theres no way to get the totalxp?

#

is getxp the points? why is it a float

#

oh

#

get total expirence

#

false alarm

#
event.setKeepInventory(false);
        var player = event.getEntity();
        var playerInventory = player.getInventory();
        var playerInventoryContents = playerInventory.getContents();
        for(int i = 0;i < playerInventoryContents.length;i++) {
            var itemstack = playerInventoryContents[i];
            if(itemstack != null && itemstack.getType() != Material.DIAMOND_SWORD) {
                playerInventory.remove(itemstack);
                player.getWorld().dropItem(player.getLocation(), itemstack);
            }
        }
        var xp = player.getTotalExperience();
        event.setNewExp(0);
        event.setNewLevel(0);
        event.setDroppedExp(xp);
        player.setTotalExperience(0);
#

im trying to get players to drop expirence when they die

#

but none of this is working

#

the xp wont drop and the player wont lost any

#

keepinventory is ON but otherwise item drops get funky

#

do u know how I could do this do i need keepinv off?

#

but when keepinv is off Idk how to have the player keep items

glad prawn
proven musk
#

I said I want to drop xp

glad prawn
#

ah ik why

proven musk
#

not items

glad prawn
#

what's that event btw

proven musk
#

PlayerDeathEvent

#

this is so confusing

#

now its just deleting items

#

this event does not work like how you would expect at all

glad prawn
#

make sure you have registered your listener

proven musk
#

i mean

#

the event runs

#

thats not the issue

#

the xp just refuses to drop

#

ok

#

I got it to work somehow

proven musk
#
for(int i = 0;i < xpSqr;i++) {
    player.getWorld().spawn(player.getLocation(), ExperienceOrb.class, x -> x.setExperience(xpSqr));
    player.sendMessage("i: " + i);
}
var orb = (ExperienceOrb)player.getWorld().spawn(player.getLocation(), ExperienceOrb.class);
orb.setExperience(xp-(xpSqr*xpSqr));
#

this only spawns the last one

#

for some reason

glad prawn
#

wtf

rough ibex
#

I'm not sure if you can prevent it or limit it

proven musk
#

hmmm

#

makes sense

#

ill do something else

worthy yarrow
#

What event would I use to detect the destroying / despawning / removal of a custom item?

#

I've been searching docs and my best conclusion is a mixture of listeners

whole vector
#

hey so I have webhosting hosting my servers website on domain.com
and I have a a record pointing to play.domain.com is there any way I can also have it allow me to connect to my server via domain.com with out putting another a record because putting a second a record will break part of the site

worthy yarrow
#

might with a grain of salt

whole vector
#

👍

graceful oak
#

I found this guide on spigot about world generation and I have been trying to play around with it. I am generating ores under ground and am checking the surrounding blocks to see if an ore will chain off to the block being generated. I keep getting these flat ore veins and im not quite sure why im checking the block to the left, behind, and under to generate blocks off of them and they only seem to be generating horizontally not vertically.

Line 88 is where it is getting the blocks around it
Then from line 91 to 122 its generating ores and determining if it should make the block an ore because of surrounding blocks

https://i.thick.at/jajhVo8d.png
https://pastebin.com/WSZfh8M0

hybrid spoke
graceful oak
hybrid spoke
graceful oak
hybrid spoke
#
float currentY = (65 + (noise2 * 30) + (y / 20));

for example

#

(gemini told me that)

graceful oak
smoky oak
#

isnt 64-bit supposed to take any amount of RAM?

#

im pretts sure minecraft can run on more than that

smoky anchor
#

are you actually running java 22 ?
do java --version

smoky oak
#

i changed the path

#

hold up

#

pardon me

smoky anchor
#

What you showed is a zip file... don't think you can run java from there

smoky oak
#

i unzipped it ofc

smoky anchor
#

try just one -
java -version

smoky oak
#

hm its bound to 1.8

#

i changed the path im sure of that

#

didnt save huh

#

well take 3

slender elbow
#

you need to restart your terminal for env var changes to take effect

smoky oak
#

no like

#

my path changes didnt save

#

for some reason

valid burrow
#

then you didnt do them propperly lol

brittle geyser
#

u need to write path to java

#

replace "java" with "path/to/java.exe"

tidal glacier
#

Can anyone heko me wiht plugins translation? I can pay too!

dawn flower
#

can u get all tasks without a list?

#

there must be a way, bukkit can cancel all tasks from a plugin and cancel task from the id

lost matrix
#

Not sure what "get all tasks without a list" means

dawn flower
#

like

#

bukkit tasks

#

Bukkit.getScheduler().runTask <-- task

lost matrix
#
List<BukkitTask> allTasks = Bukkit.getScheduler().getPendingTasks();
#

But you should not need that

#

Basically ever

dawn flower
#

Pending is kinda sus, does it include active tasks

dawn flower
#

oh wait i can check the javadocs

#

why do i keep forgetting javadocs exist

lost matrix
brittle geyser
#

Bukkit#getSchedule#getActiveWorkers()?

dawn flower
#

actually now that i think abt it they can just create a list of tasks when they create them

lost matrix
#

You could just use BukkitRunnable

dawn flower
#

pretty sure it's the same as BukkitScheduler

brittle geyser
lost matrix
dawn flower
#

what's the difference?

brittle geyser
#

Are u ignoring me?

slender elbow
#

preach

dawn flower
lost matrix
#

You want to write a skript addon which lets users create and cancel tasks, right?
But not via taskIds but by having an actual object that can be cancelled.

dawn flower
#

no like

#

well basically yes

#

i didn't realize that till now, i'm just gonna make it impossible to retrive tasks

trim lake
#

How can I make coppy of ArrayList without beaning modified by first change in source list? I tried this:

List<ItemStack> defaultEventDrops = new ArrayList<>(event.getDrops());

But when ever I will do event.getDrops().add(itemStack) it will be added to defaultEventDrops as well and I don't want that

lost matrix
#

Do you need defaultEventDrops to be modifiable?

trim lake
#

nop

lost matrix
#
List<ItemStack> defaultEventDrops = List.copyOf(event.getDrops());
valid basin
#

How to make night slowly fall? It's possible with that animation how it slowly gets night and day as well?

lost matrix
#

Just set the worlds time and gradually increase it

trim lake
dawn flower
#

is there a difference between async task and a thread

lost matrix
dawn flower
trim lake
# lost matrix Are you actually modifying the ItemStack inside?

yeas, I just need default drops from event saved somewhere

        List<ItemStack> defaultEventDrops = List.copyOf(event.getDrops());
        System.out.println("defaultEventDrops " + defaultEventDrops);
        List<ItemStack> eventDrops = event.getDrops();
        ItemStack helmet = killer.getInventory().getHelmet();
        if (helmet != null) {
            MaskEffect dropEffect = MaskEffect.DROPS;
            if (HelmetManager.haveEffect(helmet, dropEffect)) {
                double dropIncrease = HelmetManager.getEffectValue(helmet, dropEffect);
                if (dropIncrease != 0 && !eventDrops.isEmpty()) {
                    eventDrops.forEach(item -> item.setAmount((int) (item.getAmount() * dropIncrease)));
                }
                System.out.println("MASK DROPS: " + event.getDrops());
                System.out.println("defaultEventDrops: " + defaultEventDrops);
            }
        }
dawn flower
#
drops = e.getDrops().stream()
    .map(ItemStack::clone)
    .collect(Collectors.toList());
#

try that

lost matrix
trim lake
lost matrix
#

Do what W Person suggested. But use .toList() instead of .collect(Collectors.toList())

dawn flower
#

toList is for java 16 so u might not be able to use it

#

intellij should change the language level for u tho

trim lake
native ruin
#

Hi is it possible to do what i'm trying?
Here's the code
((Player) commandSender).getInventory().addItem(new WandItem(Material.BOOK, "Grimoire", false, Spells.testSpell,Spells.testSpell2));
public class WandItem extends ItemStack
if(e.getItem() instanceof WandItem wand){}
PlayerInteractEvent is unable to cast the itemstack to the wandItem

dawn flower
#

bro this is so annoying, either u get Consumer<BukkitTask> as parameter but void return or a normal Runnable and BukkitTask return value

#

u cant get both consumer and return value

tall dragon
#

Function?

tall dragon
dawn flower
lilac dagger
#

it's the same

dawn flower
#

u can do this
BukkitTask runTask(@NotNull Plugin var1, @NotNull Runnable var2)
or
void runTask(@NotNull Plugin var1, @NotNull Consumer<? super BukkitTask> var2)

lilac dagger
#

the consumer purpose is only for the within code

lost matrix
#

How about you use the BukkitRunnable like i suggested earlier

lilac dagger
#

oh

dawn flower
#

can u turn a runnable into a task

lilac dagger
#

there's bukkitrunnable class

#

it allows both cancel inside and outside

dawn flower
#

or cancel runnable outside of the code

#

ykw screw tasks

#

bukkitrunnable time

#

wait

#

can i cancel a bukkitrunnable from this
Bukkit.getScheduler().cancelTask(int)

#

or do i need the object

lilac dagger
#

yes

dawn flower
#

cool

lilac dagger
#

but how do you get the id?

#

from the consumer method?

dawn flower
#

BukkitRunnable has a method

lilac dagger
#

yeah but you can do it with cancel() there

dawn flower
#

i can have the runnable object outside the actual runnable and inside

lilac dagger
#

there's a solution btw

dawn flower
#

yeah i want to cancel from the outside

lilac dagger
#

you can have your void runTask(@NotNull Plugin var1, @NotNull Consumer<? super BukkitTask> var2) if you just make a check first and if it fails you can cancel it from within the consumer

#

not as pretty

dawn flower
#

the thing is idk what's in the consumer really, it's a skript addon

#

bukkitrunnable is prob my only option

#

either only or one of the best

lilac dagger
#

oh skript

dawn flower
#

yeah so they might want to cancel it or not cancel it

native ruin
dawn flower
#

the WandItem class

native ruin
#
public class WandItem extends ItemStack {
    private Spell[] spells;
    private int currentSpell;
    private final boolean consume;

    public WandItem(Material m, String name, boolean consumeOnUse, Spell ...spells) {
        super(m);
        consume = consumeOnUse;
        this.spells = spells;
        if(spells.length>0){
            currentSpell = 0;
        }
        setAmount(1);
        ItemMeta meta = getItemMeta();
        assert meta != null;
        meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES);
        meta.setDisplayName(ChatColor.BOLD.toString() + ChatColor.BLACK + ChatColor.MAGIC + "X " + ChatColor.WHITE + name + " " + ChatColor.BLACK + ChatColor.MAGIC + "X");
        setItemMeta(meta);
    }
    public void useSpell(Player p){ }
    public void toggleSpell(){}
    }
}```
dawn flower
#

is there an error when you try to cast?

native ruin
#

yep when trying to (WandItem) e.getItem()
Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R3.inventory.CraftItemStack cannot be cast to class xceing.untitled1.Folder.WandItem

lost matrix
#

Yeah, dont extend ItemStack

dawn flower
#

yeah i was abt to say that

#

make a manager instead

lost matrix
#

The conversion from bukkit to nms and back will result in a regular ItemStack class and all data being lost.
I would recommend using a wrapper class which uses the PersistentDataContainer of the ItemStack to rebuild.

dawn flower
#

unless you know what wands exist you can prob just make a listener tbh

lost matrix
#

By the looks his wand has dynamic spells

native ruin
chrome beacon
#

pretty much

#

unless you want to store more than that

native ruin
#

thanks

inner mulch
#

does custom model data have to be tied to a item or can it also be universal so every item turns into salt or something when the data is 100

chrome beacon
#

I believe it's tied to the item

#

now I haven't used that in years so let me check

inner mulch
#

ok thanks

chrome beacon
#

yeah does look like it's tied to an item

#

Not sure why you need it to be universal though

#

If you want to prevent the loss of the item when replacing it with your own you can simply store it in PDC

inner mulch
chrome beacon
#

but why?

inner mulch
#

to make an invisible projectile entity

#

to finally stack armorstnands :)

lost matrix
#

🤨

hybrid turret
#

armorstnands

inner mulch
lost matrix
#

I always use projectiles to stack armorstands.
Because how else would you do it, if not with Projectiles...

hybrid turret
#

can basically eveything be stored in a base64 string?

young knoll
#

Pretty much

hybrid turret
#

that's pretty sick, ngl

inner mulch
lost matrix
#

Im gonna ignore the very generalized premise of this question and just gonna say yes.
@hybrid turret

hybrid turret
#

i mean yeah i intentionally generalized it bc i mean it that way

young knoll
#

If you can convert it to bytes you can base 64 it

hybrid turret
#

as long as it has bytes it can be stored in a b64 string?

#

oh

#

nice

young knoll
#

And you can convert anything to bytes with enough effort

hybrid turret
#

right

#

bytestream and stuff is a thing

lost matrix
#

You can technically store anything you want by engraving it into the wall of your neighbour in hex.
Doesnt mean thats always a good idea.

young knoll
#

Region files are technically a bunch of bytes

young knoll
#

So let’s base64 region files

inner mulch
chrome beacon
#

Just have one invisible model and use that

inner mulch
#

so i can reuse :(

#

and im not sure how to store it then

chrome beacon
#

??

inner mulch
#

i was going to have an enum with all custom models

#

and their names

#

but now

#

its hard

young knoll
#

What is your actual goal

chrome beacon
#

You're not making much sense

young knoll
#

Im getting xy vibes

inner mulch
#

wait a minute

chrome beacon
inner mulch
#

no this is not problem, but

#

i want to store the custom model data in an enum

#

so i have it named

chrome beacon
#

sure you can do that

inner mulch
#

but because its not universal

#

its pretty stupid

chrome beacon
#

??

inner mulch
#

CustomModelData.INVISIBLE cannot be applied to everything

#

therefore it doesnt make much sense

young knoll
#

You could just have a constant itemstack for the invisible model

chrome beacon
#

^^

inner mulch
#

thats true would i need to call .clone everytime

#

so its not all the same reference

young knoll
#

Do you intend to mutate it

#

Or just shove it on a projectile

inner mulch
#

currently projectile

young knoll
#

Then no need to clone

inner mulch
#

ok

young knoll
#

Have fun making the bedrock texture pack too :p

inner mulch
#

im currently looking how to convert it :/

hybrid turret
#

imagine supporting bedrock

inner mulch
#

why cant minecraft just be all the same in both versions

young knoll
#

It’s probably not that hard for a single invisible item

inner mulch
#

textdisplays in minecraft bedrock when?

#

😔

young knoll
#

Idk ask bill gates

inner mulch
#

when you have a game and create a mobile version why do you think its a good idea changing game mechanics :(

eternal oxide
#

because everyone always thinks they can do it better

chrome beacon
#

Bedrock has stuff Java doesn't

#

Java has stuff Bedrock doesn't

ivory sleet
#

The market thingy would be cool to have in Java

#

so much cool content :>

inner mulch
#

tbh i think every1 would play windows edition if it wasnt feeling so off

chrome beacon
#

doubt

inner mulch
#

the best part is its c++ and can render chunks 10x faster

chrome beacon
#

c++ will just make is harder for people to make proper mods

young knoll
#

It also really isn’t that much faster most of the time

young knoll
#

Not the microtransactions

ivory sleet
inner mulch
#

armorstand markers can be teleported async?

chrome beacon
#

no

lilac dagger
#

teleportation is done in sync so no

inner mulch
#

uhm is the teleportasnyc method only paper?

lilac dagger
#

yeah

#

but why would you want async?

inner mulch
#

idk i was just wondering how that is possible

#

isnt that illegal doing stuff async

icy beacon
#

if you conform to ocp then no

hybrid spoke
hybrid spoke
#

you just cant fuck around with the world async

inner mulch
#

i will try this now :)

#

its illegal

#

and async

#

which is the same

#

i think the serrver is crashin

#

MY PC TOO

#

ITS LAGGING SO HARD

#

its wont close

#

help

ivory sleet
#

what the flip

inner mulch
#

much better :)

ivory sleet
#

not sure if you’re trolling or just never done multithreading before

inner mulch
#

im not trolling just testing something

ivory sleet
inner mulch
#

its for science

ivory sleet
#

mhm of course

lost matrix
#

Yeah, while(true) wont max out your CPU because the code feels what you want through ethereal energy and goes easy by pausing a bit

river oracle
inner mulch
#

it doesnt work

#

😔

icy beacon
#

not enough ocp

lost matrix
#

Because teleporting 50 times in one tick will literally just result in every 50th teleport being registered

inner mulch
#

but is teleportasync

#

why is this even a thing

eternal oxide
#

laziness

lost matrix
#

Ah, in that case the server spins up to 200 TPS

ivory sleet
inner mulch
#

i mastered ocp

ivory sleet
#

yup

icy beacon
#

you whaT???

inner mulch
#

i know every secret of the universe

icy beacon
#

no fucking way tell me everyithn

ivory sleet
#

ocp = know every secret of the universe

inner mulch
#

yes

#

with my ocp code i can determine every atom movement

icy beacon
#

you are that one thing

#

what is it called

#

1 sdec

#

laplace's demon

lost matrix
#

teleportAsync is a utility method, used to teleport entities into chunks which arent loaded yet.
It uses papers async chunk loading system and teleports the entity as soon as the chunk is ready, simply to prevent force loading a chunk on teleports.
It is async, but not on a different thread.

icy beacon
#

you are laplace's demon

lost matrix
#

async != multithreaded

inner mulch
#

(perfect size for stacking armorstands)

lost matrix
#

I dont know what that means. Im just gonna make a few assumptions.
Mount your entities like this:

  • MarkerArmorStand
  • Invisible Slime of size 1
  • MarkerArmorStand
  • Invisible Slime of size 1
  • MarkerArmorStand
  • Invisible Slime of size 1
    etc
#

Or try an ender mite

inner mulch
slender elbow
#

just use a text display + translation?

inner mulch
#

text display doesnt exist on bedrock

lost matrix
#

Mounting is always calculated using the hitbox of the mounted entity.
You cant have stacked mounting without a hitbox.

inner mulch
#

snowballs have none tho and can be stacked, or do they have one?

lost matrix
#

Snowballs have a hitbox as well. But projectiles have different behaviors embedded in both client and server.

inner mulch
#

okay so there a no entities wihch can be invisble but also cannot be hit?

slender elbow
#

text displays :)

inner mulch
#

bedrock edition :(

#

i love text displays

slender elbow
#

sucks for them

lost matrix
#

Write datapacks then i guess?

inner mulch
#

is that still java

lost matrix
#

Not even close

inner mulch
#

c++?

slender elbow
#

lol

inner mulch
#

any good language?

lost matrix
#

No. Its a weird scripting language from mojang

slender elbow
#

you mean mcfunctions?

inner mulch
#

and datapacks are allowing me to change the game more than plugins?

lost matrix
#

Which you write in a random text editor

slender elbow
#

that's just regular Minecraft commands in a text file lol

lost matrix
inner mulch
#

i dont really get how datapacks are gonna help?

river oracle
#

Datapacks are less powerful than plugins tbh

inner mulch
#

do they have anything plugins dont

slender elbow
#

yes

lost matrix
#

They might work for both versions

river oracle
#

Bedrocks is much more capable and powerful not to mention in general different

#

Java Bedrock support in one is a mistake

#

It'll never be perfect

slender elbow
#

parity updates :copium:

lost matrix
#

My approach would be this: Screw bedrock players and tell them to go where the pepper grows

inner mulch
river oracle
#

Ditch java

lost matrix
#

Im 95% sure that this doesnt translate into english... "go where the pepper grows"

inner mulch
#

c++ ?

#

yes this only makes sense in german

eternal oxide
#

go where the sun doesn't shine

river oracle
# inner mulch c++ ?

Look at bedrock server software it's comparatively primitive. If you wanna do bedrock do it right

inner mulch
lost matrix
# inner mulch c++ ?

The source code is compiled binaries.
So if you wanted to write a bedrock implementation, then would have to start from literally scratch.

river oracle
inner mulch
#

no server software

chrome beacon
lost matrix
river oracle
lost matrix
eternal oxide
river oracle
#

Iirc the PHP one is much more developed

inner mulch
#

wait what

#

it wasnt a joke?

chrome beacon
#

no

inner mulch
#

why php out of all languages?

ivory sleet
#

why not :p

river oracle
#

You don't really have room to talk of you've never used it

slender elbow
#

someone probably started some implementation in any language you can think of

uneven crater
#

i opened intellij and my autocompletion doesnt work anymore and if i try to compile my plugin the following error occurs: java.lang.NoClassDefFoundError: com/sun/tools/attach/AttachNotSupportedException. i tried reinstalling intelli, invalidating cache but none worked.

slender elbow
#

now whether or not it is mediocre is a whole other story

river oracle
lost matrix
icy beacon
#

explode??

#

what does that do

chrome beacon
#

split

icy beacon
#

render a memory address unusable?

icy beacon
#

that's boring

river oracle
#

I've never used php just saying lot of people shit on jt and don't know anything about it

icy beacon
#

i will shit on php until it stops being funny

uneven crater
radiant laurel
#

hey! i have a plugin which is in turkish language. I need to translate in english. I am a youtuber and bought these plugins from a dev but they were in turkish. I don't have the source code as the dev have lost them. I have around 15 plugins which needs to be translated. If anyone can help please message

The real problem is not translation of Turkish to English but translation of the plugin as it doesn't have any source code...

I CAN EVEN PAY!

Contact :-

Discord - thunderzlucky
Email - techthunderz443@gmail.com

lost matrix
icy beacon
#

so this was not enough huh

uneven crater
lost matrix
uneven crater
#

seems like all are updated

shadow night
lost matrix
uneven crater
#

it worked before, but one day i opened it and it just didnt work anymore

lost matrix
#

Is it just this one project? Or does that happen with a clean new project as well?

radiant laurel
#

i have 15 plugins which needs to be translated

uneven crater
#

oops, wrong msg replied

lost matrix
uneven crater
#

tried with root perms, same issue

#

nope still the same error with java 21

lost matrix
#

What OS are you on?

uneven crater
#

endeavour os

lost matrix
#

No idea. Update your packages as well.

uneven crater
#

you mean my system or are there intellij packages?

stoic cosmos
#

I have a system so that you run a command which sets a boolean as true and then when you interact with a block it has special rules. It doesnt work like the boolean doesnt change but it does change in the command but just not in the interact event

orchid trout
#

?nocode

undone axleBOT
#

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

lost matrix
uneven crater
#

is you boolean static?

stoic cosmos
#

I spent 2 hours looking asked for help then found it instantly

#

it was me registering the listener and the command executor both as new

lost matrix
#

Yeah...

#

Classic

stoic cosmos
#

well atleast i wont do it again

orchid trout
lost matrix
# stoic cosmos well atleast i wont do it again

Btw you should not distribute variables like that.
Your boolean should be in a manager class of which only one instance exists.
Your command and listener should be separate classes. Then pass your manager to both your listener and command.
This way both always see the same content from the manager.

orchid trout
#

a jar file is just a zip right

shadow night
orchid trout
#

ive seen people do it before

eternal oxide
#

You can just string replace, but you have to keep them the same length

uneven crater
#

thanks @lost matrix , full system upgrade did the trick, even tough my system kernel paniced on reboot lol

shadow night
tidal glacier
#

anything

#

can you come DM

#

i will explain you.

inner mulch
#

how can i check if a list contains an index?

#

without causing indexoutofboundsexception?

shadow night
#

.size()?

inner mulch
#

genius

#

i never thought of that

eternal oxide
#

what? list contains an index?

shadow night
inner mulch
shadow night
lost matrix
#

An ArrayList yes, but there are List implementatins which arent backed by an array

lost matrix
#

Yes

#

It contains linked nodes, which just point to the next node in the list.
Thats why LinkedList index access is O(n) instead of O(1) because it needs to start iterating from the first node and then increment a counter on each node jump

shadow night
#

Oo

#

And what are the pros of that list

lost matrix
#

It is an actual garbage collection with only a very specific benefit

blazing ocean
lost matrix
#

Removal while iterating is instant (constant time)
So methods like removeIf() or retainAll are really good on it, because it can just iterate through nodes
and if it found something to remove, it simply takes the node before it and the node after, and then links them together
while throwing out the currently linked node. This makes it really efficient for removal while iterating.

slender elbow
#

inb4 even the author of java's LinkedList considers it useless

shadow night
#

I see no real usages of it, but who knows

lost matrix
#

lul

slender elbow
lost matrix
shadow night
#

What is it

lost matrix
#

So create an abstract representation of your Projectile (the implementation doesnt matter, can be whatever you want)

public interface Projectile {
  void tick();
  boolean isDone();
  void onHit(Block block);
  void onHit(Entity entity);
  void onTimeout();
}

And a Task that starts with the server:

public class ProjectileTask implements Runnable {

  private final List<Projectile> projectiles;

  public ProjectileTask() {
    this.projectiles = new LinkedList<>();
  }

  @Override
  public void run() {
    this.projectiles.removeIf(projectile -> {
      projectile.tick();
      return projectile.isDone();
    });
  }
}

This is a really efficient way of ticking every element once, and then throwing those out that shouldnt be ticked anymore.

#

(Was an example from 2 day ago i think)

slender elbow
#

I mean unless you have hundreds of thousands of elements in there, the performance benefit is not gonna be noticeable

#

screw that, millions, arraycopy is absurdly fast for mere kilobytes

lost matrix
#

Depends on what you use. An ArrayList gets bad really really fast as removal while iterating is O(n^2) as it needs to shift the entire array every removal

slender elbow
#

big o doesn't matter unless you expect to work in separate orders of magnitudes

lost matrix
#

Meh, then lets go for memory footprint. arraycopy allocates a ton of space that needs to be GCd

slender elbow
#

short lived objects generally aren't an issue for modern GCs

#

we're talking kbs unless you have millions of elements

lost matrix
#

Im gonna buffer my lists with 10k emily dummy objects on each side from now on so you dont go in there and swap my impl from LinkedList to something atrocious

slender elbow
#

wtf

#

what is this slander

lost matrix
slender elbow
#

you're lucky I can't use emotes here

lost matrix
inner mulch
#

is working with the protected access modifier good practice or should i create an interface where the interface is always returned instead of the impl and it contains the api?

lost matrix
#

protected fields make sense if you want to give your child classes access to your fields.
It kind of violates the open closed principle and is primarily useful for sealed classes.

protected methods on the other hand are more lenient

inner mulch
lost matrix
#

They are completely disjunct from each other and i dont see a correlation between them. No idea how you compare an access modifier with an object type...

inner mulch
#

when i protect stuff from a class it can be used in the inner workings of the program, but not accessed in the api. when using an interface its the same, all the methods are hidden of the impl except the methods which the interface provides

lost matrix
#

Alright. I still dont see a correlation. You can use protected fields and implement an interface without a problem.

#

If you return an interface, then you will never be able to access the fields of the impl. No matter what access modifier they have.

acoustic pendant
#
                                if (!player.isFlying()) {
                                    Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "fly " + player.getName());
                                }
                                Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "fly " + player.getName() + " off");
                                Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "fly " + player.getName() + " on");```
#

What would be the best way to enable fly to a player?

#

because the first one, the player could not be flying but still has the fly activated right?

lost matrix
#

player.setAllowFlight(true) i suppose

acoustic pendant
#

Yea, i know that

eternal oxide
#

always use API over commands

acoustic pendant
#

But i prefer enabling the fly without that method to prevent bugs if other plugins manages better the flying

eternal oxide
acoustic pendant
#

oh

eternal oxide
#

if you want plugins to intercept and manage flight

acoustic pendant
#

but, should i be doing the first or the second method then?

#

because the first one could disable flight instead of enabling it right?

eternal oxide
#

there is the crux of the issue. fly command in other plugins may vary

acoustic pendant
#

or i can just enable it without any problem xd

valid burrow
#

that doesnt make any sense

acoustic pendant
#

maybe xd

valid burrow
#

at the end the /fly command uses the same method to make players fly as spigot .setAllowFly does

acoustic pendant
#

However i got advised time ago that this fly method wasn't perfect, as the player could recieve damage or others

valid burrow
#

what does the .fly method have to do with damage lmao

#

you do realize that .setAllowFlight and /fly use the same methods deep down

#

so any problem that method would cause

#

/fly would have the same problem

acoustic pendant
#

I mean

#

it probably isn't a thing but was concious about that

valid burrow
#

yh well

#

just be aware

#

dispatching commands

#

is usually not a good idea

#

no matter how you do it

acoustic pendant
#

well, if the other plugin is a dependency I don't see why it is bad

icy beacon
#

for one, you never know for sure what the commands do under the hood

#

just do your own thing instead of depending on some random plugin which might also randomly update

lost matrix
#

You should always call methods and never go the unnecessary extra route of dispatching commands.
It could result in undefined behavior.

acoustic pendant
#

Yea yea

lost matrix
#

Dispatching commands is also not compiletime safe. Calling methods is.

acoustic pendant
#

But if you want something from other plugin

#

calling method could not be the way

icy beacon
#

some plugins have apis

acoustic pendant
#

even if you have the dependency

acoustic pendant
lost matrix
#

Its always the way.

icy beacon
#

what plugin are you currently referring to

naive meadow
#

How can i remove this warning? Its there because of DiscordJDA but I dont know how can i remove it on spigot.

valid burrow
#

lemme check how i did it in mine

#

i used LoggerFactory

#

(logback)

remote swallow
#

you have to shade differeng things

acoustic pendant
#

but there could be

naive meadow
valid burrow
#

and add this in the main

icy beacon
valid burrow
#

well u dont have to do the config part

icy beacon
#

every competent plugin that many servers depend on should have an api for other developers

valid burrow
#

you can permanently disable it ofc but

remote swallow
valid burrow
#

i prefer to have a debug mode

remote swallow
#

slf4j has a easier way

valid burrow
#

its 3 lines

#

how is that not easy enouhg lol

remote swallow
#

slf4j is 1

#

get absolutely shit on

#

or per package

#

technically Configurator is a log4j class so logback might have it

valid burrow
remote swallow
#

it looks ugly tho

#

you would have casting on it and like weird stuff

valid burrow
#

@icy beacon why r u adding more reactions than sending messages

naive meadow
#

its still there.

valid burrow
#

1 sec

#

put ur class in here

#

i wanna see what imports u used

#

?paste

undone axleBOT
tidal glacier
#

Can anyone help me in plugin translation

#

I can pay 120$

#

120$

orchid trout
#

?services

undone axleBOT
mighty cave
tidal glacier
orchid trout
#

well noones gonna help you here either

tidal glacier
orchid trout
#

put your request on the forums and wait

tidal glacier
#

Just translation is problem

tidal glacier
#

But let's see if anyone can help me here

orchid trout
#

this isnt the place for this

tidal glacier
#

Yeah, actually the whole plugin

remote swallow
mighty cave
remote swallow
#

we wont do that for free or spoonfeed it you

tidal glacier
#

Bro

remote swallow
#

find somone on forums and dm them

tidal glacier
#

But I made a post 2 days ago and found no one

remote swallow
#

find people in offering and dm them then

naive meadow
# valid burrow 1 sec
import org.slf4j.LoggerFactory;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
#

i cant find LoggerFactory in logback

tidal glacier
eternal oxide
valid burrow
#

import org.slf4j.LoggerFactory;

#

is correct

tidal glacier
#

And even today

remote swallow
#

dont delete them

#

just bump them

naive meadow
eternal oxide
#

I looked yesterday, after you said you had posted

valid burrow
remote swallow
tidal glacier
#

I have posted 2

remote swallow
#

send the link

eternal oxide
#

?services

undone axleBOT
eternal oxide
#

not there you didn;t post

tidal glacier
#

I think not here, my acc is new I can't post here

remote swallow
#

find someone on the offering developers section and send them a dm

eternal oxide
#

Then you did not post

remote swallow
#

ask them if they will translate it for you and there you go

valid burrow
naive meadow
# valid burrow can you send me that as an acual text and not image
[18:29:44 ERROR]: Error occurred while enabling DcBoosterSync v1.0-SNAPSHOT (Is it up to date?)
java.lang.ClassCastException: class org.apache.logging.slf4j.Log4jLoggerFactory cannot be cast to class ch.qos.logback.classic.LoggerContext (org.apache.logging.slf4j.Log4jLoggerFactory is in unnamed module of loader 'app'; ch.qos.logback.classic.LoggerContext is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @17af5f5b)
        at me.adabugra.discordboostsync.DiscordBoostSync.onEnable(DiscordBoostSync.java:93) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.16.5.jar:git-Paper-794]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:599) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:298) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Paper-794]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794]
        at java.lang.Thread.run(Thread.java:840) [?:?]
tidal glacier
remote swallow
eternal oxide
#

You've spent three days asking, and instead of doing as we all told you you refuse and still you have no help.

valid burrow
# naive meadow

try this:

org.apache.logging.log4j.core.LoggerContext loggerContext = (org.apache.logging.log4j.core.LoggerContext) LogManager.getContext(false);
Configuration config = loggerContext.getConfiguration();
LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
loggerConfig.setLevel(Level.ERROR);
#

if that doesnt work show me ur pom

naive meadow
#

should i add log4j as depencendy?

valid burrow
#

yh

tidal glacier
stoic cosmos
#

        org.bukkit.World bukkitWorld = Bukkit.getWorld("world");

        com.sk89q.worldedit.world.World world = BukkitAdapter.adapt(bukkitWorld);

        try (EditSession editSession = com.fastasyncworldedit.core.Fawe.instance().getWorldEdit().newEditSession((com.sk89q.worldedit.world.World) world)) {

            Region region = new CuboidRegion(pos1, pos2);

            BlockType toType = BukkitAdapter.asBlockType(to);

            BlockType fromType = BukkitAdapter.asBlockType(from);

            Mask fromMask = fromType.toMask();

            editSession.replaceBlocks(region, fromMask, toType);

            Bukkit.broadcastMessage(""+fromMask);

            Bukkit.broadcastMessage(""+toType);

            Bukkit.broadcastMessage(""+region);
            editSession.flushQueue();

        }

    } ```fawe api meant to replace blocks in an area the stuff broadcasted is correct I dont know why it doesnt replace.
naive meadow
smoky anchor
tidal glacier
valid burrow
#

for (LoggerConfig logger : config.getLoggers().values()) {
logger.setLevel(Level.ERROR);
}

eternal oxide
#

Dude, you wasted THREE days asking in here (The WRONG place) and have NOT posted or made tickets as you have been instructed. Instead you wasted all that time annoying people.

gritty inlet
#

@eternal oxide Where do you generate a ticket? I'm new.

remote swallow
#

ask development related questions here, server related questions in #help-server

naive meadow
#

do i need to shade log4j?

eternal oxide
gritty inlet
#

Oh okk

#

I'm trying to understand how to just run it on windows 11. lol

#

I haven't had this much trouble on a launcher before.

hybrid turret
#

Is Player being extended by anything?
I‘m wondering bc Bukkit#getOnlinePlayers returns a Collection<? extends Player>

quaint mantle
#

HumanEntity, CraftPlayer

lost matrix
hybrid turret
#

Wait what i though that‘s the other way around (at least for HumanEntity)

hybrid turret
quaint mantle
#

Yup

hybrid turret
#

Lol

icy beacon
#

Afaik there's also basically no reason for HumanEntity because it's basically Player lol

quaint mantle
#

? Doesn’t make any difference

young knoll
#

Yeah all HumanEntity are player

#

At least so far

slender elbow
#

it's gonna stay like that on the server, HumanEntity represents Minecraft's Player, it's just some common player entity class with shared logic between ServerPlayer and ClientPlayer

hybrid turret
#

How would I convert a List of Objects to a byte-array?

#

Or wait

#

No nvm

naive meadow
solemn meteor
#

what are all the events that can be triggered where an item is being moved

solemn meteor
hybrid turret
#

O- oh

#

Fair point, why did i not google before asking?💀

#

Bit embarressing if i‘m honest

#

Thanks anyway :)

lost matrix
#

PS: This i pretty useless for most cases unless you specifically design your objects for it

icy beacon
#

Is there an event that gets called when a TNT is ignited, from which I can also get the block? BlockIgniteEvent does not seem to do the trick (does not get called)

ocean hollow
#

how can I remove knockback from Player#damage(damage, player)?

eternal oxide
#

cancel it or set the final vector to zero

icy beacon
#

Oh I totally missed that, thx, will test that

hot dune
#

Guys, hello! I have a problem with InventoryClickEvent with custom inventories. This event works with all vanilla inventories (chests, player inventory etc.) but doesn't work with my custom created inventory. I have tried to do this simple method, but nothing shows up in console. Event is registered and other events in this class work fine. Is there any ideas why it doesn't work?

lost matrix
#

What is a "custom created inventory" in your case?

hot dune
lost matrix
#

The InventoryClickEvent is fired for those

hot dune
#

well, I don't receive anything in console for the sout(e.getAction()) (lazy to type the full method xd)

lost matrix
#

What happens if you click into a random chest. Do you get the event output in that case?

hot dune
#

yes

lost matrix
#

That sounds pretty much impossible unless an exception is being thrown.

icy beacon
#

Given that it's 575 lines I wouldn't be surprised if you are cancelling it somewhere

hot dune
#

Here's an output for the random chest and no PICKUP actions from my GUI inventory

hot dune
icy beacon
#

Try to see if you call setCancelled literally anywhere, it could be that you are cancelling the event under some obscure conditions that you happen to meet in this case

icy beacon
#

Probably not the case then

#

I'd suggest unregistering basically all your listeners and only leaving this one to see if that helps. If it does, something is faulty in the ones you've unregistered

hot dune
#

okay, let me check

icy beacon
#

Not sure if /reload will promptly unregister the handlers btw you might need to restart

eternal oxide
#

you are opening the inventory to the player as normal?

lost matrix
#

im hearing /reload?

icy beacon
#

For development, especially when the plugin is not too large, it's fine imo

#

I still restart to be safe but I don't see the need to restart when your plugin is, say, one command and two listeners

icy beacon
# lost matrix <:PES2_PoliceHit:682654354334941218>

Do you think there's a way to correlate the ignited block to the resulting entity in TNTPrimeEvent? I don't see how I could do that except for like calling getNearbyEntities with radius 0.1 which is hacky

lost matrix
#

Check if the EntityChangeBlockEvent is fired. Otherwise no idea.

hot dune
#

Well, I disabled all listeners and seems like I actually cancel it wherever, time to search where I do it xd

eternal oxide
#

you know opening the custom inventory is going to also fire an open event

lost matrix
#

If you want to write a robust GUI lib

hot dune
hot dune
#

and the gui inventory is a chest one

slender elbow
lost matrix
#

Yes, with 10k emilies padded on both ends to repell you from touching it

slender elbow
#

does it follow the ocp..?

lost matrix
#

Nope, breaks it wherever i can

slender elbow
#

god damn

hot dune
icy beacon
# lost matrix Check if the ``EntityChangeBlockEvent`` is fired. Otherwise no idea.

No, unfortunately not. Maybe this is an XY problem. I'm trying to implement custom TNTs and for that I give a NamespacedKey to the TNT block with CustomBlockData. I'm able to detect the ignition, but to execute some effects I imagine I would need to listen to the the explosion event and check if the TNT is a custom one. Perhaps this is just wrong design?

lost matrix
#

Idk, cancel the event and spawn your own primed TNT which has a custom fuse time and some PDC data. Then on EntityExplodeEvent you can add your shenanigans.

icy beacon
#

That is a good idea

#

Thx 🙂

icy beacon
# icy beacon Thx 🙂

Works fine, though because I'm getting the original location from a block, it snaps to (X = .5; Z = .5) and thus the location isn't accurate. I'll see what I can do about that tomorrow, or maybe you have an idea.
(example before ignition & after - moves .5 blocks to the left & to the right because that's the "block location")

  @EventHandler
  public void onIgnited(final TNTPrimeEvent event) {
    final Block block = event.getBlock();
    final Location location = block.getLocation();
    final NamespacedKey key = // some stuff

    event.setCancelled(true);
    block.setType(Material.AIR);
    location.getWorld().spawn(location, TNTPrimed.class, tnt -> {
      if (event.getReason() != TNTPrimeEvent.PrimeReason.EXPLOSION) tnt.setFuseTicks(25);
      else tnt.setFuseTicks(0);
      
      tnt.getPersistentDataContainer().set(key, PersistentDataType.BYTE, (byte) 0);
    });
  }
young knoll
#

Just add 0.5, 0, 0.5

crystal knot
#

Hey !
I want to play a sound to a player, but I don't want that when the player go away, the sound disapear

slender elbow
#

you can probably use the player itself as entity sound source

crystal knot
#

ye it work ! Thanks

mossy shadow
#

I am getting this error NoClassDefFoundError: com/mysql/cj/jdbc/MysqlDataSource
Does someone know how to implement the class into grandle that the error is resolved?

subtle otter
#

any1 able to help me im trying to make it so i can craft a custom sword with certain items but theres more than one custom sword and i need to make a seperate recipe for them,

#

private void removeMaterials(Inventory inventory) {
inventory.removeItem(new ItemStack(Material.DIAMOND, 3));
inventory.removeItem(new ItemStack(Material.STICK, 2));
}

#

like how wud i make it so i can craft 2 swords instead of only being able to craft one bc right now i can only craft one as there both under the same recipe and idk if i need to make it so each recipe is asigned to each sword or can i just make more inventory.removeItem(new ItemStack(Material.DIAMOND, 3)); code likie this?

young knoll
#

?

#

So it's not a proper crafting recipe

subtle otter
#

nah it is now had to change the whole code ahahhahaha

ionic thicket
#

Hi, I'm trying to create a Boss for a plugin.
the usual 10 hearths of a skeleton aren't very the perfect choice for a boss.
https://pastebin.com/EQySH9yD

young knoll
#

#getAttribute(Attribute.GENERIC_MAX_HEALTH)#setBaseValue

#

iirc

ionic thicket
#

what

#

what's the #?

vast ledge
#

Placeholder

young knoll
#

Indicates it's an instance method

vast ledge
#

or that

#

not very good at describing stuff

ionic thicket
#

Ye, also im quite new to OOP so I don't really get everything xd

vast ledge
#
object.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(yourValue)
ionic thicket
#

so the object would be skeleton

#

right?

vast ledge
#

Yea

ionic thicket
#

what about "Attribute"

vast ledge
#

wdym?

ionic thicket
#

skeleton.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(30);

vast ledge
#

what do you not understand?

ionic thicket
#

well cant really send images here but it's not quite understood by my ide

#

oh wait. I have to import a class before

vast ledge
#

dm me the img

vast ledge
#

Kinda important xD

ionic thicket
#

xd

young knoll
#

After you increase the max health you can then do setHealth

ionic thicket
#

oh

ionic thicket
steel dirge
#

anyone know about the new snapshot update?
Whats up with components on blocks?
https://i.imgur.com/LX9ClkH.png

Custom model data can be applied now? or is this related to the hardness and fire resistance etc?

vast ledge
#

Components = Attributes afaik

steel dirge
#

just because ik bedrock calls it components

#

or block geometry components

vast ledge
#

Yea, they changed it to components in a new snapshot

#

Ah

#

Instead of NBT its now called Components

steel dirge
#

is it just a rename? or does it add things

vast ledge
#

Not sure you're gonna have to check the wiki

steel dirge
#

iirc blocks loose nbt's when placed

young knoll
#

It’s how items store data now

#

Rather than NBT

#

It’s still saved as NBT, but it gets parsed into components

steel dirge
#

makes sense

vast ledge
#
https://www.youtube.com/watch?v=yQAyKFfgmpU
#

Phoenix explains it pretty well

#

gotta love how he makes his stuff

#

But you can change alot now

#

like max stack size

#

etc

#

just give it a watch i think he also links the update log, so you can check it out yourself

young knoll
#

Yeah there’s a bunch of new stuff you can do

#

Stack size, edibility, tool type, etc

vast ledge
#

and you can make litteraly anything eatable, which is hilariouse

young knoll
#

I think you can also hide the tooltip

#

Which is cool

proven musk
#

can you have a special toolip show up when players hold shift

wet breach
#

or at least understand why it is something that is needed

proven musk
#

dammit

young knoll
wet breach
#

but you don't really need components for that

#

but I guess its one solution for that

gleaming grove
#

Is there any other way than barriers blocks to make invisible colliders?

graceful oak
#

Hey guys I have been working on creating my own custom world and generation and its going well but I cant seem to change the biome of the world I create. I want the entire world to be a desert since its a desert themed world but when I add the lines 181 and 182 it seems to freeze im not quite sure if its just intensive to switch the biome since I am doing it for every block in the chunk or if im just going outside of the loaded chunks any recommendations are welcome and if you see anything else I can do to make my code more efficient or better dont be afraid to let me know I havent done much with generation before so im trying to learn

https://pastebin.com/xuWzCYXf

remote swallow
#

are you sure that location is correct

#

if x is real x not chunk x you need to divide it to get chuink x

young knoll
#

Use a custom biome provider that always returns desert

graceful oak
graceful oak
young knoll
#

It’s an interface you extend

graceful oak
#

ill take a look into this thanks

graceful oak
# young knoll It’s an interface you extend

Im not quite sure if I did this correctly im not too familiar with custom interfaces but I made this file for the Desert Biome
https://pastebin.com/M39sgFzR

Then for the full code you can look at the paste below but this is what I did
https://pastebin.com/bYrd2M6g
BiomeProvider biomeProvider = new CustomBiomeGenerator();
biomeProvider.getBiome(worldInfo, x16 + x, y, z16 + z);

young knoll
#

Just set the biome provider in the method I linked

#

That’s it

#

You can’t set biomes inside generateNoise

graceful oak
# young knoll You can’t set biomes inside generateNoise

Im kind of lost im not going to lie

@Override
    public BiomeProvider getDefaultBiomeProvider(String worldName, String id) {
        if(worldName.equals("Dim-01"))
            return new CustomBiomeGenerator();
        return null;
    }

I threw this into my main class since I did something similar to the ChunkGenerator with getDefaultWorldGenerator but it still doesnt seem to work

young knoll
#

Do it in the chunk generator

graceful oak
young knoll
#

I sent you the exact method you need to use

graceful oak
# young knoll .

I see what I was doing wrong thanks! For some reason I had string worldName instead of WorldInfo

inner mulch
#

Is there a way to get a class and subclass access to a method (i dont want the package to access it)

river oracle
#

unless the method is in the subclass

#

then you need at minimum package private

twilit wharf
#

I have a plugin that puts a armor stand as a passenger for players to give some cool effects, but then users cant teleport. How can I listen to the teleport packets or something to make sure they can still teleport? I know client side armor stands is an option, but I dont want to have to go that route. Is there another way?

wet breach
#

Just listen for teleport events. When you get one dismount the armorstand teleport player and armorstand and remount

worldly ingot
wet breach
proven musk
#

whats the best way to remove a certain amount of a specific item

#

.removeItem doesn't work for offhand and armor slots weirdly

#

I could do it manually but idk if theres a better way

proven musk
#

yep

valid burrow
#

it should though lol

#

wait lemme see

#

can i see your code?

true dragon
#

player.inventory.itemInOffHand.subtract(1) ?

valid burrow
#

so inventory.removeItem should work

#

cause i mean

#

at the end

#

inventory.getItems is just an array

true dragon
#
val enemiesInAOE = 
caster.location.getNearbyLivingEntities(rasenganAOE).filter { !it.equals(firstEnemy) && !it.equals(caster) }
                    enemiesInAOE.forEach {
                        it.velocity = it.location.toVector()
                            .add(Vector(0.0, 0.5, 0.0).subtract(caster.location.toVector()).normalize().multiply(1.5))
                    }
#

it bugs out when its called

#

any suggestions?

valid burrow
#

?doesnotwori

#

flskfjwbf

#

?doesnotwork

#

?doesntwork

true dragon
#

?

valid burrow
#

?notworking

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.

valid burrow
#

finally

worthy yarrow
#

Has anyone got experience with modelEngineAPI? If so perhaps you could provide me with an example snippet to mess around with?

echo basalt
#

I have experience with both MEG3 and 4

worthy yarrow
echo basalt
#

So.. you want to reinvent MythicMobs

worthy yarrow
#

Yes

#

If thats what mythic mobs does

sullen canyon
#

Making something with slimeworldmanager and got a bit confused how I could be ensured if the world has been loaded to bukkit before I try to teleport a player there?

that's a code snippet what I load the world with, ik I could put player.teleport into the bukkit scheduler sync task code block but it's not the case ```CompletableFuture<SlimeWorld> loadSlimeWorld = loadSlimeWorld(plugin, gameMap);
loadSlimeWorld.thenAccept(loadedSlimeWorld -> Bukkit.getScheduler().runTask(SpigotCore.getInstance().getPlugin(), () -> {
gameMap.setGameWorldName(clonedGameWorldName);
plugin.generateWorld(loadedSlimeWorld.clone(clonedGameWorldName));

        World world = Bukkit.getWorld(gameMap.getGameWorldName());
        for(String serializedLocation : gameMap.getCageSpawnPoints()) {
            Location location = ServerLocations.deserializeLocation(world, serializedLocation);
            GameMapConstructions.getInstance().spawnGameCage(location, false);
        }
    }));```
tall dragon
sullen canyon
# tall dragon what is the problem with putting the teleport inside the sync task?

I think there is no way to have it separately? Well as for me rn I have a minigame. When a player joins the server and there is no game loaded rn, then we create a new game, in the minigame class constructor we call a method loadGameWorld(); and then we return the game's class object and teleport the player who joined to the world

#

lemme know if you need more clarification because I believe I poorly explained it

#

as for now when player 1 connects to the server and it loads the game for the first time, it teleports the player 1 to regular world, but when player 2 joins he is properly teleported to the world where he is supposed to be because it was loaded before he joined

tall dragon
#

well

#

just save the gameworld uuid somewhere

#

if its there. a world is loaded and u can teleport

#

else. load a world

sullen canyon
tall dragon
#

no u dont?

#

when the first play joins, load a world and populate a uuid var with the uuid of the world. whenever a player joins check if the var is already poplulated. if it is get the world using the uuid and teleport

#

no runnables needed. unless im not understanding u correctly

sullen canyon
tall dragon
#

by either doing teleporting inside the thenAccept future, or calling some callback from there

#

you could also consider using WorldLoadEvent but idk if thats such an elegant solution

sullen canyon
tall dragon
#

but that might obviously differ for you

sullen canyon
tall dragon
#

yea i assume ur also using the new advanced slime world manager

#

i did this using the old one

sullen canyon
#

if you think it's gonna work sync I will try this once I come back home

tall dragon
#

it works for me

#

u gotta make sure u have async loading off tho

#

in swm config

#

else it aint gonna work

#

this is what i did

thin wind
#

listening to all the events like this, will cause lags right ? ``` @Override
public void onEnable() {
RegisteredListener registeredListener = new RegisteredListener(this, (listener, event) -> System.out.println(event.getEventName()), EventPriority.NORMAL, this, false);

    for (HandlerList handler : HandlerList.getHandlerLists())
        handler.register(registeredListener);

    getServer().getPluginManager().registerEvents(this,this);
}
echo basalt
#

Under IDEAL circumstances you have a uh

#

game of each type

#

or like a game service managing stuff

#

For example the way I usually do it is that I have a dedicated game service application that takes care of creating games on game servers

#

And if a game starts another is created on "the best" server

#

It's also responsible for matchmaking to the game with the most players with the given params (game type / preferred map / where party members are at etc)

#

That way you never have to create a game for a player, but rather assign a player to a given game

drowsy helm
echo basalt
#

Well there are a lot of events

drowsy helm
#

Otherwise it’s just calling an empty method

echo basalt
#

I wouldn't recommend that

#

Especially given sout does IO

drowsy helm
#

YeH, still not a good idea but it wont lag

echo basalt
#

eh

#

Given the amount of events that sout will cause an mspt increase

thin wind
echo basalt
#

If you assume 10 microseconds for each sout and a few thousand events you're already at milliseconds

sullen canyon
#

If I was to make something like hypixel with many minigames and subminigames like Skywars (Solo Skywars, Doubles skywars etc...) would the hierarchy below be okay? I assume that each point is a separate project module. Also, they are dependent on each other hierarchically, e.g SpigotCore extends Core, SkywarsCore extends SpigotCore, etc...

Core (redis, db)

  • ProxyCore
    • BungeecordPlugin
  • SpigotCore
    • SkywarsCore
      • SoloSkywarsPlugin
      • DoublesSkywarsPlugin
      • RankedSkywarsPlugin
drowsy helm
#

That being said how many events are there

#

Has to be less than 500 right

drowsy helm
#

Might be worth waiting for the new update with transfer packets, going to change proxies as a whole

#

Or just have a separate application to handle the proxy stuff and abstract it a bit

echo basalt
#

Uh

#

IIRC the way I do it is uh

#
  • Common
  • GameService
  • Spigot
    • Lobby
    • Game Server
  • Proxy
    • Velocity Plugin
#

uh

#

how tf do I do indent list

tidal glacier
#

@echo basalt
Hey

#

Anyone has minecraft but plugins which youtubers play?

hybrid turret
#

Wouldn‘t it be possible to use a record instead of a class with lombok @Data?