Skip to content

Commit

Permalink
1.18-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
samolego committed Nov 25, 2021
1 parent eb9a18a commit c8e6e2f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
# Use these Java versions
java: [16]
java: [17]
# and run on both Linux and Windows
os: [ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.os }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 16
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 16
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
minecraft_version=1.18-pre1
yarn_mappings=1.18-pre1+build.3
minecraft_version=1.18-rc1
yarn_mappings=1.18-rc1+build.1
loader_version=0.12.5

#Fabric api
fabric_version=0.42.2+1.18
fabric_version=0.43.1+1.18

# Mod Properties
mod_version = 0.4.1
mod_version = 0.4.2
maven_group = org.samo_lego
archives_base_name = golfiv
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https://services.gradle.org/distributions-snapshots/gradle-7.4-20211124232407+0000-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,21 @@
public abstract class ItemStackMixin_SavePatch {
@Shadow public abstract void setCount(int count);

@Shadow public abstract String getTranslationKey();

@Shadow public abstract Item getItem();

@Shadow public abstract int getCount();

@Inject(method = "writeNbt(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/nbt/NbtCompound;", at = @At("HEAD"), cancellable = true)
private void writeStack(NbtCompound nbt, CallbackInfoReturnable<NbtCompound> cir) {
if(golfConfig.duplication.patchItemSave) {
System.out.println("Saving " + this.getTranslationKey());

ItemStack copy = ((ItemStack) (Object) this).copy();
this.setCount(0);

System.out.println("This: " + this.getCount() + " vs copy: " + copy);

Identifier identifier = Registry.ITEM.getId(copy.getItem());
nbt.putString("id", identifier.toString());
nbt.putByte("Count", (byte)copy.getCount());
if (copy.getNbt() != null) {
nbt.put("tag", copy.getNbt().copy());
}

System.out.println(nbt);

cir.setReturnValue(nbt);
}
}
Expand Down

0 comments on commit c8e6e2f

Please sign in to comment.