Skip to content

Commit

Permalink
Fixed logs poofing out of existence in bushes, finished merge on #9
Browse files Browse the repository at this point in the history
  • Loading branch information
dries007 committed Aug 17, 2018
1 parent 72546c5 commit 67cafbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@ public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand)
{
// For floating tree things, just make them gently disappear over time
if (state.getValue(PLACED)) return;
for (int x = -1; x <= 1; x++)
for (int y = -1; y <= 1; y++)
for (int z = -1; z <= 1; z++)
if (state.getValue(PLACED) || (world.getBlockState(pos.add(x, y, z)).getBlock() == this && (z != 0 || y != 0 || x != 0)))
if (world.getBlockState(pos.add(x, y, z)).getBlock() == this && (z != 0 || y != 0 || x != 0))
return;
world.setBlockToAir(pos);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*
* Work under Copyright. Licensed under the EUPL.
* See the project README.md and LICENSE.txt for more information.
*
*/

package net.dries007.tfc.world.classic.worldgen.trees;
Expand Down Expand Up @@ -34,7 +33,8 @@ public void generateTree(TemplateManager manager, World world, BlockPos pos, Tre
{
IBlockState leaves = BlockLeavesTFC.get(tree).getDefaultState().withProperty(DECAYABLE, true);

checkAndPlace(BlockLogTFC.get(tree).getDefaultState().withProperty(PLACED, false).withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE), world, pos);
// Has to fake being placed, otherwise the log will just poof out of existence. todo: better fix for this.
checkAndPlace(BlockLogTFC.get(tree).getDefaultState().withProperty(PLACED, true).withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE), world, pos);
checkAndPlace(leaves, world, pos.add(0, 1, 0));

for (EnumFacing face : EnumFacing.HORIZONTALS)
Expand Down

0 comments on commit 67cafbb

Please sign in to comment.