#help-development

1 messages ยท Page 827 of 1

undone axleBOT
spare hazel
spare hazel
eternal oxide
#

attribute doesn't exist on that entity

spare hazel
#
package com.amirparsa.iranskyentities.entities;

import com.amirparsa.hypixelcustomitems.Items.Fishing.SavvyInk;
import com.amirparsa.hypixelcustomitems.KeyStore;
import com.amirparsa.iranskyentities.CustomEntity;
import com.amirparsa.iranskyentities.TextData;
import com.amirparsa.iranskyentities.datastore.Equipment;
import com.amirparsa.iranskyentities.datastore.Rarity;
import com.amirparsa.iranskyentities.datastore.Stats;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDeathEvent;

public class SavvySquid extends CustomEntity {

    public SavvySquid(){
        setStats(new Stats(
                    150f,
                10,
                5,
                300
        ));
        setEquipment(new Equipment(null,null,null,null,null));
        setRarity(Rarity.COMMON);
        getDrops().addDrop(new SavvyInk().build(KeyStore.getItemKey()), 1);
        getDrops().setRepeats(1);
        setId("SAVVY_SQUID");
        setName(TextData.getString("data.entity.SAVVY_SQUID.name"));
        setEntityType(EntityType.SQUID);
    }

    @Override
    public void customSpawnFeatures(LivingEntity entity, Player spawner) {

    }

    @Override
    public void onEntityDeath(EntityDeathEvent e) {

    }

    @Override
    public void onEntityDamage(EntityDamageByEntityEvent e) {

    }
}
#

?paste

undone axleBOT
spare hazel
#

please tell me what can i do

#

like the attribute damage doesnt exist on squid?

eternal oxide
#

nothing you posted uses attributes

spare hazel
#

wait a minute

#

?paste

undone axleBOT
spare hazel
#

there u go

#

should i wrap them around in Objects.requireNonNull() ?

eternal oxide
#

no

spare hazel
#

then what should i do

#

wrap them in try{}catch(Exception ignore){} ?

eternal oxide
#

I have a feeling damage is only on weapons

spare hazel
#

yoooo it works

ivory sleet
alpine otter
#

does someone know why that could happen on a spigot plugin with jetty embedded? sh java.lang.IncompatibleClassChangeError: Class org.eclipse.jetty.util.ArrayTernaryTrie$Growing does not implement the requested interface org.eclipse.jetty.util.Index$Mutable

eternal oxide
#

looks liek trying to modify an immutable array

alpine otter
#

idk is just jetty, i didn't modify any array

young knoll
#

Nah that's not an immutable error

#

That's a this class impliements an interface but fails to impliment one of its methods

ivory sleet
#

looks like some sort of linkage error ye

young knoll
#

Stop breaking the world smh

ivory sleet
#

shake my smh coll

inner mulch
#

is the cost in terms of ram the same when creating an object as well a maintaining it?

ivory sleet
#

i mean keeping it in memory is arguably more work as u occupy on heap memory and it needs to be checked if it can be gcd or not

inner mulch
#

so instant delete once not in use?

#

even though i could get used the next secodn and then needs to be recreated?

ivory sleet
#

well what exactly ru trying to do

river oracle
#

an object only gets GC'd if it falls out of scope

#

or you only hold WeakReferences

inner mulch
#

i attach a java object to an itemstack so that it is marked as custom

ivory sleet
#

u have phantom and soft references as well

river oracle
#

e.g. if you're actively using a list it won't just randomly get GC'd

inner mulch
#

once the item is dropped i delete object

ivory sleet
#

and then other stuff like Reference::reachabilityFence

river oracle
eternal oxide
#

I think you are talking at crossed purposes

river oracle
#

java exists so you don't have to worry about low level memory collection etc take advantage of that and just don't care unless you hyper optimziing something

ivory sleet
#

youraslvation is performance an actual problem in ur case?

#

or ru just prematurely acting rn?

inner mulch
#

i just wanted to optimize

river oracle
#

idk if theirs anything you can do yourself to optimize pdc ๐Ÿค”

ivory sleet
#

yes well the general idea behind java object allocation is to keep ur objects around as long as you need them

#

and then java will dispose of them when needed

river oracle
#

keep ur objects around as long as you need them just be careful this this because if you do something stupid and never clear a cache etc that's how you end up with memory leaks

ivory sleet
#

then you've kept them around longer for what you need them but yes

river oracle
#

more so want to stress the importance of the cognizance of the expected life time of your object and ensuring you've removed your references to it. Really though even then you shouldn't really have to worry about this as far as PDC goes

#

since all your data is stored in PDC, the API abstracts the worry away for you

ivory sleet
#

managing your references and variables and mem in general is way more important in lower level langs for good reasons

river oracle
ivory sleet
#

yea lol

#

i touched mips, alr got my braincells turned around

#

but u should learn cpp right?

#

since a lot of java is in cpp

river oracle
#

ahh I was learning C,but I stopped for a bit cuz I really didn't feel like learning macros

#

it seemed like a pain in the Ass to execute generic like syntax for data structures

#

plus I had finals coming up and I really didn't have time to pull my hair out over C and finals

ivory sleet
river oracle
ivory sleet
#

haha cmake

#

yeah

river oracle
#

What 50 years and still no proper thing better than cmake??

