-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Potion of Small recipe, fix custom containers
- Loading branch information
1 parent
5f96e66
commit 2764367
Showing
9 changed files
with
99 additions
and
18 deletions.
There are no files selected for viewing
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
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
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
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
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
26 changes: 26 additions & 0 deletions
26
src/main/java/dev/schmarrn/mixin/BrewingStandBlockEntityMixin.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 dev.schmarrn.mixin; | ||
|
||
import dev.schmarrn.BeegSmol; | ||
import dev.schmarrn.brewing.CustomBrewingRecipes; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.level.block.entity.BrewingStandBlockEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(BrewingStandBlockEntity.class) | ||
public class BrewingStandBlockEntityMixin { | ||
@Inject( | ||
method = "canPlaceItem", | ||
at = @At(value="HEAD"), | ||
cancellable = true | ||
) | ||
private void bs$canPlaceItem(int i, ItemStack stack, CallbackInfoReturnable<Boolean> cir) { | ||
BeegSmol.LOGGER.info("Is basis? {}, {}", stack, CustomBrewingRecipes.isBasis(stack)); | ||
|
||
if (i != 3 && i != 4 && CustomBrewingRecipes.isBasis(stack)) { | ||
cir.setReturnValue(true); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/dev/schmarrn/mixin/BrewingStandMenuMixin.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,18 @@ | ||
package dev.schmarrn.mixin; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyReturnValue; | ||
import dev.schmarrn.brewing.CustomBrewingRecipes; | ||
import net.minecraft.world.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
@Mixin(targets = "net.minecraft.world.inventory.BrewingStandMenu$PotionSlot") | ||
public class BrewingStandMenuMixin { | ||
@ModifyReturnValue( | ||
method = "mayPlaceItem", | ||
at = @At("RETURN") | ||
) | ||
private static boolean bs$mayPlaceItem(boolean original, ItemStack stack) { | ||
return original || CustomBrewingRecipes.isBasis(stack); | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
{ | ||
"required": true, | ||
"package": "dev.schmarrn.mixin", | ||
"compatibilityLevel": "JAVA_21", | ||
"mixins": [ | ||
"PotionBrewingMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
"required": true, | ||
"package": "dev.schmarrn.mixin", | ||
"compatibilityLevel": "JAVA_21", | ||
"mixins": [ | ||
"BrewingStandBlockEntityMixin", | ||
"BrewingStandMenuMixin", | ||
"PotionBrewingMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |