#help-archived

1 messages · Page 95 of 1

idle zodiac
#

@naive goblet don't think so

#

recipe.setIngredient('d', enchantedDiamond);
Cannot resolve method setIngredient(char, ItemStack) or smth like that

#

it needs to be a material

naive goblet
#

Oof

idle zodiac
#

welcome to 1.8

#

i hate it

#

but i need it

naive goblet
#

Lemme jump on pc

idle zodiac
#

AH

#

ok

#

let me try enchantedDiamond.getData()

#

nope

naive goblet
#

Either that or RecipeChoice

idle zodiac
#

wat dat

#

i'm new to this

#

how would i go about utilising that

#

this is my first like custom recipe lol

#

should i like cast the itemstack to that?

naive goblet
#

look into that

idle zodiac
#

AH

#

ok

#

i dont think recipechoice is a thing in 1.8

naive goblet
#

use MaterialData then ig

idle zodiac
#

so

#

new MaterialData?

naive goblet
#
    public static final CustomEntityType<DummyZombie> DUMMY_ZOMBIE = new CustomEntityType<DummyZombie>("dummy_zombie", DummyZombie.class, EntityTypes.ZOMBIE, DummyZombie::new);

@jaunty night I mean perhaps add the id param here

#

I don't see it atleast

idle zodiac
#

o ok

#

so how do i get the materialdata from an itemstack?

jaunty night
#

Ah, so replace dummy_zombie with just zombie

naive goblet
#

hmm no?

#

but look into this

#

look what they said about the constant

idle zodiac
#

new MaterialData(enchantedDiamond.getType(), enchantedDiamond.getData().getData())

#

deprecated

#

lovely

#

time to try it!

naive goblet
#

lmao

idle zodiac
#

nope

#

works with a normal diamond

#

not just a custom one

#

lovely!

jaunty night
#

They completely phased out number ids though

idle zodiac
#

my brain doesnt hurt at all!

#

yay!

naive goblet
#

ShapedRecipe#setIngredient(key, new MaterialData(Material.DIRT, data))

idle zodiac
#

ok...

#

so

#

wat the data?

#

where should i init that

naive goblet
#

I have no idea

idle zodiac
#

XD

jaunty night
#

wait nvm

naive goblet
#

occy perhaps trying to get the data from another stack?

idle zodiac
#

um

#

(MaterialData) enchantedDiamond.getItemMeta()?

#

or not

naive goblet
#
ItemStack item = new ItemStack(Material.DIRT);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName("loL");
item.setItemMeta(meta)
ShapedRecipe#setIngredient(key, item.getData());
idle zodiac
#

AHAH

#

ok

#

AH

#

thanks

#

ho

#

oh

naive goblet
#

lol np

ebon charm
idle zodiac
#

@naive goblet or not

naive goblet
#

why ?

idle zodiac
#

it works with normal diamonds as well as custom ones

naive goblet
#

so?

idle zodiac
#

i need it to only work with custom ones

#

enchanted diamonsd

#

not just normal diamnd

naive goblet
#

oh it works with both?

idle zodiac
#

ye

#

fuck my life

naive goblet
#

okay i kind of got a plan

jaunty night
#

@naive goblet The guide you linked me is outdated and I believe they changed how you register custom entities since then.

naive goblet
#

oof

#

let me look into that just going to help occy

jaunty night
#

alright ty

idle zodiac
#

thanks x

#

XD

jaunty night
#

Hang on @naive goblet I may of figured it out

#

Big maybe and it may not work

#

IRegistry.a(IRegistry.ENTITY_TYPE, key.getKey(), entityType);

#

In IRegistry there's a method with the same name but with an added value

#

and it's an int value

naive goblet
#

ShapedRecipe#setIngredient(key, new RecipeChoice.ExactChoice(ItemStack)) @idle zodiac

#

ah

idle zodiac
#

ok

#

nope

#

recipechoice aint a thing

jaunty night
#

bruh just use 1.15.2

idle zodiac
#

i cant lo

#

i need to use 1.8

#

also

#

how many times are people going to just answer with "use minecraft 2.0 will you ok"

naive goblet
#

maybe you'd have to use nms then

idle zodiac
#

ok

#

i'm using 1.8

#

no questions asked ok

naive goblet
#

chill dude

#

use nms

jaunty night
#

Occy the reason why people answer with that is because it's a valid answer

idle zodiac
#

cool

#

well i'm using 1.8

#

so

#

ye

jaunty night
#

Well then expect to not get support

naive goblet
#

jesus guys chill out lol

idle zodiac
#

what

jaunty night
#

let me rephrase

idle zodiac
#

because i'm using a non-orthodox version, i dont get help?

jaunty night
#

expect to not get the same level of support

idle zodiac
#

welcome to soviet russia

#

time to break my server with nms 😄

jaunty night
#

just be careful with NMS and you should be fine

#

also expect to get the most dumbass stack traces for the dumbest reasons

idle zodiac
#

ye

#

its fine

#

i use nms quite a bit

#

lol

jaunty night
naive goblet
#

54

vernal spruce
#

killer parrot,best parrot

frigid ember
#

Is dyes under material?

jaunty night
#

@naive goblet turns out the ids on the wiki are wrong

#

I did 54

#

and parrots

frigid ember
#

How can I get the block behind a WALL-Sign in 1.15.2

jaunty night
idle zodiac
#

nice

#

gg

jaunty night
#

Turns out I don't need to regference the wiki everytime I need to grab an id

#

and the IDs are wrong there

#

IRegistry.a(IRegistry.ENTITY_TYPE, IRegistry.ENTITY_TYPE.a(parentType), key.getKey(), entityType);

#

this is what I did

tiny dagger
#

the id's are in entity types

#

exactly :d

#

btw

#

what would be the most secure way to talk between 2 servers directly? 🤔

#

ie i'm trying to do a hub npc and sign system for when the minigame is in bungee mode

#

actually hmm

#

can i send data to bungee that it will send it to the server that wants it without creating a middleman plugin for bungee?

hoary parcel
#

Just setup an ssl socket

#

Yes bungee has a forward subchannel

tiny dagger
#

