#help-development

1 messages · Page 510 of 1

ivory sleet
#

Kubernetes so nice

#

Docker just best

agile anvil
ivory sleet
#

Mye

karmic mural
#

If I check if an item is a "Splash_potion" will it return true for any kind of splash potion?

rotund ravine
#

Material yes

twilit roost
#

can I somehow stop some Worlds from ticking until I want them to?
To save resources

rotund ravine
#

Don’t load them

twilit roost
#

well I don't want to block the main thread when I want them to load

slim wigeon
#

GuiManager created and functional, it was the 3 events. Issue Resolved

rotund ravine
#

@slim wigeon could just have done this

slim wigeon
#

Was that you that sent that Gui Thread?

rotund ravine
#

Nop

slim wigeon
#

Also, there is no ignoreCancelled = true in the handler. I just made a GuiManager and that fixed my issue

#

As shown here // Guis getServer().getPluginManager().registerEvents(new GuiManager(Arrays.asList( new InterfaceGui(), new GroupGui(), new PurchaseGui(), new SellGui() )), this);

rotund ravine
#

There is

slim wigeon
#

In that GuiManager```public class GuiManager implements Listener {
private List<AbstractGui> guis = new ArrayList<AbstractGui>();
public GuiManager(List<AbstractGui> guis) { this.guis = guis; }

@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
    Player player = (Player) event.getWhoClicked(); InventoryView invView = player.getOpenInventory();
    for(AbstractGui gui : this.guis) {
        if( invView.getTitle().equals(gui.getDisplayName()) ) { gui.onClick(event); return; }
    }
}

}```

#

That is not possible by my current setup

#

Look at the source code and you see why

#

But don't think I will fix it if it was a chest that people have in inventories. I got a system that checks metadata anyway so I could not run into that issue

#

From ItemMagnet source code public boolean isItemValid(ItemStack item) { ItemMeta meta = item.getItemMeta(); DataContainer container = new DataContainer(meta); if( item.getType().equals(Material.NETHER_STAR) ) { if( container.isSet("itemID") ) { return container.stringGet("itemID").equals("itemMagnet"); } } return false; }

rotund ravine
#

It’s still flawed

karmic mural
#

Yeah we came to that conclusion earlier, I updated it a bit further down

slim wigeon
#

I know how to program, its just sometimes I need help. But soon as I heard someone say something about the 3 events, I instantly knew I needed a manager for the Guis. I have used Java to make a IRC bot using PircBot, that is when I first touched Java on the programming lang

valid basin
#

Does someone know how to send titles on bungeecord?

wise mesa
#

I have absolutely zero use for this, this is purely out of curiosity

#

Is it possible to inject additional instances/values into an enum

agile anvil
#

No it's not possible

#

Enum aren't polymorph

chrome beacon
#

You can intercept the loading of an enum and add stuff to it

#

But a plugin wouldn't be able to do that

river oracle
#

Java is so powerful lol

#

You can do anything

tribal quarry
#

how can i cut strings like that?:
example: hello %everybody%, my name is jack
to: hello %everybody% , my name is jack
by isolating %everybody% from the string?

chrome beacon
#

Regex if you want to detect all placeholders. Otherwise you can just use replace if you want to replace that with a value

shadow night
tribal quarry
#

i am using components

#

i want to put a clickevent on %everybody% and attach it to the message

chrome beacon
#

Then you should have stated that in your first message

tribal quarry
#

or just tell me how its done in components

chrome beacon
#

You can split the string at the placeholder

#

and insert your component there

worldly ingot
#

I told you it's difficult to expose in Bukkit sanely 😛

torn shuttle
#

I am quickly losing faith in humanity, more so than I thought possible

#

people playtesting my tower defense game can't figure out how to make a maze and maximize damage

#

I guess I really need to make a tutorial level that is just extremely easy because people are giving up on wave 7 when the softcap is 100 and the highscore would probably be in the 150s

tawdry echo
#

how can fix cannot access xyzClass

worldly ingot
#

Make it public? ;p

remote swallow
#

if its public and ur using ij clear caches and restart

chrome beacon
#

Or if you didn't import the dependency do that

tawdry echo
#

nvw content of my class got deleted idk why

quaint mantle
#

Hi

#

Help please

#

How to bind a mod to a plugin on a magma?

worldly ingot
#

Well you're definitely in the wrong place because this is Spigot ;p

quaint mantle
#

I have a mod running, I have a plugin running. Models are not visible on the client when logging in to the server

#

You can’t see the models on the client

worldly ingot
quaint mantle
#

No magma

worldly ingot
#

We have no knowledge of Magma or how it works

quaint mantle
#

I was wrong

sharp ocean
#

please help my

#

Please wait 4 before sending another message /who fixed ?

quaint mantle
#

It’s good, but it doesn’t see the model

slim wigeon
#

How do I get the item default name like how ShopGUI+ works?``` if( event.getRawSlot() == 52 ) {

            if( this.plugin.economy.has(player, price) ) {
                this.plugin.economy.withdrawPlayer(player, price);
                player.getInventory().addItem(new ItemStack(item.getType(),item.getAmount()));
                player.sendMessage(String.join(" ", Arrays.asList(
                    ChatColor.GREEN+"Success! "+ChatColor.WHITE+"You have purchased "+meta.getLocalizedName()+" x"+item.getAmount(),
                    "for "+ChatColor.GREEN+"$"+price
                )));
            } else {
                player.sendMessage(String.join(" ", Arrays.asList(
                    ChatColor.RED+"Error! "+ChatColor.WHITE+"You don't have "+ChatColor.GREEN+"$"+price+ChatColor.WHITE+" to purchase",
                    item.getType().toString()+" x"+item.getAmount()
                )));
            }
            
            player.closeInventory(); return;
        }```https://www.spigotmc.org/resources/shopgui-1-8-1-19.6515/
remote swallow
#

toString the type and format it

young knoll
#

Ew

#

Use a translatable component

remote swallow
#

yeah well

#

chocos pr hasnt been merged

young knoll
#

They are sending chat messages

#

Those already support components

remote swallow
slim wigeon
#

I was trying to think what I did for Factorio``` function func.itemTable(name,width,height,column_count)
if not height then height = 250; end
if not column_count then column_count = 2; end

local win = guiElem.add({type = "frame", style = 'inside_shallow_frame'}).add({type = "scroll-pane"})
win.style.width = width; win.style.height = height; win.style.padding = 4; local func = {}
local elem = win.add({type = "table", name = name, column_count = column_count})

function func.add(name)
  local item = elem.add({
    type = "sprite-button", style = "tool_button", sprite = "item/" .. name,
    tooltip = game.item_prototypes[name].localised_name
  })
  local style = elem.style; style.width = 40; style.height = 40; style.padding = 0
end

return func

end```But I don't know, .localised_name must not be on MineCraft for some strange reason. I trying to avoid NMS if possible

