#PickHaxe

1 messages · Page 2 of 1

tidal lance
#

usually i’d

storm aspen
tidal lance
#

ah

storm aspen
#

if you are using

tidal lance
#

i think i checked those but couldn’t figure out which exactly registered the items

storm aspen
#

net.pickhaxe.compat.world.item.Item

tidal lance
#

cus im used to Registery.register

storm aspen
#

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

tidal lance
#

ah

storm aspen
#

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

tidal lance
#

ooooo

tidal lance
storm aspen
#

50% their fault 50% mine really

#

They did things in a weird way and I did weird things to them

storm aspen
#

For reference, the current existing blocking issues are:

#
  • Fabric, 1.16.2 and earlier: NoSuchFieldError: displayName when 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 because f_40748_ (which translates to CreativeModeTab.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.
#

Aside from the overlapping classes issue, Forge 1.19.4 works great.

storm aspen
#

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

storm aspen
#

This screenshot summarizes my project nicely

dusty prism
#

how does it feel to be the only user of the jvm target

storm aspen
#

bittersweet

storm aspen
#

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-bare sample project

before releasing 0.4.0 publicly

storm aspen
#

sneak preview

storm aspen
#

Partially working...

#

there we go! template downloader is working

storm aspen
#

Found a snag with the template downloader, but I made a way to specify a GitHub API key if you have trouble

dusty prism
#

How are you downloading templates? I know you don't need a API token to access releases, regardless of what their documentation says

storm aspen
#

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

storm aspen
#

[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).

storm aspen
#

Next upcoming stable release is SOON-ISH! working on polishing stuff

tidal lance
#

can’t wait :3

storm aspen
#

[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 .

storm aspen
#

...and 0.4.0 is broken. fun.

storm aspen
#

...v0.4.1 is live!

tidal lance
#

oooo

storm aspen
#

Docs got an update too so they should be a good place to start

tidal lance
#

thats strange

#

i built the madeinhaxe template but the custom item isnt there?

storm aspen
#

which version

tidal lance
#

1.20.2

#

fabric launcher

storm aspen
#

trying a new build from scratch to see

#

The commands I'm running are

pickhaxe template madeinhaxe
pickhaxe build fabric 1.20.2 --make
tidal lance
storm aspen
#

the mod isn't being loaded

tidal lance
storm aspen
#

any mention of pickhaxe or madeinhaxe in the logs? 🤔

storm aspen
tidal lance
storm aspen
#

is runClient the only thing you've tried

tidal lance
#

i did build than i did make before doing runclient

#

i'll try a clean then i'll redo runclient (after building again)

storm aspen
#

ok so:

  1. runClient performs a build by default
  2. runClient uses the -dev JAR so --make isn't necessary
  3. runClient is... iffy at times.
tidal lance
#

oh

storm aspen
#

i just tested and adding the mod to a normal Minecraft instance works

tidal lance
#

alr

storm aspen
#

OH

#

uh

#

i forgot to make runClient work on Fabric

#

i made a note to myself and then forgot to fix it

tidal lance
#

well that woudl explain it

#

lmao

storm aspen
#

it should work on forge though

tidal lance
#

alr

storm aspen
#

updating github issues now with all the known stuff

#

yeah runClient works fine on Forge

storm aspen
#

Been hard at work on trying to dogfood PickHaxe and adding a bunch of features in the process

coarse galleon
#

Treat it like family

#

Or treat it like the black sheep of the herd

storm aspen
#

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

storm aspen
#

Been working on mixins too those should come in 0.5 as well

storm aspen
#

Mixins don't work until this is fixed.

tidal lance
#

hope it gets fixed soon

storm aspen
#

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.compat for Blocks
  • pickhaxe runClient working 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
tidal lance
storm aspen
#

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>

tidal lance
#

forge has datagen?

#

or are you just making it so your datagen works with forge too

storm aspen
tidal lance
#

oh cool

storm aspen
#

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)

tidal lance
#

damnn

#

im guessing its for like

#

the devs to easily make stuff

storm aspen
#

yeah basically the same reason fabric and forge devs use it

#

creating lots of valid JSON files properly is really annoying

tidal lance
#

true

#

i can agree after having to create 5 different blockstates for every tree type

#

well ok maybe 4 i think

storm aspen
#

the mod I'm making is adding trees 🙂 so i can relate

bright egret
#

make a pickhaxe tutorial

#

and make a minecraft client lib 😈

bright egret
tidal lance
glossy brook
#

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.

coarse galleon
tired tundra
glossy brook
#

ok thanks

glossy brook
#

I created the obsidianarmor project. The mod does not appear in the game...

tidal lance
storm aspen
onyx remnant
#

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?

onyx remnant
#

Also does this has MacOS support?

tidal lance
onyx remnant
storm aspen
#

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.

onyx remnant
#

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?

onyx remnant
#

Holy crap, I love laid out everything is! It feels just as easy as settting up a Lime or OpenFL workbench, great job!

storm aspen
#

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)

