#help-development
1 messages Β· Page 543 of 1
Sounds like a good use case for the event I mentioned
(crazy!)
what
not you
oh
me
what should I be using instead
Nothing you don't need to annotate that at all
^
it doesn't need a local variable?
?
I'm not familiar with java's syntax
then you should not be making a minecraft plugin
in this case, how can I make sure config is a local variable
learn java first
I'm learning java via making plugins
bad choice lmao
it's how I learn
eh well it's my choice
Learning trough projects is much more fun and efficient imo
Assuming you already have basic programming knowledge
I mean yeah true
I do java for my job so I guess I was just taught to learn then do first
Β―_(γ)_/Β―
Wanted to start organizing my plugin in order to add more features, anybody knows how to connect the starting file to the skeleton file?
What do you mean ?
They want to know how to access another class I guess
Which means it's time to learn Java
Oh π€‘
Same code doesn't work on a different java class
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
how so
any ideas why my Interactions are off grid?
Im spawning them exactly where I spawn those Block Displays
?paste
add 0.5
the block center is always 0.5
Origin of the entity is just in the bottom left
oh ok
tysm
Aaah, THAT's what a block display is. I hadn't bothered to look into it yet.
When I have an eventlistener does it need to be public?
highly encouraged
what happens if it isnβt? More reflection?
Curiosity, I suppose? I'm just trying to do stuff by the book and afaik if it doesn't need to be public, it shouldn't be
mods?
This is seemingly just what i wanted, can't believe it took me this long to find it
anyone know how to apply this in any way shape or form?? i have no knowledge on how to compile plugins π
here's the link from that thread: https://gist.github.com/aadnk/3928137
Not even sure this code works anymore, it's very old from the looks of things..?
invocation speed is slightly faster
but yeah u compromise it with unnecessary accessibility
the class or the methods?
nvm class probably cant be private
Are we talking nanoseconds or milliseconds here? If it's the former, is there really any real life application where it would be better to use public?
nanos prob
like its negligible
but it may be impactful if u scale it enough
and java is just making reflection faster with new releases
I just use public so I can unit test if needed
But on the other hand, would there even be any potential issue with leaving the modifier public?
well
does anyone else know a plugin that has something similar to this at least?
I don't want to vanish the player entirely, but have a thing to just remove them from the list of players (when you hold tab and whatnot :P)
semantic accessibility modifiers in java like private, protected, (sealed)... etc are just there to make be able to defend ur code against the world
cuz we are humans after all hence capable of just so much trouble
Thing is this is how I think
sure its public when it does not need to be
however all listeners are at the bottom of your abstraction hiearchy anyway
(or well they should be)
therefore no other class of yours should in principle have your listener classes as dependencies of their own
like also u have to code with the intention that people aren't going to deliberately sabotage your system (since in reality thats really easy to do, just reflection, unsafe etc)
i know i mean the listener class probably cant be private because Class doesnt have a setAccessible method
no shit
didnt i say class
listener class
im pretty sure you cant set shit as accessible if the class is inaccessible to you
invokespecial being faster than invokevirtual ig
yeah it is
probably because it doesnt need an instance
if you dont use this i dont think its ever dereferenced
but pushing parameters probably takes longer
ye
On the other hand, I'm having some issues with my plugin. Code pasted below.
Basically... It runs the funciton if the itemData matches "ItemDataValue"... But it doesn't do it? This is a custom recipe item, and it only works if I craft a fresh item. But then suddenly it breaks, I can't figure out why it breaks, but it does. Then, despite the data being identical, it just doesn't run the function. I printed out the itemData to be sure, and it always says "ItemDataValue" but if the item isn't freshly crafted it just doesn't work...
String itemData = meta.getPersistentDataContainer().get(_keyCache.getKey("keyname"), PersistentDataType.STRING);
if (itemData == "ItemDataValue"){
new Function(e);
}
use . equals for strings
That's what I was looking for, thank you
== is unreliable
i wanted to say that but i was typing on the wrong screen π
I completely forgot that... I knew I solved this issue before lol
Any clue as to why this is an issue in the first place? Never seen it any other language
sometimes forget that too
because == compares instance identity
it occasionally works because most strings not explicitly created with new String come from the string pool
cuz if you dont use a string literal, you are making a new string object and compare it with a literal, which is stored in another place in memeory, those two addresses dont equal so it will return false
meanwhile in c++ you just have == 
I see, that does make sense. I assume it would be solved if I made a new String like String checkFor = "ItemDataValue" too?
nah
same issue?
its not the "ItemDataValue" that is the problem, that one is stored in the readonly memory section of you program
PDT might be deserialized in which case the value is created with new String(byte[])
your itemData is a new string object made during runtime
essentially == compares the reference and .equals() compares the data
I see, thank you for the explanation :)
and it just happens to sometimes work because the value might come from the string pool
Like when it's just been crafted
so yeah always use .equals
::intern() π
yeah if it comes from a literal in your code it will most likely be from the string pool
but thats unreliable across platforms and data sources so just use .equals()
You see, I had this issue before and I just forgot how I solved it... I solved it the same way then as now, I just forgot. I guess that's what I get for working on this once a decade π
lmao
How can I build a plugin with visual studio 2019? is it even possible?
nah thats C#
only? damn
well maybe if you install a plugin to code java
can vs even work witj java
I love using IntelliJ but Eclipse is possible, too
technically
but i strongly recommend IntelliJ
ok
i'm very new to all this man, i just wanted to compile this plugin from a src but it doesn't come with anything but the code
:P
just go get intellij then, it will ask you to build
oh nvm then
who even puts that in a gist π
yeah install intellij and copy paste shit
alright
dunno, it's from 2012 seemingly
xd
i can't seem to add dependencies
Ended up using Objects.equals(a, b) since I needed to avoid null as well. Had a fun time figuring out why it didn't work until I saw I typed "Object" not "Objects" haha
i have no clue how
Well, it pays well where I live anyways
you can also do "ItemDataValue".equals(...)
Good point
because i said it earlier
assuming you read the earlier posts
π€¨
whatever
i just
need help with this
so in project strcutre and modules
apparently there's supposed to be a thing to add dependencies
i do not see it
some people do
I've been following this tutorial
https://www.spigotmc.org/wiki/creating-a-blank-spigot-plugin-in-intellij-idea/#setting-up-the-dependencies
and it's just not there
dont either
Not like this?
void MyMethod(){
}
ioh wait shit
it's there now nvm
it literally wasn't there before, think i know why though
i dont see c++ people care much about conventions
π€·ββοΈ
you can be happy if you have a ```cpp
void My_Fancy_Method()
{
}```
Unless the IDE makes the opening bracket go one line down I'm not gonna change how I write it lol
for C++ it is not usually for further development or maintaining
okay this is ridiculous, now "src" isn't there
Had to pull up a project to be sure... Turns out the class I looked at hadn't been formatted fully so the one method I looked at was incorrect lol
is there a way to extend numbers in java? like short to int but without it needing to keep its value, i just want to pad it with zeros
I much prefer having the opening bracket on the same line as the function name, though
:l you can still do it as you wish
Even if you write everything on one line it is still doesnβt matter
since java is little endian (int) myShort will place the short bits at the end of the int to preserve the value
but idc about the value i just want to extend it with zeros
new line for every character π€
For C it is just annoying about pointer and stuffs
no i mean bitwise
shouldve clarified
like byte -> short would be 0xFF -> 0xFF00
so padding zeros on the right?
yeah
frostalf probably knows
maybe i can do (int)myShort << 16
what runs first, the cast or the shift?
yeah
And yeh C does things greatly It allow you to work with memory address
But not that flexible
ok i think i got that
figuring out dangling poiinters is fun
isnt new byte[len] just the same as malloc
but managed
there already is Unsafe#allocateMemory though
does that nullify it?
or leaves them unitialized?
hmm
oh nah
that clearly looks like overflow
got bored so ima continue later
holy shit it finally worked
need to do all of this shit because java does not have structs
and using objects would fuck the heap
ill use swing
directly render shit with Graphics2D tho not doing actual swing shit ever
otherwise opengl
why not swing lmao
i wont use the components
only canvas
it wont look shit i promise
i only render stuff in odin (yes thats a lang)
Ew
Are you insane?
oh there are java bindings for raylib
graphics2d is nice
But sooo slow
im not doing fucking opengl for chess
because im stupid and i dont know what im doing
i cant be bothered to spend time on the gui
Well then you don't have to bother about performance in the first case
the gui isnt heavy
the chess engine needs to be fast
yeah
i am
idc about the gui as long as it doesnt crash everything
nah i know but i tried in C++ and i got segfault in creating the board so fuck that
is it (or will it be) on github?
yeah i will try to make it kind of a library
i like looking at your code
Won't be much of an issue as lichess is written in a JVM language.
You probably can use whatever they use
lichess most likely, like all other apps and sites, uses UCI
It's THE open source chess website
UCI?
so the engine doesnt need to be written by them
universal chess interface
yall playing chess?
lichess is open source: https://github.com/lichess-org/lila. Apparently they use an AI cluster (https://github.com/lichess-org/fishnet) for the chess engine
Is possible to add more sounds to minecraft and make them play with a plugin? (obv with texture pack)
wait what
Yes
if there's any guide for adding sound to minecraft and how can i play them
i found one https://mcmodels.net/how-to-tutorials/resource-pack-tutorials/how-to-add-custom-sounds-to-resource-pack/
ok found everything
Or just do return (byte) ((move >> 9) & 0x7);
hhm
thx
didnt think that would work
because of other values packed in the int
(technically there is a difference between << 16; >> 25 and >> 9 but due to the bitwise AND the diff is not of relevance)
ah
Packing with negative values can be a pain
dont think ill need to do that
Yeah then it is easy
you mean packing signed values?
for negative values you'd need to do stuff like
public static long hashPositions(int x, int y) {
// We make use of (y & 0xFFFFFFFFL) as otherwise y values such as -1 would completely override the x value.
// This is because `long | int` automatically casts the int to a long, where as the cast is by decimal value
return (((long) x) << 32) | (y & 0xFFFFFFFFL);
}
for reading I don't exactly recall how it works
tf
Though I believe reading/unpacking is rather easy as you can just reapply the bitmask and cast
i.e. for reading x you'd do (int) (value >> 32) and for reading y you'd do (int) (value & 0xFF_FF_FF_FFL)
Honestly the bitwise operations are rather easy but I've been in contact with those ever since I started modding galimulator (you tend to use them quite a lot for manipulating bytecode) so yeah my perception has become skewed since then
I am trying to make a plugin that times how long it takes for a player to complete a parkour course and I want to add a leaderboard hologram for the player who completes the course in the fastest time. How can I store the parkour values so I can add them to a leaderboard hologram?
Hello, I'm trying to place some items into a custom SMITHING inventory but items are not placing
Code:
null,
InventoryType.SMITHING,
"...");
inventory.setItem(0, new ItemStack(Material.APPLE));
inventory.setItem(1, new ItemStack(Material.IRON_INGOT));
player.openInventory(inventory);```
In-game result: https://prnt.sc/q95ayEwtYxzo
I tried to cast the inventory to SmithingInventory but it's giving ClassCastException. Is there a solution for them (or for any)
π€
why that appen? https://pastes.dev/9SskTvOSdY
that your own plugin that disconnect.spam thing?
no?
dunno if thats caused by that luckpermsvelocity plugin or not, should probably get to #help-server
What sort of classcastexception was it giving?
Code:
```Inventory inventory = Bukkit.createInventory(
null,
InventoryType.SMITHING,
"...");
SmithingInventory smithingInventory = (SmithingInventory) inventory;
player.openInventory(smithingInventory);
Error:
``Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventoryCustom cannot be cast to class org.bukkit.inventory.SmithingInventory (org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventoryCustom and org.bukkit.inventory.SmithingInventory are in unnamed module of loader java.net.URLClassLoader @3f8f9dd6)``
Does updating the inventory do anything?
maybe the fact that its experimental and the note
No, the function is calling by a command so the inventory is not opening due the error
Without the casting
If I don't cast, it is placing nothing to the inventory
.
Hmm
What about the items, why they aren't placing (I have never seen this problem before)
calling ::addItem?
Inventory inventory = Bukkit.createInventory(null, InventoryType.SMITHING, "meow");
inventory.setItem(0, new ItemStack(Material.DIRT));
inventory.setItem(2, new ItemStack(Material.GRASS_BLOCK));
player.openInventory(inventory);
dunno i never used smithing inventories
Works perfectly fine
slot index correct?
Tested in 1.19.2, let me test in 1.19.4
Updating the server version to 1.19.4 is solved the problem, thanks
Do you know of any good YouTube tutorials that will show how to do that?
can i move the craftingtable to the player gui?
i mean i wanna craft everything in gui
If I specify text to be bold with ChatColor.BOLD how do I specify when the bold should end. I am trying to do somthing like: normal text bold text normal text.
ChatColor.RESET
i cancel the craftitem event works but i see crafted item can i disable to show this ?
how to spawn an entity 0.5 blocks to the left of it?
to the left of what
just add 0.5 to the position.x or whatever
That wouldn't always be to the left
I need it so that for any entity it is on the right / left
get where its facing towards, create a vector pointing to that position rotated by 90 degrees
x 0.5
Look at the rotation of the red entity and do trig to get the coords to spawn the blue entity?
not really trig but close enough
Yeah you're gonna have to use trig to get the left vector of the entity and then add that vector to it's position
Hello, I am trying to develop a local chat for a plugin that I am making, and I'm using luckperms with my plugin as well. When I type in global chat, the prefixes and suffixes show, but when I use local chat which has its own format, it only shows the username and nothing more.
In short, player.getDisplayName isn't getting the prefix and suffix and I have no clue how to fix it I have been googling for like 30 minutes, any help is appreciated
And how can I do it? I'm not good at geometry.
Neither am I. There should be plenty of information online for getting a left vector though, getting directional vectors is fairly common in Game Dev
You're gonna have to use LuckPerms API to retrieve the Prefix/Suffix
oh alright
Or retrieve them any other way you can. If you've set them manually then using their API is gonna be the easiest and most consistent way probably
how can i add equal for the #PrepareItemCraftEvent
example paper.hasItemdata players can't craft map
need i get player ?
or this event have method for check crafting slots ?
`if (event.item.hasItemMeta()) setResult())
if I want to follow an arrow and just for example lets say log its data, will I have to setup a loop that will get the data every tick or is there some kind of tick event?
item is in player inventory ?
or crafting slots ?
you should know where the item you want to check will be
how can i check if item in crafting slots or can i check ?
get the inventory and loop slots
ah ty
If I have this code
Bukkit.getScheduler().runTaskTimerAsynchronously(plugin, () -> {}, 0, 1) how do I stop the loop from inside the loop?
replace () -> {} with task -> {} and then you can use task.cancel
this.cancel(); ?
that will try to cancel the class I'm coding in
and in my class there is no cancel function soo
iirc this refers to the anonymous class if you are inside any
this refers to the current context
Is there a way to do getItemMeta but get the actual item meta instead of a copy?
It is not a mutable copy no.
No. You'd need to get it via reflection
ItemMeta is constructed via the nbt data.
:> mutable item meta sounds safe reflection time
why my plugin no work!!
I can't think of a reason to get the actual item meta
Because setItemMeta is hard
It's a reflection of the nbt data.
You aren't good enough
Get good ar coding and try again
real
Bad weather? Electricity outage? Broken CPU?
So does getItemMeta returned item update to reflect the actual item meta?
GPU could be shot maybe their screen is black
getItemMeta returns a copy
what
I'm kidding I just don't know how to ask my question without sending a big block of code
?nocode
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.
I onow how you can
?paste
holy shit finally this shit passed
We are used to look at massive blocks of code
bro is making chess in minecraft
nah it's only a few lines but there's already alot of stuff in this chat
Really all of my code is less than 2 lines
Thay way nothing gets lost
We're helping spigot idiots
?PASTE
oh I think I fixed my own issue hold on
?paste
You get to two lines? Stop flexing.
Edit: Oh, less than... nvm
I'd be surprised if you didn't look at blocks of trash daily ahaha
I have no idea what it refers to but definitely not to something I need
Strong words from a kotlin users
Why the kotlin hate
I can use both JAva and kotlin plus scala
so suck a fat one
calm down girlypops
Shut up
We are just having fun ahaha
make me
Go delete your discord
i'm gonna touch your accountI did, in my phone
casual #help-development conversation
real
hey man, what else is there to do when nobody wants our awesome help
Go on the spigot forums and loose braincells
Ig I'll just use the deprecated timer task with BukkitRunnable because it has cancel()
I'm gonna make a swear jar plugin
everytime you swear, you lose a thousand real life dollars
Genius
BukkitRunnable is not deprecated
Paypal api
?jd-s
π₯³
you need to connect your credit card to join
that sounds like something I'd actually do with friends tbh
The runAsyncrounusTimerTask (or whatever it's called) with BukkitRunnable is
declaration: package: org.bukkit.scheduler, class: BukkitRunnable
fastutil is so nice but so fucking big the jar immediately becomes multiple megabytes big which sucks
Cause ur doing it wronnggg
so it turns out i didn't fix it
if (!playerFile.exists()) {
playerDataFolder.mkdirs();
try {
playerFile.createNewFile();
YamlConfiguration playerConfig = YamlConfiguration.loadConfiguration(playerFile);
playerConfig.set("balance", 0);
playerConfig.save(playerFile);```
empty file
Well now you need help
new BukkitRunnable .... .runTaskTimerAsynchr(plugin)...
always do
i want to make some kind of calculator a player can use in the chat like :
"i need 10+4 stacks of wood",
and it would just convert it to 14 but rn im kinda strugeling to think of some indicator to use it because it would be annoying if it would apply to everything yk
anyone got a idea that would make that easier to control
I have finals in 5 days from now yet i'm out here coding my first plugin
as you should tbh
check if everything before and after the sign is a number?
until you hit a space in both directions
goat dang it why won't it save
no clue what you are trying to say xd just to make sure i know how to code it i just dont know what to use. First i thought maybe put like a % or something infront the msg if something should be converted but then i though thats to hard to remember or to annoiyng to use
im just not sure how to make it user friendly
so like a player says "32+8" and it spits out 40?
i think what he means is that when a sign like "+" is found, you keep taking every number before and after it until you hit a space in each direction, that way you know the number is done
did he do something like this before?
He's been working on it for months
i just kinda wanna do it bc im having a math exam coming up and i wanted to do something with math xd
Do particle effects
could try this
https://github.com/FourteenBrush/MathExpressionParser
Well anytime you get a string that either starts withnumber<operation>number or contains <space>number<operation>number you can calculate it
if you wanna support full expressions that's not as easy as it sounds
just gotta figure out where the math is
looking for expressions like this: https://github.com/FourteenBrush/MathExpressionParser/blob/6c67ec2f340f1dd5daa4041946a73faade7539ed/core/src/test/resources/tests.txt#L28
now can someone save my ass
bc of exam?
How do I check to see what a specific value in my configuration file is?
isSet
custom config or the normal one
thank you
real
huh
ok now how do i save my config file
File playerDataFolder = new File(getDataFolder(), "playerData");
File playerFile = new File(playerDataFolder, playerID + ".yml");
if (!playerFile.exists()) {
playerDataFolder.mkdirs();
try {
playerFile.createNewFile();
YamlConfiguration playerConfig = YamlConfiguration.loadConfiguration(playerFile);
playerConfig.set("balance", 0);
playerConfig.save(playerFile);
} catch (IOException e) {
e.printStackTrace();
}
saveResource(playerID + ".yml", false);```
how would "isSet" help to get a value o.o
It would not
It would return true or false
don't do that last part
so
that's dumb
Yeah but he literally said "check to see what a specific value is in my configuration file" - fixed some grammar
why not
get then
get then
yes
simple get
get then
i'm finally starting to get used to this
@unique bay
Java
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import java.io.File;
public class ConfigUtil {
private File file;
private FileConfiguration config;
public ConfigUtil(Plugin plugin, String path) {
this(plugin.getDataFolder().getAbsolutePath() + "/" + path);
}
public ConfigUtil(String path) {
this.file = new File(path);
this.config = YamlConfiguration.loadConfiguration(this.file);
}
public boolean save() {
try {
this.config.save(this.file);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
public File getFile() {
return this.file;
}
public FileConfiguration getConfig() {
return this.config;
}
}
i normally use this when ever dealing with configs. When ever you save somethin in a file it either creates the file or loads it up and changes it if it exists
works fine for me
honestly no clue where i found it anymore
that's alot
epic java code block fail
real
its just one class u can use over and over again
have it in a seperate class and call it up when needed
I don't even know how I would do that yet
like iths
you should be saving 1 instance of it,, not creating a new one every time you want to use it
thats true yh
and if you want to get the saved data you would do this
ofc again with the same instance if possible
epics right about that
iirc you can extend YamlConfiguration or FileConfiguration and be able to do config#getLocation
real!!
extensions are barely used when it comes to bukkit
probally yh
bit annoying
my balance is still not saved in the file π
meanwhile I made a minigame lib where you gotta extend literally anything and just add to it
File playerDataFolder = new File(getDataFolder(), "playerData");
File playerFile = new File(playerDataFolder, playerID + ".yml");
if (!playerFile.exists()) {
playerDataFolder.mkdirs();
try {
playerFile.createNewFile();
YamlConfiguration playerConfig = YamlConfiguration.loadConfiguration(playerFile);
playerConfig.set("balance", 0);
playerConfig.isSet("balance");
playerConfig.save(playerFile);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}```
wait
idk why I added the isSet
do you only want to save the balance in there with idk the uuid?
because then why not just do it in the same file?
and set the uuid in there to the balance
databases be like
make a file called "balance"
uuid1: 10$
uuid2: 69$
databases are so goofy
how is it any better than just having a file for each player
i mean you would have to open way less files. Would definetly save you some space if you have many players
but to find one player's balance, it'd have to go through every single UUID in that file?
@EventHandler
public void get(PrepareItemCraftEvent e) {
CraftingInventory test = e.getInventory();
for (ItemStack item : test.getMatrix()) {
if (item.getType() == Material.PAPER){
test.setResult(null);
}
}
}``` how can i cast this error ?
no just get the balance set to that once uuid
no? you just call config#getInt() or getDouble
the matrix can have air in, check if the item is null or air and continue if it is
I still don't know how do that, I'm just happy with saving it to per-player files for now
what part of this makes it so that it isn't saved in the end?
i'm unsure
what u think ?
that hurts
if you were to use the code i send before you could for example:
ConfigUtil config = new ConfigUtil(plugin, "balance.yml");
config.getConfig().geInt(uuid);
π
i'm gonna use u
weyooo
for (ItemStack stack : test.getMatrix()) {
if (stack == null || stack.getType().isAir()) continue;
if (item.getType() == Material.PAPER) {
// do stuff
}
}
what did he say
im underage sir
so am i
xD
that's hot
im making an engine tho
like an AI
otherwise i wouldnt be over optimizing shit so much
for chess?
this bitwise fuckery is a pain
have fun with that
reminds me i need to implement A* pathfinding for my sheep
its kinda scuffed now, man just going places
never saw someone using that datatype
bit boards are pretty smart
i just realized though memory usage on the board instance doesnt matter
so if an array is faster i can just use that
https://github.com/patheloper/pathetic could take a look at this
then you havent looked at alot of code :)
or never touched java
long?
is sm1 used to intelliJ? I cant export my plugin (artifact)...
don't use pathethic pls
yh
its super useful
weird ass pathfinding will make your sheep fly
ive been using for a while now never seen someone use it nj
I mean it is pathetic
are you troll?
you use it for big numbers sir
you're just jealous of the sheep
waht doesnt work
did you know, you can switch the strategy
re: no
gradle or maven?
artifact so probally neither
i think i know his issue
gotta give my sheep wings then
he's trying to export his plugin as an artifact rather than using the literal build system to build it
skill issue
which is what I did and it didn't work for me, until I used the build system
the thing is that im primarly doing this in minestom but ye idk
y neither
use a build system, Maven or Gradle
okay did you set the correct location?
use a build system
i started without a build system too for first timers its better i believe so they dont get lost
when building it, the directories don't get created
dont include in build projects
if your a beginner you probably are above your head with a plugin
probably should fuck around with some basic java stuff
and move onto a build system asap
some people here only learn java for plugins
no
especially for beginners a plugin can be a good first project to learn from
i think so too
you just shouldnt only focus on plugin development
i think so too
because otherwise you get that "oh thats java" thought from spigot
I'd rather learn java while getting used to my build environment and plugin APIs rather than slowly burning out learning entire new concepts everytime you wanna try something else
Was my first project too, doesn't mean its for everyone, you should just always use a build system even if its overwhelming at first you don't even need ot understand it right away
I copy pasted my pom for the longest time, I still do now (its just cuz I'm lazy though)
idk why yall hate artifacts so much they work just fine for beginners xd
you were talking about java
I saw this in a video so I checked it
not a build system
so how to setup a build system?
?bing
Bing your question before asking it:
https://www.bing.com/
i'm gonna dm god cipher
create a knew project using maven or gradle i prefer maven
no gradle is better
they are annoying, don't allow shading easily, and are less straight forward e.g. you might end up getting access to non api like NMS right away even though it really shouldn't be exposed unless absolutely needed
(i have no idea what the difference is)
fuck gradle
YEAHH
i would
oh
good
weyoo
life long connection
gradle is 14
no matter how short that life is
i mean you will never forget that night for sure
what about maven
gradle's old enough for discord
double digets enough
I still have my question left unanswered man
it's no longer on the clock :/
π
holy quacamoly
what the fuck
is your chess racist
why can't I just use my current project?
yes
you can
Exporting the artifact wroked once for me, then it suddenly stopped working.
does it say gradle or maven in the top right?
right click it and enable {idk what keyword that is} support
as he said neither. You can create it using the intj builder
wait checking contains on a set and then adding??
where's that intj builder?
so many double checks everywhere
if player say /godmode:
give(player, godmode)```
the intj builder is artifacts but its well. It has its downsides
those are two different collections
python api fixed
I just wanna know why it's not working? π
isnt it even 15?
if you find anything weird lmk
no clue
(its getting worse)
well i suppose you dont wanna deal with switching rn so lets just fix artifacts first
well
now its getting better
well just some overhead here and there
yup not rly wanna bother about that
not bad
sm1 once explained me how everything works with intellij but i already forgot it π
okay so first: does it export and not load or not export at all
doesn't export at all, as already said.
yes I did.
lets do this the easy way just join my channel rq and screen share
self promo11111
weyo self promo
as if spigot dont have vcs
yh but im in a channel with someone else rn
dont wanna leave the poor guy
(he has no friends)
never ever saw someone use them tbh
you are not often here arent you?
sure..
(he's addicted to this discord)
seeing his name for the first time so
π
okay I dont know what I changed but now building does something
normally here at the middle of the night
the progress bar at bottom right corner is back when building
i hate bounds checks
but the file is still not extracting and I get an error code
what error code
?paste
still no exported file...
there is literally no classes folder
version is the plugin for
1.12.1
what java version u using
1.8
java 1.8?.
yeah
thats the old naming scheme
did you get an answer to this?
oh
whats the opposite of diagonal
ever heard of a for loop?
switch statement
for?
less ifs
straight
the performance is necessary
yeah but like a diagonal line is technically a straight line
so like you have lines that align with axis
parallel
how many millions of objects would you loop over to be concerned about the performance
yyh thats wrong select 8
its for a chess engine
still
IntelliJ strangely recommended me yesterday to install some weird sdks in a sort of message on top right corner
idk if you know but chess is pretty complicated
still
couple million possible moves after like 2 moves
well never sdks only work for never version of minecraftg
and you wont compute every
and still
Doesn't it make more sense to select a JDK instead of JRE?
then what do i use
you weight them
no i dont mean for the algorithm
^ that's how chess works
i mean as an alternative for the if statements
switch???
make a bunch of interfaces for each piece
lmao
a class for every possible move
List<Position> getValidMoves(ChessBoard board);
Doing this worked.
Thanks.
use oop to your advantage
It extracted now ^^
might as well be writing it in C if you want pure if checks
the OOP nature of java is a humongous disatvantage
but i cant be bothered to deal with memory
then don't use java
normally shit like that you do in python
dont
yes, do.
you would have to dig into machine learning for the chess engine
and there is python simply the best
oh yeah they just validate every move and pick one random
which artifact should I keep?
π
nah
for chess basically everything above python
fr
looks like you dont know what you are talking about
lmao
lmao
LMAO
stockfish, the best chess engine in the world, evaluates positions with a neural network
but still uses classical minimax at its core
with major optimizations of course
which is made with deep machine learning done in python
congrats
you just counter yourself
Guys, we all now that Scratch is the best language for Chess...
yeah not for running the fucking engine though??
the training is fine
- a classical evaluation function is more than enough for 3200+ rated chess
i would give you a big fat what emote if i would still boost this server
what would you guys consider static abuse
bro
stockfish is open source
its in C++
what can i say
nah stockfish is coded in scratch
how does that make python bad for running the engine lmao
because minimax in python would take years lmao
oh yeah minecraft is done in java so java is superior for games
Python is slower then @analog snow on heroin
fr
lmao
lmao
than*
what are you trying to say
java is faster
ur mom
than python
same
and i dont want to wait seconds between moves
for it to play
a mediocre move
i dont give a fuck about what is coded in java or in python java is objectively faster at most tasks
when I went from Eclipse to IntelliJ the encoding kind of changed. how can I revert it back? There was once a message on top right corner which told me to change encoding and it worked only for a while, now this message doesn't come up anymore.
python is good if you wanna do something quick (requests etc)
python: dev time good, performance bad
java: dev time mid, performance high-mid
C++: dev time pretty bad, performance highest
yep. Python is a greate language and has its highlights but it just works way to slow for stuff like this.
what about rust
oh no
i love python for shit like developement tools but i wont use it for a mf chess engine
c-- dev time suicide perfomce idk i will never be able to use it
btw is Rust coded in rust?
wasting less time writing header files
lmao i feel u
idk about u guys but i preferbly code in LolCode
And fixing errors because itβs compiler is so helpful
Yes they bootstrap their compiler
thx didn't know :D

@quaint mantle u know how to change encoding for entire project in IntelliJ?
the compiler is, the linker isnt
idk chat gpt seems to know
thats sad, would've been funny tbh
llvm code is compiled to assembly isnt it?
Too bad
I mean straight to machine code but basically
thats assembly

Assembly is the step before machine code
Itβs human readable
To a degree
Each instruction has a name
Most compilers skip that step
you're talking about the text representation now
well it controles the trade select xd
Afaik there is no event for when you actually complete the trade
Other than the InventoryClickEvent
theres also this
PlayerInteractAtEntityEvent event
and
Inventorey click event
yh thats what you need i think
how is it getting to this conclusion wtf
position 37 rank 8
wait rank 8 doesnt even exist
Hi everybody, I would ask if you know which videos or wich channel is a good one to learn spigot in 2023 ? i'm actually java everyday but I want start to code on Spigot
@quaint mantle exporting doesn't work anymore once again
I don't get it.
I got the correct export path and the correct java selected.
generated 3,160,412 move lists * 23 moves per list in one sec
idk how fast that is but 72,689,476 moves per sec sounds nice so lets go
send the new export error
no error.
you sure it doesnt just replace the file?
it doesn't.
hm okay thats weird
reload folder
doesn't help xd
that doesn't change anything. it would only remove deleted files when refreshing a folder
delete the file in the folder and try again
I deleted the entire dir. Nothing happens..
No progress bar appearing in bottom right corner
show me how you build it
2nd
how many classes in your plugin
why does that matter
wanna see if its worth transfering
33 classes
damn
- 2 files (plugin.yml + config.yml)
well
i would really recomend you to change to maven or gradle. It is way less trouble believe me
but kinda hard to move 33 classes i see
In this short video, I showcase how to add maven to an already existing java project while working in the Intellij IDEA.
My channel publishes videos regarding programming, software engineering especially Java and JavaFX. If that is what you are looking for then do not hesitate to join me on this journey!
Subscribe to my YouTube channel:
https:...
not sure if it will work
once you have maven
Itβs very easy to add maven or gradle to a project
At least in eclipse thereβs just a menu option for it
yh but wouldnt he have to manualy create the pom and add everything himself
there is in intj too but i never used it so i dont know how well that works
yh thats what i mean
well first
you need to add spigot to your pom
normally it will do that manually when you use a certain creator
not in this case tho
did it create a pom.xml for you?
yeah I got a pom.xml file in my project now
okay
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
add this repository
in the repository section
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
and this dependency
in the dependencies section
@young knoll did i forget anything?
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<artifactId>RPGPlugin</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
that's what I got currently
I have no dependencies section and no repos section
just add both below props?
now thats just what i copied from my plugin u are right
wait i will check what it is in your case
Only found it for 1.12.2
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
I assume it's
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
if you click this and it start downloading it works
new ui is weird
idk dont you have this button pop up?
new ui is much cleaner