#help-development

1 messages · Page 907 of 1

plucky rock
#

could that be it?

grave terrace
#

it says command not found

plucky rock
#

you need to add it in plugin.yml

#

and in the main file

grave terrace
#

oh no i mean in the discord server

plucky rock
#

yes

#

oh

grave terrace
#

in bot commands

#

i cant do /verify

plucky rock
#

./verify forums_username:

#

do !verify

#

weird it turned into a cmdn

grave terrace
#

ok

#

i will get verified soon

#

I need Help @agile anvil

plucky rock
#

bro chill on @ people

#

whats your issue

#

bro u aint the only person here

grave terrace
#

ik sry

#

my plugin is not displaying

#

in minecraft

plucky rock
#

do u have it in ur plugins folder

#

?

#

also check ur console

tall dragon
#

might be overriding your velocity in the same tick

plucky rock
#

so would i have to cancel the velocity

#

then wait 1 tick

#

and then set?

#

also how do u cancel velocity

#

just set each thing to 0

#

?

tall dragon
#

that would then be overidden in the same way ;d

plucky rock
#

hm

#

then how do i tackle this?

#

shuold i just wait a few ticks

tall dragon
#

which even u using

#

EntityDamageByEntityEvent ?

plucky rock
#

yup

tall dragon
#

should work tbh

plucky rock
#

i can send the entire block of code if u want

tall dragon
#

ive done it as well without a delay

plucky rock
#

hm

tall dragon
#

try setting velocity to 0,0,0

#

to see if it cancels knockback

plucky rock
#

ok

plucky rock
#

kb is not getting canceld

agile anvil
#

Which version are you on ?

plucky rock
#

1.16.5

#

i dont have a new enough version of java :/

agile anvil
#

So have you tried delaying by a tick the velocity ?

#

Maybe the damage trick the velocity

plucky rock
#

damage trick the velocity?

#

what does that mean

tall dragon
#

ah i see

agile anvil
#

I mean maybe there is some kind of perturbation between the two

tall dragon
#

u need to place it in a runnable @plucky rock

plucky rock
#

hm

tall dragon
#

checked my code real quick

agile anvil
#

It reminds me when we tried to fix the knockback system in 1.6/1.7 because players were not happy and said it wasdisadvantaging some

#

We had to delay the velocity

plucky rock
#

like a BukkitRunnable?

tall dragon
#

yea

plucky rock
#

ah ok

tall dragon
#

ive just made it easy for myself

#

u use a bukkitrunnable

plucky rock
#

how do u use them?

#

do u have a wiki or videos

tall dragon
#

?scheduler

plucky rock
#

on how to use them?

tall dragon
plucky rock
#

ty

tall dragon
plucky rock
#

ok

#

oh bruh its 12 AM

#

lmao

#

imma sleep ill come back to this tmmrw

#

thc for the help

agile anvil
#

Night will help you sort everything ahah

plucky rock
#

lol

tardy delta
#

Well a MethodHandle is coupled with reflection, at least on some recent versions, the jvm is able to look through them transparantly

buoyant viper
#

.unreflect goes hard

tardy delta
#

never used those to be honest

kindred sentinel
#

Is there a way to convert plugin into the intelij idea project?

agile anvil
#

What do you mean ?

native ruin
#

I think he's talking about decompiling a jar

drowsy helm
kindred sentinel
#

Just asking to understand

#

I have no problems with it

kindred sentinel
quaint mantle
#

are u use runnables to set gui items?

#

like if i want to set all slots of gui to a stained glass

#

it be very pain to do it 1 by 1

drowsy helm
#

use a for loop

quaint mantle
#

o okay

#

that slipped outta mind thanks lol

quaint mantle
#

why is it giving error

buoyant viper
#

i think your arguments are flipped

quaint mantle
#
    @EventHandler
    public void onRightClick(PlayerInteractEvent event) throws IOException {
        if(event.getAction().isRightClick()){
            if(Objects.requireNonNull(Objects.requireNonNull(event.getItem()).getItemMeta().displayName()).toString().contains("Skyblock Menu")){
                SkyblockMenu.createSkyblockMenu(event.getPlayer());
            }
        }
    }
}```
buoyant viper
quaint mantle
#

oh maybe

#

still didnt do anything

#

its giving error

buoyant viper
#

registerEvents, not registerEvent

#

@quaint mantle

#

registerEvents(new ItemRightClick(), this);

quaint mantle
#

oooo

#

thx =D

grave terrace
#

@anyone please i need helppp

#

@agile anvil sorry to disturb you

#

but i need help

#

cant i get help until i get verified??

sullen marlin
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

grave terrace
#

ok

#

so i dont know whats wrong

#

the problem i am having is, my plugin is not showing up in the server

#

when i do /plugins

sullen marlin
#

what does the server log say

grave terrace
#

i dont understans that

#

can i copy paste it here?

sullen marlin
#

?paste

undone axleBOT
grave terrace
#

here

sullen marlin
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

quaint mantle
#

ah his plugin is of paper

grave terrace
quaint mantle
#

are u using core paper?

grave terrace
quaint mantle
#

server of Paper

grave terrace
#

the server is paper

#

but the plugin is spigot

#

uhhh

#

is anyone here??

pseudo hazel
#

try a spigot server and see if you still have the same issue

tardy delta
#

looks like an invocation handler to me

grave terrace
#

ok

hybrid turret
#

if i setup an sqlite database, do i need to make the .db file accessible in the plugins folder or can it be stored in the jar file?
The latter should work, no?

#

And if not, how exactly would I add the file as a datasource in intellij, since i can't know the path where the end user will store the plugin file

umbral ridge
#

this is what I had in mind (I created a custom chance system)

#

it's a target-like random system (in the middle, where 100% is written, it's actually around 90%)

#

could remind you of a gun spray (recoil). The middle section is more likely to be chosen than red section.

Eg.:

(its possible that 5% or less out of 100 tries, that section will be chosen)

15% means you have a 15% chance every 100 tries to have that section chosen
(its possible that 15% or less out of 100 tries, that section will be chosen)

50% means you have a 50% chance every 100 tries to have that section chosen
(its possible that 50% or less out of 100 tries, that section will be chosen)

90% means you have a 90% chance every 100 tries to have that section chosen
(its possible that 90% or less out of 100 tries, that section will be chosen)```
rough drift
#

you can just make a new .db file and sqlite will handle it afaik

hybrid turret
#

tbh makes sense

#

so i just add it as a datasource with the path jdbc:sqlite:MyServerdatabase.db?

rough drift
#

sure

hybrid turret
#

huh okay, guess i'll try that

#

thanks

buoyant viper
#

event bus with similar register to bukkits

