#help-development

1 messages · Page 344 of 1

river oracle
#

Won't it just be taken down anyways

#

Yea

worldly ingot
#

If you plan on doing DRM elsewhere, stop asking here because we have no reason to help you

#

¯_(ツ)_/¯

quaint mantle
#

again, as if ive ever mentioned wanting to upload it to spigot

echo basalt
#

?whereami

worldly ingot
#

Refer to above message

quaint mantle
#

¯_(ツ)_/¯

#

and i think that is something i can ask about in the spigot's server or am i wrong ?

spice shoal
#

which is the string?

what i need to write?

sorry im bad in this

worldly ingot
#

Refer to the above message

If you plan on doing DRM elsewhere, stop asking here because we have no reason to help you

#

Your DRM is going to get cracked anyways

quaint mantle
remote swallow
echo basalt
#

if you're blind or have learning issues, here's a TL;DR

  • Don't do licensing on spigot
  • If you're doing licensing elsewhere, then don't ask us here (because we help with spigot-related info)
worldly ingot
#

No, there's just no reason to support something explicitly against our rules of our marketplace

#

"marketplace"

rotund ravine
#

Go to tph or something for advise outside spigot rules.

remote swallow
quaint mantle
echo basalt
#

It's like going to a microsoft discord server and asking about making a hackintosh

remote swallow
#

its almost as if the title of this channel says "Spigot and BungeeCord programming/development help"

worldly ingot
#

Man. Reading is hard

remote swallow
#

yeah

echo basalt
quiet ice
#

With technologies such as SSVM it is very hard to use DRM in java world

quaint mantle
#

i dont think making a personal project is against the rules

echo basalt
#

Just move on with your life

quiet ice
#

There is like only a single good obfuscator out there and it costs a huge amount of money

echo basalt
#

crack it

quiet ice
#

With huge I'm talking at over 1k

echo basalt
#

you can probably find a torrent

quiet ice
quaint mantle
quiet ice
#

there are a few leaks here and there but they are a few months to years behind

spice shoal
remote swallow
#

set the item in their inv to it

rotund ravine
#

?jd-s

undone axleBOT
remote swallow
#
// ItemStack code
player.getInventory().setItemInOffHand(stack);
player.damage(20.0);
#

no need for the SpigotUtils.spigotCommand

quaint mantle
#

reading is hard !

wet breach
# quaint mantle i dont think making a personal project is against the rules

what you asked earlier for wanting a UUID. Literally if you need to ask the client for one then you can't trust it isn't spoofing someone elses UUID. There is literally no way to prevent or check that unless you start locking down stuff to ip addresses because from the server end or external there is not really a lot you can use to identify something other then an IP for uniqueness. Since you won't specify what exactly you are making or being super secretive of your method that somehow prevents piracy. There isn't really much else to help with. Basically you didn't come here for help, rather you came here for ideas especially if you already know how to do all this.

rotund ravine
#

The mac address of the user. 👌🏻

wet breach
quaint mantle
wet breach
#

well, not sure how well your anti-piracy mechanisms are going to go if you don't know the basics of security. But good luck to you anyways I guess

undone spindle
#

how can i see when a player got shot

wet breach
undone spindle
#

but then i can get the arrow

#

not the player

undone spindle
#

do i need to get shooter

#

and then cast it to player?

signal kettle
#

hello, I tried to make that when player right click block then send command as console "example command %player%" but the plugin from that command look like can't get the player name that right click block

wet breach
#

I believe you are wrong

#

it does return an Entity

undone spindle
#

ooh

#

wait i was thinking of shoot event

#

but does that mean that when its shot and it lands on something it will return a value?

signal kettle
#
        Player player = event.getPlayer();

        if (player.getInventory().getItemInMainHand().getType() == Material.IRON_HORSE_ARMOR) {
            if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
                player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
                Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack" + player);

remote swallow
#

player will be invalid

#

use player.getName

wet breach
#

as it returns either a block or entity

remote swallow
#

?earlyreturns

remote swallow
#

@quaint mantle can we get anearly returns command with some good link about it

signal kettle
#

ohh okay I'll trie thank you

spice shoal
#

like this?

remote swallow
#

that item stack will be null

#

one sec

wet breach
#

well a bit on the nose with that

spice shoal
#

that's null

remote swallow
#
            ItemStack stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1);
            ItemMeta meta = stack.getItemMeta();
            meta.setCustomModelData(1);
            stack.setItemMeta(meta);
            p.getInventory().setItemInOffHand(stack);
            p.damage(20.0);
spice shoal
# remote swallow ```java ItemStack stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1...

that's all command , can it work (or just try and see)?

`package me.sussolino.juicepvpcore.commands.inviti;

import dev.sweety.swcore.api.utils.ColorUtils;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.jetbrains.annotations.NotNull;

import static dev.sweety.swcore.api.utils.ColorUtils.color;

public class Discord implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
if (sender instanceof Player p) {
p.sendTitle("§b§lDiscord", "§dLink in chat", 10, 60, 20);
ItemStack stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1);
ItemMeta meta = stack.getItemMeta();
meta.setCustomModelData(1);
stack.setItemMeta(meta);
p.getInventory().setItemInOffHand(stack);
p.damage(20.0);
}
sender.sendMessage("&fꐻ");
sender.sendMessage(color(" &d&lDiscord"));
sender.sendMessage(ColorUtils.colorize(" &f➥ &e&nhttp://discord.juicepvp.eu"));
sender.sendMessage("");
return true;
}
}
`

green prism
#

Help? I'm actually using XSound from XSeries for playing a Sound (matched from the config) inside an 1.8.8 server.
AMBIENT_CAVE exists as Enum inside XSound but, when played it gives me this error:

Caused by: java.lang.IllegalArgumentException: Unknown sound: Optional[AmbientCave]
        at com.cryptomorin.xseries.XSound.parse(XSound.java:1683) ~[?:?]
        at com.cryptomorin.xseries.XSound.play(XSound.java:1597) ~[?:?]
        at it.mikeslab.kitpvp.task.player.death.DeathSounds.execute(DeathSounds.java:14) ~[?:?]
        at it.mikeslab.kitpvp.task.player.death.DeathManager.onDeath(DeathManager.java:32) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
        ... 26 more```
spice shoal
wet breach
#

just to mess with people

spice shoal
# remote swallow yeah

it work but there is a problem , if player has a item in offhand , remove it and place the totem , can i save it and re-place it when i set the health to 20?

        ItemStack stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1);
        ItemMeta meta = stack.getItemMeta();
        meta.setCustomModelData(1);
        stack.setItemMeta(meta);
        p.getInventory().setItemInOffHand(stack);
        p.damage(20.0);
        p.setHealth(20);
#

after "p.setHealth(20);

remote swallow
#

check if theres something there, if there is you can probably set it to a variable, give them the totem then give the item back

spice shoal
#

idk how i can do :(( , if u can help me im happy

signal kettle
remote swallow
#
ItemStack offHand = null;
if (player.getInventory().getItemInOffHand() != null) offHand = player.getInventory().getItemInOffHand();
//do stuff
player.getInventory().setItemInOffHand(offHand)
spice shoal
# remote swallow ```java ItemStack offHand = null; if (player.getInventory().getItemInOffHand() !...

like this??

ItemStack stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1); ItemMeta meta = stack.getItemMeta(); meta.setCustomModelData(1); stack.setItemMeta(meta); p.getInventory().setItemInOffHand(stack); p.damage(20.0); p.setHealth(20); ItemStack offHand = null; if (p.getInventory().getItemInOffHand() != null) offHand = p.getInventory().getItemInOffHand(); p.getInventory().setItemInOffHand(offHand);

remote swallow
#

you need to save the offhand item before setting it to something else

spice shoal
#

oh ok

worldly ingot
spice shoal
#

meta.setCustomModelData(1);
stack.setItemMeta(meta);
ItemStack offHand = null;
if (p.getInventory().getItemInOffHand() != null) offHand = p.getInventory().getItemInOffHand();
p.getInventory().setItemInOffHand(offHand);
p.getInventory().setItemInOffHand(stack);
p.damage(20.0);
p.setHealth(20);

remote swallow
#

dont question why i made it like that

#

my brain just did

remote swallow
spice shoal
#

oh ok

#

so after p.setHeath?

