mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 12:32:23 +00:00
Fix 1408 Floating desert acacia "trees" appear in the middle of nowere
This commit is contained in:
1 parent
d567138365
commit
2d0ca49359
8 files changed
+11
-14
No files matched your search
@@ -44,7 +44,6 @@ import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IBeeMutation;
|
||||
import forestry.api.apiculture.IBeekeepingMode;
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.core.BiomeHelper;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.IErrorState;
|
||||
|
||||
@@ -37,7 +37,6 @@ import forestry.core.multiblock.MultiblockLogic;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.render.ParticleHelper;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
import forestry.factory.tiles.TileSqueezer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.SoundType;
|
||||
|
||||
@@ -65,6 +65,7 @@ public class WoodProvider implements IWoodProvider {
|
||||
return woodType.getCarbonization();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getCharcoalChance(int numberOfCharcoal){
|
||||
return woodType.getCharcoalChance(numberOfCharcoal);
|
||||
}
|
||||
|
||||
@@ -80,6 +80,7 @@ public class WoodProviderVanilla implements IWoodProvider {
|
||||
return TreeManager.woodAccess.getStack(woodType, WoodBlockKind.LOG, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getCharcoalChance(int numberOfCharcoal){
|
||||
return woodType.getCharcoalChance(numberOfCharcoal);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.arboriculture.items;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.api.arboriculture.EnumGermlingType;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class WorldGenAcacia extends WorldGenTree {
|
||||
public WorldGenAcacia(ITreeGenData tree) {
|
||||
super(tree, 5, 2);
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<BlockPos> generateTrunk(World world, Random rand, TreeBlockTypeLog wood, BlockPos startPos) {
|
||||
@@ -41,20 +41,21 @@ public class WorldGenAcacia extends WorldGenTree {
|
||||
treeTops.addAll(treeTops2);
|
||||
}
|
||||
|
||||
Set<BlockPos> branchEnds = new HashSet<>(treeTops);
|
||||
Set<BlockPos> branchEnds = new HashSet<>();
|
||||
|
||||
for (BlockPos treeTop : treeTops) {
|
||||
int xOffset = treeTop.getX();
|
||||
int yOffset = treeTop.getY() + 1;
|
||||
int yOffset = treeTop.getY() - startPos.getY() + 1;
|
||||
int zOffset = treeTop.getZ();
|
||||
float canopyMultiplier = (1.5f * height - yOffset + 2) / 4.0f;
|
||||
int canopyThickness = Math.max(1, Math.round(yOffset / 10.0f));
|
||||
|
||||
|
||||
branchEnds.add(new BlockPos(xOffset, startPos.getY() + yOffset--, zOffset));
|
||||
yOffset--;
|
||||
|
||||
float canopyWidth = rand.nextBoolean() ? 3.0f : 2.5f;
|
||||
int radius = Math.round(canopyMultiplier * canopyWidth - 4);
|
||||
BlockPos pos = startPos.add(xOffset, yOffset - canopyThickness, zOffset);
|
||||
BlockPos pos = new BlockPos(xOffset, startPos.getY() + yOffset - canopyThickness, zOffset);
|
||||
branchEnds.addAll(WorldGenHelper.generateBranches(world, rand, wood, pos, girth, 0.0f, 0.1f, radius, 2, 1.0f));
|
||||
}
|
||||
|
||||
@@ -64,11 +65,11 @@ public class WorldGenAcacia extends WorldGenTree {
|
||||
@Override
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
for (BlockPos branchEnd : branchEnds) {
|
||||
int leafSpawn = branchEnd.getY();
|
||||
int leafSpawn = branchEnd.getY() - startPos.getY();
|
||||
int canopyThickness = Math.max(1, Math.round(leafSpawn / 10.0f));
|
||||
float canopyMultiplier = (1.5f * height - leafSpawn + 2) / 4.0f;
|
||||
float canopyWidth = rand.nextBoolean() ? 2.0f : 4.5f;
|
||||
BlockPos center = new BlockPos(branchEnd.getX(), leafSpawn - canopyThickness + 1, branchEnd.getZ());
|
||||
float canopyWidth = rand.nextBoolean() ? 1.0f : 1.5f;
|
||||
BlockPos center = new BlockPos(branchEnd.getX(), leafSpawn - canopyThickness + 1 + startPos.getY(), branchEnd.getZ());
|
||||
float radius = Math.max(1, canopyMultiplier * canopyWidth + girth);
|
||||
WorldGenHelper.generateCylinderFromPos(world, leaf, center, radius, canopyThickness, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
|
||||
@@ -3,7 +3,6 @@ package forestry.factory.recipes.jei.squeezer;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import forestry.core.recipes.jei.ForestryRecipeCategoryUid;
|
||||
import forestry.core.recipes.jei.ForestryRecipeWrapper;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
|
||||
Reference in new issue
Block a user