#
@Register
void doEvent(TheEvent event) { /* stuff */ }```
tardy delta
#

i probably wouldve written an annotation processor for that

dusty totem
#
    <dependency>
      <groupId>net.md-5</groupId>
      <artifactId>bungeecord-api</artifactId>
      <version>1.20-R0.2</version>
      <type>jar</type>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>net.md-5</groupId>
      <artifactId>bungeecord-api</artifactId>
      <version>1.20-R0.2</version>
      <type>javadoc</type>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
  </dependencies>```
#

I'm using FlameCord 1.9.6 by LinsaFTW build not directly BC

fluid river
#

what is a strategy pattern

#

isn't it the most useless thing of all time

ivory sleet
#

nope

#

Consumer, Function, Callable etc

pseudo hazel
#

strategy pattern is useful

inner mulch
fluid river
#
public interface Engine
{
    public void Move();
}

public class GasEngine : Engine
{
    public void Move()
    {
        Console.WriteLine("Поехали на бензине");
    }
}

public class ElectricEngine : Engine
{
    public void Move()
    {
        Console.WriteLine("Поехали на электричестве.");
    }
}

public class Car
{
    private int seats;
    private string brand;
    private Engine engine;

    public Car(int seats, string brand)
    {
        this.seats = seats;
        this.brand = brand;
        this.engine = new GasEngine();
    }

    public void SetEngine(Engine engine)
    {
        this.engine = engine;
    }

    public void Move()
    {
        engine.Move();
    }
}

public static void Main()
{
    // Strategy
    Car tesla = new Car(5, "Tesla");
    tesla.SetEngine(new ElectricEngine());
    tesla.Move();
}```
fluid river
fluid river
#

or should engine part be only in constructor

#

without changing at runtime with SetEngine?

inner mulch
#

If it works without you could consider not havong it in the constructor

fluid river
#

example code on the internet

#

creates a field for changing engine at runtime

#

and idk why

#

oh i see

inner mulch
#

Thats the strategy pattern

fluid river
#

changing strategy at runtime

inner mulch
#

Yes

fluid river
#

done easy algorithm

#

would never use it anyways

inner mulch
#

?

ivory sleet
#

dont u like

#

use it

#

for consumer

#

function

#

etc

cedar flint
#

I now use this to set an item to the result slot of the anvil. The only thing is it isnt visable until I click on the slot and pick it up. How is that fixable?

AnvilInventory anvilInventory = (AnvilInventory) event.getInventory();
anvilInventory.setItem(2, resultItem);
tall dragon
#

call Player#updateInventory ig

shadow night
#

Don't you need to like update it or am I thinking of something else

cedar flint
#

Il try

#

Tell me if I am doing it wrong, but adding this doesnt work

AnvilInventory anvilInventory = (AnvilInventory) event.getInventory();
anvilInventory.setItem(2, resultItem);
Player player = (Player) event.getWhoClicked();
player.updateInventory();
fluid river
#

don't know

vocal cloud
cedar flint
#

ah.

#

hm

#

Not like it works anyway.

dusty totem
#

Hey,
what event (handler/callback) for BungeeCord will be the best to catch player IP and send POST request before player will be redirected to the main server?
Is there a way to hold the redirection in time to get a response previously sent request?
I wish to register user IP before redirect to main server/lobby.

kindred sentinel
#

Is there a way to artificially create connection between nether portals?

#

Like in vanilla minecraft but using plugin

short raptor
#

Is there any way to tag an item with some kind of identifiable data but still allow it to stack with other items of the same type?

#

I really doubt it but I'm asking anyway

shadow night
fluid river
#

since inventory would just pass it to itemstack[] anyways

short raptor
kindred sentinel
devout pivot
#

how do i create a levelled variable

#

cant assign an int value to levelled then how can I assign a value to levelled variable?

icy beacon
#

wdym by levelled

inner mulch
#

open closed principle

slender elbow
#

oh no

livid dove
# shadow night you'd probably need to rewrite how portals work then

Aye i'd have it where there is a portal manager that, when a TP occurs, it grabs the location of the portal they tp'd from, and checks it via a Map<Location, CustomPortal>, where the CustomPortal is an interface that has "getAlternateTpLocation" or something.

That way you could use that interface to make linked portals, portals that can link to several portals and chooses one randomly , one that TP's to a pre-set location (star gate style) etc etc

devout pivot
#

want to make a plugin that changes the composter level to 8 as soon as the composter level is greater than 1

#

bcz composters are too slow in vanilla

worldly ingot
#

Keep them in mind, don't treat them like sacred, all-knowing texts

livid dove
fluid river
quiet ice
#

MONOMOTH MONOMOTH MONOMOTH

slender elbow
#

it's IDIOMATIC

quiet ice
#

You mean idiotic

fluid river
#

wanna abuse some statics with me?

rotund ravine
#

So its better to keep it in mind if ur lazy

sterile flicker
#

Internal Exception: ic.netty.handler.codec.DecoderException: javalang.Index0utOfBoundsException: readerIndex 2) + length 8) exceeds writerIndex 2): PooledUnsafeDirectByteByfCridx: 2, widx: 2, cap: 2what can this error mean?

rotund ravine
#

U probably messed up some packet

sterile flicker
#
@EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {

        Player p = event.getPlayer();

        if (p.getLocation().getChunk().equals(Npc.nurseChunk)) {
            for (Entity entity : p.getLocation().getChunk().getEntities()) {
                if (entity instanceof Player) {
                    try {
                        System.out.print("ff");
                        EntityPlayer e = EntityNurse.create("Nurse", Npc.plugin.getServer().getWorld(Npc.plugin.getConfig().get("world").toString()), new Location(Npc.plugin.getServer().getWorld(Npc.plugin.getConfig().get("world").toString()), Double.parseDouble(Npc.plugin.getConfig().get("nurse").toString().split("\\s+")[0]), Double.parseDouble(Npc.plugin.getConfig().get("nurse").toString().split("\\s+")[1]), Double.parseDouble(Npc.plugin.getConfig().get("nurse").toString().split("\\s+")[2])));
                        entity.teleport(e.getBukkitEntity().getLocation());
                        PlayerConnection connection = ((CraftPlayer) entity).getHandle().playerConnection;
                        PacketPlayOutPlayerInfo info = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, e);
                        PacketPlayOutNamedEntitySpawn spawn = new PacketPlayOutNamedEntitySpawn();

                        connection.sendPacket(info);
                        connection.sendPacket(spawn);
                        connection.sendPacket(new PacketPlayOutEntityHeadRotation(((CraftPlayer) entity).getHandle(), (byte) ((e.getBukkitEntity().getLocation().getYaw() * 256f) / 360f)));

                        connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, e));

                    } catch (IOException er) {
                        er.printStackTrace();
                    }
                }
            }
        }
    }```  I check if the player is in the npc chunk and load it
