Fixed getToolModifiedState for AXE_SCRAPE

This commit is contained in:
coolsim 2026-08-22 15:34:42 +10:00 committed by GitHub
parent b1008b481b
commit 5599f34c6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,7 +25,7 @@
return strippedBlock;
} else {
- Optional<BlockState> scrapedBlock = WeatheringCopper.getPrevious(oldState);
+ var scrape = ctx == null ? null : oldState.getToolModifiedState(ctx, net.minecraftforge.common.ToolActions.AXE_STRIP, false);
+ var scrape = ctx == null ? null : oldState.getToolModifiedState(ctx, net.minecraftforge.common.ToolActions.AXE_SCRAPE, false);
+ Optional<BlockState> scrapedBlock = scrape != null ? Optional.of(scrape) : WeatheringCopper.getPrevious(oldState);
if (scrapedBlock.isPresent()) {
spawnSoundAndParticle(level, pos, player, oldState, SoundEvents.AXE_SCRAPE, 3005);