#help-development

1 messages · Page 2036 of 1

ivory sleet
#

I remember some implementation where they stringed the random number and used that instead to decide what rarity something would be for instance you could take the length of the string and if it’s shorter then it’s definitely rarer

(Remember you can switch between bases and such also)

lilac dagger
#

alright then

eternal night
#

use googles range map

#

pretty neat for this

patent horizon
#

does name replace id in gradle?

kindred valley
#

İm seeing the discord cod messages white on mobile. How can i fix it

cerulean mirage
#

wouldnt that not matter as you will never have 2 diff threads accessing it at the same time? Or does async runnable use multiple threads for some reason

#

my plan would be just read from database in onEnable method

#

and async timer to save every minute or sum

#

yeah

#

its only in onEnable

#

so once

#

Diff for every use case

#

I want all the values to be read

#

bc that means in my case, a lot of requests in a couple of seconds

sacred mountain
#

can i run .setDamage() twice in an EntityDamageByEntityEvent?

#

like if i want to set the damage to 0 and then 1 tick later set it to 15 or seomething

ancient jackal
#

I just get an unmodifiable copy of the cache in a tick then save that asynchronously

eternal night
#

one tick later, modifications to the event are useless

sacred mountain
#

oh ok

eternal night
#

what

#

no

ancient jackal
#

would that be fine? I'm sure it is

eternal night
#

Yea but the player dies one tick later

#

like, one tick later you can manually respawn the player sure

#

but mutating the event yields nothing

sacred mountain
#

im trying to set a damage value in a mapp and hten get it in the same tick

#

is that even possilbe

#

two different listeners

ivory sleet
#

If your cache is thread safe just using that directly isn’t gonna hurt

patent horizon
#

if i wanted to modify a message (like a caps filter or smth) how would i do that with %s

sacred mountain
ancient jackal
ancient jackal
#

it leaves nothing pending

sacred mountain
#

well then split with spaces and

sacred mountain
#

find the word with the capitals

#

and then lower it

ivory sleet
#

Usually reads from chm isn’t gonna be much more expensive than from normal hm

sacred mountain
#

then concat or stringbuild or whatever and then output

ivory sleet
#

It’s writes that are expensive

#

By copying the hash map to an immutable copy would scale quite badly

cerulean mirage
#

@ivory sleet If i would have an async timer that reads from hashmap every so often and save that to database. Would i still need a concurrent hashmap?

ivory sleet
#

Especially since you have to copy the entire backing array

ivory sleet
#

ConcurrentHashMap/a thread safe map is needed whenever you manipulate the map from multiple threads

#

If you don’t use one there’s a big change you’ll end up running into concurrent update problems

ancient jackal
#

huh, what if values are added to the hashmap while you're saving it?

ivory sleet
#

An iterator is at most just a view of the map

ivory sleet
#

yes ofc

patent horizon
#
org.bukkit.plugin.IllegalPluginAccessException: java.lang.NullPointerException
    at org.bukkit.plugin.SimplePluginManager.getEventListeners(SimplePluginManager.java:709) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.registerEvents(SimplePluginManager.java:661) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    at net.plexpvp.core.Main.onEnable(Main.java:65) ~[Plex-1.0-SNAPSHOT-all.jar:?]```
```java
        Bukkit.getPluginManager().registerEvents(new LevelListener(), this);```
ivory sleet
#

And ftr just having a normal map wouldn’t guarantee any more safety at all daVinki

patent horizon
#

lol what

ancient jackal
ivory sleet
#

Depends

#

But like it’s often avoided because there’s a lot of issues coming when bulk operating

ancient jackal
#

delay is before it runs, period is time between runs afterwards

ivory sleet
#

delay initial delay before execution starts
period is the interval between each execution once the runnable has reached the delay

ancient jackal
#

when you're saving the cache, do you have a buffer of any sort so the server doesn't end up waiting on the hashmap to become unlocked?

sacred mountain
#

guys is like generic people now

ivory sleet
#

Wat

#

assuming that I do have a sync buffer

#

Than I just invoke the thread pool and read the concurrent hash map

#

Not that complicated

ancient jackal
#

so you aren't saving async? I'm lost

ivory sleet
#

I am

#

But it’s called a sync buffer when you’re syncing all data at once

#

You have to remember the concurrent hash map doesn’t always lock, it’s fundamentally trying to avoid locks by doing compare and set operations and such

ancient jackal
#

how would it avoid locks then? what happens if there's a write during a read?

ivory sleet
#

You don’t need to lock whenever a write and read happens concurrently

#

First of all it may not that important that the read is 100% up to date, secondly atomicity is a thing

#

Locks are devastatingly slow

brave sparrow
ivory sleet
#

But if you truly need a synchronized hash map Collections::synchronizedMap might help

brave sparrow
#

^

brave sparrow
ancient jackal
glossy venture
#
public static final int PORT = 25566;

// ...

        try {
            server = HttpServer.create();
            server.setExecutor(exec);
            server.bind(new InetSocketAddress(PORT), 0);
            server.createContext("/carbon/rp_d", exchange -> {
                if (!exchange.getRequestMethod().equals("GET"))
                    return;
                OutputStream out = exchange.getResponseBody();
                exchange.sendResponseHeaders(200, Files.size(resourcePack));
                InputStream fis = Files.newInputStream(resourcePack);
                fis.transferTo(out);
                out.flush();
                out.close();
            });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
``` why is the server not responding bruh
#

no errors

#

also sorry for the humongous message lmao

cerulean mirage
#

@ivory sleet I use Long2objectopenhashmap for better performance, would it be good to manually lock the hashmap and unlock it when the task is done?

#

Bc the async timer runs like every 1 or 2 minutes

#

So using a slower hashmap would not be beneficial for that or?

ivory sleet
#

May I ask what are you doing in the async task timer?

#

Merely reading from it?

cerulean mirage
#

For loop over the hashmap and store the values in the database with batches

ivory sleet
#

Then you don’t need to lock it

#

Just read the map as is in the task timer

cerulean mirage
#

So i dont need to use concurrenthashmap for that?

ivory sleet
#

Not for that

#

Let’s say you read extremely often from multiple threads as well as writing to it from multiple threads

#

Then a CHM will be necessary more or less

cerulean mirage
#

k thanks

ivory sleet
#

Also should be said

#

the lock would be useless if you'd merely use it in the task timer

#

as you'd in principle have to lock and unlock when doing most operations with the map

#

thus why locking is usually avoided if possible

#

deplorably slow

patent horizon
#