remote swallow
#

ye

spice shoal
#

ItemStack stack = new ItemStack(Material.TOTEM_OF_UNDYING, 1);
ItemMeta meta = stack.getItemMeta();
meta.setCustomModelData(1);
stack.setItemMeta(meta);
ItemStack offHand = null;
if (p.getInventory().getItemInOffHand() != null) offHand = p.getInventory().getItemInOffHand();
p.getInventory().setItemInOffHand(stack);
p.damage(20.0);
p.setHealth(20);
p.getInventory().setItemInOffHand(offHand);

#

:)?

#

it's correct?

remote swallow
#

yeah

spice shoal
#

i love u

remote swallow
#

you can probably remove that null check

#

and just set off hand directly to the item

pseudo hazel
#

translated to "remove the null check as its adding code for no reason they should have fired the person that came up with those lines of code"

remote swallow
#

i came up with it like 5 minutes ago

#

my brain hasnt turned on yet

spice shoal
#

it work , thanks EpicEbic

green prism
#

@eternal oxide I've a problem with finalDamage

    if(event.getFinalDamage() > player.getHealth())

This sometimes becomes false even if the player die.

eternal oxide
#

=

green prism
#

oh shi

#

ty

icy monolith
#

Hey, if i would like to use world edit regions in my plugin. For example make player select an area and then using a plugin it saves the region.

tardy delta
#

and whats the problem with that?

icy monolith
#

Like i want to make code that lets me select one corner and then other corner, then save the area using my custom command and then make it generate a specific block in the whole area that was added

#

like the plugin mineresetlite

wet breach
#

world edit has an api

dry yacht
#

90% of people in this cesspool of a community. They want to belittle you and tell you off instead of helping you on your way to find out why something isn't viable yourself and gain all the experience along the way.

quiet ice
#

But the 10% exists

dry yacht
#

Would go insane otherwise, tbh.

vocal cloud
#

Idk but someone thinking that their idea is good and then spending 100h implementing it just for it to be useless might be a "learning experience" but at the same time extremely demoralizing.

quiet ice
#

I mean you are at teh wrong place if it is about DRM

river oracle
#

I was about to suggest going elsewhere but my internet went out xD

icy monolith
#

Well if they do its there chouse and they shouldnt demoralize them even more just bc they think its not good

quiet ice
#

Recaf probably might be the best "clear" area that is suitable (that I know of), but even then they aren't the right people

dry yacht
quiet ice
#

it kinda does actually

#

If you aren't gifted it is needed, you are right there

dry yacht
#

Even if you are gifted, you still cannot know about all the concepts we use in computing right from the get-go.

#

Not like these grow on trees and are something you're born with. It takes effort to get into some domain.

pseudo hazel
#

I think it depends, but I can certainly say that the starting point of the learning curve is different for everyone

quiet ice
#

Well you can't just dive into cold water regardless of what you are doing

wet breach
vocal cloud
#

Don't bring your idea to a public forum if you don't want criticism imo

dry yacht
green prism
#

Value doesnt change?

    public static void save(HashBasedTable<UUID, UserData, Integer> dataTable, KitPvP plugin) {
        YamlConfiguration config = plugin.getConfigManager().getLoadedConfigs().get("values.yml");
        dataTable.cellSet().forEach(cell -> {
            UUID uuid = cell.getRowKey();
            UserData userData = cell.getColumnKey();
            System.out.println(userData.getKills());
            config.set(uuid.toString() + ".kills", userData.getKills());
            config.set(uuid.toString() + ".deaths", userData.getDeaths());
            config.set(uuid.toString() + ".level", userData.getLevel());
        });
        plugin.getConfigManager().saveConfig("values.yml");

    }

Kills value is actually 8 but doesn't get updated in the values.yml config.
Value doesn't get overwrited... It's always 7.

dry yacht
green prism
#

geol help me

dry yacht
green prism
#

hold on

quiet ice
quiet ice
#

I.e. I never work with YAML outside of configs - for data storage DataInputStream/DataOutputStream is more suited for me. That of course may not apply to you

#

But I can tell you, using raw bytes is much nicer than yaml when it comes to debugging

pseudo hazel
#

I made a class that does the hard stuff for me so I only needed to debug it once xD

green prism
green prism
#

why does it repeat more than once?

quiet ice
#

where does the UUID come from

#

at worst, it's Thread#dumpStack time

green prism
# quiet ice where does the UUID come from
    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        UUID uuid = event.getPlayer().getUniqueId();
        Internals.DATA_TABLE.put(uuid, RawData.parser(uuid, plugin), 0);
    }
signal kettle
#
    @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
    public void Backpack(final PlayerInteractEvent event) {
        Player player = event.getPlayer();

        if (event.getAction() == Action.RIGHT_CLICK_AIR && player.getInventory().getItemInMainHand().getType() == Material.IRON_HORSE_ARMOR) {
            player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
            Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack " + player.getName());
        }
    }
}

Is RIGHT_CLICK_AIR not a thing anymore? or my constructor is bad/need to add target or smth like that?

quiet ice
#

Or do you?

dry yacht
green prism
# dry yacht Show your print calls, otherwise there's no way knowing that
    public static void save(HashBasedTable<UUID, UserData, Integer> dataTable, KitPvP plugin) {
        YamlConfiguration config = plugin.getConfigManager().getLoadedConfigs().get("values.yml");
        dataTable.cellSet().forEach(cell -> {
            UUID uuid = cell.getRowKey();
            UserData userData = cell.getColumnKey();
            System.out.println(userData.getKills());
            System.out.println(uuid.toString());
            config.set(uuid.toString() + ".kills", userData.getKills());
            config.set(uuid.toString() + ".deaths", userData.getDeaths());
            config.set(uuid.toString() + ".level", userData.getLevel());
        });
        plugin.getConfigManager().saveConfig("values.yml");

    }
    @Override
    public void onDisable() {
        saveData();
    }



    public void saveData() {
        RawData.save(Internals.DATA_TABLE, this);
    }
[18:23:09 INFO]: [KitPvP] Disabling KitPvP v1.0-SNAPSHOT
[18:23:09 INFO]: 9

[18:23:09 INFO]: 1c5501dc-9f19-4c7b-a22e-dbf3c504945a

[18:23:09 INFO]: 7

[18:23:09 INFO]: 1c5501dc-9f19-4c7b-a22e-dbf3c504945a

[18:23:09 INFO]: 0

[18:23:09 INFO]: 882f8148-7da8-4af1-b32f-34357a33a489

[18:23:09 INFO]: 0

[18:23:09 INFO]: 882f8148-7da8-4af1-b32f-34357a33a489
undone axleBOT
green prism
#

no

#

.

remote swallow
pseudo hazel
#

why not xD

green prism
#

?

signal kettle
#

when I change it to RIGHT_CLICK_BLOCK then everything work perfect

remote swallow
#

dafuq?

quiet ice
green prism
quiet ice
undone axleBOT
#

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

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

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
dry yacht
signal kettle
# remote swallow dafuq?

Yeah consfusing, I tried also with checking Action before or after checking if item in hand but still same

quiet ice
#

ConfigManager and your code is the most important code

green prism
#

?paste

undone axleBOT
quiet ice
#

ah it comes from the #save method descriptor...

green prism
#

wha?

quiet ice
#

why the hell does one need such a class though

green prism
#

which class?

quiet ice
#

HashBasedTable

#

Usually HashMap or ConcurrentHashMap is enough

pseudo hazel
#

same I would personally go for a list of maps probably

#

or a map of maps

#

idk what you usecase is

green prism
#

guys, HashBasedTable returns a Row, Column, Value...
It's the same as Map<String, Map<String, String>>

#

It's a drug for me

quiet ice
#

Well if that is how it works

rotund ravine
#

lol ew

green prism
#

help me geol

#

you're my last hope

quiet ice
#

there is an error?

green prism
#

owejgjroqejgq

quiet ice
#

I thought it would just do nothing?

dry yacht
remote swallow
#

personally i would make a record for that

quiet ice
#

if there is an error, giving it to us may be helpful

green prism
#

There's no error, results doesn't simply get updated

dry yacht
remote swallow
#

are you reloading the file

dry yacht
quiet ice
#

Yeah, you have definitely duplicate keys then

dry yacht
quaint mantle
#

