#help-development

1 messages · Page 25 of 1

crisp steeple
#

because that causes a lot of issues

#

what if i renamed a chest to be the same title

carmine nacelle
#

color codes?

crisp steeple
#

well then you're just making a hacky workaround to something you can already do properly

carmine nacelle
#

whats the "proper" way then

#

got an example of that?

kind hatch
#

InventoryHolder is not the best. Comparing instances is the proper way to do it.

crisp steeple
carmine nacelle
#

So you would like..make a list of custom inventories or somethin?

#

eh nvm.

ivory sleet
tranquil viper
#
java.lang.IllegalStateException: Asynchronous command dispatch!
        at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:16) ~[pufferfish-1.18.2.jar:git-Pufferfish-72]
        at org.bukkit.craftbukkit.v1_18_R2.CraftServer.dispatchCommand(CraftServer.java:882) ~[pufferfish-1.18.2.jar:git-Pufferfish-72]
        at xyz.praydev.event.SpawnBossEvent$1.run(SpawnBossEvent.java:74) ~[CustomEggs-1.0-shaded.jar:?]
        at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftTask.run(CraftTask.java:101) ~[pufferfish-1.18.2.jar:git-Pufferfish-72]
        at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[pufferfish-1.18.2.jar:git-Pufferfish-72]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[pufferfish-1.18.2.jar:git-Pufferfish-72]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "mm m spawn SkeletonKing 1 " + player.getWorld() + "," + clicked.getX() + "," + clicked.getY() + "," + clicked.getZ());
#

Anyone know what is causing this?

kind hatch
#

?scheduling

undone axleBOT
frail spire
#

502

tender robin
#

my brain doesn't work for this do u have any other solution lmao

eternal oxide
#

pdc is the correct approach

tender robin
#

?pdc

tender robin
#

he talked to me

eternal oxide
#

pdc wasn;t for you

crisp steeple
#

huh

tender robin
eternal oxide
#

minutes

tender robin
#

do u know how to do it? ^^

eternal oxide
#

yes

tender robin
eternal oxide
#

taken directly from that wiki page...modifiedjava ItemStack itemStack = ...; NamespacedKey key = new NamespacedKey(pluginInstance, "args"); ItemMeta itemMeta = itemStack.getItemMeta(); itemMeta.getPersistentDataContainer().set(key, PersistentDataType.STRING, args[1]); itemStack.setItemMeta(itemMeta);

#

that would put the data in the pdc

tender robin
#

"args" is correct there?

eternal oxide
#

Then in your interact or click event you read it from the PDC

#

thats what you want to store isn;t it?

#

args[1]

tender robin
#

yes

eternal oxide
#

reading is ```java
ItemStack itemStack = ...;
NamespacedKey key = new NamespacedKey(pluginInstance, "args");
ItemMeta itemMeta = itemStack.getItemMeta();
PersistentDataContainer container = itemMeta.getPersistentDataContainer();

if(container.has(key , PersistentDataType.STRING)) {
String foundValue = container.get(key, PersistentDataType.STRING);
}```

tender robin
#

pluginInstance?

eternal oxide
#

your plugin

tender robin
#

yes

#

so the main class or

#

the cmd class

eternal oxide
#

if your doing this in the class which extends JavaPlugin, you would use this

#

else

#

?di

undone axleBOT
tender robin
tender robin
echo basalt
#

nms unfortunately

#

FoodInfo

#

Or FoodData in mojmappings

eternal oxide
#

yes, that is old code, use teh getSaturation/setSaturation on teh player

#

food level and saturation are different

#

saturation is how long you stay sated

#

food with zero saturation would fill you up, but instantly start to decrease

#

the higher the saturation level, the longer before your food level drops

#

you have to cancel teh consume event and reduce the item count yourself

#

you are doing the math now

#

of course you can

#

get the ItemStack

#

its teh actual ItemStack you are eating

chilly patio
#

Uhm, so rn, I was going to check for every single thing I get from the config and report and error in case it doesn't find it, the thing is, is there no other way of doing this? Seems like DRY to be doing this like 15 different times...

eternal oxide
#

not a clone so you can reduce the amount

#

getItem().setAmount(getItem().getAmount() -1)

#

the event has nothing to do with teh ItemStack

#

its just returning teh ItemStack

#

YOU reduce it

pine lake
#

Hello, how can I change the build output of my plugin?

eternal oxide
#

you don;t leave it for the event to do, you are canceling that

ancient plank
#

teh

eternal oxide
#

it doesn;t matter, you are just reducing it in the Listener

chilly patio
#

rip

ancient plank
eternal oxide
#

canceling the event does not stop your code running. YOUR code still takes effect

ancient plank
#

Reading this is giving me a headache even tho I've been taking ibuprofen

#

He literally told you the answer

eternal oxide
#

Just cancel the event and reduce teh stack size as I've told you

#

cancelling an event just tells spigot not to make any changed due to the event. Your listener is not the event. it's just code.

#

yes, cancel event, reduce stack size, increase food level and saturation

#

yes

gray merlin
#

Does anyone have any examples of FileConfiguration implementations?

eternal oxide
#

a hearty meat pie shoudl give way more saturation than an apple

quaint mantle
#

Are you making like a toml version

gray merlin
#

Hmm, sure, toml is the simplest and easiest to understand afterall.

quaint mantle
#

true

#

Just implement it

#

your ide will tell you what to override

#

its pretty self explanatory

gray merlin
#

hmm

#

?configs

undone axleBOT
gray merlin
#

I see.

shut field
#

how do I get this location?

#

second image

#

I want the location of the shulker being held by the armorstand

#

or more accurately, I want the pufferfish to spawn directly on the shulker shell item held by the armorstand

abstract sleet
#

I think you need to guesstimate it

#

Relative to a known location of the armour stand

shut field
shut field
# shut field how do I get this location?

the shulker item will always be pointed away from the item, however, as shown in the image the shell is about 0.5 behind the armorstand and roughly 2 y cords above the armorstand base cord. But the xyz cords are changing

eternal oxide
#

just get the item in teh players hand then

gray merlin
#

Is there a way to create an empty dummy player?

#

Doesn't even need to exist in the world, I just have the object.

#

Thanks.

eternal oxide
eternal oxide
#

so long as you don't adjust the bodyPose you should be able to calculate the hand position

carmine nacelle
#

question..

#

so I have an itemstack.
I then pass the itemstack into a function which sets PDC keys on it

#

then back in the main function, I set the itemmeta and add the item to my inventory

#

does it save the changes I made to the PDC?

#
        pdcManager.setCustomHive(customHiveItem);
        customHiveItem.setItemMeta(customHiveMeta);

        return customHiveItem;
    public void setCustomHive(ItemStack itemStack) {
        NamespacedKey customHiveKey = new NamespacedKey(cadiaBees, "custom-hive");

        if(!(itemStack.hasItemMeta()) || itemStack.getItemMeta().getDisplayName() == null) return;

        ItemMeta itemMeta = itemStack.getItemMeta();
        PersistentDataContainer container = itemMeta.getPersistentDataContainer();

        container.set(customHiveKey, PersistentDataType.INTEGER, 1);
        itemStack.setItemMeta(itemMeta);
    }
#

It's not actually setting my value

eternal oxide
#

setCustomHive method is fine, however, test hasCustomName()

#