line 65 is ``` Bukkit.getPluginManager().registerEvents(new LevelListener(), this);

ivory sleet
#

what if u'd just load it by restarting the server

#

in other words not using plugwoman/plugman

patent horizon
#

ill try that

#

still no

ivory sleet
#

do u have the code on github?

patent horizon
#

yessir

ivory sleet
#

mind sharing? :3

patent horizon
#

its a private repo

#

if u dont mind going through the hassle of getting invited

ivory sleet
#

oh well my gh name is Conclure

patent horizon
#

alr

#

i just went ahead and forked it since im not the owner of the original

ivory sleet
#

alr

grim ice
#

gh should add

#

private to all BUT:

#

e.g if u wanna show someone a private repo without them changing code

patent horizon
#

nah my problem is just i dont have perms to invite others since another dev on my server is the owner of the github

#

and they're being stingy with the access

grim ice
#

ik

ivory sleet
#

uh wally its quite strange

#

Wally

#

CombatCore seems to be the issue

#

assuming its still line 65

sacred mountain
#

Maths isnt my strong point so i may need a bit of spoonfeeding here:
Im trying to make a damage calculator that will calculate the amount of damage to deal, given an input damage, a minimum value and a maximum value, and a distance.
I want to make it so the damage dealt to the player will scale depending on how far they are to my explosion (distance), but with a minimum and maximum value in which it will scale inside

#

i dont really know if i explained that well

#

explaining is also not my strong point lmao

patent horizon
ivory sleet
#

can I compile and run for myself?

patent horizon
#

this might be it

#

data.guild

ivory sleet
#

is that on startup?

patent horizon
#

no

#

its on playerdamage

patent horizon
ivory sleet
#

well the error gets yield on startup doesnt it?

sacred mountain
ivory sleet
#

@patent horizon

#

what task do I use to compile?

patent horizon
#

gradle shadowJar

#

something gives me a hunch it's this right here

quiet ice
# cerulean mirage <@!299969655915806741> I use Long2objectopenhashmap for better performance, woul...

If you know that the longs actually two ints, where as the two ints are close to a certain origin point (i .e. nothing widly random like the current time but rather something like coordinates) then https://github.com/Geolykt/Presence/blob/main/src/main/java/de/geolykt/presence/common/util/RegionatedIntIntToObjectMap.java could work better. It has pretty shit iteration time but given that it should be pretty safe to use in concurrent environments it may pay off. I know that it can reliably deal with around 1 million direct read calls (sync however) per seconds without making any dent in server performance while being on pretty shit hardware

patent horizon
#

since redlib commands also is mentioned in the log

cerulean mirage
last sleet
#

Is there any advantage to using the enchantment wrapper instead of lore?

ivory sleet
#

more object oriented

#

and to some extent better integration

golden turret
#

how could i make my MapRenderer always render?

#

like the vanilla map

quiet ice
#

Custom enchantments?

last sleet
#

Yeah

grim ice
#

using lore sucks

last sleet
#

Why?

quaint mantle
#

its unreliable

quiet ice
#

I personally use Lore + PDC or just lore

last sleet
quaint mantle
quiet ice
#

But from experience I can say that lore can break from time to time

quaint mantle
grim ice
#

dont you want other users to use your enchantment in their plugin, I assume with pdc you couldn't apply it

last sleet
grim ice
#

I would just use the implemented way, no need to make your own over complicated curvy way

quaint mantle
grim ice
#

^ yea

last sleet
#

ok, thanks

quiet ice
#

The bukkit enchantment api is incomplete at best and it is very visible that custom enchantments are a hack with it

grim ice
#

spigot doesnt add the enchant automatically? I thought when creating a custom enchant when applying it, it's added to the lore

quiet ice
#

not at all

grim ice
#

ic

#

then ig just use lore to show it

quiet ice
#

Or actually I do not know given that I never used it, but that is what I heard

young knoll
#

It is not

#

That is done client side

#

But the client will not have a valid entry for that enchantment

quiet ice
#

I personally attempted multiple conversions from my lore/pdc+lore to a bukkit enchantment system but always failed doing so

grim ice
#

is there an enchanting librayr

#

i wish there isnt

patent horizon
#

@ivory sleet im confused how it could be caused by CombatCore, according to my ide, LevelListener is on the 65th line

ivory sleet
#

yeah

#

sorry

#

I was away for some time

#

clicked on one of those scam links by mistake so had to reset my token and backup codes

#

anyhow let me download the deps first

#

@patent horizon did u push latest

patent horizon
#

just did

#

altho idk if it'll show up on fork

#

i just fetched

#

should be fully updated

ivory sleet
#
java.lang.NullPointerException: Cannot invoke "org.bukkit.craftbukkit.v1_18_R2.CraftWorld.getHandle()" because "world" is null
        at com.sk89q.worldedit.bukkit.adapter.impl.v1_18_R2.PaperweightAdapter.createWorldNativeAccess(PaperweightAdapter.java:355) ~[worldedit-bukkit-7.2.10.jar:?]
        at com.sk89q.worldedit.bukkit.BukkitWorld.<init>(BukkitWorld.java:119) ~[worldedit-bukkit-7.2.10.jar:?]
        at net.plexpvp.core.combat.CombatCore.<init>(CombatCore.java:35) ~[Plex-1.0-SNAPSHOT-all.jar:?]
        at net.plexpvp.core.Main.onEnable(Main.java:65) ~[Plex-1.0-SNAPSHOT-all.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:501) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:559) ~[paper-1.18.2.jar:git-Paper-265]
        at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:473) ~[paper-1.18.2.jar:git-Paper-265]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:664) ~[paper-1.18.2.jar:git-Paper-265]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:431) ~[paper-1.18.2.jar:git-Paper-265]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:316) ~[paper-1.18.2.jar:git-Paper-265]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-265]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-265]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

#

thats what I get

#

but its because I dont have a world named ul_world

patent horizon
#

we dont have a ul_world either

#

we have a ul_plex

ivory sleet
#

oh yeah

#

I meant ul_plex

#

let me re launch if I have a world named just that

#

oh

#

im getting the error now as well

#

@patent horizon

#

try changing

@JvmStatic
 public HandlerList getHandlerList() {
     return handlerList;
 }

to
public static HandlerList ...

#

for BlacksmithExpChangeEvent and GlobalExpChangeEvent

#

hmm

patent horizon
#

well i mean at least the error message is different this time

#

oh nvmd just two errors now

ivory sleet
#

ah

#

FarmingCore

#

public FarmingCore()
{
Bukkit.getScheduler().scheduleSyncRepeatingTask(new Main(), task(), 0L, 5L);
}

#

you're creating a second Main object

#

use Main.get() over the new Main()

#

actually wally

#

can I push my changes?

#

it will work then

#

and you'll see what I changed

patent horizon
#

yeah

#

oml

#

one of my devs keeps doing that instead of Main.get()

#

ive caught most of them

#

smh

#

if only error messages could be a little less vague

ivory sleet
#

yes

#

well

#

actually

#

FarmingCore

#

MiningCore

#

use new Main();

#

and then make sure to read

#

?event-api

undone axleBOT
ivory sleet
#

breh

#

ok

#

^

#

look how it uses custom event

#

specifically the static HandlerList

#

might not need to pr

patent horizon
#

pr?

#

oh pull request

ivory sleet
#

not needed

quaint mantle
#

Hey guys!
I need a little help in the spigot development, I need to get a part of the item lore into a string
For example

Owner: {PlayerName}
I just need the player name of the item lore, how do I do that?

ivory sleet
#

loop through each line of the lore, find where it begins with the "Owner: " string and then get the rest of the string

#

then you could use Bukkit::getPlayer to transform the string to a player object

#

altho may I ask why you do not use the persistent data container api?

visual tide
#

may i suggest you use nbt/pdc instead

#

because players can usually rename items

ivory sleet
#

^ using lore to store data is fragile and unreliable

sacred mountain
#

what about metadata/nbt

visual tide
#

as is using a container name to identify it but i still see it a ton

sacred mountain
#

i know pdc best but what about those

patent horizon
ivory sleet
#

yes

patent horizon
#

yeah i changed it to Main.get() and its error on that line

ivory sleet
#

make the task() return void

#

and then pass this::task

#

instead of task()

#

in the constructor

patent horizon
#

in the scheduleRepeatingTask?

ivory sleet
#

myes

patent horizon
#

alr

somber hull
#

What is this 1.8

ivory sleet
#

we told them already

#

no need to be rude about it

quaint mantle
ivory sleet
#

?pdc

somber hull
quaint mantle
#

If you could, would you give me a quick example of how would someone make a use of it ?

somber hull
patent horizon
#

awesome it's fixed

ivory sleet
#

look at the link I provided you with

patent horizon
#

tysm

ivory sleet
#

lol no worries

#

the errors were... interesting

somber hull
patent horizon
#

how can i make a sound only play for one player? other players on my server say they can hear this player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 0f, 0f);

ivory sleet
#

hmm fairly certain Player::playSound is player exclusive

patent horizon
#

oh lmao

#

it turns out they were hearing it though my mic

#

in a vc

ivory sleet
#

lol

rough drift
#

lmao

#

Could there be a better way to write this lmao

ivory sleet
#

DateFormatter :>

rough drift
#

oh

#

lmao

#

forgot that was a thing

ivory sleet
#

actually it might be called DateTimeFormatter

rough drift
#

yep

#

its that

ivory sleet
#

ye

#

very pog

patent horizon
#

how can i edit the sent chat message if i have to use %s for formatting?

ivory sleet
#

I mean

#

you set it

#

but it need to have two %s

#

in the new string

#

first one is the name, the second one is the message

#

"<%s> %s" is the default iirc

rough drift
#

@ivory sleet looks nice now

ivory sleet
#

😌

patent horizon
rough drift
ivory sleet
#

you dont really set it

#

its just arguments

#

the first one will be the player

#

unchangeable in principle

rough drift
ivory sleet
#

and the latter can be changed with AsyncPlayerChatEvent::setMessage iirc

rough drift
#

it will result in

#

<a> b

patent horizon
#

oh

#

so i just do like

#

event.setFormat(format, player, message)

rough drift
#

yes

patent horizon
#

alr

rough drift
#

or in kotlin:

"<%s> %s".format("a", "b")

patent horizon
rough drift
#

wait

#

hold on

ivory sleet
#

you're not supposed to pass the arguments as already said

patent horizon
#

...

rough drift
#

oh yeah

#

lmao

#

i am dum

patent horizon
#

then how do i set the second %s to the new value

rough drift
#

go ahead conclure

ivory sleet
#

you dont

#

use AsyncPlayerChatEvent::setMessage

patent horizon
#

ah k

rough drift
#

^

#

example

#

(its kotlin but it still applies)

patent horizon
#

is there a String.replace() function that allows me to input multiple parameters to get the same output replacement

#

message.replace("&k", "").replace("&l", "").replace("&m", "");

tender shard
#

does someone know how I can make the links clickable in a JOptionPane?

patent horizon
#

so like message.replace("&k" "&l" "&m", "") kinda

rough drift
#

oh

#

no

#

there aint

patent horizon
#

:(

rough drift
tender shard
rough drift
#

i don't think you can in a JOptionPane

tardy flame
#

Paste

#

?paste

undone axleBOT
rough drift
#

you can technically check when a user moves their cursor/clicks and check bounding boxes of links to make your own sorta clickable link

tender shard
rough drift
#

ik

#

o

#

you can?

sacred mountain
#

is it possible to detect a right click on an entity such as a dropped item?

#

maybe a ray trace? idk

sacred mountain
#

i dont have much experience with runnable jars, where do i put the method/run it?

tender shard
#

I'm using a JEditorPane now where can just throw HTML at it 🙂

patent horizon
tender shard
#

wrong sentence

sacred mountain
#

main class?

#

oh right

tender shard
#

I meant I am using the editorpane now, because that's where I can just throw HTML at to get my links

sacred mountain
#

nvm

chrome beacon
patent horizon
#

how do i make it then

#

or whats the alternative

tender shard
# sacred mountain nvm

your main method can be whereever you want, as long as it's a public static void main(String... args)

#

then just define the main class in the MANIFEST file

young knoll
#

Didn’t know varargs worked

#

Guess it makes sense tho

tender shard
#

in bytecode, String[] and String... is the same

young knoll
#

Figured

patent horizon
#

whats the equivalent to a forEach that returns a boolean

tender shard
#

wdym?

patent horizon
tender shard
#

well forEach takes a Consumer, if you wanna return a boolean, you want to have a BooleanFunction

patent horizon
#

im tryna iterate over a list and return true if one of the values matches the condition

tender shard
#

Function<YourObject,Boolean>

patent horizon
#

what

tender shard
#

Function<YourObject,Boolean>

#

you could also just do a regular for loop

patent horizon
#

no it's in a if statement

tender shard
#

or if you simply wanna check if your list contains something, use a stream -> filter

patent horizon
#

ah anyMatch is what im looking for

chrome beacon
tender shard
#
        ArrayList<Object> list = null;
        Object objectToFind = null;
        boolean isObjectInList = list.stream().anyMatch(o -> o == objectToFind);

or use an anyMatch

#

oh you already wrote that

patent horizon
#

second part of the question

#

how come i cant join something after collection a filter?

grim ice
#

like executing the jar

#

just curious

tender shard
#

with a MANIFEST file

grim ice
tender shard
tender shard
grim ice
#

do u rly want to check by instance

patent horizon
sacred mountain
fluid cypress
#

i get invalid target release: 17.0.3 when running mvn package
mvn -version output:

Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /opt/maven
Java version: 17.0.3, vendor: N/A, runtime: /usr/lib/jvm/java-17-openjdk
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.16.14-arch1-1", arch: "amd64", family: "unix"

java -version output:

openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment (build 17.0.3+3)
OpenJDK 64-Bit Server VM (build 17.0.3+3, mixed mode)

im using maven-compiler-plugin version 3.10.1, and exec-maven-plugin 3.0.0

grim ice
young knoll
#

Plugin devs seem to forget normal java apps use public static void main :p

grim ice
sacred mountain
#

totally not me

young knoll
#

Now find a way to connect it to bStats

#

So you can know how many people do it

tender shard
grim ice
#

u see that weird box

#

on ur button

#

it will stop showing

tender shard
#

isn't that just so that you can instantly dismiss it with return?

#

so it's preselected

tender shard
#

hm I'll check it out

young knoll
#

I like that it’s generic

#

I assume {plugin} is replaceable

quaint mantle
patent horizon
#

basically theres a list of color codes i dont want users that can use color codes to use

#

like &k, &l, &m, etc.

#

it just seems redundant to repeat the .replace() function over and over again

#

especially since im replacing them all to the same thing

quaint mantle
#

i mean you can put them into a set

grim ice
#

for(String entry : setOfCodes){
message = meesage.replace(entry, "");
}

quaint mantle
grim ice
#

meesage.replace(entry, "");

quaint mantle
#

you're doing two operations unneccessarily

#

yes

grim ice
sacred mountain
#

hey how do i create a manifest file

quaint mantle
#

META-INF/MANIFEST.MF

eternal night
#

generally speaking it will always be your build tool generating those for you

quaint mantle
#
Main-Class: me.imaginedev.somepackage.Main

eternal night
#

so google <your build tool here> generate manifest.mf

quaint mantle
#

bruh

vocal cloud
#

Name it MyMainClassClass.class

neon nymph
#
repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
    jcenter()
    maven{url = "https://repo.unnamed.team/repository/unnamed-public/"}
    maven {
        url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
        // As of Gradle 5.1, you can limit this to only those
        // dependencies you expect from it
        content {
            includeGroup 'org.bukkit'
            includeGroup 'org.spigotmc'
        }
    }
}
```Is this how you correctly declare repositories in gradle?
tender shard
ivory sleet
#

