#dev-general
1 messages · Page 196 of 1
Always has been
Always has been 
math & registers
Ha
you got me
Smh BM
Have*
were*
Always were been?
i'm tired
computers are purely logical, I’d be surprised if they were bad at it lol
always were been
@hot hull bruh what no, were you the impostor
shut it BM
Question: If Im making like a minigame in which both players get teleported to like a 3x3 cube, where should I make the 3x3 cube, because I wouldnt wanna just chuck it down where someones built or something by just using the players location
dumbo
Just open Maven
computers are purely logical, I’d be surprised if they were bad at it lol
@jovial warren
Lemmo, Always has were been yes
smh
@obtuse gale different world?
Void world
hm, I guess I could just make one minigame world and then do it all in there.....
That's usually the convention
I dont think its worth making a world per game
@obtuse gale different world?
dis good idea
Then you can just destroy the world once it's done
wouldn't do that ^
So folks
I mean the games only gonna go for like 1-2mins
😟
So is it worth making a new world per game?
1 world for all of the games I guess
just make an algorithm to determine a new place
yeah thats what im thinking
Just use a single world, and space the games out
Why would someone need more than 1 world for minigames
Or use packets so you have a single cube and trick the players to think it's multiple 
PerWorldPlugins > Bungee
PerEntityPlugins
PerPixelPlugins
PerPluginPlugins
percountryplugins
Racism
so should I just on enable if a world named x doesnt exist make it?
Like "master" branch
🙄
white discord theme is racist
Yes Aj, but you should also be removing the world when the plugin shuts down
oki
also should I be doing this kinda stuff in the main class or does that break srp or whatever
diff class
what would one call that class lol
well first split it all up into lil parts
WorldManager?
and then think about the names
like what goes into this
you have to manage arena's and determine where each arena goes
AbstractSimpleWorldManagerHandler
etc
Like "master" branch
I mean, there are worse things, think about the master-slave model for example, if you really consider that racist
Ngl that was just some idiots having too much time..
way too controversial topic to talk about tbh
Rust vs Java
anyone know how to make a void world lol?
void world() {
}
Rust with JNI
What a comek Niall
@heady birch let's make rustmc
He asked for void world
Maybe
But none of this map() stuff
I dont like that part of rust
WorldCreator creator = new WorldCreator("world");
creator.generator(new ChunkGenerator() {
@Override
public byte[] generate(World world, Random random, int x, int z) {
return new byte[32768]; //Empty byte array
}
});
World world = creator.createWorld();``` found this online, guess ill give it a go...
Damn ..
is that bad?
I dont think that method even exists anymore...
You generated 10000 chunks
that method doesnt even exist lol
Isnt the method used only for new chunks?
No idea
apparently this might work
creator.generator(object : ChunkGenerator(){
override fun generateChunkData(world: World, random: Random, x: Int, z: Int, biome: BiomeGrid): ChunkData {
return createChunkData(world)
}
})
creator.createWorld()```
Also the value 32768 means what? Because 16x16x256 equals 64k
just return null lol 🙂
well
Just loop through it and set it to air
actually

