Build fixes, present in previous commit.
This commit is contained in:
parent
efe8f5727c
commit
2d6911484a
|
@ -188,7 +188,7 @@ public class AuthEventHandler {
|
||||||
// Getting the message to then be able to check it
|
// Getting the message to then be able to check it
|
||||||
String msg = chatMessageC2SPacket.getChatMessage();
|
String msg = chatMessageC2SPacket.getChatMessage();
|
||||||
if(
|
if(
|
||||||
!isAuthenticated(player) &&
|
!isAuthenticated((ServerPlayerEntity) player) &&
|
||||||
!msg.startsWith("/login") &&
|
!msg.startsWith("/login") &&
|
||||||
!msg.startsWith("/register") &&
|
!msg.startsWith("/register") &&
|
||||||
(!config.experimental.allowChat || msg.startsWith("/"))
|
(!config.experimental.allowChat || msg.startsWith("/"))
|
||||||
|
@ -201,7 +201,7 @@ public class AuthEventHandler {
|
||||||
|
|
||||||
// Player movement
|
// Player movement
|
||||||
public static ActionResult onPlayerMove(PlayerEntity player) {
|
public static ActionResult onPlayerMove(PlayerEntity player) {
|
||||||
if(!isAuthenticated(player) && !config.experimental.allowMovement) {
|
if(!isAuthenticated((ServerPlayerEntity) player) && !config.experimental.allowMovement) {
|
||||||
return ActionResult.FAIL;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
return ActionResult.PASS;
|
return ActionResult.PASS;
|
||||||
|
@ -209,7 +209,7 @@ public class AuthEventHandler {
|
||||||
|
|
||||||
// Using a block (right-click function)
|
// Using a block (right-click function)
|
||||||
public static ActionResult onUseBlock(PlayerEntity player) {
|
public static ActionResult onUseBlock(PlayerEntity player) {
|
||||||
if(!isAuthenticated(player) && !config.experimental.allowBlockUse) {
|
if(!isAuthenticated((ServerPlayerEntity) player) && !config.experimental.allowBlockUse) {
|
||||||
player.sendMessage(notAuthenticated(), false);
|
player.sendMessage(notAuthenticated(), false);
|
||||||
return ActionResult.FAIL;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@ public class AuthEventHandler {
|
||||||
|
|
||||||
// Punching a block
|
// Punching a block
|
||||||
public static ActionResult onAttackBlock(PlayerEntity player) {
|
public static ActionResult onAttackBlock(PlayerEntity player) {
|
||||||
if(!isAuthenticated(player) && !config.experimental.allowBlockPunch) {
|
if(!isAuthenticated((ServerPlayerEntity) player) && !config.experimental.allowBlockPunch) {
|
||||||
player.sendMessage(notAuthenticated(), false);
|
player.sendMessage(notAuthenticated(), false);
|
||||||
return ActionResult.FAIL;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ public class AuthEventHandler {
|
||||||
|
|
||||||
// Using an item
|
// Using an item
|
||||||
public static TypedActionResult<ItemStack> onUseItem(PlayerEntity player) {
|
public static TypedActionResult<ItemStack> onUseItem(PlayerEntity player) {
|
||||||
if(!isAuthenticated(player) && !config.experimental.allowItemUse) {
|
if(!isAuthenticated((ServerPlayerEntity) player) && !config.experimental.allowItemUse) {
|
||||||
player.sendMessage(notAuthenticated(), false);
|
player.sendMessage(notAuthenticated(), false);
|
||||||
return TypedActionResult.fail(ItemStack.EMPTY);
|
return TypedActionResult.fail(ItemStack.EMPTY);
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,7 @@ public class AuthEventHandler {
|
||||||
}
|
}
|
||||||
// Dropping an item
|
// Dropping an item
|
||||||
public static ActionResult onDropItem(PlayerEntity player) {
|
public static ActionResult onDropItem(PlayerEntity player) {
|
||||||
if(!isAuthenticated(player) && !config.experimental.allowItemDrop) {
|
if(!isAuthenticated((ServerPlayerEntity) player) && !config.experimental.allowItemDrop) {
|
||||||
player.sendMessage(notAuthenticated(), false);
|
player.sendMessage(notAuthenticated(), false);
|
||||||
return ActionResult.FAIL;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ public class AuthEventHandler {
|
||||||
}
|
}
|
||||||
// Changing inventory (item moving etc.)
|
// Changing inventory (item moving etc.)
|
||||||
public static ActionResult onTakeItem(PlayerEntity player) {
|
public static ActionResult onTakeItem(PlayerEntity player) {
|
||||||
if(!isAuthenticated(player) && !config.experimental.allowItemMoving) {
|
if(!isAuthenticated((ServerPlayerEntity) player) && !config.experimental.allowItemMoving) {
|
||||||
player.sendMessage(notAuthenticated(), false);
|
player.sendMessage(notAuthenticated(), false);
|
||||||
return ActionResult.FAIL;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ public class AuthEventHandler {
|
||||||
}
|
}
|
||||||
// Attacking an entity
|
// Attacking an entity
|
||||||
public static ActionResult onAttackEntity(PlayerEntity player) {
|
public static ActionResult onAttackEntity(PlayerEntity player) {
|
||||||
if(!isAuthenticated(player) && !config.experimental.allowEntityPunch) {
|
if(!isAuthenticated((ServerPlayerEntity) player) && !config.experimental.allowEntityPunch) {
|
||||||
player.sendMessage(notAuthenticated(), false);
|
player.sendMessage(notAuthenticated(), false);
|
||||||
return ActionResult.FAIL;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
@ -262,7 +262,7 @@ public class AuthEventHandler {
|
||||||
}
|
}
|
||||||
// Interacting with entity
|
// Interacting with entity
|
||||||
public static ActionResult onUseEntity(PlayerEntity player) {
|
public static ActionResult onUseEntity(PlayerEntity player) {
|
||||||
if(!isAuthenticated(player) && !config.main.allowEntityInteract) {
|
if(!isAuthenticated((ServerPlayerEntity) player) && !config.main.allowEntityInteract) {
|
||||||
player.sendMessage(notAuthenticated(), false);
|
player.sendMessage(notAuthenticated(), false);
|
||||||
return ActionResult.FAIL;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package org.samo_lego.simpleauth.mixin;
|
||||||
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
import net.minecraft.network.ClientConnection;
|
import net.minecraft.network.ClientConnection;
|
||||||
import net.minecraft.server.MinecraftServer;
|
|
||||||
import net.minecraft.server.PlayerManager;
|
import net.minecraft.server.PlayerManager;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
import net.minecraft.text.LiteralText;
|
import net.minecraft.text.LiteralText;
|
||||||
|
@ -10,9 +9,7 @@ import net.minecraft.text.Text;
|
||||||
import org.samo_lego.simpleauth.event.entity.player.PlayerJoinServerCallback;
|
import org.samo_lego.simpleauth.event.entity.player.PlayerJoinServerCallback;
|
||||||
import org.samo_lego.simpleauth.event.entity.player.PlayerLeaveServerCallback;
|
import org.samo_lego.simpleauth.event.entity.player.PlayerLeaveServerCallback;
|
||||||
import org.samo_lego.simpleauth.event.entity.player.PrePlayerJoinCallback;
|
import org.samo_lego.simpleauth.event.entity.player.PrePlayerJoinCallback;
|
||||||
import org.spongepowered.asm.mixin.Final;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
@ -23,9 +20,6 @@ import java.net.SocketAddress;
|
||||||
@Mixin(PlayerManager.class)
|
@Mixin(PlayerManager.class)
|
||||||
public abstract class MixinPlayerManager {
|
public abstract class MixinPlayerManager {
|
||||||
|
|
||||||
@Final @Shadow
|
|
||||||
private MinecraftServer server;
|
|
||||||
|
|
||||||
@Inject(method = "onPlayerConnect(Lnet/minecraft/network/ClientConnection;Lnet/minecraft/server/network/ServerPlayerEntity;)V", at = @At("RETURN"))
|
@Inject(method = "onPlayerConnect(Lnet/minecraft/network/ClientConnection;Lnet/minecraft/server/network/ServerPlayerEntity;)V", at = @At("RETURN"))
|
||||||
private void onPlayerConnect(ClientConnection clientConnection, ServerPlayerEntity serverPlayerEntity, CallbackInfo ci) {
|
private void onPlayerConnect(ClientConnection clientConnection, ServerPlayerEntity serverPlayerEntity, CallbackInfo ci) {
|
||||||
PlayerJoinServerCallback.EVENT.invoker().onPlayerJoin(serverPlayerEntity);
|
PlayerJoinServerCallback.EVENT.invoker().onPlayerJoin(serverPlayerEntity);
|
||||||
|
|
Loading…
Reference in New Issue