but yes

sage dragon
#

There's probably no way to check if a player is holding left click except when mining a block, or is there?

young knoll
#

Time to shove it in every plugin and flood you with support requests

tender shard
upper crater
#

how do i deebug again

#

how would you print to server console

tender shard
#

Plugin#getLogger#warning

#

or Bukkit#getLogger#warning

#

or just simply

#

System.out.println("asd")

young knoll
#

That works too

upper crater
quaint mantle
#

can anyone help me with my server i got a super annoying dupe glitch i dont know how to fix

undone axleBOT
neon nymph
#

Gradle's giving me unresolved dependencies, I think my repo format is wrong?

#
repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
    maven("https://repo.unnamed.team/repository/unnamed-public/")
    maven {
        url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
        // As of Gradle 5.1, you can limit this to only those
        // dependencies you expect from it
        content {
            includeGroup 'org.bukkit'
            includeGroup 'org.spigotmc'
        }
    }
}
```I added in the repo as it states in its documentation like so (The repo.unnamed.team one) But it still gives me the errors
upper crater
#

no i know java and all
i just assumed that since System prints to the console where you ran it from it might not print into server

#

nvm

#

how can i do autofill for booleans? so true or false in the arguments?
do i have to make my own custom autocomplete or is there an easier way?

young knoll
#

I don’t think there’s any built in one in spigot

#

There is a brigadier tho

#

Yes that would be your own custom autocomplete

shadow owl
#

Is it still impossible to teleport a player in a PlayerQuitEvent? @quaint mantle

quaint mantle
#

@ivory sleet can u help me out

ivory sleet
#

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

sacred mountain
#

got my plugin to run as a standalone program as an easter egg lol

tender shard
shadow owl
#

teleport from PlayerQuitEvent

sacred mountain
#

maybe dont teleport

#

just set their location in the world file? im not sure if thats easy to do or not

patent horizon
#

would anyone wanna help me debug this snazzy little snippet

#
        String condensedMessage = message.toLowerCase().replaceAll("[^a-zA-Z]","").replace(" ", "");
        player.sendMessage(condensedMessage);
        if (filteredWords.filteredWords.contains(condensedMessage) || filteredWords.filteredWords.stream().anyMatch(s -> condensedMessage.contains(" " + s + " "))) {
            event.setCancelled(true);
            player.sendMessage(u.f("&3&lPLEXPVP &8» &7You cannot say blacklisted words &b" + filteredWords.filteredWords.stream().filter(s -> s.equals(condensedMessage) || condensedMessage.contains(" " + s + " ")).collect(Collectors.joining(", ")) + "&7."));
            for (Player p : Bukkit.getOnlinePlayers()) if (p.hasPermission("staff")) p.sendMessage(u.f("&3&lPLEXPVP &8» &b" + player.getName() + " &7tried to say blacklisted words &b" + filteredWords.filteredWords.stream().filter(s -> s.equals(condensedMessage) || condensedMessage.contains(" " + s + " ")).collect(Collectors.joining(", ")) + "&7."));
        }```
