mirror of
https://github.com/TibiNonEst/cauldron-dyeing.git
synced 2024-11-24 03:27:19 -05:00
Improve mixins
Include descriptors on lambda mixins et al.
This commit is contained in:
parent
bd52a34644
commit
457dffa328
3 changed files with 7 additions and 7 deletions
|
@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
@Mixin(BiomeColors.class)
|
||||
public class BiomeColorsMixin {
|
||||
@Inject(method = "getWaterColor", at = @At("HEAD"), cancellable = true)
|
||||
private static void modifyWaterColor(BlockRenderView world, BlockPos pos, CallbackInfoReturnable<Integer> cir) {
|
||||
private static void cauldron_dyeing$modifyWaterColor(BlockRenderView world, BlockPos pos, CallbackInfoReturnable<Integer> cir) {
|
||||
var blockEntity = world.getBlockEntity(pos);
|
||||
|
||||
if (blockEntity instanceof WaterCauldronBlockEntity waterCauldron && waterCauldron.getColor() != -1) {
|
||||
|
|
|
@ -25,8 +25,8 @@ import java.util.Map;
|
|||
|
||||
@Mixin(CauldronBehavior.class)
|
||||
public interface CauldronBehaviorMixin {
|
||||
@Inject(method = "method_32209", at = @At("HEAD"), cancellable = true)
|
||||
private static void injectCleanDyeableItem(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack, CallbackInfoReturnable<ActionResult> cir) {
|
||||
@Inject(method = "m_ducbhfos(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/ActionResult;", at = @At("HEAD"), cancellable = true)
|
||||
private static void cauldron_dyeing$injectCleanDyeableItem(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack, CallbackInfoReturnable<ActionResult> cir) {
|
||||
var blockEntity = world.getBlockEntity(pos);
|
||||
var item = stack.getItem();
|
||||
|
||||
|
@ -41,8 +41,8 @@ public interface CauldronBehaviorMixin {
|
|||
}
|
||||
}
|
||||
|
||||
@Inject(method = "method_32217", at = @At(value = "TAIL"))
|
||||
private static void injectFillWithWater(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack, CallbackInfoReturnable<ActionResult> cir) {
|
||||
@Inject(method = "m_xrdlazrh(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/ActionResult;", at = @At(value = "TAIL"))
|
||||
private static void cauldron_dyeing$injectFillWithWater(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack, CallbackInfoReturnable<ActionResult> cir) {
|
||||
var blockEntity = world.getBlockEntity(pos);
|
||||
if (blockEntity instanceof WaterCauldronBlockEntity waterCauldron) {
|
||||
waterCauldron.resetColor();
|
||||
|
@ -50,7 +50,7 @@ public interface CauldronBehaviorMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "registerBehavior", at = @At("TAIL"))
|
||||
private static void injectRegisterBehavior(CallbackInfo ci) {
|
||||
private static void cauldron_dyeing$injectRegisterBehavior(CallbackInfo ci) {
|
||||
var dyeMap = DyeItemAccessor.getDyeMap();
|
||||
for (Map.Entry<DyeColor, DyeItem> dyeItem : dyeMap.entrySet()) {
|
||||
CauldronBehavior.WATER_CAULDRON_BEHAVIOR.put(dyeItem.getValue(), CauldronBehaviorExtended.DYE_WATER);
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||
@Mixin(BlockRenderer.class)
|
||||
public class SodiumBlockRendererMixin {
|
||||
@Redirect(method = "renderQuad", at = @At(value = "INVOKE", target = "Lme/jellysquid/mods/sodium/client/model/quad/blender/ColorBlender;getColors(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/util/math/BlockPos;Lme/jellysquid/mods/sodium/client/model/quad/ModelQuadView;Lme/jellysquid/mods/sodium/client/model/quad/blender/ColorSampler;Ljava/lang/Object;)[I"))
|
||||
private <T> int[] redirectGetColors(ColorBlender instance, BlockRenderView world, BlockPos pos, ModelQuadView quad, ColorSampler<T> sampler, T state) {
|
||||
private <T> int[] cauldron_dyeing$redirectGetColors(ColorBlender instance, BlockRenderView world, BlockPos pos, ModelQuadView quad, ColorSampler<T> sampler, T state) {
|
||||
var blockEntity = world.getBlockEntity(pos);
|
||||
|
||||
if (blockEntity instanceof WaterCauldronBlockEntity) {
|
||||
|
|
Loading…
Reference in a new issue