quaint mantle
#

Who helped me?

undone axleBOT
young knoll
remote swallow
#

no

sharp ocean
#

@remote swallow please help my
Please wait 4 before sending another message /who fixed ?

slim wigeon
#

I know that exists but as you notice, that code is Lua and we working with Java here. These 2 programming langs are not the same

young knoll
#

The paste site handles anything

#

It's just text

slim wigeon
#

I know it does, I used that multiple times. When I had a issue with my shop, I used it to send 3 class files

sharp ocean
slim wigeon
#

Its not related to SpigotMC, that was something I should ask on a Factorio dev server. But the reason I sent that is so you see what I trying to do. I just trying to complete my shop. Adding shops without purchasing anything is my goal or anything in that case as I banned from Paypal

remote swallow
#

and the paste site isnt only spigot mc related, not even on the spigotmc.org domain

slim wigeon
#

I know its owned by md_5

remote swallow
#

so why couldnt you paste it on there instead

#

it just is hastebin lol

hazy parrot
#

It's not fork

slim wigeon
#

While I play Huuuge Casino and talking here, I could have got the name of a item working which I asked for help about. No NMS

#

Default item name is Nether Star for a example

#

I want to get that text

slim wigeon
#

Console outputSuccess! You have purchased x1 for $20Item Material Glass

ocean hollow
#

How to add an item to the inventory, in some range?

young knoll
#

If the range is continuous

#

Just loop over the slot numbers

#

for (int slot = 4; slot <= 9; slot++) { setItem }

ocean hollow
#

No, I'm not talking about random. I need to add an item to one of these slots using the addItem() method

#

addItem() adds an item to the first free slot.

#

and before that I have empty slots, I need to ignore them

young knoll
#

setItem

ocean hollow
#

setItem() doesn't work for me either, because it doesn't update the number of items that are already there.

young knoll
#

get the current stack (if any) and add to the count

hazy parrot
#

there is no reason for Factory class to be nested

#

because getA is not static

small glen
#

Hey i have this problem with HikariCP and java 8 and spigot 1.9 or 1.10, but in bungeecord the same thing work, but spigot won't

chrome beacon
small glen
#

How ?

chrome beacon
#

Shade and relocate a new version in your jar

small glen
#

i already did this

#

look dm

chrome beacon
small glen
#

i don't understand x)

small glen
#

i don't use maven on intellij

chrome beacon
#

Gradle then?

small glen
#

no i don't use anything

#

i just build manualy

chrome beacon
#

._.

small glen
#

can you help me i'm lost

chrome beacon
#

How did you even get HikariCP on to the server 💀

quiet ice
#

some other plugin shading it probs

small glen
#

can i screenshare to you ?

quiet ice
#

Using maven is the safest bet as it has the best documentation

small glen
#

i just Added framework support on intellij

#

and added maven

#

but now i'm lost

chrome beacon
#

Go look up maven tutorials

small glen
#

what i have to put in groupId

quiet ice
#

convention is to use the reverse domain - or email if you don't have that

#

(Reverse email being something like com.gmail.minecraftplayer27 for minecraftplayer27@gmail.com)

small glen
#

okay and now i need to reimport spigot with Maven ?

chrome beacon
#

Yes

small glen
#

spigot isn't on maven central

chrome beacon
#

?maven

undone axleBOT
subtle folio
#

mavenmaven

small glen
#

okay thanks

#

i've added all dependencies

#

and how i change the sql driver pls

chrome beacon
#

Depend on new version of driver

#

then shade and relocate

#

and tell Hikari to use new driver

small glen
#

idk what that mean

