33 lines
1.4 KiB
Java
33 lines
1.4 KiB
Java
package com.hypixel.hytale.builtin.buildertools.commands;
|
|
|
|
import com.hypixel.hytale.builtin.buildertools.BuilderToolsPlugin;
|
|
import com.hypixel.hytale.component.Ref;
|
|
import com.hypixel.hytale.component.Store;
|
|
import com.hypixel.hytale.protocol.GameMode;
|
|
import com.hypixel.hytale.server.core.command.system.CommandContext;
|
|
import com.hypixel.hytale.server.core.command.system.basecommands.AbstractPlayerCommand;
|
|
import com.hypixel.hytale.server.core.entity.entities.Player;
|
|
import com.hypixel.hytale.server.core.universe.PlayerRef;
|
|
import com.hypixel.hytale.server.core.universe.world.World;
|
|
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
|
|
import javax.annotation.Nonnull;
|
|
|
|
public class ClearEditHistory extends AbstractPlayerCommand {
|
|
public ClearEditHistory() {
|
|
super("clearEditHistory", "server.commands.clearhistory.desc");
|
|
this.setPermissionGroup(GameMode.Creative);
|
|
this.addAliases("clearHistory", "clearToolHistory");
|
|
}
|
|
|
|
@Override
|
|
protected void execute(
|
|
@Nonnull CommandContext context, @Nonnull Store<EntityStore> store, @Nonnull Ref<EntityStore> ref, @Nonnull PlayerRef playerRef, @Nonnull World world
|
|
) {
|
|
Player playerComponent = store.getComponent(ref, Player.getComponentType());
|
|
|
|
assert playerComponent != null;
|
|
|
|
BuilderToolsPlugin.addToQueue(playerComponent, playerRef, (r, s, c) -> s.clearHistory(r, c));
|
|
}
|
|
}
|