oh no methodf. I thought there was

carmine nacelle
#

I dont see hasCustomName

eternal oxide
#

ignore me then. I'm thinking of something else

carmine nacelle
#

I also tried changing my setCustomHive to return an itemstack

#
        customHiveItem.setItemMeta(customHiveMeta);
        customHiveItem = pdcManager.setCustomHive(customHiveItem);

        return customHiveItem;
#

I dont see why this isnt working

eternal oxide
#

make sure its actually reaching the PDC code

#

sysout

carmine nacelle
#

Yeah it reaches it

eternal oxide
#

theres nothing wrong with the pdc code

carmine nacelle
#

Hmmm..

#

got it

echo basalt
#

Ayo I'm struggling a bit with armorstand math

#

Let's assume that I want to rotate an upright item set on an armorstand's head

#

I can set the Z angle to 315º (-45º) for the item to be upright

#

but rotating the head on the Y axis breaks because of roll

#

Is there any simple way of rotating X Y and Z angles to negate the roll effect?

carmine nacelle
drowsy helm
echo basalt
#

no

tranquil viper
#

Aren't these 1.8 attributes?

limber owl
#

new 1.19.1 player chat event?

carmine nacelle
#
    private UUID hiveUUID;
    private String hiveName;
    private UUID ownerUUID;
    private Location hiveLocation;
    private List<UUID> holoUUIDs;
    private List<RewardItem> rewardItems;
    private List<String> beeNames;
    private List<UUID> beeUUIDs;
    private int beeAmt;
    private int honeyAmt;
    private HiveLevel hiveLevel;
    private HiveStatus hiveStatus;
    private Boolean beesBeingRenamed = false;

Gson should be able to work with all these right?

#

its creating a blank json file when i save

#

or do I need a custom factory for the location?

worldly ingot
#

It won't be able to serialize a Location, but aside from that, assuming all your other classes (RewardItem, HiveLevel, and HiveStatus) contain fields that are also serializable, should be fine

#

If RewardItem contains an ItemStack, it won't serialize either

near night
#

any api for custom entities not using nms for 1.19?

#

coz i hate nms

carmine nacelle
#

so I need a custom factory?

#

do you have a link to a good tutorial? I haven't done it in a while

worldly ingot
#

Most likely, yes

#

Don't think anybody's written an ItemStack serializer for Gson

carmine nacelle
#

Well, in general

tranquil viper
worldly ingot
#

Not overly complicated to implement. You need a class that implements JsonSerializer and JsonDeserializer, then you can register an instance of it in a Gson builder with registerTypeAdapter()

Gson gson = new GsonBuilder()
    .registerTypeAdapter(ItemStack.class, new MyCustomItemStackSerializer())
    .build();```
upper vale
#

i think ive seen a plugin where they just convert items to like base64 or smth

worldly ingot
#

Something like that

near night
carmine nacelle
#

@worldly ingot Would I use extends TypeAdapter<CustomHive> instead?

#

could I*

worldly ingot
#

You could, but that uses a JsonReader and JsonWriter, which means you have to work with very, very primitive Gson which can be faster but is excruciatingly annoying

carmine nacelle
#

Oof

#

alright

worldly ingot
#

The former two interfaces make it a bit nicer to write serializers/deserializers

carmine nacelle
#

this is pretty uhhhhh

#

difficult

tranquil viper
#

What are you trying to do?

#

Can't be asked to read it all

carmine nacelle
#

Custom gson serializers/deserializers

tranquil viper
#

Ah ok

#

Bit out of my expertise, lol

carmine nacelle
#

oh wait

#

from SO

public class StudentAdapter implements JsonSerializer<Student> {

 @Override
 public JsonElement serialize(Student src, Type typeOfSrc,
            JsonSerializationContext context) {

        JsonObject obj = new JsonObject();
        obj.addProperty("name", src.name);
        obj.addProperty("school", src.school.id);

        return obj;
    }
}
#

its that easy?

compact haven
#

yes

#

then there’s a method you need to call on the GsonBuilder instance

#

but that’s it

carmine nacelle
#

How would I do it with a list?

#

like, itemstack lore

tranquil viper
#

How could I get the GENERIC_ATTACK_DAMAGE value of an itemstack?

#

Or check if the GENERIC_ATTACK_DAMAGE value was modified in some way, shape, or form

ivory sleet
#

ItemMeta

tranquil viper
#

So if the GENERIC_ATTACK_DAMAGE value is in the itemmeta it's been modified correct?

ivory sleet
#

I mean it has a default value

#

But yeah

#

Just use the api

tranquil viper
#

I heard that it won't be in the ItemMeta if it's the default value

ivory sleet
#

might be the case

tranquil viper
#

Alr thanks

carmine nacelle
#

guys, with a custom jsonserializer I am unable to simply obj.addProperty("itemLore", src.getItemMeta().getLore());

#

guessing its because lore is a string

#

Or would I do obj.add("itemLore", (JsonElement) src.getItemMeta().getLore());

echo basalt
#

well

#

you can't cast a list to a jsonelement

fleet forge
#

Is there a way to listen for when the warden sniffs

echo basalt
#

I don't see anything

echo basalt
#

custom entities weren't something that should be in spigot by design

near night
#

yeah but is there a plugin for nms custom enites for 1.19

echo basalt
#

closest thing you have is mythic mobs

near night
#

danm

glossy scroll
#

except i believe it uses nms

#

because bukkit is DUMB and STUPID

#

and ive not fully tested all use cases so there's that

cedar oyster
carmine nacelle
#

I think I got it

#

by making a JsonArray instead and adding the lore to it.

cedar oyster
#

ah yeah

compact haven
#

oh

compact haven
#

well it seems I’m late

carmine nacelle
#

lol

#

np

#

now deserializing it back into an itemstack is gonna be different

noble lantern
#

Stupid question

How can i incrase the animation speed of End Crystals? So they spin slower/faster

Or is it only client side for crystal rotation speed

echo basalt
#

server wouldn't bother

noble lantern
echo basalt
#

maybe?

noble lantern
#

wtf

#

didnt even think of nms ngl

#

wth would time be thats a big ass number

#

0 - 1m

echo basalt
#

it isnt even getting used

#

probably leftover code

glossy scroll
#

@carmine nacelle

#

hello

#
    public static final class ItemStackJsonSerializer implements JsonSerializer<ItemStack>, JsonDeserializer<ItemStack> {
        @Override
        public JsonElement serialize(ItemStack src, Type typeOfSrc, JsonSerializationContext context) {
            return new JsonPrimitive(CraftItemStack.asNMSCopy(src).save(new CompoundTag()).getAsString());
        }

        @Override
        public ItemStack deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
            try {
                String asString = json.getAsJsonPrimitive().getAsString();
                CompoundTag compoundTag = TagParser.parseTag(asString);
                net.minecraft.world.item.ItemStack nmsStack = net.minecraft.world.item.ItemStack.of(compoundTag);
                return CraftItemStack.asCraftMirror(nmsStack);
            } catch (CommandSyntaxException e) {
                throw new IllegalArgumentException(e);
            }
        }
    }```
#

this is an item stack json serializer

#

i will warn you

#

this is untested for most items

