#PickHaxe
1 messages · Page 2 of 1
ah
if you are using
i think i checked those but couldn’t figure out which exactly registered the items
net.pickhaxe.compat.world.item.Item
cus im used to Registery.register
For reference
net.pickhaxe.compat.world.item.Item is a wrapper
around the vanilla Minecraft item class
in fact it replaces it at compile time so you can use it in all the same places
the things it does include:
actually currently the only thing it does is add Item.register()
which calls either Registry.register for Fabric or whatever convoluted stuff I did to make it work on Forge
ah
More work is getting done
1.16.2-1.20.2 as well as the latest snapshot all tested and working on Fabric
Forge is giving me grief as usual
ooooo
oof, sorry to hear
50% their fault 50% mine really
They did things in a weird way and I did weird things to them
For reference, the current existing blocking issues are:
- Fabric, 1.16.2 and earlier:
NoSuchFieldError: displayNamewhen initializing a CreativeModeTab. Very low priority since most people use 1.16.5.
- Forge, 1.19.2 and earlier:
NoSuchFieldError: f_40748_when initializing a mod with a CreativeModeTab. This drives me insane becausef_40748_(which translates toCreativeModeTab.TABS) DEFINITELY exists.
- Forge, 1.19.3 and later: Installing multiple mods utilizing PickHaxe at the same time throws an error that two classes with overlapping classpaths exist.
The latter issue necessitates the development of a library to rename packages at compile time, which will be its own standalone Haxelib found here: https://github.com/EliteMasterEric/haxe-shade
During the development of haxe-shade, I encountered a compiler issue which has halted its development, which has been reported to the Haxe Foundation: https://github.com/HaxeFoundation/haxe/issues/11361
Aside from the overlapping classes issue, Forge 1.19.4 works great.
oooo epic!
I thought from the beginning that PickHaxe would be a simple project but I hit the boundaries for what kind of output Haxe->JVM was capable of pretty quickly.
The good news is that everything that gets changed for this project helps everyone, really.
I got Forge 1.19.4-1.19.0 working, Forge 1.18.2 doesn't work because of a Haxe bug, multiple Forge mods at once doesn't work because of a Forge bug, Forge 1.17 has some Gradle issue I need to work, Fabric is working on everything up until 1.16.1 but who cares about that
and Forge 1.20 also had some Gradle issue that I can probably figure out just fine
This screenshot summarizes my project nicely
how does it feel to be the only user of the jvm target
bittersweet
Another issue just got merged and I have a new working sample project. This one doesn't use any custom library code provided by PickHaxe, but only builds for a specific version of Minecraft.
You still use pickhaxe build to create a jar, but this is to demonstrate that net.pickhaxe.core.CommonMod is optional. You can simply invoke Fabric's methods and classes and it will work 100%. Using this, you can make full use of Haxe's language features when developing Minecraft mods.
I'm going to continue work on more cleanup, including:
- Tested working builds for the main samples on all supported versions.
- A few new features for the build tools.
- More versions for the
madeinhaxe-baresample project
before releasing 0.4.0 publicly
:o
sneak preview
Found a snag with the template downloader, but I made a way to specify a GitHub API key if you have trouble
How are you downloading templates? I know you don't need a API token to access releases, regardless of what their documentation says
I have a JSON file which contains the relative paths of each sample along with a name and short description
When I choose a path for a sample I fetch a directory listing via API and iterate over it recursively
I do this since I want to download whatever is in the repo (so I don't have to make a release) but I don't want to download the whole thing
[showcase] PickHaxe, the Minecraft modding framework for Haxe, has been making a lot of progress in its tooling lately. Here's a demonstration that goes from an empty workspace to a sample mod working in-game in less than 2 minutes (most of that is build time ehe).
oooh sickkk!
Next upcoming stable release is SOON-ISH! working on polishing stuff
can’t wait :3
[showcase] PickHaxe v0.4.0 is live on HaxeLib. This version was a long time in the making, in part due to issues with the Haxe compiler itself; now, most of those are resolved. Fabric 1.16.5-1.20.2 (+ snapshots!) as well as Forge 1.18.2-1.20.2 are now fully supported and have working sample projects, and the built-in tools for developing for both have greatly improved. If you have any problems, please make an issue or post in #1085695464466296932 .
...and 0.4.0 is broken. fun.
...v0.4.1 is live!
oooo
Docs got an update too so they should be a good place to start
which version
trying a new build from scratch to see
The commands I'm running are
pickhaxe template madeinhaxe
pickhaxe build fabric 1.20.2 --make
the mod isn't being loaded
yeah thats what i did
yeah
(well, i did build then make, not build --make but theres not much difference between doing either one)
any mention of pickhaxe or madeinhaxe in the logs? 🤔
(There shouldn't be any difference, build --make just calls the Make function after the build is done)
when doing runClient these are the only mentions of madeinhaxe
is runClient the only thing you've tried
i did build than i did make before doing runclient
i'll try a clean then i'll redo runclient (after building again)
ok so:
runClientperforms a build by defaultrunClientuses the-devJAR so--makeisn't necessaryrunClientis... iffy at times.
oh
i just tested and adding the mod to a normal Minecraft instance works
alr
OH
uh
i forgot to make runClient work on Fabric
i made a note to myself and then forgot to fix it
it should work on forge though
alr
updating github issues now with all the known stuff
yeah runClient works fine on Forge
Been hard at work on trying to dogfood PickHaxe and adding a bunch of features in the process
Coming in 0.5 is support for dependencies
You can add mods as runtime dependencies to your mod metadata or as build dependencies for Haxe
oooo nice!
Been working on mixins too those should come in 0.5 as well
Okay sooo... https://github.com/HaxeFoundation/haxe/issues/11370
Mixins don't work until this is fixed.
Got a bunch of work done this weekend on stuff for 0.5, things you can see in develop right now:
- Mod dependencies
- Mod build dependencies
- Basic implementation of
net.pickhaxe.compatfor Blocks pickhaxe runClientworking on Minecraft Fabric
And stuff that is currently broken (dependant on some bug in HaxeFoundation/Haxe):
- Mod data generators
- Mixin support
- Bugfix for PickHaxe Forge mods conflicting with each toher
ooooh datagen? sounds awesome, cant wait!!
For context, I am making my own mod to ensure the feature set of PickHaxe, and in developing it I need to use the Fabric/Forge datagen APIs.
Implementing DataGen in a mod will involve adding a <mod-data-generator> pointing to a class extending net.pickhaxe.datagen.DataGenerator, and that will provide a single API which calls Forge or Fabric conditionally.
When you're ready to regen data, just call pickhaxe dataGen <loader> <mcVersion>
oh cool
in fact, to be clear
Minecraft VANILLA has datagen
and Forge/Fabric's APIs are wrappers to access it
(PickHaxe is a cool project because I have to learn at a deep level how Minecraft does things)
waitwha
damnn
im guessing its for like
the devs to easily make stuff
yeah basically the same reason fabric and forge devs use it
creating lots of valid JSON files properly is really annoying
true
i can agree after having to create 5 different blockstates for every tree type
well ok maybe 4 i think
the mod I'm making is adding trees 🙂 so i can relate
forget this
no i know what datagen is
I have problem when running "haxelib run pickhaxe setup"
[EXCEPTION 301] An error occurred within PickHaxe while performing this operation.
Haxe version mismatch, expected 5.0.0-alpha+, got 4.3.3.
I don't think Haxe 5 exists yet? So this is an interesting error
You have to use the latest nightly version. Click on "nightly builds" on top right.
https://haxe.org/download/
ok thanks
I created the obsidianarmor project. The mod does not appear in the game...
if your doing runClient with fabric its a known bug that it doesnt work
Yeah, runClient with Fabric only works on develop builds. If you do pickhaxe build fabric 1.20.2 --make that will give you a JAR that works
So how will PickHaxe handling Networking? Will you be creating wrapper classes for each network class of both APIs and then have an overall network class that can support both forge or fabric, or are you going to create your own network classes that use the core minecraft network classes?
Also does this has MacOS support?
idk but i dont think it'd be that hard to test
Turns out no, but I'm pushing a commit to change to yes
The CLI tool doesn't work on Linux I think there're a couple commands that were written specifically for the fact that Windows hates the paths generated by Gradle
It OUGHT to work on Mac and Linux
But last I tried to use Haxe 5.0 on Linux it gave some weird macro error that didn't show up on Windows so IDK what's going on there.
So far with MacOS, Haxe 5.0 is working fine, I haven't encountered any macro errors (At the moment)
It might be only on Linux, but that's just an assumption
So I made the setup method for MacOS, should I implement an output log warning telling the user that that "It's currently not fully stable on MacOS?"
Until I encounter more potential issues with the CLI tools?
Holy crap, I love laid out everything is! It feels just as easy as settting up a Lime or OpenFL workbench, great job!
Thank you, that means a lot to hear
Not sure how much modding experience you have but the compatibility stuff is still being fleshed out. In the meantime, working with Fabric or Forge directly works great, read the docs on the Wiki for more info on that
Note that Haxe's JVM target is basically a full reimplementation of the Java compiler so it may have discrepencies with the output of an actual Java build. Currently, there are some issues with Java annotations and with functional interfaces (i.e. passing a function as an argument to Java)
help
haxelib run pickhaxe setup
[EXCEPTION 301] An error occurred within PickHaxe while performing this operation.
Haxe version mismatch, expected 5.0.0-alpha+, got 4.3.1.
oh
forget it
new error: Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find net.minecraftforge:forge:1.16.5-36.2.39_mapped_parchment_2022.03.06-1.16.5_at_175c2242fa454c8e9a25f7f742a38c48424a3fcf.
Searched in the following locations:
- file:/C:/Users/Juan Camborda/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.16.5-36.2.39_mapped_parchment_2022.03.06-1.16.5_at_175c2242fa454c8e9a25f7f742a38c48424a3fcf/forge-1.16.5-36.2.39_mapped_parchment_2022.03.06-1.16.5_at_175c2242fa454c8e9a25f7f742a38c48424a3fcf.pom
- file:/C:/Users/Juan Camborda/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.16.5-36.2.39_mapped_parchment_2022.03.06-1.16.5_at_175c2242fa454c8e9a25f7f742a38c48424a3fcf/forge-1.16.5-36.2.39_mapped_parchment_2022.03.06-1.16.5_at_175c2242fa454c8e9a25f7f742a38c48424a3fcf.jar
Required by:
project :
rude
Did you try to build PickHaxe with Forge 1.16.5? I haven't tested with that version I don't think I noted that anywhere
any forge 1.16 tested version?
i didn't test with any forge 1.16.0-1.16.5
i think i encountered an issue with 1.17 and stopped there
a
So how exactly are plugins suppose to work in PickHaxe?
I was thinking of making one but I don't really know if there's anything unique I have to do
well considering that neither of the supported platforms are plugin platforms, id say they arent supposed to work
although you probably can do server-side mods, youd probably have to pick forge or fabric (not both) and probably would need to avoid the pickhaxe api
PickHaxe does not support Spigot/Bukkit/Sponge server plugins
And doesn't intend to LOL, that would expand the scope too much.
making a spigot plugin server in haxe
make a haxe project in java
make your main class in a directory like: org.tutorial
download this libs:
the .hxml
--java-lib libs/javax.servlet-api.jar
--java-lib libs/spigot-1.8.8-R0.1-SNAPSHOT-latest.jar
--java-lib libs/joda-time-2.12.5.jar
--java-lib libs/javax-crypto.jar
-r plugin.yml
--java bin/java
--main org.tutorial.YourPluginName
plugin.yml:
main: org.tutorial.YourPluginName
name: YourPluginName
version: 1.0
description: Your Description
the main class template:
package org.tutorial;
import org.bukkit.plugin.java.JavaPlugin;
class YourPluginName extends JavaPlugin{
static function main(){}
override overload function onEnable() {
super.onEnable();
}
override overload function onDisable() {
super.onDisable();
}
}
thats all
now create your own plugin in haxe
The fact that plugins don't need to be obfuscated makes developing for it a lot easier. You probably don't need a Haxe framework for it, just the jar files.
idk
but without that files the project dont export
in a java enviroment you just need spigot.ja
I know Haxe does tend to creep up the chain of libraries when resolving types
that's why I have Gradle export all the dependencies for Minecraft.jar and I just include them all
cool
That makes a lot more sense why I got "missing dependencies" when testing out geckoLib with PickHaxe
If you have any gradle dependencies the develop branch has support for those
is this project being worked on still?
It's currently at the point where all the things I want to work on have blockers tied to Haxe
ah
(I've also been really into modding Lethal Company lol)
oh thats nice
lethal company was made with godot wasnt it?
wait no where did i get that from
nvm
unity modding has a pretty solid set of tooling at this point
Unlike Unity development...
By the way here are the three issues that are hindering PickHaxe development right now:
Background I am currently working on a Haxe library to apply shading to a targeted package or module. The modules the macro is applied to should be generated at a new location of the user's cho...
Certain java annotation args require using other annotations, but haxe doesn't not allow this at the moment. Equivalent java code: @Foo(@Bar("baz")) Haxe code (doesn't work) @:met...
Minimal reproduction https://github.com/EliteMasterEric/Issue11054/tree/488fbb13733643d5406fbcae42802b07d72652e0 Error Message No compile error is received, instead Java experiences an error at run...
Status update:
- #11361 requires a bunch of rewrites to the JVM target in order to support a
-D jvm.root=<package>argument, so it will probably take a while to develop. This is a blocker in fixing a bug where two Forge mods cannot be used together. - #10516 requires a bunch of requires to
@:strictin order to support including annotations as an argument to other annotations. This is a blocker in fixing a bug where Mixins are not properly recognized. - #11390 is one I just built a minimal reproduction on so we should see progress on it soon. This is a blocker in fixing a bug where DataGen functions will fail at runtime.
I also just today fixed a platform issue with a recent push to develop and builds seem to work on Linux now, wahoo!
#11390 got a couple helpful commits yesterday to where I got basic datagen working
so you can run pickhaxe datagen fabric 1.20.2 and utilize the utilities provided by Minecraft to create JSON data
and notably PickHaxe will put those generated JSON files in a directory where they will get used when you perform pickhaxe build
i only learned about datagen recently but it's pretty interesting
A good example is that you could create a function which
iterates through a list of items and creates an achievement that triggers when you craft each of them
and then when you run pickhaxe datagen Minecraft will convert that into the resource pack JSON that will get included with your mod
Stuff like recipes, loot tables, translation entries, tags, block models, and worldgen features are all powered by JSON and you can write that JSON as code instead using this method
I started working on datagen in part for the mod I'm developing which requires the use of worldgen datagen
:o thats so epic!!
Was able to delete a bunch of resource files and replace them with one datagen class that auto-creates them

thats epic
Note this DOESN'T affect PickHaxe since we use the JVM target which is different!
But still sad
Wait does this really mean what I think it means...
Is Haxe no longer going to transpile into Java and C#.....
It no longer transpiles to C# and it no longer transpiles to Java SOURCE
They more recently added a feature to transpile to Java BYTECODE and that is staying
holy shit
I assume that's the JVM tranpile
Wait but @storm aspen why C# as well?
It explains it in the post
Oh ok, I reread the entire thing and I'm still in shock since I've always promoted Haxe with .NET since I have friends that program in C#
Also will Haxe have parsing for Java still?
Like being able to use JARs for externs? yes
oh but not with source .java files
atleast that's not a total lost, however, it seems that Haxe is competing with Kotlin and Scala
PickHaxe is one of the more elaborate projects to use the JVM target I think
partly because Minecraft modding requires the output be very precise in a way that doesn't matter much when using javac as your compiler
but with the custom bytecode generation one mistyped annotation will just cause a mixin to become unreadable
Ah, I don't know much about mixins except for the brief explanation you gave during a Haxe round up, but that sounds actually terrible to debug
I assume next up is native C++ due to HashLink being superior
I realized that as all my projects rely on the CFFI
but anyways tho, this is really sadding to see Java and C# go
sorry about that I wasn't thinking properly 😅
HashLink has its place but personally I haven't been able to use it much
since my main projects either rely heavily on C++ externs or really heavily on Java being the target
If you don't mind me asking, what is HashLink for exactly? I've only used native C++
Since HashLink is a VM, the built binary can be run on any target which has HashLink on it.
The main reason to use it is that build times are way faster reportedly
and therefore iteration is faster.
ohhhh ok, that makes sense, thank you
I had a false assumption that it was a VM alternative for C++ in general
compiling a flixel game to native can take over 10 minutes on the first compile and ~30 seconds on subsequent compiles (based on hardware ofc), but compiling to hashlink takes like 10 seconds at most every single time
holy crap
Get them to contribute to reflaxe.csharp 
I gotta get them
Latest Minecraft snapshot updated the game to Java 21
This will probably make it harder to update especially if they actually use any of the new language features
It also means no 32-bit computers for 1.21!
or 1.20.5
smh finally, no POOR people in my 1.21 servers (/joke)
Is PickHaxe still being worked on? (I love this MC API too much)
Haven't really touched it in a while there was a bit of refactoring I wanted to do to move the compat stuff to a separate library
To make it easier to exclude since things work pretty well when you use compile defines to divide up loader specific and version specific stuff yourself
[showcase] I spent sometime last night updating PickHaxe to work with Minecraft 1.21, and tested it out by implementing Armor Trim support for the Obsidian Armor sample project.
As part of the refactor, I moved the net.pickhaxe.compat package to its own repository, and reworked the MadeInHaxe sample project to not use it anymore. It is now split up into individual repos for different loaders and game versions.
This should make it easier to maintain. The Obsidian Armor repo will use the pickhaxe-compat library and thus try to maintain cross-platform, cross-loader support.
@storm aspen is pickhaxe planned to have support for exporting to neoforge? bcus iirc neoforge has/is removing support for forge mods(i think? take what im saying with a heavy grain of salt)
oh wow that was quick
I plan on supporting NeoForge and quilt
But support for even original Forge is kinda lacking right now
ah i see
I believe the build tools are pretty similar so the plan is to port it over once I get it working
i assume you can access the platform api and internals directly just like any mod made directly in a jvm supported language
You can call any functions in the Java libraries directly (as long as they're public and even then you can use an access transformer)
The main limitations I'd say are Haxe's slow auto complete with how many java externs it needs to build, along with technical stuff like Mixins not working properly and annoying problems when interacting between Haxe and Java (this method wants a Java array, and that method wants a factory function)
There's also the cross compatibility part of it, I can do something the Fabric way or the Forge way, but to make a single endpoint to work with on PickHaxe I have to reconcile the two. I've made that part of the project into a side library recently for this reason
Fun fact, You don't even need to touch Haxe OR Java to give a block a 3D model, it's perfectly doable with just a resource pack (most mods have at least a small resource pack baked into them to load the custom textures etc)
Hey! I've recently tried to make something similar to PickHaxe, but instead as a gradle plugin rather than with a custom build system. One question: The Haxe JVM target will place a haxe package in the output jar, which is almost but not entirely static. Importantly, this package contains generated classes that share names among different mods while having different content. Does PickHaxe have some way of renaming this package, because otherwise it will almost definetely result in conflicts once multiple PickHaxe mods are loaded into the same classpath.
Also, how hard would it be to port PickHaxe to MC 1.7.10 (forge)?
Okay, so, there IS a way to set the destination path of a class in Haxe
and I have a library that does it: https://github.com/EliteMasterEric/haxe-shade
and that library is used by PickHaxe if you use --shading
however that has a fatal flaw
attempting to remap some of the core Haxe classes (like Array) causes the compiler to break (see this issue: https://github.com/HaxeFoundation/haxe/issues/11361)
The only solution is to wait for the haxe dev team to solve it
So in the current state of PickHaxe, you can only install one Forge mod made in PickHaxe at a time.
Side note, for whatever reason Fabric does not care about multiple mods containing identical classes and package names! Only Forge has issues.
as for this it's a matter of setting up the build flags properly and then modifying any externs so they're correct for that version using compile flags
ik paper does some classpath isolation magic that causes plugins to throw NoClassDefFound or whatever it is if they dont explicitly depend on another plugin but try to access it, could try to look at what they do and see if its possible to use that in a forge mod