hi

#

how do i change the item in an inventory slot when a player clicks on that slot?

#

so

#

the way i am currently doing it is just listening for inventory click event

#

cancelling the click event.

quiet ice
#

@green prism Could I also see where you change your Internals.DATA_TABLE?

quaint mantle
#

After cancelling the event, doing inventory.setItem().

#

but

#

it it does not seem to work

#

does anyone know why?

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

green prism
# quiet ice <@350160924310634516> Could I also see where you change your `Internals.DATA_TAB...
    public HashBasedTable<UUID, UserData, Integer> getDataTable(Config configManager) {
        YamlConfiguration config = configManager.getLoadedConfigs().get("values.yml");

        HashBasedTable<UUID, UserData, Integer> dataTable = HashBasedTable.create();
        for(String key : config.getKeys(false)) {
            UUID uuid = UUID.fromString(key);
            UserData userData = new UserData(
                    config.getInt(key + ".kills"),
                    config.getInt(key + ".deaths"),
                    config.getInt(key + ".level"));

            dataTable.put(uuid, userData, 0);
        }

        return dataTable;
    }
 (Internals):   DATA_TABLE = new Values().getDataTable(configManager);
quaint mantle
#

there is no stack trace

#

no exception, no error.

quiet ice
quaint mantle
#

yep, the event is being triggered.

undone axleBOT
quaint mantle
#
        ItemStack renderItem = createRenderItem(false, this.inventory.getItem(inventorySlot));

        Bukkit.getScheduler().runTask(ChunkClaimsPlugin.getThisPlugin(), () -> {
            setGUIItem(inventorySlot, renderItem);
        });```
dry yacht
#

Internals.DATA_TABLE.row(uuid).put(userData, getStreak(uuid)); :-:

undone axleBOT
quaint mantle
#

there is complicated stuff going on but i can tell it is being triggered because of a console log.

green prism
#

don't you like it?

quaint mantle
#
boolean currentBoolean = ChunkData.getBoolean(boolIndex, this.booleansBitmask);
        ItemStack renderItem = createRenderItem(false, this.inventory.getItem(inventorySlot));

        Bukkit.getScheduler().runTask(ChunkClaimsPlugin.getThisPlugin(), () -> {
            setGUIItem(inventorySlot, renderItem);
        });

        System.out.println("Item re-rendered.");```
dry yacht
green prism
#

public static int getStreak(UUID uuid) {
return Internals.DATA_TABLE.row(uuid).get(getUserData(uuid));
}

quaint mantle
#
public class ClaimSettingsInventoryClickEventHandler implements Listener {
    @EventHandler
    public void onInventoryClickEvent(InventoryClickEvent event) {
        Inventory inventory = event.getClickedInventory();
        ClaimSettingsInventoryGUI clickedInventoryGUI = ClaimSettingsInventoryGUI.getClaimSettingsInventoryGUI(inventory);
        if (clickedInventoryGUI != null) {
            event.setCancelled(true);

            Bukkit.getScheduler().runTaskAsynchronously(ChunkClaimsPlugin.getThisPlugin(), () -> {
                try {
                    clickedInventoryGUI.inventoryClickEventHandler(event.getSlot());
                } catch (Exception e) {
                    event.getWhoClicked().sendMessage(e.getMessage());
                }
            });
        }
    }
}
green prism
quaint mantle
#

?paste

undone axleBOT
quaint mantle
dry yacht
quiet ice
#

quite honestly, it's superflous but I think I know the issue now

green prism
#

what's the issue?

quaint mantle
#

i am computing most of the stuff asynchronously then pushing the inventory update to the main game thread with the Bukkit.getScheduler().runTask(); method.

quiet ice
#

Your issue lies in that you might not be reusing the same UserData instance for row

icy monolith
#

Do you guys know where i can download world edit api? I think ive clicked every link in there docs looking for it.

quaint mantle
#

does anyone know what is going on?

quiet ice
#

i.e. you have multiple UserData instances for a single row - thus causing havoc.

#

oh wait, you recycle it

green prism
#

put

dry yacht
#

Have you sent UserData yet? You didn't override hashing with some funny implementation on your own, did you?

quiet ice
#

it might be useful to print the contents of your tables - column by column, row by row and see what you are doing

quiet ice
#

so it would need to be a clone...

quaint mantle
#

so, um, any clue why it won't change the item?

dry yacht
quiet ice
#

alternatively give us all mentions of new UserData and their surrounding lines (or just give the entirety of the plugin at that point)

quaint mantle
#

also, i have another question

#

can mobs spawn in unloaded chunks?

quiet ice
#

in vanilla world, they don't (except perhaps the ender dragon but idk if you can consider that spawning)

green prism
# quiet ice it might be useful to print the contents of your tables - column by column, row ...

[18:52:11 INFO]: Printing King Geol requested data...

[18:52:11 INFO]: 1c5501dc-9f19-4c7b-a22e-dbf3c504945a it.mikeslab.kitpvp.object.UserData@88e62 1

[18:52:11 INFO]: 1c5501dc-9f19-4c7b-a22e-dbf3c504945a it.mikeslab.kitpvp.object.UserData@bdbbca4 0

[18:52:11 INFO]: 882f8148-7da8-4af1-b32f-34357a33a489 it.mikeslab.kitpvp.object.UserData@3ff86009 0

[18:52:11 INFO]: 882f8148-7da8-4af1-b32f-34357a33a489 it.mikeslab.kitpvp.object.UserData@38ba6984 0

[18:52:11 INFO]: DONE ---> SAVING DATA

(Inside onDisable)

quiet ice
#

Spigot most likely allows spawning mobs in unloaded chunks - should they be persistent from the start

quaint mantle
#

i had a strange error occuring with the CreatureSpawnEvent being called even though a chunk was not loaded.

dry yacht
quiet ice
#

It might.

green prism
quiet ice
#

As of now your table should look something like

                                      | UserData@88e62 | UserData@bdbbca4 | UserData@3ff86009
 -------------------------------------------------------------------------|------------------
 1c5501dc-9f19-4c7b-a22e-dbf3c504945a |      1         |         0        |   N/A
 -------------------------------------|----------------|------------------|-----------------------
 882f8148-7da8-4af1-b32f-34357a33a489 |   N/A          |    N/A           |   0

So something is wrong with your choosen architecture

#

I sincerely recommend to use HashMap there and store the kill streak in the UserData and not in cells

#

Using Table makes 0 sense

#

As even without your bug you'll have as many rows as columns

green prism
#

Smth like:

Map<UUID, Entry<UserData, Integer>>?

quiet ice
#

At worst yes, at best you add the Integer to the UserData

green prism
#

hm, you're damn right

quiet ice
#

So it's be Map<UUID, UserDataWithKillStreak>

#

You'll likely want to store that in your config anyways

lavish wing
#

Hello guys help me pls with my plugin.Im using Poseidon Project Infdev Bukkit api (its like beta 1.7.3 bukkit api) and my plugin shows me this errorhttps://imageup.ru/img251/4190941/izobrazhenie_2023-02-02_205918788.png.html

#

code:
SkyGrid.java

package net.doh1221;

import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.logging.Logger;

public class SkyGrid extends JavaPlugin {

    Logger log = Logger.getLogger("Minecraft");

    public ChunkGridGenerator chunkGridGenerator = new ChunkGridGenerator((net.minecraft.server.World) getServer().getWorld("world"), 1);

    @Override
    public void onEnable() {
        log.info("Armlix SkyGrid Generation initialized");
    }

    @Override
    public void onDisable() {
        log.info("Armlix SkyGrid Generation shutting down");
    }

    @Override
    public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
        return chunkGridGenerator;
    }

}
tardy delta
#

Skygrid:12

#

world null?

lavish wing
#

ChunkGridGenerator

package net.doh1221;

import net.minecraft.server.*;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.generator.NormalChunkGenerator;

import static org.bukkit.Material.*;

public class ChunkGridGenerator extends NormalChunkGenerator {

