SteamWar/FightSystem
Archiviert
13
1

Merge branch 'techhider1.14+compatibility' of SteamWar/FightSystem into master

Dieser Commit ist enthalten in:
Lixfel 2020-01-01 18:28:42 +01:00 committet von Gitea
Commit 995ef3472c
3 geänderte Dateien mit 7 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -6,6 +6,7 @@ import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.reflect.StructureModifier;
import com.comphenix.protocol.wrappers.nbt.NbtBase;
import com.comphenix.protocol.wrappers.nbt.NbtCompound;
import com.comphenix.protocol.wrappers.nbt.NbtFactory;
import de.steamwar.fightsystem.Config;
@ -55,8 +56,8 @@ public class TechHider_14 {
cached = packet.deepClone();
ITechHider.packetCache.put(packet, cached);
e.setPacket(cached);
StructureModifier<List> list = cached.getSpecificModifier(List.class);
List nmsTags = list.read(1);
StructureModifier<List<NbtBase<?>>> list = cached.getListNbtModifier();
List<NbtBase<?>> nmsTags = list.read(1);
boolean changed = false;
for(int i = nmsTags.size() - 1; i >= 0; i--){
NbtCompound nbt = NbtFactory.fromNMSCompound(nmsTags.get(i));

Datei anzeigen

@ -100,6 +100,7 @@ public class Config {
//tech hider parameter
public static final List<Integer> HiddenBlocks;
public static final List<String> HiddenBlockTags;
public static final List<String> HiddenBlockEntities;
public static final int ObfuscateWith;
public static final String ObfuscateWithTag;
@ -177,6 +178,7 @@ public class Config {
LeaderDefault = config.getString("Kits.LeaderDefault");
HiddenBlocks = Collections.unmodifiableList(config.getIntegerList("Techhider.HiddenBlocks"));
HiddenBlockTags = config.getStringList("Techhider.HiddenBlockTags");
HiddenBlockEntities = Collections.unmodifiableList(config.getStringList("Techhider.HiddenBlockEntities"));
ObfuscateWith = config.getInt("Techhider.ObfuscateWith");
ObfuscateWithTag = config.getString("Techhider.ObfuscateWithTag");

Datei anzeigen

@ -108,8 +108,7 @@ public class TechHider {
boolean changed = false;
for(MultiBlockChangeInfo mbci : changes){
WrappedBlockData block = mbci.getData();
//noinspection deprecation
if(Config.HiddenBlocks.contains(block.getType().getId())){
if(Config.HiddenBlockTags.contains(block.getType().name())){
changed = true;
block.setType(ITechHider.obfuscateMaterial);
mbci.setData(block);
@ -145,8 +144,7 @@ public class TechHider {
e.setPacket(cached);
StructureModifier<WrappedBlockData> blockStructure = cached.getBlockData();
WrappedBlockData block = blockStructure.read(0);
//noinspection deprecation
if(Config.HiddenBlocks.contains(block.getType().getId())){
if(Config.HiddenBlockTags.contains(block.getType().name())){
block.setType(ITechHider.obfuscateMaterial);
blockStructure.write(0, block);
}