oh that's actually even better

frigid ember
#

Hey guys, I followed this: https://www.spigotmc.org/threads/creating-guis-the-right-way.156378/

which is perfect, but I need help with two things, first one being kinda obvious, but ill ask it anyways though I think I know the answer.

  1. Best way to iterate over each slot to fill it with an item stack?
  2. With that, how can I calculate every slot that's near the edge, so there's like a "border" and only 7 slots can be filled on each row of 9?
tiny dagger
#

for 2

#

all you need to know is

frigid ember
#

this is where im at. ```
for (Town town: plugin.townList) {
setItem(4, new ItemStack(Material.PAPER), player -> {
player.sendMessage("something");
});
}

tiny dagger
#

slot % 9 = column

#

slot / 9 = row

#

as for the first 1

#

well

#

iterate over all using for int i - 0; i < size; i++

#

there is no magic behind it

#

unless you have extra info about unused slots

frigid ember
#

Yeah that's what I thought would be the answer, but a little different because of question #2

#

thanks, ill play around with that.

#

reminds me that i really should master fizzbuzz... hehe

tiny dagger
#

fizzbuzz being?

brisk mango
#

@frigid ember it doesnt matter which way u do it, it will be the same and there will be most likely no difference with performance

tiny dagger
#

oh you could improve ram a little by instead of using a map integer yourguithingy

#

you could use an array

#

same thing

#

a page size is fixed same as an array so to me it seems like a win

brisk mango
#

why would you use a Map<Integer, Inventory>?

#

also how does that "ram improvement" matter in bukkit plugins

midnight summit
#

when i change unknown command with colors server doesent start

#

how i change the unknown command without crashing the server with colors

tiny dagger
#

i mean why not

brisk mango
#

and?

tiny dagger
#

you could use arrays to do same thing

#

for inv

brisk mango
#

to do WHAT

#

i dont know what are you talking about.

tiny dagger
#

keep slot number

#

and

#

a method

chrome edge
#

Are there any exploit/dupe list for between 1.8 and 1.15.2?

brisk mango
#

why is there an array needed

#

when the inventory has a method that returns its size

frigid ember
#

IllegalStack plugin may help you @chrome edge

#

it has big list of exploits fixed

#

and mentions wht versions

tiny dagger
#

i'm talking about the gui he follows

brisk mango
#

"guis the right way" ok

tiny dagger
#

to me

#

it looks like the map is not useful

brisk mango
#

this is very bad

chrome edge
#

@frigid ember Is it only for dupe?

brisk mango
#

this tutorial is litterally shit

#

this dude is using static getters for the inventory

frigid ember
#

it is for variou

#

temedy, let's see your tutorial 🙂

#

s not only dupes

tiny dagger
#

tbh he has the right idea

brisk mango
#

I can make a way better tutorial

#

want me to?

frigid ember
#

it's one of the cleanest threads i've seen so far.

tiny dagger
#

but yeah he does odd things

brisk mango
#

"cleanest" more like one of the shitties

#

method calls from constructor and static methods

frigid ember
#

let's see yours

brisk mango
#

let me do it then.

frigid ember
#

okk

brisk mango
#

I dont have one coded so it will take a while

frigid ember
#

that's fine, i'm excited to see an improved version. i actually learned quite a bit from this one so im curious what yours will be

tiny dagger
tardy lance
#

hello, my plugin reads a prefix from the config: '§8[§cBounty§8]§c '
But ingame it doesnt have color, it only has some weird ?

/?
\ ../

#

looking like that

#

but only in one command the other works

tiny dagger
#

save it with the utf 8 enc

tardy lance
hoary parcel
#

How can one code with so many useless symbols in their ide?

#

Also, tabs, wtf

tiny dagger
#

yeah sorry i got used to it :d

wanton delta
#

Yea why does he use microsoft word as his ide

tardy lance
wanton delta
#

Does it use the section symbol

tardy lance
#

you mean me ?

wanton delta
#

yea

tiny dagger
#

what's wrong with tabs tho?

tardy lance
#

what do you mean with section symbol? idk what that is

#

lol

wanton delta
#

§

tardy lance
#

yes

#

the config:

Config:
Prefix:
prefixAdmin: '§8[§b§lAdmin§8]§r§c '
prefixHorse: '§8[§dHorse§8]§f '
prefixEconomy: '§8[§2Economy§8]§c '
prefixBounty: '§8[§cBounty§8]§c '

hoary parcel
#

Uurg, legacy chat format

tardy lance
#

it works all fine but only that command in that java class doesnt work

hoary parcel
#

Ppl should move away now so they can actually use hex colors with 1.16

wanton delta
#

mini

#

Youre in the help section

tardy lance
#

it makes no sense why it doesnt work

wanton delta
#

Verilyzed i would recommend you trying to save with utf8 encoding

tardy lance
#

but all other config parts work

wanton delta
#

i dont care

#

Try to do it anyway

hoary parcel
#

My point is valid in any section

wanton delta
#

I dont care if its valid

#

Its not useful

#

Its not relevant

#

I can say my opinions but its not appropriate

tardy lance
#

How do i do this? I am using eclipse

tiny dagger
#

use ctrl s

#

it will tell you

#

to save in utf 8

#

click yes

frigid ember
#

why not just put in your config file & and then translate it?

tardy lance
#

if i click ctrl s it only saves it. i could open it in notepad++

wanton delta
#

Do that

#

I believe they have an encoding option

tardy lance
#

it works 😄

#

thanks

#

strange, but okay if it works it works 🙂

tiny dagger
#

well it's not strange

#

encodings have their role

thin mortar
#

Hey, can anyone help we with a port forwarding problem I have?

#

i cant find anything like what i have online

tiny dagger
#

open cmd

#

type ipconfig /all

#

find your network you're connected at

#

look at ipv4 adress

#

copy that

#

go into router at port forward

#

put that ipv4 adress there

#

then the ports

thin mortar
#

i have done that

tiny dagger
#

enable and you're done

thin mortar
#

i port forward my ipv4 address

tiny dagger
#

of the connected address?

thin mortar
#

(btw i use a server, not my pc)

tiny dagger
#

oh

thin mortar
#

i port forwarded the servers ipv4 though

tiny dagger
#

the server isn't portforwarded?

#

wow

thin mortar
tiny dagger
#

no

#

in server leave empty at ip

thin mortar
tiny dagger
#

or put the ipv4 address

#

are you sure connected to it yourself?

thin mortar
#

wdym?

#

i can connect to it loaclly before any of the port forwarding steps are done

#

but if i want it public for my friends to play

#

they cant join unless i port forward

tiny dagger
#

ping that ipv4

thin mortar
#

and when i port forward it

tiny dagger
#

see if it returns

thin mortar
#

the server cant start :l

#

ok

#

when you say ping the server, do you mean use a website

#

sorry if i sound dumb, im new to this kinda stuff :l

tiny dagger
#

no

#

cmd

#

just see if you're connected to it

thin mortar
#

the server i use runs of unraid which is based of linux

#

if you want i can ip config my personal pc

frigid ember
#

did you edit server-ip in server.properties?

#

(should keep it empty)

thin mortar
#

i have tried it with the ip and without any ip

#

it has the same error

#

wait no

#

it doesnt

#

with no ip

#

it boots fine

#

but the port isnt forwarded

#

atleast thats what it thinks

#

should i forward my public ipv4 address?

tiny dagger
#

yes

thin mortar
#

or just have the unraid server ip forwarded

#

ahhh, ive port forwarded my servers local ip, not my public ipv4 address

#

is that what i did wrong?

tiny dagger
#

this

#

the ip between you and the router

thin mortar
#

but the minecraft server is not running on my pc

#

its running on a sperate server in the house

tiny dagger
#

between the server and router

#

if the server is connected on the same router

#

you can connect with the ipv4 of the server

chrome edge
#

I'm trying to block exploit and wanna kick player without delay. Is there any method to force kick player from the server?

thin mortar
#

when i play on it localy

tiny dagger
#

crash their client

thin mortar
#

i use ther servers ip address to connect

tiny dagger
#

jk

#

😂

chrome edge
#

-_-

#

((CraftPlayer) player).getHandle().playerConnection.networkManager.channel.disconnect(); I've tried this but doesn't work. (I just tried it idk is it safe or not)

frigid ember
#

make sure u alowed firewall acsess to java

chrome edge
#

Oh I think I found it! ((CraftPlayer) player).getHandle().playerConnection.networkManager.close(new ChatComponentText("KICK"));

rain plank
#

Anyone know the all players online command since the @a doesn’t work

tardy lance
#

how do i get a Collection value? because name[i] doesnt work

tiny dagger
#

collection of?

tardy lance
#

Strings

tiny dagger
#

tocharlist()

#

or something like that

#

to get the string array

#

still no collection

tardy lance
#

so i have to convert it first?

tiny dagger
#

yes

tardy lance
#

okay

tiny dagger
#

thats how java works

#

c++ handles them better :p

#

but what can you do

tardy lance
#

¯_(ツ)_/¯

zenith palm
#

?fw

worldly heathBOT
torn robin
#

If I set a newline character in a config and then kick/ban a player with that string the newline character isn't making a newline rather it appears as \n, why and how can I fix this?

#

Fixed. Solution was using ""'s instead of ''s

worldly heathBOT
worn gate
#

can anyone help me with my plugin ?

red bolt
#

how would i check what height sugar cane is ?

torn robin
#

@worn gate use a runnable

#

@red bolt I assume using a for loop

red bolt
#

ive given it a good amount of thought

#

but i still cant figure it out

torn robin
#
Block sugar;
Location l = sugar.getLocation().clone();
while(l.getBlock().getType() == Material.SUGAR_CANE) {
  l.add(0, 1, 0);
}

int height = l.getBlockY() - sugar.getLocation().getBlockY();
#

something like that

brisk mango
#
final ScheduledExecutorService service = Executors.newScheduledThreadPool(1);
                service.scheduleAtFixedRate(() -> {
                    service.shutdown();
                }, 20, 20, TimeUnit.SECONDS);
torn robin
#

y

red bolt
#

what is this ?

brisk mango
#

|

#
final ScheduledExecutorService service = Executors.newScheduledThreadPool(1);
                service.scheduleAtFixedRate(service::shutdown, 20, 20, TimeUnit.SECONDS);
torn robin
#

@red bolt show me more of the code

red bolt
brisk mango
#

no idea rumdum

#

why are you doing it in the switch

hoary parcel
#

you cant place that declaration there

torn robin
#

it's in the switch thing

#

you have to move it up

hoary parcel
#

or down

brisk mango
#

or in the case

#

| in the case

red bolt
#

oh lmao

#

my bad

frigid ember
#

you can also move it left or right

#

but it wont help with anything

brisk mango
#

lol

#

also why is e.getBlock() grayed out

#

@red bolt

#

and

red bolt
#

not sure

brisk mango
#

hover over it

red bolt
#

it fixed itself now

brisk mango
#

and id stop naming my event e

#

as it stands for exception in the catch block

sturdy oar
#

nothing should be called with a single character anyway

brisk mango
#

what do you mean nothing

#

thats not true

sturdy oar
#

except counters in for loops

brisk mango
#

how about T that stands for Type

sturdy oar
#

that's not a variable

brisk mango
#

e that stands for exception

#

you said nothing

#

you didnt say that no variable should be named with single character

red bolt
#

what about this ?

boreal brook
brisk mango
#

because that doesnt return a boolean.

#

that returns a block

red bolt
#

why does getblockat need a boolean

sturdy oar
#

???

brisk mango
#

??

boreal brook
#

no

sturdy oar
#

the while needs a boolean

boreal brook
#

^

torn robin
#

pretty sure that's client sided @boreal brook you could change it with a resource pack if you want

#

maybe overriding it with a timer works but i doubt it will

boreal brook
#

oh, ok thanks, though i saw many servers putting a custom text in it so i was wondering if that's possible

tardy lance
#

how to get the index number of the integer of Collections.max(collection)

torn robin
#

english please

sturdy oar
#

^

brisk mango
#

of the integer?

#

what

boreal brook
#

use indexOf

#

he wants the index of the result of Collections.max

sturdy oar
#

not sure he meant that but maybe

boreal brook
#

i guess

tardy lance
#

yes

#

thats right

boreal brook
#

nice

torn robin
#

ah makes sense

boreal brook
#

what is the type of the collection though?

tardy lance
#

Integer

boreal brook
#

ok, but the whole type? List, Set?

brisk mango
#

its a generic type

tardy lance
#

Arraylist

brisk mango
#

yeah then thats fine

boreal brook
#

yeah i just was lazy lol

brisk mango
#

there is an indexOf method

tardy lance
#

ah okay i will try

boreal brook
#

good, just use yourList.indexOf(someValue)

torn robin
#

keep in mind collections can have duplicates im assuming you knew that already

brisk mango
#

no

#

dont mislead people @torn robin

torn robin
#

wym

brisk mango
#

Set/HashSet cannot have duplicate elements

sturdy oar
#

he said ArrayList

torn robin
#

that's why i said collections

brisk mango
#

he said collections

torn robin
#

and not set/hashset

#

yes

brisk mango
#

collections is all collections

#

hashset/set is in collections

torn robin
#

collections can have duplicates

brisk mango
#

whatever

torn robin
#

tf you talking bout

brisk mango
#

you mean

#

Collection<T>

#

can have duplicates

torn robin
#

to my knowledge yes

brisk mango
#

Well, you said collections

torn robin
#

as in

brisk mango
#

that means all the collections

#

but whatever

#

are you trying to piss me off

torn robin
#

are you? lmao

brisk mango
#

no

boreal brook
#

from the javadoc: "Some collections allow duplicate elements and others do not."

brisk mango
#

When you say collections, you probably mean all the collections

sturdy oar
#

yeah

boreal brook
#

so yeah this might be a problem

torn robin
#

alright SoME collections can have duplicates

#

is that better

brisk mango
#

it is better

tardy lance
#

i have a hashmap of all bounty values connected with the uuid of the player. that i converted into a collection type integer and then converted that into an arraylist. this arraylist i want to sort from highest bounty to lowest with name of the player and but this into an output player.sendMessage() message

boreal brook
#

yeah

#

you might be interested in the stream api

brisk mango
#

why did you convert them into collection and then into arraylist?

#

have you ever heard of BiConsumer

tardy lance
#

no

brisk mango
#

im assuming

boreal brook
#

it's a thing that consumes two things :3

brisk mango
#

you wanna convert the values into a list

#

yes?

tardy lance
#

yes

brisk mango
#

the bounty values

#

alright

sturdy oar
#

Can't you do HashMap<UUID, List<Bounty>>

#

or something

brisk mango
#

final Map<UUID, Integer> bounties = new HashMap<>();
final List<Integer> values = new ArrayList<>();
bounties.forEach((key, value) -> {
values.add(value.getValue());
});
boreal brook
#

^

brisk mango
#

or just

#

whenever needed to convert a collection to another collection

#

for example

tardy lance
#

So is it bad to convert a hashmap to a collection and then to an array or what

brisk mango
#

final Set<Player> set = Collections.newSetFromMap(new IdentityHashMap<>());

final List<Player> list = new ArrayList<>(set);
#

U cant convert hashmap to a list

#

or idk

boreal brook
#

well

brisk mango
#

because it has 2 generic types

boreal brook
#

you can have a list of entries

brisk mango
#

it has a Key and Value

#

and list only takes 1 type

boreal brook
#

List<Map.Entry<K, V>>, but that's dumb to use

tardy lance
#

yes yes, i want to convert the hashmaps values to an array

#

:3

brisk mango
#

array?

tardy lance
#

arraylist

boreal brook
#

you just want the values?

#

not the keys?

#

i mean, just use the Map

brisk mango
#

i gave a tutorial up there

boreal brook
#

i don't see why you'd want to convert lol

frigid ember
#

Howdy, I am thinking about purchasing @lone hawk 's mineacademy course. I wanted to be a programmer since I was 12 (or earlier?), and started messing around with code back then. Now I am 15, and I don't know if it's the right thing to do. Should I buy this course or not?

sturdy oar
#

what's mineacademy

#

I honestly bought ton of books and some courses from Udemy

boreal brook
#

i just read (free) tutorials

frigid ember
#

Spigot Course, but new

brisk mango
#

you dont need spigot course

#

you need basic java experience

boreal brook
#

^

frigid ember
#

It's 100 USD. I have the money, and those free things do not work for me.

brisk mango
#

100 USD for a shit course I guess

boreal brook
#

you know what else is free? US 😄

#

(don't abuse though)

sturdy oar
frigid ember
#

I understand, but I don't know

#

It seems genuinely like a good option

boreal brook
#

what doesn't work for you in those free tutorials?

frigid ember
#

Since my Java experience is little to none, and I've only really messed around with Swift Playgrounds

boreal brook
#

oh

frigid ember
#

And want to start learning slowly

boreal brook
#

well i'd suggest you first learn java

frigid ember
#

According to that website, they'll start learning Java too.

boreal brook
#

idk, do a scramble word game in the console, maybe?

frigid ember
#

I have a Mac

#

So eh idk

sturdy oar
#

??

boreal brook
#

it also works

#

eclipse, java and intellij are multiplatform

frigid ember
#

Like, is there anyone that has tried Project Onion/Spigot Course?

brisk mango
#

i like how IDEA looks on mac

sturdy oar
#

I like how everything looks on Mac you know

#

even the trash can

boreal brook
#

not me, i literally learned from reading plugin code from my friend and googling every 5 secons 😄

#

yeah macos is mmm nice ui

sturdy oar
#

StackOverflow

frigid ember
#

That's the point.

#

Project Onion seems like a consistant and slow-phased learning course

#

I don't really mind the money, I just want to learn how to code whilst it being fun, interesting, and understandable

sturdy oar
#

yeah learning ain't fun to be honest

#

it's just pain in the beginning

frigid ember
#

And when I used Swift Playgrounds, or got lessons at school, it was genuinely fun

boreal brook
#

tbh do what you want, does the course have some free samples in it? do you like them?

brisk mango
#

you dont need waste money on trash courses

#

i recommend you to take udacity course

#

its free

#

and you will learn alot

strange grove
#

hey does anyone know how to take a commands contents and put them somwhere?

#

hello?

#

😦

sturdy oar
#

define 'put it somewhere'

obtuse rose
#

define 'contents'

limber sierra
#

presumably parameters

#

not to hijack the guy from 15 minutes ago - but, i'm starting to have a go with java

#

i'm building with gradle, but it's not including the plugin.yml file

#

it exists in the src folder, but

#

it's just not being added to the jar file

#

how do i add it?

obtuse rose
#

why don't you put it in resource folder?

limber sierra
#

i'm so sorry if this is so simple, i'm somewhat familiar with java as i'm currently doing c# at college, but gradle is so confusing lmao

#

you mean the java folder?

obtuse rose
limber sierra
#

i'm an idiot 🤦‍♂️

obtuse rose
#

nah, we all have to start somewhere 😄

limber sierra
#

second problem now:

#

[17:39:21] [Server thread/ERROR]: Could not load 'plugins\FirstPaperPlugin-1.0-SNAPSHOT.jar' in folder 'plugins': uses the space-character (0x20) in its name

#

(ignore that it says paper in the name, i was gonna try that but then my mate said to try it once mastering spigot first)

#

alrighty nvm, plugin.yml once again haunting me

frigid ember
#

Here is a topic I just wrote, please read it entirely before reacting,.

obtuse rose
#

@frigid ember oRion?

#

is that what you meant?

frigid ember
#

oh

#

yes

#

my bad

#

@obtuse rose Changed immediately

brisk mango
#

@limber sierra because you have a space character in its name?

limber sierra
#

correct

brisk mango
#

(ignore that it says paper in the name, i was gonna try that but then my mate said to try it once mastering spigot first)
@limber sierra spigot and paper is the same thing

#

also what does mean "mastering spigot"?? lol

#

more like mastering java rather than spigot

#

its not that hard to learn an api

limber sierra
#

apparently half the stuff in the paper api is renamed?

red zenith
#

Not necessarily

brisk mango
#

then why learn paper rather than spigot

#

when its just renamed?

#

i dont understand lol

limber sierra
#

true, true

brisk mango
#

do whatever you want though.

limber sierra
#

hey i mean

#

i'm just messing about rn ¯_(ツ)_/¯

brisk mango
#

nice ip logger

limber sierra
#

...

#

it's... my image host...?

red zenith
#

Technically all the code from the original source has been renamed several times, obfuscated, deobfuscated, new apis

brisk mango
#

yeah why'd i open that

#

lol

limber sierra
#

it's literally a redirect i own to lucent.host

brisk mango
#

would you open a stranger's .exe file?

limber sierra
#

open it on browserling if ur scared, but it's just a video of the plugin i made lmao

#

bruh

#

it's an mp4

#

an mp4 doesn't inject into your computer

brisk mango
#

...

red zenith
#

Compare the javadocs between paper and spigot

limber sierra
#

not that much difference, now i'm actually looking at it

#

eh, guess it's a valid point tbh

red zenith
#

Paper adds further optimization and some methods, but it uses a similar approach to spigot when it does that

limber sierra
#

i'll start messing about with paper api then

brisk mango
#

Its not that much optimized, its still pretty much shit

#

and paper cant handle alot players on single server

#

another thing, i think minecraft servers should be multi-threaded

#

would be way better

limber sierra
#

which is why i'm using tuinity on servers

sturdy oar
#

tuinity is a Paper fork...

limber sierra
#

exactly

red zenith
#

What are you basing that off of? If paper is limited it’s because of minecraft itself

brisk mango
#

im basing that off paper's performance

#

and not really in every way

sturdy oar
#

oh man you're funny

red zenith
#

A potential problem with so many forks is that it starts to dilute the support and development across all of those forks to a degree, especially since they’re all volunteer projects

obtuse rose
#

imo, Spigot or Paper, that's it, don't waste money on shitty fork

sturdy oar
#

imagine buying forks

#

that's just 100% retarded

#

paying for modifications on the free works of others

obtuse rose
#

@sturdy oar that's like, what MCMarket is??? 😆

sturdy oar
#

is just non-sense

obtuse rose
#

mostly just a fork of Paper tbh

#

so mostly just Aikar's work

sturdy oar
#

yea

red zenith
#

It’s like creating a new denomination of a church; everyone wants to goldilocks tweak the rules so their porridge is just right. In the end it’s all spread to thin and unpalatable

sturdy oar
#

I also like stuff like GlowStone and Cuberite

#

sadly they are small and still haven't managed to go past 1.12.2

#

but it's pretty cool that they do not rely on Mojang's code

red zenith
#

Well a fair number of servers still run 1.8, so

obtuse rose
#

when will Mojang add PVP gamerule 😒

sturdy oar
#

i mean i think 1.8 is just something like 17%

manic raptor
#

Hi all, for an IOT project I'm trying to have a plugin make use of Google Cloud, and further would like to make use of the following classes in my plugin...

import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.cloud.pubsub.v1.AckReplyConsumer;
import com.google.cloud.pubsub.v1.MessageReceiver;
import com.google.cloud.pubsub.v1.Subscriber;
import com.google.common.collect.Lists;
import com.google.pubsub.v1.ProjectSubscriptionName;
import com.google.pubsub.v1.PubsubMessage;

I'm using Eclipse as my IDE, where I've installed the Google Cloud extension and added the necessary libraries via Project->Build Path->Add Library->Google Cloud Platform Libraries.
The the plugin.jar compiles and is created okay, and noteably with only one .java file it is 28 MB.
To me this indicates that the Google Cloud .jar files have been included in the plugin.jar?

When I export my plugin, I'm using the JAR file option, with the standard .classpath and .project unchecked and plugin.yml checked.
However when I run my plugin I get a NoClassDefFoundError exception whenever I try to use one of the Google Cloud classes...

This is the first time I've tried to include some additional library into a spigot plugin, so please excuse my lack of understanding here.
These classes, or library.jar files must be in my plugin.jar no? Otherwise why would it be 28MB? Is there something simple that I'm missing?

sturdy oar
#

are you using Maven or Gradle

torn robin
#

they have to be included so how else should the libraries be used?

manic raptor
#

Uhhh... Neither. Excuse my lack of understanding but I don't quite understand the difference. Aren't they included hence the 28MB file size on the plugin.jar?

torn robin
#

yes

manic raptor
#

So if they're included... how do I use them? 😛

obtuse rose
#

com.google.pubsub?!
Is that Google's propritary MQTT

torn robin
#

it should be auto-added to eclipse's code complete and you should be able to use the classes from it

#

assuming the imports aren't erroring its working properly

red zenith
#

You checked the jar contents for the classes?

manic raptor
#

When I run the plugin, whenever I use one of the classes it throws a NoClassDefFoundError.

#

I should note, that if I just simply make a runnable java application it works fine.

#

as in, a separate application using those classes

red zenith
#

I haven’t used eclipse for so long, I found it tedious, sluggish and underwhelming.

obtuse rose
#

use IntellJ

#

no excuse

red zenith
#

At least in contrast to idea, which is also free

obtuse rose
#

😆

rain plank
#

Does anyone know why /tpa doesn’t allow players to accept or deny? It gives the option to do both but they’re automatically teleported

red zenith
#

I would need more context to understand

#

I have my own code that provides those features and there are other plugins that do the same

rain plank
#

When we /tpa we automatically teleport. Perms are for to accept and to deny. I use essentials

red zenith
#

Perhaps a configuration issue?

#

Have you checked the docs for essentials?

rain plank
#

Yeah.

#

We have to /tpask to get it to work

obtuse rose
#

tpa is an alias of tpask though?

rain plank
#

Yeah.

#

But when we /tpa it doesn’t ask

torn robin
#

so it's probably another plugin

rain plank
#

It does

#

Idk what other one it could be, unless it’s the random teleport one. But it did it before that was added

red zenith
#

You probably have auto teleport enabled

#

I just looked at the code and permissions, if you have auto teleport enabled it skips sending the request

#

essentials.tpauto.others

#

make sure that’s unset or false

rain plank
#

Ok. I’ll look. Thanks 🙂

sturdy oar
#

I have this little doubt, I have two classes currently implementing ConfigurationSerializable and marked with annotation @SerializableAs, inside those classes i also have long field that represents the serialUID of the class

#

should the serialUID be transient ?

red zenith
#

Is there a reason for including the UID? I don't see that in some of my custom configs, where I use the same mechanism.
When I initially implemented them, I did, but then I realized it wasn't necessary to include a field for that purpose.

cloud sparrow
#

Do you mean UUID?

#

It depends on how you are saving player data if you are.

red zenith
#

I think this is a feature of java serialization

cloud sparrow
#

As since 1.8 you should use UUID for storing player data.

red zenith
#

They're using the bukkit api for serializing a class into a config file

#

which is different from UUID

#

@sturdy oar @SerializableAs is supposed to provide the serialization api with a simplified name used to identify your object; which should end up removing the serialUID.

sturdy oar
#

doesn't SerializableAs just specify a name

#

I mean I think i'll probably remove it

red zenith
#

It gets rid of a lot of extra stuff, that reduces the readability

#

bukkit is still able to figure out how to deserialize your class

rain plank
#

Is there a command for sending something to all players online? I’m trying to set up my online store by @a doesn’t work.

#

But*

red zenith
#
challenge:
  ==: Challenge
  duration: '30'
  name: Adventurer Challenge
  rank: Player
  objectives:
  - ==: EntityObjective
    mobName: ':wolf:'
    minGoal: 3
    entityType: WOLF
    name: Ambushed By Werewolves
    description: 'Kill %s %s.'
    withoutArmor: 'false'
    maxGoal: 5
#

@sturdy oar it leaves out the fully qualified name of the class; and you end up with something like the above. ==: NameSpecifiedInSerializeAs

#

@frigid ember You'd probably need to schedule a repeating task, and track the initial time the event was fired and provide it the the constructor of whatever Task you create

sturdy oar
#

well I also have a deserialize method that i built on my own

red zenith
#

You usually have to define one as part of the api

#

for ConfigurationSerializable

#

but you don't need the UID for that to work

sturdy oar
red zenith
#

@sturdy oar ```java
public Objective(Map<String, Object> args)
{
try
{
name = (String) args.get("name");
description = (String) args.get("description");
emojiDescription = "";
minGoal = (Integer) args.get("minGoal");
maxGoal = (Integer) args.get("maxGoal");
recalculateGoal();
}
catch (Exception ex)
{
ex.printStackTrace();
}
}

