Skip to content

Commit

Permalink
Add argsOnly = true to Local annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
ArkoSammy12 committed Jun 24, 2024
1 parent 5064756 commit c5316f1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class BlockMixin {

@SuppressWarnings("UnreachableCode")
@ModifyReturnValue(method = "shouldDropItemsOnExplosion", at = @At("RETURN"))
private boolean shouldExplosionDropItems(boolean original, @Local Explosion explosion){
private boolean shouldExplosionDropItems(boolean original, @Local(argsOnly = true) Explosion explosion){

// Hardcoded exception. Place before all other logic
if(ExcludedBlocks.isExcluded((Block)(Object)this)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class FallingBlockMixin {

@ModifyExpressionValue(method = "scheduledTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/FallingBlock;canFallThrough(Lnet/minecraft/block/BlockState;)Z"))
private boolean onBlockAttemptedFall(boolean original, @Local BlockState blockState){
private boolean onBlockAttemptedFall(boolean original, @Local(argsOnly = true) BlockState blockState){
// Hardcoded Exception. Place before all other logic
if(ExcludedBlocks.isExcluded(blockState)){
return original;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public class ItemScattererMixin {

@WrapOperation(method = "spawn(Lnet/minecraft/world/World;DDDLnet/minecraft/inventory/Inventory;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/ItemScatterer;spawn(Lnet/minecraft/world/World;DDDLnet/minecraft/item/ItemStack;)V"))
private static void cancelItemScatteringFromInventoryBlocks(World world, double x, double y, double z, ItemStack stack, Operation<Void> original, @Local Inventory inventory){
private static void cancelItemScatteringFromInventoryBlocks(World world, double x, double y, double z, ItemStack stack, Operation<Void> original, @Local(argsOnly = true) Inventory inventory){
// Hardcoded exception. Place before all other logic
if(inventory instanceof BlockEntity blockEntity && ExcludedBlocks.isExcluded(blockEntity.getCachedState().getBlock())){
original.call(world, x, y, z, stack);
Expand Down

0 comments on commit c5316f1

Please sign in to comment.