parent
a605b07d4a
commit
56fcfdfe64
|
@ -2,12 +2,12 @@
|
|||
org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Fabric properties
|
||||
minecraft_version=1.15.2
|
||||
yarn_mappings=1.15.2+build.1
|
||||
loader_version=0.7.5+build.178
|
||||
minecraft_version=20w08a
|
||||
yarn_mappings=20w08a+build.2
|
||||
loader_version=0.7.8+build.184
|
||||
|
||||
#Fabric api
|
||||
fabric_version=0.4.29+build.290-1.15
|
||||
fabric_version=0.4.33+build.299-1.16
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.2.0
|
||||
|
|
|
@ -6,7 +6,6 @@ import net.fabricmc.fabric.api.event.server.ServerStopCallback;
|
|||
import net.fabricmc.fabric.api.registry.CommandRegistry;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
@ -14,8 +13,8 @@ import org.samo_lego.simpleauth.commands.*;
|
|||
import org.samo_lego.simpleauth.database.SimpleAuthDatabase;
|
||||
import org.samo_lego.simpleauth.event.AuthEventHandler;
|
||||
import org.samo_lego.simpleauth.event.entity.player.ChatCallback;
|
||||
import org.samo_lego.simpleauth.event.entity.player.PlayerMoveCallback;
|
||||
import org.samo_lego.simpleauth.event.entity.player.PlayerJoinServerCallback;
|
||||
import org.samo_lego.simpleauth.event.entity.player.PlayerMoveCallback;
|
||||
import org.samo_lego.simpleauth.event.item.DropItemCallback;
|
||||
import org.samo_lego.simpleauth.utils.AuthConfig;
|
||||
|
||||
|
|
|
@ -2,12 +2,10 @@ package org.samo_lego.simpleauth.event;
|
|||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.network.packet.ChatMessageC2SPacket;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.TypedActionResult;
|
||||
import org.samo_lego.simpleauth.SimpleAuth;
|
||||
|
@ -32,9 +30,9 @@ public class AuthEventHandler {
|
|||
// Player joining the server
|
||||
public static void onPlayerJoin(ServerPlayerEntity player) {
|
||||
SimpleAuth.deauthenticatedUsers.add(player);
|
||||
/*CompoundTag tag = new CompoundTag();
|
||||
tag.putInt("loginTries", 0);
|
||||
player.writeCustomDataToTag(tag);*/
|
||||
/*CompoundTag loginTries = new CompoundTag();
|
||||
loginTries.putInt("loginTries", 0);
|
||||
player.saveToTag(loginTries);*/
|
||||
// Player not authenticated
|
||||
// If clause actually not needed, since we add player to deauthenticated hashset above
|
||||
if (!SimpleAuth.isAuthenticated(player)) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package org.samo_lego.simpleauth.event.entity.player;
|
|||
import net.fabricmc.fabric.api.event.Event;
|
||||
import net.fabricmc.fabric.api.event.EventFactory;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.server.network.packet.ChatMessageC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
|
||||
import net.minecraft.util.ActionResult;
|
||||
|
||||
public interface ChatCallback {
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package org.samo_lego.simpleauth.mixin;
|
||||
|
||||
import net.minecraft.client.network.packet.EntityS2CPacket;
|
||||
import net.minecraft.network.NetworkThreadUtils;
|
||||
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||
import net.minecraft.server.network.ServerPlayNetworkHandler;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.network.packet.ChatMessageC2SPacket;
|
||||
import net.minecraft.server.network.packet.PlayerMoveC2SPacket;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import org.samo_lego.simpleauth.event.entity.player.ChatCallback;
|
||||
import org.samo_lego.simpleauth.event.entity.player.PlayerMoveCallback;
|
||||
|
@ -20,8 +18,8 @@ public abstract class MixinServerPlayNetworkHandler {
|
|||
@Shadow
|
||||
public ServerPlayerEntity player;
|
||||
|
||||
@Inject(
|
||||
method = "onChatMessage(Lnet/minecraft/server/network/packet/ChatMessageC2SPacket;)V",
|
||||
@Inject( //todo check on fabric discord in #botposting(`!ym onGameMessage`)
|
||||
method = "onGameMessage",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
// Thanks to Liach for helping me out!
|
||||
|
@ -39,7 +37,7 @@ public abstract class MixinServerPlayNetworkHandler {
|
|||
}
|
||||
|
||||
@Inject(
|
||||
method="onPlayerMove(Lnet/minecraft/server/network/packet/PlayerMoveC2SPacket;)V",
|
||||
method="onPlayerMove(Lnet/minecraft/network/packet/c2s/play/PlayerMoveC2SPacket;)V",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
// Thanks to Liach for helping me out!
|
||||
|
|
Loading…
Reference in New Issue