carmine nacelle
#
    @Override
    public JsonElement serialize(ItemStack src, Type typeOfSrc, JsonSerializationContext context) {

        if(!(src.hasItemMeta()) || !(src.getItemMeta().hasDisplayName())) return null;

        JsonArray loreArray = new JsonArray();
        for(String loreLines : src.getItemMeta().getLore()) {
            loreArray.add(loreLines);
        }

        JsonObject obj = new JsonObject();
        obj.addProperty("itemType", src.getType().toString());
        obj.addProperty("displayName", src.getItemMeta().getDisplayName());
        obj.addProperty("itemAmount", src.getAmount());
        obj.add("itemLore", loreArray);

        return obj;
    }
#

does the one I just made look fine?

glossy scroll
#

BUT, i have confidence it will work because it literally uses nms' method for saving items to files

#

it would not account for any item meta thats unique to stuff like banners, armor, etc

carmine nacelle
#

mine or yours

glossy scroll
#

yours, vivian

carmine nacelle
#

because I dont have the tags?

glossy scroll
#

well you would need to serialize all possible item meta types

carmine nacelle
#

Yours does that?

glossy scroll
#

i believe so

#

@worldly ingot do you have any second thoughts on what i have here

compact haven
#

yours would definitely work

#

well I'm not going to make promises

glossy scroll
#

i mean

compact haven
#

but it's what it uses internally

glossy scroll
#

yea

#

i dont see why it wouldnt

carmine nacelle
#

So that'll work for serializing and deserializing...

#

nice

glossy scroll
#

but i cant really promise anything

#

yes

compact haven
#

Yes, but it wouldn't be editable in config

#

so it's quite a cop-out

carmine nacelle
#

I dont need editable in config so its fine

#

just need to save/load

glossy scroll
#

i mean it would, you would just need to know item NBT

#

i do use it for saving/loading player inventories btw

compact haven
#

well that's fair, it just wouldn't be pretty kekw

glossy scroll
#

idk what youre doing it for

#

i also refuse to touch ConfigurationSerializable too

carmine nacelle
#

Well I won't be able to test it until I come up with one for locations but ill say TIA

compact haven
glossy scroll
#

can you jog my memory lol

#

nbt a blob

compact haven
#

well the blob is unnecessary since NBT is quite literally a string

#

but why are u storing it in config files instead of a database

vestal dome
#

can someone explain to me, what am I doing wrong?

#

the hopper items are not updated.

compact haven
#

I don't know, maybe it hates you?

carmine nacelle
#

How would you register this? @glossy scroll

glossy scroll
#

?

compact haven
#

same way Choco showed you Vivian

carmine nacelle
#

so it counts as a TypeAdapter?

#

1s

glossy scroll
#

oh

vestal dome
glossy scroll
#

its important

#

it needs to be TypeHierarchyAdapter

#

i forgor why

#

new Gson(registerTypeHierarchyAdapter(ItemStack.class, new ItemStackJsonSerializer()))

#

oops

#

thats completely wrong

#

new GsonBuilder().registerTypeHierarchyAdapter(ItemStack.class, new ItemStackJsonSerializer()).create()

glossy scroll
#

its cuz ItemStack is an interface

compact haven
#

TypeHierarchyAdapter registers for all subtypes

vestal dome
#

it isn't?

#

ItemStacks are classes not interfaces.

compact haven
#

^

glossy scroll
#

u right

#

i really do forget why i did HierarchyAdapter

vestal dome
glossy scroll
#

what is instance

compact haven
#

It probably doesn't need to be a TypeHierarchyAdapter

vestal dome
#

a Hopper

#

block state

glossy scroll
#

yes but what class

#

package

compact haven
#

literally Hopper

glossy scroll
#

theres 2 i think

vestal dome
#

org.bukkit.block.Hopper

compact haven
#

are block states mutable

#

don't you need to set it back or something

glossy scroll
#

should be

#

thats block data

carmine nacelle
#
        Gson gson = new GsonBuilder()
                .registerTypeHierarchyAdapter(ItemStack.class, new ItemStackSerializer())
                        .build()

Cannot resolve method build

compact haven
#

oh

carmine nacelle
#

hmm

vestal dome
#

"Hopper extends BlockState, InventoryHolder"

glossy scroll
#

no i meant

#

BlockData is immutable

#

well actually

#

it is mutable

#

it just gives a copy

compact haven
#

well it's immutable in effect xd

vestal dome
#

that is not the point tho

glossy scroll
#
The returned object will never be updated, and you are not guaranteed that (for example) a sign is still a sign after you capture its state.
Returns:
BlockState with the current state of this block.```
#

i believe it is a copy

vestal dome
#

I have a BlockState (Hopper block state) and I'm currently attempting to edit it's inventory and update.

#

but it just doesn't update.

#

the array I'm providing IS the one I want

glossy scroll
#

but you update it

vestal dome
#

but setContents on the inventory is not working

glossy scroll
#

so it should be ok

vestal dome
#

it doesn't work

#

it literally doesn't

glossy scroll
#

i know im just saying

carmine nacelle
#

Martoph, a location serializer should be simple right

glossy scroll
#

uhhhh

#

not quite

carmine nacelle
#

:(((((

compact haven
#

yes a location serializer in incredibly easy

#

write primites x, y, z, pitch, and yaw

#

and a uuid (string) world id

#

literally it

carmine nacelle
#

oh

vestal dome
#

this is so stupid

carmine nacelle
#

I thot so

glossy scroll
#

    public static final Gson LOCATION_GSON = new GsonBuilder()
            .registerTypeAdapter(Location.class, (JsonSerializer<Location>) (src, typeOfSrc, context) -> {
                JsonObject jsonObject = new JsonObject();
                jsonObject.addProperty("x", src.getX());
                jsonObject.addProperty("y", src.getY());
                jsonObject.addProperty("z", src.getZ());
                jsonObject.addProperty("pitch", src.getPitch());
                jsonObject.addProperty("yaw", src.getYaw());
                return jsonObject;
            }).registerTypeAdapter(Location.class, (JsonDeserializer<Location>) (json, typeOfT, context) -> {
                JsonObject jsonObject = json.getAsJsonObject();
                return new Location(null, jsonObject.get("x").getAsDouble(), jsonObject.get("y").getAsDouble(), jsonObject.get("z").getAsDouble(), jsonObject.get("pitch").getAsFloat(), jsonObject.get("yaw").getAsFloat());
            }).create();```
#

well i mean

#

you still need an adapter i meant

compact haven
#

imagine using anon classes in your gson declaration

#

couldn't be me

glossy scroll
#

that code is apparently from nov 2021 so

compact haven
#

man u just pass null as the world

#

🤣

carmine nacelle
#

Whats wrong with anonymous classes

glossy scroll
carmine nacelle
#

(idk shit about them)

glossy scroll
#

this is for my niche use case

#

you may need to alter as necessary

#

meaning write the world name and then use Bukkit.getWorld

compact haven
#

anonymous classes are what he did there, where he was able to put the serializer code right into the body instead of declaring a new class

compact haven
glossy scroll
#

or i mean a much easier way to serialize locations if you dont care about rotation is

#

convert them to vectors

#

then you dont need a type adapter

vestal dome
#

Ugh, Bukkit is inefficient.

glossy scroll
glossy scroll
carmine nacelle
#
    @Override
    public JsonElement serialize(Location src, Type typeOfSrc, JsonSerializationContext context) {
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("worldUUID", src.getWorld().getUID().toString());
        jsonObject.addProperty("x", src.getX());
        jsonObject.addProperty("y", src.getY());
        jsonObject.addProperty("z",src.getZ());
        return jsonObject;
    }