bright egret
#

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

bright egret
#

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 :
bright egret
#

rude

storm aspen
#

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

bright egret
storm aspen
#

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

bright egret
#

a

onyx remnant
#

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

atomic raven
#

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

storm aspen
#

PickHaxe does not support Spigot/Bukkit/Sponge server plugins

storm aspen
#

And doesn't intend to LOL, that would expand the scope too much.

bright egret
#

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

storm aspen
#

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.

bright egret
#

idk

#

but without that files the project dont export

#

in a java enviroment you just need spigot.ja

storm aspen
#

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

bright egret
#

cool

onyx remnant
storm aspen
#

If you have any gradle dependencies the develop branch has support for those

tidal lance
#

is this project being worked on still?

storm aspen
tidal lance
#

ah

storm aspen
#

(I've also been really into modding Lethal Company lol)

tidal lance
#

lethal company was made with godot wasnt it?

#

wait no where did i get that from

storm aspen
#

unity modding has a pretty solid set of tooling at this point

dusty prism
#

Unlike Unity development...

storm aspen
#
GitHub

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...

GitHub

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...

GitHub

Minimal reproduction https://github.com/EliteMasterEric/Issue11054/tree/488fbb13733643d5406fbcae42802b07d72652e0 Error Message No compile error is received, instead Java experiences an error at run...

storm aspen
#

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 @:strict in 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!

storm aspen
#

#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

storm aspen
#

I started working on datagen in part for the mod I'm developing which requires the use of worldgen datagen

storm aspen
#

Was able to delete a bunch of resource files and replace them with one datagen class that auto-creates them

storm aspen
#

Note this DOESN'T affect PickHaxe since we use the JVM target which is different!

#

But still sad

tidal lance
#

sad

onyx remnant
#

Is Haxe no longer going to transpile into Java and C#.....

storm aspen
#

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

onyx remnant
#

holy shit

storm aspen
#

well Haxe 4.x will still support it

#

but 5.x won't

onyx remnant
#

Wait but @storm aspen why C# as well?

storm aspen
#

It explains it in the post

onyx remnant
#

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?

storm aspen
onyx remnant
#

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

storm aspen
#

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

onyx remnant
#

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

storm aspen
#

um no

#

hashlink is still a VM

onyx remnant
#

that's true

#

I forgot about that

storm aspen
#

so the performance is way better

#

plus CFFI is really important

onyx remnant
#

but anyways tho, this is really sadding to see Java and C# go

onyx remnant
storm aspen
#

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

onyx remnant
storm aspen
#

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.

onyx remnant
#

ohhhh ok, that makes sense, thank you

#

I had a false assumption that it was a VM alternative for C++ in general

atomic raven
#

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

onyx remnant
#

holy crap

dusty prism
storm aspen
#

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

tidal lance
#

damnnn

storm aspen
#

It also means no 32-bit computers for 1.21!

atomic raven
#

or 1.20.5

tidal lance
onyx remnant
#

Is PickHaxe still being worked on? (I love this MC API too much)

storm aspen
#

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

storm aspen
#

[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.

tidal lance
#

@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

storm aspen
#

I plan on supporting NeoForge and quilt

#

But support for even original Forge is kinda lacking right now

tidal lance
#

ah i see

storm aspen
#

I believe the build tools are pretty similar so the plan is to port it over once I get it working

atomic raven
#

i assume you can access the platform api and internals directly just like any mod made directly in a jvm supported language

storm aspen
#

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)

errant swallow
#

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.

errant swallow
#

Also, how hard would it be to port PickHaxe to MC 1.7.10 (forge)?

storm aspen
#

Okay, so, there IS a way to set the destination path of a class in Haxe

#

and that library is used by PickHaxe if you use --shading

#

however that has a fatal flaw

#

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.

storm aspen
atomic raven
eager current
#

what the fuck do I do here 😭

#

(this is when I'm trying to run the setup btw

devout dome
#

wrong account lol

#

oopsies

#

oh mr.@storm aspen!!!!!
(sorry for the ping I just genuinely don't know what to do here there are no issues on the github for this)

#

my bad this is whenever I use any "haxelib run pickhaxe" command???????