Further updated the justfile for creating backups and patches

master
Wynd 2025-04-05 12:19:27 +03:00
parent 2f9239bc28
commit 8921671f23
4 changed files with 24 additions and 9 deletions

View File

@ -6,9 +6,19 @@ modVersion := "1.4.0"
setup:
./cleanup.sh
./decompile.sh
just create-bakups
[working-directory: './src/minecraft/net/minecraft/src/']
apply-patch:
create-bakups:
#!/usr/bin/env bash
(for file in $(fd --no-ignore ".java"); do
[ -e "$file" ] || continue
bak="$file.bak"
cp "$file" "$bak"
done)
[working-directory: './src/minecraft/net/minecraft/src/']
apply-patches:
#!/usr/bin/env bash
(for file in $(fd --no-ignore ".java.bak"); do
core="${file/.bak/}"
@ -19,10 +29,15 @@ apply-patch:
done)
[working-directory: './src/minecraft/net/minecraft/src/']
create-patch:
create-patches:
#!/usr/bin/env bash
(for file in $(fd --no-ignore ".java.bak"); do
core="${file/.bak/}"
# check to see if the file has been changed
check="$(cmp -s $file $core && echo 1 || echo 0)"
[ $check -eq 0 ] || continue
patch="${core}.patch"
echo "Creating patch file for $core"
diff -Nau "$file" "$core" > "$patch" || true
@ -31,7 +46,7 @@ create-patch:
build:
# Delete previous builds
fd . './builds' -e .zip --exec rm
just create-patch
just create-patches
./recompile.sh
./reobfuscate.sh
(cd ./reobf/minecraft && zip -r "../../builds/${modName}-${modVersion}-modloader.zip" ./*)

View File

@ -1,5 +1,5 @@
--- BlockBed.java.bak 2025-04-04 22:37:36.783594000 +0300
+++ BlockBed.java 2025-04-04 23:36:32.041452482 +0300
+++ BlockBed.java 2025-04-05 00:03:29.834894265 +0300
@@ -22,6 +22,9 @@
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)

View File

@ -1,5 +1,5 @@
--- BlockReed.java.bak 2025-04-04 22:55:28.995768000 +0300
+++ BlockReed.java 2025-04-04 23:43:43.870642705 +0300
+++ BlockReed.java 2025-04-05 00:03:29.836894244 +0300
@@ -50,7 +50,7 @@
{
return true;

View File

@ -7,7 +7,7 @@ public class mod_FinalBeta extends BaseMod {
public static final Logger LOGGER = Logger.getLogger("FinalBeta");
public mod_FinalBeta() {
// ModLoader.SetInGameHook(this, true, true);
// ModLoader.SetInGameHook(this, true, true);
}
@Override