rough drift
sterile flicker
tall dragon
#

i would advize you to not use PlayerMoveEvent for this.

#

and if you insist at least filter out only mouse movements

sterile flicker
tall dragon
#

a repeating runnable

#

seems like it doesnt have to be instant. so u can just check every second

rough drift
#

No it's perfectly fine

#

you can just check if the chunks are diff

#

do x >> 16 z >> 16 and compare

tall dragon
#

that would work as well

worldly ingot
#

You're gonna end up with 0 in most cases if you use >> 16 lol

sterile flicker
rough drift
#

my bad lol

rough drift
sterile flicker
#

but will this solve the error?

rough drift
#

probably not, but will prevent you from absolutely destroying your server's tps

sterile flicker
#

what does this error mean and what can be done to solve it?

rough drift
#

Some data you're passing is too big for what the packet is expecting

#

that's all the info basically

river oracle
rough drift
#

I counted wrong let me beee

sterile flicker
#

condition if (p.getLocation().getChunk().getX() >> 4 == Npc.nurseChunk.getX() >> 4 && p.getLocation().getChunk().getZ() >> 4 == Npc.nurseChunk.getZ()) { nurseChunk = new Location(Npc.plugin.getServer().getWorld(Npc.plugin.getConfig().get("world").toString()), Double.parseDouble(Npc.plugin.getConfig().get("nurse").toString().split("\\s+")[0]), Double.parseDouble(Npc.plugin.getConfig().get("nurse").toString().split("\\s+")[1]), Double.parseDouble(Npc.plugin.getConfig().get("nurse").toString().split("\\s+")[2])).getChunk(); config.yml nurse: -188 64 -26

rough drift
#

no I-

#

you use the player's X and Z

#

not the player's chunk X and Z

#

that avoids getting the chunk

#

also store the location as it makes a copy each time

sterile flicker
#

the spawn npc fake entity coordinates are different from those in the game

slender elbow
#

i mean the chunk is already loaded so it's not an expensive op to get it

rough drift
#

It's extra

slender elbow
#

it's a non issue

rough drift
#

also Npc.plugin.getConfig().getString("nurse").split("\\s+") you can store this

#

(you can use getString instead of get)

sterile flicker
#

when I write /tp and insert the coordinates, it teleports me to a completely different place

devout pivot
#

I want to make it so composter gets filled as soon as its level is greater than 1 but blockLevelData.setLevel() isn't working and composter doesnt get filled when its level is greater than 1

rough drift
sterile flicker
devout pivot
rough drift
rough drift
devout pivot
#

alright thanks

rough drift
#

^

#

you were faster than me :P

devout pivot
#

thanks

inner mulch
granite olive
#

I have this weird bug where players are invisble after logging out and back in. I found it due to another bug where the color of the player name in the tab and above them would not update unless relogging (but the name in the chat would have the appropriate color without relogging). At no point in my plugin do I make players invisble (other than spectator mode but players arent in spectator mode when rejoining, its survival). Players will be visible again if they or the person viewing them dies. Anyone ever had something similar happen?

vital sandal
#

I want to constantly giving health_boost to player without reset their health value how may I do this?

kindred sentinel
#

How to get nearest block with certain type using location?

#

something like location.getNearestBlock(type)

livid bluff
#

You could check all 6 adjacent blocks for their type, and when all of them don´t match the target, mark them as visited, and then recursively call the function again for all 6 blocks. When the block tested is visited, you skip it and repeat until some block matches the material

river oracle
#

Anyways if you insist on not capping it you'll want to make ChunkSnapshots and do what the above post said iteratively and asynchronously so you don't crash your server

#

Iteratively so you don't fill the call stack asynchronously so you don't freeze the main thread

cedar flint
#

This doesnt work. Why? Iam just trying to get a debug message if a book is enchanted for now.

@EventHandler
    public void onEnchantItem(EnchantItemEvent event) {
        ItemStack enchantedItem = event.getItem();
        if (enchantedItem.getType() == Material.ENCHANTED_BOOK)
river oracle
#

?workdistro

river oracle
sterile flicker
#
@EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {

        Player p = event.getPlayer();

        if ((int) p.getLocation().getX() >> 4 == Npc.nurseChunk.getX() && (int) p.getLocation().getZ() >> 4 == Npc.nurseChunk.getZ()) {
            for (Entity entity : p.getLocation().getChunk().getEntities()) {
                if (entity instanceof Player) {
                    try {
                        if (!Npc.nurseSpawned) {
                            EntityPlayer e = EntityNurse.create("Nurse", Npc.plugin.getServer().getWorld(Npc.plugin.getConfig().get("world").toString()), new Location(Npc.plugin.getServer().getWorld(Npc.plugin.getConfig().get("world").toString()), Double.parseDouble(Npc.plugin.getConfig().get("nurse").toString().split("\\s+")[0]), Double.parseDouble(Npc.plugin.getConfig().get("nurse").toString().split("\\s+")[1]), Double.parseDouble(Npc.plugin.getConfig().get("nurse").toString().split("\\s+")[2])));
                            PlayerConnection connection = ((CraftPlayer) entity).getHandle().playerConnection;
                            PacketPlayOutPlayerInfo info = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, e);

                            connection.sendPacket(info);
                            connection.sendPacket(new PacketPlayOutEntityHeadRotation(((CraftPlayer) entity).getHandle(), (byte) ((e.getBukkitEntity().getLocation().getYaw() * 256f) / 360f)));
                            Npc.nurseSpawned = true;
                        }
                    } catch (IOException er) {
                        er.printStackTrace();
                    }
                }
            }
        }
    }``` now there are two problems, the entitydamagebyentityevent event has stopped working, where I process the event clicking on the npc and the npc appears only when I go up to the npc chunk, then go far away and enter the chunk again
kindred sentinel
river oracle
kindred sentinel
#

oh

#

Yeah I found, thakns

river oracle
#

But do it iteratively

#

Recursion sucks

cedar flint
#

Okay if I put in book then it gives an console error on this: EnchantmentStorageMeta bookMeta = (EnchantmentStorageMeta) enchantedItem.getItemMeta(); Since it is a book and not an enchanted book

river oracle
#

What are you trying to do

granite olive
# granite olive I have this weird bug where players are invisble after logging out and back in. ...

Some additional info for this I discovered: The cause seems to be related to the player being teleported to a different world right when they join. If I dont do this and instead have them log in back in the main world and then have a player teleport them, they will be visible. So for some reason players are invisible when teleporting them on login to a world thats different to the one that they logged out in. Is this a known issue perhaps? I cant find anything specific about this

devout pivot
#

any event to get player's left and right click separately?

inner mulch
#

How do ppl save minigame maps?

river oracle
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
river oracle
inner mulch
#

But how

#

?

devout pivot
river oracle
inner mulch
river oracle
#

Main is right off is left or vice versa

rotund ravine
#

Main is the one that usually has the most “actions”

devout pivot
#

do they work as left and right mouse click?

molten hearth
rotund ravine
devout pivot
#

so attack is main?

sterile flicker
#

can someone help me with this?

rotund ravine
devout pivot
#

and placing blocks?

river oracle
#

Is off hand

#

Wait or main hand

devout pivot
#

oh i see

rotund ravine
#

Offhand can place some blocks

river oracle
#

It could be both lol

devout pivot
#

bruh

river oracle
#

I usually use offhand so lo

devout pivot
#

ok let me test

river oracle
#

You can't dictate between left and right click

#

If that's what you're trying

#

I mean you can for certain actions

devout pivot
#

i want something to happen when player uses right click only not left click

river oracle
#

E.g. Action RIGHT_CLICK_BLCOK

river oracle
#

There is a click action

#

Which specifies type of click

devout pivot
#

oh alright

sterile flicker
#

for example, add a condition that checks whether an entity is in a chunk

cedar flint
# river oracle What are you trying to do

Im trying to add one of my custom enchantments to a book when it gets enchanted. This is the furthest I have come:

if (enchantedItem.getType() == Material.BOOK) { 
                ItemMeta meta = enchantedItem.getItemMeta();
                if (meta != null) {
                    List<String> lore = meta.getLore();
                    if (lore == null) {
                        lore = new ArrayList<>();
                    }
                    lore.add(ChatColor.GRAY + "Test Lore");
                    meta.setLore(lore);
                    enchantedItem.setItemMeta(meta);
                }
            }

But now I need to add the enchantment. Or for the test any enchantment.

mighty gazelle
#

How can I send a message to ALL players on the Server that have the permisson "group.mod"?
Code:

@EventHandler
    public void onPlayerSendMessage(AsyncPlayerChatEvent event) {
        Player player = event.getPlayer();
        String message = event.getMessage();
        //And here the Message to the players: "test"
}
cedar flint
#

something like that

slender elbow
#

Bukkit.broadcast("blah", "group.mod") :p

tawdry echo
#

how can i add local .jar maven dependency?

hazy parrot
# tawdry echo how can i add local .jar maven dependency?

Sometimes you have a certain .jar file that you need as dependency, but the author of that .jar was too lazy to properly upload it to a public repository. That’s bad, but not a problem. There are two ways to solve this, but only one proper way. The proper way: install the dependency The proper...

tawdry echo
#

thx

river oracle
cedar flint
#

Ok thank you

hazy parrot
#

where ever u want

#

if you have maven installed, you can even from cmd

river oracle
#

where the jar file is lol

#

unless you wanna use absolute path ig

devout pivot
#

any way to manipulate the drop i get after i fill up a composter?

river oracle
#

looks like there is little to no API surrounding the composter

#

maybe I could fix that 🤔 maybe if I get around to it

remote swallow
#

who be pingingme

river oracle
#

@remote swallow i did (jk)

remote swallow
#

kek

quaint pasture
#

does one of yall know how to make a npc that opens a control panel to tp to multiple worlds with znpcs and multiverse

young knoll
#

I would just grab something like deluxe menus and make a menu

#

Then set the npc to open the menu

upper hazel
#

if i check it

upper hazel
#

but 2 method not send warning

hasty prawn
#

You're also throwing NPE which feels a bit weird

shadow night
#

Isn't it basically doing what would happen anyway

hasty prawn
#

Pretty much, if I use an isNull method and it throws an NPE if it's null I would be sad

upper hazel
#

Is it good practice to throw exceptions for null in set methods or is it better to do nothing?

shadow night
#

Depends

rough ibex
#

Do what is most expected

#

least surprise

#

Is field nullable?

sterile flicker
#

please help. the npc appears only when I go up to the npc chunk, then go far away and enter the chunk again java private static CraftPlayer hasEntityPlayer(Chunk chunk) throws IOException { for (Entity entity : chunk.getEntities()) { if (entity.getCustomName() != null && entity.getCustomName()=="nurse") { System.out.println("1"); return (CraftPlayer) entity; } } return null; } @EventHandler public void onPlayerMove(PlayerMoveEvent event) throws IOException { Player p = event.getPlayer(); if ((int) p.getLocation().getX() >> 4 == Npc.nurseChunk.getX() && (int) p.getLocation().getZ() >> 4 == Npc.nurseChunk.getZ()) { CraftPlayer ep = hasEntityPlayer(p.getLocation().getChunk()); if (ep == null) { for (Entity pe : p.getLocation().getChunk().getEntities()) { if (pe instanceof Player) { System.out.println("fdfdf"); EntityPlayer entity = EntityNurse.create("Nurse", Npc.plugin.getServer().getWorld(Npc.plugin.getConfig().get("world").toString()), new Location(Npc.plugin.getServer().getWorld(Npc.plugin.getConfig().get("world").toString()), x, y, z)); PlayerConnection connection = ((CraftPlayer) pe).getHandle().playerConnection; PacketPlayOutPlayerInfo info = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, entity); connection.sendPacket(info); } } } } }

eternal night
#

yes

#

biomes are not tied to the chunk anymore

young knoll
#

They never were

#

They were tired to a single column

sterile flicker
#

NPCs appear to only spawn when player enters a "chunk"

#

maybe it's because I have an npc CLIENTBOUND?

livid bluff
#

You only send the packet when the Player is in the nurse chunk, you could try sending it without this check

vital sandal
#

I have this in the pom.xml but cannot find the net.minecraft packages or even use NMS

sterile flicker
young knoll
#

You should be sending it as soon as they are in tracking range

young knoll
vital sandal
#

my other projects can use that but for this nope

sterile flicker
tender shard
vital sandal
sterile flicker
#

maybe player#showPlayer?

tender shard
# vital sandal

what happens if you import a random NMS class and then just compile anyway?

import net.minecraft.core.BlockPosition;

if it works fine, it's just IJ being weird

#

btw why are you not using mojang maps?

vital sandal
tender shard
#

try to just import the class I mentioned, then run mvn package and see if it compiles

sterile flicker
#

entity-tracking-range What is he responsible for?

tender shard
vital sandal
#

weirds

tender shard
#

your plugin still contains it then, have you ran mvn clean before compiling again (or gradlew clean when using gradle)?

sterile flicker
#

(entity-tracking-range)

tender shard
#

but you should really check out mojang mappings - they'll save you hours of time in the future

tender shard
#

and you never send it when the player is inside another chunk

#

and you spam it to all players within that chunk, instead of only to the player who moved

vital sandal
sterile flicker
#
            if (ep == null) {```
tender shard
#

I doubt that hasEntityPlayer will work fine, as you're comparing strings with ==

sterile flicker
tender shard
#

show your onEnable and onLoad methods

livid bluff
#

Replace the chuck check with a distance check, if the distance between player and npc is less than the entity tracking distance, show the npc

flint warren
#

any idea why this doesn't work?

    Inventory inventory;

    public void openItemBrowser(Player player){
        inventory = Bukkit.createInventory(null, 54, ChatColor.GOLD + "Item creator");

        player.openInventory(inventory);
    }

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {

        if (event.getInventory().equals(inventory)){
            event.getWhoClicked().sendMessage("equal");
        }
        else{
            event.getWhoClicked().sendMessage("not equal");
        }
  }

this displays "not equal".

icy beacon
#

Iirc you should be comparing inventories with ==

#

To compare the reference

flint warren
#

uh wait

#

i made the variable static

#

and it works

#

idk why?

flint warren
#

nah doesn't seem to work

#

i don't like it being static but ig it will stay like that for a bit

young knoll
#

Do you register the event handler with a different instance than you call openItemBrowser with

upper hazel
#

Is it a good practice to rewrite the code and switch to implementing interfaces)?

