package fun.anfyence.features.impl.util;
import fun.anfyence.features.api.Category;
import fun.anfyence.features.api.Feature;
import fun.anfyence.features.api.FeatureInfo;
import net.minecraft.network.play.client.CResourcePackStatusPacket;
import net.minecraft.network.play.client.CResourcePackStatusPacket.Action;
import net.minecraft.network.play.server.SSendResourcePackPacket;
import fun.anfyence.events.Event;
import fun.anfyence.events.impl.packet.EventPacket;
/*
@LastChange 05/03/2025 @By : null
*/
@FeatureInfo(name = "SRPspoof", desc = "Позволяет зайти на сервер и не скачивать ресурс-пак.", category = Category.Util)
public class SpuferSRP extends Feature {
public SpuferSRP() {
}
public boolean onEvent(Event event) {
if (event instanceof EventPacket e) {
if (e.getPacket() instanceof SSendResourcePackPacket) {
mc.player.connection.sendPacket(new CResourcePackStatusPacket(Action.ACCEPTED));
mc.player.connection.sendPacket(new CResourcePackStatusPacket(Action.SUCCESSFULLY_LOADED));
if (mc.currentScreen != null) {
mc.player.closeScreen();
}
event.setCancel(true);
}
}
return false;
}
}