sturdy oar
#

so you're saying i could just do the casting from the constructor?

#

now that I think of it

red zenith
#
    public Challenge(Map<String, Object> args)
    {
        this.name = String.valueOf(args.get("name"));
        this.duration = this.originalDuration = Integer.parseInt(String.valueOf(args.get("duration")));
        objectives = new ArrayList<>();
        this.objectives = (List<Objective>) args.get("objectives");

        for (int i = 0; i < Win_Max_Slots; i++)
        {
            TextComponent text;
            switch (i)
            {
                case 0:
                    text = new TextComponent(FIRST_PLACE + " ");
                    break;
                case 1:
                    text = new TextComponent(SECOND_PLACE + " ");
                    break;
                case 2:
                    text = new TextComponent(THIRD_PLACE + " ");
                    break;
                default:
                    text = new TextComponent(CONSOLATION + " ");
                    break;
            }

            rewards.add(new BaseComponent[]{text});
        }
    }
#

the objective class is serialized and is part of the challenge class

#

since it implements configuration serializable you can just cast it

sturdy oar
#

so Bukkit does all the 'serialization part' that I'm currently doing by hand?

red zenith
#

you just have to specify how your class properties deserialize using the map

#

and vice versa for serialization

sturdy oar
#

mh cool, I will change this asap

