0
0
mirror of https://github.com/Wurst-Imperium/Wurst7.git synced 2024-09-20 01:12:13 +02:00

Fix Search targeting air blocks

This commit is contained in:
Alexander01998 2019-09-28 12:20:59 +02:00
parent 100d7ae885
commit 5ff8e6d143

View File

@ -14,6 +14,7 @@ import java.util.Set;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import net.minecraft.block.AirBlock;
import net.minecraft.block.Block;
import net.wurstclient.WurstClient;
import net.wurstclient.clickgui.BlockComponent;
@ -56,6 +57,9 @@ public final class BlockSetting extends Setting
public void setBlock(Block block)
{
if(block == null || block instanceof AirBlock)
return;
String newName = Objects.requireNonNull(BlockUtils.getName(block));
if(blockName.equals(newName))
@ -93,7 +97,7 @@ public final class BlockSetting extends Setting
String newName = JsonUtils.getAsString(json);
Block newBlock = BlockUtils.getBlockFromName(newName);
if(newBlock == null)
if(newBlock == null || newBlock instanceof AirBlock)
throw new JsonException();
blockName = BlockUtils.getName(newBlock);