#help-development

1 messages · Page 2276 of 1

noble lantern
#

that site

#

or not

#

okay

#

is that site bad or something??

spiral vault
#

?

noble lantern
#

google "1.19 spigot"

Should be first link on top

#

idk why this chat blocks the name of that website

earnest forum
#

get bukkit?

#

thats dumb

noble lantern
#

yeah that site

spiral vault
#

I tried to make a guide from the spigot site and nothing came of it. (Tried through Buildtool)

earnest forum
#

first link

#

not spigot

spiral vault
#

bukkit?

noble lantern
#

Why is the chat blocking that link

earnest forum
#

yes

eternal oxide
#

Bad, Bad site

#

?bt run buildtools

undone axleBOT
noble lantern
#

Why so? Ive used it for years now

earnest forum
#

for just server jar

#

not for development

noble lantern
#

^

eternal oxide
#

yes

#

Distribution is illegal. Always build your own

spiral vault
#

i tried buildtools

noble lantern
#

illegal for them to host, but not illegal for us to posses or download

spiral vault
#

But the download is stuck

eternal oxide
#

wait a while BT can take a little while

ivory sleet
#

For how long?

#

Cuz you need to be a bit patient

noble lantern
#

BT normally takes me like 5-10 mins

humble heath
#

any idea how to fix this trying to update an abandond plugin

ivory sleet
#

Use materials instead

#

getType()

#

And then check what material id 68 is

humble heath
noble lantern
#

its not a ItemStack

#

That is getting the numerical ID of a Material

#

which is for old asf minecraft

#

like back when if you wanted lapis lazuli you needed to add a duarbility tag lmao

quaint mantle
#

any tuts out there teaching you how to add multiple version support to ur plugin?

noble lantern
quaint mantle
#

no but I wanna add more versions

#

like my plugin is currently 1.17

#

I want to add 1.8 support 3

#

*2

humble heath
#

so what would i need to do to change all of it then

noble lantern
#

so you need to revert to 1.8

#

its a horribly idea

#

dont do it

ivory sleet
#

Usually youd have to use maven/gradle

noble lantern
#

someone get the bstats graph

ivory sleet
#

And write a bunch of abstractions

#

Or use reflection

#

But then you lose compile safety

noble lantern
#

If (MinecraftVersion.currentVersion() >= 1_12_2) do1_12_2FeatureOnlyHere()

#

ez

tacit drift
#

you won't be able to compile

noble lantern
#

you can compile with that code above

#

its from NBApi

#

that class is in NBTApi, the MinecraftVersion one

quaint mantle
noble lantern
quaint mantle
#

nop

noble lantern
#

or hardcoded ma-

#

so hardcoded

ivory sleet
#

Well you won’t be able to support 1.8 then regardless

#

Presupposing you use materials from more modern versions

noble lantern
#

yeah theres a bunch of api changes from the 2

ivory sleet
#

Well unless you’d wanna change that ofc

noble lantern
#

like inventory names and new events

#

and you can handle it from there

ivory sleet
#

Yeah a lot of things have been changed and obviated

noble lantern
#

You can borrow NBTApi's MinecraftVersion class, but its not gonna work fully for 1.8 -> 1.17 if your project is on 1.17 right now

#

eg inventory name getting was changed to getView().getName() in like 1.12

#

i see that error a lot in older plugins

#

and PrepareAnvilEvent is another big one i see alot too

#

or AnvilPrepareEvent, whatever tf its name is

#

oh god 1.8 anvil handling ._.

shadow zinc
#

or any other flag

#

and this line confuses me

#
        PROCESSORS.get(element).andThen((acc, list) -> list.clear()).accept(accumulator, commandArgs);
#

I've never seen this before

#

andThen

#

Accept

#

I googled it but I'm not getting a great result

ivory sleet
#

This looks like code from smile

eternal oxide
#

it is

#

He's teaching brain surgery to miners

noble lantern
#

hahaha

shadow zinc
#

I'm not entirely a beginner, I'm somewhere near intermediate

#

obviously not at whatever level that is

ivory sleet
#

Well you clearly haven’t touched the BiConsumer but yeah

shadow zinc
#

nope

#

guess I never needed it until now

ivory sleet
#

It’s usually not needed

#

Because code can often be represented with more clear intent

noble lantern
#

Ive never used them before either tbf

shadow zinc
#

So I did a quick google and it says it doesnt return a value, BiConsumer

ivory sleet
#

Yes

#

It consumers two values

noble lantern
#

Optionals and Completable future sunglas

eternal oxide
#

I understand that code, but I'd never use it

ivory sleet
#

HOWEVER

#

the biconsumer instance itself does have some methods

#

Such as andThen

#

Since a BiConsumer is effectively just a class with a single method that you override

#

And andThen is just a helper method at most

eternal oxide
#

its basically saying, get "this" and then do...

shadow zinc
#

so how do I get a return?

eternal oxide
#

You don;t "get a return" from teh Processor. Its passing into a lambda

#

which it then processes with teh accumulator, args

shadow zinc
#

So is there another way?

eternal oxide
#

I'd have to read back what you are actually attempting to do

shadow zinc
#

flags

#

in commands

eternal oxide
#

ok#

#

well all your code goes in the WorldCreationAccumulator

#

in teh complete method you do your actual world creation

#

force, world, type you process teh values passed to define your world creation

shadow zinc
#

right

#

