MOre fabric changes
This commit is contained in:
parent
37d4f207e2
commit
6920315952
|
@ -1,6 +1,6 @@
|
||||||
plugins {
|
plugins {
|
||||||
id "architectury-plugin" version "2.0.59"
|
id "architectury-plugin" version "2.0.65"
|
||||||
id "forgified-fabric-loom" version "0.6.52" apply false
|
id "forgified-fabric-loom" version "0.6.54" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
architectury {
|
architectury {
|
||||||
|
|
|
@ -132,7 +132,7 @@ public class AuthEventHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player chatting
|
// 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
|
// Getting the message to then be able to check it
|
||||||
if(
|
if(
|
||||||
!((PlayerAuth) player).isAuthenticated() &&
|
!((PlayerAuth) player).isAuthenticated() &&
|
||||||
|
@ -147,7 +147,7 @@ public class AuthEventHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player movement
|
// Player movement
|
||||||
public static ActionResult onPlayerMove(PlayerEntity player) {
|
public static ActionResult onPlayerMove(ServerPlayerEntity player) {
|
||||||
// Player will fall if enabled (prevent fly kick)
|
// Player will fall if enabled (prevent fly kick)
|
||||||
boolean auth = ((PlayerAuth) player).isAuthenticated();
|
boolean auth = ((PlayerAuth) player).isAuthenticated();
|
||||||
// Otherwise movement should be disabled
|
// Otherwise movement should be disabled
|
||||||
|
@ -195,7 +195,7 @@ public class AuthEventHandler {
|
||||||
return ActionResult.PASS;
|
return ActionResult.PASS;
|
||||||
}
|
}
|
||||||
// Changing inventory (item moving etc.)
|
// Changing inventory (item moving etc.)
|
||||||
public static ActionResult onTakeItem(PlayerEntity player) {
|
public static ActionResult onTakeItem(ServerPlayerEntity player) {
|
||||||
if(!((PlayerAuth) player).isAuthenticated() && !config.experimental.allowItemMoving) {
|
if(!((PlayerAuth) player).isAuthenticated() && !config.experimental.allowItemMoving) {
|
||||||
player.sendMessage(((PlayerAuth) player).getAuthMessage(), false);
|
player.sendMessage(((PlayerAuth) player).getAuthMessage(), false);
|
||||||
return ActionResult.FAIL;
|
return ActionResult.FAIL;
|
||||||
|
|
|
@ -7,6 +7,6 @@ public class PlatformSpecific {
|
||||||
@ExpectPlatform
|
@ExpectPlatform
|
||||||
public static boolean isPlayerFake(PlayerEntity player) {
|
public static boolean isPlayerFake(PlayerEntity player) {
|
||||||
// Replaced by Architectury
|
// Replaced by Architectury
|
||||||
throw new AssertionError();
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ public class SimpleAuthFabric implements ModInitializer {
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
SimpleAuth.init(FabricLoader.getInstance().getGameDir());
|
SimpleAuth.init(FabricLoader.getInstance().getGameDir());
|
||||||
//FabricLoader.getInstance().isModLoaded("carpet");
|
|
||||||
|
|
||||||
// Registering the commands
|
// Registering the commands
|
||||||
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> {
|
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> {
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
"org.samo_lego.simpleauth.SimpleAuthFabric"
|
"org.samo_lego.simpleauth.SimpleAuthFabric"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"mixins": [
|
||||||
|
"mixins.simpleauth.json"
|
||||||
|
],
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.8.8",
|
"fabricloader": ">=0.8.8",
|
||||||
"fabric": "*"
|
"fabric": "*"
|
||||||
|
|
|
@ -2,17 +2,14 @@ package org.samo_lego.simpleauth.event;
|
||||||
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.util.ActionResult;
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.TypedActionResult;
|
|
||||||
import net.minecraftforge.event.entity.player.AttackEntityEvent;
|
import net.minecraftforge.event.entity.player.AttackEntityEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerContainerEvent;
|
import net.minecraftforge.event.entity.player.PlayerContainerEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import org.samo_lego.simpleauth.utils.PlayerAuth;
|
|
||||||
|
|
||||||
import static net.minecraftforge.eventbus.api.EventPriority.HIGHEST;
|
import static net.minecraftforge.eventbus.api.EventPriority.HIGHEST;
|
||||||
import static org.samo_lego.simpleauth.SimpleAuth.MOD_ID;
|
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,
|
* This class will take care of actions players try to do,
|
||||||
|
|
|
@ -12,6 +12,8 @@ fabric_version=0.29.4+1.16
|
||||||
# Forge
|
# Forge
|
||||||
forge_version=36.0.4
|
forge_version=36.0.4
|
||||||
|
|
||||||
|
# Architectury
|
||||||
|
architectury_version=1.5.101
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.7.5
|
mod_version = 1.7.5
|
||||||
|
@ -23,8 +25,6 @@ argon2_version = 2.7
|
||||||
bcrypt_version = 0.9.0
|
bcrypt_version = 0.9.0
|
||||||
bytes_version = 1.3.0
|
bytes_version = 1.3.0
|
||||||
|
|
||||||
# Architectury
|
|
||||||
architectury_version=1.3.81
|
|
||||||
|
|
||||||
# Carpet for debugging
|
# Carpet for debugging
|
||||||
carpet_core_version = 1.4.16+v201105
|
carpet_core_version = 1.4.16+v201105
|
||||||
|
|
Loading…
Reference in New Issue