1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-12-03 04:48:06 +00:00

Make turtle tools a little more flexible

Turtle tools now accept two additional JSON fields

 - allowEnchantments: Whether items with enchantments (or any
   non-standard NBT) can be equipped.
 - consumesDurability: Whether durability will be consumed. This can be
   "never" (the current and default behaviour), "always", and
   "when_enchanted".

Closes #1501.
This commit is contained in:
Jonathan Coates
2023-07-03 22:10:11 +01:00
parent 943a9406b1
commit a91ac6f214
9 changed files with 281 additions and 89 deletions

View File

@@ -6,6 +6,7 @@ package dan200.computercraft.shared.platform;
import com.mojang.authlib.GameProfile;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.EntityDimensions;
import net.minecraft.world.entity.Pose;
@@ -39,4 +40,9 @@ public final class FakePlayer extends net.fabricmc.fabric.api.entity.FakePlayer
public double getBlockReach() {
return MAX_REACH;
}
@Override
public boolean broadcastToPlayer(ServerPlayer player) {
return false;
}
}