thats one way

#

and just to be clear im doing world creation stuff

#

it was just the example he gave me

eternal oxide
#

eg```java
private WorldType = WorldType.NORMAL;
public void type(String name) {
type = WorldType.valueOf(name);
}

shadow zinc
#

and I can show you my actual code if it helps give you some perspective

#

so

#

Thats a bit annoying

ivory sleet
#

Sure

shadow zinc
ivory sleet
#

Actually

compact cape
#

Does assert key word work in the plugin?

shadow zinc
#

i think so

#

I normally use if

compact cape
#

But it doesn't seem so It keeps skipping my checks

ivory sleet
shadow zinc
#

broadcast length of args

shadow zinc
ivory sleet
#

For you to learn at a deeper level what runnable, consumer, bi consumer, function, bifunction really have to offer

ivory sleet
#

But you need a jvm flag to enable it

#

But it’s usually not prefer to use assert in actual production because it slows down the code a bit

compact cape
ivory sleet
#

Precisely

compact cape
#

I just wanted to minimize the lines 🤷

ivory sleet
#

You can write a validation function other wise

#

static void validate(boolean expression)

#

or sth

frozen cedar
#

how to prevent player from getting stuck in the wall when teleporting to random coordinates?

compact cape
#

Tbh I have one 😂 But assert looked cooler

ivory sleet
#

You’d have to check adjacent locations recursively until you find a 1x1x2 spot

ivory sleet
#

It’s one of the ancient keywords people stopped using due to JUnit being significantly more reliable and performant

#

(As assert was mainly used for tests)

frozen cedar
noble lantern
ivory sleet
#

He’s cool

#

Tho I’m still awaiting for him to drop some merch

noble lantern
#

https://www.youtube.com/watch?v=YpS0Jh5yqIw

I would want merch with quotes from this video

How to write horrifically awful Java code!
Complete Java course: https://codingwithjohn.thinkific.com/courses/java-for-beginners

Any fool can write good Java code, but it takes an expert to create truly awful, unreadable, impossible-to-maintain Java code. That's what we'll be learning in this lesson!

What makes code bad? There are many ways yo...

▶ Play video
ivory sleet
#

Lol

compact cape
# ivory sleet Ye

Well I guess I should use this method 🤷 (AssertionError is handled by plugin as a command failure and won't cause any issues)

ivory sleet
#

Ugh

#

You don’t use errors like that

noble lantern
#

sir you have a double s in your string

ivory sleet
#

Not the assertion error

#

It’s not meant to be caught like other normal unchecked exceptions

compact cape
#

Why not?

ivory sleet
#

If it throws it means something went terribly wrong under wrong assumptions

compact cape
#

Which I assumed in the command 🤷

ivory sleet
#

For instance the class Objects.java throws it in its constructor as a way to tell that it should not work to create an instance of Objects

compact cape
#

The handler only handle the commands not general

ivory sleet
#

(Not to be confused with Object)

#

you should have your own runtime exception instead

#

Then

#

It’s much more expressive

#

and reusable for that part

noble lantern
#

i have a cool name

#

CommandException

#

: D

ivory sleet
#

Ye

quiet ice
noble lantern
#

doesnt that extend runtime exception

ivory sleet
#

Well I mean

#

UOE is used for when preview features aren’t enabled in the jdk

quiet ice
ivory sleet
#

For utility classes to dissuade their instantiations assertion error is used

quiet ice
ivory sleet
#

Then whether that’s the best choice is another part

ivory sleet
compact cape
#

I guess I'll use CommandException then 😉

ivory sleet
compact cape
#

I thought assert will work... but since it does not, Custom exceptions are ok

ivory sleet
#

Ye

frozen cedar
#

ChatColor#of in 1.18?

ivory sleet
#

Assert is pretty much useless anyhow

#

Yes

#

You’d use bungee chat tho @frozen cedar

#

(Since as aforementioned we have JUnit)

quiet ice
#

It May Prove usefull for IDEs

compact cape
#

My assumption was that assert will work so I made my API catch AssertionError and handle that

quiet ice
#

Given that assert will be a NOP in prod

ivory sleet
compact cape
#

But I can change the API 🤷

quiet ice
#

Well to explain to the IDE that a value is actually not null

ivory sleet
#

Well Objects::requireNonNull exists

quiet ice
#

Requires EEA

ivory sleet
#

EEA?

quiet ice
#

Eclipse external annotations

crude charm
#

I want to make a system where players can put an item in a menu and can retrieve those items through a different means later and when they reopen the menu, the same items with the same nbt properties will be there. How should I go about storing this? I want it to be scalable to hundreds and thousands of players, not just a config file, system memory or something that can easily break

quiet ice
#

And given that Objects#requireNonNull is a Generic Method, Eclipse will get a Heart Attack either way

#

I usually use my own requireNonNull Method due to that

ivory sleet
#

sounds like a bit of a problem concerning Eclipse

quiet ice
#

It's an issue that is inherent to null checking

ivory sleet
#

Well in IntelliJ requireNonNull, a null check or well if you really need… assert, all three work (or @SuppressWarnings)

#

Myeah null sucks anywa

hybrid spoke
#

hopefully you guys null every var after used

quiet ice
#

(Not to be confused with the frame Stack)

ivory sleet
#

First you do need the vertical scalability, but assumes you’ve maxed that out sounds like you wanna have some underlying datastructure there

quaint mantle
#

anyone can help pls ^
why am I getting this error?

sage dragon
eternal oxide
limpid bronze
#

Hey, I'm trying to verify if a item has a specific display name but the name has color. I tried to add the color to the verification and only the string without color but these 2 tries doesn't work. How do I do that?

eternal oxide
#

don;t identify items by their name

earnest forum
#

?pdc

eternal oxide
#

?pdc store a flag in the PDC

limpid bronze
#

Oh okay thanks

limber owl
#

how can I replace/remove biome from generating, like removing the oceans in blockpopulator

eternal oxide
#

Biome is an Enum so I guess you'd have to custom gen your world if you want to exclude a biome.

limber owl
#

frick

eternal oxide
#

well you could specify the biomes to use in teh WorldCreator generator settings

limber owl
#

how

eternal oxide
#

um, seems they only work for flat worlds

limber owl
#

frick again

cunning canopy
#

what is the best way to identify a player?

#

is there like a unique id or something?

formal bear
#

uuid

cunning canopy
#

how do I obtain it?

tardy delta
#

Player#getUniqueId

#

^^

cunning canopy
#

thanks

tardy delta
#

never store player instances in some kind of collection too

cunning canopy
#

will it be the same when they rejoin?

daring maple
#

yeah

tardy delta
#

the uuid? yes

#

not the player instance

cunning canopy
#

can you obtain a player instance from a uid?

daring maple
#

Its UUID is persistent across all minecraft servers

#

And yes

cunning canopy
#

thanks ppl

tardy delta
#

Bukkit.getPlayer(uuid) yes

eternal oxide
tardy delta
#

i guess check the docs

cunning canopy
#

is it of the builtin java type UUID?

tardy delta
limber owl
# eternal oxide WorldCreeator has a BiomeProvider you can set.

I found this

Field biomesField = BiomeBase.class.getDeclaredField("biomes");
biomesField.setAccessible(true);

if (biomesField.get(null) instanceof BiomeBase[]) {
    BiomeBase[] biomes = (BiomeBase[]) biomesField.get(null);
    biomes[BiomeBase.DEEP_OCEAN.id] = BiomeBase.PLAINS;
    biomes[BiomeBase.OCEAN.id] = BiomeBase.FOREST;

    biomesField.set(null, biomes);
}

but I have only Biome class and no BiomeBase

#

don't mention 1.8 here or people will send you death threats 👀

wide gyro
#

💀

daring maple
#

lmao

limber owl
#

because people can't stand someone uses other version than them

tardy delta
#

that version is older than my grandma thats the issue

limber owl
#

you see?

hybrid spoke
#

cringe who uses 1.8

#

im on 1.5.2

limber owl
#

this one is good fr 💀

dry forum
#

https://pastebin.com/kG4e1Z4t anyone know why this would be lagging my server? its supose to load a schematic using FAWE over a period of time so its kind of in rows which it does fine on a small scale but i have a relatively small schematic (20x20x40) ish and it crashes my server ;p im loading it over 1000 ticks so its not like its all being set at once

gleaming grove
#

Does somebody have run Spring Framework inside plugin?

vocal cloud
#

Why would you run spring inside a plugin? Do you really need all the features of spring?

gleaming grove
#

Like its more handy then using raw implementation of http server or websocket

vocal cloud
#

It's pretty bulky for a plugin.

gleaming grove
#

Ye I know

vocal cloud
#

Doesn't justify it

#

Also did you run 1.8.8 build tools?

#

What does doesn't work mean

#

What? You shouldn't be compiling build tools?

#

Just download the jar from spigot

#

What's the error

wind pond
#

check also your java version you is trying to compile 1.8.8 version because needs java1.8 or lower

#

you have java 9 or higher version installed?

#

maybe versions are confliting in %PATH%

#

😄

#

oh yeah, its patch script

vocal cloud
#

And this is the latest version of buildtools from the website?

wind pond
#

seems to someone wrote \r manually in file instead of enter newline?

daring maple
#

Dont you wanna use git bash to run it tho?

#

Instead of Windows Batch

wind pond
#

well inst same

#

git bash will run .sh files

vocal cloud
#

Aren't you on windows?

#

Try downloading the BT from above.

wind pond
#

seems that is considering \r (carrigage return) as non newline char

carmine valley
#

hey guys, I'm trying to access the firstPlayerSpawn and secondPlayerSpawn from a different class and for some reason I can't even access them in my getter method, I tried using public but that's not possible. any ideas on what I should do? ```java
public class SetLocationCommand implements CommandExecutor{

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if(sender instanceof Player) {
        Player p = (Player) sender;
        switch(args[0]){
            case "1":
                Location firstPlayerSpawn = p.getLocation();
                break;
            case "2":
                Location secondPlayerSpawn = p.getLocation();
                break;
    }}
    return true;
}
public static Location getLocation(byte b){
    switch(b){
        case 1:
            return firstPlayerSpawn;
            break;
        case 2:
            return secondPlayerSpawn;
            break;
    }
}

}

