diff --git a/client/src/main/java/client/renderer/Renderer.java b/client/src/main/java/client/renderer/Renderer.java index 39dac3a1..e88a6c3a 100755 --- a/client/src/main/java/client/renderer/Renderer.java +++ b/client/src/main/java/client/renderer/Renderer.java @@ -3925,6 +3925,7 @@ public class Renderer { { int i = 0; float f = 0.0F; + int n = 0; for (int j = 0; j < 4; ++j) { @@ -3934,11 +3935,15 @@ public class Renderer { { return 1.0F; } + if (blockAccess.getState(blockpos.down()).getBlock() == Blocks.air) + { + n++; + } State iblockstate = blockAccess.getState(blockpos); Block material = iblockstate.getBlock(); - if (material != block) + if (!material.isNonBlock()) // material != block { if (material == Blocks.air) { @@ -3956,6 +3961,6 @@ public class Renderer { } } - return 1.0F - f / (float)i; + return n == 4 ? 1.0f : 1.0F - f / (float)i; } } diff --git a/client/src/main/resources/shaders/world.fsh b/client/src/main/resources/shaders/world.fsh index 4dbfa44c..72350ca7 100644 --- a/client/src/main/resources/shaders/world.fsh +++ b/client/src/main/resources/shaders/world.fsh @@ -100,7 +100,7 @@ vec3 calc_point_light(light_t light, vec3 norm, vec3 dir, vec3 rgb) { void main() { if(shine <= 0.0) { - vec2 coord = fract(tex_coord * textureSize(tex, 0) / 512.0) * vis_div; // vertex.xz + vec2(0.25, 0.5)) * 24.0 / 2.0; + vec2 coord = fract(tex_coord * textureSize(tex, 0) / 256.0) * vis_div; // vertex.xz + vec2(0.25, 0.5)) * 24.0 / 2.0; vec2 shift = vec2(v2rand(coord + fract(time)) * 2.0 - 1.0, v2rand(coord + 0.5 + fract(time)) * 2.0 - 1.0); shift = vec2(dgauss(shift.x, 0.0, 1.0), dgauss(shift.y, 0.0, 1.0)) * 0.015; vec3 cl = vec3(inside(coord / vis_div, shift, 0.0, 1.0, 64.0, 1.0, 3.0, 1.0, 3.0), inside(coord / vis_div, shift, 0.0, 1.0, 64.0, 63.0, 1.0, 63.0, 1.0), inside(coord / vis_div, shift, 0.0, 1.0, 64.0, 61.0, 63.0, 61.0, 63.0)); diff --git a/client/src/main/resources/textures/blocks/cyber.png b/client/src/main/resources/textures/blocks/cyber.png index f352255a..6daa34d3 100644 Binary files a/client/src/main/resources/textures/blocks/cyber.png and b/client/src/main/resources/textures/blocks/cyber.png differ diff --git a/client/src/main/resources/textures/blocks/grass.png b/client/src/main/resources/textures/blocks/grass.png index c15842df..b7ce47c9 100644 Binary files a/client/src/main/resources/textures/blocks/grass.png and b/client/src/main/resources/textures/blocks/grass.png differ diff --git a/client/src/main/resources/textures/blocks/ice.png b/client/src/main/resources/textures/blocks/ice.png index 8b27e699..e6790a20 100755 Binary files a/client/src/main/resources/textures/blocks/ice.png and b/client/src/main/resources/textures/blocks/ice.png differ diff --git a/common/src/main/java/common/block/Block.java b/common/src/main/java/common/block/Block.java index 79a9437f..aa6378dd 100755 --- a/common/src/main/java/common/block/Block.java +++ b/common/src/main/java/common/block/Block.java @@ -1051,7 +1051,7 @@ public class Block { : (side == Facing.SOUTH && this.maxZ < 1.0D ? true : (side == Facing.WEST && this.minX > 0.0D ? true : (side == Facing.EAST && this.maxX < 1.0D ? true - : !world.getState(pos).getBlock().isOpaqueCube()))))); + : !world.getState(pos).getBlock().isOpaqueCube() && (!this.isNonBlock() || !world.getState(pos).getBlock().isNonBlock() || !world.getState(pos).getBlock().isVisuallyOpaque())))))); } @Clientside diff --git a/common/src/main/java/common/block/BlockFalling.java b/common/src/main/java/common/block/BlockFalling.java index 7918c233..32321f22 100755 --- a/common/src/main/java/common/block/BlockFalling.java +++ b/common/src/main/java/common/block/BlockFalling.java @@ -1,6 +1,7 @@ package common.block; import common.block.natural.BlockFire; +import common.block.natural.BlockNonBlock; import common.entity.item.EntityFalling; import common.init.Blocks; import common.rng.Random; @@ -10,7 +11,7 @@ import common.world.State; import common.world.World; import common.world.AWorldServer; -public class BlockFalling extends Block { +public class BlockFalling extends BlockNonBlock { public static boolean fallInstantly; public static boolean canFallInto(World world, BlockPos pos) { @@ -69,12 +70,4 @@ public class BlockFalling extends Block { public void onEndFalling(World world, BlockPos pos) { } - - public boolean isOpaqueCube() { - return false; - } - - public boolean isNonBlock() { - return true; - } } diff --git a/common/src/main/java/common/block/BlockTreasure.java b/common/src/main/java/common/block/BlockTreasure.java index b5548e0b..f34afbaa 100755 --- a/common/src/main/java/common/block/BlockTreasure.java +++ b/common/src/main/java/common/block/BlockTreasure.java @@ -1,6 +1,8 @@ package common.block; -public class BlockTreasure extends Block { +import common.block.natural.BlockNonBlock; + +public class BlockTreasure extends BlockNonBlock { public BlockTreasure(Material material) { super(material); } diff --git a/common/src/main/java/common/block/foliage/BlockBlackenedSoil.java b/common/src/main/java/common/block/foliage/BlockBlackenedSoil.java index 91b91c95..7b261c06 100644 --- a/common/src/main/java/common/block/foliage/BlockBlackenedSoil.java +++ b/common/src/main/java/common/block/foliage/BlockBlackenedSoil.java @@ -5,20 +5,17 @@ import common.block.Material; import common.init.Blocks; import common.item.CheatTab; import common.item.Item; -import common.model.Model; -import common.model.Model.ModelProvider; import common.rng.Random; import common.util.BlockPos; import common.vars.Vars; import common.world.State; import common.world.AWorldServer; -public class BlockBlackenedSoil extends Block +public class BlockBlackenedSoil extends BlockSnowable { - public BlockBlackenedSoil() + public BlockBlackenedSoil(boolean snowy) { - super(Material.LOOSE); - this.setTicked(); + super(Material.LOOSE, snowy); this.setTab(CheatTab.NATURE); } @@ -29,19 +26,22 @@ public class BlockBlackenedSoil extends Block if(Vars.darkSoilDecay) worldIn.setState(pos, Blocks.blackened_dirt.getState()); } - else if (Vars.darkSoilSpread && worldIn.getLightFromNeighbors(pos.up()) >= 1) - { - for (int i = 0; i < 4; i++) - { - BlockPos blockpos = pos.add(rand.zrange(3) - 1, rand.zrange(5) - 3, rand.zrange(3) - 1); - Block block = worldIn.getState(blockpos.up()).getBlock(); - State iblockstate = worldIn.getState(blockpos); - - if ((iblockstate.getBlock() == Blocks.dirt || iblockstate.getBlock() == Blocks.grass || iblockstate.getBlock() == Blocks.swamp || iblockstate.getBlock() == Blocks.blackened_dirt) && worldIn.getLightFromNeighbors(blockpos.up()) >= 2 && block.getLightOpacity() <= 6) - { - worldIn.setState(blockpos, Blocks.blackened_soil.getState()); - } - } + else { + if (Vars.darkSoilSpread && worldIn.getLightFromNeighbors(pos.up()) >= 1) + { + for (int i = 0; i < 4; i++) + { + BlockPos blockpos = pos.add(rand.zrange(3) - 1, rand.zrange(5) - 3, rand.zrange(3) - 1); + Block block = worldIn.getState(blockpos.up()).getBlock(); + State iblockstate = worldIn.getState(blockpos); + + if ((iblockstate.getBlock() == Blocks.dirt || iblockstate.getBlock() == Blocks.grass || iblockstate.getBlock() == Blocks.swamp || iblockstate.getBlock() == Blocks.blackened_dirt) && worldIn.getLightFromNeighbors(blockpos.up()) >= 2 && block.getLightOpacity() <= 6) + { + worldIn.setState(blockpos, Blocks.blackened_soil.getState()); + } + } + } + super.tick(worldIn, pos, state, rand); } } @@ -49,8 +49,4 @@ public class BlockBlackenedSoil extends Block { return Blocks.blackened_dirt.getDrop(Blocks.blackened_dirt.getState(), rand, fortune); } - - public Model getModel(ModelProvider provider, String name, State state) { - return provider.getModel("blackened_dirt").add().d().u("blackened_soil_top").nswe("blackened_soil_side"); - } } diff --git a/common/src/main/java/common/block/foliage/BlockGrass.java b/common/src/main/java/common/block/foliage/BlockGrass.java index 8afbec07..a2899fab 100755 --- a/common/src/main/java/common/block/foliage/BlockGrass.java +++ b/common/src/main/java/common/block/foliage/BlockGrass.java @@ -2,7 +2,6 @@ package common.block.foliage; import common.block.Block; import common.block.Material; -import common.block.natural.BlockNonBlock; import common.init.Blocks; import common.item.CheatTab; import common.item.Item; @@ -13,16 +12,12 @@ import common.world.State; import common.world.World; import common.world.AWorldServer; -public class BlockGrass extends BlockNonBlock implements IGrowable +public class BlockGrass extends BlockSnowable implements IGrowable { - private final boolean snowy; - public BlockGrass(boolean snowy) { - super(Material.LOOSE); - this.setTicked(); + super(Material.LOOSE, snowy); this.setTab(CheatTab.NATURE); - this.snowy = snowy; } public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand) @@ -39,13 +34,7 @@ public class BlockGrass extends BlockNonBlock implements IGrowable } else { - if(this == Blocks.snowy_grass && !worldIn.canFreezeAt(pos)) { - worldIn.setState(pos, Blocks.grass.getState()); - } - else if(this == Blocks.grass && worldIn.isRaining() && worldIn.canFreezeAt(pos)) { - worldIn.setState(pos, Blocks.snowy_grass.getState()); - } - else if (Vars.grassSpread && worldIn.getLightFromNeighbors(pos.up()) >= 9) + if (Vars.grassSpread && worldIn.getLightFromNeighbors(pos.up()) >= 9) { for (int i = 0; i < 4; ++i) { @@ -59,6 +48,7 @@ public class BlockGrass extends BlockNonBlock implements IGrowable } } } + super.tick(worldIn, pos, state, rand); } } diff --git a/common/src/main/java/common/block/foliage/BlockLeavesBase.java b/common/src/main/java/common/block/foliage/BlockLeavesBase.java index 28bd923e..691b7b2a 100755 --- a/common/src/main/java/common/block/foliage/BlockLeavesBase.java +++ b/common/src/main/java/common/block/foliage/BlockLeavesBase.java @@ -2,8 +2,9 @@ package common.block.foliage; import common.block.Block; import common.block.Material; +import common.block.natural.BlockNonBlock; -public class BlockLeavesBase extends Block +public class BlockLeavesBase extends BlockNonBlock { // public static final List BASE_LEAVES = Lists.newArrayList(); diff --git a/common/src/main/java/common/block/foliage/BlockMycelium.java b/common/src/main/java/common/block/foliage/BlockMycelium.java index ade921f1..c2854447 100755 --- a/common/src/main/java/common/block/foliage/BlockMycelium.java +++ b/common/src/main/java/common/block/foliage/BlockMycelium.java @@ -5,41 +5,22 @@ import common.block.Material; import common.init.Blocks; import common.item.CheatTab; import common.item.Item; -import common.model.Model; -import common.model.Model.ModelProvider; -import common.properties.Property; -import common.properties.PropertyBool; import common.rng.Random; import common.util.BlockPos; import common.util.ParticleType; import common.vars.Vars; -import common.world.IWorldAccess; import common.world.State; import common.world.World; import common.world.AWorldServer; -public class BlockMycelium extends Block +public class BlockMycelium extends BlockSnowable { - public static final PropertyBool SNOWY = PropertyBool.create("snowy"); - - public BlockMycelium() + public BlockMycelium(boolean snowy) { - super(Material.LOOSE); - this.setDefaultState(this.getBaseState().withProperty(SNOWY, Boolean.valueOf(false))); - this.setTicked(); + super(Material.LOOSE, snowy); this.setTab(CheatTab.NATURE); } - /** - * Get the actual Block state of this Block at the given position. This applies properties not visible in the - * metadata, such as fence connections. - */ - public State getState(State state, IWorldAccess worldIn, BlockPos pos) - { - Block block = worldIn.getState(pos.up()).getBlock(); - return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer)); - } - public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { // if (!worldIn.client) @@ -49,23 +30,26 @@ public class BlockMycelium extends Block if(Vars.mycelDecay) worldIn.setState(pos, Blocks.dirt.getState()); } - else if(Vars.mycelSpread) - { - if (worldIn.getLightFromNeighbors(pos.up()) >= 9) - { - for (int i = 0; i < 4; ++i) - { - BlockPos blockpos = pos.add(rand.zrange(3) - 1, rand.zrange(5) - 3, rand.zrange(3) - 1); - State iblockstate = worldIn.getState(blockpos); - Block block = worldIn.getState(blockpos.up()).getBlock(); - - if (iblockstate.getBlock() == Blocks.dirt && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && block.getLightOpacity() <= 2) - { - worldIn.setState(blockpos, this.getState()); - } - } - } - } + else { + if(Vars.mycelSpread) + { + if (worldIn.getLightFromNeighbors(pos.up()) >= 9) + { + for (int i = 0; i < 4; ++i) + { + BlockPos blockpos = pos.add(rand.zrange(3) - 1, rand.zrange(5) - 3, rand.zrange(3) - 1); + State iblockstate = worldIn.getState(blockpos); + Block block = worldIn.getState(blockpos.up()).getBlock(); + + if (iblockstate.getBlock() == Blocks.dirt && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && block.getLightOpacity() <= 2) + { + worldIn.setState(blockpos, this.getState()); + } + } + } + } + super.tick(worldIn, pos, state, rand); + } // } } @@ -86,20 +70,4 @@ public class BlockMycelium extends Block { return Blocks.dirt.getDrop(Blocks.dirt.getState(), rand, fortune); } - - protected Property[] getProperties() - { - return new Property[] {SNOWY}; - } - - public Model getModel(ModelProvider provider, String name, State state) { - if(state.getValue(SNOWY)) - return provider.getModel("dirt").add().d().u("snow").nswe().add().nswe("soil_snowed"); - else - return provider.getModel("dirt").add().d().u("mycelium_top").nswe().add().nswe("mycelium_side"); - } - - protected Property[] getUnsavedProperties() { - return new Property[] {SNOWY}; - } } diff --git a/common/src/main/java/common/block/foliage/BlockSnowable.java b/common/src/main/java/common/block/foliage/BlockSnowable.java new file mode 100644 index 00000000..8eda5f66 --- /dev/null +++ b/common/src/main/java/common/block/foliage/BlockSnowable.java @@ -0,0 +1,31 @@ +package common.block.foliage; + +import common.block.Material; +import common.block.natural.BlockNonBlock; +import common.rng.Random; +import common.util.BlockPos; +import common.world.State; +import common.world.AWorldServer; + +public class BlockSnowable extends BlockNonBlock { + private final boolean snowy; + + private BlockSnowable other; + + public BlockSnowable(Material material, boolean snowy) { + super(material); + this.setTicked(); + this.snowy = snowy; + } + + public BlockSnowable setOther(BlockSnowable other) { + this.other = other; + other.other = this; + return this; + } + + public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { + if(this.snowy ? !worldIn.canFreezeAt(pos) : worldIn.isRaining() && worldIn.canFreezeAt(pos) && worldIn.getPrecipitationHeight(pos).getY() - 1 <= pos.getY()) + worldIn.setState(pos, this.other.getState()); + } +} diff --git a/common/src/main/java/common/block/foliage/BlockSwamp.java b/common/src/main/java/common/block/foliage/BlockSwamp.java index 13b1f56d..5c3be5b7 100644 --- a/common/src/main/java/common/block/foliage/BlockSwamp.java +++ b/common/src/main/java/common/block/foliage/BlockSwamp.java @@ -1,41 +1,25 @@ package common.block.foliage; -import common.block.Block; import common.block.Material; import common.entity.Entity; import common.init.Blocks; import common.item.CheatTab; import common.item.Item; -import common.model.Model; -import common.model.Model.ModelProvider; -import common.properties.Property; -import common.properties.PropertyBool; import common.rng.Random; import common.util.BlockPos; import common.util.BoundingBox; import common.vars.Vars; import common.world.AWorldServer; -import common.world.IWorldAccess; import common.world.State; import common.world.World; -public class BlockSwamp extends Block +public class BlockSwamp extends BlockSnowable { - public static final PropertyBool SNOWY = PropertyBool.create("snowy"); - - public BlockSwamp() + public BlockSwamp(boolean snowy) { - super(Material.LOOSE); - this.setDefaultState(this.getBaseState().withProperty(SNOWY, Boolean.valueOf(false))); - this.setTicked(); + super(Material.LOOSE, snowy); this.setTab(CheatTab.NATURE); } - - public State getState(State state, IWorldAccess worldIn, BlockPos pos) - { - Block block = worldIn.getState(pos.up()).getBlock(); - return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer)); - } public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state) { @@ -49,22 +33,6 @@ public class BlockSwamp extends Block entityIn.motionZ *= 0.6D; } - public Model getModel(ModelProvider provider, String name, State state) { - if(state.getValue(SNOWY)) - return provider.getModel("dirt").add().d().u("snow").nswe().add().nswe("soil_snowed"); - else - return provider.getModel("dirt").add().d().u("swamp_top").nswe().add().nswe("swamp_side"); - } - - protected Property[] getProperties() - { - return new Property[] {SNOWY}; - } - - protected Property[] getUnsavedProperties() { - return new Property[] {SNOWY}; - } - public Item getDrop(State state, Random rand, int fortune) { return Blocks.dirt.getDrop(Blocks.dirt.getState(), rand, fortune); @@ -77,11 +45,16 @@ public class BlockSwamp extends Block if(Vars.swampDecay) worldIn.setState(pos, Blocks.dirt.getState()); } - else if(Vars.swampDry) { - float temp = worldIn.getTemperatureC(pos); - if(temp >= 38.0f) - worldIn.setState(pos, temp >= 50.0f ? (worldIn.rand.chance(20) ? Blocks.coarse_dirt.getState() : - Blocks.dirt.getState()) : Blocks.grass.getState()); + else { + if(Vars.swampDry) { + float temp = worldIn.getTemperatureC(pos); + if(temp >= 38.0f) { + worldIn.setState(pos, temp >= 50.0f ? (worldIn.rand.chance(20) ? Blocks.coarse_dirt.getState() : + Blocks.dirt.getState()) : Blocks.grass.getState()); + return; + } + } + super.tick(worldIn, pos, state, rand); } } } diff --git a/common/src/main/java/common/block/foliage/BlockTianSoil.java b/common/src/main/java/common/block/foliage/BlockTianSoil.java index 86624e80..df73a650 100755 --- a/common/src/main/java/common/block/foliage/BlockTianSoil.java +++ b/common/src/main/java/common/block/foliage/BlockTianSoil.java @@ -1,54 +1,22 @@ package common.block.foliage; -import common.block.Block; import common.block.Material; import common.init.Blocks; import common.item.CheatTab; import common.item.Item; -import common.model.Model; -import common.model.Model.ModelProvider; -import common.properties.Property; -import common.properties.PropertyBool; import common.rng.Random; -import common.util.BlockPos; -import common.world.IWorldAccess; import common.world.State; -public class BlockTianSoil extends Block +public class BlockTianSoil extends BlockSnowable { - public static final PropertyBool SNOWY = PropertyBool.create("snowy"); - - public BlockTianSoil() + public BlockTianSoil(boolean snowy) { - super(Material.SOLID); - this.setDefaultState(this.getBaseState().withProperty(SNOWY, Boolean.valueOf(false))); + super(Material.SOLID, snowy); this.setTab(CheatTab.NATURE); } - public State getState(State state, IWorldAccess worldIn, BlockPos pos) - { - Block block = worldIn.getState(pos.up()).getBlock(); - return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer)); - } - public Item getDrop(State state, Random rand, int fortune) { return Blocks.tian.getDrop(Blocks.tian.getState(), rand, fortune); } - - protected Property[] getProperties() - { - return new Property[] {SNOWY}; - } - - public Model getModel(ModelProvider provider, String name, State state) { - if(state.getValue(SNOWY)) - return provider.getModel("tian").add().d().u("snow").nswe().add().nswe("tian_soil_snowed"); - else - return provider.getModel("tian").add().d().u("tian_soil_top").nswe().add().nswe("tian_soil_side"); - } - - protected Property[] getUnsavedProperties() { - return new Property[] {SNOWY}; - } } diff --git a/common/src/main/java/common/block/liquid/BlockDynamicLiquid.java b/common/src/main/java/common/block/liquid/BlockDynamicLiquid.java index 869b0039..e8400379 100755 --- a/common/src/main/java/common/block/liquid/BlockDynamicLiquid.java +++ b/common/src/main/java/common/block/liquid/BlockDynamicLiquid.java @@ -42,6 +42,10 @@ public class BlockDynamicLiquid extends BlockLiquid public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand) { + if(this.material == Material.WATER && !worldIn.getState(pos.up()).getBlock().isOpaqueCube() && worldIn.canBlockFreeze(pos, true) && rand.chance(25)) { + worldIn.setState(pos, Blocks.ice.getState()); + return; + } if(!Vars.liquidPhysics) return; int i = ((Integer)state.getValue(LEVEL)).intValue(); diff --git a/common/src/main/java/common/block/liquid/BlockLiquid.java b/common/src/main/java/common/block/liquid/BlockLiquid.java index b8c4c101..e6cf8146 100755 --- a/common/src/main/java/common/block/liquid/BlockLiquid.java +++ b/common/src/main/java/common/block/liquid/BlockLiquid.java @@ -105,8 +105,9 @@ public abstract class BlockLiquid extends Block public boolean canRender(IWorldAccess worldIn, BlockPos pos, Facing side) { - Material material = worldIn.getState(pos).getBlock().getMaterial(); - return material.isLiquid() && (material.isColdLiquid() == this.material.isColdLiquid()) ? false : (side == Facing.UP ? true : super.canRender(worldIn, pos, side)); + Block block = worldIn.getState(pos).getBlock(); + Material material = block.getMaterial(); + return material.isLiquid() && (material.isColdLiquid() == this.material.isColdLiquid()) ? false : (side == Facing.UP ? true : !block.isNonBlock() && super.canRender(worldIn, pos, side)); } public boolean shouldRenderSides(IBlockAccess blockAccess, BlockPos pos) diff --git a/common/src/main/java/common/block/liquid/BlockStaticLiquid.java b/common/src/main/java/common/block/liquid/BlockStaticLiquid.java index a8866d71..8c8ce8ba 100755 --- a/common/src/main/java/common/block/liquid/BlockStaticLiquid.java +++ b/common/src/main/java/common/block/liquid/BlockStaticLiquid.java @@ -21,7 +21,7 @@ public class BlockStaticLiquid extends BlockLiquid public BlockStaticLiquid(Material materialIn, int rate, Object animation, BlockDynamicLiquid flowing) { - super(materialIn, materialIn == Material.LAVA, rate, animation); + super(materialIn, materialIn == Material.LAVA || materialIn == Material.WATER, rate, animation); this.dynamicBlock = flowing; flowing.setStaticBlock(this); LIQUIDS.add(new Pair(this, flowing)); @@ -93,6 +93,9 @@ public class BlockStaticLiquid extends BlockLiquid } } } + + if(this.material == Material.WATER && !worldIn.getState(pos.up()).getBlock().isOpaqueCube() && worldIn.canBlockFreeze(pos, true)) + worldIn.setState(pos, Blocks.ice.getState()); } protected boolean isSurroundingBlockFlammable(World worldIn, BlockPos pos) diff --git a/common/src/main/java/common/block/natural/BlockBedrock.java b/common/src/main/java/common/block/natural/BlockBedrock.java index 86d2b9f9..e16a13b1 100755 --- a/common/src/main/java/common/block/natural/BlockBedrock.java +++ b/common/src/main/java/common/block/natural/BlockBedrock.java @@ -8,7 +8,7 @@ import common.util.ParticleType; import common.world.State; import common.world.World; -public class BlockBedrock extends Block { +public class BlockBedrock extends BlockNonBlock { public BlockBedrock() { super(Material.SOLID); } diff --git a/common/src/main/java/common/block/natural/BlockBlackenedStone.java b/common/src/main/java/common/block/natural/BlockBlackenedStone.java index 03b216f5..fdc47a59 100644 --- a/common/src/main/java/common/block/natural/BlockBlackenedStone.java +++ b/common/src/main/java/common/block/natural/BlockBlackenedStone.java @@ -8,7 +8,7 @@ import common.item.Item; import common.rng.Random; import common.world.State; -public class BlockBlackenedStone extends Block { +public class BlockBlackenedStone extends BlockNonBlock { public BlockBlackenedStone() { super(Material.SOLID); this.setTab(CheatTab.ROCK); diff --git a/common/src/main/java/common/block/natural/BlockClay.java b/common/src/main/java/common/block/natural/BlockClay.java index 3c5a637c..6e430889 100755 --- a/common/src/main/java/common/block/natural/BlockClay.java +++ b/common/src/main/java/common/block/natural/BlockClay.java @@ -8,7 +8,7 @@ import common.item.Item; import common.rng.Random; import common.world.State; -public class BlockClay extends Block +public class BlockClay extends BlockNonBlock { public BlockClay() { diff --git a/common/src/main/java/common/block/natural/BlockColoredClay.java b/common/src/main/java/common/block/natural/BlockColoredClay.java index 31e02ebb..b429dd79 100644 --- a/common/src/main/java/common/block/natural/BlockColoredClay.java +++ b/common/src/main/java/common/block/natural/BlockColoredClay.java @@ -8,7 +8,7 @@ import common.model.Model.ModelProvider; import common.util.Color; import common.world.State; -public class BlockColoredClay extends Block { +public class BlockColoredClay extends BlockNonBlock { public static final BlockColoredClay[] CLAY = new BlockColoredClay[Color.values().length]; private final Color color; diff --git a/common/src/main/java/common/block/natural/BlockCyber.java b/common/src/main/java/common/block/natural/BlockCyber.java index d925620c..2eafb41a 100644 --- a/common/src/main/java/common/block/natural/BlockCyber.java +++ b/common/src/main/java/common/block/natural/BlockCyber.java @@ -1,12 +1,11 @@ package common.block.natural; -import common.block.Block; import common.block.Material; import common.block.SoundType; import common.item.CheatTab; import common.util.Clientside; -public class BlockCyber extends Block { +public class BlockCyber extends BlockNonBlock { public BlockCyber() { super(Material.SOLID); this.setTab(CheatTab.ROCK); diff --git a/common/src/main/java/common/block/natural/BlockGlowstone.java b/common/src/main/java/common/block/natural/BlockGlowstone.java index ca1677d1..d8667c0f 100755 --- a/common/src/main/java/common/block/natural/BlockGlowstone.java +++ b/common/src/main/java/common/block/natural/BlockGlowstone.java @@ -13,7 +13,7 @@ import common.util.Serverside; import common.world.AWorldServer; import common.world.State; -public class BlockGlowstone extends Block +public class BlockGlowstone extends BlockNonBlock { public BlockGlowstone(Material materialIn) { diff --git a/common/src/main/java/common/block/natural/BlockHardenedClay.java b/common/src/main/java/common/block/natural/BlockHardenedClay.java index 4a29f7e9..f3ee6a92 100755 --- a/common/src/main/java/common/block/natural/BlockHardenedClay.java +++ b/common/src/main/java/common/block/natural/BlockHardenedClay.java @@ -1,10 +1,9 @@ package common.block.natural; -import common.block.Block; import common.block.Material; import common.item.CheatTab; -public class BlockHardenedClay extends Block +public class BlockHardenedClay extends BlockNonBlock { public BlockHardenedClay() { diff --git a/common/src/main/java/common/block/natural/BlockHellRock.java b/common/src/main/java/common/block/natural/BlockHellRock.java index 817dc3d6..5150c789 100755 --- a/common/src/main/java/common/block/natural/BlockHellRock.java +++ b/common/src/main/java/common/block/natural/BlockHellRock.java @@ -4,7 +4,7 @@ import common.block.Block; import common.block.Material; import common.item.CheatTab; -public class BlockHellRock extends Block +public class BlockHellRock extends BlockNonBlock { public BlockHellRock() { diff --git a/common/src/main/java/common/block/natural/BlockIce.java b/common/src/main/java/common/block/natural/BlockIce.java index 758241a8..31fdc279 100755 --- a/common/src/main/java/common/block/natural/BlockIce.java +++ b/common/src/main/java/common/block/natural/BlockIce.java @@ -16,7 +16,7 @@ import common.world.World; import common.world.AWorldServer; import common.world.IWorldAccess; -public class BlockIce extends Block { +public class BlockIce extends BlockNonBlock { public BlockIce() { super(Material.LOOSE); this.setSlipperiness(0.98F); diff --git a/common/src/main/java/common/block/natural/BlockNonBlock.java b/common/src/main/java/common/block/natural/BlockNonBlock.java index 73d9d32a..cb4ad439 100644 --- a/common/src/main/java/common/block/natural/BlockNonBlock.java +++ b/common/src/main/java/common/block/natural/BlockNonBlock.java @@ -6,6 +6,7 @@ import common.block.Material; public class BlockNonBlock extends Block { public BlockNonBlock(Material material) { super(material); + this.setOpacity(255); } public boolean isOpaqueCube() { diff --git a/common/src/main/java/common/block/natural/BlockOre.java b/common/src/main/java/common/block/natural/BlockOre.java index 1eca4564..ea01a9a5 100755 --- a/common/src/main/java/common/block/natural/BlockOre.java +++ b/common/src/main/java/common/block/natural/BlockOre.java @@ -1,6 +1,5 @@ package common.block.natural; -import common.block.Block; import common.block.Material; import common.item.CheatTab; import common.item.Item; @@ -11,7 +10,7 @@ import common.vars.Vars; import common.world.State; import common.world.World; -public class BlockOre extends Block +public class BlockOre extends BlockNonBlock { private ItemStack smeltItem; private ItemStack dropItem; diff --git a/common/src/main/java/common/block/natural/BlockPackedIce.java b/common/src/main/java/common/block/natural/BlockPackedIce.java index b15822eb..b0f1b3c9 100755 --- a/common/src/main/java/common/block/natural/BlockPackedIce.java +++ b/common/src/main/java/common/block/natural/BlockPackedIce.java @@ -5,7 +5,7 @@ import common.block.Material; import common.item.CheatTab; import common.rng.Random; -public class BlockPackedIce extends Block +public class BlockPackedIce extends BlockNonBlock { public BlockPackedIce() { diff --git a/common/src/main/java/common/block/natural/BlockPodzol.java b/common/src/main/java/common/block/natural/BlockPodzol.java index 168a0633..c85599bc 100644 --- a/common/src/main/java/common/block/natural/BlockPodzol.java +++ b/common/src/main/java/common/block/natural/BlockPodzol.java @@ -1,50 +1,20 @@ package common.block.natural; -import common.block.Block; import common.block.Material; -import common.init.Blocks; +import common.block.foliage.BlockSnowable; import common.init.Items; import common.item.CheatTab; import common.item.Item; -import common.model.Model; -import common.model.Model.ModelProvider; -import common.properties.Property; -import common.properties.PropertyBool; import common.rng.Random; -import common.util.BlockPos; -import common.world.IWorldAccess; import common.world.State; -public class BlockPodzol extends Block { - public static final PropertyBool SNOWY = PropertyBool.create("snowy"); - - public BlockPodzol() { - super(Material.LOOSE); - this.setDefaultState(this.getBaseState().withProperty(SNOWY, Boolean.valueOf(false))); +public class BlockPodzol extends BlockSnowable { + public BlockPodzol(boolean snowy) { + super(Material.LOOSE, snowy); this.setTab(CheatTab.NATURE); } - public State getState(State state, IWorldAccess worldIn, BlockPos pos) { - Block block = worldIn.getState(pos.up()).getBlock(); - return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer)); - } - - protected Property[] getProperties() { - return new Property[] {SNOWY}; - } - public Item getDrop(State state, Random rand, int fortune) { return Items.dirt; } - - public Model getModel(ModelProvider provider, String name, State state) { - if(state.getValue(SNOWY)) - return provider.getModel("dirt").add().d().u("snow").nswe().add().nswe("soil_snowed"); - else - return provider.getModel("dirt").add().d().u("podzol_top").nswe().add().nswe("podzol_side"); - } - - protected Property[] getUnsavedProperties() { - return new Property[] {SNOWY}; - } } diff --git a/common/src/main/java/common/block/natural/BlockSnow.java b/common/src/main/java/common/block/natural/BlockSnow.java index cc3b33b2..45e3009f 100755 --- a/common/src/main/java/common/block/natural/BlockSnow.java +++ b/common/src/main/java/common/block/natural/BlockSnow.java @@ -80,7 +80,7 @@ public class BlockSnow extends Block { State iblockstate = worldIn.getState(pos.down()); Block block = iblockstate.getBlock(); - return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.LEAVES ? true : (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.getMaterial().blocksMovement())) : false; + return block != Blocks.ice && block != Blocks.packed_ice ? (block == this && ((Integer)iblockstate.getValue(LAYERS)).intValue() >= 7 ? true : block.isOpaqueCube() && block.getMaterial().blocksMovement()) : false; } /** diff --git a/common/src/main/java/common/block/natural/BlockSnowBlock.java b/common/src/main/java/common/block/natural/BlockSnowBlock.java index b0887e3d..0f8c8fe6 100755 --- a/common/src/main/java/common/block/natural/BlockSnowBlock.java +++ b/common/src/main/java/common/block/natural/BlockSnowBlock.java @@ -11,7 +11,7 @@ import common.vars.Vars; import common.world.State; import common.world.AWorldServer; -public class BlockSnowBlock extends Block { +public class BlockSnowBlock extends BlockNonBlock { public BlockSnowBlock() { super(Material.DIGGABLE); this.setTicked(); diff --git a/common/src/main/java/common/block/natural/BlockSoulSand.java b/common/src/main/java/common/block/natural/BlockSoulSand.java index d1da31d5..cbbe9a7e 100755 --- a/common/src/main/java/common/block/natural/BlockSoulSand.java +++ b/common/src/main/java/common/block/natural/BlockSoulSand.java @@ -1,6 +1,5 @@ package common.block.natural; -import common.block.Block; import common.block.Material; import common.entity.Entity; import common.item.CheatTab; @@ -9,7 +8,7 @@ import common.util.BoundingBox; import common.world.State; import common.world.World; -public class BlockSoulSand extends Block +public class BlockSoulSand extends BlockNonBlock { public BlockSoulSand() { diff --git a/common/src/main/java/common/block/natural/BlockStone.java b/common/src/main/java/common/block/natural/BlockStone.java index 9ac5e0d6..172c1ccd 100755 --- a/common/src/main/java/common/block/natural/BlockStone.java +++ b/common/src/main/java/common/block/natural/BlockStone.java @@ -1,6 +1,5 @@ package common.block.natural; -import common.block.Block; import common.block.Material; import common.init.Items; import common.item.CheatTab; @@ -8,7 +7,7 @@ import common.item.Item; import common.rng.Random; import common.world.State; -public class BlockStone extends Block { +public class BlockStone extends BlockNonBlock { public BlockStone() { super(Material.SOLID); this.setTab(CheatTab.ROCK); diff --git a/common/src/main/java/common/block/tech/BlockAnvil.java b/common/src/main/java/common/block/tech/BlockAnvil.java index 9334c59b..c716e142 100755 --- a/common/src/main/java/common/block/tech/BlockAnvil.java +++ b/common/src/main/java/common/block/tech/BlockAnvil.java @@ -46,14 +46,6 @@ public class BlockAnvil extends BlockFalling implements Rotatable } public boolean isFullCube() - { - return false; - } - - /** - * Used to determine ambient occlusion and culling when rebuilding chunks for render - */ - public boolean isOpaqueCube() { return false; } diff --git a/common/src/main/java/common/init/BlockRegistry.java b/common/src/main/java/common/init/BlockRegistry.java index 514afd56..5f7d724c 100755 --- a/common/src/main/java/common/init/BlockRegistry.java +++ b/common/src/main/java/common/init/BlockRegistry.java @@ -132,17 +132,17 @@ public abstract class BlockRegistry { Block stone = register("stone", (new BlockStone()).setHardness(1.5F).setResistance(10.0F).setSound(SoundType.STONE).setDisplay("Stein")); Block bedrock = register("bedrock", (new BlockBedrock()).setHardness(1000.0F).setResistance(100000.0F).setSound(SoundType.STONE) .setDisplay("Grundgestein").setTab(CheatTab.ROCK).setMiningTool(Equipment.PICKAXE, 6)); - Block rock = register("rock", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE).setDisplay("Felsen").setTab(CheatTab.ROCK)); - Block smooth_rock = register("smooth_rock", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE).setDisplay("Glatter Felsen").setTab(CheatTab.ROCK)); + Block rock = register("rock", (new BlockNonBlock(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE).setDisplay("Felsen").setTab(CheatTab.ROCK)); + Block smooth_rock = register("smooth_rock", (new BlockNonBlock(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE).setDisplay("Glatter Felsen").setTab(CheatTab.ROCK)); Block hellrock = register("hellrock", (new BlockHellRock()).setHardness(0.4F).setSound(SoundType.STONE).setDisplay("Höllenstein")); - Block cell_rock = register("cell_rock", (new Block(Material.LOOSE)).setHardness(1.0F).setResistance(3.0F) + Block cell_rock = register("cell_rock", (new BlockNonBlock(Material.LOOSE)).setHardness(1.0F).setResistance(3.0F) .setSound(SoundType.SLIME).setDisplay("Zellstein").setTab(CheatTab.ROCK)); - Block moon_rock = register("moon_rock", (new Block(Material.SOLID)).setHardness(2.5F).setResistance(10.0F) + Block moon_rock = register("moon_rock", (new BlockNonBlock(Material.SOLID)).setHardness(2.5F).setResistance(10.0F) .setSound(SoundType.STONE).setDisplay("Mondgestein").setTab(CheatTab.ROCK)); - Block cobblestone = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setSound(SoundType.STONE) + Block cobblestone = (new BlockNonBlock(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setSound(SoundType.STONE) .setDisplay("Bruchstein").setTab(CheatTab.ROCK); register("cobblestone", cobblestone); - Block mossy_cobblestone = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setSound(SoundType.STONE) + Block mossy_cobblestone = (new BlockNonBlock(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setSound(SoundType.STONE) .setDisplay("Bemooster Bruchstein").setTab(CheatTab.ROCK); register("mossy_cobblestone", mossy_cobblestone); Block sandstone = (new BlockSandStone("normal")).setSound(SoundType.STONE).setHardness(0.8F).setDisplay("Sandstein"); @@ -173,7 +173,7 @@ public abstract class BlockRegistry { register("glowstone", (new BlockGlowstone(Material.TRANSLUCENT)).setHardness(0.3F).setSound(SoundType.GLASS).setLight(1.0F) .setDisplay("Glowstone")); Block blackened_stone = register("blackened_stone", (new BlockBlackenedStone()).setHardness(1.5F).setResistance(10.0F).setSound(SoundType.STONE).setDisplay("Schwarzstein")); - Block blackened_cobble = register("blackened_cobble", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setSound(SoundType.STONE) + Block blackened_cobble = register("blackened_cobble", (new BlockNonBlock(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setSound(SoundType.STONE) .setDisplay("Schwarzbruchstein").setTab(CheatTab.ROCK)); @@ -212,28 +212,37 @@ public abstract class BlockRegistry { Block dirt; register("dirt", (dirt = new BlockNonBlock(Material.LOOSE)).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Erde").setMiningTool(Equipment.SHOVEL).setTab(CheatTab.NATURE)); - Block grass; + BlockSnowable grass; register("grass", (grass = new BlockGrass(false)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Gras").setMiningTool(Equipment.SHOVEL)); - Block snowy_grass; - register("snowy_grass", (snowy_grass = new BlockGrass(true)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Beschneites Gras").setMiningTool(Equipment.SHOVEL)); + BlockSnowable snowy_grass; + register("snowy_grass", (snowy_grass = new BlockGrass(true).setOther(grass)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Beschneites Gras").setMiningTool(Equipment.SHOVEL)); Block coarse_dirt; register("coarse_dirt", (coarse_dirt = new BlockNonBlock(Material.LOOSE)).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Grobe Erde").setMiningTool(Equipment.SHOVEL).setTab(CheatTab.NATURE)); - Block podzol; - register("podzol", (podzol = new BlockPodzol()).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Podsol").setMiningTool(Equipment.SHOVEL)); - Block mycelium; - register("mycelium", (mycelium = new BlockMycelium()).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Myzel").setMiningTool(Equipment.SHOVEL)); - Block swamp; - register("swamp", (swamp = new BlockSwamp()).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Sumpf").setMiningTool(Equipment.SHOVEL)); + BlockSnowable podzol; + register("podzol", (podzol = new BlockPodzol(false)).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Podsol").setMiningTool(Equipment.SHOVEL)); + BlockSnowable snowy_podzol; + register("snowy_podzol", (snowy_podzol = new BlockPodzol(true).setOther(podzol)).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Podsol").setMiningTool(Equipment.SHOVEL)); + BlockSnowable mycelium; + register("mycelium", (mycelium = new BlockMycelium(false)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Myzel").setMiningTool(Equipment.SHOVEL)); + BlockSnowable snowy_mycelium; + register("snowy_mycelium", (snowy_mycelium = new BlockMycelium(true).setOther(mycelium)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Myzel").setMiningTool(Equipment.SHOVEL)); + BlockSnowable swamp; + register("swamp", (swamp = new BlockSwamp(false)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Sumpf").setMiningTool(Equipment.SHOVEL)); + BlockSnowable snowy_swamp; + register("snowy_swamp", (snowy_swamp = new BlockSwamp(true).setOther(swamp)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Sumpf").setMiningTool(Equipment.SHOVEL)); Block tian; register("tian", (tian = new BlockNonBlock(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE) .setDisplay("Tian").setTab(CheatTab.NATURE)); - Block tian_soil; - register("tian_soil", (tian_soil = new BlockTianSoil()).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE) - .setDisplay("Tianerde").setTab(CheatTab.NATURE)); + BlockSnowable tian_soil; + register("tian_soil", (tian_soil = new BlockTianSoil(false)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE).setDisplay("Tianerde").setTab(CheatTab.NATURE)); + BlockSnowable snowy_tian_soil; + register("snowy_tian_soil", (snowy_tian_soil = new BlockTianSoil(true).setOther(tian_soil)).setHardness(2.0F).setResistance(15.0F).setSound(SoundType.STONE).setDisplay("Tianerde").setTab(CheatTab.NATURE)); Block blackened_dirt; register("blackened_dirt", (blackened_dirt = new BlockBlackenedDirt()).setHardness(0.5F).setSound(SoundType.GRAVEL).setDisplay("Schwarzerde").setMiningTool(Equipment.SHOVEL)); - Block blackened_soil; - register("blackened_soil", (blackened_soil = new BlockBlackenedSoil()).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Schwarzgrund").setMiningTool(Equipment.SHOVEL)); + BlockSnowable blackened_soil; + register("blackened_soil", (blackened_soil = new BlockBlackenedSoil(false)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Schwarzgrund").setMiningTool(Equipment.SHOVEL)); + BlockSnowable snowy_blackened_soil; + register("snowy_blackened_soil", (snowy_blackened_soil = new BlockBlackenedSoil(true).setOther(blackened_soil)).setHardness(0.6F).setSound(SoundType.GRASS).setDisplay("Schwarzgrund").setMiningTool(Equipment.SHOVEL)); Block slime_block; register("slime_block", (slime_block = new BlockSlime()).setDisplay("Schleimblock").setSound(SoundType.SLIME)); Block cheese; diff --git a/common/src/main/java/common/init/Blocks.java b/common/src/main/java/common/init/Blocks.java index ae8d7b03..ce63a428 100755 --- a/common/src/main/java/common/init/Blocks.java +++ b/common/src/main/java/common/init/Blocks.java @@ -84,9 +84,9 @@ public abstract class Blocks { public static final BlockSlab black_quartz_slab = get("black_quartz_slab"); public static final BlockStairs black_quartz_stairs = get("black_quartz_stairs"); public static final BlockWool black_wool = get("black_wool"); - public static final Block blackened_cobble = get("blackened_cobble"); public static final BlockBlackenedDirt blackened_dirt = get("blackened_dirt"); public static final BlockBlackenedSoil blackened_soil = get("blackened_soil"); + public static final BlockBlackenedSoil snowy_blackened_soil = get("snowy_blackened_soil"); public static final BlockBlackenedStone blackened_stone = get("blackened_stone"); public static final BlockDoor black_wood_door = get("black_wood_door"); public static final BlockFence black_wood_fence = get("black_wood_fence"); @@ -133,7 +133,6 @@ public abstract class Blocks { public static final BlockSandStone carved_sandstone = get("carved_sandstone"); public static final Block carved_stonebrick = get("carved_stonebrick"); public static final BlockCauldron cauldron = get("cauldron"); - public static final Block cell_rock = get("cell_rock"); public static final BlockDoor cherry_door = get("cherry_door"); public static final BlockFence cherry_fence = get("cherry_fence"); public static final BlockFenceGate cherry_fence_gate = get("cherry_fence_gate"); @@ -156,7 +155,6 @@ public abstract class Blocks { public static final BlockNonBlock coarse_dirt = get("coarse_dirt"); public static final BlockMetalBlock cobalt_block = get("cobalt_block"); public static final BlockMetalOre cobalt_ore = get("cobalt_ore"); - public static final Block cobblestone = get("cobblestone"); public static final BlockSlab cobblestone_slab = get("cobblestone_slab"); public static final BlockStairs cobblestone_stairs = get("cobblestone_stairs"); public static final BlockWall cobblestone_wall = get("cobblestone_wall"); @@ -319,8 +317,6 @@ public abstract class Blocks { public static final BlockStaticLiquid mercury = get("mercury"); public static final BlockMobSpawner mob_spawner = get("mob_spawner"); public static final BlockTreasure cheese = get("cheese"); - public static final Block moon_rock = get("moon_rock"); - public static final Block mossy_cobblestone = get("mossy_cobblestone"); public static final BlockWall mossy_cobblestone_wall = get("mossy_cobblestone_wall"); public static final Block mossy_stonebrick = get("mossy_stonebrick"); public static final BlockMycelium mycelium = get("mycelium"); @@ -400,7 +396,6 @@ public abstract class Blocks { public static final BlockWool red_wool = get("red_wool"); public static final BlockOre charged_ore = get("charged_ore"); public static final BlockReed reeds = get("reeds"); - public static final Block rock = get("rock"); public static final BlockFlower rose = get("rose"); public static final BlockDoublePlant rose_bush = get("rose_bush"); public static final BlockOre ruby_ore = get("ruby_ore"); @@ -418,7 +413,6 @@ public abstract class Blocks { public static final BlockSkull skull = get("skull"); public static final BlockStaticLiquid slime = get("slime"); public static final BlockSlime slime_block = get("slime_block"); - public static final Block smooth_rock = get("smooth_rock"); public static final BlockSandStone smooth_sandstone = get("smooth_sandstone"); public static final BlockSnowBlock snow = get("snow"); public static final BlockSnow snow_layer = get("snow_layer"); @@ -871,6 +865,17 @@ public abstract class Blocks { public static final BlockItemPipe pipe = get("pipe"); public static final BlockSuctionPipe suction_pipe = get("suction_pipe"); public static final BlockCyber cyber = get("cyber"); + public static final BlockMycelium snowy_mycelium = get("snowy_mycelium"); + public static final BlockPodzol snowy_podzol = get("snowy_podzol"); + public static final BlockSwamp snowy_swamp = get("snowy_swamp"); + public static final BlockTianSoil snowy_tian_soil = get("snowy_tian_soil"); + public static final BlockNonBlock blackened_cobble = get("blackened_cobble"); + public static final BlockNonBlock cell_rock = get("cell_rock"); + public static final BlockNonBlock cobblestone = get("cobblestone"); + public static final BlockNonBlock moon_rock = get("moon_rock"); + public static final BlockNonBlock mossy_cobblestone = get("mossy_cobblestone"); + public static final BlockNonBlock rock = get("rock"); + public static final BlockNonBlock smooth_rock = get("smooth_rock"); private static T get(String id) { T block = (T)BlockRegistry.byNameExact(id); diff --git a/common/src/main/java/common/init/Items.java b/common/src/main/java/common/init/Items.java index 55557320..f298171e 100755 --- a/common/src/main/java/common/init/Items.java +++ b/common/src/main/java/common/init/Items.java @@ -1704,6 +1704,11 @@ public abstract class Items { public static final ItemTool zinc_shovel = get("zinc_shovel"); public static final ItemTool zinc_sword = get("zinc_sword"); public static final Item cyber = get("cyber"); + public static final Item snowy_blackened_soil = get("snowy_blackened_soil"); + public static final Item snowy_mycelium = get("snowy_mycelium"); + public static final Item snowy_podzol = get("snowy_podzol"); + public static final Item snowy_swamp = get("snowy_swamp"); + public static final Item snowy_tian_soil = get("snowy_tian_soil"); private static T get(String id) { T item = (T)ItemRegistry.byName(id); diff --git a/common/src/main/java/common/world/AWorldServer.java b/common/src/main/java/common/world/AWorldServer.java index 8ea71710..f1b74e04 100644 --- a/common/src/main/java/common/world/AWorldServer.java +++ b/common/src/main/java/common/world/AWorldServer.java @@ -56,4 +56,5 @@ public abstract class AWorldServer extends World { public abstract LeavesType getLeavesGen(BlockPos pos); public abstract void scheduleUpdate(BlockPos pos, Block blockIn, int delay); public abstract void notifyNeighborsOfStateChange(BlockPos pos, Block blockType); + public abstract boolean canBlockFreeze(BlockPos pos, boolean noWaterAdj); } diff --git a/common/src/main/java/common/world/Chunk.java b/common/src/main/java/common/world/Chunk.java index f80bcf79..f3035c7f 100755 --- a/common/src/main/java/common/world/Chunk.java +++ b/common/src/main/java/common/world/Chunk.java @@ -455,8 +455,8 @@ public abstract class Chunk { Material mat = block.getMaterial(); if((!mat.blocksMovement() && !mat.isLiquid()) - || (mat == Material.LEAVES && ((mat = this.getBlock(loc.up()).getMaterial()) == Material.POWDER) - || mat == Material.LEAVES)) { + // || (mat == Material.LEAVES && ((mat = this.getBlock(loc.up()).getMaterial()) == Material.POWDER) + || mat == Material.LEAVES) { loc = loc.down(); } else { diff --git a/server/src/main/java/server/world/WorldServer.java b/server/src/main/java/server/world/WorldServer.java index fbd15ba2..2489fb50 100755 --- a/server/src/main/java/server/world/WorldServer.java +++ b/server/src/main/java/server/world/WorldServer.java @@ -489,10 +489,6 @@ public final class WorldServer extends AWorldServer { BlockPos blockpos2 = this.getPrecipitationHeight(new BlockPos(cx + (k2 & 15), 0, cz + (k2 >> 8 & 15))); BlockPos blockpos1 = blockpos2.down(); - if(this.canBlockFreeze(blockpos1, true)) { - this.setState(blockpos1, Blocks.ice.getState()); - } - if(this.snow && this.isRaining() && this.canSnowAt(blockpos2, true, SVars.snowStack)) { State layer = SVars.snowStack ? this.getState(blockpos2) : null; this.setState(blockpos2, SVars.snowStack && layer.getBlock() == Blocks.snow_layer