/*
 * This file is part of Sponge, licensed under the MIT License (MIT).
 *
 * Copyright (c) SpongePowered <https://www.spongepowered.org>
 * Copyright (c) contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.spongepowered.common.data.property.store.block;

import net.minecraft.block.Block;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import org.spongepowered.api.data.property.block.SolidCubeProperty;
import org.spongepowered.api.util.Direction;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import org.spongepowered.common.data.property.store.common.AbstractSpongePropertyStore;
import org.spongepowered.common.util.VecHelper;

import java.util.Optional;

public class SolidCubePropertyStore extends AbstractSpongePropertyStore<SolidCubeProperty> {

    protected static final SolidCubeProperty TRUE = new SolidCubeProperty(true);
    protected static final SolidCubeProperty FALSE = new SolidCubeProperty(false);

    @Override
    public Optional<SolidCubeProperty> getFor(Location<World> location) {
        final Block block = (Block) location.getBlockType();
        return Optional.of(block.getMaterial().isSolid() ? TRUE : FALSE);
    }

    @Override
    public Optional<SolidCubeProperty> getFor(Location<World> location, Direction direction) {
        final net.minecraft.world.World world = (net.minecraft.world.World) location.getExtent();
        final Block block = (Block) location.getBlockType();
        final BlockPos pos = VecHelper.toBlockPos(location);
        final EnumFacing facing = toEnumFacing(direction);
        return Optional.of(block.isBlockSolid(world, pos, facing) ? TRUE : FALSE);
    }

}

@@ -1409,32 +1409,66 @@
 mFacing;%0Aimport 
+net.minecraft.world.World;%0Aimport 
 org.spongepowere
@@ -1514,140 +1514,8 @@
 erty
-;%0Aimport org.spongepowered.api.util.Direction;%0Aimport org.spongepowered.api.world.Location;%0Aimport org.spongepowered.api.world.World
 ;%0Aim
@@ -1571,38 +1571,37 @@
 .common.Abstract
-Sponge
+Block
 PropertyStore;%0Ai
@@ -1602,56 +1602,8 @@
 ore;
-%0Aimport org.spongepowered.common.util.VecHelper;
 %0A%0Aim
@@ -1680,22 +1680,21 @@
 Abstract
-Sponge
+Block
 Property
@@ -1886,16 +1886,82 @@
 alse);%0A%0A
+    public SolidCubePropertyStore() %7B%0A        super(true);%0A    %7D%0A%0A
     @Ove
@@ -1963,37 +1963,40 @@
  @Override%0A    p
-ublic
+rotected
  Optional%3CSolidC
@@ -2018,97 +2018,28 @@
 tFor
-(Location%3CWorld%3E location) %7B%0A        final Block block = (Block) location.getBlockType();
+Block(Block block) %7B
 %0A   
@@ -2135,21 +2135,24 @@
 de%0A    p
-ublic
+rotected
  Optiona
@@ -2182,153 +2182,116 @@
 tFor
-(Loca
+Direc
 tion
-%3C
+(
 World
-%3E location, Direction direction) %7B%0A        final net.minecraft.world.World world
+ world, int x, int y, int z, EnumFacing facing) %7B%0A        BlockPos pos
  = 
-(
 ne
-t.minecraft.world.World) location.getExtent(
+w BlockPos(x, y, z
 );%0A 
@@ -2293,30 +2293,24 @@
 z);%0A        
-final 
 Block block 
@@ -2315,158 +2315,42 @@
 k = 
-(Block) location.getBlockType();%0A        final BlockPos pos = VecHelper.toBlockPos(location);%0A        final EnumFacing facing = toEnumFacing(direction
+world.getBlockState(pos).getBlock(
 );%0A 

Fix SolidCubeProperty being only accessible from Location<World>