vocal cloud
#

gag I just compiled 1.8.8

daring maple
#

They are variables

wind pond
#

i think static will not work

tardy delta
#

oh god

daring maple
#

Not fields

wind pond
#

since its per player i think right?

vocal cloud
#

Either way they have to be via an instance or static

carmine valley
#

no these are supposed to be static locations

vocal cloud
wind pond
tardy delta
#

dont have static locations, if another player executes that command, they will be changed

wind pond
#

and that Map you can make it static

carmine valley
#

they are not player-dependent, they are supposed to be global

wind pond
#

then you check uuid in Map, if contains fine take and update values, or else add new

tardy delta
#

dont see a reason to use a switch or a byte too

vocal cloud
#

E F F E C I E N T

wind pond
#

also switch on java isn't well optimized by compiler

tardy delta
#

smh

#

switch is a lookup table

#

but for 2 values :/

limber owl
#

?paste

undone axleBOT
carmine valley
#

I will just initiate the variales outside the onCommand method and set it to them, screw getters and setters

wind pond
#

^

tardy delta
#

smells like a design problem

#

i used to do such things too

carmine valley
#

just a quick throw-together code

#

I will optimize it later

#

later

wind pond
#

l a t e r

#

🤣

#

i remember when i said this while i was doing my auto miner plugin