#

literally everything

remote swallow
#

it depends on what it is

#

if the plugin has an api some stuff can become interfaces but not everything has to be an interface, if theres no api not really

upper hazel
#

Well, in short, connect it as deluxeMenu, but with the API I would like to add the ability to create your own menus

remote swallow
#

depends how you expect it to be used, if its just configs only it doesnt really need interfaces, if other plugins might interact maybe a few

upper hazel
#

I just look at objects and perceive them as 1 implementation of a common functionality

#

this is more like an idea to add the ability to create your own menu implementations, because at the end I look and see that my manager class creates only general logic...

#

and apparently will have to be remade for interfaces

flint warren
#

o wait you might be right

#

yeah now it works

#

ty

grim hound
#

Pretty sure it's PlayerMoveEvent

kindred sentinel
#

How to clone entity?

sterile flicker
sterile flicker
#

I put the "I" in the link)))

kindred sentinel
#

Why do entity has no remove() method?

grim hound
eternal night
kindred sentinel
#

oh

grim hound
kindred sentinel
#

I imported entity from java

#

sorry

grim hound
sterile flicker
#

what should I do with playermoveevent

#

does my code make sense?

#

in this event

#

is it possible to change something?

grim hound
#

does it work?

sterile flicker
tender shard
#

that's a really cursed line lol