ivory sleet
#

oh god

patent horizon
#

heh

pulsar zenith
#

tf

quaint mantle
#

wtf

hasty prawn
#

Would anyone happen to know what causes YAML to be saved with these lol

quaint mantle
#

are those pointers 😂

hasty prawn
#

why tho KEKW

ivory sleet
#

yaml anchors

#

uwu

young knoll
#

It’s supposed to be a type

#

Afaik

hasty prawn
#

It puts them there at random

#

Sometimes they there, sometimes not.

#

And they get placed in different spots NotLikeThis

patent horizon
#

it's kinda like extra info for parsing

#

afaik

young knoll
#

I've only seen it as like

#

java.lang.uuid though

#

Not id004

patent horizon
#

idk

hasty prawn
#

It's just on drugs I guess

#

It's fantastic that it saves it like that though and has no idea how to read it back in lol

#

Maybe if u saved it how I gave it to u it'd be readable monkaGun

patent horizon
#

event.setFormat(u.f("&8[&b" + level + "&8] " + prefix + "&7%s &8» &7") + (u.f("%s"))); how come i cant allow people to use color codes with this

ivory sleet
#

I mean why dont you just use ChatColor::stripColors

patent horizon
#

u.f() is a shortcut function for translateAltColorCodes

ivory sleet
#

