Skip to content

Commit d260d03

Browse files
Rename to pickhaxe + more gradle stuff
1 parent 196f81d commit d260d03

File tree

125 files changed

+973
-603
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+973
-603
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
dev/
33

44
# Java
5-
generated/
5+
generated/
6+
gradle/.gradle/
7+
gradle/build/
8+
gradle/gradle/

README.md

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
# HxCraft
1+
# PickHaxe
22

3-
![](/art/logo.png)
3+
![](/art/logo2.png)
44

5-
HxCraft is a flexible, powerful Haxe framework to supercharge your Minecraft mod development. Build your mods in a high-level strictly-typed language and export to the Minecraft versionn and modding API of your choice.
5+
PickHaxe is a flexible, powerful Haxe framework to supercharge your Minecraft mod development. Build your mods in a high-level strictly-typed language and export to the Minecraft versionn and modding API of your choice.
6+
7+
Getting started is simple. Install Haxe and PickHaxe, then create a new mod project and get developing. When you're ready to test, PickHaxe will compile your mod for Fabric or Forge, for the Minecraft version of your choice.
8+
9+
# To-Do Items
10+
- Get basic Fabric mod working.
11+
- Get basic Forge mod working.
12+
- Make externs for the entire Mojmap codebase.
13+
- Port over Obsidian Armor.
614

715
# Known Issues
816