sterile flicker
#

but sometimes need to re-logging

grim hound
sterile flicker
grim hound
kindred sentinel
#

entity.copy is unstable, is it normal?

sterile flicker
#

If I remove the PlayerMoveEvent code, will the NPC still function properly when moving to a distant location and returning?

#

is there a better way to do this?

sterile flicker
grim hound
#

the npc isn't there

#

you're just spoofing it to the player

#

so that he thinks a player is there

#

but anyway, just check it with distance and once he's out of range and later comes back spoof the packets again

sterile flicker
#

send packets again?

#

what about the REMOVE_PLAYER packet, when should I send it?

grim hound
#

and check by chunks

grim hound
gleaming grove
#

does anyone has utility class that load json itemMeta to, ItemMeta object?

grim hound
#

yes

gleaming grove
grim hound
#

ye

eternal night
#

us BukkitObjectOutputStream

grim hound
#

either nms or api

eternal night
#

or whatever it is called

#

json makes little to no sense for items

gleaming grove
#

I need this just for prototype

native ruin
#

Can you instantiate an event manually?

eternal night
#

sure you can

young knoll
#

Yeah you can use BukkitObjectOutputStream to convert it to a byte[]

#

(And then possibly to base64)

eternal night
#

does obviously not mean the created event will "happen"

#

creating a blockBreakEvent does not mean the block there will break

tender shard
young knoll
#

Even if you call it

#

Oh yeah I was going to do SNBT api thingy

#

kek

eternal night
#

isn't ItemMeta#getAsString already SNBT ?

tender shard
#

yes

eternal night
#

ah so coll is delusional as always

tender shard
#

except without the material

native ruin
sterile flicker
young knoll
#

Yeah that's one thing

#

But other things can be turned to SNBT too

eternal night
#

Ah

grim hound
eternal night
#

Yea I guess you can Entity#getAsString

sterile flicker
eternal night
#

1.12.2 OMEGALUL

river oracle
#

When ?1.12 @young knoll

#

?1.12 uwu uwu md_5 md_5 md_5 uwu uwu uwu

eternal night
#

coll maintaining spigot 1.12.2 ???

#

confirmed

river oracle
#

Wahaattt

#

Coll based 1.12.2 maintainer

#

Hates all those new versions anyways???

eternal night
#

The best version with 0 exploits

river oracle
#

I prefer 1.7.10 tho

#

It's still got that beast log4j exploit

chrome beacon
#

it doesn't?

young knoll
#

Do we need EntityFactory now :p

river oracle
#

Ughhh I just wanna RCE on MFs computers 😳😳

chrome beacon
river oracle
# chrome beacon it doesn't?

Idk I heard it was patched at a launcher level but I don't use the vanilla launcher also for servers MD only patched back to 1.8

#

So it's still a valid concern pre 1.8

sterile flicker
#

Coll1234567, is there a method to get the player's view distance in 1.12.2?

eternal night
sterile flicker
#

client side only?

river oracle
#

I'll give you candy bars!!!

eternal night
#

gotta rush it before EntityFactory hits

river oracle
#

Guys new plan 👌 I'm going to buy paper Corp

#

And shut it down

eternal night
#

fun side node, there was a guy yesterday asking why mojang hasn't bought us or spigot kekwhyper

eternal night
#

I mean that one was bought

river oracle
#

There is a reason we're not using bukkit right now

rough ibex
#

most non-mojang launchers will use the mojang log config anyway

eternal night
#

can still hack the server

#

if that one ain't patched

river oracle
#

Pre 1.7.10 yipeeee

dry hazel
#

so good

river oracle
eternal night
#

I still run craft bukkit on prod what do you mean

river oracle
eternal night
#

You see I have this trusty webpage

river oracle
#

I hear Craftbukkit is getting components soon

#

Rejoice!!!

eternal night
#

as copium as paper fork

rough ibex
#

molang

river oracle
#

Maybe in the next thousand years

#

@eternal night Think ima rewrite bukkit this weekend for the fun of it gonna probably release it and make a trillion dollars tbh gonna suck to see spigot and paper die so fast but what can you do ig Shrug

