Merge branch 'techhider1.14+compatibility' of SteamWar/FightSystem into master
Dieser Commit ist enthalten in:
Commit
995ef3472c
@ -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));
|
||||
|
@ -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");
|
||||
|
@ -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);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren