restored some anti cheat things for elytra, still applicable
This commit is contained in:
1 parent
cb900f638f
commit
bc9d0664cd
2 files changed
+36
No files matched your search
@@ -0,0 +1,35 @@
|
|||||||
|
package carpet.mixins;
|
||||||
|
|
||||||
|
import carpet.CarpetServer;
|
||||||
|
import carpet.settings.CarpetSettings;
|
||||||
|
import net.minecraft.entity.EquipmentSlot;
|
||||||
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.item.ElytraItem;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.Items;
|
||||||
|
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.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(PlayerEntity.class)
|
||||||
|
public abstract class PlayerEntity_antiCheatDisabled
|
||||||
|
{
|
||||||
|
@Shadow public abstract ItemStack getEquippedStack(EquipmentSlot equipmentSlot_1);
|
||||||
|
|
||||||
|
@Shadow public abstract void method_23669();
|
||||||
|
|
||||||
|
@Inject(method = "method_23668", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void allowDeploys(CallbackInfoReturnable<Boolean> cir)
|
||||||
|
{
|
||||||
|
if (CarpetSettings.antiCheatDisabled && CarpetServer.minecraft_server.isDedicated())
|
||||||
|
{
|
||||||
|
ItemStack itemStack_1 = getEquippedStack(EquipmentSlot.CHEST);
|
||||||
|
if (itemStack_1.getItem() == Items.ELYTRA && ElytraItem.isUsable(itemStack_1)) {
|
||||||
|
method_23669();
|
||||||
|
cir.setReturnValue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -88,6 +88,7 @@
|
|||||||
"PistonBlock_rotatorBlockMixin",
|
"PistonBlock_rotatorBlockMixin",
|
||||||
|
|
||||||
"ServerPlayNetworkHandler_antiCheatDisabledMixin",
|
"ServerPlayNetworkHandler_antiCheatDisabledMixin",
|
||||||
|
"PlayerEntity_antiCheatDisabled",
|
||||||
|
|
||||||
"PortalForcer_portalCachingMixin",
|
"PortalForcer_portalCachingMixin",
|
||||||
"PortalBlock_portalCachingMixin",
|
"PortalBlock_portalCachingMixin",
|
||||||
|
|||||||
Reference in new issue
Block a user