vocal cloud
#

Tech debt doesn't exist it can't hurt you

carmine valley
river oracle
#

I smell large design flaws and bad practices

carmine valley
wind pond
#

don't work emoji as image :/

eternal oxide
river oracle
quaint mantle
#

ah

vocal cloud
wind pond
#

any ways to keep phyisics state on falling block on paper?

river oracle
#

Wtf is paper spigot

tardy delta
#

tf is paperspigot?

wind pond
#

i was doing an airdrop like system, but falling block just got teleported to floor

sage dragon
#

Who doesn't know what Paper||Spigot|| is?

noble lantern
#

SpigotPaper?

tardy delta
#

a spigot with a piece of paper in it

wind pond
#

an work around i did, was using an minecart with an blaze mounted in 🤣

tardy delta
#

spigot 🗞️

sage dragon
vocal cloud
#

What use is a wet piece of paper

river oracle
wind pond
noble lantern
wind pond
#

its an spigot

#

😂

river oracle
#

I'm not even joking I actually have no clue lol

sage dragon
vocal cloud
#

Where is the whereami command

noble lantern
#

its paper lmfao

vocal cloud
wind pond
#

🤣

river oracle
daring maple
#

They used to be paperspigot

noble lantern
#

Nah theyre name is PaperSpigot in logs

river oracle
#

Oh

noble lantern
#

or spigotpaper

river oracle
#

Never noticed

noble lantern
#

whatever the fuck

eternal oxide
#

pretty sure paperspigot is very old and no longer active

noble lantern
#

prolly legacy

cunning canopy
#

can I call a function from the main class from a command class?

noble lantern
#

maybe

daring maple
#

They still have its source code as a branch on github tho

wind pond
#

do u think global banning from mojang will be a good idea?

noble lantern
#

nope

wind pond
#

i could think lot of trolls reports every second, and people getting banned for no reasons

noble lantern
#

oneword

cunning canopy
#

well

river oracle
#

?learnjava

undone axleBOT
river oracle
#

Got me

cunning canopy
#

I know I prob can

tardy delta
#

Player#setFallDistance(0) not working to prevent fall damage?

noble lantern
#

its basic java knowing the answer to that (not you brush)

cunning canopy
#

but I dont know how

wind pond
noble lantern
river oracle
#

Lol

wind pond
#

idk if fall distance is calculated every player move

noble lantern
#

Brush

#

you just wanna cancel fall damage?

wind pond
#

cancel damage event

noble lantern
#

EntityDamageEvent should have a getCause

tardy delta
#

cancel fall damage only when they stop vanishing

#

so thats where i used that method

carmine valley
#

because you can do /damage

#

and specify a cause

river oracle
tardy delta
#

lol

#

bedrock player

river oracle
#

I think it's a bukkit api thing

tardy delta
#

yall thinking lol? im sure

tacit drift
#

there is /damage in bedrock

carmine valley
noble lantern
#

you can damage a player with a specified Entity

tacit drift
#

but to prevent falldamage for unvanished players, add the unvanished players to a list that clears them from there after x seconds or after taking fall damage

#

and after that you can figure out what to do 👍

tardy delta
#

ah yes i post a pic of a warden

somber sequoia
#

Hey, I need to fetch a offline player by their name but I cant lag the server, is there any way to do that?

tardy delta
#

do it async

#

?scheduling

undone axleBOT
somber sequoia
#

aight thanks

chrome beacon
#

Make sure to go back to the main thread when using the api

somber sequoia
#

youve got me confused now

#

how would i do that

tardy delta
#

nest runTask in runTaskAsync

chrome beacon
#

runTaskAsync -> getOfflinePlayer -> runTask -> do other stuff

tardy delta
#

or use some CompletableFuture whatever you want lol

chrome beacon
#

TaskChain :)

tardy delta
#

dunno what that is

chrome beacon
#

It hasn't been updated in a while though

hybrid spoke
tardy delta
#

and then fall damage is blocked?

hybrid spoke
chrome beacon
cunning canopy
#

my command wont execute. it says the command does not exist even tho I did register it

unborn kiln
#

How would I go about doing that? Because every single video that I watch they all say to replace the texture of an existing block

chrome beacon
cunning canopy
chrome beacon
#

And did you register that in your plugin.yml

cunning canopy
#

thats prob the problem lol

#

how do I do that?

#

is it commands: []?

tardy delta
#

?plugin.yml

last ledge
#

