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)
|
@Mixin(BiomeColors.class)
|
||||||
public class BiomeColorsMixin {
|
public class BiomeColorsMixin {
|
||||||
@Inject(method = "getWaterColor", at = @At("HEAD"), cancellable = true)
|
@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);
|
var blockEntity = world.getBlockEntity(pos);
|
||||||
|
|
||||||
if (blockEntity instanceof WaterCauldronBlockEntity waterCauldron && waterCauldron.getColor() != -1) {
|
if (blockEntity instanceof WaterCauldronBlockEntity waterCauldron && waterCauldron.getColor() != -1) {
|
||||||
|
|
|
@ -25,8 +25,8 @@ import java.util.Map;
|
||||||
|
|
||||||
@Mixin(CauldronBehavior.class)
|
@Mixin(CauldronBehavior.class)
|
||||||
public interface CauldronBehaviorMixin {
|
public interface CauldronBehaviorMixin {
|
||||||
@Inject(method = "method_32209", at = @At("HEAD"), cancellable = true)
|
@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 injectCleanDyeableItem(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack, CallbackInfoReturnable<ActionResult> cir) {
|
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 blockEntity = world.getBlockEntity(pos);
|
||||||
var item = stack.getItem();
|
var item = stack.getItem();
|
||||||
|
|
||||||
|
@ -41,8 +41,8 @@ public interface CauldronBehaviorMixin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "method_32217", at = @At(value = "TAIL"))
|
@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 injectFillWithWater(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack, CallbackInfoReturnable<ActionResult> cir) {
|
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);
|
var blockEntity = world.getBlockEntity(pos);
|
||||||
if (blockEntity instanceof WaterCauldronBlockEntity waterCauldron) {
|
if (blockEntity instanceof WaterCauldronBlockEntity waterCauldron) {
|
||||||
waterCauldron.resetColor();
|
waterCauldron.resetColor();
|
||||||
|
@ -50,7 +50,7 @@ public interface CauldronBehaviorMixin {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "registerBehavior", at = @At("TAIL"))
|
@Inject(method = "registerBehavior", at = @At("TAIL"))
|
||||||
private static void injectRegisterBehavior(CallbackInfo ci) {
|
private static void cauldron_dyeing$injectRegisterBehavior(CallbackInfo ci) {
|
||||||
var dyeMap = DyeItemAccessor.getDyeMap();
|
var dyeMap = DyeItemAccessor.getDyeMap();
|
||||||
for (Map.Entry<DyeColor, DyeItem> dyeItem : dyeMap.entrySet()) {
|
for (Map.Entry<DyeColor, DyeItem> dyeItem : dyeMap.entrySet()) {
|
||||||
CauldronBehavior.WATER_CAULDRON_BEHAVIOR.put(dyeItem.getValue(), CauldronBehaviorExtended.DYE_WATER);
|
CauldronBehavior.WATER_CAULDRON_BEHAVIOR.put(dyeItem.getValue(), CauldronBehaviorExtended.DYE_WATER);
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
@Mixin(BlockRenderer.class)
|
@Mixin(BlockRenderer.class)
|
||||||
public class SodiumBlockRendererMixin {
|
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"))
|
@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);
|
var blockEntity = world.getBlockEntity(pos);
|
||||||
|
|
||||||
if (blockEntity instanceof WaterCauldronBlockEntity) {
|
if (blockEntity instanceof WaterCauldronBlockEntity) {
|
||||||
|
|
Loading…
Reference in a new issue