red zenith
#

Location implements it as well

sturdy oar
#

yeah ItemStack as well

#

and others i think

red zenith
#

Those two for certain, but it's relatively straightforward, though confusing at first.

sturdy oar
#

does that work on BungeeCord as well?

red zenith
#

for loading configuration?

sturdy oar
#

yeah nvm it won't

#

that's just Bukkit API

red zenith
#

right

#

There are other approaches to doing this, gson/json libraries

sturdy oar
#

why doesn't bungeecord use the same YAML API that Spigot uses? That's a thing I've never understood

red zenith
#

I haven't needed them yet, but I've seen plenty of examples for plugins that do

#

even net.minecraft.server includes examples, which you can see if you've run buildtools or build Paper

#

I don't know all the details behind the history of bungeecord, I'm only familiar with what it does; I haven't run a setup with it

sturdy oar
#

well sadly I'm making a JAR that works both on BungeeCord and Spigot

#

so I'll have a lot of duplicate code i think

red zenith
#

I would look into something like gson then

#

it may be included in bungeecord already. Pretty sure it's a dependency included in the spigot jar, but I would double check that.

sturdy oar
#

does GSON read YAML?

#

i thought it was only for Json

#

also yes Gson is shaded into Spigot

red zenith
#

gson can read either, I believe