system.put.print('Plugin Enabled'){ throwing error

noble lantern
#

You dont see why?

cunning canopy
chrome beacon
#

I have a feeling someone has lacking Java skills

quaint mantle
#

'put'

tardy delta
last ledge
chrome beacon
noble lantern
#

what

chrome beacon
noble lantern
#

For one

#

system is not a valid referance

#

its System

#

two

last ledge
#

I started Java Yestarday, I'm trying to build my first plugin today 🙂

chrome beacon
#

Oh no

tardy delta
#

lmao

noble lantern
#

Its not put, its out as in the out cons-

#

nvm

#

im not gonna explain it lol

chrome beacon
#

You did not learn enough Java in one day

last ledge
#

I did, it was learn java under 14hrs Video

quaint mantle
#

you can't learn enough Java in one day

last ledge
#

quite informative

noble lantern
#

bro

tardy delta
#

videos are bad

noble lantern
#

this gotta be a troll

hybrid spoke
#

you a pro now

eternal oxide
#

Keep going. You'll get there

quaint mantle
noble lantern
#

Just dont jump right to a minecraft plugin

#

You should learn from other base java projects first

#

Its like trying to run when you cant walk

hybrid spoke
last ledge
#

Yup yestarday I completed Java, today I'll start with Java Script

#

quite productive day

quaint mantle
#

this is a joke

noble lantern
#

troll confirmed

hybrid spoke
#

i know how to program in spigot

noble lantern
#

Can there be a rule like no trolling in here

#

in the description

cunning canopy
noble lantern
#

stg someone always coming in here thinking this type of stuff is funny

noble lantern
#

No one is able to learn a language in 14 hours

#

Your brain needs to sleep, and reproduce over and over again before it actually learns

hybrid spoke
last ledge
#

but gotta do it, aim high.

noble lantern
#

i could prolly learn a basic convo in spanish in a day

hybrid spoke
tardy delta
#

is tomorrow going to be C?

noble lantern
#

ill sound stupid and no accents, and inpror grammar but ide still do it

quaint mantle
hybrid spoke
noble lantern
#

no tommorrow is machine code

#

actually no

last ledge
noble lantern
#

tmrw hes learning to write java from smali code

tardy delta
#

writing binary

somber sequoia
eternal oxide
#

Tomorrow he finishes AI

hybrid spoke
noble lantern
#

^^^^^

somber sequoia
#

5 hour long binary video

noble lantern
quaint mantle
#

anyways, I have a question
I want to include a library in a plugin. the library itself is not a plugin, so when I put it in the plugins folder it gets angry. How do I supply a library jar for a plugin to use?

last ledge
#

Which one should I start first Java Script or C?

noble lantern
#

LOL

eternal oxide
somber sequoia
ivory sleet
river oracle
noble lantern
#

the entirety of this chat: shade

quaint mantle
chrome beacon
tardy delta
#

lets go write assembly

ivory sleet
noble lantern
somber sequoia
#

can we rewrite spigot in assembly

river oracle
#

I don't use C lol

last ledge
#

netflix

noble lantern
#

same kek

hybrid spoke
noble lantern
#

no

quaint mantle
noble lantern
#

netflix uses a lot of Javascript though in the form of NodeJS

#

same with paypal

ivory sleet
#

Does objective C count as C?

noble lantern
#

discord

noble lantern
eternal oxide
noble lantern
#

yeah i guess most os's would use native c

tardy delta
#

C++ kek

last ledge
#

Anyways guys gtg, was just kidding, mb

noble lantern
#

since its closest to the cpu

somber sequoia
#

and nginx is c

quaint mantle
noble lantern
#

is nginx made in c?

#

always thought it was c++

somber sequoia
#

its c

eternal oxide
noble lantern
#

interesting didnt know that

#

prolly explains why its so smooth ngl

quaint mantle
#

I only have it locally

eternal oxide
#

maven

quaint mantle
#

oh ok

eternal oxide
#

if its a local libray you have to shade it into your jar

quaint mantle
#

eh

#

hmm I don't really want to shade because I want it to be used in multiple plugins on the server

somber sequoia
#

there was a way to put the lib into the server

#

dont remember how it was done tho

eternal oxide
#

yes, create a libraries folder and put it in there

river oracle
#

Ir that

noble lantern
#

wouldnt work if you wanted it public

#

but you wuld just build spigot yourself

somber sequoia
noble lantern
#

with your added maven import to it set to shade into the spigot jar

quaint mantle
#

Nevermind I will just make a base plugin that shades the library, and use the library via that

quaint mantle
somber sequoia
#

you can create a plugin for it ig

hybrid spoke
#

what gambling games would be good to lose your inventory with

quaint mantle
#

this only works on a local server I think

tardy delta
#

my code full of bugs i love it

somber sequoia
noble lantern
#

cow flip

somber sequoia
#

its a plugin that works as a library iirc

quaint mantle
#

yeah ok

hybrid spoke
noble lantern
#

add the dinnerbone tag to a cow and make it like a heads or tales thing

hybrid spoke
#

for now i have roulette(roll), coin flip and blackjack

noble lantern
#

im telling you

#

cow flip

hybrid spoke
#

like a spinning cow

#

until it lands

somber sequoia
#

how do you think of that

noble lantern
#

yep, can add in a slowing effect too

crude charm
#

How should I go about returning the result of the loop in my method which only accepts an int as a value?

noble lantern
#

stick around

#

next idea i come up with might be pure stupidity

hybrid spoke
#

burchard wanna contribute

tardy delta
#

bruh me trying to get a weakreference's value which has no value

quaint mantle
#

what are you trying to do

noble lantern
#

int x;

#

x = i

#

return x

tardy delta
#

why is finalize() deprecated too?

noble lantern
#

make the initial value -1

crude charm
noble lantern
#

if getThing == -1 it was invalid

quaint mantle
noble lantern
#
public int getSlot()
   int[] stuff = {. . .}
   for (shit) {
       return thatNumberFromShit;
   }
    return -1;
}
crude charm
#