quaint mantle
#
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: net/evilblock/pidgin/message/listener/MessageListener```
whats up with this? I think I added the right dir in my pom and yet
eternal oxide
#

does it work with a fresh server start?

quaint mantle
#

nop the same issue

#

tried rebuilding

eternal oxide
#

run a mvn clean package

quaint mantle
#

I dont think I got maven installed

eternal oxide
#

how are you building?

quaint mantle
#
mvn : The term 'mvn' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was 
included, verify that the path is correct and try again.
At line:1 char:1
+ mvn clean
+ ~~~
    + CategoryInfo          : ObjectNotFound: (mvn:String) [], CommandNotFoundException
#

this happens

candid rapids
#

I want to run bungeecord player's command in Java(Kotlin) Plugin.

event.player.performCommand("party chat")

My Code ^^^^

In ItemHeldEvent, party chat is bungeecord plugin's command. but it's cannot run. how can I fix it?

P.S. I already use Bukkit.dispatchCommand and Bukkit.getServer().dispatchCommand :<

eternal oxide
#

will not work

candid rapids
#

i can't?

eternal oxide
#

performCommand is local to the server and never seen by bungee

candid rapids
#

how can using bungeecord command?

eternal oxide
#

?pmc

candid rapids
#

thk

alpine otter
eternal oxide
alpine otter
quaint mantle
#

could I try exluding pigdin from shading?

eternal oxide
#

is your server running java 11?

quaint mantle
#

elgarll

quaint mantle
#

was it for me

alpine otter
quaint mantle
#

or the other guy?

alpine otter
eternal oxide
#

if its a shadable resource

quaint mantle
#
<dependency>
    <groupId>net.evilblock.pidgin</groupId>
    <artifactId>pidgin</artifactId>
    <version>1.0</version>
System path thing here
    <exclusions>
        <exclusion>
            <groupId>monke</groupId>
            <artifactId>monke</artifactId>
        </exclusion>
    </exclusions>
</dependency>

and then the other one

#

am I right?

#

worth a shot

eternal oxide
quaint mantle
#

wym?

eternal oxide
#

your error says pvp/core/club/shaded/pidgin/message/listener/MessageListener

quaint mantle
#

I think I got it

eternal oxide
#

so you must/should shade/relocate pidgin to that location in your jar

uncut needle
#

when selecting in fawe this white box apears without mods. Does someone know how to do it? It is also client side

ivory sleet
#

and u're not in f3 mode?

uncut needle
#

no

ivory sleet
#

interesting

#

my guess would be some display entity

#

tho thats just a speculation

eternal oxide
#

7smile7 was playign around doing that a while back

uncut needle
#

did u meant the one that shows entity boxes

ivory sleet
#

it looks like a aabb hitbox

#

yea

ivory sleet
quaint mantle
#

im actually done with redis

eternal oxide
#

@lost matrix ^ you did this a while back didn't you?

quaint mantle
#

bye bye redis you have served me well

uncut needle
#

bye all of you

ivory sleet
#

lol

eternal oxide
#

nah he was rendering to sides

uncut needle
#

it doesnt look like particles

#

the line gets smaller when u get closer

#

particles dont

#

im gonna try to look at the source code

chrome beacon
#

Structure Block outline

#

?

lost matrix
lost matrix
quaint mantle
ivory sleet
#

they are sorta meant for different things

lost matrix
ivory sleet
#

one is heavily in memory based

#

and the other one is more for ur persistence

river oracle
#

Mongodb the #1 redis replacement ๐Ÿ’ช๐Ÿ”ฅsanta_5

lost matrix
#

Pretty much what conclure said. Completely different applications.
Its like saying "Bye Spigot. Im using Bungeecord now."

uncut needle
#

it spawns a structure black

#

block

minor junco
#

i mean whether u use monogodb directly or something like redis depends on your use cases I guess

ivory sleet
#

i mean whether u use monogodb directly or something like redis depends on your use cases I guess
fify

minor junco
#

was rhetoric

#

i mean obviously it depends on your use case

kindred sentinel
#
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.Tag.getValues()" because "org.bukkit.Tag.ITEMS_FURNACE_MATERIALS" is null

code

    public void onInventoryInteract(InventoryClickEvent event){
        System.out.println(event.getRawSlot());
        for(Material a : Tag.ITEMS_FURNACE_MATERIALS.getValues()){
            System.out.println(a);
        }
    }
#

What's wrong??

#

I need set of fuels

#

everything that can be fuel for furnace

proud badge
#

Should looping through an array in my ram be done async or will it not help?

shadow night
#

Depends, kind of.

chrome beacon
#

You'll most likely make things slower and break stuff

proud badge
#

damn I use async almost all of the time in my plugins ๐Ÿ’€

shadow night
#

Oh yeah, async can be dangerous

proud badge
#

Even if my ArrayList is 200 objects long I shouldnt use Async?

chrome beacon
#

Now ask yourself why do you need to go through 200 objects

proud badge
#

JSON file with player sethomes

#

Need to find the one

chrome beacon
#

๐Ÿ’€

proud badge
#

that matches player uuid - arraylist sethome object uuid

knotty aspen
#

200 objects is basically nothing lol

proud badge
#
        for (HomeLocation home : homeLocations) {
            if(home.getUUID().equals(sender.getUniqueId())) {
                return home;
            }
        }
        return null;
    }```
knotty aspen
#

computers are fast. if you have 20k objects I would worry about that, but not with 200

chrome beacon
#

That's quite a poor way of storing the homes

proud badge
#

damn fr?

knotty aspen
#

and yes, that could use a map or something

chrome beacon
#

^ and don't store all the homes in a single json file

proud badge
#

rip why not

chrome beacon
#

you'll need to load the entire thing in to memory to read from it

#

Now what happens if you have a lot of users

kindred sentinel
proud badge
#

I guess on server start I could try loading the homes into a hashmap

chrome beacon
#

Keeping homes of players that aren't online in memory is just a waste

knotty aspen
#

yeah but you still wouldn't want to load all homes. No reason to load homes from that random user who last logged in two years ago

proud badge
#
  {
    "uuid": "3b4b5172-4860-4191-bda8-1be9ae7cace8",
    "worldName": "heese",
    "x": 1261,
    "y": 56,
    "z": 2720,
    "yaw": 56.58,
    "pitch": 86.69
  },
  {
    "uuid": "830eb1b9-441d-4f15-a011-7b8688841003",
    "worldName": "heese",
    "x": 10315,
    "y": 62,
    "z": 9777,
    "yaw": 250.95,
    "pitch": 46.65
  },
  {
    "uuid": "6132603f-8b63-4e8d-93a2-b780e854affa",
    "worldName": "heese",
    "x": 1511,
    "y": 68,
    "z": 606,
    "yaw": 45.74,
    "pitch": 11.19
  },
  {
    "uuid": "a639919a-1213-4e82-a56b-31f09dace6b3",
    "worldName": "heese",
    "x": -6432,
    "y": 97,
    "z": -2325,
    "yaw": 117.11,
    "pitch": 24.9
  },
  {
    "uuid": "e87b776c-74f1-4f31-a936-fa1cddb2b634",
    "worldName": "heese",
    "x": 10350,
    "y": 72,
    "z": -8715,
    "yaw": 116.28,
    "pitch": 18.6
  },
  {
    "uuid": "f08e4f92-a3ed-43a7-adee-d22c68a13d80",
    "worldName": "heese",
    "x": -15150,
    "y": -51,
    "z": 15277,
    "yaw": 132.17,
    "pitch": -2.08
  }
]```
#

an example

shadow night
knotty aspen
#

you could store them per user, and give the file the user uuid as name. and then just load that when they log in

shadow night
#

And you should also probably store them in a subdirectory in your plugin data folder, I think

kindred sentinel
#

I would store every user in HashMap on server load and use HashMap.get(player.getUniqueId)

proud badge
#

ok so
playeruuid.json containing

[
  {
    "uuid": "f08e4f92-a3ed-43a7-adee-d22c68a13d80",
    "worldName": "heese",
    "x": -15150,
    "y": -51,
    "z": 15277,
    "yaw": 132.17,
    "pitch": -2.08
  }
]```
load it when they join, save when they leave?
knotty aspen
#

yeah for example

kindred sentinel
#

why not?

proud badge
#

I think its better to do the hashmap when they join

shadow night
#

If users have multiple homes that won't work

chrome beacon
#

Why load data for users that aren't online

proud badge
#

And delete when they leave

chrome beacon
#

You're just wasting memory at that point

shadow night
kindred sentinel
chrome beacon
#

Yeah which is why I said that's a bad way of storing the data

kindred sentinel
#

btw yml config is better

knotty aspen
#

doesn't really make much of a difference here

shadow night
chrome beacon
#

eh negligable

kindred sentinel
#

it makes cause you can just do getFileConfigurationSection.get(player.getUniqueId())

knotty aspen
#

get(key) also exists in json

shadow night
#

Simpler, but I find json kinda better for things like that, idk why

kindred sentinel
#

oh

proud badge
#

ok i think what imma do is when a player joins I'll loop through homes.json, grab their home, put it in a hashmap and when they leave I save it back

kindred sentinel
#

ok

proud badge
#

@chrome beacon why

knotty aspen
#

If you had one file per user you wouldn't need to loop at all

chrome beacon
#

^^

proud badge
#

whats wrong with my plan

chrome beacon
#

Just do what Malfrador told you to do

proud badge
#

But I'd need to migrate my entire homes.json somehow again ๐Ÿ’€

knotty aspen
#

do the loopy thing when they log in, but always save to the user file

#

then everytime someone logs in for the first time after the change, their homes will be migrated

shadow night
#

What about the thing that hashmaps have one value per key

#

Do you really need an array of home objects?

#

Just thinking, is there some better way than that?

knotty aspen
#

if users can have multiple homes, yeah. but just putting a list into the hashmap should be fine for that

#

or a set or whatever collection you want

shadow night
proud badge
#

oh btw I forgot to mention but theyre in a Set not an ArrayList

#

does that make a difference

#

public static final Set<HomeLocation> homeLocations = new HashSet<>();

knotty aspen
#

no. the set has no order, while the arraylist will have an order. but that shouldn't matter for homes

chrome beacon
#

why is that public static