it depends on the jvm if it'll use 0.03mb or not
Pretty sure there is a method
class WorldManager {
fun createWorld() {
if (Bukkit.getWorld("mapgames") != null) return
val creator = WorldCreator("mapgames")
creator.generator(object : ChunkGenerator() {
override fun generateChunkData(world: World, random: Random, x: Int, z: Int, biome: BiomeGrid): ChunkData {
return createChunkData(world)
}
})
creator.createWorld()
}
fun deleteWorld() =
Bukkit.getWorldContainer().resolve("mapgames").delete()
}```
Also could these methods be like static? If no why not? I only call them onEnable and disable
object
like the class?
yes
what is object : ChunkGenertor
Mhm
it’s an anonymous object
class Mapgames : JavaPlugin() {
companion object {
var debug: Boolean = true
}
override fun onEnable() {
/* PDMBuilder(this).build().loadAllDependencies().join()*/
"Loaded dependencies".print()
debug = this.config.getBoolean("debug")
CommandHandler.registerCommands(this)
"Loaded commands".print()
WorldManager.createWorld()
"Loaded world"
"Plugin fully loaded".print()
}
override fun onDisable() {
WorldManager.deleteWorld()
"Deleted world"
}
}``` hows this
companion object at the top ew
Because my hotswapping wasnt working so i removed pdm and it still didnt work and I just havent added it back in
add it back in now 🙂
thats an option
what?
Debug should have a private setter
how
private set
like literally just that?
yes
var debug: Boolean = true
private set```
yes?
it loads the chunk async
teleportAsync is only from paper iirc
so should I use it?
depends
if I were you and creating your cubes I'd already load the chunks
and since teleporting to your cubes you know they'll be loaded already so no need to use the async method
I mean is there a downside to it?
to what
It's only on paper for one thing
I wouldn't use it for this usage since then I'd have to ugly with completable future
and Iknow it won't need to do so
^
Was about to say that
You'd need a messy callback system
suspend fun teleport(to: Location, callback: () -> Unit)
teleport
obligatory /s
mf-cmd just started throwing me NPEs 😦
Scary
me.mattstudios.mf.base.CommandHandler.tabComplete(CommandHandler.java:306) what is line 306
Also wrong channel
at org.bukkit.craftbukkit.v1_16_R2
I saw that, im on a 1.16.3 server
306 is this final Method completionMethod = subCommand.getCompletionMethod();
so subCommand is null
find out
smh
fun deleteWorld() =
Bukkit.getWorldContainer().resolve("mapgames").delete()``` this no work 😦
MaGiC vAlUeS eee
this didnt work either
fun deleteWorld(){
Bukkit.unloadWorld("mapgames", false)
Bukkit.getWorldContainer().resolve("mapgames").delete()
}```
@steel heart
That annotation just tells the IDE that that interface is supposed to be a functional interface and thus should only contain exactly one function to be implemented
@old wyvern I’m aware of that but else there is no other functionality of the annotation
?
You can convert any interface with 1 method to a lambda
The annotation isn't necessary
Don't think so
Hmm okay
sure a library might use reflection with the annotation
but it's only default use is just to show it's a functional interface and shouldn't have more than 1 method
Yeah, so mainly to explicitly tell anyone it’s a functional interface
mhm
fun deleteWorld(){
Bukkit.unloadWorld("mapgames", false)
Bukkit.getWorld("mapgames")?.worldFolder?.delete()
}
``` rEE this no work 😢 😢 🤣 😦 😦
Turns out delete doesnt work on folders :/
fun deleteWorld() {
val world = Bukkit.getWorld("mapgames")
if(world == null){
"shit".debug()
return
}
world.worldFolder.deleteRecursively()
}``` this should work but it doesnt 
What would make the most sense to use for statistics and a building menu,
I was thinking of having a normal menu for statistics where the user could freely interact with them, and the having a book which would list all the unlocked "blueprints" as well as show the locked ones and their required cost. Then once you'd select a blueprint it would give you a map with an image of the blueprint which you could then somehow place down (if you had all the required materials, still not sure how that would work but it's still far away)
Open for ideas 
Niall imma smack your 4head
When you dont give us a stacktrace how can we help?
Bruh not this shit again
how do i transfer %player_server% to the server expansion?
You can't
then why doesnt %player_server% work?
Do you have the player expansion installed?
yes
(I pinged you in #placeholder-api since this isn't the right channel)
What would make the most sense to use for statistics and a building menu,
I was thinking of having a normal menu for statistics where the user could freely interact with them, and the having a book which would list all the unlocked "blueprints" as well as show the locked ones and their required cost. Then once you'd select a blueprint it would give you a map with an image of the blueprint which you could then somehow place down (if you had all the required materials, still not sure how that would work but it's still far away)
Since chat got flooded with nonsense
So what kind of layout for a the GUIs
Was just thinking the good old
A way I’d do it would be to split the blueprints up into generalised categories (themes, sizes) and have it so you can freely click them to gain the placeholder items of the blueprints
Basically a preview or?
You can't force a block to have a different texture (even if it's another blocks texture) without a RP right?
Cause I was thinking that when you'd place the blueprint down it would build it with lime glass
So you could see if it suits the location, and then if you have all the materials you could build it
You could use the player ghost block feature forgot what the method is
But it just shows up blocks for one player
Well but stairs would be cucked, cause you couldn't see if it was built or not
Just have a action bar telling them it’s a preview?
And if they try and break a block or something you could also display that message
any idea what could make my theme not work properly? https://i.imgur.com/tzyB3j6.png
is basically the default Material Oceanic theme
just doesnt like stuff that starts with i lol
😡
Dont you have to unload it?
Guess you will have to use schematics or smth
I mean I dont necessarily need to delete the world
lol Bukkit.unloadWorld worked
¯_(ツ)_/¯
If im making a plugin that has multiple games should I have like an interface for game or something? I dont think ive ever used an interface/abstract class in a plugin before lol
Probably yeah
What would that consist of?
Aren't you working on spring projects 😦 ?
naaa
@oak coyote Trynna recreate something with this, so trynna follow the mechanics, otherwise that'd be good yea
How would you guys handle the arenas and their location in relevancy to the game
Like if the arena is say a 3x3 box (not for every game, size varies), how would you connect that to the game
Wdym?
im confusing myself here lol
Cos im tryna keep things as general as possible since im gonna have multiple game implementations
So
Can a game have multiple arenas?
No, but there will be multiple games going at once
I see
I would say keep arenas seperatley
I think it makes sense for the Arena to reference the Game
Arena.startGame(Game game);
right
then in the games start method I need access to the arena tho
Since the game has stuff like player interact event, and I need to get the location of that, and get the game based off the location
oh wait
I can just get it from the player cant I
would you maybe have this has the game start method or is this a weird way to do it?
interface Game {
fun start(playerOne:Player, playerTwo:Player)```
actually wait that doesnt make sense
im confusing myself more now lol
class Game {
void start(final Arena arena) {
//do some stuff
}
}
Game sounds like it should be stateful maybe
As in have a lifetime the same as the game duration
Instead of existing through multiple games
new DuelGame(playerOne, playerTwo).start(arenaOne);
Map.of exist on java 9 I believe
Can I make a kotlin extension that like overrides the normal method but changes it? for example
fun Player.sendMessage(text:String){
// Do something to the message
this.sendMessage(editedMessage)
}```
Yes
What does the fun type do in Kotlin?
Method
no return type?
oh ait
fn to_string() -> String {}
java devs: man im so proud of my work of java art
kotlin devs in the background: java man, java man
Rust users:
Who?
If I have an enum whats the best way to store the type of game it should be?
Like I want the enum to hold the game type, and from that type I can make a new instance of the class that implements Game
In that case, Make an enum with all the game types
And pass that enum to the constructor for that class
Supplier<? extends Game>?
pub enum Game {
GameTypeOne {
}
}
^ probably better (above that one)
tf is a supplier
it supllies
class GameType {
TYPE (YourGameImplementation::new)
}
also tf is ? extends Game in kotlin, wouldnt it be like <idk : Game> or something liek that?
also, @obtuse gale , what is this for anyway?
im making like a game plugin thing
and im confusing myslef
so this works
val game:Supplier<out Game> but it also works with in not out, whats the difference?'
only tic tac toe atm, and I havent even started making the game itself
just to supply generic methods (like player maxes, etc.)
Game is an interface that has a prepare() method and start() method
YourGameImplementation::new whats this in kotlin lol
kotlin doesnt have method refference?
probably does but YourGameImplementation::new aint working
that's the alternative for () -> new ClassName()
I have that
unless theres a specific purpose for the enum
the enum just contains basic information about the game,
i would just use is/instanceof (wait are you writing it in kotlin or java?)
kot
k
basic information
metadata?
that's the alternative for () -> new ClassName()
lol I never went that far in java to know what that was
method refference, usually used when the method has all params provided by the lambda in the right order
(name, age) -> new Person(name, age) can be replaced by Person::new
Imma just copy & paste do this in java, then get IJ to convert it for me lol
Java --> Kotlin is decently good
but the cleanup isnt worth it if you're tryna initially make it in kotlin
Wait are we tryna use a consumer or a Supplier lol
Cos I typed this
enum Test{
ONE(GameImpl::new);
}``` and IJs consuctor generated a consumer lol
oh wait
nope ignore me
well, use a consumer if you need to pass a value 🤷
GameTypeRegistry {
Map<String, GameType<?>>
}
GameType<T> {
String getName();
String getDescription();
GameFactory<T> getFactory();
}
GameFactory<T extends Game> {
T create();
}
@obtuse gale Show your code
fixed it :))
It was just me being dumb and not putting a @Default command lol, if this is in reference to the npe from earlier
Yeah
so kotlin doesn't use equals() ?
No it uses ==
noice
====
Ok real talk here (no circlejerking)
If I wanted to make my own calculator (hypothetically ofc), would Rust be a good option? Or would C / something else be better
Like an actual physical calculator running on a Pi or something
asm boi
Supplier<Game> { TicTacToe() }
@obtuse gale::TicTacToe
o
@frigid badge sounds scary
yes but also fun
something big wouldn't be made in asm
maybe parts of it would if it were critical
but otherwise I'd all just be c
java
i remember someone saying that yea
rust excels at certain stuff and so does c
but I'd compare c++ with rust rather than c
afaik yeah
it just depends on what you write I'd suppose
but that's for every language really
but I'm by no means an expert in, c, c++ or rust
so your best bet is googling the stuff for factual data.
Ok real talk here (no circlejerking)
If I wanted to make my own calculator (hypothetically ofc), would Rust be a good option? Or would C / something else be better
Oh look
After all those months of saying rust is bad
Ironic
😅
lmao
unless im missing an obvious point here, i dont see the need to compare performance from languages that compile, theyre all gonna be fast enough, especially for the program u wanna make
Depends on compiler
and what you compile to
yea obvious exception being java
java is a compiled language too
Well the last point is true
so is c# etc
Yea
Id love to write something in assembly one day
lemmo knows assembly iirc
So cool
unless im missing an obvious point here, i dont see the need to compare performance from languages that compile, theyre all gonna be fast enough, especially for the program u wanna make
@onyx loom for something like this though you need every optimisation you can get
Like I bet JIT cant optimize any of those stupid .map.filter.collect functional things
ColdSpot
So, lets try do be a app manager at the Senior
that knows kotlin
They done a inspection
and I fail with this message: "Must use Java"
That do you folks think about that?
The problem is that they don't have a application manager that knows Kotlin
I'm appling that help, but, who knows if they will accept me
Or just switch to rust 🙂
I like rust
But I don't use C or C++
In this case....
I really want to try a little of Goroutines
I want to know the different that does when the Runtime it self uses green threads
Goroutines ez
@prisma wave do you know the benefits from Goroutines vs Coroutines from Kotlin?
Goroutines are simpler
where can i get help with the plugin?
what plugin
DeluxeMenu
thx
@prisma wave do you mean the use of Goroutines, right?
because they don't have blue/red functions
Yeah
@quiet depot So I've configured a root project that has my lib and my plugin projects imported as independent modules. When I edit the lib that is used as a dependency by the plugin and re-build the root project, IntelliJ recognizes there are changed classes and lets me reload them at runtime using the hotswap agent. The agent says the hotswap is successful but in the execution, nothing actually changes. It seems so close to working but it won't work after all.
This is the only clue in the console when the hotswap happens:
[17:08:16] [JDWP Transport Listener: dt_socket/INFO]: HOTSWAP AGENT: 17:08:16.368 RELOAD (org.hotswap.agent.plugin.jvm.AnonymousClassPatchPlugin) - Class 'me/blocky/core/plugin/command/BlockyCommand' has been enhanced with anonymous classes for hotswap.
Got any ideas?
are you shading/relocating by any chance?
No I disabled all the shading
Sorry for sending it here, but is someone experienced enough to help me make a spigot plugin?
Like, not code wise
But since i am new to releasing my stuff on spigot, i won't mind someone with experience teaming up with me to release some stuff
I'm fine with whatever
just to get the hang of it
what
what indeed
Like, i know i am asking something unreasonable
But i was looking for someone to develop and release a plugin on spigot, to understand how the deploy process works
#750658587767996486 I guess
ait
@high violet just create a new resource and upload the jar then like add a description if you want
@high violet It gives you all the info you need when clicking Post Resource or whatever the button is called
Ait
was also interested if any specific code is needed in the plugin for like, update and stuff
If someone has any links feel free to share them
Update checkers are annoying af, don't be that guy 
I'm awful at programming so my stuff will be full of bugs 🙃
So >bugfix
bugfix
bugfix
I mean OS usually helps with this since others can give you advice on what to improve
Update checkers are annoying af, don't be that guy
Update checkers are okay, auto updaters on the other hand....... don't.. just don't auto update
It shouldn't exist
Nah update checkers are doodoo as well, especially when they make it so they don't run async, and you can't disable them, that's just ew in every way
Well I mean if it's worst case scenario yes of course
But make it show in console every once in a while, async and a setting for it to not run
Like Vault basically lol
Lowkey if the user isn't willing to check spigot atleast once a week that's just sad
I rely on spigot/dbo sending me an email for updates lol
Jesus
Nah update checkers are doodoo as well, especially when they make it so they don't run async, and you can't disable them, that's just ew in every way
I mean that's on the dev, the dev is doodooo not update checkers themselves, those are fine if you make them well
Well yea, but you know what I mean Matt, it is spigot afterall
Jesus
Hey it's been working perfectly for my needs ¯_(ツ)_/¯
I mean, even Microsoft uses auto updates for Windows
I can get behind auto updates for security updates, but brah windows be like download 10GB of "cumulative updates" and I'll never know what the fook they bring
If I ever make auto updates I'm going to make sure it kicks everyone on the server and doesnt let them on for the next hour
Just to fix a typo 🙂
I mean, even Microsoft uses auto updates for Windows
You're comparing a huge company with a small dev, you choose who's more trustworthy lol
The smaller dev 
You're comparing a huge company with a small dev, you choose who's more trustworthy lol
matt
I agree with that
Bruh I got so good ideas for a plugin I'm working on, but don't got time cuz I gotta study, fuck school 
on Windows for the first time in ages lol
(had to setup dual booting because of Roblox lol)
because Roblox doesn't support Linux any more
and Roblox has games that are actually half decent believe it or not
it's so weird being on Windows though after getting used to AL for some time
roblox 
ew
What makes sense in a way that a user can view their statistics (health, stamina, etc), a normal ass menu or anyone got any fancy ideas?
yea a single row gui I guess
There's 11 stats
That'd look hella odd imo
But I feel like singlular row would look fancier
Would a book make sense, or perhaps even a map which has drawn shit on it?
Yea I guess map works
Could perhaps do bossbar with symbols, but that could get confused as hell
yo just to clarify... you can't use bukkit/spigot/paper plugins in modpack servers using sponge (or anything else) right? You gotta learn & use the (for ex.) sponge api.. right?
Indeed
Let's make a sponge plugin to run spigot ones 
🤔
enum class RobotType(private val texture: String, val displayName: String) {
MONEY(
"aaa",
"Money"
),
TOKENS(
"bbb",
"Tokens"
)
}```
How do I add a `skull: ItemStack` variable here? It will be generated using the texture of each enum entry
ah, you need a semicolon
yea
@ocean quartz SEE!!! COLI WAS NOT WORTHLESS
but coli dead 🙂
fu too
@prisma wave can I do more stuff on the elvis operator right side or only one thing like "return"
1 expression
aight
or a return statement
ye figured I don't need more than 1
You should never be hardcoding an NPE into your code
in kotlin or java
Personally the only time I consider it acceptable to use is if it will never be null, but the compiler can't tell
I use it here
val skull: ItemStack = ItemBuilder.from(XMaterial.PLAYER_HEAD.parseItem()!!).setSkullTexture(texture).build()```
why
parseItem is nullable for a reason?
although actually I guess every version has PLAYER_HEAD
I guess that's fine then
@distant sun COLI HAS USES BUT NOT WHERE YOU WANTED!
😡
Coli?
Ok
It's a semicolon Frosty
anybody got some code to set the facing direction of an entity based of the direction of a player, but only on N S E W and not NE / NW / SE / SW
@ocean quartz oh..
Just / 90? @distant sun
Anyone interested in a web-based ticketing system
Ok
will leave it for now fehfo
can you override functions using extensions in kt?
I want my own Location#serialize / Location#deserialize
😦
just use a different name?
yea
gonna have to name it Location#lolnicetryiloveobfuscation now
@prisma wave is Elara an actual language now?
in kotlin if i have something like event: Class<out Event>, as a method parameter is there a way to get the exact type of event provided?
event is x ?
event can be any event the user provides
its for an event waiter im trying to make
well yea but I don't think you can check the event type in another way 
so i wanna be able to do something like turn the generic event into like PlayerDeathEvent or something depending on what it is
or if there's a different way im open to that too. im just trying to take the event class that they are providing right now and then listen for that but i need to get an exact event not a generic one from that parameter
nvm figured it out
show us
@frigid badge Do you by any chance know anything about jFrog artifactory?
got it working
@distant sun its not tested really but in theory it should work at least it think so lol
this is what i came up with https://paste.jaims.dev/qavuhopewo.coffeescript
i think i need to make it blocking somehow maybe with coroutines but thats next
but the idea is you can handle your events inside commands without making a list of players that are waiting and cooldowns and such
Interesting
my intellij is building things fine with gradle, but in files where i use my dependencies, it says they don't exist. they are in the jar, and i've never been more confused
ive restarted intellij, my pc, invalidated caches, etc
anyone have any ideas?
why does this happen when i press tab
@org.bukkit.event.EventHandler
im trying to do @EventHandler
.. well rip James
ah ur right
lmao dkim
im literally so confused. i've never seen something build before while having visual errors about the thing not existing in intellij
^ lol I don't understand any of that code 😛
lol thats so weird james
yea its really annoying lmao
i might ask stackoverflow and see if they know
but i also will probably get told im stupid
good ol' stackoverflow
I know i've asked this before, but where do I get these? (I'll bookmark the site this time 🙂 )
ah thanks!
thats where i get mine
ye thats what someone told me earlier on this discord server
hmmm
flat vs plastic
xD
why
Error:(15,55) java: incompatible types: net.neednot.listeners.Dupe cannot be converted to org.bukkit.event.Listener
getServer().getPluginManager().registerEvents(new Dupe(), this);
im making a dupe plugin
does Dupe implement Listener
lol
lol
class DupeListener implements EventHandler {
@Listener
public void onEvent(SomeEvent e) {
System.out.println("I am professional programmore");
}
}```
:)

https://stackoverflow.com/questions/64019457/intellij-kotlin-visual-unresolved-reference-bug go answer my question :)
Lmao you got it the way around implementing EventHandler and annotating Listener xD
Oh didn't read everything xD
lmao
Now to work out how to connect arenas to games
Since each arena is a different sized cube
I could try and store the bottom left & top right co ord I guess....
or I could just store the size and the centre block
guys
ny friend
said they have mc server
with no paper
and iasked what
and they said custom server jar
can you do that xd
but like
what is there to imporve
that paper devs havent already?
they said all this
Then yeah that lol
All of those are already on paper/tuinity lol
Most (if not all) of the custom server jars people sell are nothing special compared to paper
After all, they are open-sourced
If they are so much better than paper, might as well PR it
how can i detect when a player is in an inventory such as a chest or their own
i need to to determine if the player dropped an item using Q or threw it out of their inventory or chest or whatever
First one, when they click on the inventory you can check if it's player inventory or chest and things like that
Second, i don't think you can, i could be wrong but i don't think so
yeah so im going to use knowing if their in an inventory to know what kind of drop it is
what even is it for the inventories
The event gives you all the required info
Well have you checked the events methods?
@hot hull i can't find anything about it
@fluid walrus None, use Velocity instead
i dont know how hard it would be to check which slot the item came from
i could just do a check to see if the hand and slot are equal and boom problem solved
So with my game plugin, each game is gonna have an arena, how can I make it so that each class that implements Game has to have an arena? Can I just make a val in the interface? Is that how it works lol?
interface Game {
val arena: Arena
}
Now it's forced to implement it and can't be null
actually
mm, I was thinking of just having the arena size in teh class, and then the class that handles the game can handle making the arena and stuff
interface Game {
val arenaSize: Int
fun start(playerOne: Player, playerTwo: Player)
fun prepareArena()
}```
its just handling the arenas location that im unsure about, since each arena is a different size
Whats the best way to determine where the arena goes? Each should be like 100 blocks away from the last
Aj, your spacing :((
better?
, its just I am unsure what the best way to go about spacing them is, they probably need to be like 100 blocks apart, so whats the best way to space them out? Obviously I could just add like 100 to a location for every arena but then its just gonna be a straight line, and id rather its like a grid kinda thing...
I mean I doubt it will ever get to that scale so idk if its worth it
I could just do somethbing like this and screw having a grid system
private val lastLocation = Location(Bukkit.getWorld("minigames"), 0.0, 0.0, 0.0)
fun getNextLocation():Location{
val loc = lastLocation
lastLocation.add(100.0, 0.0, 100.0)
return loc
}```
That would probably make it like
X
X
X
X``` Id prefer if it was
X X X X
X X X X
X X X X``` But I mean I guess eithers fine, I dont think it will ever get to the scale where it will become an issue....
imma just do a straight line
she'll be right
@prisma wave is
Elaraan actual language now?
@lavish notch not exactly but kind of
It doesn't run yet but it's like 50% ready
what's it based off?
assembly
String builder
why is x & z always 0 even when arenaAmount
private var arenaAmount = 0
private val x = 100 * (arenaAmount % 50).toDouble()
private val z = 100 * (arenaAmount / 50).toDouble()```
even when arenaAmount goes up they are still both 0
ohh
right
how come this always makes one at 0 100 0 then
class ArenaManager {
private var arenaAmount = 0
private val x
get() = 100.0 * (arenaAmount % 50.0)
private val z
get() = 100.0 * (arenaAmount / 50.0)
private val location
get() = Location(Bukkit.getWorld("mapgames"), x, 100.0, z)
fun createArena(game: Game) {
x.debug()
z.debug()
arenaAmount.debug()
ArenaCreator.createHollowCube(location, game.arenaSize, game.material)
arenaAmount++
}
}```
it doesnt print 0 0 0 tho
Whats the output?
First time its called its
0.0
0.0
0
Second time its
100.0
2.0
1
Third time its
200.0
4.0
2
imma try a different approach other than this random guys code lol
Thats seems to be right?
yeah but the location is always 0.0 100 0.0
Have you tried printing it out in the same place?
yea?
The arenas were always being placed in the right spots.... I just had this hard coded in
playerOne.teleport(Location(Bukkit.getWorld("mapgames"), 0.0, 100.0, 0.0))
absolute trash
https://github.com/IridiumLLC/IridiumSkyblock/blob/master/src/main/java/com/iridium/iridiumskyblock/Island.java but idk i think this is up here
1k lines long and uses lombok
M8
why tf do you have getters and setters in kotlin
😂
oh wait nvm
actually yea
xD
What happened here xD
Listen
That's all deleted now
Also it was in Java
then i just ctrl + alt + shift + k it
and got it in kotlin
It should normally convert them to properties

https://github.com/Oribuin/Skyblock/blob/kotlin/src/main/kotlin/xyz/oribuin/skyblock/island/Island.kt this is mine
imagine using github white theme
https://github-readme-stats.vercel.app/api?username=oribuin&show_icons=true&theme=tokyonight
Nice
Petition to integrate this into barry
Well looking at Ori's page it looks as if it's an image
I expect its dependent on the content type you request
Looking for a way to fill all the walls of this cube with maps
except the highlighted ones, those have maps with a different pattern
And I only have the centre block of this cube
gl😂
yeaaaa
Actually I could probably just do it when I make the cube in the first place....
fun createHollowCube(location: Location, size:Int, material: Material) {
val firstLocation = location.clone()
for (x in -size..size) {
for (y in -size..size) {
for (z in -size..size) {
if (abs(x) != size && abs(y) != size && abs(z) != size) continue
val loc = firstLocation.add(x.toDouble(), y.toDouble(), z.toDouble())
loc.block.type = material
loc.subtract(x.toDouble(), y.toDouble(), z.toDouble())
}
}
}
}```
This is the logic I have to make the cube...
pain
im thinking i could do something
it might work and it might not
the corners might fuck me over :)(:
I had the genius idea of forking IridiumSkyblock and then changing the source code for someone's server im working on
and then I looked at iridium's source code
and i wanna throw up
Your trying to make hollow cube?
so i made it bearable by using kotlin, pain
Personally I would do the sides instead of a full cube and continue on the hollow parts
only pain
I was thinking I could maybe just check if the block relative to one side was air, then if it was set it to an itemframe, and that would cover me for one side
The way your doing now probably works fine to be honest
well how do I go about the item frames
Might fare worse as the volume of the cube increases
thasts the hard bit
What do you want to do with item frames?
put an item in them
I thouigth I could chuck this in teh loop and hope for the best
if(loc.block.getRelative(BlockFace.WEST).type == Material.AIR || loc.block.getRelative(BlockFace.WEST).type == Material.ITEM_FRAME){
"mm".debug()
loc.block.getRelative(BlockFace.WEST)
}``` and that would cover me for one side, that prints `mm` once, then throws me an `IllegalArgumentException: Cannot get data for not block ITEM_FRAME`
So annoying because you have to set 3 frames in corners
Wont that cause lag for players if are too many?
Iirc banners do
5 left
3 more now
we got some popping off the wall as well for some reason
also this has gotta be the messiest code if ever typed btw
I did it
anyone prepared for the code?
=paste
Please use a paste service to share configs, errors, code and long logs.
• HelpChat Paste
https://paste.helpch.at/sezufikitu.rb 😳 someone tell me how to make this better please
set of BlockFace ?
val faces = setOf(BlockFace.UP, BlockFace.DOWN, ...)
//
faces.asSequence()
.filter { loc.bloc.getRelative(it).type == Material.AIR || loc.bloc.getRelative(it).type == Material.ITEM_FRAME }
.forEach { spawn the frame }```
Please use a paste service to share configs, errors, code and long logs.
• HelpChat Paste
How come this works:
https://paste.helpch.at/asanejifaf.cpp
But this throws an IllegalArgumentException: Cannot spawn hanging entity for org.bukkit.entity.ItemFrame at Location{world=CraftWorld{name=mapgames},x=0.0,y=96.0,z=-3.0,pitch=0.0,yaw=0.0} (no free face)
Why are you not
should the yaw and pitch be 0?
@obtuse gale
don't you have to set the itemframe facing the opposite direction?
if the block in west is air the frame should face east I think
how come it works without the renderer tho
eyy
got it working
now I just gotta work out why a shit ton of maps/itemframes spawn on the ground
damn what for minigame you making lol
what have you changed?
I just added a check
he's making heaven or smth
if(loc.block.getRelative(it).type != Material.AIR) return@forEach
:))
paint 3d
how to make a greenscreen in minecraft
I want to make somethink like market gui where players can sell own items, how can i save items in array or something that they stay even after server restart?
base64 I guess
Now my options are
A) Work out whats causing the items to pop off and leave a bunch of item frames/maps on the ground orrrr
B) Just kill all the item entities and be lazy
A
sounds like effort to me
=paste
Please use a paste service to share configs, errors, code and long logs.
• HelpChat Paste
@misty coral https://gist.github.com/graywolf336/8153678
thanks
@frigid badge General question
For a database
Is it best to use a seperate table for something simple as UserStatus
e.g
UserStatus.APPROVED
To be
user_status
id name
0 "approved'
fun createHollowCube(location: Location, size: Int, map: ItemStack) {
val firstLocation = location.clone()
val renderer = ImageRenderer.createSingleColorRenderer(Color.WHITE)
val map = MapBuilder.create()
.world(Bukkit.getWorld("mapgames"))
.addRenderers(renderer)
.build().createItemStack()
for (x in -size..size) {
for (y in -size..size) {
for (z in -size..size) {
if (abs(x) != size && abs(y) != size && abs(z) != size) continue
val loc = firstLocation.add(x.toDouble(), y.toDouble(), z.toDouble())
loc.block.type = Material.SEA_LANTERN
faces.filter { loc.block.getRelative(it).type == Material.AIR }.forEach {
if(loc.block.getRelative(it).type != Material.AIR) return@forEach
location.world.spawn(loc.block.getRelative(it).location, ItemFrame::class.java) { itemFrame ->
itemFrame.setFacingDirection(it, false)
itemFrame.setItem(map)
}
}
loc.subtract(x.toDouble(), y.toDouble(), z.toDouble())
}
}
}
}```
halp this makes a crap ton of item frames/maps go onto the ground
how can stop
I also just realised my method of spawning itemframes covers the outside as well....
XD
depth perception is so weird in here....
like that door looks really far away but its only like 4 blocks
interface Game {
val players:Pair<Player, Player>
}``` vs
```kotlin
interface Game {
val playerOne:Player,
val playerTwo:Player
}```
what?
the map room? Ive seen it in another discord server before lol, havent seen it used for minigames tho, I feel like it might lag some people....

