#help-development

1 messages · Page 2232 of 1

worn tundra
#

You should just the Material enum (ItemStack.getType) and turn that to a string (Material.toString), then do the rest

winged birch
# worn tundra You should just the Material enum (ItemStack.getType) and turn that to a string ...

Thanks! I did it as follows, don't know if this is the proper way of doing it

    @EventHandler
    public void onOreDestroyed(BlockBreakEvent e) {
        var pickaxes = Arrays.asList(
                Material.NETHERITE_PICKAXE,
                Material.DIAMOND_PICKAXE,
                Material.GOLDEN_PICKAXE,
                Material.IRON_PICKAXE,
                Material.WOODEN_PICKAXE);

        var itemInMainHand = e.getPlayer()
                .getInventory()
                .getItemInMainHand()
                .getType();

        if (e.getPlayer().getGameMode() == GameMode.SURVIVAL
            && pickaxes.contains(itemInMainHand)) {
            e.getPlayer().sendMessage("You a pickaxe equipped");
        }
    }
worn tundra
winged birch
#

awesome, I like yours better, thanks!

eternal oxide
#
if (Tag.MINEABLE_PICKAXE.isTagged(itemInMainHand)) {...```
#

type not the actual item

winged birch
eternal oxide
#

yes

winged birch
#

thank you!

eternal oxide
#

oh no sorry wrong tag, thats for blocks mineable BY a pickaxe 😦

#

you will have to use Septicuss version

winged birch
#

gotcha, thanks for the explanation

tardy delta
#

ah i see ElgarL has smth too

tender shard
#

no well I meant, it doesn't provide the data in the "PDC" format. his lib also uses PDC to store information but doesn't allow you to retrieve it as a PDC container

eternal oxide
#

are you trying to simulate teh breaking of a block?

#

it won't break teh block, it will display the cracking effect on it

quaint mantle
#

Im trying to cancel an event outside of the event handler but to no sucess, is this possible, as im trying to have a switch case statement inside my runnable and have the checks in there.

subtle folio
#

pass the event as an argument

tardy delta
#

assuming that youre cancelling the event the same tick

quaint mantle
#

Let me proviide some code

tardy delta
#

otherwise youre cancelling an old event

#

wouldnt make sense either

subtle folio
#

canceling on move is so cringe

#

it’s so buggy

quaint mantle
#
                        new ShieldReactions<>(event.getDamager(), player, itemStack, EntityDamageEvent.DamageCause.SONIC_BOOM, event);

    private class ShieldReactions<E extends EntityDamageByEntityEvent> extends BukkitRunnable {


event.setCancelled(true);
tardy delta
#

lol

quaint mantle
#

Its snipits but theres nothing really else important

tardy delta
#

i hope youre cancelling it the same tick

quaint mantle
#

I am

#

Wait.. i may not be 2 secs

tardy delta
#

i guess we need to see more code lol

quaint mantle
#
        public ShieldReactions(Entity attacker, Player player, ItemStack itemStack, EntityDamageEvent.DamageCause damageCause, E event) {

            this.attacker = attacker;
            this.player = player;
            this.heldItem = itemStack;
            this.damageCause = damageCause;
            this.event = event;

            runTaskTimer(moreShields, 16, 20);

        }

Heres the constructor, i have a feeling due to the 16 tick delay im not cancelling it in the same tick -_- big derp

tardy delta
#

no lol

quaint mantle
#

Thought as much

tardy delta
#

you are passing an event instance which is already handled ig

quaint mantle
#

cheers

tardy delta
#

and you shouldnt really be extending bukkitrunnable and then calling runTaskTimer in the constructor :/

quaint mantle
#

What would you suggest

tardy delta
#

either call runTaskTimer outside or use the scheduler internally to run this::somethingToRun

quaint mantle
#

Sorted, thank you.

tardy delta
#
class SomTask implement Runnable {
  SomeTask() { Bukkit.getScheduler().runTaskTimer(plugin, this, delay) }
  void run() {}
}```smth like this
#

i still recommend the first thing

quaint mantle
#

So new ShieldReactions<>(event.getDamager(), player, itemStack, EntityDamageEvent.DamageCause.SONIC_BOOM, event).runTaskTimer(plugin, delay, ticks);

tardy delta
#

yes..

quaint mantle
#

Thats what i thought

#

ok just making sure 😛

wild reef
#

Hey guys, am I doing something wrong?

GameProfile gameProfile = ((CraftPlayer) player).getHandle().getGameProfile();
Property property = (Property) gameProfile.getProperties().get("textures").toArray()[0];

        String signature = property.getSignature();
        String texture = property.getValue();

        npc.getGameProfile().getProperties().put("textures", new Property("textures", texture, signature));

I wanted to create a npc with the same skin as I have, but for some reason it appears with a different one, not a default steve or alex one tho

lethal roost
#

event doesn't seem to be firing (message isn't showing up in console) whenever i press Q to drop an item, any idea why?

    public void onItemDrop(EntityDropItemEvent event) {
        Player player = (Player) event.getEntity();
        ItemStack droppedItem = event.getItemDrop().getItemStack();
        Material configMaterial = Material.valueOf(config.getString("material"));

        Bukkit.getLogger().info("entity drop item event fired");
    }```
eternal oxide
harsh matrix
#

Can anyone recommend me a library for creating GUIs

hushed spindle
#

i keep getting this error when building my project, is this something i should worry about? all the overlappings come from my own plugin so i dont understand whats happening lol

maven-shade-plugin has detected that some class files are
present in two or more JARs. When this happens, only one
single version of the class is copied to the uber jar.
smoky oak
#

shouldnt that be a warning instead of an error?

#

how do you make that an error

tardy delta
#

just ignore

hushed spindle
#

oh yeah sorry its a warning

#

its just that im not sure if i should worry about it apparently overlapping 1600 classes or so

wild reef
eternal oxide
#

try it and see?

harsh matrix
sterile token
covert karma
#

how do i enchant block-items? when trying to add an enchant it says that this enchant cant be applied to that item
is it only possible with packets?

#

(just the glint effect i mean)

hushed spindle
# harsh matrix could you give me a link?

Spigot has updated their inventory API!!!!! Watch this video too: https://www.youtube.com/watch?v=Qj66KDQucp8&list=PLfu_Bpi_zcDNEKmR82hnbv9UxQ16nUBF7
In this video, I show you how to make a GUI menu using Inventories and ItemStacks. GUI menus allow you to make it so that users can choose options in a menu-like manner. It makes your plugins extra...

▶ Play video
hushed spindle
#

or addUnsafeEnchantment i dont remember

#

and just apply a HIDE_ENCHANTMENTS flag to the item

smoky oak
#

do you have to use unsafe to bypass the normal limits?

covert karma
#

ah yeah unsafe works thanks

hushed spindle
#

yeah

#

if you just do addEnchantment i believe it cant go above like efficiency 5 for example

wild reef
# eternal oxide did you try clearing the old properties first?
String signature = property.getSignature();
        String texture = property.getValue();
        npc.getGameProfile().getProperties().get("textures").clear();
        npc.getGameProfile().getProperties().put("textures", new Property("textures", texture, signature));

Tried it like this - if you meant that, which doesn't work

eternal oxide
#

No clue then. It was just a suggestion.

covert karma
#

can i make mobs have more reach

hushed spindle
#

i think you'd have to do custom entity shenanigans with nms to do that

#

otherwise no

#

at least not in a pretty way

#

i guess you could accomplish it by having a runnable regularly check mobs on the server that have a target and if that target is within a certain distance you can have em attack

smoky oak
#

can someone explain 'clazz'?

ocean lion
#

Is there any specific hub command that is neccessarry to the plugin

eternal oxide
wild reef
worldly ingot
#

Some people use theClass as well

#

I've also seen classs

#

but that one's weird

eternal oxide
iron palm
#

is there any mojang remapped for 1.19?
Since i cannot get build from a remapped nms

smoky oak
wild reef
iron palm
smoky oak
#

--remapped

iron palm
#

i've also added that before

eternal oxide
#

did you run it for 1.19?

smoky oak
#

then MANUALLY add the .m2 folder to the project

#

i had to

iron palm
#

java -jar BuildTools.jar --rev 1.19 --remapped

eternal oxide
smoky oak
#

well it only worked once i did that

#

sue me

#

but if i just hit run it errs out

eternal oxide
#

you just need the correct pom

smoky oak
#

'cant find spigot 1.19'

eternal oxide
#
        <!--Bukkit/Spigot API -->
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>${project.spigotVersion}</version>
            <scope>provided</scope>
        </dependency>

        <!--Bukkit/Spigot NMS -->
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>${project.spigotVersion}</version>
            <classifier>remapped-mojang</classifier>
            <scope>provided</scope>
        </dependency>```