    int[] Materials = new int[]{STONE.getId(), GRASS.getId(), DIRT.getId(), COBBLESTONE.getId(), WOOD.getId(),
            BEDROCK.getId(), STATIONARY_WATER.getId(), STATIONARY_LAVA.getId(), SAND.getId(),
            GRAVEL.getId(), GOLD_ORE.getId(), IRON_ORE.getId(), COAL_ORE.getId(),
            LOG.getId(), LEAVES.getId(), SPONGE.getId(), GLASS.getId(),
            WOOL.getId(), STEP.getId(), BRICK.getId(), TNT.getId(), BOOKSHELF.getId(),
            MOSSY_COBBLESTONE.getId(), OBSIDIAN.getId(), CHEST.getId(), DIAMOND_ORE.getId(),
            WORKBENCH.getId(), CROPS.getId(), BURNING_FURNACE.getId(), FURNACE.getId()};

    public ChunkGridGenerator(World world, long seed) {
        super(world, seed);
    }


    public byte getRandomBlock() {
        return (byte) Materials[(byte) (Math.random() * (Materials.length))];
    }

    @Override
    public Chunk getOrCreateChunk(int i, int i1) {
        byte[] result = new byte[32768];
        net.minecraft.server.Chunk chunk = new net.minecraft.server.Chunk(((net.minecraft.server.World) Bukkit.getWorld("world")), result, i, i1);

        for (int x = 4; x < 32768; x += 4) {
            if (x % 128 != 0) {
                result[x] = getRandomBlock();
            } else {
                x = x + 128;
            }
            if (x % 2048 == 0) {
                x = x + 2048;
            }

        }
        chunk.initLighting();


        return chunk;
    }
}
tardy delta
#

bruh

#

?paste

undone axleBOT
haughty granite
#

?paste

undone axleBOT
tardy delta
#

💀

lavish wing
#

Why it doesn't work?

tardy delta
#

we told you

haughty granite
#

is there a better way to call an API and use what it returns?

tardy delta
#

why the stringbuffer tho

#

does it need to be synchronized?

haughty granite
#

no, I just send parameters and the API returns data

tardy delta
#

use a stringbuilder then ig

haughty granite
#

in fact I don't understand what StringBuffer is for

tardy delta
#

its just a threadsafe stringbuilder as far as i know

green prism
#

it works

lavish wing
green prism
#

thank you geolll

tardy delta
#

make sure world exists or smth idk

chrome beacon
lavish wing
chrome beacon
#

You're getting the world too early

tardy delta
#

hmm didnt even look at it, init it in onEnable ^

chrome beacon
#

Do it in getDefaultWorldGenerator

lavish wing
lavish wing
chrome beacon
#

Use the world name from the method

chrome beacon
#

Now send your code again so we can have the correct lines in the stacktrace

lavish wing
lavish wing
dry yacht
chrome beacon
# lavish wing huh?

Line 32 in your SkyGrid class is in the stacktrace. There is no code on line 32

lavish wing
#

Java Compiler moment

quiet ice
signal kettle
# remote swallow sysout the action

Okay so I belive you mean this:

    @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
    public void Backpack(final PlayerInteractEvent event) {
        Player player = event.getPlayer();

        if (event.getHand().equals(EquipmentSlot.HAND)) {
            System.out.println("Player used HAND");
            return;
        }
        if (event.getAction() == Action.RIGHT_CLICK_AIR) {
            System.out.println("Player used RIGHT_CLICK_AIR");
            return;
        }
        if (player.getInventory().getItemInMainHand().getType() == Material.IRON_HORSE_ARMOR) {
            System.out.println("Player have IRON_HORSE_ARMOR in Main Hand");
            player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
            Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack " + player.getName());
        }
    }
dry yacht
lavish wing
chrome beacon
#

Line 33 doesn't have code either

signal kettle
#

and now: It's still not work when i click in air and no print line in console, when i click on block with right click then I get in console:

02.02 18:18:54 [Server] INFO [STDOUT] Player used HAND
02.02 18:18:54 [Server] INFO [STDOUT] Player have IRON_HORSE_ARMOR in Main Hand
#

so it checks Hand slot and if item in hand but not the RIGHT CLICK AIR

dry yacht
# lavish wing Yes

Sure thing. It's not like the lexer knew where the token was in the file and just handed that information over to the compiler to include it in the debug information. I'm sure it just rolled dice on your line-numbers, xDDD.

dry yacht
rough drift
remote swallow
lavish wing
lavish wing
haughty granite
dry yacht
tardy delta
#

or use a try with resources

haughty granite
tardy delta
#

try (Resource r = getResource()) { resource.use() } and it gets closed when scope ends

vagrant stratus
#

I'm trying to get two armor stands two move between two locations.
It works properly with a single entity, but has sync issues once two are involved

Ignoring the lack of any sort of proper API for animations or the holograms in general, here's the code lmao: https://paste.md-5.net/gadaguzuku.cs

remote swallow
#

optic? in help dev? shocked_ghast

vagrant stratus
#

I've been here before @remote swallow lmao

remote swallow
#

lies

tardy delta
#

scared

dry yacht
tardy flame
#

How the hek

#

this resource got accepted

#

into premium

tardy delta
#

10 dollar 💀

lavish wing
#

@chrome beacon Maybe this is an error?

net.minecraft.server.Chunk chunk = new net.minecraft.server.Chunk(((net.minecraft.server.World) Bukkit.getWorld("world")), result, i, i1);
tardy delta
#

bunch of idiots

tardy flame
#

Yeah!

#

That's premium

#

Don't you see

vagrant stratus
#

I m trying to get two armor stands two

tardy flame
#

🫠

dry yacht
# tardy delta

I thought that was how the concept of premium resources worked? No?

vagrant stratus
tardy delta
#

why would you pay 10 bucks for smth you can make in half an hour

vagrant stratus
#

Yes, and?

tardy flame
#

You shall buy this premium plugin!

#

See how great it is

vagrant stratus
#

We're not looking for only the best plugins to make premium

tardy flame
#

Man, it's literally 25 kb

tardy delta
#

so?

vagrant stratus
#

10kb limit

echo basalt
#

10kb is nothing

#

I'd say 30kb should be the minimum

quiet ice
#

Anything under 10kb would be impressive

echo basalt
#

because like

#

my entire menu engine is maybe 50kb

tardy delta
#

10kb ram 🤓

echo basalt
#

It's not hard

signal kettle
# remote swallow just sys out event.getAction

So sorry to get your time but how to? You mean like that:

    @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
    public void Backpack(final PlayerInteractEvent event) {
        Player player = event.getPlayer();

        if (event.getAction().equals(Action.RIGHT_CLICK_AIR)) {
            System.out.println("Player used RIGHT_CLICK_AIR");
            return;
        }
        player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
        Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack " + player.getName());
    }
}
tardy flame
vagrant stratus
#
"Low Effort" resources may be rejected.

    This is entirely at the discretion of the reviewer, however "Low Effort" resources include those:
        With less than 10kb of code.
        Contain beginner programming mistakes.
        Are similar to those produced by tutorials or examples.

within this part of the guidelines, it's still valid lol

quiet ice
#

I've seen some of the Achy's previous plugins, their quality were VERY dubious - not sure if they have improved over the months

#

I sure do hope so

vagrant stratus
#

now then, back to figuring out why I can't sync two entities movement properly lmao

remote swallow
#

no need for the if check

tardy delta
#

naming conventions where

vagrant stratus
#

?

tardy flame
tardy delta
#

you think i cant read or smth

tardy flame
#

No it's Backpack

#

it's on higher level

#

We can't understand it

#

But this guy created his own convention

#

Backpack convention

dry yacht
signal kettle
vagrant stratus
remote swallow
tardy flame
#

But then 25,8kb is too large for single method

tardy flame
#

Or...

icy monolith
#
        <dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.19.3-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
            <groupId>com.sk89q</groupId>
            <artifactId>worldedit-bukkit</artifactId>
            <version>7.2.0</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</project>```

Why does it send an error for <groupid> in <groupId>com.sk89q</groupId>
tardy flame
#

Maybe they just added maven thingies

dry yacht
tardy flame
#

so it's like unused data

remote swallow
#

each dep gets its own tag

#

in the global tag

tardy delta
#

damn it has char support

tardy flame
#

why isEven('3');
returns false

tardy flame
#

kind of stupid

vagrant stratus
tardy flame
#

it should convert to decimal

#

and then check

tardy flame
icy monolith
vagrant stratus
#

16 classes actually

remote swallow
quiet ice
remote swallow
vagrant stratus
quiet ice
vagrant stratus
#

idk either lmao

remote swallow
vagrant stratus
#

even tried to ChatGPT it, didn't work lol

tardy delta
#

chatgpt broke my driver so wouldnt trust on it

tardy flame
#

ChatGPT has too little bukkit/spigot data

vagrant stratus
#

Actually, I've found it fine for certain things, just not in this case lmao

tardy flame
#

I asked it to create listener class for spigot plugin in minecraft java and it responded that it's unavailable

#

:C

#

Such a silly

quiet ice
#

also what sort of out-of-sync are we talking about?

icy monolith
#
        <dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.19.3-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sk89q</groupId>
            <artifactId>worldedit-bukkit</artifactId>
            <version>7.2.0</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</project>```
