Skip to content

Commit

Permalink
Implement /map (for clearing)
Browse files Browse the repository at this point in the history
  • Loading branch information
magicus committed Nov 14, 2021
1 parent 9096747 commit d415421
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -63,4 +66,11 @@ public void updateBlock(BlockPos pos) {
DrawableMapRegion region = getOrCreateRegion(regionPos);
region.updateBlock(pos);
}

@Override
public int onMapCommand(CommandContext<ServerCommandSource> context) {
registry.clear();
context.getSource().sendFeedback(new LiteralText("Map cleared"), false);
return 0;
}
}

0 comments on commit d415421

Please sign in to comment.