Skip to content

Commit

Permalink
ci(fabric): cmd run fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlimiter committed Feb 18, 2024
1 parent 247d8d4 commit ddde41b
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions fabric/src/main/java/cn/evole/mods/mcbot/cmds/BotCmdRun.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import cn.evole.mods.mcbot.McBot;
import net.minecraft.commands.CommandSource;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
Expand Down Expand Up @@ -34,15 +35,12 @@
*/
public class BotCmdRun extends CommandSourceStack {

//#if MC >= 11900
public static BotCmdRun CUSTOM = new BotCmdRun(CommandSource.NULL, Vec3.ZERO, Vec2.ZERO, McBot.SERVER.overworld(), 0, "Bot", Component.literal("Bot"), McBot.SERVER, null);
public static BotCmdRun OP = new BotCmdRun(CommandSource.NULL, Vec3.ZERO, Vec2.ZERO, McBot.SERVER.overworld(), 4, "OP", Component.literal("OP"), McBot.SERVER, null);
//#elseif MC < 11600
//$$ public static BotCmdRun CUSTOM = new BotCmdRun(CommandSource.NULL, Vec3.ZERO, Vec2.ZERO, McBot.SERVER.getLevel(DimensionType.OVERWORLD), 0, "Bot", new TextComponent("Bot"), McBot.SERVER, null);
//$$ public static BotCmdRun OP = new BotCmdRun(CommandSource.NULL, Vec3.ZERO, Vec2.ZERO, McBot.SERVER.getLevel(DimensionType.OVERWORLD), 4, "OP", new TextComponent("OP"), McBot.SERVER, null);
//#if MC < 11900
public static BotCmdRun CUSTOM = new BotCmdRun(CommandSource.NULL, Vec3.ZERO, Vec2.ZERO, McBot.SERVER.overworld(), 0, "Bot", new TextComponent("Bot"), McBot.SERVER, null);
public static BotCmdRun OP = new BotCmdRun(CommandSource.NULL, Vec3.ZERO, Vec2.ZERO, McBot.SERVER.overworld(), 4, "OP", new TextComponent("OP"), McBot.SERVER, null);
//#else
//$$ public static BotCmdRun CUSTOM = new BotCmdRun(CommandSource.NULL, Vec3.ZERO, Vec2.ZERO, McBot.SERVER.overworld(), 0, "Bot", new TextComponent("Bot"), McBot.SERVER, null);
//$$ public static BotCmdRun OP = new BotCmdRun(CommandSource.NULL, Vec3.ZERO, Vec2.ZERO, McBot.SERVER.overworld(), 4, "OP", new TextComponent("OP"), McBot.SERVER, null);
//$$ public static BotCmdRun CUSTOM = new BotCmdRun(CommandSource.NULL, Vec3.ZERO, Vec2.ZERO, McBot.SERVER.overworld(), 0, "Bot", Component.literal("Bot"), McBot.SERVER, null);
//$$ public static BotCmdRun OP = new BotCmdRun(CommandSource.NULL, Vec3.ZERO, Vec2.ZERO, McBot.SERVER.overworld(), 4, "OP", Component.literal("OP"), McBot.SERVER, null);
//#endif


Expand All @@ -53,17 +51,17 @@ public BotCmdRun(CommandSource commandSource, Vec3 vec3, Vec2 vec2, ServerLevel
}

//#if MC >= 12000
@Override
public void sendSuccess(Supplier<Component> supplier, boolean bl) {
super.sendSuccess(supplier, bl);
this.outPut.add(supplier.get().getString());
}
//#else
//$$ @Override
//$$ public void sendSuccess(@NotNull Component component, boolean p_81356_) {
//$$ super.sendSuccess(component, p_81356_);
//$$ this.outPut.add(component.getString());
//$$ public void sendSuccess(Supplier<Component> supplier, boolean bl) {
//$$ super.sendSuccess(supplier, bl);
//$$ this.outPut.add(supplier.get().getString());
//$$ }
//#else
@Override
public void sendSuccess(@NotNull Component component, boolean p_81356_) {
super.sendSuccess(component, p_81356_);
this.outPut.add(component.getString());
}
//#endif

}

0 comments on commit ddde41b

Please sign in to comment.