so much easier

patent horizon
ivory sleet
#

it strips away colors

patent horizon
#

not what im tryna do

#

im trying to allow people to use color codes in chat

ivory sleet
#

oh

patent horizon
#

everything comes out like this

ivory sleet
#

just use

#

event.setMessage(ChatColor.translateAlternateColorCodes('&',event.getMessage())) then

#

perhaps

patent horizon
#

thatd be the same exact thing

ivory sleet
#

well thats what Id do

#

no clue whatsoever what u::f does

#

and like, the setMessage method is just so much more convenient here

hasty prawn
#

Shouldn't you be using event.getMessage() instead of "%s" in the u.f() call

ivory sleet
#

nah

#

the string format's second argument is the message basically

dry meadow
#

For me it looks like it is translating colors in "%s" first and then replacing it.

ivory sleet
#

myes

patent horizon
#

did that

#

still no

#

ima try setting the color code in setMessage

ivory sleet
#

well ima try then

patent horizon
#

yup that did it

#

setting color codes in event.setMessage

ivory sleet
#

myes

#

as expected :3

patent horizon
#
        String condensedMessage = message.toLowerCase().replaceAll("[^a-zA-Z]","").replace(" ", "");
        if (filteredWords.filteredWords.contains(condensedMessage) || filteredWords.filteredWords.stream().anyMatch(s -> finalMessage.contains(" " + s + " "))) {
            event.setCancelled(true);
            String triggeredWords = filteredWords.filteredWords.stream().filter(s -> s.equals(condensedMessage) || condensedMessage.contains(" " + s + " ")).collect(Collectors.joining(", "));
            player.sendMessage(u.f("&3&lPLEXPVP &8» &7You cannot say blacklisted word(s) &b" + triggeredWords + "&7."));
            for (Player p : Bukkit.getOnlinePlayers()) if (p.hasPermission("staff")) p.sendMessage(u.f("&3&lSTAFF &8» &b" + player.getName() + " &7tried to say blacklisted word(s) &b" + triggeredWords + "&7."));
        }``` so my filter works pretty well
ivory sleet
#

ye

#

well you should clean the code

patent horizon
#

except for the fact that players can say blacklisted words at the beginning and ends of sentences

#

and idk how to make flags for those without tripping over words like

#

battlepass

ivory sleet
#

filtering is hard

#

its extremely easy to bypass with special chars

#

and empty spaces

patent horizon
#

spaces and extra chars are filtered out

ivory sleet
#

and then there's this issue, what if a word used in a special context makes it a non curse word

#

where it would normally be a curse word

patent horizon
#

like

#

assaulted

#

contains ass

ivory sleet
#

mye

#

theres a bunch of those

#

any Im heading off now, cya and gl wave_hi_bye

patent horizon
#

:(

ivory sleet
#

sadly I do have school tmrw

#

so ye lol

tender shard
#

have a good Thread.sleep Conclure

patent horizon
#

whys it expecting a variable?

low temple
#

You can’t do queries without assigning them to variables

#

so change it to
p-> spaceAbuse = p.length() > 2 ? spaceAbuse + " "+p+" " : spaceAbuse + p

#

also should probably use StringBuilder rather than String if ur gonna add strings together

patent horizon
#

ah ok

ornate frost
#

When you go to set a value in the config it asks for a path
How do I make the path the whole file?

tender shard
#

with plain SnakeYaml it'd be no problem I guess

golden turret
#

help me with some logic here pls

#
    @Override
    public void render(@NotNull MapView view, @NotNull MapCanvas canvas, @NotNull Player player) {
        Location center = new Location(player.getWorld(), view.getCenterX(), 0, view.getCenterZ());
        Location location = player.getLocation();
        game.getShoots().forEach((time, shoot) -> {
            if (System.currentTimeMillis() > time + Configuration.gameShootTime || shoot.distance(location) > 10)
                return;

            canvas.setPixel(128 - Math.abs(center.getBlockX() - shoot.getBlockX()), 128 - Math.abs(center.getBlockZ() - shoot.getBlockZ()), (byte) 16);
        });
    }```
#

basically, i want to show red pixels at where a shoot happened

#

like pubg

#

but the 0 of the canvas is the top left

#

not the center

tender shard
#

whut? when I added cursors, 0,0 was the center

golden turret
#

well

#

so

#

0,0 is this

tender shard
#

weird, then they use different coords for pixels and cursors

golden turret
#

maybe

#

wait

#

which code you used for cursor

tender shard
#

but where's the problem? can't you just

  1. get the x and z offset of the location you wanna mark from the center offset
  2. add 64 to both numbers
  3. done?
#

?paste

undone axleBOT
golden turret
#

worked until some point

#

this is my code rn

#

im in the center

#

but the red pixels are at my left

wet breach
golden turret
#

ik

wet breach
#

64,64 should be the center of the map

golden turret
#

yes

wet breach
#

so I don't see the problem....

golden turret
#

ok

#

i will make a video

wet breach
#

so is your issue translating the coords in the world

#

to a point on the map?

golden turret
#

yes

#

the code now

#

the setPixel sets the pixels at the same place as the cursor

wet breach
#

do you know the math for getting chunk coords from world coords?

tender shard
#

don't you have to switch center with shoot?

#

if you're left of the center, the number should be negative, not positive

wet breach
#

if you do, then the principle is the same for translating world coords to map coords

#

basically you have to compress the coords

wet breach
#

have to normalize all the values too

tender shard
wet breach
#

ah

#

Well, as far as translating the coords from the world to the map, you basically compress it in a similar way you would to get a chunk coord from a world coord

golden turret
#

it seems that negative numbers are the problem

tender shard
#

in the first code you sent you were also using Math.abs

#

do you still use that?

#

doesn't seem right

golden turret
#

nop

tender shard
#

simply do x = playerX - centerX

golden turret
tender shard
#

shouldn't that work for cursors?

golden turret
#

everything there is working fine

golden turret
quaint mantle
#

hey guy esixt StartAler in spigot plugin development?

wet breach
#

you divide by 16

#

2048x2048 blocks fits in a map view when zoomed all the way out, you can get the xCenter and ZCenter of a map which helps knows the area of coords the map will cover

quaint mantle
wet breach
#

helps if you make yourself understandable

quaint mantle
#

what?

wet breach
#

no one knows what you are talking about

quaint mantle
#

do you know a bedwars game in minecraft?

#

I have to do like those servers that when you enter it appears the game starts in 1 minute ..

wet breach
#

and you don't want it to be shown in chat?

#

you have a few ways you can do it

#

you can use the title bar, boss bar or broadcast it

quaint mantle
#

