game-design-driven / Create-Prepare-to-Dye

Create: Prepare to Dye an opinionated, minimalistic modpack centered around complex and interesting automation.
GNU General Public License v3.0
24 stars 19 forks source link

Extract settings with java mod #466

Open Discord-Github-Bridge opened 6 months ago

Discord-Github-Bridge commented 6 months ago

minecraft.getMinecraft().gamesettings as a variable that can be accessed in kubejs (even write to a file and read with kubejs)

Discord-Github-Bridge commented 6 months ago

yarden.zamir on Discord says

The color of the cards that people get in the discord bridge is random with their name as seed it's always interesting to see them

Discord-Github-Bridge commented 6 months ago

engineersmith_4628 on Discord says

I want to be able to access the key binding for key_crafting_on_a_stick.key.open_curios and others ™️

Discord-Github-Bridge commented 6 months ago

yarden.zamir on Discord says

Easy: minecraft command that when ran writes settings to json file

Discord-Github-Bridge commented 6 months ago

yarden.zamir on Discord says

Hard: an api entry that returns settings

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

i could try wrapping a class like kubejs does

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

in javascript

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

although i have no idea how that works and how complicated it would bve

Discord-Github-Bridge commented 6 months ago

yarden.zamir on Discord says

look at a simple kjs addon

Discord-Github-Bridge commented 6 months ago

engineersmith_4628 on Discord says

I tried loading net.minecraft.client.Minecraft in kubejs but it didn't like me

Discord-Github-Bridge commented 6 months ago

yarden.zamir on Discord says

if there is one

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

is there a progammatic way to get the keybind

Discord-Github-Bridge commented 6 months ago

engineersmith_4628 on Discord says

Oh - the github issue doesn't mention who the OP is

Discord-Github-Bridge commented 6 months ago

engineersmith_4628 on Discord says

no idea other than this 1 blog post for forge 1.7

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

lmao

Discord-Github-Bridge commented 6 months ago

engineersmith_4628 on Discord says

https://jabelarminecraft.blogspot.com/p/minecraft-forge-1721710-keybinding.html#:~:text=Minecraft.getMinecraft().gameSettings.keyBindJump

Discord-Github-Bridge commented 6 months ago

engineersmith_4628 on Discord says

I assume it can give me the keyMapping class for the key and from that you can get the key

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

yeah

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

hm

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

ill see what i can do

Discord-Github-Bridge commented 6 months ago

engineersmith_4628 on Discord says

No big rush - I know how painful the docs are

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

thats alright, should be relatively simple

Discord-Github-Bridge commented 6 months ago

engineersmith_4628 on Discord says

you have 12 minutes

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

lol

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

fuck

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

yarden.zamir do you know how create classes are available like this: $myclass = Java.loadClass("com.simibubi.create.content.trains.bogey.AbstractBogeyBlock")

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

need to import the source of ptdye plus into kubejs somehow

Discord-Github-Bridge commented 6 months ago

yarden.zamir on Discord says

I think any loaded mod can be loaded this way

Discord-Github-Bridge commented 6 months ago

yarden.zamir on Discord says

Not realted to kube

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

hm

Discord-Github-Bridge commented 6 months ago

yarden.zamir on Discord says

for you it will be com/kikis/ptdyeplus

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

yeah

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

think i need to dump probejs

Discord-Github-Bridge commented 6 months ago

yarden.zamir on Discord says

Yea you need to load it with loadClass then dump

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

ok im having quite a lot of trouble

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

was trying to follow the kubejs readme: https://github.com/KubeJS-Mods/KubeJS/tree/2004?tab=readme-ov-file#creating-addons

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

but the examples it provides are outdated 😢

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

tried some things but nothing working

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

going to ask on their discord

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

also github search is completely broken right now 😭

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

https://discord.com/channels/303440391124942858/1192291452995256492/1192291452995256492

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

holy fucking shit i did it

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

i am a god coder and there is nothing i cant code!

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

i managed to make an a custom event handler

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

and i can programmtically fire that event from java

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

i havent figured out how to just expose a function though

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

but i can expose a function in the event


console.log('my settings: ' + event.settings());
})```
Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

i think what we need is an exposed function that can just be run whenever but if an event works engineersmith_4628 , when do you need to know what the keybind is?

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

ok

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

never mind

Discord-Github-Bridge commented 6 months ago

kikis2111 on Discord says

got the function working