#

ah, that's jackson

sturdy oar
#

yeah )=

#

I mean sometime having duplicate code is fine i guess

red zenith
#

maybe snakeyaml + gson

#

Is snake in bungeecord?

sturdy oar
#

well you see, I currently have an 'AbstractValues' class

#

sadly Bungeecord Configuration

#

has basically the same methods of Bukkit Configuration

#

but they don't have anything in common

#

so I can't generalize on that

red zenith
#

are all of those enums your defaults?

#

In EnumConfig?

#

You don't want to lock up your server for 10 seconds while it waits to check the elapsed time; which is why you schedule a task or repeating task to check after a delay, or repeatedly.

red zenith
#

How are you managing player permissions, and is anyone op'd?

rain plank
#

Just me.

#

But it happens to everyone

#

Luckperms

#

And it’s not on their perms.

red zenith
#

Well, I generally avoid op and use groups with luckperms to assign permissions instead

rain plank
#

I’m the only one with op

red zenith
#

Luckperms gives you a default group to start, that's applied to everyone

#

op overrides most permissions

#

which is why I don't use it, can make it difficult to test certain functionality

#

can you DM me, I want you to share what luckperms shows in the editor

#

/lp editor

#

that'll give you a link to a web interface, where you can see all the permissions you've set

#

