From d4154215344b83557ebf40bc01b6034e89b8c9c5 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Sun, 14 Nov 2021 17:40:34 +0100 Subject: [PATCH] Implement /map (for clearing) --- .../bulldog/justmap/map/data/fast/FastWorldMapper.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/ru/bulldog/justmap/map/data/fast/FastWorldMapper.java b/src/main/java/ru/bulldog/justmap/map/data/fast/FastWorldMapper.java index 48f46eb2..31bba79e 100644 --- a/src/main/java/ru/bulldog/justmap/map/data/fast/FastWorldMapper.java +++ b/src/main/java/ru/bulldog/justmap/map/data/fast/FastWorldMapper.java @@ -3,6 +3,9 @@ import java.util.HashMap; import java.util.Map; +import com.mojang.brigadier.context.CommandContext; +import net.minecraft.server.command.ServerCommandSource; +import net.minecraft.text.LiteralText; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.WorldChunk; @@ -63,4 +66,11 @@ public void updateBlock(BlockPos pos) { DrawableMapRegion region = getOrCreateRegion(regionPos); region.updateBlock(pos); } + + @Override + public int onMapCommand(CommandContext context) { + registry.clear(); + context.getSource().sendFeedback(new LiteralText("Map cleared"), false); + return 0; + } }