Remove global server reference from Player_antiCheatDisabledMixin
This commit is contained in:
1 parent
6b9e7aff3e
commit
17c2d601d2
1 file changed
+2
-2
@@ -1,7 +1,7 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetServer;
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ElytraItem;
|
||||
@@ -23,7 +23,7 @@ public abstract class Player_antiCheatDisabledMixin
|
||||
@Inject(method = "tryToStartFallFlying", at = @At("HEAD"), cancellable = true)
|
||||
private void allowDeploys(CallbackInfoReturnable<Boolean> cir)
|
||||
{
|
||||
if (CarpetSettings.antiCheatDisabled && CarpetServer.minecraft_server != null && CarpetServer.minecraft_server.isDedicatedServer())
|
||||
if (CarpetSettings.antiCheatDisabled && (Object)this instanceof ServerPlayer sp && sp.getServer().isDedicatedServer())
|
||||
{
|
||||
ItemStack itemStack_1 = getItemBySlot(EquipmentSlot.CHEST);
|
||||
if (itemStack_1.getItem() == Items.ELYTRA && ElytraItem.isFlyEnabled(itemStack_1)) {
|
||||
|
||||
Reference in new issue
Block a user