#help-development
1 messages · Page 769 of 1
but thanks either way
https://paste.md-5.net/ovafasudad.java Would this be more efficient than the bukkit scheduler? It relies on time waiting instead of tick waiting
how can I add more than sharpness 5 to a sword for instance?
idk how to say it
illegal enchantments?
ItemMeta#addUnsafeEnchantments
Hey is anyone able to help me setup votifier plugin in https://discord.com/channels/690411863766466590/741875845089722499? Sorry don’t want o sound needy or anything just having quite a bit of trouble 😅
no pls
nah 1.8 😭
?
your spigot version?
how to check it
where
Im currently trying to make a portable brewing stand, and it seems like if i just open an inventory of type brewing for the player that wont allow the player to brew in there. Does the brewing stand have to have a block connected to it?
Hmm so i have to put a brewing stand somewhere in the world, and the portable one accesses that block brewing stand?
okay you ready to use some NMS 
its going to be difficult!
especially if you want it to work 😈
I haven't even gottent his far with Tile Entities because well they aren't supposed to work without a world
goal 1. opening the menu its easy enough. Create TileEntityBrewing with NMS and create its container,
goal 2 is going to be a bit tricky. You're going to want ticking your TileEntityBrewing you made. However, you've got to be very careful to not let it keep ticking forever this could cause a build up of tasks and eventually possible memory leaks
I'd reccomend Ticking it within a BukkitTask that runs on the main thread
keep site of the BukkitTask so it can be canceled once the TileEntity falls out of scope. It might be tricky to figure out exactly when it does though
ticking it is less than straight forward however, as all block tick mechanics are not within the TileEntity rather within the Block class
you essentially need to trick the server into thinking your virtual TileEntity is a real block at a real location, much easier said than done
Okay thats more theory than practice, has anybody actually done that before and can show an example?
Highly doubt it this is not a trivial thing you can just do
I could dig up code to help but theory is pretty much as far you'll go by most people
Where would i put that "fake" brewing stand so that it doesnt mess with players or other events in the server
let me look at BlockBrewingStand
how can I give bold name to an item
like a color is with ChatColor
how about bold underline etc.
ChatColor.BOLD and ChatColor.UNDERLINE exist
@pine forge your best bet is to see what you can do with this constructor
public BlockBrewingStand(BlockBase.Info blockbase_info) { it'll be called different with moj maps prob like BrewingStand block or something, but you need to create this object and make a new ticker()
@Override
public TileEntity newBlockEntity(BlockPosition blockposition, IBlockData iblockdata) {
return new TileEntityBrewingStand(blockposition, iblockdata);
}``` this method can help create a TileEntity if you don't have one
```java
@Nullable
@Override
public <T extends TileEntity> BlockEntityTicker<T> getTicker(World world, IBlockData iblockdata, TileEntityTypes<T> tileentitytypes) {
return world.isClientSide ? null : createTickerHelper(tileentitytypes, TileEntityTypes.BREWING_STAND, TileEntityBrewingStand::serverTick);
}
``` this mehtod will create the ticker
note that you'll need to manually call the Tick method
Okay but if we're faking a block here, what happens if someone places a block in the same location or walks into it or something
okay more information
@Nullable
protected static <E extends TileEntity, A extends TileEntity> BlockEntityTicker<A> createTickerHelper(TileEntityTypes<A> tileentitytypes, TileEntityTypes<E> tileentitytypes1, BlockEntityTicker<? super E> blockentityticker) {
return tileentitytypes1 == tileentitytypes ? blockentityticker : null;
}
}``` this method might be better it'll allow you to replicate the innards of getTicker without having it create a new TileEntity bound to the location
That’s a lot of generics
ChatColor.BOLD.toString() + ChatColor....
god really
Yeah you gotta toString one
Generics are great
Java is fine with adding objects to a string
But adding object and object is no beuno
still doesnt really answer my question 😅
im not really sure what that means if were using this brewing stand construcctor, does it place a block somewhere or what does it register?
uhm well you've kinda gotta fake the block. Essentially sorry I'm rambling here since in practice this really shouldn't even be possible I'm schemeing heavily
DFU 
what does "faking" a block mean, what happens if someone places a block in the same location
is the block in the world, does it appear to playesr?
@Nullable
protected static <E extends TileEntity, A extends TileEntity> BlockEntityTicker<A> createTickerHelper(TileEntityTypes<A> tileentitytypes, TileEntityTypes<E> tileentitytypes1, BlockEntityTicker<? super E> blockentityticker) {
return tileentitytypes1 == tileentitytypes ? blockentityticker : null;
}``` this method is a protected static method you need to use reflection to get it and use it. This will help you create something that will beable to tick
?pdc
I mean the easy solution without nms, would be to just put a brewing stand somewhere far off, store the coordinates, and then access it whenever someone rightclicks the portable
Obvious issues with this approach but it would be quite a lot easier to implement than the nms one
not ideal the chunk would be loading and unloading way to much
you'd have to leave it loaded and hope no one ever found it
is it okay to have 2 classes in same java file?
@pine forge my bad again. I way overcomplicated this its way easier sorry I'm like digging through NMS its fucked
TileEntityBrewing stand has a public static method called
public static void serverTick(World world, BlockPosition blockposition, IBlockData iblockdata, TileEntityBrewingStand tileentitybrewingstand) {
you can call this method to tick the brewing stand it shouldn't have any adverse affects afaik if you input arbitrary position and world, though you'll need to keep the block data consistent or it'll fuck over your brewing progress.
note that calling this method only ticks the brewing stand once though
so you'll need a scheduler
i cant just put a world that doesnt exist though can i?
let me check
honestly @pine forge you might be best off manually implementing this tick method this is so heavily bound to the world it'd be impossible to use
https://mappings.cephx.dev check out TileEntityBrewingStand and the static method serverTick (both spigot maps)
this whole thing sounds like it requires me to dig throuhg nms for the next couple of days
if you're using moj maps you can just decompile the class and check the method yourself
time that i dont really have
unfortunately there is no other way to do this that guarentees your code will work
honestly I believe im better off either just ditching the idea or doing that even though its a stupid implementation
I would stay away from that implementation
yea i get taht
Ill take a look at the nms functions you sent me and the classes
you might beable to pull this off very nicely actually if you take a look at that static method
RIP out absolutely anything you don't need
you might beable to even achieve a lazy implementation that doesn't tick while the menu is closed 😈
i would want it to be brewing though while the menu is closed
see the thing about lazy implementations is you calculate the time spent on open
ah
that way you don't need to run a background task constantly
that sound scool
their is no UI to display, so there is no need to update
does minecraft do that?
no
just like fast forward once someone looks in the menu
thats an idea for a performance mod
Are you planning on releasing this plugin?
no its for a private smp
Alright
you can't not tick because otherwise the sounds would not play
@rotund ravine interested in an implementation?
Nope
ah i see
well it can not tick specific blocks
if the block is not in render distance it won't tick atleast afaik it shouldn't
his
prey sure that's how MC handles
cant they distinguish between a player opening an inv and a plugin opening an inventory for player?
because theres probably gonna be an anticheat on the server
Well, maybe if ur lucky
Okay well tysm for all the help, i gtg now
might come back later
ill consider the nms solution, but im really not sure if i have the time to figure that thing out
maybe ill just ditch the idea completely
gn
that's such an easy check though?
Leigt just Container#checkReachable if its true and they're to far away boom hax if its false and they're too far away boom not hax
Yeah I don’t think it’s quite that simple
well if you're openeing a container and checkReachable is true and you're far away it won't open
that is an undisputed fact
that is unless the client spoofs a movement hack too
Would opening an anvil inventory return the owner as null? or would it be whoever placed it?
it shoudl be null
alr thanks.
If minecraft was so simple we wouldn’t have a hacking issue
Is the player allowed to fly? No? Well then why are they flying!
factzs
#1 anti cheat developer here
I legit did that very early on in my plugin making days
Was very sad when it didn’t work
if (player.isFlying() && !player.hasPermission("fly")) {
player.kickPlayer("hahahahaha!!!!");
}
best new fly detection
Okay but that was actually it
what can cause mongo server not start after activiting auth? Its simple not start the process
Does anyone know the optimal way of implementing custom model data for tools and armor? I have the required blockbench files, I'm interested in the best way of hooking code into them to make them accessible in-game
Look at logs
Is it a full multi armorstand model or just a reskin of an item
no log content, doesn appea rany error
Full models really
can you help me please?
You have to manually parse the blockbench file and create an armorstand per thingo
Just use a library makes life easier
Linux or windows
Linux
Would it be possible to create a custom resource pack instead?
What are these models
A resource pack is needed either way
Items? Blocks? Mobs?
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player player)) return false;
ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
ItemMeta swordMeta = sword.getItemMeta();
if (swordMeta == null) return false;
NamespacedKey key = new NamespacedKey(plugin, "customdamage");
swordMeta.getPersistentDataContainer().set(key, PersistentDataType.STRING, "ksiezyc");
swordMeta.setDisplayName(ChatColor.GOLD + "Chinskie Ostrze Ksiezycowego Swiata");
ArrayList<String> list = new ArrayList<String>();
list.add(ChatColor.GRAY + "Damage: " + ChatColor.RED + "30");
list.add(ChatColor.GRAY + "Silny przeciwko potworom: " + ChatColor.RED + "70%");
list.add("");
list.add(ChatColor.GOLD.toString() + ChatColor.BOLD + "LEGENDARNY MIECZ");
swordMeta.setLore(list);
sword.setItemMeta(swordMeta);
player.getInventory().addItem(sword);
return true;
}
The sword that's spawned with this command doesnt seem to have PDC at all, what could be wrong?
If your question is directed at me, I have custom blockbench files for tools (pickaxes, axes, swords) and a couple of armor items
Well for tools all you need is custom model data
Should be easy to find a tutorial on setting that up
For custom armor models you’re gonna need a bit more
Are you referring to the files themselves or the code, because from what I've gathered, there's really only #setCustomModelData
Apart from that, I'm not sure how to hook into it
There will be a log somewhere I dont see why it just wouldnt start
That’s all you need code wise
I see, and in order to make the textures and models physically present in-game, I'd have to force the resource pack onto the client?
i find it but doesnt show any error
How are you verifying that it doesnt have pdc
Yes
Alright, I think I have enough to go on, thank you @drowsy helm and @young knoll for your time
if (!container.has(key, PersistentDataType.STRING)) return;
Setting custom model data code wise is pretty easy though
does it matter that im doing the check in different plugin?
if the plugin instance is different yes
you would need to use NamespacedKey.fromString
Press F3+H ingame and see if it has any nbt tags
/data get entity @s SelectedItem
Smh we use @s here
Get with the times
?paste
i dont want it cmarco
i cant find any error bro, this are latest lines of document
it looks like that
the plugin instance is different so the namespaced key is different
use NamespacedKey.fromString("otherpluginname:customdamage")
Mongo error
How are you setting auth creds
Is it a docker container
its simple mongo no container
Are you editing mongod.conf?
I did it via admin db
mongosh
use admin
db.createUser(
{
user: "myServerAdmin",
pwd: "mipassword",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
}
);
like that @drowsy helm
You have to enable authentication in the config still
Lower case
And how are you verifying that it’s not startingb
yes i did that too
and im using systemctl start mongod
what??
Status 14
thanks man will test it
i dont have any error
thats the problem
the log file doiesnt have any clear error
Okay so they do print the actual exit code
how?
But they also just print exit-code
how?
it just dont show any error im not trollimg lmao, just wanna fix my issue...
thats actual mongod.conf
I encountered one problem, if I wanted to make a lootbox plugin that would give players items with PDC tags, but also made plugin that would make enemies drop same items with PDC tags, is there any way to universalize apart from dumping it into same plugin?
the only thing I can think of is checking around all custom plugins if they created certain PDC tag
Just use the same tag in both plugins?
yeah but when I do NamespacedKey key = new NamespacedKey(this, "customdamage"); then how am I supposed to do them same if they are set in two different plugins?
dont make it like that
because that will prepend plugin name as namespace key
whats the alternative?
what? i dont have any mongo error really bro im not trolling. Just doesnt start
either pass your other plugin instance or NamespacedKey.fromString
how do I pass it if they are two separate plugins
Get an instance of the other plugin
Via Bukkit.getPlugin or have the other plugin expose it via some api
^
Actually i think it’s PluginManager#getPlugin but yeah
I... think ill use NamespacedKey.fromString
Tis what I do
you can also just pass a normal namespace no like new NamespacedKey("key","path")
Don’t do that
w/o needing the plugin instance
But yeah at the end of the day
yoo bro you know about mongoo? please save me!!
A namespaced key is just 2 strings
yeah I need this kind of thing
myeah, doesnt it just translate the plugin name into a key?
is there a way to make universal folder for configs that plugins could use?
the thing is that I need one command plugin to access it
worst case ill just make two copies and edit them at the same time
I want one plugin to take args from config when giving custom weapon and the other take args from same config when doing custom damage
if u can, maybe avoid direct config interference
like, use some sort of middleman object
Yeah
config interference as in 2 plugins using it at the same time?
well, that one plugin explicitly touches the other plugin's config
Yeah, rather than having plugin B touch plugins As config
Have plugin A offer the values from the config in some way
well I can just make two same configs
I feel like maybe working with database would be easier to set it up
Generally you don’t really want to interact with another plugins database either
The plugin should be providing you an api
Pretty sure you have
I bet my right testicle I havent I already lost my left one to other bet
Spigot/bukkit is an api
I think I need to actually see what api is
Its just a way of programming that allows some outside thing to either interact with it or obtain information without resorting to code or memory injection etc
wouldnt I need web deb knowledge to make plugin api?
No
As long as another plugin builds against a plugin that provides api they can interact and this is possible because plugins dont run in their own process
do you know any guide for that?
So what are you gonna do with @storm crystal’s left testicle?
The server loads plugins into its process space so all plugins can see each other
Think they need it more then i do
why so interested, mad cuz u didnt win it?
Was just curious
There is plenty of open source plugins you can look at
acually is there a plugin that is not open source?
Yes plenty
Doesnt mean you cant interact with them just makes it more difficult because you dont have source freely available and have to resort to other methods
Anyways the project i linked is one of my old plugins that is defunct at the moment but it should still be valuable in how to make api related things.
idrk how to read it
Well it has 2 modules
One is the api jar and the other is the plugin jar. The plugin jar has to implement the api in order for it to work. Dont have to do it this way just makes it easier
Main thing that the plugin provides is it uses custom events
Does anyone know why I can override onCommand of JavaPlugin?
also, when does anyone know, when does it actually fire? (I overrode it, but didn't register it anywhere)
with that little information. im sure most of us don't know
Alright, i'm going to be more specific
its ran by spigot plugin loader
JavaPlugin class has an abstract method onCommand, my question is** why**
No worries
onCommand because if you go down the herarchy, javaplugin implements CommandExecutor at some point
Your JavaPlugin class automatically gets registered as CommandExecutor for every command in your plugin.yml
Alright
anyone have an example of what spigot PersistentData looks like in NBT
Its really just some NBT Compound with a bukkit-something name, which has all plugin pdc data in its hierarchy
I get that much I'll prob look for a string somewhere I reember lynx sent one
I kinda just need a visual representation
Serialize the ItemStack. It will show you the data as sNBT
I was hoping I wouldn't have to go in game :P I'm being so lazy
Get an item with pdc and /data get entity @s SelectedItem
All pdc just goes in a compound called PublicBukkitValues
u can but dont 💀
I just didn't want to load a server :P I suppose I will just wing it for now and see in practice later
I'm doing some very naughty things to learn about item stacks
Item stacks are just fancy compound tags
I mean
Tbf a lot of things are like that in the end
Wut cursed stuff are you up to
going to answer my own question, turns out, if you give your command a command executor, it uses that to execute the command, otherwise it falls back to the JavaPlugins onCommand
@young knoll ignore the pdc stuff I need to rework that still because PDC is still under construction
https://paste.md-5.net/ekawafazal.java but this is an API I made that directly edits the NBT instead of using ItemMeta and copying
Ah
I mean ideallistically bukkit could do this, which I personally think would be preferable though I'm sure there is some valid counter. The issue is with Bukkit you create ItemStacks as an abstract class vs an interface
ofc ItemMeta is still needed in some capacity to expose compounds
is this subject to pr? or just ur own thingy
just my own thing I don't have the brains to do this for bukkit mainly because of how ItemStacks work currently
it would break contract
:,)
well fixing the ItemStack is easier said than done because it is an AbstractClass
Just tested it out. The key for the nbt container is PublicBukkitValues
can you send me the SNBT data if you have it
I'm more interested in that
if not its fine
thank you btw
Gotta redo CraftItemMeta still
the issue with CraftMetaItem is that it works off the fact the ItemStack copies rather than wraps
ItemStack{DIAMOND_AXE x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, PublicBukkitValues={
"spigotsandbox:key_one": "This is a string value",
"spigotsandbox:key_three": 3.1415d,
"spigotsandbox:key_two": 42
}}}
imho we should really be editing directly vs copying a shit ton, I wonder why it works the way it does
oops super reacted but thx
lol i guess I should use them as I have them lol
@young knoll do you know why ItemStacks are the way they are is there a real reason
They copy and wrap
yeah but why the copy part
I mean, there is 100% a point in their implementation
yea it would be faster, but as lynx said I believe there was strong reasoning not to couple it so tightly with nms stacks
Preemptive translation of internals to API types means faster reoccurring access
Tho parsing slows down
Arent items immutable in nms? Something like that.
Switching that to just wrapping nbt means you pay the price pdc pays rn
Reads and writes slow down but the fetching is cheap
Yea Item is the "material"
Beyond that, ehh, copy instead of just keeping the internal instance also means people fuck less things up
I can edit my stack usually fine without fucking the actual state up
hard to fuck things up when you give a set of instructions you can use though
what is there to really fuck up tho?
No like, I get a stack from somewhere and change it's type
ItemStacks suffer with this precise problem already though it doesn't actually solve said problem
For something
ah
Depends on where you get the stack from
so essentially its an attempt at being semi-immutable but its not very good at it
Yea, to be fair, I don't really know the best solution for this down the line
/***
* This method has a decent chance of renaming the item.
*/
Immutability is great
yeah like storing an itemstack given from some other api thingy which is a CraftitemStack under the hood can B a bit goofy
Saves you from a lot
though there is a lot of overhead with immutability
I'd say copying on every operation is quite a heavy task, You could limit this by using Consumers and doing bulk tasks though
has it considered to have stacks that delegate to nms stacks as well as stacks that are just copies to the api (like they co exist)
w/o craftitemstack
Isn’t that kinda what we have now
Well, the issue with that imo is always like, how do you express that nicely in a type system
well, in api there is no real contract of this
Right now it's terrible because you have this one mystical type that maaaaybe one thing maybe another
lol true
I would not mind always doing a single copyy and then wrapping nbt
if only ItemStack could die :P Bukkit#createItem when??? /j
I am not a huge fan of directly wrapping internal stuff usually
really I am, but I'm a psycho
Idk, I like my "write' operation at the end
ItemStack and FastAsyncItemStack
Its always confusing if you have an ItemStack variable, add it to an inventory, modify it later, and in some instances
edit the ItemStack inside the inventory alongside, and sometimes it has no correlation anymore.
ProbablyImmutableItemStack, ItemStack, MutableItemStack
lol
If itemstack can mutate we had way less performance.
The bigger thing with wrapping nbt isn't even if you are linked to an nms one or not
i'd assume that happens if the ItemStack turns into a CraftItemStack not sure the conditions for that to happen though
It’s magic
Wrapping nbt is a vibe anyway just to get rid of item meta fucking you up when parsing
before Inventory PR I tried fixing Items it did not go well, so I stuck with my dear inventories
MD said that CraftItemMeta should just directly wrap the NBT
I mean, there is not much to fix
So that’s his opinion on the matter
that makes more sense
what does it do right now
It's a rather borked system that is so old, changing things breaks everything
Usually loads stuff into its own variables
Yea right now it does a full nbt parse
Commadore ftw
Uses a copy and applies changes in bulk
I love CraftMetaSpawnEgg
no you don't don't lie
Because it has 2 layers of legacy jank
First from when the mob type was the damage value of the item
:} you can always try
Idk, it's a rather fruitless discussion
Then from when mob type was in the NBT
Fixing items is not that important compared to the death that is coming
And now mob type is split into individual types… kind of
In terms of registry
❓
Making sure that transition runs smoothly is probably a smarter investment of brain cells
Like, item API has its ugly edge cases but the API has places that need more attention
E.g. the material enum crap
My current thought is either a second main class for early loading stuff
Or maybe a new load: option for plugins to interact with early loading
I kinda feel like enums should be erradicated from a system that aims to be data driven
can't wait to see that gone that 🙂
1.21 please MD please
Choco is doing that 🥲 we got the bungee chat stuff merged
so that's one step
Sure. But dont deprecate all the simple string methods.
modifying registries?
Yeah
Simple string methods are absolute dogshit
Some registries can have custom stuff added
not really its great for simple things
Use the string templating java is adding
For string stuff
The legacy format is an absolute terrific pain
Exposing it just leads to sadness
But legacy plugins
§l§4yes
Not possible if my "string" is wrapped in 20 components and i need to deserialize it, make sure i dont break the
formatting, and serialize it back into its components.
is there much harm in letting registries be unfrozen forever (Ig it would be a mess but anything in particular?)
Uhh
I mean, it doesn't matter
Having an incomplete format be a first level API citizen is just not smart
Legacy does not fully represent components
It cannot
Any plugin using it risks loosing data
It works finish in your plugin space if you are 100% you are the only one editing that stuff
Fineish
Fine-ish
yeah I get it may be nice for like debugging and networking
There
Probably to ensure that an exception is thrown when a registration is done too late.
For example if the registration is done and the server wants to do something with each
registration, you dont want someone to come in late and not get the same treatment.
True but they are the only ones doing that
Smh just write better code so it doesn’t try to register stuff late
:p
cant datapacks also do some funky funky stuff?
Well. Freezing ensures this.
I'll thank you tonight 🙂
okay to ahead

I'm thinking if that's an optimal way of handling custom damage formula:
I'm checking on event if player is hitting a mob with something that is not air, I check if it has custom tag (lets say it has "mySword") and then use this tag to look through config for it's assigned custom statistics (like "mySword.damage", "mySword.elementaldamage" etc.), and then plug them into custom formula and set event damage with it
I won't
Rudmily
i hate phone keyboards

Sounds fine.
I didnt want to do god knows how many nested ifs and had to edit it every single time I wanted to add a new weapon
so that I could just edit config
Now you have a scalable system. Keep improving like that.
i assume if some item type provided by a plugin, and the plugin unloads it will be handled graciously, so given that, then unfreezing those registries may not be that harmful?
:,)
I kinda get the oop basics now
well not really some spigot specific quirks like with that pdc tags
⭐
2 weeks
and u're off a great start
im lovin it :)
doing assignments in python feels so off now
ngl I did feel kinda cringe when I tried to recreate a hypixel weapon
Which registries?
Shouldnt have issues with it being unfrozen unless some plugin starts removing stuff. Adding stuff should be fine its removing the vanilla stuff that would cause issues lol
yea, well im just curious if there is an aspect we neglect now
I mean they are basically the registries, no?
There are special ones that are mutable
ugh, last time I checked it just loops through populating each registry and calls freeze on each one
nms wise ofc
What are these recipes? The message outputs as soon as the server is started
Yeah it basically does that
It also shoves datapack stuff in ofc
The main issue is just how early it’s done
yeaa right
Most likely just the default recipes. Curiously this number is usually higher though
Is that hardcoded? can I change it?
Magic
I'm trying to minify the console output
Just block it then
Probably could change them. Dont think they are hardcoded just some of them are loaded up ahead of time which makes sense if they are the vanilla ones.
Most recipes are just an extension of the defaults
Yeah I still don’t know what the 7 are
Maybe it’s just the different types of recipe
Yeah idk I couldn't find much online about this
You know sticks, stone, wood etc
This might be it
Been a really long time since i have poked with the code for that stuff
I want to get rid of this or at least know what it is xD
Other messages I understand
except these recipes
That would make sense
If you are looking to minify output you are better off just providing a custom console instead
Vanilla has a bit more than 7 total recipes
yeah and there are 7 types rn
huh
campfire no?
I believe there are also 2 types of smithing recipe now
wait let me pull up class
public interface RecipeType<T extends Recipe<?>> {
public static final RecipeType<CraftingRecipe> CRAFTING = RecipeType.register("crafting");
public static final RecipeType<SmeltingRecipe> SMELTING = RecipeType.register("smelting");
public static final RecipeType<BlastingRecipe> BLASTING = RecipeType.register("blasting");
public static final RecipeType<SmokingRecipe> SMOKING = RecipeType.register("smoking");
public static final RecipeType<CampfireCookingRecipe> CAMPFIRE_COOKING = RecipeType.register("campfire_cooking");
public static final RecipeType<StonecutterRecipe> STONECUTTING = RecipeType.register("stonecutting");
public static final RecipeType<SmithingRecipe> SMITHING = RecipeType.register("smithing");
public static <T extends Recipe<?>> RecipeType<T> register(final String identifier) {
return Registry.register(BuiltInRegistries.RECIPE_TYPE, new ResourceLocation(identifier), new RecipeType<T>(){
public String toString() {
return identifier;
}
});
}
}
o
prob debug or sth weird
Ah okay it lumps all the crafting recipes together
yeaa, not sure if it always were the case but yeaa
Hmm?
public class MerchantOffer {
/**
* The first input for this offer.
*/
private final ItemStack baseCostA;
/**
* The second input for this offer.
*/
private final ItemStack costB;
/**
* The output of this offer.
*/
private final ItemStack result;
private int uses;
private final int maxUses;
private boolean rewardExp = true;
private int specialPriceDiff;
private int demand;
private float priceMultiplier;
private int xp = 1;
public MerchantOffer(CompoundTag compoundTag) {
this.baseCostA = ItemStack.of(compoundTag.getCompound("buy"));
this.costB = ItemStack.of(compoundTag.getCompound("buyB"));
this.result = ItemStack.of(compoundTag.getCompound("sell"));
this.uses = compoundTag.getInt("uses");
this.maxUses = compoundTag.contains("maxUses", 99) ? compoundTag.getInt("maxUses") : 4;
if (compoundTag.contains("rewardExp", 1)) {
this.rewardExp = compoundTag.getBoolean("rewardExp");
}
if (compoundTag.contains("xp", 3)) {
this.xp = compoundTag.getInt("xp");
}
if (compoundTag.contains("priceMultiplier", 5)) {
this.priceMultiplier = compoundTag.getFloat("priceMultiplier");
}
this.specialPriceDiff = compoundTag.getInt("specialPrice");
this.demand = compoundTag.getInt("demand");
}
@young knoll
and more
isnt that it, or no am I lookingat the wrongthing?
lol thats a bit goofy
Yeah I'm not sure why that was designated a recipe. It shouldn't have been
maybe they make it one, not impossible?
Maybe sth like interface Keyless extends Keyed
altho that looks just like the schrodinger cat
That would be useful everywhere
default
abstract class
adapter
I'd also love if java had operator overloading

well, java doesnt care much about boilerplate reduction
:(
Operator overloading can get weird
Sure, it makes sense on a vector
But what happens when I add it to player huh
yeah in principle its just a BinaryOperator<T> x)
Player * Player
DOUBLE player xD
Btw any idea on how to change F3 server name?
I heard that it's possible with packets but I don't know much about them
xD Ofcourse not, I want to put "Visit spigotmc.org and add Conclube as a friend" xD
Yeah I'm looking at its source right now
But its confusing
https://github.com/zubiden/F3Name/blob/master/src/main/java/ua/coolboy/f3name/bukkit/packet/ReflectionPayloadPacket.java this is it I think
i support the second instruction quite indefinitely
xD
ngl I felt memey today. https://www.spigotmc.org/threads/is-it-possible-to-place-a-block-async.624460/#post-4659157
guys when is spigot gonna break 1.8 support how many more years
I think we hard fork NMS here tbh we need to beable to place blocks async
nice new name
Chocolate
waait holll'up, mine doesnt say that xD
yes still Choco on my phone
I prefer ctrl+shift+c
weird
focuses the area where you're hovering
try to press winKey+ctrl+shift+b
restarts your video driver 😍 (if you're on windows)
I'm not on windows
that just puts you into the terminal
I don't need to alt+f4 for that
super+"terminal"
or more super+"ter
ubuntu?
fedora
nice
Latest fedora?
ofc
All good then. Got the 6950xt
I'll probably have to move to mint sooner or later because of that
mint is staying with xorg for the next 2 years
Lol, we gonna use each other's distros.
I hate cinamin but they're the only DE not removing xorg support
I've got 2-3 years with Cinnamon + Mint vs 5 more months with fedora+gnome
I don't dislike cinnamon, but I think it could be better. I also think vanilla gnome could be better, but at least there's tons of extensions.
I can always stay on fedora 38 but then I loes security updates
I wonder if using nvidia cards will ever be as easy to use as amd cards are. Not that there aren't problems with amd cards, but at least they work on the majority of distros.
if nvidia gets their head out of their asses sure
but they never will
Didn't the nouveau driver get some updates recently? I thought with the recent stuff nvidia drip fed us got some better results out of the open source driver.
you'd have better odds having a toddler take down a heavy weight boxer
better results xD yeah ofc, though that doesn't change that nouveau drivers are literal ass compared to proprietary
you might as well buy a low end card if you want low end results
I love linux so much it makes me wish I knew about it before I bought parts for my new system
Same. I got my graphics card swapped because I switched over permanently.
Just got tired of dealing with the issues.
first thing I did when I got my laptop was uninstall windows and install linux
granted I have to dual boot because otherwise I wouldn't beable to install their invasive ass testing software but I have it confined to a single ssd vs my entire system
Also in the same boat except my spare windows ssd is for games only. Only problem I have with dual booting is the auto installed drivers fucking up my peripherals when switching back into linux.
Mouse sense is not where it should be, keyboard seems to lose it's profiles, and I have to double check audio sometimes.
I use linux for games, I'm not a huge gamer so everything I could ever want works on linux. I'm especially not into games that rootkit your system with anti cheats
I used to play genshin (unfortunately) and I even got that working on linux
I try whatever I can first on linux and if it works, great. However there are just some games that aren't there. Rust being one of them.
does genshin do that?
oh no, they don't like when you do it
there is a project which I am at liberty to not name
ah alr
which deals with this issue
Who owns Genshin?
Mohoyo -> Chinese -> Chinese Government
At least it's not Riot Games
was gonna say x)
I got it to work very well and that project is still alive and well, however, as you can imagine they like to keep its userbase very small. They switch the project name and location every 6 months
its hard to keep track of if you don't know what you're looking for
Well, I take this back. The games will launch and even run locally just fine, it's just the multiplayer anti-cheat that's holding the game back.
aahh
ooof
it works by essentially disabling the anti cheat but feeding fake specs that you are using it. It only works on linux and they don't provide windows support because they don't want people to cheat
I feel you though.
sounds like emulator stuff
kind of but not really its just lots of data spoofing
ah I see
wait this genshin or riot?
genshin
Riot sucks who cares about them
I quit genshin, but I never started with Riot
I can't believe I need a rootkit on my system to play their games
Did they add it to League or is it still only for Valorant?
Valorant is not worth a rootkit
Facts
CS2 is rough though. At least with my internet connection. Can hardly play it now. :/
so its not just me
CS2 I've noticed my connection is much laggier
fair, i just really like the val community, or well its fun to partake in it at times :>
I wonder what they did with protocol
why?
i see
But it's def noticable
there is no way of changing it?
lol
I miss cobblestone man 😭 I loved that map it was my fav, but instead I'm stuck playing the garbage they added back instaed
At least the replay tools are finally usable and not stuck on some source 1 bs that would lag and possibly crash the game when trying to scrub through video.
I'm hoping by the time I move again the game will be in a better state so I can play it when I have good internet again.
fun fact I actually bought prime and I've sold every single reward I've gotten I've made back approximately 5 of 15 dollars
10 to go
ive made hundreds of dollars minus in csgo
I'm only -10
-800 iirc
I'm a modern game companies worst enemy, I don't care about cosmetics
Never pulled a gold. 😦
but what if its fancy wings in an mmorpg
you have to buy it right
I don't play mmorpg most of them are just stupid money sinks tbh
most MMOs are just riddled with micro transactions now adays
true
my prof wants me to wirte a rhetorical analysis on one of my research sources
its so lame bro this is an academic journal
itss just facts and stats
the author invokes ethos I think i'm going to have written that like 30 billion times by the end of this
is there a tutorial on how i can use my plugin as an api for another plugin?
look into jitpack
?
do you know how i can add my own api to another plugin, so that it can acces the classes?
oh
you could either fork the plugin or see if the plugin's api is accessible
Use latest
Rhetorical analysis? Doesnt that mean its pointless lol
Anyone know how to check if a minecraft name is valid?
guys, i need some help. i have C# script:
{
spriteRenderer.sprite = ShipSprite;
transform.Translate(Vector2.right * ShipSpeed * Time.deltaTime);
if (Input.GetKey(KeyCode.Space))
{
rb.AddForce(Vector2.up * ShipForce, ForceMode2D.Impulse);
}
}```
it's working too bad, how i can make ship from geometry dash (game)?
If they join the server it’s valid
Why not ask something like that at the programming hideout or similarly?
i decided to just use the minecraft api
since code accepts offlineplayer
idk
sir... this is spigot
I mean we do help people that are developing programs of various purposes but we prioritize spigot
Still, you definitely will not get too much help here because most people here do not specialize in what you're doing
they are requestion support for C# on a server for spigot
that's like double unrelated
I did sneak a few galimulator modding questions on this discord in the past ;)
Define working bad? Also you might want to scale the force by deltaTime
Hello I wanna make a discord bot with my pluin (javacord).
I have this error :
java.lang.NoClassDefFoundError: org/javacord/api/DiscordApiBuilder
at fr.cedricxbg.rpww3.Main.onEnable(Main.java:23) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:546) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:460) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.reload(CraftServer.java:968) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at org.bukkit.Bukkit.reload(Bukkit.java:833) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:877) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchServerCommand(CraftServer.java:862) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.dedicated.DedicatedServer.bf(DedicatedServer.java:412) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:388) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1197) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1014) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:303) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: org.javacord.api.DiscordApiBuilder
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:147) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
... 18 more
And my line 23 is this :
DiscordApi api = new DiscordApiBuilder().setToken(getConfig().getString("bot.token")).login().join();
Can anyone help me pls ?
you need to shade it
how I do that?
via your build system
Hey, I'd like to create a custom mob plugin but I have an issue, I'd like to edit the values before spawning the entity, does anyone know how could I do it?
ok
maven-shade-plugin for maven iirc and shadow for gradle
why do you use javacord in first place
and what do I need to place into the Java task shadowJar ?
Are you spawning the entity or the default algorithm is?
implementation/api dependencies are shaded automatically
so just use the jar with the -all classifier
you should also specify a relocation rule to move javacord to your package
also i'm using #spawnEntity
but I don't want to use directly #spawnEntity, more like I add the desired values to the mob and then spawn it with those values
what do I need to put into the "" ?
shadowJar {
dependencies {
include dependency("")
}
relocate("","")
}
If it is a double-quote (this looks like a single-quote but could be my font), yes
Also you probably don't need a dependency block in your shadowJar block
so I let my gradle.build file like that ?
Well you need to relocate still
so what I need to put into the quotes ?
relocate("source.package.here", "com.example.myproject.shaded.package.here") for example
Also make sure to have the javacord dependency as API or implementation, but not as compileOnly or compileOnlyApi
implementation is good ?
While source.package.here is the javacord package
Yeah
There’s a consumer in spawnEntity
relocate("org.javacord:javacord:3.8.0","fr.cedricxbg.rpww3.shaded")
just org.javacord
No, it needs to be the package name, not the artifact
and preferably you'd select a destination package specific to javacord
i.e. me.example.libs.javacord
so that is good ? fr.cedricxbg.rpww3.libs.javacord
yes
relocate("org.javacord","fr.cedricxbg.rpww3.shaded.javacord")
I can put that in my gradle.build ?
can remove the libs part if you're gonna put shaded in the package, but yeah
make sure it's in the shadowJar task configuration closure
currently I have this
shadowJar {
dependencies {
include dependency("")
}
relocate("org.javacord","fr.cedricxbg.rpww3.shaded.javacord")
}
you can remove the dependencies closure
Yeah but I want to make something like a gui editor and then at the end save the entity or spawn it
Not sure if gradle allows this but in maven you can specify artifact to be more specific. Handy if you have 2 dependencies with same package layout.
So?
That’s just prework
@dry hazel same error
Save all the options and change the entity on spawn @tawny talon
if I use #spawnEntity I'll spawn immediately the Entity which is not what I want
M8
Don’t spawn before you have all the changes you want
Run spawn entity when they have finished ur gui settings and click spawn in it
Yeah but how can I get the values if I don't have an entity variable
Lets say I want to modify a Zombie damage
Code would look something like
Zombie zombie = World#spawnEntity(etc)
Obviously you would have that saved somewhere
Yeah but what I'm trying to say is, I need a variable to be able to modify the settings, and there isn't a method that just returns the Entity without spawning it
Davy
I am telling you
To save the settings you want to change
Before
Spawning
Make your own POJO or smth
Then use the consumer in spawnentity once the user is done
Don’t overthink that you need an actual entity object
used the correct jar?
with the -all classifier?
mm, so I'll just create a normal class, create the variables there and then use them in the #spawnEntity method?
Yes
wdym by "-all classifier"
They probably could just extend the entity classes to create some virtual entity to make it easier to plug values in lol
suffix in the file name
Regardless either way its not overly difficult for the solution
The hard part is getting this thing persisted.
The even harder part is making the server not instantly replace it when its being loaded.
I just meant using a virtual entity to hold values without having to create custom methods and types. On spawning you would transfer the values over
And then get rid of the virtual entity if its not needed anymore or keep it around if its needed
Ah so like a template
Yeah exactly
so I rename my Main.java to Main.java-all ?
no?
shadowJar produces a JAR with an -all suffix
But... you dont want the jar with the -all suffix.
The one that has no suffix should be used
-all is the shaded jar
Yes but there are a bunch of maven goals that could be missed out, depending on what you are doing.
No suffix is the final jar
Gradle 💪🏻
this is gradle, not maven
Though you can do the same there
Ah so shadow
Would say its pretty much a death sin to mix the two of em up :>
Hello, what is the event when an entity attacks an entity (or a player)?
?jd-s
@cinder abyss Look for it here
for me?
Hint it has Damage in its name
It includes players too?
A player is an entity
EntityDamageByEntityEvent
I was trying to get him to find it himself smh
i know
okay thanks
no need to be cryptic about a simple question like that
Do u like pickles? @hushed spindle
I can find myself, but It would be easier to just say EntityDamageByEntityEvent 🤣
No, but it’s an easy way to learn to navigate javadocs
grrr i hate pickles nasty gross too sour
I know how to navigate in javadocs x)
🤔
pcikled onions tho 🤤
I will shove large one in ur mouth
hmm
with your big strong hands
Lol
you're not spigot related
Channels are not so strictly moderated so don’t worry
be happy
As long as we answer questions we can be a little silly
sometimes me too 😏
in this channel
yes we are
I don't know what thread it is x)
I'll search
hello im in troubles trying to install citizens plugin, i cant access to that spigot web
Hello I have a question, rename a plugin .jar to .rar and edit plugin.yml to change permssion its illegal like decompilation? or I can?
xD
hilarious md_5 reply
you can do whatever, and whats the sense of doing that? you generate the jar file and also a folder
? Also #help-server
you can, you'll get illisible classes
Everything is legal
this post isn't spigot related 🤣
but it's funny 🤓
?
How do you compile?
I use intellij idea
I click on the gradle icon at my right
then Tasks > build > build
Did you make build depend on shadowjar?
here is my gradle.build file
plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'java'
}
group = 'fr.rpww3'
version = '1.0'
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compileOnly "org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT"
implementation 'org.javacord:javacord:3.8.0'
}
shadowJar {
relocate("org.javacord","fr.cedricxbg.rpww3.shaded.javacord")
}
sourceCompatibility = targetCompatibility = '17'
compileJava.options.encoding = 'UTF-8'
setLibsDirName('../server/plugins')
You did not
Either hit the “shadowJar” task instead of build
Or make build depend on shadowJar
okk
Location cornerLocation = new Location(world, playerChunk.getX() * 16, player.getY() + 14, playerChunk.getZ() * 16);
ItemDisplay chunkBorder = player.getWorld().spawn(cornerLocation, ItemDisplay.class);
ItemStack border = new ItemStack(Material.KNOWLEDGE_BOOK);
ItemMeta borderMeta = border.getItemMeta();
borderMeta.setCustomModelData(1);
borderMeta.addEnchant(Enchantment.LUCK, 1, false);
borderMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
border.setItemMeta(borderMeta);
chunkBorder.setItemStack(border);
chunkBorder.setInterpolationDuration(100);
chunkBorder.setInterpolationDelay(-1);
Transformation transformation = chunkBorder.getTransformation();
transformation.getScale().set(16, 16, 16);
chunkBorder.setTransformation(transformation);```
Hey, I am trying to make this Knowledge_book transform from it's original size to Scale (16, 16, 16) with interpolation over a duration of 5 seconds.
Right now it instantly scales to (16, 16, 16), instead of over 5 seconds. What do I do wrong?
Is it possible to call your event via EventHandler anttation?
now I have this err:
java.lang.ExceptionInInitializerError: null
at fr.cedricxbg.rpww3.shaded.javacord.api.DiscordApiBuilder.<init>(DiscordApiBuilder.java:33) ~[?:?]
at fr.cedricxbg.rpww3.Main.onEnable(Main.java:23) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:546) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:460) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:588) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:413) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:250) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:972) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:303) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.IllegalStateException: No DelegateFactoryDelegate implementation was found!
at fr.cedricxbg.rpww3.shaded.javacord.api.util.internal.DelegateFactory.<clinit>(DelegateFactory.java:98) ~[?:?]
... 13 more
Display entities do not like to interpolate right after they spawn
You gotta delay it