small glen
#
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <configuration>
                    <relocations>
                        <relocation>
                            <pattern>com.mysql.jdbc</pattern>
                            <shadedPattern>mysql-connector-java</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>```
#

it's good ?

chrome beacon
#

no

#

Use your own package

small glen
#

how i do that

quiet ice
#

change the shadedPattern

small glen
#

yes but idk what to put in

quiet ice
#

com.gmail.minecraftplayer27.mysqlconnector

small glen
#

okay i did

#

i build

small glen
quiet ice
#

are the source and resource files in src/main/java and src/main/resources appropriately?

small glen
#

ok it's now detected, but error onEnable

quiet ice
#

and what is that certain error?

small glen
#

null with protocol lib implementation

#

i added protocol lib with maven

#

but doesn't work like previously even it's the same version

#

ok, everything fixed but not the mysql error 😢

small glen
icy beacon
#

?learnjava

undone axleBOT
icy beacon
#

and learn maven i guess

#

and oh well

#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

quiet ice
#

Meh, this is a plain case of there not being a sufficent pool of people that have knowledge in the particular topic

small glen
#

Everything work just needed this... hikariConfig.setDriverClassName("com.mysql.cj.jdbc.Driver");

pseudo hazel
#

java

restive mango
#

Hmm... you know, there is a noClip tag now, for abstractArrow

#

I wonder if I can somehow use that...

quiet ice
torn shuttle
#

some times java is icky

#

I don't like how I get classes from itemstack pdc

wet breach
#

otherwise may need to wait several hours before someone like me is on to help XD

agile anvil
#

life saver

quiet ice
#

I should start with SQL heh.
But I still prefer my own flatfile databases for the moment

flint coyote
#

We can take the easy route and prevent you from leaving uwu

agile anvil
wet breach
#

there is more to SQL then just the programming side of it

agile anvil
#

I did the inverse way, that why I struggled with it because without basis it's depressing

young knoll
#

Gotta design those schemas

flint coyote
wet breach
# young knoll Gotta design those schemas

Well, other then learning this it does help though if you learn the system you are using because typically they end up having things built in that would make your programming a whole lot easier

quiet ice
flint coyote
#

Database design and SQL statements really aren't that hard

wet breach
#

I would probably say the part where Geol would most likely not be familiar with is the other side of the SQL field, not the programming area or looking at code that interacts with SQL 😛

quiet ice
#

And well I already know how to structure databases and stuff (In fact I am currently doing ERMs and all that other database design stuff at school)

flint coyote
#

Using databases is quite straight forward. It does get painful if you support different databases and they handle transactions differently

wet breach
#

but, there is times though where designing a DB isn't going to be straight forward because you don't have enough information or know all the possible things you need to be aware about until you get further along in your program

flint coyote
#

I feel like it's hard to fail designing a relational database model. Unless there's a good reason not to you just avoid duplicating any data and you are good

#

Sure there are exceptions but usually those exceptions won't be there in a minecraft context

wet breach
#

not for the typical plugin

quiet ice
#

the main problem I expect to occur is that changes later on can be quite painful

flint coyote
#

You can always migrate the data

wet breach
#

it isn't because they don't know, they just don't want to go through the time and trouble to change it

quiet ice
flint coyote
old totem
#

Hello everyone. ProtocolLib does not work in the plugin

error:

Caused by: java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.sendServerPacket(org.bukkit.entity.Player, com.comphenix.protocol.events.PacketContainer)" because the return value of "com.comphenix.protocol.ProtocolLibrary.getProtocolManager()" is null

maven:

<repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>dmulloy2-repo</id>
            <url>https://repo.dmulloy2.net/repository/public/</url>
        </repository>

    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.12.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>RELEASE</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.comphenix.protocol</groupId>
            <artifactId>ProtocolLib</artifactId>
            <version>4.8.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

plugin.yml:

name: TestPlugin
version: '${project.version}'
main: me.imzontik.testplugin.TestPlugin
depend: [ProtocolLib]
commands:
  createpacket:
flint coyote
wet breach
flint coyote
wet breach
flint coyote
#

Usually my projects are pretty open end - until I abandon them

#

For various reasons

old totem
wet breach
#

is it enabled?

old totem
wet breach
#

then it is going to be something with your code then

#

or you need to wait for protocollib to be enabled first before your plugin

flint coyote
#

Well he is depending on it so that should get handled by spigot. Unless he's accessing in a static context

quiet ice
#

try updating the protocollib plugin installed on the server

#

after you make sure you only run your code after Protocollib fully initialized

wet breach
flint coyote
#

Yeah he did that

old totem
#

the problem has been solved, thanks

quiet ice
#

even then it may as well be useless as either protocollib initializes too late or the plugin loads too early

quiet ice
wet breach
#

o.o

flint coyote
#

The plugin cannot load too early if you depend on another plugin

#

Obviously you can't rely on that when using static blocks but everything in the on enable will not run before the depending plugin is initialized (if it's installed)

quiet ice
#

static blocks is what I mean with too early

#

And then there are also plugins that initialize on the first tick - so even calling their APIs in the onEnable won't work.
But I am not sure if protocollib is one of those plugins

flint coyote
#

Yeah I also had to do that for one of my projects

#

since depending plugins need to register before I load all my contexts

tardy delta
#

👋

subtle folio
#

java json library?

#

java object to json and back library?

#

Question Mark?

flint coyote
#

google gson is included in spigot

#

there's also org.json

#

and some more

quiet ice
#

Probably GSON, but I prefer org.json if you like less magic interfacing

subtle folio
#

magic??

flint coyote
#

reflection

quiet ice
#

Sometimes libs might use even darker magic

subtle folio
#

org.json documentation?

flint coyote
#
quiet ice
#

org.json:json documentation is pretty much only the javadocs

subtle folio
#

goggle .com documentation?

quiet ice
#

It's dead easy to figure out

flint coyote
#

💀

subtle folio
#

im really bored

crude estuary
#

also if you don't know how to Google

subtle folio
crude estuary
#

Yeah

#

Forgot to add the Text

#

xD

subtle folio
#

lol

crude estuary
#

the Main Point of the Website and i just didn't do it

quiet ice
#

i.e. String stringified = new JSONObject().put("key", "value").toString();
And vice-versa it'd be
JSONObject jsonified = new JSONObject("{\"kew\" = \"value\"}");

subtle folio
#

maybe ill just use jackson

quiet ice
#

isn't that one unmaintained?

flint coyote
#

no jackson is maintained and is also widely using in spring

subtle folio
#

not according to a 2015 blog post

#

im writing a spring boot app rn lol

flint coyote
#

spring != spring boot though

subtle folio
#

similar enough

#

boot is just the web mvc

flint coyote
#

Yup and Spring itself is just the beans and wiring. Afaik spigot also started based on spring

quiet ice
#

doubt so

flint coyote
#

well it was widely used to run external jars. Doesn't sound that unfamiliar for plugins

#

a colleague told me. I never checked

subtle folio
#

I think Bukkit used to.

quiet ice
#

hm. I never heard about it being used

subtle folio
#

prolly not anymore

#

the beans got old and stale

quiet ice
#

defo not anymore

#

They haven't been available ever since 1.8 if they ever included it

#

And I've checked out some old ass CB forks and I don't recall seeing something about spring

flint coyote
#

as I said. I was told it started with it, I never checked so I can't be sure about it. Although it would fit

quiet ice
#

I've seen a reference of avaje.ebean - perhaps you mean that?

flint coyote
#

Would have to ask the guy who told me. I just believed it since it would have made sense. If it's wrong then now I know

quiet ice
#

Dissected the spigot and cb sources (although latter only through that old ass fork I referenced before) and didn't find any mention of spring before the maven transition occured. After that it gets a bit difficult since dependencies cannot be easily searched for

flint coyote
#

It probably wasn't spigot. I just forgot that bukkit was a thing years ago. So yeah it was probably (craft)bukkit in its really early stages. Or he just mixed something up aswell

orchid gazelle
#

hello, does anybody have an idea of how to implement a system that detects if the player is holding interact? I'd guess somehow check for times between clicks or something maybe?

wet breach
#

not sure who told you, but they are definitely wrong lol

subtle folio
#

that's it im making my own jackson fork

buoyant viper
#

just make ur own JSON java impl

#

ezpz

subtle folio
#

yeah might aswell

#

fk jackson

buoyant viper
#

Retrofit lele

orchid gazelle
#

I gotta use holds to move my armorstands better. For now, I just have teleports set up on interact which makes it look laggy if holding down tho

flint coyote
orchid gazelle
#

so if I can detect when a player is holding down the interact, I can set the velocity

#

they are just armorstands that gotta be moved when clicking an item, but also when holding down it should constantly get moved

flint coyote
#

why don't you pick it up on first right click and lock it into position on the next?

orchid gazelle
#

wdym?

#

for single interacts I can just teleport

flint coyote
#

Right click = Armorstand moves
second right click = Armorstand no longer moves

orchid gazelle
#

for holding down I gotta use velocity so it does not look laggy

#

since interacts are only getting called every like 200ms

#

(and would demolish performance)

orchid gazelle
flint coyote
#

then use leftclick or a different item

orchid gazelle
#

it is a ingame creator for armostands, they need to be moved precisely

#

its the same issue then

flint coyote
orchid gazelle
#

so right there things are gonna get complicated

#

I want a precise realtime creator

flint coyote
#

Loop over players and send them the packet? The server does the same except that it still handles a real entity

orchid gazelle
#

not "input the position m8"

orchid gazelle
flint coyote
#

But as I said, you don't need to use packets since moving a single entity (or even 100 entities) every tick won't hurt performance that much

orchid gazelle
#

players gotta move around while editing

orchid gazelle
flint coyote
#

I don't know how you implemented the moving part but I'd just have an item that's a position adjustment tool. When selecting the armor stand you can move it around until you unselect it with another click

orchid gazelle
#

interacts get called like every 200ms or something

#

players gotta move around while editing

#

and 10x more time-consuming and annoying for users

flint coyote
#

I told you multiple times to not use "hold button". If you need single teleports either use another item or another click type (or check if the player is shifting during the click) or whatever suits best

orchid gazelle
#

because when having them input some random positions, they cannot see how it is gonna look in realtime

orchid gazelle
flint coyote
#

Well you are engine limitated here 😅

orchid gazelle
#

don't need to

fervent robin
#

Hey I am using the PlayerMoveEvent to place a block under a player everytime the block under the player isnt a certain type of block. Though this works flawlessly most of the time when I go in between chunks it lags back. https://paste.md-5.net/sanafehuvo.cs

orchid gazelle
#

1 item in hotbar for every direction

flint coyote
crude estuary
#

use .java

fervent robin
midnight finch
#

Hello, I'm trying to replace the lore of a music disc to "Uncompleted!" (for bingo), but setting it to null like it says in the documentation doesn't work. It still shows the artist and title of the song.

ITEM_META.setDisplayName(ChatColor.RED + getDefaultItemName(materialToAdd));

ITEM_META.setLore(null);
List<String> LORE = new ArrayList<>();
LORE.add(ChatColor.GRAY + "Uncompleted!");
ITEM_META.setLore(LORE);

ITEM_TO_ADD.setItemMeta(ITEM_META);
crude estuary
#

that's the Server Lagging so Hard

#

i Remember that Thing from a Plugin Called PlugHack

#

from a While Ago

fervent robin
#

i made that plugin lmfao

crude estuary
#

why did you Remove it then?

#

it was Cool

#

and Fun

midnight finch
#

I did

fervent robin
crude estuary
#

Yes, Please i want to Hack without Hacks

orchid gazelle
#

so basicly I can also set up a loop that gets started and renewed for every click

#

it contains the time of the latest click, and then I gotta compare it to the new event

fervent robin
crude estuary
#

Yeah, but the Server can't keep up with the Position of the Player at the Same time it Places Blocks under Him

#

that Happened to me when using PlugHack and i though it was that

#

and i Said Server but i meant Event

fervent robin
#

ur literally the second person to recognize me for that plugin it only has 300 downloads too

crude estuary
#

i'm one of them

#

I Actually Enjoyed it

river oracle
#

No one recognizes me :(

orchid gazelle
#

what about just a HashMap containing all players and the last time they clicked, then compare every interact call

quiet ice
crude estuary
#

i think i was the Only one that had it Starred on GitHub

#

xDD

river oracle
orchid gazelle
#

yeah that also works

fervent robin
orchid gazelle
#

the thing with using an infinite loop is that I can actually register my own listeners to it

#

so I don't have to modify the method manually, can just listen

quiet ice
orchid gazelle
#

and also have custom timing not being bound to every interact

river oracle
#

Hope no one downloads it

crude estuary
#

but it's not Bad

#

it Works Great

river oracle
#

Otherwise I'll have to deal with the people

quiet ice
river oracle
#

I have to do a recode though

#

You should see my codebase vs his

#

It's like heaven and hell difference

quiet ice
#

that is standard once you are serious about forking

orchid gazelle
#

I never forked something lol

river oracle
#

Essentials clone 1,003,728,472

orchid gazelle
#

accurate

river oracle
#

I focus on skyblock stuffs though so

#

Ig a tad dif

#

But that's abt it

wet breach
river oracle
#

I almost forked an entire database yesterday cuz I didn't agree with their design

#

I'll get around to just making my own from scratch though

wet breach
#

to remember it because it is good or because I use it for something and therefore like to maintain it myself and fix whatever issues it has lol

quiet ice
#

I only use the fork feature because I legitimately either contribute to it or because I'm actually planning on rolling out a fork myself.
If I need to remember stuff it gets starred and forgotten

wet breach
#

I don't use the star function because I hate being spammed about stuff about it

#

just because I like it doesn't mean I need to be notified about anything of it

quiet ice
#

seems you got it confused with the watch feature

wet breach
quiet ice
#

Unless you look at the "for you" tab that is

wet breach
#

but I am stuck with the habit now and since it hurts no one I see no reason to change it

midnight finch
young knoll
#

It's mostly us having a bad name for it

west oxide
#

hello

#

is it possible to get spigot src ?

#

if so where ?

quiet ice
#

?stash

undone axleBOT
west oxide
undone axleBOT
quiet ice
#

works fine for me ™️

west oxide
#

thanks man

quiet ice
#

otherwise just clone the entire repo and checkout the appropriate tag (so git checkout version/1.9.4 for you)

west oxide
#

i appreciate your help thanks man

small glen
#

Hey, i can't build with maven because i added a dependencie from jar file and when i build with maven i have the error package does not exist

tardy delta
#

never add jar files directly

small glen
#

the dependence i have isn't on maven

tardy delta
#

is it on github?

chrome beacon
#

Which dependency is it?

quiet ice
#

then use my wonderful file:// repo hack

tardy delta
#

otherwise you could use jitpack

small glen
#

Vault 1.7.3 and Vault API 1.7

small glen
chrome beacon
#

Vault has maven

small glen
#

doesn't worked

chrome beacon
#

system dependencies are deprecated Use install file to add it to maven local

chrome beacon
tardy delta
#

dunno if directly pulling from gh with jitpack is any better

#

thats what i do to get my own fork as a dependency

small glen
#

okay, previously Vault didn't worked but now Vault is working

#

but i have same problem for Bukkit

#

i need Bukkit 1.9.4

small glen
tardy delta
#

¯_(ツ)_/¯

small glen
#

import net.minecraft.server.v1_9_R2.PacketPlayOutScoreboardTeam; isn't working

chrome beacon
#

You don't need packets for teams

quiet ice
#

well it's 1.9...

#

Just remove support for 1.9 - it's not worth the trouble

small glen
#

for my scoreboard

#

it work like that

tardy delta
#

why are you on 1.9 anyways

chrome beacon
#

It doesn't have to use packets

#

Use the API

small glen
#

i already have all my class but when i import the JAr it's working

#

maven, not

chrome beacon
#

You need to run BuildTools and build 1.9.2

#

Then change the artifactId from spigot-api to spigot

#

?bt

undone axleBOT
small glen
#

what do i do with build tools ?

#

i used the build tools i have the folders on my pc

small glen
wise mesa
#

Can I ask why you’re making this for Minecraft 1.9.2

small glen
#

because my plugin is for 1.9

wise mesa
#

Why do you want to make a plug-in for 1.9

small glen
#

because i prefer

young knoll
#

That is a a new one

wise mesa
#

Very interesting

#

Oh well

chrome beacon
remote swallow
#

what does 1.9 do that 1.19 doesnt

wise mesa
#

Or whatever version

#

And then you can add spigot to your maven

#

Or 1.9.3 or whatever version it is

small glen
#

yes

wet breach
west oxide
#

hey so i ended up using buildtools to get spigot src

which folders will i need to rebuild the spigot jar ?

small glen
wise mesa
#

It’s installed now

#

Into your local maven repo

#

All you have to do is add it to your Pom

#

Build tools automatically runs install

charred blaze
#

whats wrong with this

wet breach
#

everything

charred blaze
#
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find net.md-5:bungeecord-chat:1.12-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/net/md-5/bungeecord-chat/1.12-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-SNAPSHOT.pom
       - https://hub.spigotmc.org/nexus/content/repositories/snapshots/net/md-5/bungeecord-chat/1.12-SNAPSHOT/maven-metadata.xml
       - https://hub.spigotmc.org/nexus/content/repositories/snapshots/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-SNAPSHOT.pom
       - https://jitpack.io/net/md-5/bungeecord-chat/1.12-SNAPSHOT/maven-metadata.xml
       - https://jitpack.io/net/md-5/bungeecord-chat/1.12-SNAPSHOT/bungeecord-chat-1.12-SNAPSHOT.pom
     Required by:
         project : > org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT:20180712.012057-156

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

charred blaze
wet breach
#

idk. will have to wait for someone who knows gradle

charred blaze
#

:(

small glen
weak meteor
#

@wet breach add the Bungeecord repo

small glen
#

how i add spigot to mven after build tools

weak meteor
#

?maven

undone axleBOT
weak meteor
#

There

wet breach
weak meteor
#

Both of u

buoyant viper
#

probably a misping

#

somehow

weak meteor
#

i ping normally for that

#

?gradle

#

damn

#

Lemme search for it

small glen
#

i used buildtools

weak meteor
#

damn

#

i never used tuat

#

Search on forums, if you havent

wise mesa
#

Just do spigot instead of spigot api

#

For the artifact id

silent tendon
#

How do I make my plugins from version 1.16 to 1.19.4 compatible? Because of the API in the plugin .yml . And how do I do that, that plugin also works for other software?

young knoll
#

api version 1.16

#

And depend on the 1.16 API when coding

silent tendon
#

And how can I use that on a 1.19 server?

young knoll
#

Use what

silent tendon
#

I don't understand 😅

small glen
young knoll
#

You just develop the plugin for 1.16

#

And it will work on 1.17/18/19

agile anvil
#

Make your plugin with the latest api version (spigot 1.19), and in plugin.yml just add "api-version: 1.16"

young knoll
#

lol what

#

Don't do that

remote swallow
#

no, depend on 1.16

silent tendon
#

So now I just write my plugin for 1.16 and add to the api version: 1.16 or what? And that goes without any problems on 1.17, 1.18, 1.19 etc.

young knoll
#

yes

#

Spigot is very backwards compatible

small glen
silent tendon
#

I'll test it

small glen
#

i imported Spigot but can't use import net.minecraft.server.v1_9_R2.PacketPlayOutPlayerInfo;

west oxide
river oracle
#

why legacy support?

wise mesa
wise mesa
wise mesa
raven siren
#

Can you tell me how to remove this spam from my console?

[23:25:47 INFO]: com.mojang.authlib.GameProfile@3aa883b5[id=<null>,name=1qY4msssRYG,properties={},legacy=false] (/193.35.18.113:51924) lost connection: Disconnected
echo basalt
undone axleBOT
small glen
#

why my maven plugin isn't detected by the Server ?

silent tendon
#

did you build it right?

small glen
#

i think

tardy delta
#

where did you place it?

small glen
#

plugins folder..............

tardy delta
#

reloaded server?

small glen
#

stop and restarted

tardy delta
#

errors?

small glen
#

nothing in the rcon

full stump
#

hey bro you can help me @tardy delta

tardy delta
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

full stump
#

is here

tardy delta
#

lets not ping people

silent tendon
tardy delta
#

why would you install instead of package

silent tendon
#

The plugin is then built on top of this and can be used. This is the simplest option

remote swallow
#

install also adds it to your maven local

#

no reason to do that

silent tendon
#

I find it the easiest this way

remote swallow
#

you find pointless steps the easiest way?

wet breach
silent tendon
remote swallow
#

yeah, package

silent tendon
#

What exactly does that do?

remote swallow
#

compiles the plugin

tardy delta
small glen
#

java.lang.NoClassDefFoundError: net/minecraft/server/v1_9_R2/IScoreboardCriteria$EnumScoreboardHealthDisplay

i have this error someone know why

chrome beacon
full stump
#

frostalf you are here

#

lol

wet breach
#

indeed

silent tendon
#

What is the easiest way for me to query in the join file whether the value in the configuration for the join message is true or false? If true, a message should come and if false, none.

wet breach
#

o.O

#

it literally should be like 1 method to grab it

#

not sure how that could be anymore simpler

young knoll
#

if (config.getBoolean(whatever))

silent tendon
#

so?

if (config.getBoolean("joinNotification") === true) {

        } 
remote swallow
#

?learnjava

undone axleBOT
buoyant viper
#

=== DogJA

#

this isnt javascript, get outta town!

chrome beacon
#

also === true 💀

young knoll
#

You don’t need a comparison for booleans

#

Just if (Boolean)

silent tendon
#

I'm new to Java and have used PHP before

golden turret
crude estuary
#

Java 20?? i mean

#

why do you Hate Yourself

#

xD

sullen marlin
#

?whereami

crude estuary
#

i don't get it

golden turret
crude estuary
#

ik but i asked why did they use Java 20 in the First Place

#

oh, it was for You

#

the Classes are Paper ones

#

and you Posted it on Spigot

#

that's why md_5 Responded

#

The Meme Man fr

#

it was Hard for me to get it xD

fallow latch
#

i still need some help with NMS, after running buildtools with java -jar BuildTools.jar --rev 1.19.4 --remapped, i still cant use net.minecraft.server.v1_19_R3, though other packages withing net.minecraft.server can be used. the maven repository at C:\Users\<me>\.m2\repository\net\ has no minecraft folder in it, is that maybe the problem?

chrome beacon
#

Show your pom

#

?paste

undone axleBOT
fallow latch
#

i could not find a detailed tutorial on the setup of nms anywhere, so if anyone can give me a link to like a yt video that would also be great

young knoll
#

Isnt the version removed from NMS packages

chrome beacon
fallow latch
#

ok thank you i will take a look

chrome beacon
#

Remapped uses Mojang package names now

#

So it won't have the version number in it

fallow latch
#

ohhh

#

i see

#

thanks that was whats confusing me yesterday

#

so do i just use the same thing but in net.minecraft.server directly?

chrome beacon
#

Let the IDE handle imports

small glen
#

How we cancel when a player try to move item on his inventory by pressin num key with another slot, inventory click event does'nt prevent that

chrome beacon
#

It does

small glen
#

i tried

#

few seconds ago

sick edge
#

Hi, I've been working with nms a bit and I don't quiet understand the Item class. Where is the actual type/material of the item stored as item implements imaterial itself 🤔

chrome beacon
undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

chrome beacon
sick edge
chrome beacon
#

if I recall correctly

sick edge
#

ah I see so how would I create an nms ItemStack for example for an oak plank (without using asnmscopy or something like that)

small glen
# chrome beacon ?nocode
@EventHandler
  public void onClickInv(InventoryClickEvent e) {
    Player player = (Player)e.getWhoClicked();

    e.setCancelled(true);
}```
chrome beacon
#