You want to check your default group and look for any thing that starts with essentials

#

if you're using any wildcards: essentials.* or have an entry for essentials.tpauto.others

rain plank
#

I know how to use lp. I’m telling you that every person that is lower than admin does not have that .

#

But it still auto tpas them

red zenith
#

So you've checked all your permissions for your default group and no one has wildcard permissions for essentials

rain plank
#

Yes

#

That is correct

red zenith
#

and you're just running one minecraft server, no bungee or anything else?

#

and you have no other plugins that implement any kind of /tpa

rain plank
#

Correct.

#

I only have one for random tp.

red zenith
#

the one provided by essentials?

rain plank
#

No.

red zenith
#

so the only thing that plugin does is provide /tprand or /wild?

rain plank
#

Yes

rough hare
#

Hey, It's my first time developing a plugin, and I'm trying to make a sound play when a player enters the command. I did p.playSound(Sound.BLOCK_NOTE_BLOCK_BASS); However I have formatted this incorrectly. Does anyone know how to correct it?

red zenith
silk gate
#

(hint: set them to 1.0)

rough hare
#

thanks so if I want it to play (location) on the player it's just "@p"

red zenith
#

player.getLocation()

#

I believe

rough hare
#

ok

red zenith
#

or p.getLocation()

#

since that's the name of your player variable