shadow night
#

That is a good question

proud badge
#

no clue my friend made it

shadow night
#

Dependency injection moment ig?

knotty aspen
#

yeah it probably shouldn't be public static lol

proud badge
#

private then?

shadow night
#

and you'd probably want to do some stuff with mutability and however tf it's done, idk

proud badge
#

private static?

knotty aspen
#

depends on where it is. I would make one UserData class, instance that per (online) player and then have the homes as private in that class

shadow night
#

At that point it's just kinda like files in ram stuff lol

knotty aspen
#

well yeah probably overkill if all that plugin does is homes. but if you have more than one thing to store per user, or expect that to be the case in the future

proud badge
#

all it does is teleportation

#

warps, spawn, homes

lost matrix
proud badge
#

yes

#

extra sethomes

#

/home2

lost matrix
#

XDD

proud badge
#

you can get for voting

lost matrix
#

I mean...

slate crown
#

json vs yml for player island info?

#

wich better

quiet ice
#

yaml is a json superset

rapid trout
#

Hi I am searching a packet for change the pitch and the yaw of a player, I am using NMS with spigot 1.20.2

ivory sleet
#

json is faster parsing wise I believe since its more strict in terms of syntax

knotty aspen
#

Player#lookAt

#

unless thats Paper only

rapid trout
#

That doesn't exist on spigot ?

knotty aspen
#

idk, it might. I haven't checked just use paper

wary harness
#

@lost matrix I found solution for the problem btw

#

Libby dependency was bringing Bungee and Velocity jar content with it from some reason

kindred sentinel
#

Could anyone help? What's wrong with it? I just want tag of fuels, and IntelijIdea says that there is a Tag.ITEMS_FURNACE_MATERIALS

Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.Tag.getValues()" because "org.bukkit.Tag.ITEMS_FURNACE_MATERIALS" is null

code

    public void onInventoryInteract(InventoryClickEvent event){
        System.out.println(event.getRawSlot());
        for(Material a : Tag.ITEMS_FURNACE_MATERIALS.getValues()){
            System.out.println(a);
        }
    }
knotty aspen
#

Furnace materials tag hasn't existed since 1.16.2

#

one of the many reasons why having static constants in the API for that stuff is a bad idea. there are multiple tags for burnable stuff, look at https://minecraft.wiki/w/Tag#Items

rapid trout
# knotty aspen idk, it might. I haven't checked ~~just use paper~~

I found this but doesn't work have you an idea I have never used packets ?

public static void setPlayerOrientation(Player player, float pitch, float yaw) {
        CraftPlayer craftPlayer = (CraftPlayer) player;

        byte bytePitch = (byte) (pitch * 256 / 360);
        byte byteYaw = (byte) (yaw * 256 / 360);

        craftPlayer.getHandle().c.a(new PacketPlayOutEntity.PacketPlayOutEntityLook(craftPlayer.getEntityId(), bytePitch, byteYaw, false));
}
orchid trout
#

is it possbiel to ingnore this

knotty aspen
dry hazel
orchid trout
#

aa

#

i put jar in build path and compile

proud badge
orchid trout
#

?paper

#

?thjisiossp[igotnotpaper

dry hazel
#

?whereami

orchid trout
#

all me

orchid trout
dry hazel
#

you're missing a dependency on the compilation classpath

orchid trout
#

does that mean i have to do something in pom.xml

dry hazel
#

no idea

static cave
orchid trout
#

fixed it thatnsk

#

all i had to do is follow the instructions

quaint mantle
#

when you use build tools

#

or here wait

#

Why does bukkit or minecraft make their code so weird

#

they're using like a reverse guard clause or something

static cave
knotty aspen
#

because mojang is nice enough to provide mappings for modders, but the game isn't open source for legal reasons

quaint mantle
worldly ingot
#

Likely a case of either (a) old code. it isn't broken, don't need to fix it, (b) CraftBukkit patches to avoid minimal diff, or (c) symptom of a decompiler

quaint mantle
#

Yeah might be the decompiler

knotty aspen
#

d) client code being stripped out

quaint mantle
#

I used some random online decompiler cause I'm on my phone ๐Ÿ’€

worldly ingot
#

Though I think they do that less and less now-a-days

quaint mantle
#

Is it just me

#

Or does nms and bukkit violate a ton of solid principles

knotty aspen
#

the principle of "not overengineering everything"? lol

#

because mojang loves to do that

remote swallow
#

SOLID principals

knotty aspen
#

some of the codebase is still very much "notch wrote this in a few days in 2009", and some of the newer stuff is needlessly overengineered. but overall imo the minecraft codebase isn't too bad anymore. just blindly applying some theoretical principles to a project makes no sense anyways

worldly ingot
#

Especially when some of those principles really aren't suited towards modern software. They don't really take into account the power of modern compilers, and modern software features, etc.

quaint mantle
#

ig I am looking at 1.8 nms

#

@worldly ingot do yk what true damage is from hypixel

knotty aspen
#

1.13 did a lot of changes, before that it really was a mess. and 1.8 was ten years ago, safe to assume mojang has learned a lot in that time too

worldly ingot
quaint mantle
#

so for example:
player with full diamond armor, resistance 2
True damage: 2
Player still losing 1 full heart

worldly ingot
#

isn't that just a value in the damage event :p

quaint mantle
#

I was just wondering if they use nms for that, or use .setHealth

river oracle
#

I don't think choco is going to help you make a 1 to 1 hypixel clone regardless of his status at hypixel

#

as I said before it is up to you to figure it out my mans

quaint mantle
#

it's not I just wanna make my own gamemode

young knoll
#

setHealth is the easy way

quaint mantle
#

idk every time I've used that, it's just handling hell

knotty aspen
#

Hypixel rewrote that entire part anyways

#

which if you want to do any larger changes to combat (or just good cross version compat) is kinda needed

quaint mantle
#

I'm going through nms rn and I'm seeing a damage source has the option for .setIgnoreArmor()

#

But can a damagesource ignore potion effects too or nah

steel swan
#

hey a little question do u guys see any problem in this line? it just doesnt generate a tree, everything else is good i even put debugs to check the localisation and its a valid localisation

orchid trout
#

does the world exist

steel swan
#

yep

#

and im in it and the location is exactly where it needs to be

#

but it doesnt work

sullen marlin
#

Sure the location doesn't need to be one block higher

steel swan
#

i am going to check this out !

terse pumice
#

Does anyone know of a website/api that simply has the 16x16 default item textures for different materials?

sullen marlin
#

?xy

undone axleBOT
steel swan
sullen marlin
#

No worries

terse pumice
#

I just need the images for use in Bedrock forms

sullen marlin
#

Can the forms not reference resources?

#

In any case I doubt someone will appreciate you using their website for your form, host it yourself

terse pumice
#

Well I was looking for an api to be honest, worst case I'll just use a github repo

terse pumice
knotty aspen
terse pumice
#

that'll do, thank youu

obsidian drift
#

I'm trying to get a TextDisplay to mount onto a ServerPlayer, it works but only when the chunk is reloaded does the TextDisplay actually appear above the player.

boolean b = ((CraftTextDisplay) textDisplay).getHandle().startRiding(serverPlayer, true); // b=true

Anyone got any ideas?

rotund ravine
#

Why are you using nms for that

obsidian drift
#

The server player is an NPC

#

And I donโ€™t think getBukkitEntity works on server players

#

(If theyโ€™re an npc)

knotty aspen
#

sounds like some sort of desync. mount packet not being correctly sent or something

kindred sentinel
#

How to get how long item is burning in furnace?

orchid trout
kindred sentinel
#

I found Material.isFuel but didn't find the time

kindred sentinel
kindred sentinel
crystal palm
#

heya! which event is called when a player uses a fishing rod? (not when the player captures something and reels it back)