Try recreating on 1.19.4

chrome beacon
sick edge
#

Ah i see they're all collected in the Items class thx

young knoll
#

Mojang splits what spigot calls material into items and blocks

#

The Mojang version of material is only used to dictate the properties of things, like the breaking sound and such

#

It’s also gone in 1.20

sick edge
#

Ah I see...I'm trying to get the bundle tooltip on to another item type and I thought it might be possible through the item class but I doubt it will work do you have any ideas if it's even possible I originally thought it was just a special tooltip that could be added to any itemstack but mojangs implementation seems more complex and tied to the BundleItem class

chrome beacon
#

Are you making a mod?

sick edge
#

no plugin

chrome beacon
#

Then you can't add that bundle tooltip

sick edge
#

ah man but how is it implemented?

young knoll
#

Probably client side

chrome beacon
#

^^

young knoll
#

You could

chrome beacon
#

The server doesn't care about how it is rendered

sick edge
young knoll
#

Use pdc to give bundles a different texture

#

Not pdc

#

Custom model data

sick edge
young knoll
#

Yes

sick edge
#

yeah good Idea I might do it 🙂

worldly ingot
#

The bundle tooltip is 100% client-sided, yeah. Hardcoded onto the bundle specifically

#

I do wish they'd add that same tooltip to shulker boxes though. Missed opportunity tbh