#

and in the plugins section xml <plugin> <groupId>net.md-5</groupId> <artifactId>specialsource-maven-plugin</artifactId> <version>1.2.2</version> <executions> <execution> <phase>package</phase> <goals> <goal>remap</goal> </goals> <id>remap-obf</id> <configuration> <srgIn>org.spigotmc:minecraft-server:${project.spigotVersion}:txt:maps-mojang</srgIn> <reverse>true</reverse> <remappedDependencies>org.spigotmc:spigot:${project.spigotVersion}:jar:remapped-mojang</remappedDependencies> <remappedArtifactAttached>true</remappedArtifactAttached> <remappedClassifierName>remapped-obf</remappedClassifierName> </configuration> </execution> <execution> <phase>package</phase> <goals> <goal>remap</goal> </goals> <id>remap-spigot</id> <configuration> <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile> <srgIn>org.spigotmc:minecraft-server:${project.spigotVersion}:csrg:maps-spigot</srgIn> <remappedDependencies>org.spigotmc:spigot:${project.spigotVersion}:jar:remapped-obf</remappedDependencies> </configuration> </execution> </executions> </plugin>

iron palm
eternal oxide
#

in the properties section add xml <project.spigotVersion>1.19-R0.1-SNAPSHOT</project.spigotVersion>

eternal oxide
#

thats just something I added so you only need set the version in one place

iron palm
#

oh lmao right

eternal oxide
#

so long as you ran buildtools --remapped and it finished with no errors you are good to go

wild reef
eternal oxide
#

no clue

iron palm
eternal oxide
wild reef
#

I see stuff about datawatcher, but no idea where that class comes from

smoky oak
#

PacketPlayOutEntityMetadata

#

its off by default i think

#

you need to say that its active

eternal oxide
#

I've found reference to it with GameProfile but the only way they have said to display it is with sending a EntityMetadata packet

#

send after spawning the npc

wild reef
#

Does this come from some other lib or something? Can't find these classes on my ide

eternal oxide
#

I've not used them but I belive they are nms

iron palm
quaint mantle
#

Hey, if i block the chat event and then i let the server write the message, the player was writing, will then the uuid of the player be removed out of the message?

wild reef
#

Okay I am doing that now as well. It's has a different naming with mojang mapping

#
ps.send(new ClientboundSetEntityDataPacket(npc.getId(), npc.getEntityData(), true));

but it still doesn't work

old cloud
#

Hi, is anyone familiar with how bungeecord communicates with other servers?

agile anvil
#

What do you understand by communicating ? Do you mean plugin messaging ?

old cloud
#

No, how it generally communicates with servers and clients. What happens if a client connects to the proxy? Where does the client send its packets to? How does a client communicate with the proxy if it is connected to a sub server?

humble tulip
agile anvil
#

Well basically Bungee is just a tunnel between the client and a server. The client connects to the bungee instance like if it wanted to connect to a real minecraft server (follow the handshake protocols and go on), then bungee redirect all the traffic to a specified server, and vice versa

agile anvil
#

So bungee does not really communicate with servers, actually it doesn't. It just copy paste the traffic from the client

humble tulip
#

pretty much

#

it can communicate with servers using players

agile anvil
#

(well there are some stuff behind but not important)

ivory sleet
#

Yea bungee is in principle one directional in the way it’s designed

#

It uses player connections for servers to talk back to it

agile anvil
#

(so if there isn't any players, it can't communicate) (except if you make it happen by using sockets, or redis, etc .)

old cloud
#

Does the sub server the player is on communicate directly with the client or do all packets first go through the proxy, which just redirects them?

humble tulip
#

all go thru the proxy which redirects it

agile anvil
#

Everything go through the proxy

#

So that you can switch servers without getting disconnected

old cloud
#

ok nice, thanks

agile anvil
#

(bungee simulates a world change for that)

lost matrix
old cloud
eternal night
#

bedrock has stuff for that

#

java sadly not

#

for like a full server redirect

#

tho that feature is pretty hard to implement properly anyway, I think in bedrock it is just a "connect to this ip"

#

which, eeeek, security loves those

agile anvil
#

Speaking of "connect to this ip".. Log4J... Hopefully it has been patched 🥲

eternal night
#

log4shell is patched since like

#

december

ivory sleet
#

Yes pretty much very patched

eternal night
#

basically days/hours after it went public

ivory sleet
#

Hey even legacy versions got updated

agile anvil
#

Yep hopefully, cause trust me it was really easy to use

eternal night
#

should have literally not patched 1.8

lost matrix
ivory sleet
#

🥲

eternal night
#

people would have at least moved for a maintained 1.8 fork

#

which, better than unmaintained 1.8

agile anvil
#

Would have been wonderful

lost matrix
humble tulip
#
<relocation>
    <pattern>com.zaxxer.hikari</pattern>
    <shadedPattern>me.saif.pluginname.hikari</shadedPattern>
</relocation>

This needed to stop conflicts with possibly older versions?

#

I asked before but imajin said no

ivory sleet
#

Myes