I did it like this, but now 
            <groupId>com.sk89q</groupId>
            <artifactId>worldedit-bukkit</artifactId>
            <version>7.2.0</version>
is an error
tardy delta
#

mvn reload

quiet ice
icy monolith
#

ok

quiet ice
#

Also compile is the wrong scope

#

You want it to be provided, otherwise you might accidentally shade worldedit into your plugin, which is a big no-no

vagrant stratus
icy monolith
#

idk im so confused lmao. I reloaded it and its still an error

#

idk if i even reloaded it the right way

vagrant stratus
#

Gimme a sec and I can do a video lol

icy monolith
#

i just put the command in console

vagrant stratus
icy monolith
#

intelliJ console

quiet ice
dry yacht
vagrant stratus
#

Correct, which they do, but they end up getting out of sync in terms of movements

#

I'll do a quick video lmao

icy monolith
dry yacht
quiet ice
#

@vagrant stratus it probably is related to the armour stands not starting within their path but outside of it (i.e. 2 / 1.75 blocks below)

signal kettle
# remote swallow System.out.println(event.getAction);

Get nothing in console when right click or any get action when set like this:

    @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
    public void Backpack(final PlayerInteractEvent event) {
        Player player = event.getPlayer();

        if (event.getAction() == Action.RIGHT_CLICK_AIR && player.getInventory().getItemInMainHand().getType() == Material.IRON_HORSE_ARMOR) {
            System.out.println(event.getAction());
            player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
            Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack " + player.getName());
        }
    }
}

When set like this:

    @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
    public void Backpack(final PlayerInteractEvent event) {
        Player player = event.getPlayer();

        System.out.println(event.getAction());
        player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
        Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack " + player.getName());
    }
}

Then but only when clicked on block
02.02 18:46:30 [Server] INFO RIGHT_CLICK_BLOCK
02.02 18:46:30 [Server] INFO RIGHT_CLICK_BLOCK

quiet ice
#

but I guess a video would give clarity

quiet ice
#

Show us your repositories block

dry yacht
vagrant stratus
#

hold plz lol

quiet ice
vagrant stratus
#

gotta upload to YT

vagrant stratus
quiet ice
#

make 0.25 evenly divisble by your increment/decrement

#

0.25 is not evenly divisble by 0.1, thus causing your issue

quiet ice
echo basalt
#

ah fuck it I hate this code

vagrant stratus
#

@echo basalt Yea, I need it working before I get a properly made api created lol

#

Only difference between then and now is they're now teleported to the starting point first

dry yacht
quiet ice
echo basalt
#

I think you have a 1 tick offset provided by that replace function

signal kettle
#

Got fixed it by my self, set priority to HIGHEST and remove ignoreCancelled!

    @EventHandler(priority = EventPriority.HIGH)
    public void Backpack(final PlayerInteractEvent event) {
        Player player = event.getPlayer();

        if (event.getAction().equals(Action.RIGHT_CLICK_AIR)) {
            if (player.getInventory().getItemInMainHand().getType() == Material.IRON_HORSE_ARMOR) {
                System.out.println(event.getAction());
                player.playSound(player.getLocation(), Sound.BLOCK_GLASS_BREAK, 100, 1.0F);
                Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "cosmetic apply backpack " + player.getName());
            }
        }
    }
}
dry yacht
quiet ice
#

It defo has something to do with teh current.getY() >= start.getY() check though but no idea in the specifics. Could be strange floating point behaviour but that shouldn't be as noticable

signal kettle
lost matrix
vagrant stratus
vagrant stratus
echo basalt
#

well

#

define a hardcoded offset?

vagrant stratus
#

That's what I've tried to do lol

lost matrix
#

Wait those are not done with packets? PES_Yikes

vagrant stratus
#

No lmao

dry yacht
#

Isn't it because you first teleport and then check bounds? So the first overshoots first, then get's it's direction changed at the next tick, and thus is always one delta ahead?

twilit roost
#

How can I check if 2 strings are similar?
S1 - world_nether
S2 - world_*

How can I check that S1 is similar to S2?

I tried replacing * with Ø and then checking if S1 starts with S2
but it didn't work for me

vagrant stratus
quiet ice
#

what the hell is Ø

twilit roost
#

nothing
blank

dry yacht
twilit roost
vagrant stratus
#

Mojang native hologram when

quiet ice
twilit roost
#

yep

quiet ice
#

.startsWith should work then - how did you call that check?

twilit roost
#

and then s1.startsWith(s2)

vagrant stratus
quiet ice
dry yacht
twilit roost
#

ConfigTab#getWorlds returns all entries in config, therefore also world_*
world being just Player#getWorld#getName

vagrant stratus
quiet ice
#

The two armourstands should theoretically always have the same distance to each other according to the code

vagrant stratus
#

Yea, but my guess is they're ticked at a large enough difference that it doesn't matter lmao

quiet ice
#

the length of the path (4.0) is visible by 0.1 - so that is not the issue either.

vagrant stratus
quiet ice
#

try to add a very minute (like 0.001) amount ontop of start, end, start2, etc. respectively - that would factor out strange floating point operations

vagrant stratus
#

y coord I assume?

quiet ice
#

Yeah

#

X/Z shouldn't matter

rotund ravine
quiet ice
#

that is basicallly useless for similarity comparision

rotund ravine
#

K

quiet ice
#

comparing the similarity of two words is basically impossible without some big brain moment or hacky workarounds

vagrant stratus
#

just check char by char lol

twilit roost
#

Turns out I just had some bug with the ret of my code.
The way I mentioned works fine

sonic sparrow
#

Is it possible to use a custom jar with specialsource-maven-plugin? Build tools doesnt have the proper mappings that my jar has, how can i go about getting the proper mappings passed through the maven plugin?

vagrant stratus
# quiet ice Yeah

Didn't work but it seems like the issue is the bump it gets from reaching either location

quiet ice
#

doesn't make much sense to me as both armour-stands should have that bump at the same point but it seems as if that wasn't the case

vagrant stratus
quiet ice
#

is cannot find a reasonable explaination for that behaviour though

sonic sparrow
#

do the armor stands have collision?

vagrant stratus
#

inb4 that's it lmao

sonic sparrow
#

That looks like a velocity push from collision

vagrant stratus
#

seems to happen even w/ entity.setCollidable(false);

quiet ice
rough drift
quiet ice
#

You need to have some kind of mappings at hand, otherwise it won't work

sonic sparrow
#

Just a fork

quiet ice
#

If it is a fork of paper I'd use paperweight instead - at which point you'd have to ditch maven but a small price to pay for usability

#

Otherwise you can just hope that they didn't change too much about the mappings and use spigot mappings anyways

#

It'd would have the same setup as for spigot just transforming a different artifact (but using the same map)

vagrant stratus
sonic sparrow
#

So you are saying just use reobfuscated jar instead of remapping it?

quiet ice
#

uh, alternatively you could use the mojmap jar yeah - but that would be dangerous in conjunction with different plugins

quiet ice
#

csrg are probably not generated by forks of paper

#

although idk really

vagrant stratus
quiet ice
#

I have never worked with this outside of looking at it very briefly

quiet ice
#

csrg is basically some old mappings format similar to tiny iirc

#

?stash although, lemme check in an in-depth manner before I tell absolute stupidity

undone axleBOT
quiet ice
#

And they don't adhere to the tiny format before you insert a tinyv2 file into that arg

vagrant stratus
#

also noticed I didn't disable collision for both of them, and yea collision's not the issue lol

haughty granite
#

I generate random codes that I have to retrieve in a text file, the code works very well

#