glossy scroll
#

anon classes cannot be instantiated outside that very statement

carmine nacelle
#

hows that

compact haven
#

^ the reason I was like "yikes" is because it'll clutter your GSON-declaring class (your plugin class, probably) with serializer code, when it really should be in a separate class

carmine nacelle
#

Oh

compact haven
carmine nacelle
#

well im doing this in its own class

#

nah its block locations

glossy scroll
#

if you wanted to get really technical you could use getLeastSignificantBits and getMostSignificantBits

carmine nacelle
#

what the hell

glossy scroll
#

instead of deserializing a uuid from a string

compact haven
#

kekw

#

storing 2 longs instead of a string, while the whole config is a string

glossy scroll
#

its honestly personal preference idc

compact haven
#

nah just keep it a string, don't worry about what he said- you'd do that type of thing if you were storing in binary form

glossy scroll
#

you just use UUID.fromString or new UUID()

vestal dome
#

Why does this code not work?

#

when in doubt, create thread.

compact haven
#

when life gives you lemons, you throw them at people.

carmine nacelle
#
    @Override
    public Location deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
        JsonObject jsonObject = json.getAsJsonObject();
        UUID worldUUID = UUID.fromString(jsonObject.get("worldUUID").getAsString());
        double x = jsonObject.get("x").getAsDouble();
        double y = jsonObject.get("y").getAsDouble();
        double z = jsonObject.get("z").getAsDouble();
        Location newLocation = new Location(Bukkit.getWorld(worldUUID), x, y, z);
        
        return newLocation;
    }
vestal dome
carmine nacelle
#

WOOO IT SAVED LFG

glossy scroll
#

just use Location#toVector

#

and save that

#

then Vector#toLocation

compact haven
#

no

glossy scroll
#

you dont need typeAdapter for Vectors

compact haven
#

then he has to do serialization logic in the saving part

#

it don't belong there

carmine nacelle
#
[
  {
    "hiveUUID": "a9715339-642d-4908-b6a6-540fb284fc7b",
    "hiveName": "???????????C????a???d???i????a ?????H???i???v?????e??????????",
    "ownerUUID": "e42b60b0-c35a-462f-a2b4-b1a9980f399e",
    "hiveLocation": {
      "worldUUID": "423cf54e-8122-4586-b34f-9d5b70594b30",
      "x": 133.0,
      "y": -60.0,
      "z": -389.0
    },
    "holoUUIDs": [
      "46aad801-0ecf-4836-8e21-5251ae834e8e",
      "f9fde4e2-f31d-4c86-bfd7-86ac0c4e77c1",
      "b3304f5b-e7f6-4f89-bd1c-0f34fd4854ea"
    ],
    "rewardItems": [],
    "beeNames": [
      "???B???e?e"
    ],
    "beeUUIDs": [
      "e87eb370-db05-401a-b007-5b1e137f446e"
    ],
    "beeAmt": 2,
    "honeyAmt": 0,
    "hiveLevel": {
      "hiveLevel": 1,
      "maxBees": 1,
      "maxHoney": 5,
      "cost": 0,
      "rewardChance": 0
    },
    "hiveStatus": "PRODUCING",
    "beesBeingRenamed": false
  }
]
compact haven
#

wottf

carmine nacelle
#

im satisfied with this i suppose, idk why its turning some of my stuff into weird characters lmao

glossy scroll
#

wdym no im saying you would

#

serialize the vector

vestal dome
#

wtf

glossy scroll
#

because gson works very nicely with vectors

carmine nacelle
#

Yeah idk

#

its actually...
#25ec0dH#2eea0ci#37e80av#3fe609e #48e407L#51e206e#5ae004v#62de03e#6bdc01l#74da00

compact haven
#

yes but then he needs to either store Vectors in the class, or write vectors in JsonObject

#

it just doesn't make sense

carmine nacelle
#

its hex coded text.

compact haven
#

Why is it doing that

glossy scroll
#

yea

#

you should debug that

carmine nacelle
#

I have no clue

glossy scroll
#

you shouldnt have 2 serialization things going on at the same time

carmine nacelle
#

its hex text

#

So idk why its translating to that

glossy scroll
#

what are you deserializing

#

what is that field

compact haven
#

make sure you have .disableHtmlEscaping(), but that shouldn't be the cause

#

it's a string with hex codes I presume

carmine nacelle
glossy scroll
#

but its just a string right?

carmine nacelle
#

yes

glossy scroll
#

ok

carmine nacelle
#

weird af

#

It was working fine when I was saving it in a yml

compact haven
#

are we sure it's saving like that, and it's not just your text editor

carmine nacelle
#

gui-name: '#c35bfb⋯#b65ff8「#a963f6C#9c67f3a#8f6af0d#826eedi#7572eba #6776e8H#5a7ae5i#4d7ee2v#4081e0e#3385dd」#2689da⋯'

#

this is how that same thing looks when saved in yml

carmine nacelle
#

im using N++

compact haven
#

send the file

carmine nacelle
#

Dafuq

glossy scroll
#

now i see §

compact haven
#

ah that's what it is

vestal dome
#

why do you even have to store the UUID of the holograms?

carmine nacelle
#

cause my holos save to file also

vestal dome
#

well

#

using NMS to create holos is an idea..

carmine nacelle
#

its packets

golden turret
vestal dome
#

WHAT?

carmine nacelle
#

notepad++

compact haven
#

legit the best text editor

noble lantern
carmine nacelle
#

yes

golden turret
#

i was like

#

c++ made a kid?

carmine nacelle
#

KEKDOUBLEYOU

compact haven
#

anyways

noble lantern
#

emoji fail laugh at this user

compact haven
#

your notepad++ encoding is wrong for that json file

carmine nacelle
#

emoji fail?

compact haven
#

that's why it can't read the section symbol unicode

carmine nacelle
#

How can I change it

compact haven
#

and it shows as that weird thing

carmine nacelle
#

Oh

#

Hmmmm

#

Idk what one I would want

#

I tried converting to all the different options and nothing changed

compact haven
#

UTF-8

#

but it should be on that xd

modest garnet
#

can someone join a leave a 1.19 mc server real quick i wanna test a plugin

carmine nacelle
#

it is

