Skip to content

Commit

Permalink
16.12.alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
RoboMWM committed Jun 14, 2019
1 parent c4a0012 commit 6403caa
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 96 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -6,7 +6,7 @@

<groupId>me.ryanhamshire</groupId>
<artifactId>GriefPrevention</artifactId>
<version>16.11.6.dev</version>
<version>16.12.alpha.1</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/me/ryanhamshire/GriefPrevention/Visualization.java
Expand Up @@ -22,6 +22,7 @@

import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
Expand Down Expand Up @@ -285,15 +286,16 @@ private static Location getVisibleLocation(World world, int x, int y, int z, boo
//helper method for above. allows visualization blocks to sit underneath partly transparent blocks like grass and fence
private static boolean isTransparent(Block block, boolean waterIsTransparent)
{
Material blockMaterial = block.getType();
//Blacklist
switch (block.getType())
switch (blockMaterial)
{
case SNOW:
return false;
}

//Whitelist TODO: some of this might already be included in isTransparent()
switch (block.getType())
switch (blockMaterial)
{
case AIR:
case OAK_FENCE:
Expand All @@ -309,11 +311,12 @@ private static boolean isTransparent(Block block, boolean waterIsTransparent)
case DARK_OAK_FENCE_GATE:
case SPRUCE_FENCE_GATE:
case JUNGLE_FENCE_GATE:
case SIGN:
case WALL_SIGN:
return true;
}

if (Tag.SIGNS.isTagged(blockMaterial) || Tag.WALL_SIGNS.isTagged(blockMaterial))
return true;

return (waterIsTransparent && block.getType() == Material.WATER) ||
block.getType().isTransparent();
}
Expand Down

0 comments on commit 6403caa

Please sign in to comment.