somber hull
#
    private List<ItemStack> getItemList(Player plr) {
        List<ItemStack> items = new ArrayList<>();
        for (ItemClass i : dataConfig.getPlayerListMap().get(plr.getUniqueId())) {
            ItemStack item = new SpawnerFactory(plugin,
                    EntityType.valueOf(i.getEntityType()),
                    i.getMultiplier(),
                    i.getCreatorName(),
                    i.getXp(),
                    i.getLastGen()).getSpawner();
            
            items.add(item);
        }
        return items;
    }
    
    private ItemStack resetItem(ItemStack item) {
        PersistentDataContainer itemData = item.getItemMeta().getPersistentDataContainer();
        ItemStack items = new SpawnerFactory(plugin,
                EntityType.valueOf(itemData.get(plugin.ENTITY_TYPE_KEY, PersistentDataType.STRING)),
                itemData.get(plugin.MULTIPLIER_KEY, PersistentDataType.INTEGER)
                , itemData.get(plugin.OWNER_KEY, PersistentDataType.STRING),
                itemData.get(plugin.XP_KEY, PersistentDataType.INTEGER),
                itemData.get(plugin.LAST_GEN_KEY, PersistentDataType.LONG)
        ).getSpawner();
        return items;
    }
    
    private List<ItemClass> getItemClassList(List<ItemStack> items) {
        List<ItemClass> itemClassList = new ArrayList<>();
        
        for (ItemStack i : items) {
            PersistentDataContainer itemData = i.getItemMeta().getPersistentDataContainer();
            itemClassList.add(new ItemClass()
                    .setCreatorName(itemData.get(plugin.OWNER_KEY, PersistentDataType.STRING))
                    .setEntityType(itemData.get(plugin.ENTITY_TYPE_KEY, PersistentDataType.STRING))
                    .setMined(itemData.get(plugin.MINED_KEY, PersistentDataType.BYTE) == 1 ? true : false)
                    .setMultiplier(itemData.get(plugin.MULTIPLIER_KEY, PersistentDataType.INTEGER))
                    .setXp(itemData.get(plugin.XP_KEY, PersistentDataType.INTEGER))
                    .setLastGen(itemData.get(plugin.LAST_GEN_KEY, PersistentDataType.LONG)));
        }
        return itemClassList;
    }
ivory sleet
#

Linkage errors could occur

eternal night
#

I hate ?paste

somber hull
#

leme explain

humble tulip
agile anvil
#

When quoting code, PLEASE ADD JAVA so at least there will be colors

humble tulip
#

since it gets put in the root direcctory of my jarfile

agile anvil
#

```java

ivory sleet
#

Minion probably

humble tulip
ivory sleet
#

Well if it only relies on the api then you might not need to shade it at all

humble tulip
#

i dont have it in my pom

ivory sleet
#

No you shade it in there

humble tulip
#

one sec

ivory sleet
#

But like it’s quite hidden since it’s transitive

#

You can tho… override it

humble tulip
#

so i dont have to shade it?

ivory sleet
#

Unsure

somber hull
#

If i need to save a spawner type (It doesnt need to be placed so i dont have to edit the blockdata), and other custom variables whats the best way to do that?

ivory sleet
#

But try and see if it’s possible to not have it shaded

lost matrix
somber hull
#

Currently

humble tulip
ivory sleet
#

Add the dependency yourself

#

Set the scope provided / compile time only

humble tulip
#

ok and put provided

somber hull
#

its gonna be a lot of work

#

wow

#

your very helpful

lost matrix
#

this colon triggers me

somber hull
#

almost as if it did work the first time, and a version change broke it

ivory sleet
#

Tho usually when you write code getting it to work is one thing… then cleaning the code usually takes another iteration per say

lost matrix
#

Btw thats not how you use "factories". Bit misleading this name.

somber hull
ivory sleet
#

Yep

somber hull
#

Ye as i said i made this a loooong time ago

#

wait

#

why wouldnt it be?

lost matrix
#

Honestly. Im at a point where i use a Gson singleton with all my type adapters registered and im just serializing a whole class into the PDC.
This also fixes versioning issues because Gson can handle class model changes.

humble tulip
#

jar size also smaller

ivory sleet
#

Pog

somber hull
#

Well i dont think im using gson but i keep running into an issue where it doesnt know how to serialize certain classes from spigot

#

im using jackson, how easy is it to switch over

ivory sleet
#

Jackson naming conventions 😵‍💫 but yeah it’s trivial

somber hull
#

well it wouldnt be that hard

#

i just have one class that needs changing

lost matrix
somber hull
#

So how do i get a serializer for ItemStack and Location

somber hull
#

Or do you mean make a custom one?

humble tulip
#

and every meta subtype

somber hull
#

Hold up

humble tulip
#

oh wait nvm

#

i just read what 7smile7 said

somber hull
#

And why exactly is the name factory misleading there?

ivory sleet
#

Because it’s a design pattern

#

When you include the label "Factory" in the name of a class you weakly expose the intention of that the class is gonna follow the design pattern

ivory sleet
#

So if said class does not follow the pattern you’re gonna end up trolling a bunch of devs

somber hull
#

Got it

#

The pattern for factory being?

ivory sleet
#

Myes, the factory pattern aims to decouple instantiation from creation

humble tulip
#

ur storing itemstacks?

ivory sleet
#

Which your class there does not really do

somber hull
#

got it

#

what would it be called then

somber hull
#

Currently it deserializes all the nesscesary information

#

and saves it to a file

humble tulip
somber hull
#

and then when i need it again

#

i just apply it back to a new spawner

somber hull
humble tulip
lost matrix
humble tulip
#
    public static String serialize(ItemStack[] obj) {
        try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
             BukkitObjectOutputStream dataOutput = new BukkitObjectOutputStream(outputStream)) {


            dataOutput.writeInt(obj.length);

            for (int i = 0; i < obj.length; i++) {
                dataOutput.writeObject(obj[i]);
            }
            return Base64Coder.encodeLines(outputStream.toByteArray());
        } catch (Exception e) {
            throw new IllegalStateException("Unable to save item stacks.", e);
        }
    }

    public static ItemStack[] deserialize(String str) {
        try (ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(str));
             BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream)) {
            ItemStack[] items = new ItemStack[dataInput.readInt()];

            for (int i = 0; i < items.length; i++) {
                items[i] = (ItemStack) dataInput.readObject();
            }

            return items;
        } catch (Exception e) {
            return new ItemStack[0];
        }
    }
#

u can ofc just change ItemStack[] to ItemStack

#

forget the exception

somber hull
#

well it is a list of itemstacks

humble tulip
#

i copied the class

#

u can basically copy this as well

somber hull
#

whats Base64Coder?

#

is that even nessescary?

humble tulip
#

itemstacks get saved as
rO0ABXcEAAAACnBzcgAab3JnLmJ1a2tpdC51dGlsLmlvLldyYXBwZXLyUEfs8RJvBQIAAUwAA21h

#

that's an itemstack^^

somber hull
#

how tho..

#

if it has much more data?

#

Does it just add more numbers ig

humble tulip
#

Base10 has 10 characters for data

lost matrix
humble tulip
#

base64 has 64

somber hull
humble tulip
#

no

#

its a java thing

somber hull
#

Really?

humble tulip
#

base64 strings can store data in less space

lost matrix
#

the byte[] will get longer

humble tulip
#

since it uses more chars

#

"space"

#

like a shorter string

somber hull
#

But if i need to grab the values from these itemstacks

humble tulip
#

deserialize them like on player join or whatever

somber hull
#

without needing the whole itemstack

#

hmm that works

humble tulip
#

an itemstack doesnt rly take up much space

somber hull
#

So make like a map of player to itemstack array?

humble tulip
#

servers have tens of thousands of itemstacks loaded when the server is running

somber hull
#

and change it on join and any other changes that need to be made

humble tulip
#

what exactly are u making?

somber hull
#

i just need to keep track of the spawners a player puts into or takes out of a gui

#

the spawners also have nbt saved

humble tulip
#

ohh

somber hull
#

through persistentdata

humble tulip
#

nbt data is saved this way

#

so ur fine

#

also

#

you can literally store the ItemStack[]

#

load it on join, save on leave

#

any changes when player are online can be made to the array

somber hull
#

i forget why i didnt save the itemstacks

#

i think it was just because i needed the data in the itemstack more than i need it itself

#

should i just grab the nbt value whenever i need it?

humble tulip
#

is the gui some sort of spawner storage?

somber hull
#

yea

#

but it generates xp

#

over time

#

by storing the last time it generated xp

#

and doing the math on inventory open

humble tulip
#

that's fine

#

alterantively, u can create a data class that stores the spawner type, last use, whatever

somber hull
#

wich is what i have now

humble tulip
#

and u read the data array and generate spawners

somber hull
#

Thats exactly what i have now

#

but its so complicated

humble tulip
#

it shouldnt be

somber hull
#

i feel like it can be much better

humble tulip
#

it's easier to just save the spawners tho

somber hull
#

these are essentially serialize and deserialize

    private ItemStack resetItem(ItemStack item) {
        PersistentDataContainer itemData = item.getItemMeta().getPersistentDataContainer();
        ItemStack items = new SpawnerFactory(plugin,
                EntityType.valueOf(itemData.get(plugin.ENTITY_TYPE_KEY, PersistentDataType.STRING)),
                itemData.get(plugin.MULTIPLIER_KEY, PersistentDataType.INTEGER)
                , itemData.get(plugin.OWNER_KEY, PersistentDataType.STRING),
                itemData.get(plugin.XP_KEY, PersistentDataType.INTEGER),
                itemData.get(plugin.LAST_GEN_KEY, PersistentDataType.LONG)
        ).getSpawner();
        return items;
    }
    
    private List<ItemClass> getItemClassList(List<ItemStack> items) {
        List<ItemClass> itemClassList = new ArrayList<>();
        
        for (ItemStack i : items) {
            PersistentDataContainer itemData = i.getItemMeta().getPersistentDataContainer();
            itemClassList.add(new ItemClass()
                    .setCreatorName(itemData.get(plugin.OWNER_KEY, PersistentDataType.STRING))
                    .setEntityType(itemData.get(plugin.ENTITY_TYPE_KEY, PersistentDataType.STRING))
                    .setMined(itemData.get(plugin.MINED_KEY, PersistentDataType.BYTE) == 1 ? true : false)
                    .setMultiplier(itemData.get(plugin.MULTIPLIER_KEY, PersistentDataType.INTEGER))
                    .setXp(itemData.get(plugin.XP_KEY, PersistentDataType.INTEGER))
                    .setLastGen(itemData.get(plugin.LAST_GEN_KEY, PersistentDataType.LONG)));
        }
        return itemClassList;
    }
waxen plinth
#

Dear god

humble tulip
#

yeah nah

#

just save the itemstack[]

somber hull
#

alr

humble tulip
#

cuz spawner type etc will be saved with that

somber hull
#

alr

waxen plinth
#

You can save ItemStacks in config

#

Alternatively I have a library that provides methods to serialize and deserialize items

humble tulip
humble tulip
#

ppl are generally stupid

lost matrix
humble tulip
#

compared to the byte[] ye

#

not sure abt if u convert the byte[] to a String

lost matrix
#

And the encoded String will get bigger (when the underlying data size increases)

humble tulip
#

think the unencoded strings are shorter

eternal oxide
#

a serialized object is WAY smaller than a Base64 encoded one

twilit roost
#

as you can see the black line
that is current Direction in which the ship should be facing
but it doesn't match
any ideas for better working code?

    public static Vector fromRot(float yaw) {
        return new Vector(Math.sin(yaw), 0, Math.cos(yaw));
    }
humble tulip
#

ig i was wrong

#

i thought it was a way to shrink the string

twilit roost
#

blue line is direction
red line is Vector from the yaw

agile anvil
#

How do you translate the blocks ?

twilit roost
humble tulip
#

In the first

twilit roost
#

32 ~

lost matrix
#
    public static Vector fromRot(float yaw) {
        return new Vector(Math.sin(yaw + Math.PI), 0, Math.cos(yaw + Math.PI));
    }
#

Hm you might need a modulo in that case...

agile anvil
#

sin(x + pi) is - sin(x)

twilit roost
lost matrix
humble tulip
twilit roost
#

yep

lost matrix
#

Nice. Now see if it also fixed the other issue

twilit roost
#

ok now it unfixed it self
even in straight position

lost matrix
#
    private static final TWO_PI = Math.PI * 2;

    public static Vector fromRot(float yaw) {
        return new Vector(Math.sin((yaw + Math.PI) % TWO_PI), 0, Math.cos((yaw + Math.PI) % TWO_PI));
    }

Not sure if the java impl does this internally already but you should cap full rotations like that.

twilit roost
humble tulip
#

is yaw in degrees or radians?

twilit roost
eternal oxide
#

are you trying to calculate teh Vector of rotation about Y for the Yaw?

eternal night
#

you'd need to send a message with a click event + command run

#

beyond that the client does not notify the server about clicking chat messages

agile anvil
twilit roost
#

or i dont get what u mean

lost matrix
eternal night
#

Yea sponge has something like that build in

humble tulip
#

how do u draw the blue line?

#

and the red line

twilit roost
#
    public static void createGizmo(Location at, Vector dir, Color color,float length){
        int r = color.getRed();
        int g = color.getGreen();
        int b = color.getBlue();

        Location curLoc = at.clone();
        for (int i = 0; i <= length; i++) {
            curLoc.getWorld().spawnParticle(Particle.REDSTONE, curLoc, 5, new Particle.DustOptions(Color.fromRGB(r, g, b), 1));
            curLoc.add(dir);
        }
    }
    public static void createGizmo(Player at, Vector dir, Color color, float length){
        int r = color.getRed();
        int g = color.getGreen();
        int b = color.getBlue();

        Location curLoc = at.getLocation();
        for (int i = 0; i <= length; i++) {
            at.spawnParticle(Particle.REDSTONE, curLoc, 5, new Particle.DustOptions(Color.fromRGB(r, g, b), 1));
            curLoc.add(dir);
        }
    }

feel free to use this

meager trout
#

hi,
how to set operation for itemstack on NBTTagCompound ?
for example = Head - Chest and more ..

#
        NBTTagCompound damage = new NBTTagCompound();
        damage.set("AttributeName", new NBTTagString("generic.attackDamage"));
        damage.set("Name", new NBTTagString("generic.attackDamage"));
        damage.set("Amount", new NBTTagInt(10 * 10));
        damage.set("Operation", new NBTTagInt(0));
        damage.set("UUIDLeast", new NBTTagInt(894654));
        damage.set("UUIDMost", new NBTTagInt(2872));
        modifiers.add(damage);
twilit roost
humble tulip
twilit roost
#

oh

#

😄

eternal night
#

does the API not have attribute API ?

lost matrix
eternal night
#

for item stacks

ornate patio
#

what's the most efficient way to store an array of UUIDs in a PDC

twilit roost
#

blue line is bassically *-1

eternal night
#

I mean, byte[] ?

eternal night
ornate patio
#

I'm looking at the NBT data for a horse and idk wth this is

ornate patio
eternal night
#

int array

#

a bit more readable than byte array

humble tulip
ornate patio
lost matrix
# meager trout Version is 1.8.8

Well then go dig in old forum posts from half a decade ago. Support for that version was dropped years ago
and nobody plays it anyways.

twilit roost
lost matrix
eternal night
#

right PDC has long[] kekw

humble tulip
lost matrix
twilit roost
#

point same direction as the ship does

eternal oxide
#

?stash

undone axleBOT
humble tulip
ornate patio
twilit roost
#

well blue is indeed -1 of red
but it doesn't point onto the front part ( dont know the name rn ) of the ship

humble tulip
#

Rotating Vectors

lost matrix
#

lsb = least significant bits
msb = most significant bits

Ill show you an example

ornate patio
#

also can i store nested arrays in a PDC because i need to store multiple UUIDS

tardy delta
#

new long[] { uuid.getMostSignificantBytes(), uuid.getLeastSignificantBytes() }

ornate patio
#

i think its best if i write my own persistentdatatype right

tardy delta
#

or use alex' lib

ornate patio
#

also how am i supposed to do this

#
public class UUIDListTagType implements PersistentDataType<long[][], ArrayList<UUID>> {

    @Override
    public Class<long[][]> getPrimitiveType() {
        return long[][].class;
    }
    
    @Override
    public Class<ArrayList<UUID>> getComplexType() {
        ...
    }
#

what am i supposed to put for the getComplexType body

lost matrix
# ornate patio how do you split a UUID and what is lsb and msb lmao
  public static long[] toPrimitive(UUID... uuids) {
    long[] primitives = new long[uuids.length * 2];

    for (int index = 0; index < uuids.length; index++) {
      long msb = uuids[index].getMostSignificantBits();
      long lsb = uuids[index].getLeastSignificantBits();
      primitives[index * 2] = msb;
      primitives[index * 2 + 1] = lsb;
    }

    return primitives;
  }

  public static UUID[] fromPrimitive(long[] primitives) {
    Preconditions.checkArgument(primitives.length % 2 == 0);
    UUID[] uuids = new UUID[primitives.length / 2];
    for (int index = 0; index < uuids.length; index++) {
      uuids[index] = new UUID(primitives[index * 2], primitives[index * 2 + 1]);
    }
    return uuids;
  }

This is more the solution than an example... anyways. Consider yourself fed blobspoonfeed

ornate patio
#

dw i'll study it

#

i hate copying code that i dont understand

eternal oxide
#

?paste

undone axleBOT
lost matrix
eternal oxide
#

probably

smoky oak
#

why is the syntax highlighting gone

lost matrix
#

Not that those microseconds would matter

eternal oxide
#

but not forever. 64 will be redundant

smoky oak
#

oh on that topic

#

is it faster to do a for loop iterating by one and copying & bit shifting the variable to the left by 9, or to do a for loop which adds 512 per iteration

eternal night
#

byte[] also just looks worse in game

#

like, you do crab on the /data command with it xD

ornate patio
#

would it be possible to use an ArrayList<UUID> instead of UUID[] though?

#

or does this not support it

eternal night
#

obviouly

eternal oxide
#

You cna pass in any way you want. Just rewrite it

ornate patio
#

alright

lost matrix
# smoky oak ^

Show us your code.
If the compiler sees something that can be optimized then it will optimize.

eternal oxide
eternal oxide
#

I believe. I could be wrong

#

oh that wasn;t his question

smoky oak
#

im planning to check one block at input coordinates per mca. Also isnt bit shifting invented to literally make division and multiplication by 2 faster?

ornate patio
#

what do i put here

humble tulip
#

bit shifting always faster

lost matrix
#

Im just thinking about the last ALU i assembled and the multiplication was hella expensive.
But it was super primitive.

ivory sleet
#

Just ArrayList.class

eternal oxide
#

its a List.class

ornate patio
ivory sleet
#

Well cast it also perhaps

ornate patio
eternal oxide
#

actually you can't parameterise teh class

tardy delta
#

i thought this was valid syntax :c

ornate patio
lost matrix
ivory sleet
#

One way would be with a type token

humble tulip
ivory sleet
#

But that’s smelly

tardy delta
#

ye thats why i thought

ivory sleet
#

Class.class is a singleton so not able to pass types to type params (since there are none)

lost matrix
#

SomeClass.<Type>method()

humble tulip
#

oh ye mb

tardy delta
ornate patio
#

soo should i resort back to UUID[] instead then

ivory sleet
eternal night
#

valhalla wen

#

tho I think even with specific generics the class type won't support that

ivory sleet
#

(Class<ArrayList<UUID>>) new TypeToken<ArrayList<UUID>>(){}.getRawType()

#

Maybe

tardy delta
#

aaaaa

ivory sleet
#

Or perhaps it might work with just TypeToken::getType but ye

#

Gets verbose

tardy delta
#

@SupressWarnings("unchecked") ehhhe

ivory sleet
#

Alternatively
Class<ArrayList<UUID>> dodo = (Class<ArrayList<UUID>>)(Type)ArrayList.class; maybe

lost matrix
ornate patio
lost matrix
#

You can convert a List to an Array by simply calling toArray

ornate patio
#

yeah but like

#

its still work

#

to convert the array to an arraylist too

tardy delta
#

😳 ElgarL once told me to put 'java' before everything i wanted to know

eternal oxide
ivory sleet
#

ye

mortal hare
#

do you guys use protected for exposing final fields for subclasses

humble tulip
#

yes

eternal night
#

inheritance is kinda cringe

ivory sleet
#

^

#

composition :3

eternal night
#

🙏

lost matrix
#

composite your way through

mortal hare
#

i feel like exposing protected field code smells

#

i cant get rid of this feeling

#

but sometimes i need some kind of field

ivory sleet
#

well dovidas, I try to keep the coupling between a super and sub class minimal as the relation between the two classes is already extremely coupled

lost matrix
#

What really smells is the friend keyword... (C++)

mortal hare
#

sometimes i have complete implementation in base class but i need to further extend it in subclasses

tardy delta
#

friendly class

tardy delta
#

or fun

ivory sleet
#

I mean you have a set of design patterns dovidas

#

like proxy, adapter, delegate, chain of responsibility and also functional interfaces with hot sugar syntax

ornate patio
mortal hare
ivory sleet
#

do you even need to expose the field?

mortal hare
#

I dont want to even expose its existance to end user

ivory sleet
#

it might be enough with getters and setters

ornate patio
#

man i really wish java had built-in getters and setters

ornate patio
#

like python's @property and .setter

lost matrix
#

records or lombok

opal juniper
#

lombok -> delombok -> boom you have setters

ivory sleet
#

lol

ornate patio
#

what is lombok

mortal hare
#

annotation processing lib

opal juniper
#

a hot pile of steaming shit

mortal hare
#

automaticallly creating setters and getters for you

#

by annotating field or method

ornate patio
#

ill look into it

ivory sleet
ornate patio
#

but it's still just a rough bandaid

opal juniper
#

i love how lombok is reduced to "getters and setters"

ivory sleet
#

kinda true

lost matrix
ivory sleet
#

Ive had a bad experience with it

mortal hare
#

i hate it because it hides stuff, which some do not like

ornate patio
#

its just a bandaid to cover up java's flaws

ivory sleet
#

like source and decompiled code mismatch

#

and then back in the days you could get some wizard-like stacktraces

#

but through out the years its a pretty solid java boilerplate reducer library

lost matrix
ivory sleet
#

I just find it meaningless as we do have code generation keybinds etc in ides

#

and like the entire "when code isnt written by you, but inferred the code is hard to maintain"-argument is kinda bullshit

#

lombok has become a preference I believe

quaint mantle
#

What does the itemflag Hide_Attributes do, becuase on the docs it says hides damage but durability still shows?

mortal hare
#

it hides damage

#

attributes

opal juniper
mortal hare
#

attack, speed, etc.

lost matrix
mortal hare
#

Attack Damage +7

ivory sleet
#

mye hence preference Id say

mortal hare
#

that kind of stuff

quaint mantle
ivory sleet
#

well

#

I find it fine to use

#

but for public libs still a bit no for me

#

since not everyone is familiar with it

quaint mantle
opal juniper
#

Yeah its fine™️ but i would never choose to use it

ivory sleet
#

so it would ultimately increase complexity of said library

mortal hare
#

its impossible

quaint mantle
#

Not even with NMS?

opal juniper
#

no

mortal hare
#

yep

#

not even with nms this is possible

lost matrix
quaint mantle
#

Im creating custom durabilities

#

So it would ruin the thing if they could see it

mortal hare
#

you would need to just deal with it

#

its not a big deal

quaint mantle
#

Does unbreakable still show durabilities?

eternal night
#

wouldn't custom durability just live on the server 🤔

#

or PDC

mortal hare
#

only items which do not have durability do not show that

lost matrix
mortal hare
#

while its durability is simulated in server and sent back to client

eternal night
#

Yea but if you had custom durability

quaint mantle
eternal night
#

durability isn't part of the lore 😅

quaint mantle
#

No i know

mortal hare
#

its a separate thing

quaint mantle
#

But its one way i could visualise it if i set it as unbreakable

eternal night
#

Yea

#

but then yea, you'd have to store the "custom durability" somewhere else

lost matrix
quaint mantle
#

PDC?

mortal hare
#

Delegate design pattern wouldnt work for me, since i extend the class, its not as if I wrap some kind of class

ivory sleet
#

yes I was just listing some

#

mainly to give ya a hint

mortal hare
#

so guys using protected for subclasses is fine

ivory sleet
#

its fine

#

but keep it minimal

#

since it becomes hard to maintain through out a nested sub class relation

mortal hare
#

its final field after all

#

what could go wrong

ivory sleet
#

personally if its a read only field Id make a getter/accessor and keep that thing protected, just to make the design a bit more robust

mortal hare
#

are primitive ints initialized to zero by default?

eternal oxide
#

yes

mortal hare
#

ik unintialized ints in cpp are undefined

#

but in java idk

eternal oxide
#

primitives can not be null

mortal hare
#

if they initialized to zero by default why you can use operators like i++ without initializing it to zero first

#

i mean if values like int i; have predefined values like boolean has value false by default

eternal oxide
#

well no. you can;t use an uninitialized primitive

mortal hare
#

oh

#

ok

solid cargo
#

should i do this to prevent potential hackers?

eternal night
#

I mean

#

ehhhhh

solid cargo
#

i mean the ones who aint trying to hide it

#

does optifine count as forge?

#

just clean optifine

eternal night
#

The amount of people actually running forge to run their hack clients might be rather small

#

and idk what isForgeUser is

solid cargo
#

its on bungeecord

eternal night
#

ah

tender shard
eternal night
#

I have doubts this will be effective yea

#

any good hack client will bypass that

#

even if they for some reason use forge

tender shard
#

you can hide the client branding with like 2 lines of code

#

and also people could just use fabric instead of forge or whatever

solid cargo
#

but the dumb ones will still be catched or at least delayed to hack

tender shard
eternal night
#

You would also block any other forge user

#

if you only want vanilla clients, then yea

#

go for it

#

but, most if not all of those users will not be hacking

solid cargo
#

its for a building championship, to prevent printer as much as possible

tender shard
#

printer?

solid cargo
#

auto build

#

or schematica all together

eternal night
#

Well both fabric and forge announce themselves don't they ?

#

so if you wanna clap all mods, sure

solid cargo
#

optifine is enough

#

imo

eternal oxide
#

many clients install forge so they can have a map

solid cargo
#

i just need to prevent schematica

eternal oxide
#

if they run forge you can query what mods they have

solid cargo
#

yeah ik.

#

player had these mods: ....

#

should work ig

tardy delta
#

hypixel gave me a ban appeal for hacked client lmao

#

love the staff

solid cargo
#

oof

#

eeh fuck it. lets allow players to connect with forge. our eyes are good enough to detect players who cheat

lost matrix
solid cargo
#

wait wtf is that word

#

can you explain in monke terms?

humble tulip
#

isnt that machine learning?

solid cargo
#

we just need to detect schematica autobuild. thats it

humble tulip
#

just check the modlist ig

#

wont stop everyone tho since they can just change the mod name

solid cargo
#

not everyone is going to go through that

#

ig i can make modlist list

#

and then if player mods contain something

#

i throw them out?

humble tulip
solid cargo
#

also should i give them a reason why they got kicked out?

humble tulip
#

or stop them from building

#

tell them that they are using schematica

#

which is not allowed

tender shard
#

litematica's fast place feature can also easily be detected by checking the clicked blockface in blockplaceevent

#

if it's always BlockFace.SELF then they have it enabled

solid cargo
#

an ac is prolly made for that already. i dont wanna reinvent the wheel

humble tulip
#

i thought u just wanted to stop 1 thing tho

#

anticheats arent lightweight

#

and it isnt very hard to implement

#

a map that maps uuid to integer to keep count

#

or maybe 2 so u can get a percentage of BlockFace.SELF placements

solid cargo
#

eh fudge it. im allowing anyone to join.

#

even cheaters. they will just get detected sooner or later by my laser eyes

lost matrix
solid cargo
tardy delta
#

if (ThreadlocalRandom.current().nextInt(100) < 50) user.ban() hehe

tall dragon
#

make fake bans 😄

solid cargo
#

YES

#

random usernames from playerlist or random username from a list in code?

tall dragon
#

and make fancy announcements like "our anticheat has banned 435 cheaters this week!"

#

excelent idea

solid cargo
#

nah its for like a building championship

lost matrix
#

xX_puxxySlayer69_Xx got banned for slaying some

solid cargo
#

which might get like 100 participants

tall dragon
solid cargo
#

some what?

#

🐱

tardy delta
#

some cat

lost matrix
#

some inferior opponents

solid cargo
#

its 12am should i go to sleep?

#

the animatronics are about to come

lost matrix
#

1am is peak productivity time

tardy delta
#

what are animatronics?

solid cargo
#

fnaf

tardy delta
#

it was 2am yesterday

lost matrix
#

Thats when you start the really big projects

tall dragon
#

yea doesnt every programmer program better at night?

#

its so much better

tardy delta
tall dragon
#

idk why

solid cargo
#

no one is there to disturb you

#

its quiet outside

#

not too cold not too warm

dire marsh
tall dragon
dire marsh
#

i mean you'd be doing the same stuff they already do

tall dragon
#

exactly

#

they act like watchdog is the shit

#

in reality there is no anticheat 😄

dire marsh
#

yep

#

they've had that anticheat role open for around a year now I think lol

#

don't seem to require much for a so called machine learning anticheat

tall dragon
#

of the final jar?

#
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <outputDirectory>${project.basedir}/../out/</outputDirectory>
                </configuration>
            </plugin>

i use this

solid cargo
#

bruh i wanna add something simple to the plugin before going to sleep. what should i add?

#

or plugins, since i have 1 for the game server, 1 for lobby and 1 for proxy 🤣

tall dragon
wild reef
#

Hey I got a question. I started to use remapped-mojang for package related things. But I found the procolib. So I am kinda confused which of both is better, or if it's recommended to use them together? I am pretty new in that kind of topic so I wanted to ask for an opinion

humble tulip
#

but sending packets with protocol lib is a pain

#

it's really nice to listen to incoming packets tho

wild reef
#

so I would still use protocolib i guess?

humble tulip
#

depends on ur use

tall dragon
#

tbh isnt that kind of a weird question. protocollib will help you with packets. but u can do plenty other stuff with nms. which you could need remapped for no?

wild reef
#

well I need to send packets and listen to some

#

basically something about npcs

#

I used remapped right now

#

everything worked fine till finding a way to listen to packages

#

that's why I found protocolib which seems like everyone uses

humble tulip
#

use protocollib to listen to packets

tall dragon
#

well if ur only needing to interact with packets i'd suggest protocollib yea

wild reef
#

that's why I was confused if I can combine them, or need to use one of them

humble tulip
#

u can combine em

#

protocol lib is for packets

#

nms still has alot more uses

wild reef
#

alright thank you guys

ornate patio
#

is there an event for when a player jumps on a horse

lost matrix
ornate patio
#

no like

#

if the player is riding the horse

#

and holds the space bar to jump

ornate patio
#

damn this is actually a thing

#

wasnt expecting that

#

but thankfully it does

humble tulip
#

too bad it's now clientside so u cant modfiy it

#

well u can but it may look wonky

ornate patio
#

can i cancel it?

tall dragon
#

will it even be fired still?

humble tulip
#

no

#

again u can but may be wonky

ornate patio
#

i'll see what happens

#

if its wonky i can just like forcibly teleport the horse back down

humble tulip
#

why dont u want the horse jumping

ornate patio
#

its complicated lol

#

it'll sometimes be able to jump, sometimes wont

humble tulip
#

u can give it a jump potion of max amplifier to disable jumping

#

and remove when u dont want it to jump

ornate patio
humble tulip
#

not sure if it'll work tho since horses are contrllable

humble tulip
#

yeah it works on player

ornate patio
#

it was buggy though, sometimes if the player took damage they'd go flying up into outer space

humble tulip
ornate patio
#

well it does happen

humble tulip
#

Thanks everyone i solved the issue with
Code (Java):
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, 250));
but the problem was when i quit and rejoin i could jump so i remove the potion then give the potion and that worked.

#

250 is the amplifier

ornate patio
#

another problem though is if the horse already has a genuine jump boost potion affect on

#

wait cant i use an attribute modifier

humble tulip
#

messy but may work

#

still dont know if player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, 250)); works on horses so u can start by testing that

tall dragon
#

could maybe also directly edit the horses jump power

ornate patio
lost matrix
#

Whatever was just there: I tried base64 decoding it.
뮺뮺뮺뮺뮺뮺뮺뮺뮺뮺뮺뮺yʞu^w;@@]w<P zzܮ

humble tulip
#

lul

wild reef
#

Uhm about protocolib again. I will need it on my server for my plugin using it to run properly correct? Is there a way with maven to shade the plugin into mine, so protocolib doesn't need to be on the server?

humble tulip
#

i was cleaning my keyboard

tall dragon
mortal hare
#

but by using that you will need to manage NMS dependant code by yourself

ornate patio
#

more of a java question but should i be using Random#nextDouble or Math#random

tall dragon
#

id use TheadLocalRandom

mortal hare
#

I use ThreadLocalRandom

ornate patio
#

alright

mortal hare
#

i would use Random only in the case I would like to use seeding

#

but that's only the preference by using ThreadLocalRandom you dont need to maintain random classes by yourself

brave sparrow
#

ThreadLocalRandom is faster

#

Like it’s more performant in general than Random

mortal hare
#

but it doesnt support seeding

#

also randomness is thread dependant

#

its just a matter of architectural design

ivory sleet
#

yeah

#

non reproducible

#

altho hopefully any modern java code depends on RandomGenerator rather, in which the impl can be substituted at will

ornate patio
#

the problem is that if the leash does get cancelled, the player gets automatically mounted on the horse

#

how would i prevent that

tardy delta
#

entitymount event?

tall dragon
#

listen to interactevent instead

#

or interactatentityevent actually

ornate patio
#

yeah but like

#

i dont want to stop all players from mounting horses

#

the main this is how do i determine if the player's leash got cancelled or not

tall dragon
#

so check if they are clicking on a horse

#

then check if they have a leash

#

in their main hand

#

if so -> do random

ornate patio
#

sorry hUh

#

oh you mean in interactatentityevent?

tall dragon
#

yea

ornate patio
#

and ditch the playerleashentityevent?

tall dragon
#

yes

ornate patio
#

k lemme try

#

whats the difference between PlayerInteractAtEntityEvent and PlayerInteractEntityEvent

#

what should i listen to

tall dragon
#

use PlayerInteractAtEntityEvent

ornate patio
#

ok

tall dragon
#

use PlayerInteractEntityEvent

#

i got confused

ornate patio
#

alright

#

wait how do i get an players item in a specific EquipmentSlot

tardy delta
humble tulip
#

Get Equipment

#

GetItem

#

That's also a method

ornate patio
#

oh getItem(slot) is a thing

humble tulip
#

Ye

ornate patio
#

@tall dragon ok your solution worked, thanks

tall dragon
#

👍

ornate patio
#

i dont see how this prevents the horse mounting though

tall dragon
#

well the player is interacting with the horse isnt he

#

and ur cancelling that

ornate patio
#

hmm

#

i guess so

tall dragon
#

the leash event is bassically a fancy PlayerInteractEntityEvent with a leash check xd

tardy delta
#

so are all damage events

tall dragon
#

yep

ornate patio
#

what's a good "reject" sound effect

#

for example a horse resisting a leash

tardy delta
#

villager saying no

#

forget the name, it was smth with villager in the name

ornate patio
#

i found it

tardy delta
ornate patio
#

ENTITY_VILLAGER_NO

tardy delta
#

ig

ornate patio
#

thanks

grim ice
#

its saying mew mew repeatedly

#

in korean

ornate patio
#

also I'm still working on finding the damn pathfinding algorithm

#

if anyone could help that'd be great lmao

smoky oak
tardy delta
#

dont think so

grim ice
#

man

#

i need a coding idea

tardy delta
#

i assume green one means the villager bein happy

grim ice
#

i should make an app that will help me learn russian

mortal hare
#

more interactability

#

with ui's

#

this would be great for help info custom gui's with resource packs

ivory sleet
#

oh ye

mortal hare
#

also i separated NMS from bukkit api code so there are nms interfaces rn, in order to make this more platform independant

#

enough work for today

ivory sleet
#

could be really epic

smoky oak
# mortal hare

im assuming that switch's intended. What about using the first trade in the UI to switch between different villagers?

#

like

#

on clikc

lost matrix
mortal hare
#

you can do whatever you want

#

there's InventoryActionContext interface which invoke method returns

#

so you can execute whatever you want

#

including switching inventories

smoky oak
#

is that nms or api btw? i dont recall how much you can manipulate guis without diving into nms

mortal hare
#

mix of both

smoky oak
#

ah

mortal hare
#

NMS is mostly not needed

#

but in order to preserve items in the trading slots (which do not stay in bukkit merchant implementation)

#

you need to implement custom NMS menu class

#

but for example Merchant without villager entity in bukkit api can not hold levels

#

so you need to do some nms to bypass

smoky oak
#

i see. Interesting, though i doubt it'll come up for me

#

What im working on atm is interactions in the world

#

like checking blocks powers of two apart if they're the same

#

long story

#

hence my question about bit shifts earlier

#

if i can make it fast without much effort

#

im going to make it fast

#

oh on that note

#

would it be faster to bit shift i and bit shift it back, or to copy it into another variable and bit shift that variable?

#

im not sure how assignment or variable initialization compares to bit shifting in speed

lost matrix
smoky oak
#

in this specific case no

#

its possible that it'll come up en masse in a different one

#

particle stuff

lost matrix
#

allocating space for a new variable is for sure more expensive than using an exisiting one and doing a shift on it

smoky oak
#

and if i just assign it in the loop? allocate it before the loop?

#

im aware that doing that inside the loop is a dumb idea - initialization - but im not sure about assignment

#

i think its slower

#

but i dont know for sure

#

also i cant test it right now

wild reef
#

I am trying to interact with this npc right now, and it's only working on the shadowed position on the legs (cause it would be the normal location if the pose was standing). Can I make it somehow, so I can interact with the whole laying body?

smoky oak
#

show hitboxes. I'd recon you can't interact cuz the hitbox is still up

lost matrix
smoky oak
#

hah fair enough

#

im mostly worried because ill start working with a research institute in the future. I'd rather have my code optimized there, especially considering how much modern research relies on a buttload of math being done

#

modern neural networks got what

#

like

#

a few billion nodes? and they all run math

lost matrix
#

Youll probably be using something more low level then

humble tulip
#

And better hardware

smoky oak
#

I'll most likely be forced to use c or c++ anyways

#

and then ill pull out my hair because neither of those has a garbage collector

#

to be honest

#

i really dont understand how people think using python for data science is a good idea

lost matrix
#

Neuronal networking is done on GPUs because the workload relies on strong parallelisation.
And all of that is abstracted away from you. Data science is mainly done in Python for whatever reason.

smoky oak
#

what i dont get is

sterile token
#

["", "&fPlace the block to", "&fprotect an area", ""] this can parsed with YamlConfiguration#StringList() ?

ivory sleet
#

yes

sterile token
#

It seems that throw an excpetion

smoky oak
#

python is interpreted not compiled. So why do people use something three to four orders of magnitude slower than a compiled language for something that relies so heavily on speed???

lost matrix
sterile token
#

LOl what a nice staff

ivory sleet
#

python isnt necessarily that bad

#

especially when the modules you use are natively written

smoky oak
#

oh right

ivory sleet
#

like numpy

quaint mantle
smoky oak
#

i forgot

lost matrix
smoky oak
#

yea c

#

i remember

lost matrix
#

Like Pandas, Numpy and Torch

ivory sleet
smoky oak
#

huh for some reason i recall that name

sterile token
#

every lang is bad if you dont give the correct usage

smoky oak
#

theres some languages you cant use correctly

sterile token
#

That the only thing i have learned around my own experience

smoky oak
#

piet, chief, shakespeare...

sterile token
lost matrix
#

Whitespace, Brainfuck, Moo

sterile token
#

Cobol for example

ivory sleet
#

these esoteric languages sure

#

they're just trolling ya

smoky oak
#

intercal

#

'not sufficiently polite'

ivory sleet
#

but any normal language usually has a use case

lost matrix
#

Another esoteric language: Javascript

sterile token
#

I dont know how still exists cobol devs

tender shard
lost matrix
smoky oak
#

theres that one language you cant prove or disprove to be turing complete cuz it was made on a hex grid for some reason too

ivory sleet
sharp flare
smoky oak
ivory sleet
#

most systems running on cobol are planning or are getting re written

smoky oak
#

snowflake servers are an interesting thing

quaint mantle
tender shard
lost matrix
smoky oak
#

win seven wasnt much better tho

quaint mantle
#

they're the damn government

tender shard
smoky oak
#

see thats the issue

#

governments never manage to make progress on semi important things

tender shard
#

no

smoky oak
#

dont think so. Arent destructors doing what the GC already does in java?

tender shard
#

yeah kinda

#

just dont reference unneeded objects and you're fine

#

well there is a finalize method