#
    public void loadHives() {
        File file = new File(cadiaBees.getDataFolder().getAbsolutePath() + "/hives.json");

        if(file.exists()) {
            Reader reader = null;
            try {
                reader = new FileReader(file);
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }

            Gson gson = new GsonBuilder()
                    .registerTypeHierarchyAdapter(ItemStack.class, new ItemStackSerializer())
                    .registerTypeHierarchyAdapter(Location.class, new LocationSerializer())
                    .disableHtmlEscaping()
                    .setPrettyPrinting()
                    .create();
            
            List<CustomHive> hives = gson.fromJson(reader, (Type) CustomHive[].class);
            for(CustomHive hive : hives) cadiaBees.hiveManager.addHive(hive);
        }
    }
 class [Lcom.squallz.cadiabees.objects.CustomHive; cannot be cast to class java.util.List ([Lcom.squallz.cadiabees.objects.CustomHive; is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @639c9c75; java.util.List is in module java.base of loader 'bootstrap')
        at com.squallz.cadiabees.managers.configmanagers.ConfigManager.loadHives(ConfigManager.java:67) ~[?:?]
#

wat

#

List<CustomHive> hives = gson.fromJson(reader, (Type) CustomHive[].class); this line is the error

compact haven
#

ehm

glossy scroll
#

ok so

#

you need type adapter

#

or wait

compact haven
#

he needs no such thing

#

give me one second

glossy scroll
#

type token

#

new TypeToken<List<CustomHive>>() {}.getType()

compact haven
#

Type listType = new TypeToken<ArrayList<CustomHive>>(){}.getType();

carmine nacelle
#

REEE ANONYMOUS CLASS REEEEE

#

jk

#

ily in the gayest possible way

#

but its erroring on something kinda unrelated now

carmine nacelle
#
[
  {
    "hiveUUID": "a1455d0e-7466-47d9-989d-f5f2939f9d58",
    "hiveName": "???????????C????a???d???i????a ?????H???i???v?????e??????????",
    "ownerUUID": "e42b60b0-c35a-462f-a2b4-b1a9980f399e",
    "hiveLocation": {
      "worldUUID": "423cf54e-8122-4586-b34f-9d5b70594b30",
      "x": 138.0,
      "y": -60.0,
      "z": -379.0
    },
    "holoUUIDs": [
      "33449cc6-63d0-4a51-a4b6-f7093470feaf",
      "390166f1-2946-4ac8-bb9e-3099769de6c1",
      "4837653b-47ed-4f0b-962d-e7eb7864c547"
    ],
    "rewardItems": [],
    "beeNames": [
      "???B???e?e"
    ],
    "beeUUIDs": [
      "1b4682e9-4c41-4a92-b466-23651abd5999"
    ],
    "beeAmt": 2,
    "honeyAmt": 0,
    "hiveLevel": {
      "hiveLevel": 1,
      "maxBees": 1,
      "maxHoney": 5,
      "cost": 0,
      "rewardChance": 0
    }
  }
]

So this is my file

#

im loading it

#

error

[00:32:27] [Server thread/ERROR]: Error occurred while enabling CadiaBees v${project.version} (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "com.squallz.cadiabees.objects.HiveLevel.getMaxHoney()" because the return value of "com.squallz.cadiabees.managers.HiveLevelManager.getHiveLevel(int)" is null
golden turret
#

hm

carmine nacelle
#

It shouldnt be erroring because... getMaxHoney should be returning the "maxHoney" for the hiveLevel in the json

golden turret
#

getHiveLevel is null

carmine nacelle
#

yeah but it should be...

#

shouldnt*

#

weird.

#

[00:38:56] [Server thread/INFO]: LEVEL: 1

#
                Bukkit.getLogger().info("LEVEL: " + hive.getHiveLevel().getHiveLevel().toString());
#

sussy

glossy scroll
#

why are you using the Integer wrapper?

carmine nacelle
#

wdym

kind hatch
#

Also, why are you calling #getHiveLevel() twice?

carmine nacelle
#

so

#

its just bad naming

#
package com.squallz.cadiabees.objects;

public class HiveLevel {
    private Integer hiveLevel;
    private Integer maxBees;
    private Integer maxHoney;
    private Integer cost;
    private Integer rewardChance;

    public HiveLevel(Integer hiveLevel, Integer maxBees, Integer maxHoney, Integer cost, Integer rewardChance) {
        setHiveLevel(hiveLevel);
        setMaxBees(maxBees);
        setMaxHoney(maxHoney);
        setCost(cost);
        setRewardChance(rewardChance);
    }

    public Integer getHiveLevel() {
        return this.hiveLevel;
    }

    public void setHiveLevel(Integer hiveLevel) {
        this.hiveLevel = hiveLevel;
    }

    public Integer getMaxBees() {
        return this.maxBees;
    }

    public Integer getMaxHoney() {
        return this.maxHoney;
    }

    public Integer getCost() {
        return this.cost;
    }

    public Integer getRewardChance() {
        return this.rewardChance;
    }

    public void setCost(Integer cost) {
        this.cost = cost;
    }

    public void setRewardChance(Integer rewardChance) {
        this.rewardChance = rewardChance;
    }

    public void setMaxBees(Integer maxBees){
        this.maxBees = maxBees;
    }

    public void setMaxHoney(Integer maxHoney) {
        this.maxHoney = maxHoney;
    }
}

#

the getHiveLevel in my HiveLevel class is just the numeric value.

glossy scroll
#

You're using the wrapper Integer and not the primitive

#

yes

#

exactly

carmine nacelle
#

can you elaborate

glossy scroll
#

Integer is not the same as int

golden turret
#

you using Integer

#

which is an object

glossy scroll
#

boxed type vs primitive type

golden turret
#

and every object can be null

carmine nacelle
#

i usually use them interchangeably 😓

glossy scroll
#

you... shouldnt

golden turret
#

you should do that only when need

#

example

#

when retrieving data from database and the null represents empty data

glossy scroll
#

yes, if your integer needs to be represented as null then use the boxing

#

otherwise use primitive

carmine nacelle
#

where should I change it..

glossy scroll
#

Integer -> int

carmine nacelle
#

well

#
public class CustomHive {
    private UUID hiveUUID;
    private String hiveName;
    private UUID ownerUUID;
    private Location hiveLocation;
    private List<UUID> holoUUIDs;
    private List<RewardItem> rewardItems;
    private List<String> beeNames;
    private List<UUID> beeUUIDs;
    private int beeAmt;
    private int honeyAmt;
    private HiveLevel hiveLevel;
    private transient HiveStatus hiveStatus;
    private transient Boolean beesBeingRenamed = false;
#

I use int in my custom object

crisp steeple
#

using Boolean is almost never a good idea

#

you dont want to end up with a troolean

carmine nacelle
#

WHAT IS THAT

crisp steeple
#

boolean = true, false
Boolean = true, false, null

glossy scroll
#

yea you have a big problem with using box types unnecessarily

carmine nacelle
#

omg

glossy scroll
#

you need to convert these to primitive

carmine nacelle
#

I thought the capitalized version was primitive

glossy scroll
#

no...

#

capitalized version is a wrapper object

carmine nacelle
#

is that my issue?

glossy scroll
#

could be

carmine nacelle
#

hold on

#

now that I changed my stuff to ints

#

it no longer lets me call #tostring

glossy scroll
#

you dont need tostring for primitive

#

you could be picky and do String.valueOf()

carmine nacelle
#

String.valueOf works

glossy scroll
#

oh yea you would need string valueOf

#

or just

#

"" + i

#

but thats

#

weird idk

carmine nacelle
#

also

#

is there a better way to do what I just showed

#

it looks like cheeks but it works

glossy scroll
#

i mean oyure not realy elaborating here

#

what is inputString

carmine nacelle
#
    public String replacePlaceholders(String inputString, CustomHive customHive) {
        String returnString;

        HiveLevel hiveLevel =customHive.getHiveLevel();
        returnString =
            inputString.replace("{NEXT-HIVE-LEVEL}", String.valueOf(hiveLevel.getHiveLevel()))
            .replace("{NEXT-HIVE-COST}", String.valueOf(hiveLevel.getCost()))
            .replace("{NEXT-MAX-BEES}", String.valueOf(hiveLevel.getMaxBees()))
            .replace("{NEXT-MAX-HONEY}", String.valueOf(hiveLevel.getMaxHoney()))
            .replace("{NEXT-REWARD-CHANCE}", String.valueOf(hiveLevel.getRewardChance()))
            .replace("{BEE-AMOUNT}", String.valueOf(customHive.getBeeAmt())
            .replace("{HIVE-LEVEL}", String.valueOf(hiveLevel.getHiveLevel())
            .replace("{HIVE-NAME}", String.valueOf(customHive.getHiveName())
            .replace("{HONEY-LEVEL}", String.valueOf(customHive.getHoneyAmt());

        return returnString;
    }
#

ohg

#

Takes a string input and replaces the placeholders with real values

#

its so I can have configurable messages.

glossy scroll
#

ok for one thing that method looks like it could be static

#

i personally would opt for String.format

strong parcel
#

I tried that, but I get the same result.

glossy scroll
#

something like

carmine nacelle
#

javadocs are always confusing to understand

glossy scroll
#

String.format("The hive level is %d", myInt)

#

i mean not really

#

that would produce "The hive level is 3" if myInt was 3

carmine nacelle
#

for me cause im stupid lmao

carmine nacelle
glossy scroll
#

yea so you could do somehing like

#

String.format("The hive level is %d and it has %d bees", hiveLevel, numBees)

#

would say "The hive level is 3 and it has 2 bees" if numBees was 2

#

if you did String.format("The hive level is %d and it has %d bees", numBees, hiveLevel)

#

you would get "The hive level is 2 and it has 3 bees"

carmine nacelle
#

gotcha

somber hull
#

Can someone skim through this rq and lmk if theres anyhting i can imrove on.

carmine nacelle
#

Dang.. I cant do like level.equals(level) anymore

#

with the ints

glossy scroll
#

no and you SHOULDNT

somber hull
#

==

compact haven
#

bro what

carmine nacelle
#

== cannot be applied to int

compact haven
#

heh

glossy scroll
#

yes it can

somber hull
#

wat

compact haven
#

are you doing

somber hull
#

y lmao

compact haven
#

level.==(level)

#

tf u doin

glossy scroll
#

primitives literally are there so you can use ==

compact haven
#

^

glossy scroll
#

== cannot be applied objects

compact haven
#

no it can be used everywhere

#

just not safely

glossy scroll
#

well yea

#

technicality i suppose

#

.equals compares two objects

compact haven
#

that's why we love Kotlin

#

because == is .equals()

glossy scroll
#

== compares them in memory

#

well in java .equals is == so ha

compact haven
#

no it is nit

glossy scroll
#

unless you impl it

#

its the default

compact haven
#

well yes and no 😢

#

anyways Kotlin superior

glossy scroll
#

Kotlin is just unreadable java

#

its like half-compiled java

strong parcel
#

I double checked the main file, and the listener is registered. I also have the gui's class implement listener. Also, the system should only print the error message I made if it recognizes the event, right? Would you mind explaining your subclass theory a bit more?

carmine nacelle
#

YOOOOOO ITS WORKING

#

LETS GOOOOOOOOOOOOOOOOOOOOOOOOOOO

opal juniper
#

don’t call your main class that you extend, MainClass. call it like SpawnerPlugin

#

@somber hull

kind hatch
#

?main

compact haven
#

ur blind, quite clearly

#

obviously only knowing Java won't let you read Kotlin code

#

it's a different language

#

to read Kotlin code u must learn Kotlin

granite burrow
#

is it possible to convert World#getTime() to a date format that the SimpleDateFormat would work on?

EX: World time is 24000 so if the SDF was set to HH:mm the output would be 00:00

somber hull
echo basalt
#

why 3.6? because there are 86400 seconds in a day / 24000 ticks

#

So each game tick represents 3.6 seconds in a day

#

or each game second represents 72 seconds in a day

quaint berry
#

Is there a way to force the model inside an item frame to stay loaded?

carmine nacelle
#

I once again come with another stupid question

#

I need to store an ArrayList<String> into a String for PDC, then return it back as an ArrayList<String>

#
    public ItemStack setStoredBeeNames(ItemStack itemStack, List<String> beeNames) {
        NamespacedKey storedBeeNames = new NamespacedKey(cadiaBees, "stored-bee-names");

        if(!(itemStack.hasItemMeta()) || itemStack.getItemMeta().getDisplayName() == null ) return null;

        ItemMeta itemMeta = itemStack.getItemMeta();
        PersistentDataContainer container = itemMeta.getPersistentDataContainer();

        container.set(storedBeeNames, PersistentDataType.STRING, String.valueOf(beeNames));
        itemStack.setItemMeta(itemMeta);
        return itemStack;
    }
#
    public List<String> getStoredBeeNames(ItemStack itemStack) {
        NamespacedKey storedBeeNames = new NamespacedKey(cadiaBees, "stored-bee-names");

        if(!(itemStack.hasItemMeta()) || itemStack.getItemMeta().getDisplayName() == null || itemStack.getItemMeta().getPersistentDataContainer() == null) return new ArrayList<>();

        ItemMeta itemMeta = itemStack.getItemMeta();
        PersistentDataContainer container = itemMeta.getPersistentDataContainer();

        if (container.has(storedBeeNames, PersistentDataType.STRING)) {
            List<String> beeNames = new ArrayList<>();

            String beeNameString = container.get(storedBeeNames, PersistentDataType.STRING);
            if(beeNameString.contains(",")) {
                String[] beeNameArray = beeNameString.split(",");

                beeNames.addAll(Arrays.stream(beeNameArray).toList());
            } else {
                beeNames.add(cadiaBees.colorUtil.color(beeNameString));
            }
        }

        return new ArrayList<>();
    }
#

this no worky. Translation: returns nothing

strong parcel
#

Does anybody know what is causing e.getInventory.equals(gui) to return false? I don't know what is causing the inventories to be unequal. The event is registered, and I also tried using getClickedInventory but got the same result. https://paste.md-5.net/jidarotovo.java

oblique vigil
#

Hey, im having trouble getting the amount of a specific itemstack in a player's inventory. I can remove 1 just fine, but I need to get the amount they have if they have more than one. Ive seen plenty of threads about a normal material, such as Material.COBBLESTONE, etc. but not a custom itemstack with custom values.

Thanks!

vestal dome
#

if you call the method again it will overwrite the existence gui

#

and since they're different it will return false.

oblique vigil
#

it has a method to get an item in a persons inventory, but not to return the amount of that specific item

vestal dome
#

just

strong parcel
vestal dome
vestal dome
#

hm

#

are you using the same listener instance?

strong parcel
#

I am not sure what you mean by that.

vestal dome
#

how do you open the gui

strong parcel
#

I open it through a command

vestal dome
#

well show me the command

strong parcel
vestal dome
#

so you're instantiating the class to open the gui every time

#

and the gui will always be different, unless gui is defined as static.

#

and even then it will be different if more people execute it

oblique vigil
vestal dome
#

fixed

#

check it again

#

I'm sorry

#

ItemStack can be null sometimes

#

soooo

#

just checking for it will fix it

oblique vigil
#

kk lemme see

#

still doesnt work

vestal dome
#

weeeirrd

oblique vigil
#

yeah, checking inventories is a mess

#

its so confusing

vestal dome
#

so uhh

#

hm

#

are you sure you have enough items

oblique vigil
#

yeah, the method for checking checks if they have greater than 1 of the item stack after they get the amount

#

unless the way i made the method is just broken

#

but i would assume it would be with the InventoryUtils method and not the method that checks the result

vestal dome
#

really weird

#

should be working

#

unless there's a difference

oblique vigil
#

its probably me inventory method just not returning the amount but idk how to fix it so it would

vestal dome
#

my guess is the item isn't equal

oblique vigil
river oracle
oblique vigil
#

im trying to make a static method that returns the amount of a specific itemstack in a players inventory

#

not a material

#

the itemstack has custom attributes added to it so i need to check if its an itemstack

river oracle
#

let's see the code

#

?paste

undone axleBOT
oblique vigil
echo basalt
#

What if you only have 1 coral

river oracle
#

I'd reccomend using isSimilar

#

it disregards stack size

echo basalt
#

Oh yeah that too

oblique vigil
#

ok lemme see

echo basalt
#

I'm hella sleep deprived didn't even spot it

river oracle
#

I work best late at night lol

echo basalt
#

I got out of bed

river oracle
#

1am-3am are the sweet spot

echo basalt
#

To make clientside map canvases

river oracle
#

lol

echo basalt
#

It's 8 am

river oracle
#

I work best late at night surprisingly

echo basalt
#

Same

river oracle
#

I have issues with concentration so the calmness really helps

#

I can sip on my tea in peace

echo basalt
#

Thing is I've been working with no days off for the past few months/years

oblique vigil
#

that didnt work

river oracle
#

is the item data the same

oblique vigil
#

it just runs the else statement as if i onyl have 1 in my inventory

#

yes

#

10000000%

echo basalt
#

Sout both items

oblique vigil
#

i give the items in a command and they're the exact same cause if they werent the else statement wouldnt fire

river oracle
#

my next question would be why aren't you checking for the custom data instead of similarity

#

I feel like it'd be more precise to just check for that specific data

echo basalt
#

I've had issues where 1 item had those legacy color codes on its name

#

And the other had components

#

isSimilar said they're different

river oracle
#

yea I prefer to check specific values on items i usually ad like a byte pdc or something

oblique vigil
#

plugin is all in 1.18

#

it wouldnt be any different

river oracle
#

stdout both items and make sure they are exactly the same

#

don't assume

#

just stdout it

river oracle
#

hmhm I love my 1 byte PDC tags

river oracle
carmine nacelle
#

Anyone here a particle math wiz

echo basalt
river oracle
#

Lol these are the times I wish I could do 3d math but I'm hopeless

echo basalt
#

👍

#

3d math is fun

river oracle
carmine nacelle
#

I suck at it

#

I wanna make a looping particle helix, ive done it before but I forgot how

echo basalt
#

Except for quaternions and euler angles

river oracle
#

I'm good at math I just haven't had to learn it yet

compact haven
#

that would be a terrible idea please do not

echo basalt
#

That shit makes me mad

carmine nacelle
#

by done it before I mean I found a chunk of code and slightly modified it.

river oracle
echo basalt
#

I made satanic cows with async particles out of pure nms

compact haven
#

oh I meant the islands in pdc

#

that’s just cursed

river oracle
#

yea I know

#

lol

#

I'd totally do that shit

compact haven
#

having fun with particles, that’s amazing

oblique vigil
echo basalt
#

Spinning pentagram with a helix on top

#

Was fun

river oracle
echo basalt
#

Cows would fly like blazes and shoot fireballs

river oracle
#

?paste

undone axleBOT
carmine nacelle
#

Should I just use ParticleLib to spawn my particles isntead of the PlayOutBlahBlah

echo basalt
#

Player#spawnParticle

#

Works perfectly finr

#

Thread safe

carmine nacelle
#

well id want World#spawnParticle but ye

#

fine

echo basalt
#

Both worky

river oracle
echo basalt
#

It still calls equals

river oracle
#

that too similar is just better lol

#

good catch

echo basalt
#

I remember looking at internals

oblique vigil
#

yeah i updated it to isSimilar

#

just not in the paste

echo basalt
#

And it was like

river oracle
#

isSimliar is pretty much just equals without the stack size iirc

#

thats what docs say atleast

echo basalt
#
public void equals(ItemStack other) {
    return isSimilar(other) && amount == other.amount;
}
#

Writing code on mobile is tiring

river oracle
#

kek

#

I don't even bother typing code whiule I'm on mobile

#

I just try to explain it

echo basalt
#

I mean

#

Yeh

oblique vigil
echo basalt
#

Just showing internals

river oracle
#

thats the equals method for item stacks

#

isSimilar is good for checking for similar items disregarding the item amount

oblique vigil
#

yeah i changed it to isSimilar and it still doesnt work, and i know fs that the items are the same

river oracle
#

I don't think they are 😉

oblique vigil
#

bro if they arent the same then why does the else statement fire if its legit the same thing just if its only 1

#

they wouldnt stack if they werent the same either

river oracle
#

true are they stacking in different slots?

oblique vigil
#

nope

river oracle
#

send a screenshot of your inventory

#

I'd just add debug statements to my loop and see where its not going through at tbh

#

its hard for me to help you considering all I'm seeing is that the items aren't the same

#

Wuat

#

LMFAO

#

I"M SO STUPID

echo basalt
#

It's the only point of failure

river oracle
#

BRO

echo basalt
#

Unless we tripping

river oracle
#

imillusion

#

look at this take a good hard look at whats wrong

#
        int amount = 0;

        for (ItemStack item : player.getInventory().getContents()) {
            if (item != null && item.equals(itemStack)) {
                amount += item.getAmount();
            }
        }
        return itemStack.getAmount();```
echo basalt
#

Lol

#

Okay

oblique vigil
#

thats my inv

echo basalt
#

We're blind

river oracle
#

you need to return your amount value lmfao

echo basalt
#

Like

river oracle
#

xD

oblique vigil
#

bruh

#

lmao

echo basalt
#

I gotta put my glasses on after that

river oracle
#

omg we are both idiots

echo basalt
#

Dude it's 8am and I've been doing nms for the past 16 hours

oblique vigil
#

lemme see if its fixed now lmao

echo basalt
#

I'm not stable enough

oblique vigil
river oracle
#

lol I've been working with shitty minigame code I'm redoing

#

too bad its proprietary or I would share lol

echo basalt
#

Minigame is written in nms

river oracle
#

not a lot of NMS

#

thank god the core takes care of it

echo basalt
#

I have fake blocks and fake entities and all

oblique vigil
#

it works

#

i love you both

river oracle
#

lmfao

oblique vigil
#

❤️

river oracle
#

we are all stupid

echo basalt
#

That interact with each other in a game by game basis

#

And collide

oblique vigil
#

hey man u clearly know more than me so dont put urself down

river oracle
#

very neat

echo basalt
#

It comes at the cost of having no friendd

echo basalt
river oracle
#

I wish I could say I have no friends, but I have too many to say that 😥 I can only say it as a joke

echo basalt
#

Asked for 10k, dude hasn't got back to me yet

river oracle
#

lol

river oracle
#

the map system we have is also really cool

echo basalt
#

Who needs maps

river oracle
#

true not me 😂

echo basalt
#

Neither me

river oracle
#

when's the last time you played bedwars

echo basalt
#

🤡

river oracle
#

is this good stats #general message

echo basalt
river oracle
#

what

echo basalt
#

Sweaty mf

river oracle
#

I'm not good lol I suck

#

The people I went against just happened to suck more

echo basalt
#

It's a bit wrong of me to call other people sweats honestly

river oracle
#

I can only click 5cps :P i can never reach full potential

#

I'm a 5cps legend I used to play HCF and actually did pretty well for clicking so slowly

echo basalt
#

I have a disorder that makes me physically sweat 20x more than the usual person

#

So I'm a literal sweat

river oracle
#

you sweat

#

Also I can't be a nolife because I play sports and work out

echo basalt
#

I work out sometimes

river oracle
#

I touch grass and go out with friends too! I'm not a loser

#

right? right? 😭

echo basalt
#

You're a plugin dev

#

Not a loser 🤡

river oracle
#

I'm not just a plugin dev

#

I code my friends and families programs to make boring stuff easy

#

I think my top accomplishment is this reminder app for my mom who is a specialist at a school she has to send out lots of reminders and I completely automated it 🥲 had to bundle 4 platforms together

echo basalt
#

eww this guy does more than minecraft

#

not me

#

I'm a professional plugin maker

#

don't even have a working website

crude charm
#

Every time I go about starting a massive project I try to do everything else and end up getting overwhelmed and stopping development. Would planning every small thing in advanced help me pace myself? I could have like 3 tiers of importance and I do them all in order? Starting from easy stuff like storing player data and scoreboard to mines, private mines, robots, custom enchants and so on.

echo basalt
#

at least I can say I interned at a school and fixed their printer

river oracle
echo basalt
river oracle
#

Just make a bunch of small plugins than combine them it always keeps me more on task

echo basalt
#

I have a massive project that I've been working on over the past 1-2 months and I'm still doing steady hours because:
1 - it's fun
2 - it's organized
3 - team overlooks development with weekly meetings and I don't want to disappoint

ivory sleet
echo basalt
#

In my case it's a zombies minigame

crude charm
echo basalt
#

So the first thing I made was a game system (initializing and disposing games)

#

then a zombie spawning mechanism

#

then gun mechanics

#

then points, then doors

#

then perks

crude charm
#

Yeah

echo basalt
#

you break it into small objectives / features and fully implement them

#

You only start another feature once the feature you want is completely implemented

oblique vigil
echo basalt
#

But make sure that all dependent features are already done before starting work

#

So if I'm making a perk machine, I expect to have a points system make

#

And a perk system so that you use the machine and something actually happens

crude charm
echo basalt
#

After having all the guns done and points

#

then I can make a mystery box

#

type thing

crude charm
#

It's also annoying when I have to make methods for getting basic stuff

echo basalt
#

But it's more important to have working stuff than just "done" stuff

crude charm
#

It's why I usually prefer to work with existing code bases

echo basalt
#

basically you need internal planning

#

and to follow an order of operation

#

based on what's relied upon the most

river oracle
#

I usually build up my API before i even start a project's main concept

crude charm
#

Yeah

compact haven
#

well if you build an API then you could literally work on perks before points

#

which is especially nice if 2 things rely on each other

echo basalt
#

I never understood the concept of making an external API

#

I usually make an api and call it internally type thing

#

instead of having an api layer and an internals layer, the internals are the api

river oracle
crude charm
#

would making classes such as "PlayerData" and making 50 comments with methods I need to make, then make all of them.

//get tokens
public void getTokens() {

}
//set tokens
//get player level
echo basalt
#

you'd end up with 2k lines

compact haven
#

Typically your API is all interface, minus some utility implementations

#

Then your internal is all actual implementation

oblique vigil
#

just make the methods bro

compact haven
#

Which works just fine

echo basalt
#

raytrace, get hit point, create particle line between

crude charm
river oracle
#

always comment before proceeding

crude charm
#

To know what I need

river oracle
#

My classes are usually marked up a shit ton

oblique vigil
#

i mean i comment stuff but not every single thing

#

if im making a getter or setter or whatever i know what it does lmao

river oracle
#

I usually leave myself an outline before I implement especially if I need to come back or I forget

oblique vigil
#

and id hope anyone else would

compact haven
#

Honestly that might be a good idea for me

echo basalt
river oracle
oblique vigil
#

ig

echo basalt
river oracle
#

you can actually get some Methods called get that have specific return reasons

echo basalt
#

I have a full skyblock core that has 6 listeners

river oracle
#

like I have getAdapter methods that return specific parts of the spigot API that i've wrapped

#

I like to explain why its there what it does for all other users of the API

oblique vigil
#

fair enough

ivory sleet
oblique vigil
#

yeah getters and setters are self explanatory, i was just curious tbh

ivory sleet
#

Comments are far from pure good although necessary sometimes, even if explanatory code could be used

oblique vigil
#

still relatively new to coding

river oracle
ivory sleet
#

There are tons of issues with comments

echo basalt
#

whatever can't be explained through the variable naming, shall be commented

#

getTokens() is self explanatory

oblique vigil
#

^

#

my thought process

vocal cloud
#

If you have a backend an entity relationship diagram is nice

echo basalt
#

incrementRound() can do some underlying operations so it should be documented (cleaning entities, wiping scores type thing)

ivory sleet
#

Not only variable naming, but naming of everything

crude charm
#

Issues also arise when I need to implement another big feature to work on another. Like player levels to get player level

#

This is tame but it arises that I get massively sidetracked with something unrelated which takes days

echo basalt
#

You only start working on a feature if all underlying systems are fully implemented

#

you gotta think about how it'll roll out before actually writing code

#

I'd say I do a 1:10 planning:developing ratio

#

sometimes up to 7:3

river oracle
#

I spend a lot of time planning because I can't concentrate for shit

crude charm
#

1/10th development or planning?

compact haven
#

1:10 and 7:3 are very different dynamics LOL

echo basalt
#

I spent 5 hours planning a system that took me about 25 minutes to code

compact haven
#

I plan much more than I develop

#

It’s a bad habit

vocal cloud
#

Plan twice develop once

echo basalt
#

even pulled up the pen & paper

#

the minecraft notebook

#

unrelated question

#

am I the only mf out there collecting minecraft merch?

river oracle
crude charm
echo basalt
#

I got mousepads, mugs, books

compact haven
#

I create notepad++ files that literally outline how the API should end up

#

or the endpoints of the REST api

#

utterly ridiculous

river oracle
#

I just outline it in my head than write it if its super big I'll write it on paper

echo basalt
#

visual demos need writing in paper

#

or paint

#

like for zombie spawning

#

I had to make it so it would only spawn zombies in spawn points close to the map region the player was at

#

but that map region also had to be unlocked

#

But doors have to work bidirectionally as the map has 2 paths

vocal cloud
#

Write lots of TODOs KEKW

compact haven
#

then never complete them

echo basalt
#

So I had to design a door system that connects 2 regions

earnest socket
#

How can I setup mappings for nms?

echo basalt
#

then a whole api to parse doors based on overlapping wg regions

compact haven
#

Whenever you have time available for a project, spend it all on planning

vocal cloud
earnest socket
#

I've tried everything I've found online but my mappings simple do not work

echo basalt
#

it's quite simple

#

on gradle groovy