That would work...?

noble lantern
#

-1 = your error number

#

yes

#

if not

#

you can do this:

crude charm
#

like that?

noble lantern
#
public int getSlot()
   int[] stuff = {. . .}
    int returnValue = -1;
   for (shit) {
       returnValue = thatNumberFromShit;
   }
    return returnValue;
}
#

this way is dirtier tho

noble lantern
#

wait

crude charm
#

Aight I'll give it a try, thanks

hybrid spoke
noble lantern
#

what exactly are you wanting to return

noble lantern
hybrid spoke
#

shame on you

noble lantern
#

cause rn that will always return 13

crude charm
noble lantern
tardy delta
#

is WeakReference#clear actually useful or can it be ignored?

crude charm
noble lantern
noble lantern
#

then why wouldnt you just return the array?

tardy delta
#

when no longer in jvm?

noble lantern
#

sorry brain fried

quaint mantle
crude charm
tardy delta
#

so no need to actually call clear() by your code?

quaint mantle
#

no

paper viper
#

^

#

GC gets rid of it

noble lantern
paper viper
#

That’s why it’s useful for storing Player, World, and other objects similarity

noble lantern
#

cause rn that only returns the first number and thats it

#

if your wanting to return all those your gonna need something other than a int

tardy delta
#

ok that will solve my issue then

noble lantern
#

ie array

crude charm
#

Aight, I'll just copy and paste my code for something that accepts an array and I recon that'll work

#

thanks

noble lantern
#

you can transform your code lib

#

to take a Integer varargs

#

it would be simple just pass varargs to your single int method in a for loop

#

that way you can directly work with the array

crude charm
#

I'll see

quaint mantle
#

ehm how would I access a shaded library from another project

noble lantern
#

its already in the scope once shaded

#

you can just use it in that project

quaint mantle
#

but like

noble lantern
#

in that case

#

ik what you mean

#

you need to have the other plugin have a scope of provided, and get the instance of the lib from the main plugin

#

it can be shaded in to, but dont initialize it

#

but provided is the typical use case for things like that

quaint mantle
#

Base (not a plugin)
BasePlugin (shades Base (Acts as library to access Base))
OtherPlugin (uses BasePlugin, wants to interact with Base (static methods etc..))

hybrid spoke
#

basically a middleman

quaint mantle
#

yes

noble lantern
#

OtherPlugin would import Base as a provided scope (Can be shaded but dont initialize it in this plugin)

OtherPlugin would get a static variable of your lib from its main class in BasePlugin

quaint mantle
#

oh ofc Base is in the scope because BasePlugin has it

tardy delta
#

a playerquit even is fired for everyone when the server stops right?

noble lantern
#

just

#

make sure

#

OtherPlugin hard depends on BasePlugin

#

and itll be gucci

quaint mantle
noble lantern
#

if its not then just shade and get the instance

#

but provided should be fine

somber sequoia
quaint mantle
#

maven shading and that kinda stuff is quite overwhelming tbh

noble lantern
#

its simple once you get used to it

quaint mantle
#

yeah Im not at the stage where I am used to it yet :P

#

lets try

crude charm
#

This might be a stupid question but how do I let players move items in their inventory but not in the menu? and how can I go about differentiating the 2?

crude charm
#

forgot about that

#

lmfao

#

I am stupid

#

thanks

noble lantern
#

youll have to check if they did click on top inventory though ofc

crude charm
#

ofc

noble lantern
#

wtf

#

how possible

#

nvm

#

holy shit whoosh

#

?learnjavamoment

quaint mantle
#

what

#

OH it shaded les goo

noble lantern
#

i was wondering how i could initialize a static variable in a non static method lmao

tardy delta
#

android

noble lantern
#

indeed

#

annoying asf

tardy delta
#

i gotta do android next year

#

and i dont want

noble lantern
#

yeah took me a good few seconds to realize that thats possible lmfao

#

android is aids

#

anything that requires waiting

#

needs to be async

#

or the whole app freezes

tardy delta
#

gotta do ios next year too 🥺

hybrid spoke
#

IOS sucks

#

android is okay

tardy delta
#

fking college

#

web development too 🥺

hybrid spoke
#

if you ever have an app where you support apple

tardy delta
#

only like the programming and networks stuff

hybrid spoke
#

just drop the support

tardy delta
#

fun

cunning canopy
#

If I want to replicate a repeating commandblock I would put stuff in a while loop right?

tardy delta
#

no ?scheduling

#

?scheduling

undone axleBOT
tardy delta
#

while loop on the main thread will block the server

cunning canopy
#

Ooo

noble lantern
#

oh so your telling me i cant do this

tardy delta
#

dunno why a commandblock if you can do it by code too

noble lantern
#

fuck

tardy delta
#

oh no

