Small tweak.

2.x-1.16
Szum123321 2020-05-08 23:33:43 +02:00
parent 7e1fe5a602
commit 5d1bdf5e9e
4 changed files with 15 additions and 12 deletions

View File

@ -50,13 +50,6 @@ public class TextileBackup implements ModInitializer {
config = ConfigManager.loadConfig(ConfigHandler.class);
registerCommands();
ServerStartCallback.EVENT.register(server -> {
LevelStorage.Session session = ((MinecraftServerSessionAccessor)server).getSession();
System.out.println(session.getDirectory(class_5218.field_24188).toAbsolutePath());
System.out.println(session.method_27424(DimensionType.OVERWORLD).toPath().toAbsolutePath());
});
}
private void registerCommands(){

View File

@ -8,6 +8,7 @@ import net.minecraft.command.arguments.EntityArgumentType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.LiteralText;
import net.minecraft.text.TranslatableText;
import net.szum123321.textile_backup.TextileBackup;
@ -51,7 +52,7 @@ public class BlacklistCommand {
}
private static int executeAdd(CommandContext<ServerCommandSource> ctx) throws CommandSyntaxException {
PlayerEntity player = EntityArgumentType.getPlayer(ctx, "player");
ServerPlayerEntity player = EntityArgumentType.getPlayer(ctx, "player");
if(TextileBackup.config.playerBlacklist.contains(player.getEntityName())) {
ctx.getSource().sendFeedback(new TranslatableText("Player: %s is already blacklisted.", player.getEntityName()), false);
@ -72,6 +73,8 @@ public class BlacklistCommand {
builder.append(" successfully.");
ctx.getSource().getMinecraftServer().getCommandManager().sendCommandTree(player);
Utilities.log(builder.toString(), ctx.getSource());
}
@ -79,7 +82,7 @@ public class BlacklistCommand {
}
private static int executeRemove(CommandContext<ServerCommandSource> ctx) throws CommandSyntaxException {
PlayerEntity player = EntityArgumentType.getPlayer(ctx, "player");
ServerPlayerEntity player = EntityArgumentType.getPlayer(ctx, "player");
if(!TextileBackup.config.playerBlacklist.contains(player.getEntityName())) {
ctx.getSource().sendFeedback(new TranslatableText("Player: %s newer was blacklisted.", player.getEntityName()), false);
@ -93,6 +96,8 @@ public class BlacklistCommand {
builder.append(player.getEntityName());
builder.append(" removed from the blacklist successfully.");
ctx.getSource().getMinecraftServer().getCommandManager().sendCommandTree(player);
Utilities.log(builder.toString(), ctx.getSource());
}

View File

@ -8,6 +8,7 @@ import net.minecraft.command.arguments.EntityArgumentType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.LiteralText;
import net.minecraft.text.TranslatableText;
import net.szum123321.textile_backup.TextileBackup;
@ -51,7 +52,7 @@ public class WhitelistCommand {
}
private static int executeAdd(CommandContext<ServerCommandSource> ctx) throws CommandSyntaxException {
PlayerEntity player = EntityArgumentType.getPlayer(ctx, "player");
ServerPlayerEntity player = EntityArgumentType.getPlayer(ctx, "player");
if(TextileBackup.config.playerWhitelist.contains(player.getEntityName())) {
ctx.getSource().sendFeedback(new TranslatableText("Player: %s is already whitelisted.", player.getEntityName()), false);
@ -72,6 +73,8 @@ public class WhitelistCommand {
builder.append(" successfully.");
ctx.getSource().getMinecraftServer().getCommandManager().sendCommandTree(player);
Utilities.log(builder.toString(), ctx.getSource());
}
@ -79,7 +82,7 @@ public class WhitelistCommand {
}
private static int executeRemove(CommandContext<ServerCommandSource> ctx) throws CommandSyntaxException {
PlayerEntity player = EntityArgumentType.getPlayer(ctx, "player");
ServerPlayerEntity player = EntityArgumentType.getPlayer(ctx, "player");
if(!TextileBackup.config.playerWhitelist.contains(player.getEntityName())) {
ctx.getSource().sendFeedback(new TranslatableText("Player: %s newer was on the whitelist.", player.getEntityName()), false);
@ -92,6 +95,8 @@ public class WhitelistCommand {
builder.append(player.getEntityName());
builder.append(" removed from the whitelist successfully.");
ctx.getSource().getMinecraftServer().getCommandManager().sendCommandTree(player);
Utilities.log(builder.toString(), ctx.getSource());
}

View File

@ -29,6 +29,6 @@
"depends": {
"fabricloader": ">=0.7.2",
"fabric": "*",
"minecraft": "1.16.*"
"minecraft": ">=1.16-alpha.20.19.a"
}
}