eternal night
#

cmarco level of cope

river oracle
eternal night
#

was he banned ?

river oracle
#

Yes

eternal night
#

Whyyyyy

#

why is he back

#

😭

river oracle
#

Well he's unbanned now but God if he realizes

eternal night
#

oh xD

river oracle
#

He isn't rejoined ywt

#

Dw

eternal night
#

perfect

#

thank god

river oracle
#

He was never notified of his unban

tender shard
#

i hope nobody DMs him

eternal night
#

lets keep it this way NODDERS

river oracle
#

👌

rotund ravine
#

Why eas he banned

river oracle
rotund ravine
#

Why

river oracle
eternal night
#

self bot ?

#

time to report his account to discord

river oracle
rotund ravine
#

He was active on spigot today

junior anvil
#

is there a way of making a flying mob walk? my objective is to make a walking ghast that can melee attack

eternal night
#

you'll have to deep dive into NMS

junior anvil
#

so i'll have to basically make a mob from the ground up

livid dove
#

"It walks like a ghast, talks like a ghast, but in reality is a zombie in disguise"

junior anvil
#

what about the hitbox

livid dove
#

True true

#

I work more on the skills side of it, but maybe mythic mobs already has a solution to it (disclaimer of bias, i work as a dev for it on Mythic Enchants, so grain of salt with this one haha)

echo basalt
#

yeah you just nuke all the objectives and make them walk

#

PathfinderGoalMeleeAttack

#

it's like 5 lines of nms

livid dove
#

^

echo basalt
#

or like 20 if you do it the proper way

junior anvil
#

PathfinderGoalMeleeAttack needs a PathfinderMob as a parameter

echo basalt
#

yeah that's the nms ghast

#

for example I extend the nms creeper and register custom attack goals to not attack spectators on my minigame

junior anvil
#

ghast isnt a subclass of pathfindermob as far as i know

echo basalt
#

p sure it is

#

that's uh

#

EntityInsentient in obfuscated nms

#

Monster extends PathfinderMob

#

hm interesting

#

yeah just make a custom melee goal then

eternal night
#

you can try fucking around its moveControl

quaint mantle
#

Do you guys use the maven javadoc plugin when making your own library

echo basalt
#

You can replace PathfinderMob with Mob on the melee goal

#

and it worky

#

so eh

junior anvil
echo basalt
#

or like

#

override the travel method

junior anvil
#

wow

#

okay

tender shard
echo basalt
#

always been a thing

#

p sure

#

I'm having so much fun changing my hardcoded strings into proper message keys rn

torn shuttle
#

man I got completely sidetracked from my programming work looking at whether I wanted to buy an investment property

#

like 100% derailed me for a couple of days

#

also may I recommend not buying properties with a 25 year loan in the current housing market unless you like 2x the total to pay

echo basalt
#

sounds ab right

#

offices doubled in price in the last 3 years

torn shuttle
#

it's an investment rental property, its value 1.5x in the last 1.5 years but taking into account the bank loan price I'd be paying 2.5x what it was worth 1.5 years ago

#

not worth it

#

it was a unique opportunity due to some very specific factors but it just doesn't make that much financial sense right now

#

but hey if they fail to sell for a year I'll show up and offer 66% of their asking price clown_dead

inner mulch
#

yo i have an object that has only final values, when i call new Object, is this even taking any significant processing power at all? (all the values are predefined)

torn shuttle
#

but if you really want to know scale it up and test it

inner mulch
river oracle
#

enums aren't oop enough nerd_glasses

#

fr though what is wrong with enums

slender elbow
#

ocp

#

ofc

torn shuttle
inner mulch
#

what initializers?

echo basalt
#

constructor

river oracle
#

📆

#

its not july 17th

#

shitty emoji

tender shard
#

it's definitely july though

echo basalt
#

ah yes make the poor intern do 366 if checks

river oracle
torn shuttle
river oracle
#

just mangle the data into a file name bro

echo basalt
#

you think they're that good?

river oracle
#

oh true

echo basalt
#

magma keeps throwing shade at me being paid by the hour clown_2

torn shuttle
#

oh actually I have a fun story

#

there's a new intern at my local gym

#

he's studying fitness at uni

#

he does not know a single fucking thing about anything at the gym

#

not one muscle, not one exercise, not one machine

#

it's hilarious

echo basalt
#

let him cook

torn shuttle
#

my personal trainer is training him (since yesterday) and at one point during my workout he points at a leg press and asks "what exercise is that for"

#

and the dude says arms

#

10/10

echo basalt
#

mf could've at least gone to a gym twice

torn shuttle
#

imagine doing uni studies when going to the gym a single time would've taught you more

#

also he was asked to come up with a training plan for I think it was legs and shoulders as an exercise

#

and he gave 2 leg exercises and 7 shoulder exercises for the workout

echo basalt
#

lmfao

#

prob all just front delt too

torn shuttle
#

average jeans wearing enjoyer

#

funniest part is, if I understood correctly, he's never gone to a gym before

#

I actually know more about fitness than this dude and I actually went out of my way to pay people to figure this shit out for me because I don't have the time to learn it for myself

river oracle
#

I feel like his parents must have expectations of him or something because why the fuck is he going to uni for FITNESS if he ain't know the first thing about it??

#

I probably know more about fitness than that MF and I go to the gym like once a month lol

torn shuttle
river oracle
#

lol

torn shuttle
#

fitness studies kinda infamously have very low required averages for entry

#

and this is definitely a low IQ andy, ngl

echo basalt
#

fitness is for those who don't know nun else

#

like

#

my cousin had to repeat the year 4x and he went to fitness type deal

torn shuttle
#

I think fitness might be a field with a degree of complexity too high for this dude, he should go check if there are any openings for a position as a pedreiro

#

that might be more his speed

#

might have to teach him how to use a hammer first, though

#

oh and also how to draw patterns

quaint mantle
echo basalt
#

nah

#

just me not using hardcoded strings for messages

#

messages.send(player, "no-permission") -> messages.send(player, MessageKeys.NO_PERMISSION)

#

it's literally a string wrapper

torn shuttle
#

laughs in standardized configuration engine message initialization

echo basalt
#

you still need to tell what msg you want

#

I don't hardcode my msges

#

I hardcode my keys :)

torn shuttle
#

I bet you don't even autogenerate and autofetch translatable strings

echo basalt
#

homie my utils are more advanced than you think

torn shuttle
#

well to be fair that is not very hard, I think very little of you

#

🤡

#

I like stealing your entity packets though

echo basalt
#

that code's ass

#

I didn't bother making it nice

#

so I'm glad it meets your quality standards

#

it tells me how low they are