#

isnt Task like a completablefuture?

noble lantern
#

i needed to be able to use it differently

tardy delta
#

ig the impl is terribly bad

noble lantern
#

i wanted to change around the normal callback listener as i wanted this method to be blocking and return a value

#

without it its hard to return a value cause its locked in lambda

#

this is fine to be blocking for this method

#

just sucks i gotta resort to sleeper thread

ivory sleet
#

Maybe it possible to await the task with a dead line?

noble lantern
#

never done await in java before

ivory sleet
#

Or does the Task class not define such methods?

#

I mean await means blocking

noble lantern
#

Nah doesnt contain those method just ability to add onComplete listeners

ivory sleet
#

You wait on another thread for it to complete a task

#

Ah that sucks

noble lantern
#

as well as a shitload of other listeners

#

Its not a normal Java Task its some funky Google transformed task

#

import com.google.android.gms.tasks.Task;

ivory sleet
#

Yeah figures

tardy delta
#

CompletableFuture#whenComplete but android...

noble lantern
#

theyre entire impl sucks for this ngl

tardy delta
#

gotta love next year college

crude charm
#

Is it possible / safe to use paypal api to processes payments ingame? I havent dug into it too deep so it might not even be possible

noble lantern
#

?paste

undone axleBOT
tardy delta
#

what the

#

i dont understand why they are using the R. ...

noble lantern
#

Resource

#

its a dynamic thing

#

referances front end ids

tardy delta
#

lazy fuckers can even type Reource

noble lantern
#

so like if you want login_button

#

R.id.login_button

#

actual front end doesnt suck tho

#

please ignore my shit styling

grizzled lintel
#

Sorry for the sudden chat.
Now my question is, how do I get the behavior that when I click on the colored glass, it takes me to another server registered in BungeeCord?

||Also I do not speak English so please forgive me for the difficulty in replying and reading the conversation...||

tardy delta
#

do you already have the inventory being set up?

chrome beacon
noble lantern
#

No but inventory is fairly simple

#

database is mongoDB so its just an array of objects

crude charm
#

yeah bmc not pmc I'm stupid, same idea

noble lantern
#

the hard part is gonna be the things i want to call units

#

The game is gonna be a botnet simulator in a sense, i want people to be able to have virtual pcs and they can be upgraded individually/in mass

Thats gonna sucks because people can potentially have thousands of those objects and i need to figure out how ill compress it

chrome beacon
#

Have you seen how many objects minecraft has at once

noble lantern
chrome beacon
#

A few thousand won't be a problem

noble lantern
#

What about up to lets say a million?

#

the objects wont be fairly large

crude charm
noble lantern
#

just a few integer fields

#

BigInteger*

chrome beacon
#

Minecraft had about a Million blocks alone loaded when I last looked at a memory dump

#

Anyways make your application first. You can worry about tiny optimizations later

tulip hinge
#

does someone know how to use NBT components with the component system from net.md_5.bungee.api.chat? There are components for scores and keybinds but not for NBT data...
Can I maybe send JSON directly? or create my own Component by extending BaseComponent even though it's deprecated?

worldly ingot
#

(the time is optional by the way)

noble lantern
#

Not a Java task

worldly ingot
#

I know

#

Tasks is a Google class

noble lantern
#

oh fr

#

And that methods blocking i assume

worldly ingot
#

Yeah. Tasks.await(task) should work

#

Yes, it's blocking

noble lantern
#

oh god yes

#

so much nicer

#

thank you for that

worldly ingot
#

o/

noble lantern
#

prolly would of never found that

#

oh thats microseconds, should be milli

#

stupid auto complete

opal juniper
#

was about to say that

tardy delta
#

essentials code is fun to look at 🤓

noble lantern
#

so you just return anywhere to make the code work

tardy delta
#

i have such things in my code too

noble lantern
#

ive been trying to avoid angry code syndrome

tardy delta
noble lantern
#

TCP Client waiting for a response from that server: Hello? u there?

#

time to finish this stupid google oauth up im tired of working on it

tardy delta
#

lmao this looks so stupid why dont they use a completablefuture

noble lantern
tardy delta
#

has litterally all the stuff

noble lantern
#

they have 5 other ways of doing that

#

with 2 other libaries that can do that

#

its a mess

tardy delta
#

smh

noble lantern
#

theyre official docs suck

#

i had to figure this out on combination of sheer luck, looking at multiple google docs, and stack overflow posts from 2014

#

theyre actual REST is documented good

#

but theyre java lib sucks

tardy delta
#

oh no hopefully they wont let me code in kotlin at college

noble lantern
#

theres legit methods that dont exist on theyre guide when you go to try it

opal juniper
#

let or make

crude charm
#

Is there a method built into spigot to check for a specific armour type?

#

Like chest, helmet so on

opal juniper
#

nope

crude charm
#

Aight

opal juniper
#

just look at teh material

noble lantern
#

^

#

split("_")

crude charm
#

Bit messy if I'm checking for every type of chestplate

noble lantern
#

if arg[arg.length -1].endsWith("LEGGINGS");

#

or just

#

enum.getName()

#

then endsWith

crude charm
#

Yeah I was gonna check name comtains as I'll have custom names

#

but itll still have chestplate, leggings whatever somewhere

tardy delta
noble lantern
#

when someone gonna ask for help with networking

noble lantern
tardy delta
#

ye

noble lantern
#