young knoll
#

Agreed

young knoll
#

There are client mods for it though

worldly ingot
#

Vanilla, man. It can totally be vanilla

young knoll
#

D: indeed

hollow birch
#

does anyone know how the new system works for changing an items name i know its with like item.displayname.append or something like that but i dont really know how components work and i couldnt find anything about it online

worldly ingot
#

Functionality's already there! They've got separate tooltip renderers

young knoll
#

Just gotta get Mojang to hire me

sick edge
#

😂

young knoll
#

We don’t have a new system for item names

#

Well not quite yet anyway

sullen marlin
#

right?

young knoll
#

Uhh

#

Yes

#

Adds herobrine

hollow birch
young knoll
#

It’s not deprecated in spigot

hollow birch
#

it is in paper

young knoll
#

📄

sullen marlin
#

?whereami

hollow birch
#

damn

#

i got where am id

young knoll
#

MD loves that command

silent tendon
#

What can it be? I have Java 17 on the server and the plugin is also Java 17

worldly ingot
#

It is a great command

hollow birch
#

its pretty nic

#

nice

worldly ingot
#

It's a casting issue

#

String definitely != long

young knoll
#

Strings can be long

#

But they cannot be a long

hollow birch
late sonnet
tall saffron
#

?paste

undone axleBOT
tall saffron
#