rough hare
#

thanks

#

great it works! Also that website frost sent is quiet useful, ill refer to that!

red zenith
#

@rain plank The only other place where the auto teleport might be configured is in the players data file for essentials

#

so in your plugins/EssentialsX/userdata each user should have a .yml file that includes their name and UUID in the title

#

look for teleportauto

#

Did you follow an example somehwere?

#

public void only needs to come at the beginning of the line where you define your function

#

If you're not sure about the conventions of java, I'd encourage you to find some resources online that will help you learn

#

ah I see what you mean

#

you mean like this?

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        // Create the task anonymously and schedule to run it once, after 20 ticks
        new BukkitRunnable() {
        
            @Override
            public void run() {
                // What you want to schedule goes here
                plugin.getServer().broadcastMessage(
                    "Welcome to Bukkit! Remember to read the documentation!");
            }
            
        }.runTaskLater(this.plugin, 20);
    }
#

The reason why you have that method run inside the onJoin method, is that you're defining an implementation of BukkitRunnable() inline, and it requires you to define the run method; which has the method signature public void run()

#

well, you have some issues with that

obtuse rose
#

why did you have 2 argument for event handler?

red zenith
#

you cannot listen to two events in one EventHandler

#

you would need two seperate eventhandlers

#

but that's not the only issue

#

you don't want your function to run a while loop in your event handler, like that

#

that's where you need to schedule a task/runnable

#

because your sever won't respond to any other requests while that timer is running?

#

I shared that with you earlier, I thought.

rain plank
#

I’ll work on the configs when I get home

red zenith
#

if your sever is running properly, there should be roughly 20 ticks per second

#

when your event triggers, you store the current time in milliseconds

#

then your task runs every so often, until you stop it

#

and gets the time in the same way

#

and compares the two

#

don't just assume that your 20 ticks actually occured in 1 second

#

anything that stresses your server will lower the ticks per second

#

If you want a reference check out the code for griefprevention. It has a feature that lets you siege another player's claim, and if a flag is set, that player dies if they try to logout

#

That's not a straightforward example

#

but it does demonstrate a custom task that is run when someone is sieged

rough hare
#

How do I add a tooltip as part of a message

red zenith
#

you mean something you can mouseover?

rough hare
#

yeah

red zenith
#

@frigid ember what do you use to check if the player is in pvp combat? how long do you keep them in that state? So when you check if they're logging out, that they'll die?