orchid trout
#

playerinteractevent most likely

#

or some event simillar

crystal palm
#

oh wait

#

maybeh?

quaint mantle
#
      Function<Double, Double> resistance = new Function<Double, Double>() {
          public Double apply(Double f) {
            if (!damagesource.isStarvation() && EntityLiving.this.hasEffect(MobEffectList.RESISTANCE) && damagesource != DamageSource.OUT_OF_WORLD) {
              int i = (EntityLiving.this.getEffect(MobEffectList.RESISTANCE).getAmplifier() + 1) * 5;
              int j = 25 - i;
              float f1 = f.floatValue() * j;
              return Double.valueOf(-(f.doubleValue() - (f1 / 25.0F)));
            } 
            return Double.valueOf(-0.0D);
          }
        };
      float resistanceModifier = ((Double)resistance.apply(Double.valueOf(f))).floatValue();
      f += resistanceModifier;

Anyone know how I can change the resistance modifier to not apply

#

and I need the dmg source to be an entity type

glad prawn
#

wat

quaint mantle
#

Like a section

ivory sleet
kindred sentinel
#

is it possible to create block without adding it to the world?

quaint mantle
#

idk how im supposed to edit

ivory sleet
#

Oh, thatโ€™s nms code?

quaint mantle
#

yeah

ivory sleet
#

Goofy shit

quaint mantle
#

it's rly annoying how it's all just stacked in one method

ivory sleet
#

Unsure, but isnt there a damagesource api

#

Maybe paper (idr)

quaint mantle
#

if (!damagesource.isStarvation() && EntityLiving.this.hasEffect(MobEffectList.RESISTANCE) && damagesource != DamageSource.OUT_OF_WORLD) { this is the only thing

#

maybe i can spoof it to be a starvation dmg?

knotty aspen
#

Easiest is probably doing the calculation yourself and setting the health

steel swan
#

Hello, once again, does anyone know how to make a ONE biome World

remote swallow
#

public class SingleBiomeProvider extends BiomeProvider {
    private final Biome biome;

    public SingleBiomeProvider(Biome biome) {
        this.biome = biome;
    }

    @Override
    public Biome getBiome(WorldInfo worldInfo, int x, int y, int z) {
        return biome;
    }

    @Override
    public List<Biome> getBiomes(WorldInfo worldInfo) {
        return Collections.singletonList(biome);
    }

}
young knoll
#

Make a custom biome provider that only returns one biome

remote swallow
#

spoon moment

young knoll
#

Oh hey I wonder where that came from

remote swallow
#

same

steel swan
steel swan
#

thx !

steel swan
young knoll
#

Mhm

steel swan
strong parcel
strong parcel
#

I am not sure where to put the DynmapCommonAPIListener.register method and how to get the DynmapCommonAPI object out.

rotund ravine
#

Itโ€™s static

#

A static method

strong parcel
#

Using .register requires a DynmapCommonAPiListener as a parameter.

slender elbow
#

yes, you create your own subclass of it

strong parcel
#

So this is similar to Bukkit.getPluginManager.registerEvents()?

slender elbow
#

uh, sure, except that you don't use @EventHandlers but override the methods that you need to implement

rotund ravine
#

๐Ÿ‘€

strong parcel
#

I made a class called Dynmap that extends DynmapCommonAPIListener. When apiEnabled triggers, it assigns the api to dynmapCommonAPI, which I then use with an eventhandler to make a marker.

#

I have DynmapCommonAPIListener.register(new Dynmap()); in my OnEnable.

rotund ravine
#

Ur doing smth wrong then

#

Ur welcome

strong parcel
#

However, I just tested it and got an error that dynmapCommonAPI is null ๐Ÿค”

rapid trout
#

I am trying to use player.lookAt with paper for player to look at a specific direction (yaw, pitch) but I have an error in my consol when I start my server :

Location location = p.getLocation();
location.setPitch(pitch);
location.setYaw(yaw);

p.lookAt(location, LookAnchor.EYES);

Caused by: java.lang.ClassNotFoundException: io.papermc.paper.math.Position

wide cipher
#

how can i use ProtocolLib to do this?

twin venture
#

hi , anyone Used ormlite? if so , how would i have a list of strings for example :
User favorite Maps
it will be list , how would i make that happen?

#

This is what i have so far :

hazy parrot
#

what

#

you want to save list inside of your dao object ?

twin venture
#

a FavoriteUser :
will have a list of favorite maps

#

so lets say :

  • Map2
  • Map15
  • DragonKillerMap
  • ... just an example
#

etc

hazy parrot
#

and Map is also dao ?

twin venture
#

no its a string

#

the arena name

hazy parrot
#

kinda weird for arena to have just name

#

but you would have to look into relationships

twin venture
#

,-, it have other data but i only need the name

hazy parrot
#

this is how its done in hibernate, you would need 1 to many relationship

#

it would be something similar

twin venture
#

alright thanks

hazy parrot
wide cipher
#
        at ca.nagasonic.skonic.elements.skins.EffFakeSkin.execute(EffFakeSkin.java:53) ~[Skonic-1.0.5.jar:?]
        at ch.njol.skript.lang.Effect.run(Effect.java:50) ~[Skript (5).jar:?]
        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:62) ~[Skript (5).jar:?]
        at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:90) ~[Skript (5).jar:?]
        at ch.njol.skript.command.Commands.handleEffectCommand(Commands.java:200) ~[Skript (5).jar:?]
        at ch.njol.skript.command.Commands$2.lambda$onPlayerChat$0(Commands.java:299) ~[Skript (5).jar:?]
        at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftFuture.run(CraftFuture.java:88) ~[paper-1.19.4.jar:git-Paper-550]
        at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[paper-1.19.4.jar:git-Paper-550]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1483) ~[paper-1.19.4.jar:git-Paper-550]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:447) ~[paper-1.19.4.jar:git-Paper-550]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1397) ~[paper-1.19.4.jar:git-Paper-550]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1174) ~[paper-1.19.4.jar:git-Paper-550]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[paper-1.19.4.jar:git-Paper-550]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]```
minor junco
wide cipher
#
        Class<?> craftPlayer = getCraftClass("entity.CraftPlayer");
        Class<?> playerConnection = getNMSClass("server.network", "PlayerConnection");
        Class<?> playerCommonConnection;
        Class<?> serverLevel = getNMSClass("server.level", "ServerLevel");
        if (supports(20) && supportsPatch(2)) {
            // The packet send method has been abstracted from ServerGamePacketListenerImpl to ServerCommonPacketListenerImpl in 1.20.2
            playerCommonConnection = getNMSClass("server.network", "ServerCommonPacketListenerImpl");
        } else {
            playerCommonConnection = playerConnection;
        }

        MethodHandles.Lookup lookup = MethodHandles.lookup();
        MethodHandle sendPacket = null, getHandle = null, connection = null, getServerLevel = null;

        try {
            connection = lookup.findGetter(entityPlayer,
                    v(20, "c").v(17, "b").orElse("playerConnection"), playerConnection);
            getHandle = lookup.findVirtual(craftPlayer, "getHandle", MethodType.methodType(entityPlayer));
            sendPacket = lookup.findVirtual(playerCommonConnection,
                    v(20, 2, "b").v(18, "a").orElse("sendPacket"),
                    MethodType.methodType(void.class, getNMSClass("network.protocol", "Packet")));
            getServerLevel = lookup.findVirtual(entityPlayer,
                    v(20, "f").v(17, "c").orElse("serverLevel"), MethodType.methodType(entityPlayer));
        } catch (NoSuchMethodException | NoSuchFieldException | IllegalAccessException ex) {
            ex.printStackTrace();
        }

        PLAYER_CONNECTION = connection;
        SEND_PACKET = sendPacket;
        GET_HANDLE = getHandle;
        GET_SERVER_LEVEL = getServerLevel;```