How can i make this work in different pages? : https://paste.md-5.net/xopiwufoxa.cs, i have it setted up for 36 slots, and i want to set it up heads till the 27 slot then on a next page, also i dont know how can i test this out, as it is for online players

tall saffron
#

?paste

undone axleBOT
sullen marlin
#

pages = players % slots per page;

tall saffron
tall saffron
#
                        playersCounted++;
                        String aboutMe = plugin.getConfig().getString("players." + onlinePlayer.getUniqueId()+".aboutme");
                        if(playersCounted <= 27){
                            if (aboutMe != null && !aboutMe.isEmpty()) {
                                ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
                                SkullMeta skullMeta = (SkullMeta) skull.getItemMeta();
                                skullMeta.setOwningPlayer(onlinePlayer);
                                skullMeta.setDisplayName(onlinePlayer.getName());
                                ArrayList<String> lore = new ArrayList<>();
                                lore.add(ChatColor.GREEN+"Click to read my about me!");
                                skullMeta.setLore(lore);
                                skull.setItemMeta(skullMeta);
                                inventory.addItem(skull);
                            }
                        }
                        else if (playersCounted > 27){
                            playersCounted = 0;
                            page++;
                        }
                    }```
#

i did this

#

but i dont know how to create a new inventory per pagwe

#

and dont know how to test it like with fake players idk

young knoll
#

You could use the same inventory

#

And just change contents

tall saffron
tall saffron
young knoll
#

Have an int

#

Set that int to the current page x items per page

#

And then start at that index when adding items

tall saffron
#

i have it already ```//Else

                int maxPlayersPerPage = 27;

                int playersInPage = 0;


                for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
                    playersInPage++;
                    String aboutMe = plugin.getConfig().getString("players." + onlinePlayer.getUniqueId()+".aboutme");
                    if(playersInPage <= maxPlayersPerPage){
                        if (aboutMe != null && !aboutMe.isEmpty()) {
                            ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
                            SkullMeta skullMeta = (SkullMeta) skull.getItemMeta();
                            skullMeta.setOwningPlayer(onlinePlayer);
                            skullMeta.setDisplayName(onlinePlayer.getName());
                            ArrayList<String> lore = new ArrayList<>();
                            lore.add(ChatColor.GREEN+"Click to read my about me!");
                            skullMeta.setLore(lore);
                            skull.setItemMeta(skullMeta);
                            inventory.addItem(skull);
                        }
                    }
                }

                player.openInventory(inventory);