but is there a cleaner way to do it?

haughty granite
#

codes is HashSet<String>

rough drift
#

I mean not really I guess

#

other than

vagrant stratus
rough drift
#
var file = ...;

try(var writer = new FileWriter(file)) {
  for(var code : codes) {
    writer.write(code);
    writer.write("\n");
  }
}
vagrant stratus
#

getting it to stop a tick earlier, they're all in the same animation method. ig a boolean 🤷‍♂️

rough drift
#

Yeah

#

try that

vagrant stratus
#

actually, it's not even tick based by y cord based so the best I could do is stop it a y coord sooner, but there'd still be the bump

rough drift
#

that's the point

#

abuse the bump as a way to still make it go up

vagrant stratus
#

ig abuse the bump for it to go down too

#

happens for both start & end locations kek

rough drift
#

yeah

#

Try using that

#

it might work surprisingly well

vagrant stratus
#

or not lmao

#

we'll see

rough drift
#

hence

#

might

twilit roost
vagrant stratus
#

oh well now it just breaks it entirely, probably my end lmao

vagrant stratus
#

I'll worry about porting it to a library for now and releasing that, then it can be looked at better

haughty granite
#

File fileCodes = new File(pathToPluginFolder + "/codes-" + System.currentTimeMillis() + ".txt");
is there any way to get the path of the plugin folder (pathToPluginFolder) ?

remote swallow
#

that seems like a bad idea to make 1 file, in 1 folder

#

and probably have hundreds of them

haughty granite
#

what do you suggest?

remote swallow
#

create a folder in your data folder called "codes" or whatever you choose and store there

lost matrix
haughty granite
remote swallow
#

not the plugins directory

lost matrix
#

What are you saying? XD

remote swallow
#

if i had a plugin called InsaneData or whatever getDataFolder would get the InsaneData folder not plugins folder

haughty granite
#

new File(getDataFolder() + "/codes-" + System.currentTimeMillis() + ".txt");

#

hahaha I can't find it

lost matrix
#

It will resolve to server/plugins/YourPluginName

remote swallow
#

yeah

remote swallow
haughty granite
remote swallow
#

yeah

#

you probably want to change it from making a new folder for each to use 1 folder and make a new text file there for each

dry yacht
vagrant stratus
#

Good thing we've cleared that up lol

lost matrix
vagrant stratus
#

hold on, I'll zip up the relevant classes lol

dry yacht
dry yacht
vagrant stratus
#

no kek

#

hold plz lol

dry yacht
#

I'd just use your first attempt but only apply it to the first armor stand of the list of lines. Then, iterate from 1 till end and add your offset to the head location each time. You can use that method exactly as it is, you just need to add moving the other armor-stands right after teleporting the head.

vagrant stratus
#

Ah, it'll only be a single subline but it should still work lol

dry yacht
#

I was talking about the general solution, but yes, in your case it would be enough to just pass in the single other entity and teleport that at the first one's offset y.

dry yacht
vagrant stratus
#

lets see if I can manage to impl it properly lmao

dry yacht
#

It should be add .1 both times actually, or subtract, depending on growth-direction

lost matrix
# dry yacht Not sure if I understand what you mean, but sure. One location, propagate moves ...

Here is an example ive made up just now

public interface IHologram {

  Location getLocation();
  
  void teleport(Location location);
  
  void addLine(String line);
  
  int size();
  
  String getLine(int index);

  void removeLine(int index);

}
public class SomeHologram implements IHologram {

  private final List<HologramLine> hologramLines = new ArrayList<>();
  private Location location;

  @Override
  public Location getLocation() {
    return null;
  }

  @Override
  public void teleport(Location location) {
    Vector direction = location.toVector().subtract(this.location.toVector());
    hologramLines.forEach(line -> line.teleport(line.getLocation().add(direction)));
  }

  @Override
  public void addLine(String line) {
    // Some stuff
  }

  @Override
  public int size() {
    return 0;
  }

  @Override
  public String getLine(int index) {
    return null;
  }

  @Override
  public void removeLine(int index) {
    // Some stuff
  }
}

You never touch the lines externally. You should always just call your IHologram methods which
handle the specific functionality.

Thats a very decent design approach: Think about what you want the class to achieve and then
write an interface without any implementations.

vagrant stratus
#

tbf I did say I don't have a proper api impl'd lol

dry yacht
vagrant stratus
#

Plus once working I can just rewrite it to be OOP kek

pseudo hazel
#

why

dry yacht
#

That's the thing. Always get to know your problem domain first, build a pice of shit, and then start polishing it. The architecture is not going to solve your math problem, xD.

pseudo hazel
#

just write it to be readable

lost matrix
vagrant stratus
#

It's already partly OOP. I just don't have the animations tasks and such split into separate files @lost matrix

pseudo hazel
#

this is oop enough imo

#

unless each of these files is like 1000s of lines

dry yacht
#

