20w14a update

Updating, plus fixing colors in config.
This commit is contained in:
samo_lego 2020-04-05 20:23:11 +02:00
parent af1c51bf73
commit 5aa82f0db0
5 changed files with 5 additions and 9 deletions

View File

@ -6,8 +6,6 @@ import net.fabricmc.fabric.api.event.server.ServerStopCallback;
import net.fabricmc.fabric.api.registry.CommandRegistry;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.Inventory;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
@ -25,7 +23,6 @@ import org.samo_lego.simpleauth.utils.AuthConfig;
import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Timer;
import java.util.TimerTask;
@ -34,7 +31,7 @@ public class SimpleAuth implements DedicatedServerModInitializer {
public static SimpleAuthDatabase db = new SimpleAuthDatabase();
// HashSet of players that are not authenticated
// HashMap of players that are not authenticated
// Rather than storing all the authenticated players, we just store ones that are not authenticated
public static HashMap<PlayerEntity, Integer> deauthenticatedUsers = new HashMap<>();

View File

@ -37,7 +37,6 @@ public class LoginCommand {
// Method called for checking the password
private static int login(ServerCommandSource source, String pass) throws CommandSyntaxException {
// Getting the player who send the command
System.out.println(maxLoginTries);
ServerPlayerEntity player = source.getPlayer();
if(SimpleAuth.isAuthenticated(player)) {

View File

@ -24,7 +24,7 @@ public abstract class MixinPlayerEntity {
new ScreenHandlerSlotUpdateS2CPacket(
-2,
player.inventory.selectedSlot,
player.inventory.getInvStack(player.inventory.selectedSlot))
player.inventory.getStack(player.inventory.selectedSlot))
);
player.networkHandler.sendPacket(new ScreenHandlerSlotUpdateS2CPacket(-1, -1, player.inventory.getCursorStack()));
cir.setReturnValue(false);

View File

@ -25,7 +25,7 @@ public abstract class MixinSlot {
new ScreenHandlerSlotUpdateS2CPacket(
-2,
player.inventory.selectedSlot,
player.inventory.getInvStack(player.inventory.selectedSlot))
player.inventory.getStack(player.inventory.selectedSlot))
);
player.networkHandler.sendPacket(new ScreenHandlerSlotUpdateS2CPacket(-1, -1, player.inventory.getCursorStack()));
cir.setReturnValue(false);

View File

@ -74,8 +74,8 @@ public class AuthConfig {
public String loginRequired = "§cYou are not authenticated!\n§6Use /login to authenticate!";
public String loginTriesExceeded = "§4Too many login tries.";
public String globalPasswordSet = "§aGlobal password was successfully set!";
public String cannotChangePassword = "§aYou cannot change password!";
public String cannotUnregister = "§aYou cannot unregister this account!";
public String cannotChangePassword = "§cYou cannot change password!";
public String cannotUnregister = "§cYou cannot unregister this account!";
public String notAuthenticated = "§cYou are not authenticated!\n§6Try with /login or /register.";
public String alreadyAuthenticated = "§6You are already authenticated.";
public String successfullyAuthenticated = "§aYou are now authenticated.";