MOre fabric changes

This commit is contained in:
samolego 2021-01-27 11:21:38 +01:00
parent 37d4f207e2
commit 6920315952
7 changed files with 11 additions and 12 deletions

View File

@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "2.0.59"
id "forgified-fabric-loom" version "0.6.52" apply false
id "architectury-plugin" version "2.0.65"
id "forgified-fabric-loom" version "0.6.54" apply false
}
architectury {

View File

@ -132,7 +132,7 @@ public class AuthEventHandler {
}
// Player chatting
public static ActionResult onPlayerChat(PlayerEntity player, String message) {
public static ActionResult onPlayerChat(ServerPlayerEntity player, String message) {
// Getting the message to then be able to check it
if(
!((PlayerAuth) player).isAuthenticated() &&
@ -147,7 +147,7 @@ public class AuthEventHandler {
}
// Player movement
public static ActionResult onPlayerMove(PlayerEntity player) {
public static ActionResult onPlayerMove(ServerPlayerEntity player) {
// Player will fall if enabled (prevent fly kick)
boolean auth = ((PlayerAuth) player).isAuthenticated();
// Otherwise movement should be disabled
@ -195,7 +195,7 @@ public class AuthEventHandler {
return ActionResult.PASS;
}
// Changing inventory (item moving etc.)
public static ActionResult onTakeItem(PlayerEntity player) {
public static ActionResult onTakeItem(ServerPlayerEntity player) {
if(!((PlayerAuth) player).isAuthenticated() && !config.experimental.allowItemMoving) {
player.sendMessage(((PlayerAuth) player).getAuthMessage(), false);
return ActionResult.FAIL;

View File

@ -7,6 +7,6 @@ public class PlatformSpecific {
@ExpectPlatform
public static boolean isPlayerFake(PlayerEntity player) {
// Replaced by Architectury
throw new AssertionError();
return false;
}
}

View File

@ -14,7 +14,6 @@ public class SimpleAuthFabric implements ModInitializer {
@Override
public void onInitialize() {
SimpleAuth.init(FabricLoader.getInstance().getGameDir());
//FabricLoader.getInstance().isModLoaded("carpet");
// Registering the commands
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> {

View File

@ -20,6 +20,9 @@
"org.samo_lego.simpleauth.SimpleAuthFabric"
]
},
"mixins": [
"mixins.simpleauth.json"
],
"depends": {
"fabricloader": ">=0.8.8",
"fabric": "*"

View File

@ -2,17 +2,14 @@ package org.samo_lego.simpleauth.event;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.ActionResult;
import net.minecraft.util.TypedActionResult;
import net.minecraftforge.event.entity.player.AttackEntityEvent;
import net.minecraftforge.event.entity.player.PlayerContainerEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import org.samo_lego.simpleauth.utils.PlayerAuth;
import static net.minecraftforge.eventbus.api.EventPriority.HIGHEST;
import static org.samo_lego.simpleauth.SimpleAuth.MOD_ID;
import static org.samo_lego.simpleauth.SimpleAuth.config;
/**
* This class will take care of actions players try to do,

View File

@ -12,6 +12,8 @@ fabric_version=0.29.4+1.16
# Forge
forge_version=36.0.4
# Architectury
architectury_version=1.5.101
# Mod Properties
mod_version = 1.7.5
@ -23,8 +25,6 @@ argon2_version = 2.7
bcrypt_version = 0.9.0
bytes_version = 1.3.0
# Architectury
architectury_version=1.3.81
# Carpet for debugging
carpet_core_version = 1.4.16+v201105