#

but i dont know how to make it like the next 27

#

make a int index?

#

and if index is 2 what ?

young knoll
#

Then start at 2 x 27

#

I use a list of items for mine for easy index based access

#

Array works too

young knoll
#

list.get(index)

tall saffron
#

Damn i dont know bout lists

#

?learnjava

#

?learnjava

undone axleBOT
young knoll
#

Lists are great

tall saffron
young knoll
#

They are basically arrays that automatically handle resizing

#

A list can’t be infinite

tall saffron
#

well but it will work for online players

young knoll
#

Sure

#

Online players is finite

tall saffron
#

Oh yeah i guess 😬

#

my bad

#

How can i make lists, or do you have a doc link?

young knoll
#

Follow the java tutorials

#

You’ll encounter them soon enough

tall saffron
#

K thanks

weak meteor
#

Can someone explain me whats the difference between all of this, i dont understand the javadocs

worldly ingot
#

asynchronously means off of the main thread (database, file read/write, and other IO should be done async so it doesn't pause the main thread)

#

later and timer should be pretty self explanatory

young knoll
#

Do note most of the Bukkit api is not thread safe

weak meteor
#

i assume timer is like

#

10h 30m 23s -> 10h 30m 22s?

#

and that way

remote swallow
#

timer is a repeating task, later is running a task later, async stuff runs on another thread

#

mostly used for io

weak meteor
#

k

tall saffron
torn oyster
#

should i store player statistics/data in a mysql server or a redis server

young knoll
#

Replace it with something you do have a lot of

#

All materials with isItem = true is a good test

buoyant viper
small glen
#

How can i get from Maven the real bungeecord like the spigot webtools

hazy parrot
torn oyster
#

yes

hazy parrot
#

How would saving statistics there make sense then

torn oyster
#

idk

hazy parrot
#

It would not be persistent

young knoll
#

Just never stop the server

hazy parrot
#

Yeah or that ^

tall saffron
#

I dont know what i did wrong

#

but iclick next page

#

then nothing happens

#

and if i close and open again it looks like the next pag

#

but then i go back and do the same and still like is like there isnt a player anymore its wierd

#

I know for it to update automatticly i have to reopen the inventory the wierd thing is that i dissapear when clicking next

small glen
#

How can i add the real bungeecord on Maven like we add spigot with buildtools

tall saffron
echo basalt
#

bungeecord has no weird nms logic

#

it is not a fork or anything, purely standalone

weak meteor
#

Someone can see this?

#

Im trying to do a decreasing timer

#

and well

#

i think its wrong?

vital sandal
#

Long is a wrapper class

#

it create new object everytime it is calculate

#

use long

buoyant viper
#

is that class extended by anything?

weak meteor
#

to

#

oh damn

#

i just

#

thinked about it

#

this shouldnt be abstract

vital sandal
#

and also you can create the runnable first

weak meteor
#

ill do it again

vital sandal
#

and then use

start(){
  runnable.runTaskTimer(HCF.getInstance(), 20,   
getDuration());
}
#

and there is like no setter for timer values?

weak meteor
#

i actually dont know what a setter is

#

neither a getter

vital sandal
#

hmm

weak meteor
#

is the only thing i actually dont know

#

This what i got

vital sandal
#

yeh that would do

weak meteor
#

and well the runnable

buoyant viper
#

and make it long (lowercase l), Pls anguish

weak meteor
#

why?

#

isnt the same?

vital sandal
weak meteor
#

oh

#

ok

vital sandal
#

if you do the loop like 100 time there will be objects be created

worldly ingot
#

If you can use a primitive over a wrapper, do it. long > Long. int > Integer. boolean > Boolean, etc.

#

It's not about object creation, it's about wrapping and unwrapping values

#

In a loop specifically, the compiler would probably optimize the unboxing outside the loop anyways (where possible)

buoyant viper
#

creating objects is the JVMs greatest purpose yaknow

weak meteor
#

now here should i start to make remaining - 20?

worldly ingot
#

& they're stack variables when in a method anyways. Not like you're heap allocating

vital sandal
vital sandal
weak meteor
#

This L stuff

#

what means

vital sandal
#

Long

worldly ingot
#

Value suffixes. You can use L for long, D for double, F for float

candid kindle
#
  • im making an rpg system and have an abstract class, Pool, which is extended into other stuff like Health and Energy
  • im using gson to save all this as json, and i need to write a TypeAdapter for Pool
  • i cant return Pool from the read method because Pool is abstract

is there a way around this, or am i going to have to make TypeAdapters for each specific pool instead?

echo basalt
#

uhh

#

great question

#

maybe save the pool type along the data itself?

#

and then get the type adapter

candid kindle
#

good idea

#

im basically new to programming, not really sure how id do that

echo basalt
#

So you're trying to make an RPG whilst you're new to programming?

#

that doesn't sound like the best idea

candid kindle
#

do you know how i might do this

echo basalt
#

You can just append an object to the gson itself

wise mesa
#

how can I tell if an item has a custom name that was made in an anvil

#

just check if its italics?

echo basalt
tranquil prairie
#

Is Location block = e.getTo().clone().subtract(0, 1, 0) the exact same as Block block = to.getBlock().getRelative(BlockFace.DOWN)

wise mesa
#

ah

#

no but what if I set the name in a plugin

worldly ingot
tranquil prairie
#

And the second code is faster right?

worldly ingot
#

You can't distinguish how an item got its name

#

It either has a name or it doesn't

wise mesa
#

i want to differentiate between having set the name in a plugin and having set it in an anvil

tranquil prairie
#

cuz cloning uses more resources

wise mesa
#

hmmm

#

ill have to add some persistent data

echo basalt
#

also one returns a block and the other returns a location so

tranquil prairie
#

yeah ik but yk what i mean ill get the location of the block

echo basalt
#

Alright so first thing

tranquil prairie
#

but i remember seeing somewhere that cloning is slow

echo basalt
#

Block#getLocation always returns a copy

#

So if we look at the impl

tranquil prairie
echo basalt
#

pretty much

tranquil prairie
#

damn

echo basalt
#

it's irrelevant to micro-optimize at this level honestly

#

unless you're me

tranquil prairie
#

I cant think of any other ways to optimize

echo basalt
#

I wouldn't call getBlock that many times

#

re-use values and all

#

Honestly I'd rather focus on code quality rather than micro optimization

tranquil prairie
#

thats true didnt notice that

echo basalt
#

Like you can do a few things to improve here

tranquil prairie
echo basalt
#

for one you shouldn't use single letter variables (e)

#

n

#

etc

tranquil prairie
#

alright any performance onces though?

echo basalt
#

other than repeating getBlock 15 times

#

don't see anything

tranquil prairie
#

lmao yeah im pretty tired and didnt notice that

echo basalt
#

setData and setType, hmm

#

there might be a way to set both at the same time

#

which lets you like

#

not modify the block twice

wise mesa
#

so I want to loop through all players on the server over the course of a couple ticks

#

but I've realized a slight issue with this idea

echo basalt
#

wait setData is not a thing

wise mesa
#

so I started like this

echo basalt
#

are you on 1.8 🤨

wise mesa
#

but since its a collection I can't safely cast it to a list

echo basalt
#

why would you want to cast it

wise mesa
#

and stream().toList() doesn't guarantee the same order every time

vital sandal
#

:l wait var?

#

what is it?

wise mesa
#

because I want to """loop""" through that list over a couple ticks

echo basalt
#

welcome to java 12

wise mesa
#

one player every tick

echo basalt
wise mesa
#

or every run of the runnable at least

echo basalt
#

imagine half your players are afk

wise mesa
#

the alternative is doing every single player each tick

#

they all have to be checked eventually

echo basalt
#

One thing is like

#

you need to check if the player's block changes

#

because PlayerMoveEvent like

wise mesa
#

im checking if they have old versions of items in their inventories that need to be updated

echo basalt
#

triggers whenever your position changes

#

as in

wise mesa
#

because attributes or something changed

echo basalt
#

if you look around

tranquil prairie
echo basalt
#

wait you guys are two completely different people

#

wtf is my brain on

tranquil prairie
#

lmao

echo basalt
wise mesa
#

proper data

echo basalt
#

hm

wise mesa
#

i already have a method that can update old versions of items

echo basalt
#

What's stopping you from like

#

limiting your checks to a few things

wise mesa
#

and a method that can scan a player's inventory for old versions of items that need to be updated

#

i just want to really make sure I don't miss any events or anything

#

so nothing slips past

echo basalt
#
  • Tile entities (ChunkLoadEvent), so any container, item frames etc
  • Dropped item entities
  • PlayerJoinEvent player inventory and enderchest
  • Any drop item event
#

should be it

wise mesa
#

its gonna run like every 8 ticks

#

but okay

echo basalt
#

scheduler seems wasteful imo

worldly ingot
#

What about an Iterator?

#

And if you never want it to end, you can use Iterators.cycle()

regal scaffold
#

Any events work for Cyrstals growing?

#

Amethyst shards?

kind hatch
#

BlockGrowEvent?

regal scaffold
#

Doesn't apply

#

Any other suggestions?

quaint mantle
#

BlockSpreadEvent

regal scaffold
#

No

#

That's only when it goes from same block to one next to it

#

Not when it grows

buoyant viper
#

theres like a BlockChangeEvent isnt there

#

?jd-s

undone axleBOT
river oracle
#

What is a good way to provide my API to the end application here...
I have a setup like this
api
core
modules
submodule1
submodule2

essentially core is the intermediary between all the submodules and I don't want to expose dirty implementation to the api section because I need access to one class in the core module. I should note this is all bundled as one jar I'm just only exposing the API module when depending.

I setup an interface in my api that is implemented in core in order to implement all the API, but I'm not really sure what to do from here

regal scaffold
#

BlockFromToEvent doesn't apply either

buoyant viper
#

hmm

quaint mantle
#

Services and Providers?

worn tundra
ivory sleet
#

Unless you may use jpms

#

But like, a singleton for ur api is always fine

#

(To the public api consumers)

regal scaffold
worn tundra
regal scaffold
#

Holy shit

#

Thank you so much

rotund ravine
#

Careful that event fires a lot

worn tundra
#

^

quaint mantle
worn tundra
#

Plugins can listen to events using listeners

#

Event firing, means that all listeners that listen to specific events (like block break for ex.), receive that event and can modify its outcome

#

BlockPhysicsEvent specifically is called a lot, because it's responsible for things like block updates, sand falling etc

ocean hollow
#

there is no something to findFirstNotFull() method?

hazy parrot
hazy parrot
ocean hollow
#

how to use it in inventory?

tardy delta
#

how to use what

ocean hollow
#

like first(material), but if amount not 64

tardy delta
#

id do a manual loop cuz those inventory methods are weird

west oxide
#

hello, i am working on a custom spigot and need to modify the kb, this is where i can do it right ?

public abstract class EntityLiving extends Entity {
...
public void a(Entity entity, float f, double d0, double d1) {
        if (this.random.nextDouble() >= this.getAttributeInstance(GenericAttributes.c).getValue()) {
            this.ai = true;
            float f1 = MathHelper.sqrt(d0 * d0 + d1 * d1);
            float f2 = 0.4F;

            this.motX /= 2.0D;
            this.motY /= 2.0D;
            this.motZ /= 2.0D;
            this.motX -= d0 / (double) f1 * (double) f2;
            this.motY += (double) f2;
            this.motZ -= d1 / (double) f1 * (double) f2;
            if (this.motY > 0.4000000059604645D) {
                this.motY = 0.4000000059604645D;
            }

        }
    }
...
}
west oxide
west oxide
silk mirage
#

You can always check this!

west oxide
#

ow man i struggled to understand that stuff this would have been very useful lol

#

thanks alot

silk mirage
#

NMS is just about finding the right thing

west oxide
#

how do you know which _a function is it though ?

silk mirage
west oxide
#

how did you know it was func_70653

#

as in how did you find the function i shared

silk mirage
#

Then search for your method

#

public void a(Entity entity, float f, double d0, double d1) {

west oxide
#

ohhhhh

silk mirage
#

so that would be a(Entity arg0, float arg1, double arg2, double arg3)