Merge branch 'master' into 1.17

# Conflicts:
#	src/main/java/carpet/script/utils/SnoopyCommandSource.java
#	src/main/java/carpet/utils/WoolTool.java
This commit is contained in:
gnembon committed 2021-05-18 21:23:15 -03:00
commit b80b555781
9 files changed
+147 -12

No files matched your search

@@ -19,6 +19,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import carpet.helpers.HopperCounter;
import carpet.utils.WoolTool;
/**
* The {@link Mixin} which removes items in a hopper if it points into a wool counter, and calls {@link HopperCounter#add}
*/
@Mixin(HopperBlockEntity.class)
public abstract class HopperBlockEntityMixin extends LootableContainerBlockEntity
{
@@ -30,6 +33,9 @@ public abstract class HopperBlockEntityMixin extends LootableContainerBlockEntit
@Shadow public abstract void setStack(int slot, ItemStack stack);
/**
* A method to remove items from hoppers pointing into wool and count them via {@link HopperCounter#add} method
*/
@Inject(method = "insert", at = @At("HEAD"), cancellable = true)
private static void onInsert(World world, BlockPos blockPos, BlockState blockState, Inventory inventory, CallbackInfoReturnable<Boolean> cir)
{
@@ -52,4 +58,4 @@ public abstract class HopperBlockEntityMixin extends LootableContainerBlockEntit
}
}
}
}
}