Skip to content

Commit

Permalink
2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasualix committed Oct 1, 2023
1 parent 47c3317 commit 5368389
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 14 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Java CI with Gradle

on: [ pull_request, push ]

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Grant execute permission for Gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: build/libs
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ jar {
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
}
10 changes: 2 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@
potattributes_version=1.19.2-0.0.5

# Mod Properties
mod_version=1.19.2-2.1.0
mod_version=1.19.2-2.1.1
maven_group=com.teampotato.modifiers
archives_base_name=remodifier
mod_id=modifiers
mod_author=TeamPotato
# Proxy
# REMOVE THIS IF YOU WANT TO BUILD THIS PROJECT BY YOURSELF
systemProp.http.proxyHost=localhost
systemProp.http.proxyPort=7890
systemProp.https.proxyHost=localhost
systemProp.https.proxyPort=7890
mod_author=TeamPotato
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public MixinSmithingTableContainer(ScreenHandlerType<?> a, int b, PlayerInventor
ItemStack material = input.getStack(1);

if (ModifierHandler.canHaveModifiers(stack)) {
if (stack.getItem().canRepair(stack, material) || ReforgeConfig.UNIVERSAL_REFORGE_ITEM.get().equals(Objects.requireNonNull(ForgeRegistries.ITEMS.getKey(material.getItem())).toString())) {
if ((stack.getItem().canRepair(stack, material) && !ReforgeConfig.DISABLE_REPAIR_REFORGED.get()) || ReforgeConfig.UNIVERSAL_REFORGE_ITEM.get().equals(Objects.requireNonNull(ForgeRegistries.ITEMS.getKey(material.getItem())).toString())) {

boolean hadModifier = ModifierHandler.hasModifier(stack);
Modifier modifier = ModifierHandler.rollModifier(stack, ThreadLocalRandom.current());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ private void onDrawBackground(MatrixStack matrixStack, float f, int i, int j, Ca
this.drawTexture(matrixStack, k, l, 0, 0, this.backgroundWidth, this.backgroundHeight);
ItemStack stack1 = this.handler.getSlot(0).getStack();
ItemStack stack2 = this.handler.getSlot(1).getStack();
boolean isUniversal = ReforgeConfig.UNIVERSAL_REFORGE_ITEM.get().equals(Objects.requireNonNull(ForgeRegistries.ITEMS.getKey(stack2.getItem())).toString());

boolean isUniversalReforgeItem = ReforgeConfig.UNIVERSAL_REFORGE_ITEM.get().equals(Objects.requireNonNull(ForgeRegistries.ITEMS.getKey(stack2.getItem())).toString());
// TODO add a util function somewhere for `canReforge(stack1, stack2)`
boolean cantReforge = !stack1.isEmpty() && !stack1.getItem().canRepair(stack1, stack2);
if (isUniversal && cantReforge) cantReforge = false;
if (ReforgeConfig.DISABLE_REPAIR_REFORGED.get() && !cantReforge) cantReforge = true;
if (isUniversalReforgeItem && cantReforge) cantReforge = false;
// canReforge is also true for empty slot 1. Probably how it should behave.
((SmithingScreenReforge) this).modifiers_setCanReforge(!cantReforge);
if (!stack1.isEmpty() && !(stack1.getItem().canRepair(stack1, stack2) || isUniversal)) {
if (cantReforge) {
this.drawTexture(matrixStack, k + 99 - 53, l + 45, this.backgroundWidth, 0, 28, 21);
}
}
Expand Down

0 comments on commit 5368389

Please sign in to comment.