quaint mantle
#

does spigot have tickrate methods yet

hazy parrot
#

what are you refering to exactly ?

quaint mantle
#

/tick command

hazy parrot
#

isn't it like vanilla in the newest version ?

quaint mantle
#

nonono

#

methods

#

like tickRate(number)

remote swallow
#

i dont think that api has been merged

quaint mantle
#

๐Ÿ˜ก

worldly ingot
#

WIP

#

open PR atm

river oracle
quaint mantle
#

thanks!!!!!!

river oracle
#

More people should be excited about Inventory PR back in my day it was all the rage

river oracle
#

Well it's the greatest thing on earth my friend. It fixed up a bunch of issues with bukkits current inventory system

#

For example can't create working stations from Bukkit.createInventory and adds some other missing API

quaint mantle
#

oh

river oracle
#

Don't say oh you're supposed to be extatic

#

Kids these days

quaint mantle
#

i dont use inventorys tho

#

@river oracle i made my own system

#

r u happy

river oracle
#

Nothing beats inventory pr

#

Some sweet sweet api

quaint mantle
#

i just

#

dont know if this is good or bad

#
public interface CustomItemListener extends Listener {

    default void onDamagedWhileWearing(EntityDamageEvent event) {}
    default void onDamagedWhileHolding(EntityDamageEvent event) {}

    default void onDamagedByPlayerWhileWearing(EntityDamageByEntityEvent event, DamageEventInfo info) {}
    default void onDamagedByPlayerWhileHolding(EntityDamageByEntityEvent event, DamageEventInfo info) {}

    default void onAttackPlayerWhileWearing(EntityDamageByEntityEvent event, DamageEventInfo info) {}
    default void onAttackPlayerWhileHolding(EntityDamageByEntityEvent event, DamageEventInfo info) {}

}```
river oracle
#

Error

worldly ingot
#

I mean it's never not been done before. Pretty sure JDA does exactly this with their AbstractListener or something like that

river oracle
#

Kids these days is this what they do instead of rejoice about inventory pr

quaint mantle
#

that inspired me

#

i kinda like it

worldly ingot
#

I mean I kinda don't but it's up to you how you design your libraries I suppose

river oracle
#

Alright all this talk of inventory pr has truly made me hungry I'm saddened to say I must go

quaint mantle
river oracle
umbral ridge
#

hey how do you depend on a local jar in maven in pom.xml?

#

do i add a new <dependency> but what do I put in

remote swallow
#

the same info in the other pom

umbral ridge
misty current
#

is this supposed to get the generic type of a class?
(Class<V>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
because it throws a classcastexception. This is the class name:
public class StatisticKey<V extends CitadelStatistic<V>>

young knoll
#

Donโ€™t think it works like that

#

Yay type erasure

misty current
#

i'm pretty sure i got it working for another class

#

tho the name was slightly different

#

public class MyClass<T>

#

instead of T extends...

#

not sure if that makes a difference

#

i can just pass the type class into the constructor argument, but me being the average developer i'd rather spend 1 hour on this than 1 minute to add the type class to the constructor args

river oracle
slender elbow
#

of what

#

:^)

river oracle
# slender elbow :^)

You wouldn't get it you paper folk don't have inventory PR its a spigot exclusive

misty current
#

what's the inventory pr about?

river oracle
#

I'm on my phone but I'd love to have a 10 hour seminar about it

misty current
#

lol

#

i'll take a 30 second summary

misty current
#

interesting

#

anything useful for interactable guis?

river oracle
misty current
#

click events/actions

#

like your average server gui where you can click

river oracle
#

Not particularly

#

I mean that realm of api is good

misty current
#

yeah i agree

#

also anyone can just implement that with a plugin

#

so no need to pr that into spigot

river oracle
#

It's really the virtual inventory stuff that need to be reimpelemented

#

As it had some problematic behavior

carmine mica
misty current
#

getClass actually returns the subclass class, so getGenericSuperclass will return the class itself

carmine mica
#

getClass on what? you aren't showing what you are calling getClass on

misty current
#

uh no wait

#

i've mixed it up with another class

#

yea makes sense

#

nevermind

carmine mica
#
class Whatever<T> {
}

((ParameterizedType) (new Whatever<SomeType<SomeOtherType>>( {}.getClass().getGenericSuperclass())).getActualTypeArguments(); 

this works

#

will return a ParameterizedType cause SomeType is parameterized

#

you cannot cast it to Class

misty current
#

basically i thought that my class was a superclass of another one, so the subclass invoking the super constructor would make getClass return the subclass class object

#

i've just passed the class object in the constructor tho

valid basin
#

Is it possible to open a virtual book on bungeecord to a client?

zenith gate
young knoll
#

Because you avoid the square root call

zenith gate
#

But youโ€™re calling it anyways by squaring in the variable above so isnโ€™t it the same thing ? Maxdistance*maxdistance

young knoll
#

Thatโ€™s just multiplication

#

Not a square root

zenith gate
hazy parrot
#

what

#

how are multiplication and square root same

carmine mica
inner mulch
#

does somebody know how i can spawn this swing animation? ( the effect triggered if you attack with a fully charged sword )

worldly ingot
#

Not to mention that not only are you avoiding a root call, you're avoiding n root call_s_. There are multiple calls to Math#sqrt(). One is bad enough, let alone n lol

#

Especially when you really, really do not need that operation. You're simplifying the math required to get to the same outcome

#

Only time you should be getting the distance over a squared distance is if you're showing it to the user

echo basalt
#

mm lovely

worldly ingot
#

That's certainly one way to do it

river oracle
#

saving muh cpu cycles

exotic obsidian
#

hello

#

guys does anyone know how to cancel items that i get from fishing rod (except fish) ?

astral pilot
#

how do i get default stats of EntityType without spawning it and then instantly killing it

worthy yarrow
#

Could anyone help me with some world edit api stuff?

#
remote swallow
#

cant tell without the rest of the class

worthy yarrow
#

Its not fully written yet,

            islands.remove(playerId);
        }
        public Island getIsland(UUID playerId) {
            return islands.get(playerId);
        }

        public void teleportPlayerToIsland(Player p, World island){
            Location spawnLocation = island.getSpawnLocation();
            p.teleport(spawnLocation);

        }
}```
remote swallow
#

i meant the imports and package lol

worthy yarrow
#

lol my b

#

do you just want a new paste?

remote swallow
#

its probably easier

worthy yarrow
#

I had some issues with incorrect bukkit/worldedit imports but I thought I cleared all that up

remote swallow
#

im guessing that issue is with we internals so you might wanna ask in their discord

worthy yarrow
#

eek chatgpt said the same I was hoping it was just my syntax D;

astral pilot
#

how do i get default stats of EntityType without spawning it and then instantly killing it

remote swallow
#

probably a virtual entity from the recent snapshot

astral pilot
remote swallow
#

recent api adition to make an entity without spawnign it

astral pilot
halcyon hemlock
#

or just cache it

astral pilot
#

im tryna avoid spawning it

remote swallow
#

World#createEntity

astral pilot
#

im tryna avoid that

remote swallow
#

create entity doesnt spawn

astral pilot
#

oh

#

i see

#

Note: The created entity keeps a reference to the world it was created in, care should be taken that the entity does not outlive the world instance as this will lead to memory leaks.

What does this mean?

remote swallow
#

when the world gets unloaded its references should be removed, but by something keeping a reference, eg you saving the entity after the world is unloaded will keep that in memory so you have a memory leak from it not being able to remove the world from memory

astral pilot
remote swallow
#

keep a weak reference

astral pilot
#

wdym by that

#

does Java drop vriables when its out of scope like in Rust

remote swallow
astral pilot
#