917
- [x45 gets appended to dashes in resource file names](https://community.haxe.org/t/jvm-how-to-add-custom-resources-into-output-jar/3205)
18+
- Mitigated by disallowing dashes in mod IDs.
1019

1120
# License
1221

13-
HxCraft's tools are made available under the MIT License. See [LICENSE.md](/LICENSE.md) for more details.
22+
PickHaxe's tools are made available under the MIT License. See [LICENSE.md](/LICENSE.md) for more details.
23+
24+
PickHaxe utilizes mappings modified from Minecraft: Java Edition, and its use is governed by the Minecraft End User License Agreement available at https://account.mojang.com/documents/minecraft_eula.

Run.hx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Run {
22
static function main() {
3-
hxcraft.tools.Main.main();
3+
net.pickhaxe.tools.Main.main();
44
}
55
}

art/logo2.png

32.6 KB
Loading

art/logo2.psd

257 KB
Binary file not shown.

build_tool.hxml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
--library tink_xml
22
--library tink_core
33
--library tink_macro
4-
--library hxcraft
4+
--library pickhaxe
55

66
--class-path src/
7-
--main hxcraft.tools.Main
7+
--main net.pickhaxe.tools.Main
88

9-
-D hxcraft.tools.executable=true
9+
-D net.pickhaxe.tools.executable=true
1010

1111
--cpp ./generated/bin/
1212

13-
# Copy the result to templates/bin/hxcraft.exe so people can `haxelib run hxcraft setup`
14-
--cmd copy "./generated/bin/Main.exe" "./templates/bin/hxcraft.exe"
13+
# Copy the result to templates/bin/pickhaxe.exe so people can `haxelib run pickhaxe setup`
14+
--cmd copy "./generated/bin/Main.exe" "./templates/bin/pickhaxe.exe"

docs/DEFINES.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Compile Defines
2+
3+
PickHaxe makes many compile definitions available to Haxe.
4+
5+
- `pickhaxe`: The current version of the PickHaxe library.
6+
- `pickhaxe.java.version`:
7+
- `pickhaxe.minecraft.version`:
8+
- `pickhaxe.loader`:
9+
- `pickhaxe.mod.id`:
10+
- `pickhaxe.mod.name`:
11+
- `pickhaxe.mod.version`:
12+
- `pickhaxe.mod.environment`: One of `CLIENT`, `SERVER`, or `*`.
13+
- `pickhaxe.mod.parentPackage`:
14+
- `pickhaxe.mod.parentPackage`:
15+
- `pickhaxe.mod.entryPoint`:
16+
17+
- `pickhaxe.tools.executable`: Set to true when building the PickHaxe command line tools as an executable.

docs/SETUP.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Setup Guide
2+
3+
TODO
-17 Bytes
Binary file not shown.
Binary file not shown.

gradle/.gradle/7.4.2/dependencies-accessors/gc.properties

Whitespace-only changes.
Binary file not shown.
-1 Bytes
Binary file not shown.
-17 Bytes
Binary file not shown.

gradle/.gradle/7.4.2/gc.properties

Whitespace-only changes.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#Mon Mar 06 04:43:15 EST 2023
1+
#Wed Mar 08 22:13:38 EST 2023
22
gradle.version=8.0.1

gradle/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Problem: Different Minecraft projects want different Gradle versions for their b
44

55
Solution: Create separate gradle wrappers for each version and run the appropriate one.
66

7-
`./gradlew-8.0.1.bat -D"hxcraft.loader=fabric" -D"hxcraft.version=0.0.1"`
7+
./gradlew-8.0.1.bat -D"pickhaxe.loader=fabric" -D"pickhaxe.version=0.1.0" -D"pickhaxe.loader.fabric.api_version=0.74.0+1.19.3" -D"pickhaxe.java.version=17" -D"pickhaxe.mappings.yarn.version=1.19.3+build.5" genSources
88

99
## Gradle options
10-
- `-Dhxcraft-version`: The current version of HxCraft
11-
- `-Dhxcraft-loader=<loader>` Use a specific loader (`fabric` or `forge`)
12-
- `-Dhxcraft-mapping`
10+
- `-Dpickhaxe-version`: The current version of PickHaxe
11+
- `-Dpickhaxe-loader=<loader>` Use a specific loader (`fabric` or `forge`)
12+
- `-Dpickhaxe-mapping`

gradle/build.gradle

+60-21
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,31 @@
22
buildscript {
33
println "Java: ${System.getProperty('java.version')}, JVM: ${System.getProperty('java.vm.version')} (${System.getProperty('java.vendor')}), Arch: ${System.getProperty('os.arch')}"
44

5-
println "HxCraft: ${System.getProperty('hxcraft.version')}, Loader: ${System.getProperty('hxcraft.loader')}"
5+
println "PickHaxe: ${System.getProperty('pickhaxe.version')}, Loader: ${System.getProperty('pickhaxe.loader')}"
66
}
77

8-
archivesBaseName = hxcraft.mod.id
9-
version = hxcraft.mod.version
10-
group = hxcraft.mod.parentPackage
8+
// Reference all Gradle plugins, with versions.
9+
plugins {
10+
id 'maven-publish' // Common
11+
id 'net.minecraftforge.gradle' version '5.1.+' apply false
12+
id 'fabric-loom' version '1.1-SNAPSHOT' apply false
13+
}
1114

1215
// Select the Gradle plugin based on the loader.
13-
switch(System.getProperty('hxcraft.loader')) {
16+
switch(System.getProperty('pickhaxe.loader')) {
1417
case 'forge':
15-
plugins {
16-
id 'maven-publish'
17-
id 'net.minecraftforge.gradle' version '5.1.+'
18-
}
18+
//apply plugin: 'net.minecraftforge.gradle'
1919
break
2020
case 'fabric':
21-
plugins {
22-
id 'maven-publish'
23-
id 'fabric-loom' version '1.1-SNAPSHOT'
24-
id 'legacy-looming' version '1.1-SNAPSHOT'
25-
}
21+
apply plugin: 'fabric-loom'
2622
break
2723
case null:
28-
throw new Exception("HxCraft: Missing loader")
24+
throw new Exception("PickHaxe: Missing loader")
2925
default:
30-
throw new Exception("HxCraft: Unknown loader: ${System.getProperty('hxcraft.loader')}")
26+
throw new Exception("PickHaxe: Unknown loader: ${System.getProperty('pickhaxe.loader')}")
3127
}
3228

33-
switch(System.getProperty('hxcraft.java_compatibility')) {
29+
switch(System.getProperty('pickhaxe.java.version')) {
3430
case '1.8':
3531
sourceCompatibility = JavaVersion.VERSION_1_8
3632
targetCompatibility = JavaVersion.VERSION_1_8
@@ -39,8 +35,51 @@ switch(System.getProperty('hxcraft.java_compatibility')) {
3935
targetCompatibility = JavaVersion.VERSION_17
4036
}
4137

42-
plugins {
43-
id 'maven-publish'
44-
id 'net.minecraftforge.gradle' version '5.1.+'
45-
id 'fabric-loom' version '1.1-SNAPSHOT'
38+
archivesBaseName = System.getProperty('pickhaxe.mod.id')
39+
version = System.getProperty('pickhaxe.mod.version')
40+
group = System.getProperty('pickhaxe.mod.parentPackage')
41+
42+
repositories {
43+
mavenCentral()
44+
gradlePluginPortal()
45+
maven { url = 'https://maven.fabricmc.net' }
46+
maven { url = 'https://maven.minecraftforge.net' }
47+
maven { url = 'https://maven.parchmentmc.org' }
48+
}
49+
50+
dependencies {
51+
// To change the versions see the gradle.properties file
52+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
53+
// mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
54+
mappings loom.layered() {
55+
officialMojangMappings()
56+
parchment("org.parchmentmc.data:parchment-1.19.3:2023.02.26@zip")
57+
}
58+
59+
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
60+
61+
62+
63+
// Fabric API. This is technically optional, but you probably want it anyway.
64+
modImplementation "net.fabricmc.fabric-api:fabric-api:${System.getProperty('pickhaxe.loader.fabric.api_version')}"
65+
66+
// Uncomment the following line to enable the deprecated Fabric API modules.
67+
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.
68+
69+
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
4670
}
71+
72+
configurations {
73+
web
74+
}
75+
76+
tasks.withType(JavaCompile).configureEach {
77+
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
78+
it.options.release = System.getProperty('pickhaxe.java.version') == '17' ? 17 : 8
79+
}
80+
81+
// A custom task to copy all the runtime dependencies to a place where they can be easily referenced.
82+
task copyDependencies(type: Copy) {
83+
from configurations.runtimeClasspath
84+
into "$buildDir/minecraft"
85+
}

gradle/gradle.properties

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@ org.gradle.jvmargs=-Xmx3G
33
# org.gradle.daemon=false
44
org.gradle.parallel=true
55

6+
# Pickhaxe Properties
7+
8+
# Fabric Properties
9+
=0.74.0+1.19.3
10+
11+
pickhaxe.mappings.yarn.version=
12+
613
# Fabric Properties
714
# check these on https://fabricmc.net/develop
815
minecraft_version=1.19.3
9-
yarn_mappings=1.19.3+build.5
1016
loader_version=0.14.17
1117

1218
# Mod Properties
1319
mod_version = 1.0.0
1420
mod_package = com.elitemastereric
15-
mod_id = obsidian-armor
21+
mod_id = obsidianarmor
1622

1723
# Dependencies
1824
fabric_version=0.74.0+1.19.3

gradle/gradlew-8.0.1.bat

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
@if "%DEBUG%" == "" @echo off
1+
@rem @if "%DEBUG%" == "" @echo off
22
@rem ##########################################################################
33
@rem
44
@rem Gradle startup script for Windows
55
@rem
66
@rem ##########################################################################
77

8+
echo Hello, Gradle!
9+
810
@rem Set local scope for the variables with windows NT shell
911
if "%OS%"=="Windows_NT" setlocal
1012

gradle/settings.gradle

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ pluginManagement {
1919
name = 'Jitpack'
2020
url = 'https://jitpack.io'
2121
}
22+
maven {
23+
name = 'ParchmentMC'
24+
url = 'https://maven.parchmentmc.org'
25+
}
2226
}
23-
// TODO: Create script to enable custom plugins
2427
}

haxelib.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "hxcraft",
3-
"url": "https://github.com/EliteMasterEric/hxcraft",
2+
"name": "PickHaxe",
3+
"url": "https://github.com/EliteMasterEric/pickhaxe",
44
"license": "MIT",
55
"tags": [
66
"java",
@@ -11,7 +11,7 @@
1111
"modding"
1212
],
1313
"classPath": "src",
14-
"description": "Minecraft mod development framework for Haxe",
14+
"description": "A Haxe framework to build Minecraft mods. Fabric, Forge, and more.",
1515
"contributors": ["MasterEric"],
1616
"releasenote": "In development",
1717
"version": "0.1.0",

mappings/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
This folder doesn't actually contain any Minecraft mappings, but rather information ABOUT mappings, as well as things like required JDK and Gradle versions.
44

5-
HxCraft tries to stick to Mojmap when possible, but for older versions other mappings are needed.
5+
PickHaxe tries to adhere to Mojmap when possible, but for older versions other mappings are needed.
66

7-
Most popular versions are 1.7.10, 1.12.2, and 1.16.5. Latest is 1.19.3 and oldest is Beta 1.7.3.
7+
**NOTE:** Most popular versions for modding are 1.7.10, 1.12.2, and 1.16.5. Lastest (1.19.3 at time of writing) is less popular, oldest with available tooling is Beta 1.7.3, and other versions are "stretch goals."
88

99
# Available Mappings
1010
- [Parchment](https://parchmentmc.org/docs/getting-started)

mappings/versions/stable/release-1.19.3/metadata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
"releaseDate": "2022-12-07",
66

7-
"javaVersion": "1.17",
7+
"javaVersion": "17",
88
"gradleVersion": "8.0.1",
99

1010
"fabricVersion": "0.75.1+1.19.3",

samples/obsidian-armor/hmm.json

-1
This file was deleted.

samples/obsidian-armor/project.xml

-31
This file was deleted.

samples/obsidianarmor/project.xml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<pickhaxe>
3+
<mod
4+
id="obsidianarmor"
5+
version="1.0.0-haxe"
6+
parentPackage="com.elitemastereric.obsidianarmor"
7+
classPath="./src/"
8+
resourcePath="./resources/"
9+
/>
10+
11+
<!-- CLIENT, SERVER, or * -->
12+
<mod-environment value="*" />
13+
14+
<mod-entry-point value="ObsidianArmorMod" />
15+
16+
<mod-metadata
17+
name="Obsidian Armor"
18+
description="A mod written in Haxe!"
19+
/>
20+
21+
<mod-contact
22+
homepage="htts://github.com/elitemastereric/pickhaxe"
23+
24+
irc="irc://irc.esper.net:6667/charset"
25+
issues="htts://github.com/elitemastereric/pickhaxe/issues"
26+
sources="htts://github.com/elitemastereric/pickhaxe"
27+
/>
28+
29+
<mod-author name="EliteMasterEric">
30+
<mod-contact email="[email protected]" />
31+
</mod-author>
32+
33+
<!-- https://spdx.org/licenses/ -->
34+
<mod-license value="MIT" />
35+
</pickhaxe>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"itemGroup.obsidianarmor.obsidian_armor": "Obsidian Armor",
3+
4+
"item.obsidianarmor.obsidian_helmet": "Obsidian Helmet",
5+
"item.obsidianarmor.obsidian_chestplate": "Obsidian Chestplate",
6+
"item.obsidianarmor.obsidian_leggings": "Obsidian Leggings",
7+
"item.obsidianarmor.obsidian_boots": "Obsidian Boots",
8+
9+
"item.obsidianarmor.obsidian_pickaxe": "Obsidian Pickaxe",
10+
"item.obsidianarmor.obsidian_axe": "Obsidian Axe",
11+
"item.obsidianarmor.obsidian_shovel": "Obsidian Shovel",
12+
"item.obsidianarmor.obsidian_hoe": "Obsidian Hoe",
13+
"item.obsidianarmor.obsidian_sword": "Obsidian Sword"
14+
}

0 commit comments

Comments
 (0)