torn shuttle
#

I like that I didn't have to look shit up, I changed the homework because I'm an A+ student and I wouldn't want to get caught hanging out with someone who is cousins with someone who failed to enter fitness studies 4x

echo basalt
#

(he didnt fail to enter fitness studies 4x)

#

(he failed 7th grade 4x)

torn shuttle
#

ah, even better

echo basalt
#

dw I despise my family too

torn shuttle
#

do they despise you too? Because I might be warming up to them right now

echo basalt
#

can't wait for you to come ask me for my client-sided world homework :)

eternal night
#

🍿

torn shuttle
#

meh I do wonder, there was a time where I drew a line in the sand saying that I would rather make my own game than write nms code

echo basalt
#

nms is easy

torn shuttle
#

tbh I don't even think that was a bad line to draw, even now that I'm over that line

#

it's not about being easy or not it's about the hassle

echo basalt
#

kicker is that I did all this shit without using any tools or mappings

torn shuttle
#

like why bother with that hassle

echo basalt
#

like 2 years ago

#

hm

#

fuck the chicken place is closed

torn shuttle
#

not to devalue the work of game devs but to be completely clear it is easier to make some games than to make some systems I've created

torn shuttle
echo basalt
#

half a chicken is like 3,5€

torn shuttle
#

I was talking about the pizza numbnuts

echo basalt
#

oh

#

yeah it's open

#

I think their cheapest pizza is 4,5€

#

still bigger than pizza hut lmfao

torn shuttle
#

talked to my nutritionist today

eternal night
#

not to devalue the work of game devs but to be completely clear it is easier to make some games than to make some systems I've created
is gonna go into my quote book

torn shuttle
#

seems like I'm not going to be losing weight

torn shuttle
#

meanwhile I'm over here doing stupid shit to make a tower defense game in minecraft with custom models that supports several versions

eternal night
#

I mean yea, I guess. Barely a fair comparison for a game like minecraft

torn shuttle
#

I could've just made tower defense game

#

it would've been less work

eternal night
#

Restrictions empower creativity

#

or whatever the saying was

torn shuttle
#

I mean there's full on games made in mc, the tower defense game is pretty much self-contained

#

making it in minecraft is more work than making it standalone

eternal night
#

Yea, I mean that is half of its selling point tho

tender shard
#

Was the bundle finally added or is that still some preview thing?

eternal night
#

still preview

tender shard
#

Duh

#

Thx

eternal night
#

still has duplication exploits iirc xD

#

actually, dunno they might have fixed that

valid burrow
river oracle
#

idk if that's the official reason

eternal night
#

true I heard something like dat too

river oracle
#

but like seems plausable enough

young knoll
#

Give it to only java then

#

kek

echo basalt
#

mans got 32gb ram

#

Im upgrading to 64gb tomorrow swagcircle

torn shuttle
echo basalt
#

bros got 128 or sumn

torn shuttle
#

it shows 96 but it is 128

echo basalt
#

I was thinking of doing 96gb for the memes

#

but nah

#

I also got a mad deal on the 32gb kit

#

it was like 50 bucks

tender shard
#

the newest imacs only go to 24gb, that's so weird

torn shuttle
#

ddr1

echo basalt
#

ddr4 3200

#

imma overclock it to 3600 like I did for my other 2 sticks

torn shuttle
#

meh I don't even think about it

#

I scarcely ever push my rig anyway, it's massive overkill for most things

echo basalt
#

I don't use nowhere near as much ram

#

but I had 2 empty slots

torn shuttle
#

I have for llms

#

but

echo basalt
#

I guess my IDE + browser use like 15gb by themselves

torn shuttle
#

not using a gpu is just garbage

echo basalt
#

my pc reaches like 26gb ram when I'm at work :)

torn shuttle
#

I do appreciate the extra ram for video editing

echo basalt
#

bro thinks he a ytber

rough ibex
#

I use 32gb normally for just having a lot of stuff open

#

but I should get into the habit of closing stuff

echo basalt
#

16gb is like the essentials

#

manage your pc well and you'll go far

#

32gb is if you're lazy

torn shuttle
#

I'm actually about to do a lot of yt stuff

echo basalt
#

64gb is if you dont turn your pc off at night

torn shuttle
#

soon I'll be rolling in that raid shadow legends money

rough ibex
#

I used to use a laptop with 4GB of RAM

echo basalt
#

same

rough ibex
#

It actually worked, but it was slow

echo basalt
#

I built my pc with 5$ plugin money I got off my dad's laptop

rough ibex
#

so I learned patience

torn shuttle
#

my first pc was a shitty hp pavillion laptop, it ran cs:source at 4 fps

echo basalt
#

back in '98 or what

torn shuttle
#

huff my shorts

echo basalt
#

dinosaur

torn shuttle
#

zoomer

#

it's not even an old model, my first computer was a black and white monitor apple laptop

#

only got a pc much later on

echo basalt
#

I think my first pc build was literally just a bunch of parts my dad found on the side of the road

#

with a hdd he stole from work

#

and a sketchy 200w power supply

torn shuttle
#

I kept wishing my family would let me get a pc instead of handing me down their old macs, the only games I could play were civilization and then runescape (though not consistently, my browser has issues)

echo basalt
#

my family never gave me shit

#

which is why I got into development n made money

torn shuttle
#

I have a really nice and loving family and they keep telling me they're proud of me, they've got my back and I've got theirs

echo basalt
#

I worked to buy my shoes n clothes from the age of like 12

summer spade
echo basalt
#

uh

torn shuttle
#

where the hell were you even living that this was the case

echo basalt
#

I'd live under their roof and ate my mom's food until like 8th grade

echo basalt
torn shuttle
#

were you living in a korean webnovel story?

echo basalt
#

made a minigame network last week and blew all the money on an office chair

echo basalt
torn shuttle
#

you didn't need to say that first part, we know

summer spade
#

don't get involved in opensource

#

no money + no time

echo basalt
#

opensource = good for portfolio

torn shuttle
#

guys

echo basalt
#

just learn how to manage

torn shuttle
#

all of my projects are open source

summer spade
#

i got like 3 million users on a project and not one dollar

torn shuttle
#

and uh

#

i'm doing more than fine

#

I hire people full time

summer spade
torn shuttle
#

it's called skills, I recommend you get good

echo basalt
#

tp the player or the boat

#

it works if you do it often enough

torn shuttle
#

actually correction currently my least popular project is closed source

rough ibex
#

it must be caged and hidden

torn shuttle
#

it's just because I want to make it into a standalone game and I don't want someone to just yoink the logic and balance outright

echo basalt
#

On the left side you have commission stuff

#

1:1 customs, you do it and move on

rough ibex
#