i mean like wouldn't the class just get dropped when its out of scope

remote swallow
#

it tries to but if something holds a reference it wont remove it

astral pilot
remote swallow
#

private World world = Bukkit.getWorld("name"); would be holding a reference

astral pilot
#

ah then ig in my case nothing would be holding a reference to it

remote swallow
#

the entity holds a reference to it

astral pilot
#

since it will be only used to get default stats of a mob

remote swallow
#

but if you dont hold an entity reference in more than just a method u'll be fine

astral pilot
#

ig i would be fine then

#

anyways thanks for the help

ivory sleet
#

in Rust u have borrows and lifetime

#

Java has a gc that actively checks if variables fell out of scope

terse ore
#

seeds are a string right?

halcyon hemlock
terse ore
#

im reading the wiki.vg and for the login play packet, it needs to send the first 8 bytes of the sha 256 hash of the seed

ivory sleet
remote swallow
terse ore
#

ill just search for a seed genreator in gh

astral pilot
#

i just realize i can't get attributes of Entity

remote swallow
#

entities dont have attributes

astral pilot
remote swallow
#

Entity#getHealth

#

if its 0 or null not much you could do

astral pilot
remote swallow
#

im guessing its on living entity which it probably isnt

astral pilot
#

so ig there's no way to get default value without spawning them first?

remote swallow
#

it might exist in nms otherwise you have to hardcode it in an enum or something

astral pilot
#

oof

#

@remote swallow how do i just check if Entity is a Mob

#

with the given EntityType

eternal oxide
#

instanceof Mob

remote swallow
#

get entity class is assinable from Mob

astral pilot
eternal oxide
#

oh type

#

why are you using the type?

#

if you have an Entity object

astral pilot
#

only type

eternal oxide
#

from createEntity

#

returns an Entity

astral pilot
#

so i need to use createEntity?

eternal oxide
#

you are trying to get base attributes?

#

you can;t do that without NMS or getting an entity

astral pilot
#

ah

#

ok thanks

#

ig imma do using createEntity

astral pilot
#

like health of it etc

eternal oxide
#

not that I know of

#

well yes

#

creatEntity doesn't spawn it

astral pilot
#

not LivingEntity

eternal oxide
#

If you are creating it you know what it is. If you are only creating LivingEntities then cast the returned Entity

astral pilot
#

i see

halcyon hemlock
zealous osprey
#

Is it possible to change the width and length of a display block independently from one another?
I always only see blocks that are always in a 1x1 relation. Also, there's only a #setDisplayWidth and #setDisplayHeight, so I assume it is not possible. But I wanted to make sure.

#

Ah, it probably has to be done via scale

ocean hollow
#

how can this be? I set the PrivateSystem class in the constructor, but when I get it I get null, and I donโ€™t have a setter

eternal oxide
#

show where you instance Kingdoms

zealous osprey
ocean hollow
# eternal oxide show where you instance Kingdoms
    public void playerType(ChatEvent event){
        Player player = event.getPlayer();
        KingdomsPlayer kingdomsPlayer = KingdomsPlayer.getKingdomsPlayer(player);
        WaitingReason reason = kingdomsPlayer.isWaitingForInput();


        if(reason == WaitingReason.NONE){
            return;
        }

        if(reason == WaitingReason.KINGDOMS_NAME){
            // TODO: CHECK IS KINGDOMS EXISTS
            Kingdoms kingdoms = new Kingdoms(player, convertComponent(event.originalMessage()), plugin, kingdomsSQL);
            kingdomsPlayer.setKingdoms(kingdoms);

            player.sendMessage("ะšะพั€ะพะปะตะฒัั‚ะฒะพ ัƒัะฟะตัˆะฝะพ ัะพะทะดะฐะฝะพ ั ะฝะฐะทะฒะฐะฝะธะตะผ " +  convertComponent(event.originalMessage()));
        }

        kingdomsPlayer.setEditor(!kingdomsPlayer.isEditor());
        kingdomsPlayer.setWaitingForInput(WaitingReason.NONE);

        event.setCancelled(true);
    }```
eternal oxide
#

you do not instance Kingdoms in that code

#

ah I see

ocean hollow
#
public void createWalls(){
        int chunkX = chunk.getX();
        int chunkZ = chunk.getZ();

        if(kingdoms == null){
            Bukkit.broadcast(Component.text("KINGDOMS - NULL"));
        }
        if(kingdoms.getPrivateSystem() == null){
            Bukkit.broadcast(Component.text("PRIVATE SYS - NULL"));
        }
        if(kingdoms.getPrivateSystem().getChunkSystem() == null){
            Bukkit.broadcast(Component.text("CHUNK SYS - NULL"));
        }
}```
eternal oxide
#

why are you creating a new instance of Kingdoms on every chat message?

ocean hollow
#

not always

#

after using the command, it gives it a reason

eternal oxide
#

you are also accessing KingdomsPlayer before you instance Kingdoms and set it in KingdomsPlayer

#

Kingdoms is also a local variable which goes out of scope for every message

#

KingdomsPlayer looks to be some static mess which you repeatedly change teh Kingdoms instance in

clever lantern
#

why does the player bug into the block when i change the material of the block under him?