I just want your lines to move properly... :( My god, what are we getting into here.

vagrant stratus
#

i dev against spigot though, reee (╯°□°)╯︵ ┻━┻

pseudo hazel
#

I just want to make some transistors flip in my pc, how hard can it be

dry yacht
lost matrix
pseudo hazel
#

wtf are all these I's for

#

do you work for apple

vagrant stratus
remote swallow
#

smh optic

lost matrix
remote swallow
#

bukkit scheduler better

rough plover
#

someone can help me?

pseudo hazel
#

sad standard

#

idk

#

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

remote swallow
#

smh 7

dry yacht
lost matrix
#

Wait wrong command. Ive been away for too long

vagrant stratus
# pseudo hazel this is oop enough imo

I'll most likely OOP the animation stuff specifically, that way animations can be cleanly added. They're currently just shoved into a single method lmao

remote swallow
#

you ahve

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!

tardy flame
dry yacht
tardy flame
#

I do

pseudo hazel
#

no

#

why would I

remote swallow
#

not normally

pseudo hazel
#

whats the point

tardy flame
#

Especially IInventory...

#

Double I

#

That's what I love

#

💕

pseudo hazel
#

i dont use it any differently from other classes

vagrant stratus
#

I never use I for interfaces or anything like that

pseudo hazel
#

when writing with it

vagrant stratus
#
    public void addLineBelow(String line) {
        ArmorStand entity = (ArmorStand) armorStand.getLocation().subtract(0, 0.25, 0).getWorld().spawnEntity(armorStand.getLocation(), EntityType.ARMOR_STAND);
        entity.setGravity(false);
        entity.setCanPickupItems(false);
        entity.setCustomName(line);
        entity.setCustomNameVisible(true);
        entity.setCollidable(false);
//        entity.setVisible(false);
        lineBelow = entity;
    }
compact haven
#

it doesn’t tend to matter

lost matrix
#

Helps separate abstraction layers. But as stated before: Its an old habit. Microsoft still uses this standard.

vagrant stratus
#

guessing it's the way I'm just spawning it in now lmao

compact haven
#

For example, every spigot class that you work with is an interface, but none are prefixed with I

pseudo hazel
#

yeah microsoft is an old habit

pseudo hazel
#

and besides, your IDE will already let you know what it is due to the icon

vagrant stratus
#

actually, might be the start location 🤔

twilit roost
#

When player eats GApple, how can I add into count ( of total health ) those yellow hearths?

dry yacht
# lost matrix I whish i could stop but im too "indoctrinated"

You just don't understand what I was getting at. It does not help at all to write a clean architecture if the way you think about holograms is way off. It was completely evident from the way we (geol, optic and me) tried to solve the tracking issue that we've overcomplicated the situation and didn't think about the straight forward way of a head which just moves the remaining lines relative to it.

Once that works on optic's end, they can still improve the design. But why would you solve somebody's logic issue through OOP, if they literally write application specific software which always only has two lines. People don't learn anything about their mistake this way, if you're always just gonna hit them with "your architecture is wrong". Just fix the issue, then let them refactor themselves once they wrapped their head around it.

pseudo hazel
#

or w/e its called

lost matrix
#

As numeric value

twilit roost
#

yes

vagrant stratus
dry yacht
vagrant stratus
vagrant stratus
twilit roost
lost matrix
#

?1.8

undone axleBOT
lost matrix
dry yacht
# vagrant stratus but yea, this is the current issue lol

What's the issue there? I'm kinda having a hard time spotting something. It seems a bit weird to subtract from the location that way, but I guess it works because the evaluation order first has to subtract, get the world, spawn the entity, and by then the parameter should be already affected. I'd just extract that to another line above, as it's really dense.

unborn kiln
#

Is there a way to make it so that if a player jumps with multiple armor stands behind them that the first one will go up with the player then the rest will flow behind it and go up with a player down the line? Kind of like the origin realms balloons that are in a line like the train balloon. Here's the origin realms balloons. Is there a way to do this with inverse kinematics but only use it on the y axis and not all 3 axis?

pseudo hazel
#

intense

unborn kiln
pseudo hazel
#

I mean tell me its not

unborn kiln
#

very suspenseful ngl

dry yacht
lost matrix
dry yacht
#

Looks like gravity and collisions aren't off for both of them

vagrant stratus
#

they are off lmao

lost matrix
#

Are you sure?

vagrant stratus
#

managed to screw up the placement too, lemme clean up the hologram class real quick and I'll send that as well as the current code

#
entity.setGravity(false);
        entity.setCanPickupItems(false);
        entity.setCustomName(line);
        entity.setCustomNameVisible(true);
        entity.setCollidable(false);

For both of them, pretty sure

lost matrix
#

Btw i would still use a Location which is not bound to an object and then simply move every object relative to that location

unborn kiln
vagrant stratus
#

These will be player placed, so it'll have to be bound

lost matrix
#

Wait do you want to additionally add the y axis or only use the y axis?

unborn kiln
#

couldn't you make it separately from the other 2 axis?

lost matrix
#

Huh?

unborn kiln
#

nevermind, I'm dumb. I think I know how I'll do it

vagrant stratus
unborn kiln
vagrant stratus
#

Correct, it's the relevant code anyways

unborn kiln
#

Would a sin curve be better for the up and down animation?

vagrant stratus
#

Couldn't tell you

unborn kiln
#

I feel like the math would be a lot more compact and efficient imo

#

but if it works it works

vagrant stratus
#

Well I can't do math regardless kek

dry yacht
unborn kiln
dry yacht
#

Not only that it's way easier, it would also be symmetrical by default and feel more natural.

unborn kiln
dry yacht
#

Well, that depends on your angle step size

vagrant stratus
#

No idea how to impl lmao

unborn kiln
#

here ya go, that's my method at least

dry yacht
vagrant stratus
vagrant stratus
lost matrix
# unborn kiln here ya go, that's my method at least

You should probably add a parameter for the frequency of your wave.
With a too small values all armorstands will look like they oscilate with the same freq (bc you are looking at a small portion of the wave)
And a too high value will look completely random

lavish wing
haughty granite
#

in my command to duplicate items, if I duplicate more than 27, the items do not drop to the ground

#

I have a thought : I check if the inventory is empty, if yes, instead of adding it to the inventory I drop the item on the ground

#

is there an easier way?

lost matrix
dry yacht
haughty granite
desert tinsel
#

why I get NullPointerException while trying to add into an arryalist a custom serializable object?

#

if the object isnt serializable, I dont get the error

lost matrix
lost matrix
#
  • did not test
#

update to latest version and hope they fixed the vuln there

haughty granite
#

How can I save items, via a HashSet?

desert tinsel
remote swallow
#

i have this exact same method, without the foreach

#

just as a for loop instead

lost matrix
#

lol i just made that up ^^
But it looks like a decent util method

desert tinsel
#

not the object is null, but the arraylist is

lost matrix
desert tinsel
#

i solved it

dry yacht
desert tinsel
#

thx

vagrant stratus
#

If it still doesn't work then idfk

haughty granite
pseudo hazel
#

thats an ItemStack[]

lost matrix
desert tinsel
#

actually how can I make my plugin to have a smaller size?

pseudo hazel
#

are you using maven?

desert tinsel
#

yep

lost matrix
pseudo hazel
#

how big is it now

desert tinsel
#

12mb

vagrant stratus
dry yacht
#

:-:

pseudo hazel
#

how

#

mine is like 300kb

haughty granite
remote swallow
dry yacht
lost matrix
desert tinsel
#

I'm shading it only by using the run button of intellij idea

remote swallow
#

the what button

vagrant stratus
#

If this works @dry yacht then it's just a matter of rewriting to use those classes :p

undone axleBOT
lost matrix
dry yacht
desert tinsel
lost matrix
remote swallow
#

what do you run on that

desert tinsel
#

a maven build

remote swallow
#

use package

haughty granite
remote swallow
#

minimize

#

does the lib use nms?

desert tinsel
remote swallow
#

just minimize on the project that uses the lib

lost matrix
pseudo hazel
#

yeah, how are you going to use the method sylfaen?

dry yacht
#

Processed annotations should not be shaded, as the compile-scope does.

vagrant stratus
#

Yea @dry yacht that works, so it looks like I'm gonna be rewriting my Hologram & Animation implementation lmao

haughty granite
lost matrix
dry yacht
#

transitive dependencies probably. That's why I don't trust the maven shade plugin to decide by itself and always specify all shaded artifacts myself. Opt-In rather than Opt-Out or AutoDetect.

vagrant stratus
#

Gonna lower the tick speed it takes to update, if it breaks then, then that'll be the issue in general lol

dry yacht
remote swallow
#

one moment

dry yacht
#

Run proguard for dead code elimination, lol

remote swallow
#

in the configuration of shade add <minimizeJar>

vagrant stratus
remote swallow
#

well that would reduce some of the size

dry yacht
haughty granite
vagrant stratus
#

looks like all I need to do now is rewrite the animation & hologram api to make use of the code you provided

lost matrix
# haughty granite I'm learning as I go along, I assume that you should declare an ItemStack[] rath...

In which case you can write a overload method:

  public static void giveOrDrop(Player player, Collection<ItemStack> items) {
    giveOrDrop(player, items.toArray(new ItemStack[0]));
  }

  public static void giveOrDrop(Player player, ItemStack... items) {
    World world = player.getWorld();
    Location loc = player.getLocation();
    player.getInventory().addItem(items).values().forEach(overflown -> world.dropItem(loc, overflown));
  }

Usage:

    Player player = ...;
    Set<ItemStack> someCoolItems = Set.of(new ItemStack(Material.STONE), new ItemStack(Material.DIAMOND));
    TheUtilClass.giveOrDrop(player, someCoolItems);
dry yacht
#

What's this?

lost matrix
dry yacht
#

I thought you said that your jar gets bigger when you add your lib? Did I misunderstand you?

#

Ah, as usual, xD.

#

Could you try to explain that again real quick?

#

Oh

lost matrix
#

Add <scope>provided</scope> to all dependencies you dont want to shade

haughty granite
dry yacht
#

Tbh, I'm not sure, but I don't think that this overrules the scope of transitive dependencies.

lost matrix
#

Is your lib standalone or do you need to shade it?

dry yacht
#

So you're shading it.

lost matrix
#

If its plural then you should 100% make it a standalone plugin.

#

What else do you have in your lib?

#

You must be shading a ton

#

lombok, jetbrains annotations, spigot api <- those should not be shaded

dry yacht
#

Have you had a look at the dependencies section of your IDE's maven panel yet? You should see all the mess you inherit there.

lost matrix
#

also lombok is an annotation processor. There is nothing to shade

dry yacht
#

Project

#

Where you include the lib that causes trouble in regards to final jar size

lost matrix
#

In your lib: Add <scope>provided</scope> to at least the spigot api

#

Build your lib and tell me its size

dry yacht
#

You could also just decompile the jar and have a look at what's in there, xD

lost matrix
#

Alright now build your plugin which depends on your lib and show its size as well

#

Because your lib surely does not contribute 12mb to it

vagrant stratus
#

Ah @dry yacht can you make it work off of local coords real quick

public static Location getLocalCoord(double x, double y, double z, Location origin) {
        Location arrival = origin.clone();

        Vector dirX = new Location(arrival.getWorld(), 0, 0, 0, Location.normalizeYaw(arrival.getYaw() - 90), arrival.getPitch()).getDirection().normalize();
        Vector dirY = new Location(arrival.getWorld(), 0, 0, 0, arrival.getYaw(), arrival.getPitch() - 90).getDirection().normalize();
        Vector dirZ = arrival.getDirection().normalize();

        return arrival.add(dirX.multiply(x)).add(dirY.multiply(y)).add(dirZ.multiply(z));
    }
dry yacht
#

What's normal about that? 10KB + 69KB != 236KB. Something's off, :-:

vagrant stratus
#
Location currLoc = hologram.armorStand().getLocation();
        Location start = Utils.getLocalCoord(0, 4, 0, currLoc);
        Location end = Utils.getLocalCoord(0, 2, 0, currLoc);
dry yacht
#

What are local cords?

#

'a'.repeat(Integer.MAX_VALUE) at you for not just frickin decompiling that thing and checking out what's actually being shaded

lost matrix
vagrant stratus
dry yacht
rough drift
#

unsetting vs setting a permission to false?

remote swallow
#

unsetting would take default so could also be true still iirc

rough drift
#

so setting it to false would not allow default?

remote swallow
#

shouldnt™️

vagrant stratus
dry yacht
vagrant stratus
#

Lmao

#

Yours seems to be going off of world coords, not entity

dry yacht
#

Yes, you want to track it to an entity, I guess, right?

vagrant stratus
#

In my case yes, it would be going off entity coords. But might as well allow both and I can shove this all into a clean public API

frank kettle
#

anyone knows how bundles show the items inside when hover it in the inventory?

vagrant stratus
#

Going off entity coords allows limiting to a specific radius around the entity itself

rough drift
# remote swallow shouldnt™️

Wait so

attachment.setPermission(perm, true); // the permissible of this attachment will return true for perm
attachment.setPermission(perm, false); // the permissible of this attachment will return false for perm
attachment.unsetPermission(perm); // the permissible will return the default for perm or false if no default
```correct?
lost matrix
# vagrant stratus Goes off of whatever location's passed
  private static Vector vectorFromRotations(double pitch, double yaw) {
    return new Vector(Math.sin(pitch) * Math.cos(yaw), Math.sin(pitch) * Math.sin(yaw), Math.cos(pitch));
  }
  
  public static Location getLocalCoord(double x, double y, double z, Location origin) {
    Location arrival = origin.clone();
    
    Vector dirX = vectorFromRotations(arrival.getPitch(), Location.normalizeYaw(arrival.getYaw() - 90));
    Vector dirY = vectorFromRotations(arrival.getYaw(), arrival.getPitch() - 90);
    Vector dirZ = arrival.getDirection().normalize();

    return arrival.add(dirX.multiply(x)).add(dirY.multiply(y)).add(dirZ.multiply(z));
  }

No need to create a bunch of location objects. The only question now is: What the heck is a local coord?

vagrant stratus
#

Entity coord +/- loc, global being world +/- loc

remote swallow
#

if that mimics it yes

rough drift
#

should

dry yacht
lost matrix
vagrant stratus
#

sorta just fucks off to space atm even though I'm trying to limit it to a small area above where it's placed, regardless of location

dry yacht
vagrant stratus
dry yacht
#

It's just that I'm having a really hard time wrapping my brain around the thoughts of people other than myself, xDD. I can always only provide a proof of concept, but hardly ever fix the stuff another person wrote, :-:

#

It's like so many layers deep already and I'm missing so many bits and pieces.

#

Communication is hard, haha

vagrant stratus
dry yacht
dim bluff
#

hey, my test server is on offline mode, but i got a premium account, and even buying the game i'm getting the wrong UUID when I join the server. How can I make so premium players get real UUID and cracked players get fake UUID? (i need the fake one for my test account)

vagrant stratus
#

I'll ask ChatGPT to explain global/local coords lmao

dry yacht
vagrant stratus
#
In Minecraft, coordinates are used to specify the position of an object in the game world. There are two types of coordinates: local and global.

A local coordinate system refers to the coordinate system of a specific object or entity, such as an Armor Stand. In the context of an Armor Stand, the origin (0,0,0) of its local coordinate system is located at its feet, and its x, y, and z axis extend outwards from its body. The position of any point on or within the Armor Stand can be described in terms of its local coordinates.

A global coordinate system, on the other hand, refers to the coordinate system of the entire Minecraft world. The origin (0,0,0) of the global coordinate system is located at the bottom-left corner of the world, and its x, y, and z axis extend to the right, up, and forward, respectively. The position of any object or entity in the Minecraft world, including an Armor Stand, can be described in terms of its global coordinates.

So, in summary, local coordinates specify the position of an object relative to itself, while global coordinates specify the position of an object relative to the entire game world.

@dry yacht @lost matrix

vagrant stratus
#

lmao

#

This just happens to be how I found it kek

dry yacht
#

My lord, :-: When I hear local and global I think about analysis of functions, but not about coordinates relative to another point, haha

lost matrix
#

Ok but the Location object is always a global coordinate. No exceptions. Local coordinates are represented using Vectors.

dim bluff
lost matrix
dim bluff
lost matrix
#

You can resolve the uuid from a players name using mojangs api

dim bluff
#

thank you

lost matrix
dry yacht
vagrant stratus
#

Already working on properly OOPing this lol

dry yacht
dry yacht
# vagrant stratus Already working on properly OOPing this lol

Just write it in a data-oriented, clean and concise way. If that involves standard OOP practises, it's good, but there's no need to force anything just because it's what's socially accepted.

You need to figure out in which ways your structure is limiting you, that's the only way you'll learn good architecture. I've seen so many big projects with spot on OOP practises which were still rotting under the hood... If OOP was the solution, modern computing wouldn't be the steaming pile of shit it actually is.

vagrant stratus
#

Oh trust me, the animations alone could probably be more OOP to allow extra expansion in that regard

#

they're currently all shoved in a single method and multiple BukkitRunnable's lmao

dry yacht
vagrant stratus
#

And that's what I'm most likely gonna be OOPing lmao

Most likely AnimationTask, a manager or something to handle them, and then each animation just extends AnimationTask

pseudo hazel
#

ah yes so then its still shoved in runnables, it will just be harder to trace them all back

rough drift
#

Hard to find runnables

#

Hidden runnables

pseudo hazel
#

yeha fr

#

we need a new diagram, a thread diagram that shows at which point how many runnables deep you are in the code

rough drift
#

If you see my code I'll be at least 96 lambdas deep with 7 runnables

rotund ravine
#

@rough drift Are oyu the slimefun guy?

rough drift
#

no

#

why would I be

#

I only ever seen SF4 once

rotund ravine
#

thank god

rough drift
#

wdym

#

what happened with the SF guy

remote swallow
#

what would be be better to do for language stuff, make an enum with valid languages or accept any string and convert that to a valid language or default if not found

rough drift
#

e n u m

#

or string and use gapi to translate

remote swallow
#

gapi

rough drift
#

google api

#

shut

final monolith
#

?paste

undone axleBOT
final monolith
rough drift
#

for you see, just remove the scope

#

and it shall work

final monolith
#

already tried that

rough drift
#

Also may I add your pom made me want to bleed my eyes out, cover them in acid and let them dry staring right at the sun

final monolith
#

xD

remote swallow
#

it hurts

rough drift
#

You should really use the intelij mc plugin

remote swallow
#

even got system scope stuff Pepe_Shoot

final monolith
rough drift
#

intellij has a plugin for mc

final monolith
rough drift
#

it's really fucking handy

final monolith
remote swallow
rough drift
#

generates the pom for you

rough drift
remote swallow
#

you shouldnt need to shade gson, spigot comes with a version

rough drift
#

Intellij Minecraft Dev plugin or smt

remote swallow
#

ye

final monolith
#

2.10+

rough drift
#

k

pseudo hazel
#

skill issue

remote swallow
#

well to me

#

it looks like you dont relocate

final monolith
#

i dont want relocate

#

it doesn't works for my purpose

ivory sleet
#

why would you not want to relocate

#

just out of curiosity

lost matrix
#

How do you expect to use your version if you dont relocate?

final monolith
dry yacht
lost matrix
#

Yeah kind of messy

vagrant stratus
#

So. much. to. rewrite. lmao

remote swallow
#

do it quicker

vagrant stratus
#

Can't lol

crimson relic
#

do it slower then

vagrant stratus
#

At this rate, I am lmao

Currently trying to figure out why the subline isn't being updated, I'm assuming it's just an order of operations thing at this point lol

#

so much shit going on now that it's no longer limited to a specific method lol