rough hare
#

in deluxechat its called a tooltip for some reason

#

but yeah mouseover

red zenith
rough hare
#

thanks

red zenith
#

Are you trying to prevent logout when in combat with anything? or only with players?

rough hare
#

Whats an enum constant?

atomic imp
#

do mobs spawn less on spigot servers? My friends and I have a multiplayer server and we built a creeper farm but its not as efficient, I lit up the whole area and built it correct but mobs barely spawn. Is there a way to change this?

red zenith
#

I've had an issue with that for some time, I created a modification to mob spawning because by default vanilla mc server does not evenly split the spawn across players

#

it's more of a first come/first server basis

#

I think Aikar has a fairspawn plugin, I don't know if it's maintained or not

atomic imp
#

ok

rough hare
#

Nice

red zenith
#

In fact I have the opposite problem right now, I have way too many mobs spawning and I need to adjust my code

#

I go to the nether and ghasts everywhere, used to see practically zero

atomic imp
#

lol

#

I found in the bukkit.yml that there is a mob spawning rate

red zenith
#

bukkit and spigot configs have parameters for adjust spawn factors

atomic imp
#

should my friend put the change the bukkit.yml?

red zenith
#

I'd refer to that

#

I use paper

strange grove
#

hey does anyone know how to takle the contents of a command?

#

*take

red zenith
#

/summon minecraft:football_player

strange grove
#

hahahha

atomic imp
#

nice meme

strange grove
#

🙂

#

well

#

um

#

does anyone here know how to take the contents of a command i make and put it somewhere else?

#

it would rly be a pleasure if you help!

#

🙂

red zenith
strange grove
#

no no

#

well

#

maybe

#

but

#

i'm asking

#

see

#

im making a /replace command

red zenith
#

are you asking how to keep track of commands entered?

strange grove
#

for animated frames

#

and using the data from the replace command

#

it's going to give that data to other commands and execute them

#

it's putting to old thing to gether and making something new

#

so first

#

it's going to execute the remove command

#

then the create command

red zenith
#

you'd probably have to create your own plugin, to create a command that'll do that

strange grove
#

no no

#

i've already got an idea

#

so

red zenith
#

by animated frames, you mean item frames?

strange grove
#

yes

red zenith
#

you want to change the item in the frame

#

every x ticks?

strange grove
#

the picture in the frame

#

and no

red zenith
#

you mean paintings or item frames?

strange grove
#

by replacing it i keep the name but take the old url of the picture

#

and put in a new one

#

but keep the name

#

ya get me now?

red zenith
#

so you have a painting which you've named, with a nametag or in code?

strange grove
#

well

#

yes

red zenith
#

and you want the contents of the painting to change?

strange grove
#

but not the name

#

so

#

taking the value of the name and keeping it but throwing the url away and placing a new one via command...

red zenith
#

wait, so you're trying to display a custom image, and not just cycle through the ones available?

strange grove
#

that parts not important

#

the part that's important is changing

#

the content

red zenith
#

I think it's important to clearly state what your trying to change

#

If you're just cycling through the available artwork that's part of the default client, that's one thing

strange grove
#

/replace (name of image you want tor replace) (url here)

red zenith
#

but if you're using custom, then you obviously have to provide that to the client as well

strange grove
#

then it gives it

#

to other commands to execute

#

/remove (name of image you want tor replace)

#

/create (url here)

#

but their asynchronous and delayed

red zenith
#

give me a basic scenario: Start by describing the original item, and then an example of what you would change it to

strange grove
#

well

#

say i wanted a picture of itachi uchiha to be cahnged to madara uchiha

red zenith
#

bless you

strange grove
#

i just do the replace command and it gives you

#

well it makes

#

you

#

because im using player.chat

red zenith
#

so basically custom images

strange grove
#

yes

#

and gifs if needed

red zenith
#

and you want to display those in game?

strange grove
#

it's already set

red zenith
#

so you've already got that working?

strange grove
#

im just trying to change the contents

#

well with a plugins help yes

#

just adding my own little command to use

red zenith
#

and this plugin manages the loading of the images from a url, and transmits that to the player's client?

#

Does this require a forge client or something non standard?

#

that's the part I'm trying to understand

lament wolf
#

Is there an equivalent of onTabComplete on Bungeecord ?

strange grove
#

um

#

not sure

red zenith
#

They have a discord, don't they?

strange grove
#

using someone elses

#

from spigot or bukkit i dunno

rough hare
#

Sorry to bother so often, I've been trying to apply the hover event, and copied the example text on the spigot website, however I haven't been successful. If I send the text could someone assist me?

strange grove
#

but the point is to switrch content

#

if you want @red zenith i could friend you

#

so we could talk un interrupted

#

🙂

red zenith
#

Is the plugin that you're using available somewhere? the code?

strange grove
#

yeah

#

it's called animated frames

#

it worls rly well

#

works

#

it can do gifs and images

#

tho i can make a few bugs happen

#

🙂

#

by doing some stuff

rough hare
#

wow @strange grove thats a cool plugin u made!

strange grove
#

no it's not mine

#

im piggybacking of it

#

but not gonna post it

#

butr i can give you the link

#

im just making a new command

rough hare
#

XD

strange grove
#

so i can use it personally

#

for my server

#

anywho

#

so anyof you know how to transport command contents?

red zenith
#

have you tried giving a url for the image to the command in animated frames?

strange grove
#

well

#

yes

#

but that is not the problem

#

there is not a replace command

#

and it takes longer to replace an image

#

so im making a new one for the plugin

#

"that is not mine!" @rough hare lol 🙂

rough hare
#

yeah ik

strange grove
#

heh

rough hare
#

still cool tho

strange grove
#

🙂

#

so

#

any ideas? on how to transport /replace <nameOfimage> <urlOfimage>

red zenith
#

are you trying to avoid having to save the images?

strange grove
#

to

#

no

#

im trying to avoid

#

using the remove command

red zenith
#

so you just want to add an image to the list of images that AnimatedFrames can display

strange grove
#

and then the create command

red zenith
#

and then replace one that you've already created?

strange grove
#

to make a new one

#

yes