OH TANK YOU

golden turret
wet breach
#

ok, Xcenter and ZCenter refer to the coordinates in the world that the map represents

#

since we know 0,0 is top left and corresponds to Xcenter and ZCenter

#

and we know that a map can represent 2048 blocks for x and z

golden turret
#

hm

#

in my case it is a 128 map

wet breach
#

128x16 = 2048

golden turret
#

hm

wet breach
#

so to get the world coord to the map coord, you would dived the world coord by 16

#

divide*

#

also you have to use absolutes since there is no negatives in the map coords

golden turret
wet breach
#

yes, but then the additional check is to ensure the location you are grabbing is part of the map, not sure if your map is dynamic or static

#

if its just an area where people can't go outside of that isn't really necessary

#

Anyways, that is the math explained. Isn't all that hard 😄

golden turret
wet breach
#

you need to make sure BlockX is not a negative if it is, make it positive

shadow owl
#

Anyone know how to avoid the WorldChangeEvent trigger on player deaths?

golden turret
#

wait, i forgot to use setPixel

wet breach
#

thus when they respawn a worldchange event has to happen

shadow owl
#

It happens when their health reaches 0

wet breach
#

well yeah, they are dead. So before they hit respawn the server automatically sets them back at server spawn

#

even if visually it hasn't happened

#

not like they are coming back to life unless they hit that button 🙂

shadow owl
#

Ah, interesting. And I'm checking their health, but that isn't a good indicator either since their health is auto-reset back to 20

#

so how do I ignore the event for this instance?

quaint mantle
#

why do you want to ignore it

wet breach
#

well a death event would have been thrown first

#

listen for death event, set boolean, check boolean from your changeworld event if its because they died

#

if so, ignore

golden turret
#

frost

#

the math is not working

last sleet
#

Is there a way for EnchantmentTarget (getItemTarget) to return a target of only axes, instead of all tools?

wet breach
golden turret
#

some place outside the map

wet breach
#

did you ensure you didn't have a negative in there?

golden turret
#

yes

wet breach
#

what coords did you test it on

#

or what were the coords

golden turret
#

now it said

#

"i will work now"

wet breach
#

lol

shadow owl
wet breach
#

I don't know what it is you are trying to accomplish really nor can we see any code

#

are you trying to make it to where they respawn in the same world they died in?

primal sequoia
#

is there a plugin to become a werewolf, vampire, or human for spigot/paper?

#

was in Performium towny a while back

golden turret
primal sequoia
#

sorry, forgot lol

shadow owl
#

but the world change event is still being thrown

#

Probably because the flow is death -> server spawnpoint -> what would be my spawnpoint

#

but weirdly I'm not seeing that last part even happen ^

wet breach
#

ok, not sure why changeworld event is important

#

if you are listening to the respawn event and setting the respawn location, that is all that should be needed o.O

last flint
#

Hola necesito devolopers que me ayuden a hacer una Network md porfavor

shadow owl
#

Whenever they leave a certain world I want them to be tp'd to the server spawnpoint

#

so it seems like that's overriding my natural respawn (because before they can click the respawn button they're automatically respawned by the other event)

wet breach
#

so instead of doing anything in the respawn event, record their location and set a boolean, check that object in world change event. Teleport them to the location.

#

then you don't have to worry about anything being overridden

golden turret
#

help again with maps

#

i want to draw a square

#

i give it the size of the square

#

then it will draw the square based on the center

shadow owl
#

good thinking

golden turret
#

example:

wet breach
wet breach
golden turret
#

i dont know how to do it 😭

#

that is everything i have for now

#

now i just need to fill the arrays

wet breach
#

if you know how bounding box's work, it is similar to that

golden turret
#

idk

wet breach
#

give me a few minutes

#

to help you out

golden turret
#

wait

#

i think im doing it

wet breach
#

alright I will wait to see if you figured it out 🙂

golden turret
#

i did

#

!

wet breach
#

sweet, now I can show you the math to do it easily

golden turret
wet breach
tall dragon
#

frostalf are you writing a book? :D

ancient jackal
#

so tell me... where did you guys learn bitwise operations

golden turret
#

frost

#

where is the bible you are typing?

warm trout
#

How would I get the location to the left of a block if I know the direction its facing? (Im shit at vectors)

golden turret
#

what would i do:

#

convert the blockface to degrees

#

takes 90°

#

convert the degrees to blockface

#

success

tall dragon
#

legends say frostalf is still typing

wet breach
# golden turret

int BoxCenterX = MapX;
int BoxCenterZ = MapZ;

int BoxMaxX = BoxCenterX + TotalBoxHeight/2;
int BoxMaxZ = BoxCenterZ + TotalBoxWidth/2;
int BoxMinX = BoxCenterX - TotalBoxHeight/2;
int BoxMinZ = BoxCenterZ - TotalBoxWidth/2;

for (X=BoxMinX; x < BoxMaxX; x++) {
    for(Z=BoxMinZ; Z < BoxMaxZ; z++) {
        canvas.setPixel(x,z,(byte) 32);
        canvas.setPixel(BoxMaxX - X, BoxMaxZ - Z, (byte) 32);
    }
}

Ok I don't have my IDE, but this should work. My Primary HDD went down the other day so haven't quite setup everything yet so this is off the top of my head lol. You can further condense this if you want as the math basically revolves around mirroring so you are not running extra loops. Basically you only need to do it for half the box, then using math apply to the other half in the same loop.

warm trout
wet breach
#

This is why it helps to know math 😛

wet breach
#

if you know the direction the blockface you have is facing, then you can get the other sides of the same block and get adjacent blocks using relative locations

hardy swan
#

I have been trying to create a custom mob class but it seems like the mobs revert to their parent class whenever the chunk unloads and reloads. .setPersistent(true) does not seem to help. Anyone has any idea how this should work?

hasty prawn
#

You could try this @hardy swan

hardy swan
#

ah ok

hasty prawn
#

Otherwise, you need to use PDC and basically reload the entity if it's got some sort of flag that you set.

hardy swan
#

I registered on enabled

hasty prawn
#

if you get Coll's idea working btw lmk peepoGiggles

hardy swan
#

lemme try

tall dragon
#

so i have a mathf question. i have a formula with some exponentional growth. its used to determine how much an "upgrade" should cost. now if i want to calculate how much it will cost the player to upgrade 1000 levels at once. will i need to loop 1000 times and add up the cost each time to determine that cost or would there be a better way to achieve this?

wet breach
# hardy swan I have been trying to create a custom mob class but it seems like the mobs rever...