#
blockBelowPlayer.setType(materialToSwap);```
ocean hollow
eternal oxide
#

why do you create a new Kingdoms object for every chat message and then set it in KingdomsPlayer. static again

ocean hollow
#

noooo

eternal oxide
#

every chat message you do java Kingdoms kingdoms = new Kingdoms(player, convertComponent(event.originalMessage()), plugin, kingdomsSQL); kingdomsPlayer.setKingdoms(kingdoms);

ocean hollow
lost matrix
# ocean hollow

You should not create GUIs like this. Its is an absolute mess.

ocean hollow
#

I was going to redo this, it looks too clumsy in the code

eternal oxide
#

Somewhere (probably in KingdomPlayer) you are trying to access Kingdom before it is set

#

so hard toi tell as the code is a mess

ocean hollow
#

I don't think that's the problem. For KingdomsPlayer, the kingdom is not null, which means that PrivateSystem should not be null

lost matrix
ocean hollow
#

Itโ€™s just easier, you donโ€™t have to pass the manager to the constructors every time

lost matrix
#

Are kingdomsList and nameKingdoms at least private, static, and have no getter/setter?

ocean hollow
#

it has getters

lost matrix
# ocean hollow it has getters

In this case you majorly broke encapsulation and finding the cause can be an absolute nightmare.
You can write a system in which you dont have to pass your KingdomManager through constructors.
Having manager classes as Singletons with a static getter is perfectly viable.

#

Try to rewrite this with a few rules:

  • No static (Unless you have constants or singletons)
  • No getter or setter for any collection. (No exception)
  • Constructors dont have functionality. They only initialize the class. No side effects.

This will probably resolve all your "Something is null when it shouldnt" problems, as those
probably emerge from the mess which is created when you break encapsulation.

ocean hollow
#

okay, thanks

lost matrix
# ocean hollow okay, thanks

Let me show you an example because the question about bulk operations often comes right after someone starts with managers ^^
Last method should be your go-to for bulk operations.

public class KingdomManager {

  private final Map<String, Kingdom> kingdomNameMap;

  public KingdomManager() {
    this.kingdomNameMap = new HashMap<>();
  }

  public void addKingdom(Kingdom kingdom) {
    String name = kingdom.getName();
    Preconditions.checkArgument(!this.kingdomNameMap.containsKey(name), "Kingdom with name " + name + " already exists.");
    this.kingdomNameMap.put(kingdom.getName(), kingdom);
  }

  public void removeKingdom(Kingdom kingdom) {
    this.kingdomNameMap.remove(kingdom.getName());
  }

  public Kingdom getKingdom(String name) {
    return this.kingdomNameMap.get(name);
  }

  public Set<String> getKingdomNames() {
    return Set.copyOf(this.kingdomNameMap.keySet());
  }

}
wet breach
#

however in the case of it being a string it is limited to being an int

#

so if you use strings, it only has 32bits to work with and I forget the other case in where its also an int

#

otherwise its a long

ivory sleet
#

yeah cuz of String::hashCode, or am I missing sth?

wet breach
#

that is correct if I remember right

terse ore
wet breach
#

if the seed is greater then 20 characters it is also an int

ocean hollow
lost matrix
#

Spigot is a bit odd in that regard, because initialization is done in your onEnable. But if you dont encounter any dependency
problems, then a classical singleton is ok.

ocean hollow
#

Thank you! ๐Ÿ˜˜

lost matrix
#

PS: you could use a ternary expression to shorten this a bit

return instance == null ? instance = new KingdomManager() : instance;

Because a variable assignment evaluates to the assigned value.

umbral ridge
short raptor
#

Is there a quick way to check for a specifc block around a Location e.g. in a 2x2 radius or should I just iterate through them all

echo basalt
#

Iterate through them all

#

make a util method

lost matrix
brisk estuary
#

Since which version are hex colors supported?

remote swallow
#

1.16

valid basin
#

how to accurately check for memory leaks in a plugin?

umbral ridge
#

You could use VisualVM or enable the garbage collection logging

dry hazel
#

or eclipse mat

umbral ridge
#

for logging, add this to your server startup script
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<YOUR LOG FILE>

short raptor
#

If I have two classes which both have the same event
If i set cancelled in one class' event, does the other also become cancelled

chrome beacon
#

yes

#

it's the same event

eternal oxide
#

depends on priority and which you registered first

lost matrix
short raptor
#

My interpretation of all your answers is that it does not

chrome beacon
#

Depends on if you have the ignoreCancelled flag set or not

eternal oxide
#

by default yes. your second one would not fire as default is ignoreCanceled is true

short raptor
#

Ok

#

Awesome ty

lost matrix
short raptor
#

Good to know

#

I ddint even know that flag existed lol

rotund ravine
#

Defualt is false

#

Default

#

**

eternal oxide
#

yes

#

default is false

rotund ravine
#

So it will run

eternal oxide
#

so second listener would not fire

#

err

rotund ravine
#

ignoreCancelled marks the method to not run if the event is cancelled

#

So it โ€œignoresโ€ ur eventhandler if cancelled

eternal oxide
#

you are correct, default is false

rotund ravine
#

The naming is ๐Ÿฅฒ

eternal oxide
#

yeah naming is a bitch

#
ignoreCancelled
boolean ignoreCancelled
Define if the handler ignores a cancelled event.

If ignoreCancelled is true and the event is cancelled, the method is not called. Otherwise, the method is always called.

Returns:
    whether cancelled events should be ignored

Default:
    false

ocean hollow
#

Why I have such problem? When rendering a chunk, its PDC must be read, and based on the data, create a class for the chunk. I output the uuid of entities to the console, but for some reason it thinks that the entities are null. Although if you teleport to this uuid, then everything is ok

eternal oxide
#

entities may not be loaded as the chunk is

ocean hollow
#

how does it work? I thought when loading chunks the entities would be loaded immediately

rotund ravine
#

Probably loads after ๐Ÿคท๐Ÿฝโ€โ™‚๏ธ

ocean hollow
#

even so, uuid displays them, but does not allow them to be shown

shadow night
#

Crazy shit

blazing ocean
#

hello, what packet do I send (and how) to show a fake player in a player's player list?

ocean hollow
#

Oh thank you. I thought there were only chunks

rotund ravine
#

Then try it

#

Then ask here for help when you fail

blazing ocean
# rotund ravine Google it

well, the only things im finding are either:

  • for 1.8 or older
  • just not working at all
  • packet not existing anymore
#
  • or use a 3rd party library
rotund ravine
#

Look what they do then

blazing ocean
#

they are also quite old

candid galleon
#

?

#

This article is about the protocol for the latest stable release of Minecraft Java Edition (1.20.4, protocol 765)

rotund ravine
#

The idea of what to send has not changed

blazing ocean
rotund ravine
#

Try searching in this channel

#

Someone asked for help about it recently

rotund ravine
#

Not โ€œhow to do thisโ€, but i tried โ€œthisโ€ and expected โ€œthisโ€

eternal oxide
#

using protocol lib

#

missed a digit

blazing ocean
eternal oxide
#

they answerd you

astral pilot
#

is there a way to set ItemMeta from a given ItemMeta String

astral pilot
#

"{display:{color:3949738}}" for instance I have this

young knoll
#

It should

#

iirc

#

SNBT api when

shadow night
#

StringNBT?

young knoll
#

mhm

lost matrix
#

Isnt there Spigot unsafe?

young knoll
#

no

astral pilot
dry hazel
#

Bukkit#getUnsafe iirc

young knoll
#

Bukkit.getUnsafe

astral pilot
#

ok thanks

lost matrix
young knoll
#

That's bukkit unsafe

#

smh

lost matrix
#

sigh

eternal oxide
#

no

#

doh I was scrolled up

ocean hollow
# eternal oxide entities have their own event <https://hub.spigotmc.org/javadocs/spigot/org/bukk...

strange, but it still didn't help.

    @EventHandler
    public void loadEntity(EntitiesLoadEvent event){
        Chunk chunk = event.getChunk();

        String kingdomsName = chunk.getPersistentDataContainer().get(NamespaceManager.getInstance().getKingdomsName(), PersistentDataType.STRING);
        if(kingdomsName == null){
            return;
        }

        Kingdoms kingdoms = KingdomsManager.getInstance().getKingdom(kingdomsName);

        if(kingdoms == null){
            return;
        }

        if(KingdomsManager.getInstance().getKingdomsChunk(kingdoms, chunk) == null) {
            kingdoms.getPrivateSystem().getChunkSystem().loadChunk(chunk);
        }
    }
#

these entities continue to be null

ocean hollow
chrome beacon
#

also note the warning:

The provided chunk may or may not be loaded.

ocean hollow
#

I still don't understand

#

in theory, the entities in this chunk have loaded, if I get the uuid of the entity from the chunk from the PDC, then they should not be equal to null

chrome beacon
ocean hollow
#

just save the list?

#

I just have to get entities by uuid from a chunk, and not everything in a row

young knoll
#

After the event it should be safe to get them by uuid

#

May need to wait an extra tick

chrome beacon
#

I'd get it from the event

#

since the chunk could get unloaded

#

probably won't be but better safe than sorry

icy beacon
#

Since when is this a thing holy shit??

#

Don't tell me it's always been there, I'm going to feel stupid

eternal oxide
#

reasonably new

icy beacon
#

Is this gonna be a replacement for enums like Material or how does this work

#

I just happened to peak at the javadocs and saw this shit and was like wtf I haven't seen this

#

Wait, but it's not new, it's there since at least 1.16.5

young knoll
#

ItemType and BlockType will be the replacement for material

icy beacon
#

Ok it seems it's there since 1.14. How has it been able to go under my radar for so long lmao

eternal oxide
#

I did say reasonably. I guess 1.16 is getting old now

icy beacon
#

When approx is that coming, any idea?

icy beacon
#

Welp it's there since 1.14 and that is DEFINITELY old ๐Ÿ˜›

young knoll
halcyon hemlock
#

anyone wanna make a minecraft server framework in rust together

#

from scratch

#

for latest version

#

hehe

#

and best performance ofc

icy beacon
#

๐Ÿ˜ณ

#

If I had more time on my hands I'd join in lmao

#

But even then I'd need to get my Rust up to speed, I haven't done anything with it in so long

halcyon hemlock
#

I'm a noob

ivory sleet
#

yeah I can try to contrib

halcyon hemlock
#

I don't want to be criticized for my skill

#

You learn by making stuff

ivory sleet
#

well Im almost proficient

halcyon hemlock
#

how much can you contrib?

#

kinda boring doing alone

ivory sleet
#

well i mean Im willing to give my opinion on w/e happens, but like, since im going on a trip to usa I wont be able to do much the coming month

rotund ravine
#

Take a look at valence

#

Heard it was like minestorm barebones mc implem in rust

halcyon hemlock
#

feather

#

I mean It's fun

#

to make a server

#

rust is a new language, and new stuff is always fun

#

java is slow old and boring

ivory sleet
#

i mean its not that new

halcyon hemlock
#

rust is actually enjoyable writing code in cause you know it's worth it

ivory sleet
#

depends

#

async code can be a mess in rust

halcyon hemlock
#

yeah true

#

I mean still, I find it quite enjoyable

#

and the magic is also fun

#

Haven't used it a lot though, if we build a server I'm sure it'll be used a lot

#

and if we do make a server, the physics would be fun to code

#

and something to put on my undergrad application

#

anyway, those who do you want to contribute to this amazing project, please dm me as I will make a group chat

dry hazel
#

good luck

ivory sleet
#

i mean its a really huge project

vocal cloud
#

It's probably a million lines of code big lol

ivory sleet
#

so like, dont expect a finished product

distant wave
#

whats the name of site for the comparing mappings

dry hazel
#

?mappings

undone axleBOT
distant wave
#

ty

rotund ravine
quaint mantle
chrome beacon
#

Send your pom

#

?paste

undone axleBOT
quaint mantle
#

pom?

chrome beacon
#

pom.xml

quaint mantle
#

ohh okie

chrome beacon
#

and how are you compiling the jar

quaint mantle
#

intellij

chrome beacon
#

.-.

quaint mantle
#

sorry if i am missing the point i am not too good with explaining or exact understanding ;-;

chrome beacon
#

is this your first time programming in Java

quaint mantle
#

yeah i am learning from the video and i am doing what it showed but as you see idk what's going on in the error

chrome beacon
#

?learnjava

undone axleBOT
chrome beacon
#

You should learn basic Java before starting with Spigot

quaint mantle
#

i did though that's the thing

chrome beacon
#

and then building again

quaint mantle
#

nope error again

chrome beacon
#

Same error?

quaint mantle
#

just checked yes

eternal oxide
#

um, are you online? Disconnected from the target VM, address: '127.0.0.1:64163', transport: 'socket'

chrome beacon
#

Debug mode in Intellij can do that

eternal oxide
#

ok

rough drift
#

it happens when the debugger is shut down or the debugged process is shut down

eternal oxide
#

a build does if he's never built before

quaint mantle
#

i did with basic java code so i know how to build

jagged thicket
#

[[nycmen,false,[none,none],[nycmen,none],[none,none],[none,none],0],[tokyo manji,false,[none,none],[tokyo manji,none],[none,none],[none,none],1009],[yomen,false,[none,none],[yomen,none],[none,none],[none,none],2555]]

#

i have a list like dis

#

how do i sort it based on the l[i][l[i].length-1]

charred blaze
#

hey is there any easy way to check if player is muted? (without hooking into bans plugin's api)

chrome beacon
#

No

charred blaze
#

uhh

#

why

jagged thicket
minor junco
chrome beacon
#

Well you could probably force the player to send a message

#

and then see if that is intercepted

#

but that's just a bad way of doing it

minor junco
eternal oxide
#

if it comes from an sql query you can add a sort on that

jagged thicket
#

yes it does come from a raw sql query

#

i want to sort the balances

minor junco
#

you can do ORDER BY

#
SELECT * FROM <name>
ORDER BY balance;
jagged thicket
#

Ok thanks!

minor junco
#

the best way to do it btw is to create an ordered index for balance

#

if your database supports that

jagged thicket
charred blaze
worthy yarrow
#

When he says bans stem from another plugin he could be talking about any sort of administrative plugins

charred blaze
#

no im just writing antiswear plugin

#

trying to*

worthy yarrow
#

Then you need to implement your own functionality in order to cause someone to actually be muted, ie: if player isMuted(){

E.setCancelled(true)

}

#

Something like that

#

Perhaps try storing a player uuid to an array list so when a mod or something on your server types /mute <player> it will store their uuid in a list which you can then use to check if the player is muted

#

If that list contains their uuid then make a chat listener event class and just implement the simple โ€œmutingโ€ logic there

kindred sentinel
#

Does anyone know how to get item's burning time?

ivory sleet
#

fuel time for cooking recipes?

kindred sentinel
#

no, like fuel's burning time, like how long would burn coal, oak log, etc. in furnace

ivory sleet
#

yeah thats for cooking recipes lol

kindred sentinel
#

oh

#

ok

#

then in cooking recipes ๐Ÿ˜…

ivory sleet
#

unsure about fuel

#

let me check lol

kindred sentinel
#

I found only Material.isFuel()

ivory sleet
#

hmm all I see is furnaceburnevent exposing anything related to burntime

#

and ofc the Furnace blockenetity

kindred sentinel
#

oh... I'm creating something like another block with other funcionality with burning mechanic so... I think furnaceburnevent isn't my option

ivory sleet
#

net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity.getFuel() otherwise from nms

kindred sentinel
#

I'm not sure that I know how to use it...

inner mulch
#

is it possible to save a mutable list to a pdc?

ivory sleet
#

myeah

#

i mean the elements of the list would get copied essentially

#

so if u mutate the original one, it may not reflect

inner mulch
#

so how would i create one?

hazy parrot
#

Just save normal array list lol

ivory sleet
#

new ArrayList<>() maybe, or LinkedList

inner mulch
#

but there is not persistentdatatype for this, right?

ivory sleet
#

not shipped

#

but there are 3rd party libs

inner mulch
#

is it easy to create my own type or should i just use these libs?

chrome beacon
#

Save time by using lib

ivory sleet
#

^

#

u can prob shade the lib and just use some nice qol features

lost matrix
#

Creating your own types should be not too hard if you have experience with serialization.
But adding PDCs to something that has none in the first place is quite cumbersome.

worthy yarrow
#

Can someone help me with some world edit api?

chrome beacon
#

?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!

inner mulch
#

okay, is there a lib that you can recommend?

chrome beacon
#

?morepdc

undone axleBOT
worthy yarrow
chrome beacon
#

any errors?

worthy yarrow
#

Nope

#

There's just no schem being pasted to the world haha

#

The really interesting part is that I was having issues with reading the schem file but that was because it got corrupted... once that was fixed, world creation worked but no schem was loaded

chrome beacon
#

Try printing and see if it fires the paste code

worthy yarrow
#

} else {
// case when the block at the specified location is not a chest
System.out.println("Chest not in correct location in schematic!");
}
this gets printed to console

#

but that's it

chrome beacon
worthy yarrow
worthy yarrow
worthy yarrow
charred blaze
worthy yarrow
#

You could achieve the same thing with an arrylist method

charred blaze
#

yeah but once plugin restarts

#

ill lose data

worthy yarrow
#

then just use someone elses api bruh

lost matrix
worthy yarrow
#

You're trying to create more work for yourself with that method imo

charred blaze
#

nope. im trying to:
If player is muted and he swears in a book, sign etc. not to mute him because he may have 7d mute and im trying to mute him for 3 hours. that will only decrease the duration of his mute.

worthy yarrow
charred blaze
worthy yarrow
lost matrix
charred blaze
#

am i clear

worthy yarrow
#

Ehm

chrome beacon
#

so why would muting again reduce the total mute time

worthy yarrow
#

yeah

chrome beacon
#

instead of adding to it

charred blaze
#

litebans ig?