smh

#

can someone just make a new essentialsx from scratch

crude charm
#

Like Fiery boots of the fiery order of souls powered by magic from the cave of tern eaten by todert owned by {player}

noble lantern
#

the mc community doesnt deserve this

crude charm
#

🙂

#

but It's only for me

noble lantern
#

make it popular

#

ugh

crude charm
#

has alot more just every essentials command tho

tardy delta
#

setFallDistance(-1) not working too lol

noble lantern
#

we went through this earlier cancel the damage event

#

xD

worldly ingot
tardy delta
#

cant really

#

lol

noble lantern
#

CompletableFuture confirmed does not exist on about 6% of android devices

tardy delta
#

i could add the player to a collection but mehhhr

worldly ingot
#

Which in and of itself is a problem lol

noble lantern
#

I dropped support for that % just to get CompletableFuture

ivory sleet
noble lantern
#

Its just unhelpful for me because i want this stuff sync

tardy delta
#

atleast a bit

worldly ingot
#

Added in Android 7.0

noble lantern
#

they dont offer sync options

ivory sleet
#

Await

#

That’s sync/blocking

noble lantern
#

choco actually showed me something badass

noble lantern
tardy delta
#

still looks pain

ivory sleet
#

the await method which suspends thread activity until the computation is completed (eventually exceptionally)

noble lantern
#

its all in sync now

I have no use for any async actions google provides, because this method entirely its called async

ivory sleet
#

Which is nice

noble lantern
#

Just weird they dont offer a get() like future does with Task

ivory sleet
#

It’s similar

noble lantern
#

yeah just a little more code to work around with

ivory sleet
#

Mye

worldly ingot
#

Well, to be fair, it does have one. It just doesn't wait for a result. It throws an exception if not yet complete

#

CF has one of those as well iirc

ivory sleet
#

Or well Idk if it’s more, it’s just different from my perspective

noble lantern
ivory sleet
#

Yeah join()

noble lantern
delicate badger
#

What do you guys suggest where I could learn to code plugins?

noble lantern
#

well

#

learn java first

#

?learnjava

undone axleBOT
noble lantern
#

however me personally

#

try codecademy

#

its pretty decent

delicate badger
#

Well I know the basics

noble lantern
#

teaches you basics

#

oh okay

crude charm
#

like basics

#

or basics

delicate badger
#

basics

crude charm
#

hmm

noble lantern
#

HashMap?

#

Anyways you can learn basically anywhere

somber sequoia
#

how would I remove a single item from a players main hand

noble lantern
#

if you know java you can google "How to do x spigot"

#

this is 90% of my time developing plugins

crude charm
noble lantern
#

and then do what works for you

somber sequoia
noble lantern
#

NEVER

#

EVER

#

i mean EVER

#

run that piece of code in a Runnable/BukkitTask

#

it leads to dupe bugs

somber sequoia
#

im guessing you learned that the hard way

opal juniper
#

Opinion on the ability to set the brand of the server?

ivory sleet
#

Elaborate :0

cunning shard
#

how would i go about creating a scheduler or thing which sets a player to afk after 5 minutes and then kicks them for being afk after 5 more minutes?

opal juniper
#

well you know on the f3 screen there is the server brand

ivory sleet
#

Oo that’d be really cool

opal juniper
#

Didnt know whether to introduce api to change it

noble lantern
#

nah

eternal night
#

personally really dislike it

noble lantern
#

gonna get 9 year olds saying they made a custom jar

eternal night
#

you are using software people work hard on for free. the least you can do is keep the branding

noble lantern
#

^

subtle folio
#

Is there an easy way to check if a hit in an EntityDamageByEntityEvent is critical?

ivory sleet
#

Mye well if you really wanna change it just doing some packetry shouldn’t be too hard Ig

opal juniper
#

Hmm that is a point, but at the same time

noble lantern
opal juniper
#

nopers

noble lantern
#

i assume that strings stored somewhere

opal juniper
#

dont think so

ivory sleet
tardy delta
#

stackoverflow how to save a list to a database be like

eternal night
#

the string is returned from a method iirc

opal juniper
#

Yep

ivory sleet
#

And also Duration and Instant might be interesting

eternal night
#

but yea, if you wanna change the brand name, at least put in the effort and fork

noble lantern
opal juniper
cunning shard
#

lord have mercy on my soul

noble lantern
opal juniper
#

i dont really think its that big of a deal. Like i dont look at a server and think "wow its a paper server"

noble lantern
eternal night
#

if it isn't a big deal, then changing it to your thing is also not a big deal and not worth it 🙂

noble lantern
#

Like "oh wow xyz cool"

crude charm
tardy delta
#

bruh i really forgot how to insert a whole collection to a db table? are that just multiple statements then?

noble lantern
#

Do you have any non functional code written

eternal night
#

iirc there are plugins for it as well. ¯_(ツ)_/¯

opal juniper
#

which could use api instead of packets

crude charm
opal juniper
#

but doesnt matter

crude charm
eternal night
#

again, I think they should put in at least some effort

crude charm
#

I wanna get the item and store it in a db and give it to the player when they call for it

eternal night
#

I wasn't talking to you xD

crude charm
#

but thats not relevent

eternal night
#

I was talking to olli

noble lantern
tardy delta
crude charm
#

Ah

noble lantern
#

and btw

#

players inventroy type sometimes returns as the crafting one