playergivehead

echo basalt
#

On the middle, you have public plugins

#

Maybe you charge for it, up to you

#

And on the right side you have open source

#

Left = +money, -popularity

#

Right = -money, +popularity

#

And middle is a weird one where you struggle with both

slender elbow
torn shuttle
young knoll
#

ayo?

tame sedge
echo basalt
#

Yeah but it's harder to grow

#

That's the in between of right and mid

torn shuttle
#

if it were easy it would be called your workout

echo basalt
#

oh okay

#

Anyways

#

This spectrum applies to your project, not your career

#

If all your projects are open source and you don't market it then yeah good luck making money

echo basalt
#

you have an audience

#

and you sell stuff

torn shuttle
#

I didn't advertise

echo basalt
#

So you're in a middle

torn shuttle
#

and it's all open source

echo basalt
#

If all your projects are commissions then you make cash fairly easy, but you struggle to grow an audience

torn shuttle
#

to be clear there is a difference between making a plugin and making content

#

or there can be

tender shard
torn shuttle
#

like right now I'm making a system that allows you to create your own custom models that cna be used as mounts in-game

#

but I can also sell premade mounts

#

and the system would still be open source

#

other people can do this as well

summer spade
#

I don't even do minecraft dev tbh, I did it like once 6 years ago and make 15 bucks with this pretty simple custom bosses plugin

echo basalt
#

25$+ / hr take it or leave it

summer spade
#

the thing i'm working on rn is just a bit of an undertaking for a solo dev so i thought i might try minecraft dev again for a day or two

echo basalt
#

¯_(ツ)_/¯

torn shuttle
#

we are talking about developing plugins

echo basalt
#

we're talking ab career development

torn shuttle
#

no

echo basalt
#

open a thread

torn shuttle
#

it's help-development not help-zushee

echo basalt
#

:)

#

shut up magma

summer spade
#

channel may as well be help zushee now

torn shuttle
echo basalt
#

ngl this 4$ pizza is bussin

torn shuttle
#

you're just hangry and craving cardboard

candid inlet
#

does PlayerMoveEvent even get fired in that case? shouldn't it be VehicleMoveEvent?

quaint mantle
#

hi I want to learn how to create a plugin can you tell me where to learn?

tender shard
#

do you know java?

quaint mantle
#

i have to learn it

tender shard
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

wet breach
hazy parrot
#

TIL baeldung is java specific

slender elbow
#

it isn't

hazy parrot
#

Oh, I trough it's implied with this learnjava

#

Lol

tender shard
#

ChatGPT wrote ?learnjava :p

river oracle
candid inlet
#

you could teleport the player instead of the boat? it looks like you can't teleport occupied boat for some reason, if teleporting the player didn't work then you'll have to remove the player from the boat, teleport it as you wish then put him back, I'd just try teleporting the player first since it's better approach

jagged bobcat
#

??

        Entity entity;
        Vector vector = entity.getVelocity();
        if (vector.isZero()){
            // ??
        }
#

then update your spigot to the latest one

#

What is the dependency version you are using?

chrome beacon
#

just check the velocity yourself

jagged bobcat
chrome beacon
#

it's just a vector

fluid river
#

according to Single Resp principle

#

what LANServer and LANClient can do and what they shouldn't

quaint mantle
#

One message removed from a suspended account.

#

One message removed from a suspended account.

fluid river
#

I have a lot of UI and and some operations based only on TCP and UDP packets

candid inlet
fluid river
#

I'm thinking about creating some sort of Layer class, which can close the UI tab if tcp calls a ConnectionLostEvent, and also can stop packet sending/receiveng if user presses a UI button by sending some kind of PlayerClosedTabEvent

#

rn my server gets an instance of a UI tab inside the connection method so it can close the tab when something goes wrong

#

and code looks really messed up

quaint mantle
#

One message removed from a suspended account.

fluid river
quaint mantle
sand spire
#

How do I loop through all existing entities (even entities that aren't loaded in any world)? Cause i'm trying to receive entitytypes from a configfile but I don't think you can save entities so I save strings and I need to be able to compare the string to the entity names

sullen marlin
#

you cant get unloaded entities

#

?xy

undone axleBOT
fluid river
#

LivingEntitys are PersistentDataHolders so you can store PD tags on them instead of saving them to config

fluid river
candid inlet
candid inlet
# fluid river is that a right approach

prob, if there is some functions in the UI that needs to do things with the connection then it could use another implementation that's responsible for that, do not implement anything in UI that it shouldn't be responsible to but use other implementations through interfaces if needed

fluid river
#

Cancel connection while joining

#

input a password

#

close the "Joining. Please wait" panel if i get to a timeout

#

so ui affects connection and connection affects the ui ofc

sand spire
fluid river
#

so i thought about a layer class which directs events between UI and Server

#

well, you just loop through the loaded entities

#

and if entities of this type should be killed, server kills them

candid inlet
# fluid river so ui affects connection and connection affects the ui ofc

yes but the UI shouldn't have any implementation of anything connection related, it'd talk to interface that has implementation and responsible for connection related stuff, SRP basically talks about having 1 reason for that class to change and if you implement connection logic in the UI then you'll have another reason which is changing UI related stuff and connection related stuff, breaking SRP

fluid river
#

Well, my UI has a button for example

#

so when i press it, something should happen like a ButtonPressEvent ig

inner mulch
#

are inner classes inherited as well?

hybrid spoke
inner mulch
#

can i inherit both ? or is there still only 1 inheritance allowed?

plucky rock
#
                if (AttackerName.contains("§5King of Spider's Servant")) {
                    new BukkitRunnable() {
                        @Override
                        public void run() {
                            Vector up = player.getVelocity().setY(0).setX(0).setZ(0);
                            player.setVelocity(up);
                            player.sendMessage("Debug3333");
                        }
                    }.runTaskLater(this, 20L * 1L);

                }
``` any1 knows why this doesnt work?
young knoll
#

What do you expect it to do

rough ibex
#

is the name actually correct

young knoll
#

Because the vector is named up but it has all 3 values set to 0

plucky rock
#

since its an onentitydaamgeentyty event

#

name is correct

#

debug msg isnt sending anymore

#

i orginally wanted it to push player up

#

but for testing purposes is et it to 0

#

to see if it would cancel kb

#

since i couldnt get push player up working

young knoll
#

1 tick should be enough, rather than 20

#

Also if you are on latest there is a knockback event

plucky rock
#

sadly i am not

#

actully i might

#

i am not

#

but yea i do what this to be a damage event

#

as i want to send the player flying up when they get hit

#

i could update actully

#

maybe

#

🤔

young knoll
#

You should identify the entity with pdc instead

plucky rock
#

whats pdc?