-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: stupid dumb no-good crash patches
- Loading branch information
1 parent
8ba0aae
commit aafb4f5
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/main/java/io/pyke/vitri/finorza/inference/mixin/ducttape/RecipeBookComponentMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.pyke.vitri.finorza.inference.mixin.ducttape; | ||
|
||
import net.minecraft.client.gui.components.EditBox; | ||
import net.minecraft.client.gui.screens.recipebook.RecipeBookComponent; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(RecipeBookComponent.class) | ||
public class RecipeBookComponentMixin { | ||
@Shadow | ||
private EditBox searchBox; | ||
|
||
@Inject(method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;IIF)V", at = @At("HEAD"), cancellable = true) | ||
private void render(CallbackInfo ci) { | ||
if (searchBox == null) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/io/pyke/vitri/finorza/inference/mixin/ducttape/RecipeButtonMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.pyke.vitri.finorza.inference.mixin.ducttape; | ||
|
||
import java.util.List; | ||
|
||
import net.minecraft.client.gui.components.EditBox; | ||
import net.minecraft.client.gui.screens.recipebook.RecipeBookComponent; | ||
import net.minecraft.client.gui.screens.recipebook.RecipeButton; | ||
import net.minecraft.world.item.crafting.Recipe; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(RecipeButton.class) | ||
public abstract class RecipeButtonMixin { | ||
@Shadow | ||
protected abstract List<Recipe<?>> getOrderedRecipes(); | ||
|
||
@Inject(method = "Lnet/minecraft/client/gui/screens/recipebook/RecipeButton;renderButton(Lcom/mojang/blaze3d/vertex/PoseStack;IIF)V", at = @At(value = "HEAD"), cancellable = true) | ||
private void render(CallbackInfo ci) { | ||
if (this.getOrderedRecipes().isEmpty()) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters