#help-development

1 messages · Page 577 of 1

echo basalt
#

Is it server -> client or client -> server?

somber scarab
#

okay good.. cuz I wanna workload distro these copy pastes..

echo basalt
#

Show code, you probably have some wild ray size

somber hearth
#

It's server -> client

teal kindle
#
                                    Location eye = player.getEyeLocation().add(player.getLocation().getDirection());
                                    Predicate<Entity> filter = entity -> !entity.getUniqueId().equals(player.getUniqueId());
                                    RayTraceResult result = player.getWorld().rayTrace(player.getEyeLocation(), eye.getDirection(), range, FluidCollisionMode.NEVER, false, 0, filter);
echo basalt
#

So this packet then

mellow edge
#

I can call Material.getCreativeCategory(), but for some reason some items have multiple creative categories

#

how can I get all of them?

eternal oxide
#

this is wrongplayer.getEyeLocation().add(player.getLocation().getDirection());

#

you are offsetting your ray by the direction your body is facing

echo basalt
# echo basalt So this packet then

For this you're setting:

  • The vehicle id (Entity#getEntityId)
  • The arraylist of passenger ids (single element array of a player's entity id, for example)
#
Entity vehicle = ...;
Collection<Entity> passengers = ...;

int vehicleId = vehicle.getEntityId();
int[] passengerIds = passengers.toArray(new int[0]{}); // or just loop through the collection and populate the array

PacketContainer packet = new PacketContainer(MOUNT);

packet.getIntegers().write(0, vehicleId);
packet.getIntegerArrays().write(0, passengerIds);

// send the packet
#

Gotta dip now

somber hearth
echo basalt
teal kindle
echo basalt
somber scarab
#

Okay... soooo

after imports:

echo basalt
#

You can assign that session in the try-with-resources

#

no need for it elsewhere

#

Paper has Ghast#setExplosionPower, otherwise you gotta do some tricky event stuff

somber scarab
echo basalt
#

You can create the clipboard outside

#

Then yeah listen to events

#

or use nms

#

The explosion power is usually tied to the fireball

#

well

#

The fireball's explosion power is set by the ghast

#

You can change ExplosionPrimeEvent's radius to something like a 10

#

by just checking if the projectile's shooter is your ghast

somber scarab
#

Okay I fixed the rest..

#

lets call teh functions where they need to be called

dawn ledge
#

HI,
How can i make my imports works ? I try to import WorldEdit : import com.sk89q.worldedit

tender shard
#

that's not a valid class name

#

did you even add worldedit to your classpath? are you using maven?

dawn ledge
tender shard
#

so you added worldedit as <dependency> to your pom.xml?

#

the proper import for worldedit's "main" is com.sk89q.worldedit.WorldEdit

dawn ledge
#

I think I did something wrong because the error is displayed on the sk89q word

tender shard
#

show your pom.xml

#

?paste

undone axleBOT
tender shard
#

no

#

no

#

why don't you just check the javadocs

#

there is however Explosive#setYield which changes the explosion radius

dawn ledge
tender shard
#

you are obviously using gradle and not maven

dawn ledge
#

ha

#

sorry

tender shard
#

and you commented out the worldedit dependency

teal kindle
dawn ledge
# tender shard and you commented out the worldedit dependency

yes because if I uncomment it I get this error on build : ```Execution failed for task ':compileJava'.

Could not resolve all files for configuration ':compileClasspath'.
Could not find com.sk89q.worldedit:worldedit-bukkit:.
Required by:
project :```

tender shard
dawn ledge
#

how can I know the version ?

tender shard
#

latest stable is 7.2.9

#

I'd use 7.3.0-SNAPSHOT however

dawn ledge
#

@tender shard you are just my god ty, that was just that, I've don't specified the version, I've used my actual worldedit version and it work than you so much

dawn ledge
#

HI, It's me again if someone know how worldedit library work, can he/she explain me why this code run without error but don't paste block : ```World monde = Bukkit.getWorld("Hub");
File file = new File("plugins/WorldEdit/schematics/test.schem");
if(!file.exists()){
System.out.println("FICHIER ABSCENT");
return false;
}
Clipboard clipboard;
ClipboardFormat cbf = ClipboardFormats.findByFile(file);
try{
ClipboardReader cpr = cbf.getReader(new FileInputStream(file));
clipboard = cpr.read();

        EditSession editSession = WorldEdit.getInstance().newEditSession(new BukkitWorld(monde));
        Operation operation = new ClipboardHolder(clipboard)
                .createPaste(editSession)
                .to(BlockVector3.at(0, 0, 0))
                // configure here
                .build();
        Operations.complete(operation);
    } catch (FileNotFoundException e) {
        throw new RuntimeException(e);
    } catch (IOException e) {
        throw new RuntimeException(e);
    } catch (WorldEditException e) {
        throw new RuntimeException(e);
    }```
orchid trout
#

am i using mongodb's updateMany correctly?

tender shard
dawn ledge
#

yse I use a void world

tender shard
#

btw where does this new BukkitWorld(...) come from?

#

You are usually supposed to use the bukkit adapter

dawn ledge
tender shard
#

World worldEditWorld = BukkitAdapter.adapt(myBukkitWorld);

(although tbh that usually does the same, so that's not the issue)

#

can you paste that schematic manually using worldedit?

dawn ledge
#

yes I used //schem load and then //paste

tender shard
#

pls show the whole method

dawn ledge
#
  1. //schem load test
    It say "test loaded, paste with //paste
  2. //paste
    and the schem appear in my world
timid hedge
#

Anyone?

stiff knot
#

Hey does anyone have any idea why I'm getting maven compilation failures?

#

I've tried setting the project Java version to 17 but it hasn't solved it

quiet ice
#

Remove the --enable-preview flag

stiff knot
#

where's that?

quiet ice
#

There is almost never a reason to have it

#

Uh, is this issue in IJ or maven? I'd say the former, in which case I have no idea

stiff knot
#

IJ using maven

quiet ice
#

It's likely an error somewhere in your IJ configuration

#

At worst nuke the IJ project files and reimport the project into your IDE

tender shard
#

?paste

undone axleBOT
stiff knot
#

I removed the flag but now I'm getting this

tender shard
#

which flag did you remove?

stiff knot
#

enable preview

tender shard
#

if you set source to 8, you also need to set target to 8

quiet ice
#

<target>8</target> needs to be added too

stiff knot
#

ah right okay

#

should I use 8?

quiet ice
#

Yep

stiff knot
#

alright cool, thanks!

tender shard
#

usually you either wanna use 8 or 17. if you want to support spigot 1.16 and older, you should use 8

#

otherwise 17

quiet ice
#

Or later if you really fancy that but keeping them the same is best practice

timid hedge
#

Can someone please help?

tender shard
#

why are you still using your own COnfig class instead of the FileConfiguration provided by JavaPlugin?

timid hedge
# tender shard why are you still using your own COnfig class instead of the FileConfiguration p...

Does it?

   public void onEnable() {
        System.out.println("[" + " " + "Exon" + "MC" + " " + "]" + " " + "Pluginnet er nu startet");
        getCommand("eat").setExecutor(new EatCommand());
        //Setup config
        getConfig().addDefault("Permission", "Exon.eat");
        getConfig().addDefault("Cooldown", 5);
        this.getConfig().options().copyDefaults(true);
        saveConfig();

        getConfig().options().copyDefaults(true);
        saveConfig();
tender shard
#

you can just do getConfig().getInt("Cooldown")

timid hedge
#

Why dont i have a selection called getConfig?
As you has? main.getConfig().getString

tender shard
#

probably because you didn't follow the blog post entirely

#

what is "main"?

#

show where/how you declare it

timid hedge
#
public class EatCommand implements CommandExecutor {

    private final EatCommand main;

    public OtherClass(EatCommand main) {
        this.main=main;
    }
delicate lynx
#

main should be an instance of your main plugin class, not the current class...

tender shard
delicate lynx
#

he did not read anything and just copied it

tender shard
#

also how can your constructor be caleld OtherClass? That wouldnt even compile

tender shard
delicate lynx
#

...

flint coyote
noble lantern
#

yes theyre entities so just set them invisible

quaint mantle
#

im pretty sure you're blocking the main server thread everytime a new player joins

#

whats the problem

#

any errors?

brave sparrow
#

?notworking @quaint mantle

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.

brave sparrow
#

Explain what’s happening and what you expect to happen

quaint mantle
#

that is a very useful command applaud to whoever added that

brave sparrow
#

Just their original nickname?

#

The other one works?

somber scarab
#

@wet breach guess what...

#

10 seconds.

wet breach
#

could be worse

somber scarab
#

50x50 area

wet breach
#

but, at least you are at 10-10.5 seconds so far

somber scarab
#

from top to bottom

brave sparrow
#

Have you verified your code is running in the right place

stiff knot
#

hey so I'm able to spawn a regular fireball entity but I'm just wondering, how would I adjust things like explosion power or velocity?

quaint mantle
#

what do you mean

brave sparrow
#

So you added debug statements already?

quaint mantle
#

can you explain further

#

how does it not work

#

does it not save to the file?

#

or is the nickname not being applied

brave sparrow
quaint mantle
#

its because you're using saveDefaultConfig

#

use saveConfig instead

quaint mantle
#

get rid of the savePluginConfig method

#

in the onEnable call saveDefaultConfig on the first line

brave sparrow
quaint mantle
#

and in the onDisable use plugin.saveConfig()

brave sparrow
#

@quaint mantle that’s not right

quaint mantle
#

pretty sure im right

brave sparrow
#

His player nicknames are stored in a different file

#

Not config.yml

quaint mantle
#

ohhhh

#

right

brave sparrow
#

@quaint mantle in your listener add some debug output lines to see which parts of the code are being run

#

I suspect your hasPlayedBefore check isn’t working properly

quaint mantle
somber scarab
#

?distro

#

?dis

#

hmmm

quaint mantle
#

what r u looking for

somber scarab
#

workload distribution

tall dragon
#

?workdistro

somber scarab
#

ahh thx

stiff knot
brave sparrow
#

Fireball extends Explosive, which has setYield

stiff knot
#

ah thanks!

deft thistle
#

Is this enough to calculate if the victim is going to die, but to not make it actually die?

public class EntityDamageListener implements Listener {
    private final ArenaManager arenaManager;

    public EntityDamageListener(ArenaManager arenaManager) {
        this.arenaManager = arenaManager;
    }
    @EventHandler
    public void onEntityDamage(EntityDamageEvent entityDamageEvent) {
        if(!(entityDamageEvent.getEntity() instanceof Player) )return;
        Player victim = (Player) entityDamageEvent.getEntity();
        if( arenaManager.isPlayerOnArena(victim) ) {
            ArenaModel arenaModel = arenaManager.getPlayerArena(victim);
            if( arenaModel.getArenaState() != ArenaState.ARENA_STATE_FIGHTING ) {
                entityDamageEvent.setCancelled(true);
            }
            else if( entityDamageEvent.getFinalDamage() >= victim.getHealth() ) {
                entityDamageEvent.setCancelled(true);
                ArenaDeathEvent arenaDeathEvent = new ArenaDeathEvent(arenaModel,victim);
                arenaDeathEvent.callEvent();
            }
        }

    }
}

Thank you for your attention 🙂

tall dragon
#

well if ur tryna calculate if the player will die from that hit. that aint gonna work

deft thistle
#

yeah that's what I'm trying to

tall dragon
#

since ur checking if the damage is more than the player's health

#

actually nvm

deft thistle
#

Maybe get player helath - final damage > 0 ?

tall dragon
#

im stupid that would probablyt work like that

#

yea that what i was thinking but this is essentially hte same

#

should work i think

deft thistle
#

thank you for your help 🙂

#

I'm about to ?tryandsee

#

?tryandsee

undone axleBOT
tall dragon
#

:<>

chrome beacon
#

?tas

undone axleBOT
somber scarab
sonic cosmos
#

Hi, I have problem with loading world - when I create world and i try to teleport to it server crashes

#

it's void world

#
public void generateWorld(Island island) {
        Bukkit.getScheduler().runTaskAsynchronously(SkyblockPlugin.getPlugin(SkyblockPlugin.class), () -> {
            WorldCreator worldCreator = new WorldCreator("is-" + island.getOwnerUser());
            worldCreator.generator(new EmptyChunkGenerator());
            worldCreator.generateStructures(false);


            Bukkit.createWorld(worldCreator);
        });
    }
flint coyote
#

you can't create a world asynchronous

sonic cosmos
young knoll
#

Yes

#

That’s just how worldgen is

flint coyote
#

Most things of the spigot api aren't usable off the main thread. Like changing blocks, editing inventories, teleporting etc

young knoll
#

Ideally you avoid making worlds at runtime

flint coyote
young knoll
#

Or at least try to make them at startup

flint coyote
#

Actually I did think of a way to prevent it by generating the world on another server and transfering it via http but you would still have to load the world which then again would be blocking

sullen marlin
#

Can't imagine an empty world is very slow to generate

remote swallow
#

i highly doubt you want to give every player their own world

sonic cosmos
#

yes

remote swallow
#

you should use per player world boarders

young knoll
#

Even loading an existing world from file causes a brief spike

#

Unfortunately

sonic cosmos
flint coyote
#

yup that's why using another server to generate is not a perfect solution either, sadly. Also it will obviously take longer than generating it on the same server

sonic cosmos
#

and then make algorithm to claim it or something like this

remote swallow
#

you'd wanna do it per chunk so its somewhat easier to math

flint coyote
#

It would definitly be better to use one world as opposed to ticking 40 different worlds at a time when 40 players are online

sonic cosmos
#

chunk is 16x16 but i need ~200x200 islands per player

remote swallow
#

go to the nearest chunk

young knoll
#

You can map a location to a player

#

And then treat everything within X blocks of that location as also belonging to them

sonic cosmos
#

im storing center of island so that sounds good

flint coyote
sonic cosmos
#

okey i think its no problem

#

then it should work on one world and make "islands" on it for every player

flint coyote
#

Yes. Give them some space in between if you don't want them to meet each other at the border

sonic cosmos
young knoll
#

You can then also use the pet player border api to give them nice visible borders

#

That are also impassable

sonic cosmos
#

i also want to make borders

flint coyote
#

I think he meant custom borders though

sonic cosmos
#

okey but if one island is on 0,0 then second has to be on 213,0

#

islands=208x208 and space between 5

young knoll
#

Add more space between to keep it chunk aligned

flint coyote
#

take a full chunk (or more) as space between

remote swallow
#

if i have 3 values, what could i call the third if i have key and value

flint coyote
#

when you have 3 values and those are key and value then how does the third one even match them?

remote swallow
#

idk

flint coyote
#

Is it part of them? Or is it some random other value?

remote swallow
#

3 different values

young knoll
#

So you have a key, a value, and then some third thing

remote swallow
#

yeah

young knoll
#

How does the third thing relate to the key and value

remote swallow
#

its not technically a key

#

its just me being smooth brain

flint coyote
#

Do you just wanna show code or do we have to keep guessing? How shall I name something I know nothing about

remote swallow
young knoll
#

first second and third

remote swallow
#

F S T as the generics

young knoll
#

You can also just do A B C

remote swallow
#

no

flint coyote
young knoll
#

I mean generally you should avoid such objects in favour of actual descriptive data objects

flint coyote
young knoll
#

Kek

flint coyote
#

I'm just trying to fix the design choice lol

remote swallow
#

tbh its quite useful

#

avoids me having to make/return a map for anything that has 2 different values

young knoll
#

Yeah maybe pair is

#

I believe Mojang has one of those they use a bit

#

But they don’t go beyond that

remote swallow
#

oh coll

#

do you know how i can not replace base attribute modifiers on tems

#

items

#

bc for some reason adding an extra damage modifer removes the base damage

young knoll
#

Correct

#

The base attributes are weird and don’t really exist

#

Get the base attributes and then edit them

remote swallow
#

how

young knoll
#

Material#getDefaultAttributeModifiers

remote swallow
#

smh

quaint tapir
#

Whats the simplest way to cancel knockback taking place in an EntityDamageByEntity event

young knoll
#

One tick later set their velocity to 0

remote swallow
remote swallow
#

yeah well

#

not on 1.17

young knoll
#

Lol

#

Seems like a you issue

#

Have fun with NMS

remote swallow
#

pain

#

and suffering

quaint tapir
young knoll
#

Hmm

#

Well you can cancel the event and damage them manually

remote swallow
#

oi coll

quaint tapir
#

can I apply the red damage taking visual effect even if I cancel the vent

remote swallow
#

what class is UnsafeValues in cb

young knoll
#

CraftMagicNumbers

quaint tapir
#

how so

#

does event.getEntity.Damage(5) make them go red for a moment?

young knoll
#

Yes

noble lantern
#

can Player#stopSound be ignored by the client sometimes?

#

naw wtf

#

something aint right

#

even if i play the sound a tick later

#

the client will just ignore the stopSound sometimes?

#

what type of inconsistent bs is this

teal kindle
#

Seems like raytrace result doesn’t detect entities at a short range (less than 4 blocks). Don’t know what’s wrong. This is what my code looks like
https://paste.md-5.net/pipodipazu.cs

deft thistle
#

Hey any help over there?
Console logs this error when victim is going to DIE.

[00:23:43 ERROR]: Could not pass event EntityDamageByEntityEvent to SimpleSpigotPlugin v1.0-SNAPSHOT
java.lang.NullPointerException: Cannot invoke "org.bukkit.event.HandlerList.getRegisteredListeners()" because "handlers" is null
public class EntityDamageListener implements Listener {
    private final ArenaManager arenaManager;

    public EntityDamageListener(ArenaManager arenaManager) {
        this.arenaManager = arenaManager;
    }
    @EventHandler
    public void onEntityDamage(EntityDamageEvent entityDamageEvent) {
        if(!(entityDamageEvent.getEntity() instanceof Player) )return;
        Player victim = (Player) entityDamageEvent.getEntity();
        if( arenaManager.isPlayerOnArena(victim) ) {
            ArenaModel arenaModel = arenaManager.getPlayerArena(victim);
            if( arenaModel.getArenaState() != ArenaState.ARENA_STATE_FIGHTING ) {
                entityDamageEvent.setCancelled(true);
            }
            else if( entityDamageEvent.getFinalDamage() >= victim.getHealth() ) {
                //right here the error fires
                entityDamageEvent.setCancelled(true);
                ArenaDeathEvent arenaDeathEvent = new ArenaDeathEvent(arenaModel,victim);
                arenaDeathEvent.callEvent();
            }
        }

    }
}

Thanks for the attention!

trail coral
#

are you sure you're registering it right?

deft thistle
#
        //custom events
        getServer().getPluginManager().registerEvents(new ArenaStateChangeListener(arenaManager),this);
        getServer().getPluginManager().registerEvents(new ArenaJoinQuitListener(),this);
        getServer().getPluginManager().registerEvents(new ArenaFightStartListener(),this);
        getServer().getPluginManager().registerEvents(new ArenaDeathListener(),this);
noble lantern
young knoll
#

Your arena death event is likely missing the handler methods

buoyant viper
#

also looks like a custom event, make sure ur constructing it right :v cant help there though since i just use bukkit provided ones

young knoll
#

Your custom event classes need both a static and non static getHandlers method

deft thistle
# young knoll Your arena death event is likely missing the handler methods
public class ArenaDeathEvent extends Event {

    private static final HandlerList HANDLERS = new HandlerList();
    private final ArenaModel arena;
    private final Player victim;

    public ArenaDeathEvent(ArenaModel arena, Player victim) {
        this.arena = arena;
        this.victim = victim;
    }

    public ArenaModel getArena() {
        return arena;
    }

    public Player getVictim() {
        return victim;
    }

    public static HandlerList getHandlerList() {
        return HANDLERS;
    }

    @Override
    public @NotNull HandlerList getHandlers() {
        return null;
    }
}
#

oh

#

return null

#

mb lmao

remote swallow
#

mojank weird

deft thistle
#

why do I only get these stuff when I copy paste the code

remote swallow
#

they have no way to loop over the 1.17 Items class

#

i have to use reflection probably

young knoll
#

Common outdated versions L

remote swallow
#

am i gonna get sued for showing this

#

the registry exists ig

buoyant viper
echo basalt
remote swallow
#

why do i hate this

river oracle
#

I spent 1 week on IntelliJ and I'm back to vscode

remote swallow
#

fair

river oracle
#

forgot how strict my sonar lint was

#

Warnings everywhere

#

:L

young knoll
#

Open spigot with it enabled

river oracle
#

Bukkit, CraftBukkit, and Spigot destroy my sonar lint

#

I turn it off usually

#

I'll have like 1000+ warnings

#

it stops keeping track after 999

#

so I don't know how many their truly are

remote swallow
#

how can i cache values in a map, like the stuff with computeIfAbsent

#

like i would cache the return value of a util method

noble lantern
noble lantern
remote swallow
#

cache the result of Utils.getDefaultModifiers(Attribute.GENERIC_ATTACK_DAMAGE, type, EquipmentSlot.HAND) so im not going and screaming at nms everytime i use it

#

returns a Collection

noble lantern
#

why couldn't you shove the collection returned into the map?

remote swallow
#

bc it would be different for each item

noble lantern
#

like for the equipment slots?

remote swallow
#

materials

#

different swords for example

noble lantern
#

Map<Material, Collection> ?

#

why wouldnt this work

remote swallow
#

idk what the correct formatting for the computeifabsent is

noble lantern
#

ahh for that type i see

noble lantern
#

why tf is the client ignoring stopSound wtf

remote swallow
#
    private List<AttributeModifier> getDefaultModifier(Material material) {
        return defaultMaterialModifiers.computeIfAbsent(material, type -> Utils.getDefaultModifiers(Attribute.GENERIC_ATTACK_DAMAGE, type, EquipmentSlot.HAND).stream().toList())
    }
#

all the jank

wet breach
noble lantern
#

wym?

#

like even stopping the direct sound using the key for it doesnt stop it 50% of the time

wet breach
#

I guess that went over your head

noble lantern
#

it did im kinda seeing red rn

wet breach
#

looks green to me

noble lantern
#

absolutely ridiculous mojang fucks theyre clientup so damn often

wet breach
noble lantern
#

even doing this

#

shit just ignore stopSound

#

not sure

wet breach
#

what is stop sound?

#

I thought that was to stop....the sound from playing

noble lantern
#

client doesnt think so

young knoll
#

It’s meant to stop sounds that are already playing

noble lantern
#

it just straight up ignored it 50% of the time

noble lantern
wet breach
#

I don't recall it taking a parameter like that lol

#

now I have to go look at it

young knoll
#

They are passing a category

noble lantern
#

I tried stopping the direct sound key too

#

same behviour

young knoll
#

What about stopAllSounds

noble lantern
#

i was gonna do that but wouldnt it interfere in some way?

young knoll
#

Probably

#

But does it work

noble lantern
#

not sure lemme try

wet breach
#

are you sure the category of sound is even playing?

#

also you need to wait a tick between playing and stopping

noble lantern
#

i am

#

i even have a click cooldown

#

theres like 4 cooldowns

wet breach
#

also some sounds can't be stopped in the middle of their playing as well

noble lantern
#

totalling 4-6 seconds in between each songs

noble lantern
wet breach
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

wet breach
#

have you had someone else test it?

noble lantern
#

yes but not the new version

#

old version it did it, and its doing it on the new one so i assume its gonna do it to other ppl too

ivory sleet
#

Whats that

noble lantern
#

its like mojang just cant get theyre shit together

ivory sleet
#

Myeah why not try with armor stands

young knoll
#

Armorstands for old versions

#

Display entities for new ones

trim creek
#

I won't ever understnad display entties.

ivory sleet
#

That displays sth

#

For example a block

young knoll
#

The only complex part is transformations

ivory sleet
#

Yeah

#

Which requires like… some matrix knowledge

young knoll
#

Scale and translation are fine

#

But rotation uses a 4th value

noble lantern
#

WAIT YALL

young knoll
#

Witchcraft I say!

noble lantern
#

im dumb

#

ffs

ivory sleet
#

You’re trolling lol

noble lantern
#

imma cry now

#

god damnit ofc course it works now, i take back everything i said mojang im sorry

#

tasks are annoying asf i swear

young knoll
#

Lol

tender shard
#

Tasks.later(60, () -> { }) superior

young knoll
#

No plugin arg?

#

Cursed

tender shard
#

it gets the plugin automatically

noble lantern
#

i just made a wrapper around the methods needing plugin instances and made em static lmfao

young knoll
#

Does it use evil classpath stuff to get the plugin

#

:p

remote swallow
#

JavaPlugin.getProvidingPlugin(ClassUtils.getCurrentClass(1));

noble lantern
#

?paste

undone axleBOT
noble lantern
tender shard
# young knoll Does it use evil classpath stuff to get the plugin

first it tries JavaPlugin#getProvidingPlugin, and if that fails, it does evil stuff https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/JeffLib.java#L149

GitHub

Avoid writing the same code over and over again - use JeffLib for your Spigot plugins! - JeffLib/core/src/main/java/com/jeff_media/jefflib/JeffLib.java at master · JEFF-Media-GbR/JeffLib

young knoll
#

Evillllll!

tender shard
#

no

#

no

#

you could use a falling block or block display and move that 0.5 blocks down

#

although IIRC block displays are a tad smaller than a normal block

young knoll
#

You can just scale em then

tender shard
#

ah ok

#

nah just use a blockdisplay with a custom transformation

#

here's half an ice block

young knoll
#

Hehe he flat

trim creek
tender shard
#

just spawn a blockdisplay, set the block to ice, create a transformation object with a vec3f 1, 0.5, 1 as scale, and then set it to the display

#

don't forgot to set all these things in the consumer, not after spawning the entity

young knoll
#

Should work

#

Just add the consumer

#

Are you depending on the right api version

#

Depends

remote swallow
#

what version

tender shard
#

sth like this should do

    public static void spawnHalfIceBlock(Location loc) {
        loc.getWorld().spawn(loc, BlockDisplay.class, display -> {
            display.setBlock(Material.ICE.createBlockData());
            Transformation transformation = display.getTransformation();
            display.setTransformation(new Transformation(transformation.getTranslation(), transformation.getLeftRotation(), new Vector3f(0, 0.5f, 0), transformation.getRightRotation()));
        });
    }
#

haven't tested

young knoll
#

You need 1.19.4

#

Or above

tender shard
#

1.19.3 is outdated

#

no, you can't do anything in 1.19.3

remote swallow
#

if ur server runs 1.19.4 yea

young knoll
#

And if your server still runs 1.19.3

remote swallow
#

update

remote swallow
#

yeah just bump api version

tender shard
#

block displays are fun

young knoll
#

I agree

remote swallow
#

just change the .3 to .4

young knoll
#

Idk go ask purpur

remote swallow
#

<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>

<dependencies>
<!--This adds the Spigot API artifact to the build -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

tender shard
#

dude with displays one can finally build literally anything

young knoll
#

Yep

tender shard
young knoll
#

It’s a shame they are entities tho

tender shard
#

well more like 7 frog lights

trim creek
#

Wideing Table.

young knoll
#

They are almost custom blocks

#

But just not quite

#

Mojang plz

dire marsh
#

I wish the block displays had transparency. would work great for me

tender shard
#

aint nobody gonna trip over this hook

small holly
#

Damn I some how crashed intelliJ when editing a Lua script lol

noble lantern
#

oh god the block display users are coming out r_baby_cry hide your children

#

i needa loko into those one day though they look badass

noble lantern
#

:>

young knoll
#

Lul

small holly
#

Oh thats fine for me

#

then again the current project I am doing is 1.8

#

so not as much but ive done it in 1.19

noble lantern
#

oh intellij finally auto collpases them now so it doesnt shit the bed rendering them all

remote swallow
#

that isnt intellij collapsing them

#

its md adding editor folds

noble lantern
#

ahh

young knoll
#

Lol

noble lantern
#

i thought that was some intellij thing lmao

remote swallow
#

change the transformation

#

probabyl

young knoll
#

Yes

noble lantern
#

itll make it .3 less tall, since you lower it on the y axis

tender shard
#

change the vector in the transformation

young knoll
#

.2 less tall

#

0.5 - 0.3 is 0.2

noble lantern
#

oh is the block height an array alr then

remote swallow
#

smol ice

noble lantern
#

oh

#

thats odd, but kinda makes sense

#

so it only works in increments of 2 i take it?

young knoll
#

No?

#

You can shove 0.2746372 in there if you want

#

I do think the game rounds it at some point, but it’s fine enough that you won’t notice

remote swallow
#

gonna make my ice 2 px smaller

young knoll
#

2 pixels is a lot

#

When you consider a block is only 16 pixels

remote swallow
#

L

#

mine are 32

noble lantern
#

someone should make 2x minecraft with block displays

#

would be a lot of work but would be hilarious

young knoll
#

I doubt the game would handle that many block displays

tender shard
#

yes

noble lantern
#

my best guess is you would tie a couple block displays together to make them act like one

sturdy flax
#

anyone know if there is an event or something i can use for archaeology?

tidal anchor
#

how would i create a coustom use event in my plugin

remote swallow
#

?event-api

undone axleBOT
tidal anchor
#

no is there an event for right clicking an item

young knoll
#

PlayerInteractEvent

tidal anchor
#

ok

#

tnx

fervent robin
#

Using a spigot plugin how do I send a player to another server within bungee?

young knoll
#

?pmc

young knoll
#

I believe that covers it

fervent robin
timber prawn
#

So if I want to get a hashmap within another class from which it was created, how would I?

echo basalt
#

make a getter

noble lantern
#

you need some library for block bench stuff

timber prawn
noble lantern
# timber prawn Can you explain what a getter is please?

essentially a getter is a method that gets something

So for ex Bukkit.getPlayer(UUID) is a getter, and getters typically return some form of value (IE they are not a void)

You would make a getValueFromMap say if your map holds player with a key of material you would make a getter of YourClass.getPlayer(Material material); and it would return a value from your hashmap using the key provided from the argument

timber prawn
noble lantern
#

WHats the hashmap for?

Normally you have Manager/Handler/Whatever classes that manage your maps and lists to make things easier on yourself, and you would make getters to those classes in your main class so when you use dependency injection you have access to all those classes

timber prawn
#

So basically the idea is. In ProjectileLaunchEvent I want to set a hashmap to (Entity, Boolean) so when I shoot an arrow it'll say (Arrow, False). The boolean would be if the arrow has landed. So then in a ProjectileHitEvent it would change the arrow's boolean to true since it have "hit" something... (sorry if this is all over)

solemn dock
#

There is a plugin called mine x farm it used to support 1.12 to 1.19 before but from it's last update it supports 1.20 but from 1.17 so anyone has a old version copy of it?

#

I want it for my 1.16.5 server

compact haven
#

idk if that's the plugin but the site has version history on resources

#

so just find what u want

solemn dock
#

Ok ty

compact haven
# noble lantern essentially a getter is a method that gets something So for ex `Bukkit.getPlaye...

I will add for @timber prawn that a "getter" is typically referred to as a method inside of a class with no parameters and simply returns a protected or private field inside of the class.

public class Player {
  private String name; // You can not player.name because it's private,
  
  public String getName() {
    return name; // so instead of player.name you use player.getName(), which also prevents you from changing the name.
  }
compact haven
#

wdym

noble lantern
compact haven
#

I read context and it's literally the difference between renaming "name" to "map" or whatever and changing hte type from String to Map

compact haven
#

well I mean

#

you'd literally put a map inside of ProjectileLaunchEvent

timber prawn
#

So I create it inside the class that the Projectile Launch Event is in?

compact haven
#

correct

timber prawn
#

and I can call it to the ProjectileHitEvent?

compact haven
#

correct

#

though honestly

#

I don't know that it belongs inside of the listener, but it can

#

you'd just need to pass the instance of your ProjectileLaunchEvent listener from the main class

timber prawn
#

Where else would I put it? Inside it's own class?

compact haven
#
public class MyPlugin extends JavaPlugin {
  @Override
  public void onEnable() {
    ProjectileLaunchEventListener projectileLaunchEvent = new ProjectileLaunchEventListener();
    ProjectileHitEventListener projectileHitEvent = new ProjectileHitEventListener(projectileLaunchEvent);

    getPluginManager().registerEvents(projectileLaunchEvent, this);
    getPluginManager().registerEvents(projectileHitEvent, this);
  }
}
public class ProjectileLaunchEventListener implements Listener {
  private List<UUID> launchedEntities = new ArrayList<>();

  @EventHandler
  ...

  public boolean isLaunchedEntity(Entity entity) {
    return launchedEntities.contains(entity.getUniqueId());
  }

  public void removeLaunchedEntity(Entity entity) {
    launchedEntities.remove(entity.getUniqueId());
  }
}
#

that's all the spoon feeding for today

#

also I changed it from a Map to a List because I genuinely don't see why it needs to be a map, though tbh I didnt fully read your message

#

any time you have a Map<?, Boolean> typically the presence of the entry in the list can be subsituted for the value in the map

#

i.e. List#contains = Map#get

#

@timber prawn ^

echo basalt
#

You mean a set

compact haven
#

literally doesn't matter

echo basalt
#

it kinda does

compact haven
#

I refuse to code a Set anymore because every damn time I use one I end up refactoring it to an indexed iterable because I need .get(0) for etc'

timber prawn
echo basalt
#

That's... just a lack of understanding the right structure

compact haven
#

excuse me?

echo basalt
#

Sets have their use-cases

compact haven
#

stfu I'm not going to debate whether he wants a List or Set

echo basalt
#

Lists also have their use-cases

compact haven
#

change it to any fucking Collection

#

and it'll work just fine

echo basalt
#

Some are better than others

#

HashBasedTable emptyinside

hybrid spoke
#

tf are collections

#

just use arrays

noble lantern
#

arrays? i just hard code a bunch of variables ill think i need

hybrid spoke
#

make sure to have some placeholders as well if its off by one

quaint mantle
#
public class ArrayLengthTwo {
    public Object objectOne;
    public Object objectTwo;
}

public class ArrayLengthThree {
    public Object objectOne;
    public Object objectTwo;
    public Object objectThree;
}
#

// TODO implement arrays with longer lengths

glossy venture
#

generate them at runtime

static ingot
sweet sonnet
#

Should getLogger().warning() be this.getLogger().warning()? Or does it not matter

smoky anchor
sweet sonnet
smoky anchor
median bronze
#

is there any way to permanently force load a chunk, including any block changes (ie crop growth, spawners etc)?

smoky anchor
sweet sonnet
#

Is there any better way other than creating a getInstance method?

median bronze
smoky anchor
smoky anchor
undone axleBOT
smoky anchor
#

Have you tried reading the error

Invalid plugin.yml

sweet sonnet
#

24th line

smoky anchor
median bronze
buoyant viper
#

is it?

smoky anchor
#

in any case, I see purpur and paper so ask for help in their servers ig

buoyant viper
#

also

purpur

this is a spigot

sweet sonnet
#

send it

buoyant viper
#

?paste ur plugin.yml

undone axleBOT
sweet sonnet
#

?whereami YES I GET TO USE IT FOR ONCE

smoky anchor
#

Are you sure ?!

#

Are you sure

buoyant viper
#

your server log says otherwise

#

no, your server is running Purpur

smoky anchor
#

did you switch dev from purpur plugin to spigot plugin ?
Is that what you mean ?

sweet sonnet
#

🤦‍♂️

buoyant viper
#

so ur testing ur Spigot plugin on Purpur

smoky anchor
buoyant viper
#

not that an incompatibity should exist, but

#

it might

#

just ?paste ur plugin.yml so we can see

#

or well, use the link from

#

?paste

undone axleBOT
buoyant viper
#

dont actually paste ur yml in here

smoky anchor
#

dude, your sense of time is fucked

median bronze
#

does anyone know how I could fake a player presence in a specified chunk

chrome beacon
#

Depends on what you mean with presence?

smoky anchor
#

They want to have spawners active & random ticks to happen

chrome beacon
#

Oh just add chunk tickets

#

As for spawners it might be a bit tricker

smoky anchor
shadow night
#

Yeah, random ticks work only when a player is nearby

chrome beacon
smoky anchor
#

From the wiki:

tender shard
#

chunks only tick when a player is at most 128 blocks horizontal distance from the chunk's center

median bronze
#

oh sorry didnt see the messages above

chrome beacon
#

Yeah spawners and plant growth might require nms then

smoky anchor
#

You do know spawners have 16 blocks range

chrome beacon
#

That could be set and rest on load/unload

#

Crops are the main problem then ig

smoky anchor
#

can you not manually tick the chunk somehow ?
Like "emulate" the presense of a player ?
Might require NMS tho

median bronze
#

i think nms is most commonly used for plugins like this

#

pretty sure wild loaders used nms

chrome beacon
#

Either use nms to force a random tick or just fake a random tick on your own

#

How fun I sent that message before your messages appeared

summer scroll
#

Anyone know why PlayerInteractEvent doesn't get called when left/right clicking in air? I'm on 1.19.4

eternal oxide
#

it doesn;t fire with an empty hand

summer scroll
eternal oxide
#

then you are not running spigot

summer scroll
# eternal oxide then you are not running spigot

I have ignoreCancelled = true on the event handler, on the javadocs it says that the event will be cancelled if player just punching air no matter what item that you're holding with, that's probably why.

tender shard
#

oh and yeah it does get called in cancelled state when clicking air with a sword, that's correct

summer scroll
#

ah okay, thanks for the help guys!

#

so it does get fired but cancelled

worn tundra
ocean hollow
#

jdbc:mysql://user:passw@node1.game-servers.faithnode.host/host

how can I set connection to this

#

do I need to do this?

zealous osprey
#

btw, why don't you just do return connection != null;?

tawdry echo
#

also check connection.isClosed()?

flint elk
#

How do I set the age of an plant?

placid moss
#

check Ageable interface

#

nooi was too slow

smoky anchor
#

you can do this

#

?i-jda

agile laurel
#

kek

smoky anchor
#

no idk what you trying to do :D

undone axleBOT
placid moss
#

top 1 reason why we should have slash commands for all of them

smoky anchor
#

fw?

#

ye

#

? ? ?
It's not that hard lol

#

so where lies the problem

#

does the entity actually spawn ?
Check with F3+B at the location, should show a blue line pointing south?

#

also, try, instead of using the default transformation just constructing new one from scratch.
The website should tell you what values what has.

#

wdym how

#

yes

#

but also the vectors and quaterions

#

oh ok
wait a sec

#

this one is sadly really limited, I think I remember a different one tho
wait more sec

#

The command shows the tranformation matrix

#

You can prob just copy paste that into code

#

omg spigot transformation does not support from matrix...
Ye

#

Then use the misode one to get the rotations and put those in

smoky anchor
#

@quaint mantle I don't provide help in DMs unless I say so....

opal juniper
#

what!

true perch
#

My moves.yml file has 3 keys (default move settings, smash, and basic attack) however it is reading the first key as "default move" instead of "default move settings" as it's written in the config. Any idea why? solved

for (String moveKey : movesSection.getKeys(false)) {
  Bukkit.getLogger().info("Loading data for the move: " + moveKey);
}```__**moves.yml**__
```yaml
moves:
  default move settings:
    test: test
  smash:
    test: test
  basic attack:
    test: test```
hollow oxide
#

do you know how to make a single entity invisible for only one player?

hollow oxide
#

it look like comphoenix work

chrome beacon
#

Why use Protocollib when you can use api

hollow oxide
#

cuz i don't know how to use api (i didn't knew there were api)

hollow oxide
#

i'm not in 1.20, im in 1.18.2

placid moss
hollow oxide
#

thx

#

and how do you use an api ? (i'm new to plugin and to java)

placid moss
#

api just refers to the fact that the library is based on a set of interfaces rather concrete classes

#

and the actual classes are present in the server classpath

#

this pretty much allows for cross compatibility and some other things

hollow oxide
#

ok thx

chrome beacon
#

Probably has something to do with the ConfigurationSerializable api

#

Check stash

#

?stash

undone axleBOT
chrome beacon
#

You should use the spawn method that takes a consumer

#

I believe you already did that earlier

smoky anchor
#

How about you try to spawn them without the transformation ?
Does that work ?
||are you calling the method?||

#

Bro... I just looked at the documentation
Transformation(Vector3f translation, Quaternionf leftRotation, Vector3f scale, Quaternionf rightRotation)
You really setting scale to 0 and then wondering why it doesn't show up
How did you even mix those two
what in the fuck

#

I didn't look at first since I had assumed you would read the variable names at least...

young knoll
#

If you want to output stuff like itemstacks then yes

lyric grove
#

anyone know how i can fix this?

#

Unsupported class file major version 64

#

nvm i fixed it by changing the jvm to 17

#

I hate how intellij doesnt just suggest how to fix these errors i somehow always get them

sharp kayak
#

Any other way of getting the world type? .getWorldType() is deprecated

young knoll
#

It’s not

sharp kayak
#

i cant upload a image here

#

it is

young knoll
#

It’s not

smoky anchor
remote swallow
#

its deprecated on paper

young knoll
#

The one in world is

#

But it tells you why

remote swallow
#

nerd

sharp kayak
#

any alternative methods for that?

young knoll
#

No

#

If it’s not stored in vanilla worlds then you can’t get it

#

What are you trying to do

sharp kayak
#

Can i retrieve it from WorldInfo?

smoky anchor
sharp kayak
smoky anchor
#

now.. why ?

sharp kayak
#

do I need to answer that? 😶

smoky anchor
#

You don't have to
But we might come up with a solution where you don't need that info

sharp kayak
#

Its nothing important, just to specify the world type while listing worlds in a GUI for the player

inner nacelle
#

Hello, I have a problem creating a plugin, I'd like to use this : PacketPlayOutScoreboardTeam but on version 1.19.0 I don't know what to put in the constructor when instantiating a new PacketPlayOutScoreboardTeam. If anyone can help me, thank you in advance

smoky anchor
remote swallow
#

the other constructor is private

smoky anchor
river oracle
shadow night
#

how do I get the motd of the bungeecord server through code?

inner nacelle
smoky anchor
#

Please, don't try to re-invent the wheel
Trust me, I know what I am saying :D

#

It is perfectly fine to work with libraries to make stuff faster/easier for you

ivory sleet
#

u use the static factory methods

#

ofc u could just use the friendlybytebuf constructor (And u create a bytebuf with Unpooled.buffer())

astral shoal
#

Trying to use
((CraftPlayer) player).getHandle().b.a(new PacketPlayOutBlockBreakAnimation(-player.getEntityId(), blockPosition, intdamage));
for 1.20.1
but .b now returns "'b' has private access in 'net.minecraft.server.level.EntityPlayer'"

remote swallow
#

you should use mojmaps

#

b is now the logger

subtle folio
#

why can’t minecraft just be foss Troll

smoky anchor
#

I mean it sorta is
Like you can easily get the sourcecode in roughly the way it actually looks like

#

wtf
huh
Does that annotate the methods as well then ?

fervent gate
#

PacketPlayOutPlayerInfo

What is the 1.20 equivalent to this? Can't find anything similar

smoky anchor
#

huh not what I expected tbh

fervent gate
#

?

smoky anchor
fervent gate
#

Is that for 1.20 too?

smoky anchor
worldly ingot
worldly ingot
#

It's a hell of a lot faster than screamingsandals

remote swallow
#

yeah

#

and i dont have to specify a namespace

echo basalt
#

Looks like garbage on mobile

worldly ingot
#

That's your fault for browsing a mapping website on mobile

#

wtf

fervent gate
#

yeah thx, I'll use that

quaint mantle
#

Concerning developping and testing players-to-players interactions features, how do you usually test them?
I only own one account so and my friends usually aren't online when I am doing tests... Do you get a "cracked version" of the launcher for temporary alt account, OR is there a simpler way to do it (which also wont put me at risk)? 🤔

tender shard
#

i got 5 alt accounts or sth lol. mockbukkit can also help for certain things

remote swallow
quaint mantle
quaint mantle
#

Alright, thanks

ivory sleet
#

and sometimes u can also unit test w/o mock bukkit

haughty storm
storm scaffold
#

Is there a way to stop the arm swing animation when a player clicks on something like a note block?

ocean hollow
#

if I want to change plugin version, I need to change only here?

remote swallow
#

you would also need to wrap 1.20 in apostrophes, blame snakeyaml

#

api-version: '1.20'

ivory sleet
#

it thinks its just 1.2 otherwise right?

remote swallow
#

yeah

glossy venture
storm scaffold
#

Is there a way to detect when a player stops holding right click on a block?

echo basalt
#

Lol no

eternal oxide
#

abort event

echo basalt
#

That's left click

#

The client sends 5 packets per second for right click

storm scaffold
eternal oxide
#

then as imillusion said, no

terse bough
#

https://ibb.co/KN78nHJ
Does anyone know how I get this list is in the 1.20.1? and yes I know I am not using any particular PacketWrapper.

echo basalt
#

you gotta get the data watcher and get all the contents

terse bough
#

yes and what is the name of the method am not yet familiar with the 1.20

echo basalt
#

If you were using mappings it'd be much simpler, sec

#

entity.aj().c()

#

if c() doesn't work, then b()

terse bough
#

thank you I test it

echo basalt
eternal oxide
#

?nms

terse bough
#

in the 1.20.1, as far as I know, this does not work yet

native gale
terse bough
echo basalt
river oracle
#

why no remapping :(

#

remapping is bae

orchid trout
#
        if (stringTime.endsWith("h")) {
            stringTime = stringTime.replace("h", "");
            seconds = convert(stringTime) * 3600;
        } else if (stringTime.endsWith("d")) {
            stringTime = stringTime.replace("d", "");
            seconds = convert(stringTime) * 3600 * 24;
        } else if (stringTime.endsWith("m")) {
            stringTime = stringTime.replace("m", "");
            seconds = convert(stringTime) * 3600 * 24 * 30;
        } else if (stringTime.endsWith("y")) {
            stringTime = stringTime.replace("y", "");
            seconds = convert(stringTime) * 3600 * 24 * 30 * 12;
        }``` asv0od8979g
eternal oxide
#

Also Duration has ofMinutes, ofHours, ofDays etc

somber scarab
#

How can I save a player's inventory and then give it to them back later?

#

for a minigame

#

I dont feel like importing MVinventories just for this

terse bough
# echo basalt

could you send me maybe the website of it, because I now also need to know how to change the blockface of the itemframe

somber scarab
remote swallow
#

It is

tender shard
#

works just fine

remote swallow
#

Thats 1.14

#

If u use 1.20 snakeyaml reads it as 1.2 and spigot errors

tender shard
#

oh for 1.20, yeah that might be true

#

i didnt think about 1.20 being different than 1.19 etc

terse bough
ivory sleet
#

but like

#

that would require pr

young knoll
#

We discussed it

worldly ingot
#

We PR'd it too

young knoll
#

What was the conclusion

#

Me no remember

worldly ingot
#

Stuck in limbo is all. No conclusion

young knoll
#

Ah I thought it was decided against

worldly ingot
#

Nah. Only MachineMaker had issues with it but I don't think they were really valid

young knoll
#

Fair

tender shard
#

Why not just make spigot accept 1.2 for 1.20 lol

#

It wouldnt cause issues until we‘re at 1.130 anyway

worldly ingot
#

Hacky solution

#

The better solution is to interpret it as a string

#

Which we did

haughty storm
ivory sleet
#

I assume this would be the case with ConfigurationSection#getString also then in the future?

worldly ingot
#

No

#

Unaffected. Only the reading of the plugin.yml in PluginDescriptionFile is affected

ivory sleet
#

ah alr alr

lyric grove
#

Hi i have barely used gradle before, how would i solve this issue:

I have cloned 2 repositories locally (KyoriPowered/adventure) and (KyoriPowered/adventure-platform). I then imported them into IntelliJ, if i edit code in adventure (module = adventure-api) and try to import that edited code into adventure-platform (module = adventure-platform-facet), I get a cant resolve error.
How do i get the adventure-api dependency to pull my local changes

eternal night
#

Ehhh, you'd have to install to maven local like you would with maven as well

lyric grove
#

but im using gradle

eternal night
#

gradle has support for maven local

lyric grove
#

oh

eternal night
#

you just have to add it as a repo

#

do your changes in adventure

river oracle
#

mavenLocal()

#

in repos

eternal night
#

./gradlew publishToMavenLocal

#

and then yea, ^ mavenLocal() in platform

vivid skiff
#

How can i get all the files in a folder from the resources folder?

eternal oxide
#

you mean save to a folder from the plugin?

vivid skiff
#

Yes

eternal oxide
#

Plugin#saveResource

river oracle
#

wouldn't you just get the class and get the Resource from that

vivid skiff
#

but i want to get all the files in a folder, for example i have the folder test in the resources folder and i want to get every file in it

eternal oxide
#

you can save anywhere

river oracle
eternal oxide
#

saveResource preserves the file structure

fierce whale
#

How can I get MariaDB connection?
Is there any thing to download additionally like maria db driver?

river oracle
eternal oxide
river oracle
#

^ Oh yeah don't forget to follow the guide though

#

you'd just choose a provided scope instead of implementation / compile

vivid skiff
river oracle
vivid skiff
#

Isn't there some way to get the files using a for loop maybe?

eternal oxide
#

not easily

river oracle
#

at that point you'd have to go to the java classloader i believe

vivid skiff
haughty storm
fierce whale
river oracle
#

and add the dependency to Maven / Gradle whichever you use

fierce whale
#

OH...

#

I got it. how didn't I know about this for a year lol

river oracle
#

reminder if you use library loading DO NOT shade the dependency

dry forum
#

if i have a link thats like
mysql://some_stuff
do i just add jdbc: before mysql?

storm scaffold
#

Can I find the shape of BlockData? I am trying to find the theoretical bounding box of a block at a location, but without actually changing the block

eternal oxide
#

Block#getBoundingBox()

lyric grove
river oracle
#

please consider looking at gradle docs

lyric grove
#

ok i will

dry forum
#

sql link question

fervent gate
#

entityPlayer.getBukkitEntity().teleport(location)

This is returning false. Does anyone know anything abt that?

quaint mantle
#

Guys

#

Using the symbol and resourcepack

#

Healt indicator

subtle folio
#

Do you know java already?

quaint mantle
#

Yes

#

I ask how to make thirst, health and hunger I could

subtle folio
#

then do you not know how to start making that?

alpine swan
#

when is the pluginenableevent called?
like you register the event listener in the onenable in the main class, so will the pluginenableevent be called as soon as the listener is registered or what

(im confused because when the plugin is enabled the listener isnt registered yet)

quaint mantle
#

Thirst from the race. When less than 50, there will be a slowdown, when 0 - 5 damage every 3 seconds

quaint mantle
subtle folio
#

thirst looks like the XP bar

fervent gate
#

cuz I have created an NPC and I need to set its location

#

no

#

I need to have it move and shit

#

with packets

#

it's just the teleporting that isn't working

storm scaffold
#

Is there an event for when a player lets go of left click?

eternal oxide
#

if mining it's an abort event

storm scaffold
#

Is there a way to tell what block would be placed if a certain item was used? I can use Material.createBlockData() for most blocks but it doesn't work for stuff like crops, which have a different material as a block to an item

fluid river
#

jree

zealous osprey
#

"snaps to the other one?"
Could you specify that a bit more

#

ok...

silver shuttle
#

I'm trying to add JGit to my plugin, but when trying to use the shadow compiled fat jar, I get this exception, stating the resource is missing:

org.eclipse.jgit.errors.TranslationBundleLoadingException: Loading of translation bundle failed for [org.eclipse.jgit.internal.JGitText, en_US]
    at org.eclipse.jgit.nls.TranslationBundle.load(TranslationBundle.java:141) ~[MineCICD-1.0-SNAPSHOT-all.jar:?]
    at org.eclipse.jgit.nls.GlobalBundleCache.lookupBundle(GlobalBundleCache.java:64) ~[MineCICD-1.0-SNAPSHOT-all.jar:?]
    at org.eclipse.jgit.nls.NLS.get(NLS.java:125) ~[MineCICD-1.0-SNAPSHOT-all.jar:?]
    at org.eclipse.jgit.nls.NLS.getBundleFor(NLS.java:101) ~[MineCICD-1.0-SNAPSHOT-all.jar:?]
    at org.eclipse.jgit.internal.JGitText.get(JGitText.java:28) ~[MineCICD-1.0-SNAPSHOT-all.jar:?]
    at org.eclipse.jgit.errors.RepositoryNotFoundException.message(RepositoryNotFoundException.java:69) ~[MineCICD-1.0-SNAPSHOT-all.jar:?]
    at org.eclipse.jgit.errors.RepositoryNotFoundException.<init>(RepositoryNotFoundException.java:53) ~[MineCICD-1.0-SNAPSHOT-all.jar:?]
    at org.eclipse.jgit.errors.RepositoryNotFoundException.<init>(RepositoryNotFoundException.java:31) ~[MineCICD-1.0-SNAPSHOT-all.jar:?]
    at org.eclipse.jgit.lib.BaseRepositoryBuilder.build(BaseRepositoryBuilder.java:627) ~[MineCICD-1.0-SNAPSHOT-all.jar:?]
    at org.eclipse.jgit.api.Git.open(Git.java:93) ~[MineCICD-1.0-SNAPSHOT-all.jar:?]
    at org.eclipse.jgit.api.Git.open(Git.java:73) ~[MineCICD-1.0-SNAPSHOT-all.jar:?]

How could I fix that?

zealous osprey
#

what's "the other one" then? What do you want it to snap to?

#

oooh, that's a display block, I thaught the ice in the water was... well ice

#

So you are spawning 3 display blocks per ice shard thingy?

Why not just use this model instead of the ice block in a resourcepack?

fervent gate
#

https://paste.md-5.net/aloxotisel.md

This happens when I try to teleport an EntityPlayer that's from NMS using the following code:

entityPlayer.teleportTo(worldServer, new Position(location.getX(), location.getY(), location.getZ()))

Someone said that this was because the chunk hasn't been loaded, but I made sure to load it first.

zealous osprey
#

ah, kk. But it might jitter when teleporting 3 armour stands

eternal oxide
fervent gate
#

It does though, I can view it

shadow night
#

Hmm, guys. I need to make a gui with a lot of text and if possible, for it to be always visible. What's the best way to do that?

eternal oxide
#

just because you can see it on a client doesn;t mean it exists on the server

zealous osprey
#

sorry, I usually make stuff pre 1.19, so I'm not used to this fancy tech yet XD

eternal oxide
#

packet based Players do not have Bukkit entities

fervent gate
#

@eternal oxide It spawns all of them at 0 0 0

eternal oxide
shadow night
#

Yes, lots of lots of text. I could use a inventory with a pages system and just renamed signs but it's weird. Imagine something like a terminal inside minecraft

fervent gate
#

No, the only thing I'm doing with the world is when I create the NPC: this.entityPlayer = new EntityPlayer(minecraftServer, worldServer, this.gameProfile);

eternal oxide
#

if you never call nmsWorld.addNewPlayer(npc) your NPC doesn;t exist on the server

fervent gate
#

oh

#

I didn't know that

shadow night
fervent gate
#

@eternal oxide

((CraftWorld) location.getWorld()).addEntity(this.entityPlayer, CreatureSpawnEvent.SpawnReason.CUSTOM);

This does the trick right?

zealous osprey
#

I have an idea, I'm trying it out currently, but why not try to make one block display ride the other, then it should have smoother interpolation and automatic rotation aligning

eternal oxide
#

you need to decide if you are goign all packets or adding to world

fervent gate
#

I'll add to world yes

eternal oxide
#

if you are goign all packets you can;t use things like entity teleport. You have to do everythign using packets

zealous osprey
#

ye

eternal oxide
#

if you add to world there are more hoops you must jump through

zealous osprey
#

well I think it's called passanger

eternal oxide
#

you have to attach a null manager to prevent sending any packets to the NPC

fervent gate
#

a interactManager?

eternal oxide
#

search back about a day ago. I posted a zip for Fake player

#

teh code no longer works out teh box, but it shows you how to wrap the ServerPlayer

zealous osprey
#

btw, I'd recommend doing this with commands atm, cause this might take very long trying to get it to work with recompiling, restarting and then testing.
Here's a neat website for summoning stuff:
https://mcstacker.net/

tulip vector
#

I have a location which is 500 blocks away from my location. now , I want to split target coordinate into small coordinates which has a distance of 10 blocks from each other.

is this a correct implementation ?

   public static List<Vector> multiplyUntilLocation(Location loc1, Location loc2) {
        Vector direction = loc2.toVector().subtract(loc1.toVector());
        direction.normalize();

        List<Vector> multipliedVectors = new ArrayList<>();
        Vector currentVector = direction.clone();
        while (currentVector.length() <= direction.length()) {
            multipliedVectors.add(currentVector.clone());
            currentVector.multiply(10);
        }

        return multipliedVectors;
    }```
solid cargo
#

what is a good inventory api?

#

that supports 1.20

fervent gate
#

@eternal oxide Is that using mojang mappings?

eternal oxide
#

yes

quaint mantle
warm mica
#

I'm not sure (I have never worked with them yet), but maybe it'd be a good idea to add the two display entities at the side as a passanger to the one to the middle. By this, you would only have to move the on in the middle and each the other two get moved at the same time as well. This could remove possible jiggle for players with a greater ping

quaint mantle
#

ah noo

#

😄

eternal oxide
#

player#sendBlockDamage

zealous osprey