Minor performance tweaks and cleaning of metrics

Why were metrics so messed up in the first place?
This commit is contained in:
matt
2019-04-01 20:42:10 -04:00
parent f87e31683e
commit 86ce762982
13 changed files with 854 additions and 1236 deletions

View File

@ -70,11 +70,9 @@ public class OverlayBrush extends PerformBrush {
@SuppressWarnings("deprecation") private boolean isIgnoredBlock(int materialId) {
BlockType type = BlockTypes.get(materialId);
switch (type.getResource().toUpperCase()) {
case "WATER":
case "LAVA":
case "CACTUS":
return true;
String s = type.getResource().toUpperCase();
if (type == BlockTypes.WATER || type == BlockTypes.LAVA || type == BlockTypes.CACTUS) {
return true;
}
BlockMaterial mat = type.getMaterial();
return mat.isTranslucent();

View File

@ -2,6 +2,7 @@ package com.thevoxelbox.voxelsniper.brush;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.thevoxelbox.voxelsniper.Message;
import com.thevoxelbox.voxelsniper.SnipeData;
@ -95,19 +96,15 @@ public class SnowConeBrush extends Brush
if (snowData > snowconeData[x][z])
{
switch (BlockTypes.get(snowcone[x][z]).getResource().toUpperCase())
{
case "AIR":
case "CAVE_AIR":
case "VOID_AIR":
snowconeData[x][z] = snowData;
snowcone[x][z] = BlockTypes.SNOW.getInternalId();
case "SNOW_BLOCK":
snowconeData[x][z] = snowData;
break;
default:
break;
BlockType blockType =
BlockTypes.get(snowcone[x][z]);
if (blockType.getMaterial().isAir()) {
snowconeData[x][z] = snowData;
snowcone[x][z] = BlockTypes.SNOW.getInternalId();
snowconeData[x][z] = snowData;
} else if (blockType == BlockTypes.SNOW_BLOCK) {
snowconeData[x][z] = snowData;
}
}
else if (yOffset[x][z] > 0 && snowcone[x][z] == BlockTypes.SNOW.getInternalId())