Yes, custom entities revert back to normal ones when they are unloaded in a chunk, this is because technically the entity dies and gets respawned when the chunk loads again with its data that was saved. So a way around this is to save the locations of your custom entities for when chunks unload as well as server restarts and then when the chunk gets loaded again, use your location list for that chunk to get the entity that is supposed to be yours, kill it spawn your custom one again.

wet breach
tall dragon
#

not sure how you mean just multiply

wet breach
#

I don't know your formula or how you calculating how much an upgrade costs to begin with

tall dragon
#

this is what i use

private double quadraticBezier(double progress, double min, double max, double total) {
        return quadraticBezier0((progress / total), min, max, min);
    }

    private double quadraticBezier0(double t, double start, double end, double intersect) {
        double scalar = (1.0 - t);

        double firstToIntersect = scalar * ((scalar * start) + (t * intersect));
        double intersectToSecond = t * ((scalar * intersect) + (t * end));

        return firstToIntersect + intersectToSecond;
    }
#

bassically it can create an exponentional curve between 2 values

#

but if someone wants to upgrade like 5k levels at once

#

thats alot of calculations with a loop

wet breach
#
this basically the formula for exponential growth
x(t) = x0 * (1 + r/100)^t
tall dragon
#

yea but that aint what i am working with

#

i need to be able to have a min & max and generate a curve between those 2

wet breach
#

do you have a max limit?

tall dragon
#

yes

#

for example

#

and that works fine. i just need a way to calculate multiple upgrades without looping

#

but im not sure im gonna be able to get arround that

hardy swan
hardy swan
wet breach
#

That is just the way entities work, their data gets saved and they despawn when a chunk unloads. You could see if you can use PDC to set custom data on those entities to make it easier to know which ones were your custom ones

#

but essentially when the chunk loads and the entities respawn, all you have to do is either kill the entity that is the normal one or I don't remember if there is a spawn event for entities if the chunk loads, cancel the event for those entities that were originally yours and spawn your custom ones in. In either case, custom entities don't get saved because the MC doesn't use your entity class to spawn the entity.

wet breach
# tall dragon for example

not sure if you will be able to get around the looping. I will have to work out the math or ponder on it to see if there is a way you could simply not do that. However, what you could do instead is pre-calculate all the known values of your curve up to the max denoting the levels

#

in this manner you don't necessarily need to loop, you already know what it should be

tall dragon
#

there could be millions of upgrades though

wet breach
#

you said there was a max

tall dragon
#

yes there is

#

which could be millions

wet breach
#

so the max is arbitrary then

tall dragon
#

yea i probably shoulda mentioned that

wet breach
#

well, I recommend running this function in another thread

#

this way, if it takes a bit of time, at least the main thread can still do its thing lol

#

I do know for fact there is a function you can use to figure out all the known points between your two points, just not sure if the function can be done without a loop

#

so I will have to research a bit to figure it out, will let you know if I come up with something 😛

tall dragon
#

ah, thanks i appreciate that

wet breach
#
// t is a value between 0-1 to represent percentage and thus will always be a fraction between the start and end points.
t = 0.5;
x = (1 - t) * (1 - t) * p[0].x + 2 * (1 - t) * t * p[1].x + t * t * p[2].x;
y = (1 - t) * (1 - t) * p[0].y + 2 * (1 - t) * t * p[1].y + t * t * p[2].y;

this should give you any point as long as you always know the max AKA the end point regardless of what it gets set to, and the start point
p[0] is start point, p[1] is your control point, p[2] is your end point  t is the parameter going from 0-1

maybe not be code per-say but, if you know how to turn your levels into percentages this should work

#

also hopefully you understand the math too XD

lavish hemlock
#

Y'ALL

#

what is the best Java disassembler w/ GUI?

brave sparrow
#

Java isn’t assembled

#

You want a decompiler

wet breach
#

lol

lavish hemlock
#

I don't want a decompiler because I don't want to see Java source code

brave sparrow
#

Java isn’t assembled

#

Lol

#

You just want to look at the bytecode

#

So any bytecode editor would work

lavish hemlock
#

Okay if you wanna get pissy about the semantics

#

What is the best

#

JVM BYTECODE DISASSEMBLER

#

with a GUI?

brave sparrow
#

It’s not semantics

#

It’s not a Java anything you want

#

You just need a standard bytecode viewer

#

Java bytecode isn’t special

#

A disassembler is something specific

wet breach
brave sparrow
#

Is that gonna decompile it for them lol

wet breach
#

it will do whatever it is they are wanting

#

it will decompile or let you just look at bytecodes

#

and its a GUI

brave sparrow
#

Fair enough

lavish hemlock
#

I'm still gonna call it a disassembler :p

#

I mean, something doesn't need to be assembled to be disassembled either

#

You just need to convert it to an assembly language

brave sparrow
#

Java doesn’t get converted to assembly

#

It doesn’t get assembled

#

Lol

lavish hemlock
#

You can assemble JVM bytecode

#

There are tools for it

#

And there are tools to disassemble it too

#

I prefer the term "disassembler" as

#

well

#

for one

#

THE FUCKING JDK USES THE TERM

brave sparrow
#

A disassembler turns machine code back into assembly

lavish hemlock
#

The javap command disassembles one or more class files.

#

And that's not entirely true

brave sparrow
#

“A disassembler is a computer program that translates machine language into assembly language—the inverse operation to that of an assembler. A disassembler differs from a decompiler, which targets a high-level language rather than an assembly language.”

lavish hemlock
#

You could very well disassemble bytecode as bytecode is just a specialized machine language.

#

Literally I googled the definition

#

The only thing that makes bytecode and machine code different

#

is that machine code is passed to the hardware processor/CPU

#

instead of a VM

#

I don't consider that difference great enough to warrant completely separating the terms

brave sparrow
#

Suit yourself ¯_(ツ)_/¯

lavish hemlock
#

Also "machine code" is just vague as well, as there's multiple instruction sets (x86, x64, ARM, MIPS) and multiple executable formats (PE, COFF, ELF)

#

(Although the OS would handle the latter)

#

And actually

#

If you really want to keep arguing that JVM bytecode can't be disassembled because it's not machine code

#

Jazelle DBX (direct bytecode execution) is an extension that allows some ARM processors to execute Java bytecode in hardware as a third execution state alongside the existing ARM and Thumb modes. Jazelle functionality was specified in the ARMv5TEJ architecture and the first processor with Jazelle technology was the ARM926EJ-S. Jazelle is denoted...

A Java processor is the implementation of the Java virtual machine (JVM) in hardware. In other words, the Java bytecode that makes up the instruction set of the abstract machine becomes the instruction set of a concrete machine. These are the most popular form of a high-level language computer architecture today.

#

^ JVM bytecode is technically machine code too as some hardware processors can run it

#

Anyway:

  • Krakatau and Jasmin can assemble JVM bytecode using the Jasmin assembly language (Krakatau modifies it slightly).
  • Krakatau can disassemble JVM bytecode to the Jasmin assembly language.
#
  • The JDK tool javap refers to itself as disassembling classfiles (thereby making it a disassembler)
#
  • OpenJDK has an internal project called AsmTools, that, well... "AsmTools consist of a set of (Java class file) assembler/disassemblers"
lavish hemlock
wet breach
#

while in practicality you are correct that there was hardware that could execute bytecode directly

#

they have since been obsolete

lavish hemlock
#

Yeah and Itanium is discontinued but do you invalidate its existence as a processor?

wet breach
#

No, but it is no different then there being Java OS's that existed. But again are now obsolete or no longer used. These all came about because processor speeds were still in the mega hertz and not in the giga hertz where it doesn't make a difference

#

But I have already stated you are correct about there being hardware that could execute bytecode directly

#

however in modern times, to make your assembly/disassembly definition fit, we could just pretend the JVM is the cpu for the purposes

#

as long as we pretend there isn't something in between then the definition works 🙂

lavish hemlock
#

I mean that was just with the definition of "machine code"

#

And, you gotta argue semantics to win against semantics

wet breach
#

Anyways....we can move on now lol

lavish hemlock
#

Yep

#

I have claimed my victory

#

I am satisfied... for now

#

wow my internet is slow af

kindred valley
#

İm seeing the discord code messages white on mobile. How can i fix it

worn tundra
#

No fix, that's how mobile works

kindred valley
glossy venture
#

jvm bytecode is run on a virtual, hardware like architecture so i count it as machine code

glossy venture
#

why does generics have to fuck me over again

#

the registry type is

#

the exact thing it wants

quiet ice
#

Wildcards are dangerous @glossy venture

glossy venture
#

yeah i know

#

im too lazy to type everything out tho

#

but not i regret it

quiet ice
#

If you want read-only wildcards are good, otherwise don't use them

glossy venture
#

yeah

quiet ice
#

I think ModElementRegistry<? extends CarbonItem> might work but idk

#

Also I'd use diamond operators

glossy venture
#

i hate how the compiler requests a generics class which isnt even constructable

quiet ice
#

That is because you Tell it to use it

glossy venture
#

yeah but theres no way to get the generic type without the type parameters

quiet ice
#

That's generic ersure for you

#

But there are ways of working around this. I might Help you on this when I'm free especially because I Just scrapped my mega-project I Had been working on

glossy venture
#

what is capture of ...

#

im so confused

#

ive never understood capture of

#

what the fuck

#

ok i kinda hate this but it works

smoky oak
#

what's the event for a player dropping an item?
PlayerDropItemEvent

prime harness
#

hi guys, can you help me please? my friend set a plugin when a player enter to the server. a large writing appears with the name of the player for all player online. how can i remove it?

worn tundra
#

@glossy venture damn bro, you looking for contributors?

glossy venture
#

nah not yet

#

barely finished the framework

smoky oak
#

on the server there's a folder called plugins. go in there and remove the plugin @prime harness

glossy venture
#

of the api

smoky oak
glossy venture
#

otherwise it will be a mess

prime harness
glossy venture
#

reading through the code

#

i swear

kindred valley
#

How can i compare iterator.next with an int

smoky oak
worn tundra
glossy venture
#

really

#

lmao

worn tundra
#

yeah, have lots of experience

#

could do blocks

brave sparrow
glossy venture
#

alright sure but ill still need to implement some framework

smoky oak
#

shrugs

glossy venture
smoky oak
glossy venture
#

when you remove one stupid import but then import C

#

because Carbon

prime harness
brave sparrow
#

Why don’t you just ask your friend what plugin he installed and ask him to remove it

glossy venture
#

also @worn tundra idk how to host the resource pack, im trying to use an http server hosted on the minecraft server but its not working

worn tundra
#

because it needs extra ports

prime harness
brave sparrow
#

Remove plugins one by one until you figure it out

worn tundra
#

work at the same time

glossy venture
#

i know

worn tundra
#

is that port open tho

glossy venture
#

im doing it on 25566

#

idk im binding to it

#

theres no error in the console

worn tundra
#

what exactly isn't working there

glossy venture
#

heres the issue

earnest forum
#

are u making a custom server jar

worn tundra
#

I assume the resource pack is zipped?

glossy venture
#

nah its a plugin to load content mods

kindred valley
#

How can i get the output from iterator.next

glossy venture
#

yep

glossy venture
worn tundra
#

Isn't the url supposed to end with ".../file.zip" in that case?

#

Since you need a straight link to the file

glossy venture
#

do you?

#

ill try

worn tundra
#

Yeah, minecraft needs a link that downloads the file right away

#

returns like an outputstream

glossy venture
#

oh that would make sense

worn tundra
#

You'd also have to create your own HttpHandler

glossy venture
#

it wasnt working in the browser tho

worn tundra
#

Look into that interface

glossy venture
#

creating the context

worn tundra
#

Oh

#

Right

#

Something like this

#

Which I assume you're doing something similar already

prime harness
#

i find it. it is the s.i.r. plugin

kindred valley
#

Hello guys is forge simpler than spigot

smoky oak
#

no

#

unless you do it with one of the half-working mod creators

#

but then you have to still do a lot manually

ivory sleet
#

Once you learn Minecraft’s code that is

vocal cloud
#

Forge is way more complex than spigot

ivory sleet
#

It’s a bit more intricate sure but with good tools it becomes quite easy to work with

vocal cloud
#

Forge has much less documentation. You'll be spending a lot of time reading and understanding vanilla source code. You need to have a full understanding of how tags and the like work and interact with registries. Etc etc

quiet ice
# glossy venture ive never understood capture of

It's Wildcard. Capture of X means everything that is an instance of X. ? extends X means everything that is an instance of a class that extends X (theoretically this includes direct instances of X but idk)

ivory sleet
#

So solving most problems (if you have a good knowledge about Java (and partly Minecraft I assume)) shouldn’t be too complicated

smoky oak
#

what happens when a static method gets called by multiple threads, and what happens if a non-static method gets called by multiple threads?

#

ie

ivory sleet
#

Nothing really happens

#

Just gets called on that thread that’s all

smoky oak
#

what is important to be aware of

ivory sleet
#

If you have state mutation you might run into concurrency update problems

smoky oak
#

are there any problems if it runs with separate locations as args but the same instance of an event for example

vocal cloud
ivory sleet
#

No not really, Moterius

smoky oak
#

i ain't an engine conclure

ivory sleet
#

Better? :3

smoky oak
#

ye :D

ivory sleet
vocal cloud
#

Just don't use Mc creator or I'll hit you with a stick