lol
fun createHollowCube(location: Location, size: Int, map: ItemStack) {
val firstLocation = location.clone()
val renderer = ImageRenderer.createSingleColorRenderer(Color.WHITE)
val map = MapBuilder.create()
.world(Bukkit.getWorld("mapgames"))
.addRenderers(renderer)
.build().createItemStack()
for (x in -size..size) {
for (y in -size..size) {
for (z in -size..size) {
if (abs(x) != size && abs(y) != size && abs(z) != size) continue
val loc = firstLocation.add(x.toDouble(), y.toDouble(), z.toDouble())
loc.block.type = Material.SEA_LANTERN
faces.filter { loc.block.getRelative(it).type == Material.AIR }.forEach {
if(loc.block.getRelative(it).type != Material.AIR) return@forEach
location.world.spawn(loc.block.getRelative(it).location, ItemFrame::class.java) { itemFrame ->
itemFrame.setFacingDirection(it, false)
itemFrame.setItem(map)
}
}
loc.subtract(x.toDouble(), y.toDouble(), z.toDouble())
}
}
}
}
Ive got this and it makes the cube, and fills it with maps and item frames, but it also covers the outside, and a bunch of item frames like pop off and just fall on the floor
But I suck at maths and stuff like this, anyone got any ideas how i can make it not cover the outside and make them not pop off?
they are placed on the outside because you check the relatives of the wall
right so how would I not do that lol
I just ask nicely to my code
what about another loop inside the cube?
hmm
I dont think it would be that easy since you place the frame on the wall, don't you?
well
To place the itemframe you need to spawn it in since its an entity
Which means you need the facing direction + the location
yeah, it’s a bit like spawning a painting
what are you trying to do?
if the statuses are changeable sure but I'd name it either statuses or user_statuses due to convention
@heady birch
By changeable
what are you trying to do?
@jovial warren spawn a box of x radius around a centre block, with item frames with maps in them on the inside only
Do you mean statuses may be added/removed
“statuses”
👌 top quality English xD
yes
Considering spring, its alot of boiler plate
I dont expect it to change really
1 enum compared to 3 classes 😄
$tatu$
yes hence why you wouldn't name it that lol
actually according to dictionaries, both “statuses” and just “status” are valid plurals of “status”
I thought it was status'
Pagination is fun
statii
sooo
statii
that was one that was explicitly mentioned as being wrong
🙁
anyone know what to do about my map/itemframe problem?
I thought it was
status'
that’s literally just a contraction from “statuses”
I think its statoos
anyone know what to do about my map/itemframe problem?
explain thy problem to me
I think its statoos
that’s how it’s pronounced, according to some sources, not how it’s spelt
explain thy problem to me
thy problame is as follows: https://discordapp.com/channels/164280494874165248/695431668944732270/758295593188982784
Ya know spring property configurations
wdym it “covers the outside”
Can you set the values programatically and expect spring to save it to file?
Wouldn t be suprised if its capable of that
wat niall?
wdym it “covers the outside”
https://cdn.discordapp.com/attachments/695431668944732270/758277065497378816/unknown.png
thats the outside of the 5X5 cube
The outside doesnt need covering
ah okay
couldn't we make new blocks by just y'know covering them with itemframes
;p
rainbow block
kinda
Just use vector to check direction opposite to outside
how would one do that lol
also, if only Kotlin had something like this for for loops: ```kotlin
for (x, y, z in -size..size)
vf - vi
center - current location
Is modulus of that is +
You are facing inwards
Move that direction
And check for air and stuff
none of those words make sense to me....
ok one sec let me write thus down a bit more explanatively
vf-vi? you talking about final velocity - initial velocity?
final vector in this case my guy
like, that old school science equation used to calculate acceleration?
A direction vector is final positional vector - initial positional vector
like that old school science equation used to calculate acceleration
No that would just be relative velocity if in that context
Acceleration is velocity per unit time
also like when I say some itemframes/maps pop off from somewhere, I dont mean like a few, like a get a few stacks from that
Its varies why? ATM its just 2, but in future it will be more
that gives us a 5*5 inside the cube
actually no
atm its 3
no no no no no
which gives us that internal 5X5
I know what it is
the z loop will loop 5 times for every time the y loop loops, which will loop 5 times for every time the x loop loops
meaning that inner code is ran 5x5x5=125 times
Assume center = (cx,xy,cz)
current_position = (x1,y1,z1)
trying to find inward direction:
inward_direction = (center - current_position) with sigma function applied to each coords
block_to_check = current_position + inward_direction
the only location I have is the centre btw
Like I have to base the entire thing off that
What about the position you are iterating off to place the block?

