mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-15 01:35:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc7dc2c14d | ||
|
|
807a8e24ed | ||
|
|
2e74ed4645 | ||
|
|
ebdb282c6b | ||
|
|
d60f070e75 | ||
|
|
0b2e47d88d | ||
|
|
6be0719a9f | ||
|
|
e9ad1bda8e | ||
|
|
a15d297f8a | ||
|
|
0444201f7a | ||
|
|
3e9965b750 | ||
|
|
e8d843eb89 | ||
|
|
555f44889d | ||
|
|
4bca0f042d | ||
|
|
dc288141ac | ||
|
|
d26f4816e1 | ||
|
|
79b8e3e6a4 | ||
|
|
5e21a29d3f | ||
|
|
f6e2eec09c | ||
|
|
031b077a4b | ||
|
|
49f4c84b5d | ||
|
|
09b4d5a207 | ||
|
|
68f226e07e | ||
|
|
da6ea7048a | ||
|
|
d721a7e98f | ||
|
|
ce050eaa63 | ||
|
|
0133d143f8 | ||
|
|
7cc917ae76 | ||
|
|
6f1d00e4f5 | ||
|
|
2aa0b9bb8c | ||
|
|
d5d8885850 | ||
|
|
cb6cb3a01f | ||
|
|
cd5c2b3406 | ||
|
|
b1b06753ad | ||
|
|
5846f59d64 | ||
|
|
ec790c9333 | ||
|
|
784fa0ad30 | ||
|
|
3bd8c53273 | ||
|
|
bc10e65feb | ||
|
|
3eaf99a4d1 | ||
|
|
7910cff956 |
No files matched your search
+1
-1
@@ -22,7 +22,7 @@ buildscript {
|
||||
apply plugin: "se.bjurr.gitchangelog.git-changelog-gradle-plugin"
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "2.0.17"
|
||||
version = "2.0.19"
|
||||
if (System.getenv("BUILD_NUMBER") != null) {
|
||||
version = version + "-" + System.getenv("BUILD_NUMBER")
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class CircuitGarden extends BinnieCircuit {
|
||||
if (info.length() > 0) {
|
||||
info = " (" + info + EnumChatFormatting.RESET + ")";
|
||||
}
|
||||
addTooltipString("Flowers" + info);
|
||||
addTooltipString(I18N.localise("botany.circuit.flowers") + info);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -89,10 +89,28 @@ public class GardenLogic extends FarmLogic {
|
||||
return stack.getItem() == Item.getItemFromBlock(Blocks.dirt);
|
||||
}
|
||||
|
||||
private boolean maintainSoil(int x2, int y2, int z2, FarmDirection direction, int extent) {
|
||||
private boolean maintainSoil(int x, int y, int z, FarmDirection direction, int extent) {
|
||||
for (int i = 0; i < extent; ++i) {
|
||||
Vect position = translateWithOffset(x2, y2, z2, direction, i);
|
||||
if (fertilised && Gardening.isSoil(world.getBlock(position.x, position.y, position.z))) {
|
||||
Vect position = translateWithOffset(x, y, z, direction, i);
|
||||
boolean isSoil = Gardening.isSoil(world.getBlock(position.x, position.y, position.z));
|
||||
|
||||
// remove unnecessary blocks
|
||||
if (!isManual && !isSoil && !isAirBlock(position)) {
|
||||
Block block = world.getBlock(position.x, position.y, position.z);
|
||||
if (moisture == EnumMoisture.DAMP) {
|
||||
if (block != Blocks.water) {
|
||||
dropBlockAsProduction(position);
|
||||
}
|
||||
} else if (moisture == EnumMoisture.DRY) {
|
||||
if (block != Blocks.sand) {
|
||||
dropBlockAsProduction(position);
|
||||
}
|
||||
} else {
|
||||
dropBlockAsProduction(position);
|
||||
}
|
||||
}
|
||||
|
||||
if (fertilised && isSoil) {
|
||||
IBlockSoil soil = (IBlockSoil) world.getBlock(position.x, position.y, position.z);
|
||||
if (soil.fertilise(world, position.x, position.y, position.z, EnumSoilType.FLOWERBED)) {
|
||||
continue;
|
||||
@@ -101,55 +119,56 @@ public class GardenLogic extends FarmLogic {
|
||||
|
||||
if (world.getBlock(position.x, position.y + 1, position.z) == Botany.plant) {
|
||||
world.setBlockToAir(position.x, position.y + 1, position.z);
|
||||
} else {
|
||||
if (acidity != null && Gardening.isSoil(world.getBlock(position.x, position.y, position.z))) {
|
||||
IBlockSoil soil = (IBlockSoil) world.getBlock(position.x, position.y, position.z);
|
||||
EnumAcidity pH = soil.getPH(world, position.x, position.y, position.z);
|
||||
if (pH.ordinal() < acidity.ordinal()) {
|
||||
ItemStack stack = getAvailableAlkaline();
|
||||
if (stack != null && soil.setPH(world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() + 1])) {
|
||||
housing.getFarmInventory().removeResources(new ItemStack[]{stack});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pH.ordinal() > acidity.ordinal()) {
|
||||
ItemStack stack = getAvailableAcid();
|
||||
if (stack != null && soil.setPH(world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() - 1])) {
|
||||
housing.getFarmInventory().removeResources(new ItemStack[]{stack});
|
||||
continue;
|
||||
}
|
||||
if (acidity != null && isSoil) {
|
||||
IBlockSoil soil = (IBlockSoil) world.getBlock(position.x, position.y, position.z);
|
||||
EnumAcidity pH = soil.getPH(world, position.x, position.y, position.z);
|
||||
if (pH.ordinal() < acidity.ordinal()) {
|
||||
ItemStack stack = getAvailableAlkaline();
|
||||
if (stack != null && soil.setPH(world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() + 1])) {
|
||||
housing.getFarmInventory().removeResources(new ItemStack[]{stack});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isAirBlock(position) && !world.getBlock(position.x, position.y, position.z).isReplaceable(world, position.x, position.y, position.z)) {
|
||||
ItemStack block = getAsItemStack(position);
|
||||
ItemStack loam = getAvailableLoam();
|
||||
if (isWaste(block) && loam != null) {
|
||||
produce.addAll(Blocks.dirt.getDrops(world, position.x, position.y, position.z, block.getItemDamage(), 0));
|
||||
setBlock(position, Blocks.air, 0);
|
||||
return trySetSoil(position, loam);
|
||||
if (pH.ordinal() > acidity.ordinal()) {
|
||||
ItemStack stack = getAvailableAcid();
|
||||
if (stack != null && soil.setPH(world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() - 1])) {
|
||||
housing.getFarmInventory().removeResources(new ItemStack[]{stack});
|
||||
continue;
|
||||
}
|
||||
} else if (!isManual) {
|
||||
if (!isWaterBlock(position)) {
|
||||
if (i % 2 == 0) {
|
||||
return trySetSoil(position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FarmDirection cclock = FarmDirection.EAST;
|
||||
if (direction == FarmDirection.EAST) {
|
||||
cclock = FarmDirection.SOUTH;
|
||||
} else if (direction == FarmDirection.SOUTH) {
|
||||
cclock = FarmDirection.EAST;
|
||||
} else if (direction == FarmDirection.WEST) {
|
||||
cclock = FarmDirection.SOUTH;
|
||||
}
|
||||
if (!isAirBlock(position) && !world.getBlock(position.x, position.y, position.z).isReplaceable(world, position.x, position.y, position.z)) {
|
||||
ItemStack block = getAsItemStack(position);
|
||||
ItemStack loam = getAvailableLoam();
|
||||
if (isWaste(block) && loam != null) {
|
||||
produce.addAll(Blocks.dirt.getDrops(world, position.x, position.y, position.z, block.getItemDamage(), 0));
|
||||
setBlock(position, Blocks.air, 0);
|
||||
return trySetSoil(position, loam);
|
||||
}
|
||||
} else if (!isManual) {
|
||||
if (!isWaterBlock(position)) {
|
||||
if (i % 2 == 0) {
|
||||
return trySetSoil(position);
|
||||
}
|
||||
|
||||
Vect previous = translateWithOffset(position.x, position.y, position.z, cclock, 1);
|
||||
ItemStack soil2 = getAsItemStack(previous);
|
||||
if (!Gardening.isSoil(soil2.getItem())) {
|
||||
trySetSoil(position);
|
||||
}
|
||||
FarmDirection cclock = FarmDirection.EAST;
|
||||
if (direction == FarmDirection.EAST) {
|
||||
cclock = FarmDirection.SOUTH;
|
||||
} else if (direction == FarmDirection.SOUTH) {
|
||||
cclock = FarmDirection.EAST;
|
||||
} else if (direction == FarmDirection.WEST) {
|
||||
cclock = FarmDirection.SOUTH;
|
||||
}
|
||||
|
||||
Vect previous = translateWithOffset(position.x, position.y, position.z, cclock, 1);
|
||||
ItemStack soil2 = getAsItemStack(previous);
|
||||
if (!Gardening.isSoil(soil2.getItem())) {
|
||||
trySetSoil(position);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -278,10 +297,19 @@ public class GardenLogic extends FarmLogic {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void dropBlockAsProduction(Vect position) {
|
||||
ItemStack stack = new ItemStack(world.getBlock(position.x, position.y, position.z));
|
||||
if (stack.getItem() == null) {
|
||||
return;
|
||||
}
|
||||
produce.add(stack);
|
||||
world.setBlockToAir(position.x, position.y, position.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedGermling(ItemStack itemstack) {
|
||||
public boolean isAcceptedGermling(ItemStack stack) {
|
||||
for (IFarmable farmable : farmables) {
|
||||
if (farmable.isGermling(itemstack)) {
|
||||
if (farmable.isGermling(stack)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -340,7 +368,7 @@ public class GardenLogic extends FarmLogic {
|
||||
|
||||
try {
|
||||
IOwnable housing2 = (IOwnable) housing;
|
||||
GameProfile prof = (GameProfile) IOwnable.class.getMethod("getOwnerProfile", new Class[0]).invoke(housing2);
|
||||
GameProfile prof = (GameProfile) IOwnable.class.getMethod("getOwnerProfile", new Class[0]).invoke(housing2);
|
||||
((TileEntityFlower) tile).setOwner(prof);
|
||||
} catch (Exception ex) {
|
||||
// ignored
|
||||
|
||||
@@ -36,6 +36,12 @@ public class BlockFlower extends BlockContainer {
|
||||
setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, f * 3.0f, 0.5f + f);
|
||||
setTickRandomly(true);
|
||||
setBlockName("flower");
|
||||
setStepSound(Block.soundTypeGrass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return "botany.flower";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -217,4 +223,10 @@ public class BlockFlower extends BlockContainer {
|
||||
}
|
||||
return hasBeenBroken;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int meta, int side) {
|
||||
return Blocks.yellow_flower.getIcon(0, 0);
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ public class ItemInsulatedTube extends Item {
|
||||
icons = new IIcon[3];
|
||||
setUnlocalizedName("insulatedTube");
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public static ItemStack getInsulateStack(ItemStack stack) {
|
||||
@@ -52,9 +53,9 @@ public class ItemInsulatedTube extends Item {
|
||||
if (pass == 0) {
|
||||
return 0xffffff;
|
||||
}
|
||||
return (pass == 1) ?
|
||||
Material.get(stack.getItemDamage()).getColor() :
|
||||
Insulate.get(stack.getItemDamage()).getColor();
|
||||
return (pass == 1)
|
||||
? Material.get(stack.getItemDamage()).getColor()
|
||||
: Insulate.get(stack.getItemDamage()).getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,6 +26,7 @@ public class BlockPlant extends BlockBush {
|
||||
setBlockName("plant");
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setTickRandomly(true);
|
||||
setStepSound(Block.soundTypeGrass);
|
||||
}
|
||||
|
||||
public static boolean isWeed(IBlockAccess world, int x, int y, int z) {
|
||||
|
||||
@@ -111,7 +111,7 @@ public class ModuleGardening implements IInitializable {
|
||||
if (fertilised) {
|
||||
insulate += 3;
|
||||
}
|
||||
new CircuitGarden(moist, null, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 0 + 128 * insulate), icon);
|
||||
new CircuitGarden(moist, null, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 128 * insulate), icon);
|
||||
new CircuitGarden(moist, EnumAcidity.ACID, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 1 + 128 * insulate), icon);
|
||||
new CircuitGarden(moist, EnumAcidity.NEUTRAL, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 2 + 128 * insulate), icon);
|
||||
new CircuitGarden(moist, EnumAcidity.ALKALINE, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 3 + 128 * insulate), icon);
|
||||
@@ -132,6 +132,13 @@ public class ModuleGardening implements IInitializable {
|
||||
}
|
||||
}
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Botany.soil, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Botany.loam, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Botany.flowerbed, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Botany.soilNoWeed, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Botany.loamNoWeed, 1, OreDictionary.WILDCARD_VALUE));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Botany.flowerbedNoWeed, 1, OreDictionary.WILDCARD_VALUE));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
Botany.trowelWood,
|
||||
new Object[]{
|
||||
@@ -193,6 +200,7 @@ public class ModuleGardening implements IInitializable {
|
||||
new ItemStack(Items.wheat_seeds),
|
||||
new ItemStack(Items.wheat_seeds)
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.AshPowder.get(4), Mods.forestry.stack("ash"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.MulchPowder.get(4), Mods.forestry.stack("mulch"));
|
||||
GameRegistry.addShapelessRecipe(BotanyItems.CompostPowder.get(4), Mods.forestry.stack("fertilizerBio"));
|
||||
@@ -202,6 +210,7 @@ public class ModuleGardening implements IInitializable {
|
||||
BotanyItems.SulphurPowder.get(4),
|
||||
new Object[]{"dustSulphur"}
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
new ItemStack(Botany.pigment, 2, EnumFlowerColor.BLACK.ordinal()),
|
||||
new Object[]{
|
||||
@@ -210,6 +219,7 @@ public class ModuleGardening implements IInitializable {
|
||||
"dyeBlack"
|
||||
}
|
||||
));
|
||||
|
||||
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.SulphurPowder.get(1), 1);
|
||||
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.MulchPowder.get(1), 1);
|
||||
ModuleGardening.queuedAcidFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "mulch")), 2);
|
||||
@@ -245,6 +255,7 @@ public class ModuleGardening implements IInitializable {
|
||||
'c', Items.clay_ball,
|
||||
'g', Blocks.gravel
|
||||
);
|
||||
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
ItemStack clay = new ItemStack(Botany.clay, 1, c.ordinal());
|
||||
ItemStack pigment = new ItemStack(Botany.pigment, 1, c.ordinal());
|
||||
@@ -252,8 +263,14 @@ public class ModuleGardening implements IInitializable {
|
||||
GameRegistry.addSmelting(clay, TileEntityMetadata.getItemStack(Botany.ceramic, c.ordinal()), 0.0f);
|
||||
ItemStack glass = TileEntityMetadata.getItemStack(Botany.stained, c.ordinal());
|
||||
glass.stackSize = 4;
|
||||
GameRegistry.addShapedRecipe(glass, " g ", "gpg", " g ", 'g', Blocks.glass, 'p', pigment);
|
||||
GameRegistry.addShapedRecipe(
|
||||
glass,
|
||||
" g ", "gpg", " g ",
|
||||
'g', Blocks.glass,
|
||||
'p', pigment
|
||||
);
|
||||
}
|
||||
|
||||
GameRegistry.addRecipe(new PigmentRecipe());
|
||||
}
|
||||
|
||||
|
||||
@@ -274,7 +274,12 @@ public class WindowFieldKit extends Window {
|
||||
return;
|
||||
}
|
||||
|
||||
getWindowInventory().setInventorySlotContents(0, Analyser.analyse(getWindowInventory().getStackInSlot(0)));
|
||||
ItemStack stack = getWindowInventory().getStackInSlot(0);
|
||||
if (stack == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
getWindowInventory().setInventorySlotContents(0, Analyser.analyse(stack));
|
||||
getWindowInventory().decrStackSize(1, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -393,9 +393,9 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
if (rotating) {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GuiScreen.itemRender.renderItemOverlayIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y(), null);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GuiScreen.itemRender.renderItemOverlayIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y(), null);
|
||||
GL11.glClear(256);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
@@ -24,13 +24,16 @@ public class MachineComponent implements INBTTagable {
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public void onUpdate() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public Class[] getComponentInterfaces() {
|
||||
@@ -38,6 +41,7 @@ public class MachineComponent implements INBTTagable {
|
||||
}
|
||||
|
||||
public void onInventoryUpdate() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public MachinePayload getPayload() {
|
||||
|
||||
@@ -164,9 +164,9 @@ public class MachineUtil {
|
||||
return machine.getInterface(IProcess.class);
|
||||
}
|
||||
|
||||
public List<ItemStack> getNonNullStacks(int[] slotAcclimatiser) {
|
||||
List<ItemStack> stacks = new ArrayList<ItemStack>();
|
||||
for (ItemStack stack : getStacks(slotAcclimatiser)) {
|
||||
public List<ItemStack> getNonNullStacks(int[] slot) {
|
||||
List<ItemStack> stacks = new ArrayList<>();
|
||||
for (ItemStack stack : getStacks(slot)) {
|
||||
if (stack != null) {
|
||||
stacks.add(stack);
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@ public class ManagerMachine extends ManagerBase {
|
||||
return;
|
||||
}
|
||||
|
||||
Set<Class<?>> interfaces = new HashSet<Class<?>>();
|
||||
for (Class<?> currentClass = component; currentClass != null; currentClass = null) {
|
||||
Set<Class<?>> interfaces = new HashSet<>();
|
||||
for (Class<?> currentClass = component; currentClass != null; currentClass = currentClass.getSuperclass()) {
|
||||
Collections.addAll(interfaces, currentClass.getInterfaces());
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ public abstract class ComponentProcessIndefinate extends MachineComponent implem
|
||||
|
||||
public ComponentProcessIndefinate(IMachine machine, float energyPerTick) {
|
||||
super(machine);
|
||||
this.energyPerTick = energyPerTick;
|
||||
actionPauseProcess = 0.0f;
|
||||
actionCancelTask = 0.0f;
|
||||
clientEnergyPerSecond = 0;
|
||||
this.energyPerTick = energyPerTick;
|
||||
}
|
||||
|
||||
protected IPoweredMachine getPower() {
|
||||
@@ -52,6 +52,7 @@ public abstract class ComponentProcessIndefinate extends MachineComponent implem
|
||||
} else if (isInProgress()) {
|
||||
onCancelTask();
|
||||
}
|
||||
|
||||
if (actionPauseProcess > 0.0f) {
|
||||
actionPauseProcess--;
|
||||
}
|
||||
|
||||
@@ -32,30 +32,32 @@ public enum BinnieCorePacketID implements IPacketID {
|
||||
((INetworkedEntity) tile).readFromPacket(packet.payload);
|
||||
}
|
||||
} else if (this == BinnieCorePacketID.TileMetadata) {
|
||||
MessageMetadata packet2 = new MessageMetadata(message);
|
||||
TileEntity tile = packet2.getTileEntity(BinnieCore.proxy.getWorld());
|
||||
MessageMetadata packet = new MessageMetadata(message);
|
||||
TileEntity tile = packet.getTileEntity(BinnieCore.proxy.getWorld());
|
||||
if (tile instanceof TileEntityMetadata) {
|
||||
((TileEntityMetadata) tile).setTileMetadata(packet2.meta, true);
|
||||
((TileEntityMetadata) tile).setTileMetadata(packet.meta, true);
|
||||
}
|
||||
} else if (this == BinnieCorePacketID.CraftGUIAction && context.side == Side.CLIENT) {
|
||||
MessageCraftGUI packet3 = new MessageCraftGUI(message);
|
||||
EntityPlayer player = BinnieCore.proxy.getPlayer();
|
||||
if (player.openContainer instanceof ContainerCraftGUI && packet3.getTagCompound() != null) {
|
||||
((ContainerCraftGUI) player.openContainer).recieveNBT(Side.CLIENT, player, packet3.getTagCompound());
|
||||
}
|
||||
} else if (this == BinnieCorePacketID.CraftGUIAction && context.side == Side.SERVER && context.netHandler instanceof NetHandlerPlayServer) {
|
||||
MessageCraftGUI packet3 = new MessageCraftGUI(message);
|
||||
EntityPlayer player = ((NetHandlerPlayServer) context.netHandler).playerEntity;
|
||||
if (player.openContainer instanceof ContainerCraftGUI && packet3.getTagCompound() != null) {
|
||||
((ContainerCraftGUI) player.openContainer).recieveNBT(Side.SERVER, player, packet3.getTagCompound());
|
||||
} else if (this == BinnieCorePacketID.CraftGUIAction) {
|
||||
if (context.side == Side.CLIENT) {
|
||||
MessageCraftGUI packet = new MessageCraftGUI(message);
|
||||
EntityPlayer player = BinnieCore.proxy.getPlayer();
|
||||
if (player.openContainer instanceof ContainerCraftGUI && packet.getTagCompound() != null) {
|
||||
((ContainerCraftGUI) player.openContainer).recieveNBT(Side.CLIENT, player, packet.getTagCompound());
|
||||
}
|
||||
} else if (context.netHandler instanceof NetHandlerPlayServer) {
|
||||
MessageCraftGUI packet = new MessageCraftGUI(message);
|
||||
EntityPlayer player = ((NetHandlerPlayServer) context.netHandler).playerEntity;
|
||||
if (player.openContainer instanceof ContainerCraftGUI && packet.getTagCompound() != null) {
|
||||
((ContainerCraftGUI) player.openContainer).recieveNBT(Side.SERVER, player, packet.getTagCompound());
|
||||
}
|
||||
}
|
||||
} else if (this == BinnieCorePacketID.TileDescriptionSync && context.side == Side.CLIENT) {
|
||||
MessageTileNBT packet4 = new MessageTileNBT(message);
|
||||
TileEntity tile = packet4.getTarget(BinnieCore.proxy.getWorld());
|
||||
if (tile != null && packet4.getTagCompound() != null) {
|
||||
MessageTileNBT packet = new MessageTileNBT(message);
|
||||
TileEntity tile = packet.getTarget(BinnieCore.proxy.getWorld());
|
||||
if (tile != null && packet.getTagCompound() != null) {
|
||||
IMachine machine = Machine.getMachine(tile);
|
||||
if (machine != null && machine instanceof INetwork.TilePacketSync) {
|
||||
((INetwork.TilePacketSync) machine).syncFromNBT(packet4.getTagCompound());
|
||||
((INetwork.TilePacketSync) machine).syncFromNBT(packet.getTagCompound());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,10 +51,10 @@ public class ExtraTrees extends AbstractMod {
|
||||
public static Block blockLog;
|
||||
public static BlockCarpentry blockCarpentry;
|
||||
public static Block blockPlanks;
|
||||
public static Block blockShrubLeaves;
|
||||
public static Block blockMachine;
|
||||
public static Block blockFence;
|
||||
public static BlockCarpentry blockPanel;
|
||||
public static Block blockKitchen;
|
||||
public static Block blockSlab;
|
||||
public static Block blockDoubleSlab;
|
||||
public static Item itemHammer;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import forestry.arboriculture.blocks.BlockForestryLeaves;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockShrubLeaves extends BlockForestryLeaves {
|
||||
public BlockShrubLeaves() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginLeavesDecay(World world, int x, int y, int z) {
|
||||
// ignored, no able decay
|
||||
}
|
||||
}
|
||||
@@ -40,12 +40,14 @@ public class ModuleBlocks implements IInitializable {
|
||||
ExtraTrees.blockPlanks = new BlockETPlanks();
|
||||
ExtraTrees.blockFence = new BlockFence();
|
||||
ExtraTrees.blockLog = new BlockETLog();
|
||||
ExtraTrees.blockShrubLeaves = new BlockShrubLeaves();
|
||||
ExtraTrees.blockGate = new BlockGate();
|
||||
ExtraTrees.blockDoor = new BlockETDoor();
|
||||
ExtraTrees.blockMultiFence = new BlockMultiFence();
|
||||
ExtraTrees.blockSlab = new BlockETSlab(false);
|
||||
ExtraTrees.blockDoubleSlab = new BlockETSlab(true);
|
||||
ExtraTrees.blockStairs = new BlockETStairs(ExtraTrees.blockPlanks);
|
||||
|
||||
GameRegistry.registerBlock(ExtraTrees.blockPlanks, ItemMetadata.class, "planks");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockFence, ItemMetadata.class, "fence");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockMultiFence, ItemMetadata.class, "multifence");
|
||||
@@ -56,6 +58,7 @@ public class ModuleBlocks implements IInitializable {
|
||||
GameRegistry.registerBlock(ExtraTrees.blockDoubleSlab, ItemETSlab.class, "doubleSlab");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockDoor, ItemETDoor.class, "door");
|
||||
GameRegistry.registerBlock(ExtraTrees.blockStairs, ItemETStairs.class, "stairs");
|
||||
|
||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockStairs), new StairItemRenderer());
|
||||
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockGate), new GateItemRenderer());
|
||||
for (ILogType plank : ILogType.ExtraTreeLog.values()) {
|
||||
|
||||
@@ -31,41 +31,41 @@ public class PlankType {
|
||||
}
|
||||
|
||||
public enum ExtraTreePlanks implements IPlankType, IFenceProvider {
|
||||
Fir(12815444),
|
||||
Cedar(14181940),
|
||||
Hemlock(13088108),
|
||||
Cypress(16169052),
|
||||
Fig(13142058),
|
||||
Beech(14784849),
|
||||
Alder(12092755),
|
||||
Hazel(13480341),
|
||||
Hornbeam(12818528),
|
||||
Box(16511430),
|
||||
Butternut(15510138),
|
||||
Hickory(14333070),
|
||||
Whitebeam(13222585),
|
||||
Elm(15772004),
|
||||
Apple(6305064),
|
||||
Yew(14722426),
|
||||
Pear(12093805),
|
||||
Hawthorn(13402978),
|
||||
Rowan(13610394),
|
||||
Elder(12489337),
|
||||
Maclura(15970862),
|
||||
Syzgium(15123393),
|
||||
Brazilwood(7487063),
|
||||
Logwood(10762028),
|
||||
Iroko(7681024),
|
||||
Locust(12816736),
|
||||
Eucalyptus(16165771),
|
||||
Purpleheart(5970991),
|
||||
Ash(16107368),
|
||||
Holly(16512743),
|
||||
Olive(11578760),
|
||||
Sweetgum(13997656),
|
||||
Rosewood(7738624),
|
||||
Gingko(16050106),
|
||||
PinkIvory(15502496);
|
||||
Fir(0xc38c54),
|
||||
Cedar(0xd86634),
|
||||
Hemlock(0xc7b56c),
|
||||
Cypress(0xf6b85c),
|
||||
Fig(0xc8882a),
|
||||
Beech(0xe19951),
|
||||
Alder(0xb88553),
|
||||
Hazel(0xcdb195),
|
||||
Hornbeam(0xc39860),
|
||||
Box(0xfbf1c6),
|
||||
Butternut(0xecaa7a),
|
||||
Hickory(0xdab48e),
|
||||
Whitebeam(0xc9c2b9),
|
||||
Elm(0xf0a964),
|
||||
Apple(0x603528),
|
||||
Yew(0xe0a57a),
|
||||
Pear(0xb8896d),
|
||||
Hawthorn(0xcc8362),
|
||||
Rowan(0xcfad9a),
|
||||
Elder(0xbe9279),
|
||||
Maclura(0xf3b22e),
|
||||
Syzgium(0xe6c3c1),
|
||||
Brazilwood(0x723e57),
|
||||
Logwood(0xa4372c),
|
||||
Iroko(0x753400),
|
||||
Locust(0xc39160),
|
||||
Eucalyptus(0xf6ab8b),
|
||||
Purpleheart(0x5b1c2f),
|
||||
Ash(0xf5c768),
|
||||
Holly(0xfbf6e7),
|
||||
Olive(0xb0ad88),
|
||||
Sweetgum(0xd59658),
|
||||
Rosewood(0x761500),
|
||||
Gingko(0xf4e7ba),
|
||||
PinkIvory(0xec8ca0);
|
||||
|
||||
protected int color;
|
||||
protected IIcon icon;
|
||||
@@ -109,7 +109,7 @@ public class PlankType {
|
||||
}
|
||||
}
|
||||
|
||||
public enum VanillaPlanks implements IPlankType {
|
||||
public enum VanillaPlanks implements IPlankType, IFenceProvider {
|
||||
OAK(0xb4905a),
|
||||
SPRUCE(0x805e36),
|
||||
BIRCH(0xd7c185),
|
||||
@@ -149,6 +149,11 @@ public class PlankType {
|
||||
Block block = Blocks.planks;
|
||||
return block.getIcon(2, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getFence() {
|
||||
return TileEntityMetadata.getItemStack(ExtraTrees.blockFence, WoodManager.getPlankTypeIndex(this));
|
||||
}
|
||||
}
|
||||
|
||||
public enum ForestryPlanks implements IPlankType, IFenceProvider {
|
||||
|
||||
@@ -55,6 +55,12 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
for (IFenceProvider type : PlankType.ExtraTreePlanks.values()) {
|
||||
list.add(type.getFence());
|
||||
}
|
||||
|
||||
for (IFenceProvider type : PlankType.VanillaPlanks.values()) {
|
||||
if (type != PlankType.VanillaPlanks.OAK) {
|
||||
list.add(type.getFence());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,7 @@ public class MultiFenceRecipeSize implements IRecipe {
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
StringBuilder pattern = new StringBuilder();
|
||||
List<IPlankType> types = new ArrayList<IPlankType>();
|
||||
List<IPlankType> types = new ArrayList<>();
|
||||
for (int i = 0; i < inv.getSizeInventory(); ++i) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
IPlankType type = (stack == null) ? null : WoodManager.get(stack);
|
||||
|
||||
@@ -135,7 +135,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
|
||||
tooltip.add(I18N.localise(
|
||||
"extratrees.block.tooltip.twoColors",
|
||||
"extratrees.block.tooltip.twoMaterials",
|
||||
block.getPrimaryMaterial().getName(),
|
||||
block.getSecondaryMaterial().getName()
|
||||
));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.extratrees.carpentry;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -11,6 +12,7 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockStainedDesign extends BlockDesign {
|
||||
@@ -60,4 +62,18 @@ public class BlockStainedDesign extends BlockDesign {
|
||||
public String getBlockName(DesignBlock design) {
|
||||
return I18N.localise("extratrees.block.stainedglass.name", design.getDesign().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
|
||||
tooltip.add(I18N.localise(
|
||||
"extratrees.block.tooltip.twoColors",
|
||||
block.getPrimaryMaterial().getName(),
|
||||
block.getSecondaryMaterial().getName()
|
||||
));
|
||||
} else {
|
||||
tooltip.add(block.getPrimaryMaterial().getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,28 +6,64 @@ import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.ILogType;
|
||||
import binnie.extratrees.worldgen.DefaultTreeGenerator;
|
||||
import binnie.extratrees.worldgen.WorldGenAlder;
|
||||
import binnie.extratrees.worldgen.WorldGenApple;
|
||||
import binnie.extratrees.worldgen.WorldGenAsh;
|
||||
import binnie.extratrees.worldgen.WorldGenAcornOak;
|
||||
import binnie.extratrees.worldgen.WorldGenAspen;
|
||||
import binnie.extratrees.worldgen.WorldGenBalsamFir;
|
||||
import binnie.extratrees.worldgen.WorldGenBanana;
|
||||
import binnie.extratrees.worldgen.WorldGenBeech;
|
||||
import binnie.extratrees.worldgen.WorldGenConifer;
|
||||
import binnie.extratrees.worldgen.WorldGenBox;
|
||||
import binnie.extratrees.worldgen.WorldGenBrazilNut;
|
||||
import binnie.extratrees.worldgen.WorldGenBrazilwood;
|
||||
import binnie.extratrees.worldgen.WorldGenButternut;
|
||||
import binnie.extratrees.worldgen.WorldGenCedar;
|
||||
import binnie.extratrees.worldgen.WorldGenClove;
|
||||
import binnie.extratrees.worldgen.WorldGenCoconut;
|
||||
import binnie.extratrees.worldgen.WorldGenCoffee;
|
||||
import binnie.extratrees.worldgen.WorldGenCommonAlder;
|
||||
import binnie.extratrees.worldgen.WorldGenCommonAsh;
|
||||
import binnie.extratrees.worldgen.WorldGenCommonBeech;
|
||||
import binnie.extratrees.worldgen.WorldGenCopperBeech;
|
||||
import binnie.extratrees.worldgen.WorldGenCypress;
|
||||
import binnie.extratrees.worldgen.WorldGenDefault;
|
||||
import binnie.extratrees.worldgen.WorldGenEucalyptus;
|
||||
import binnie.extratrees.worldgen.WorldGenFir;
|
||||
import binnie.extratrees.worldgen.WorldGenDouglasFir;
|
||||
import binnie.extratrees.worldgen.WorldGenElder;
|
||||
import binnie.extratrees.worldgen.WorldGenElm;
|
||||
import binnie.extratrees.worldgen.WorldGenFloweringCrabapple;
|
||||
import binnie.extratrees.worldgen.WorldGenGingko;
|
||||
import binnie.extratrees.worldgen.WorldGenHawthorn;
|
||||
import binnie.extratrees.worldgen.WorldGenHazel;
|
||||
import binnie.extratrees.worldgen.WorldGenHolly;
|
||||
import binnie.extratrees.worldgen.WorldGenJungle;
|
||||
import binnie.extratrees.worldgen.WorldGenHornbeam;
|
||||
import binnie.extratrees.worldgen.WorldGenIroko;
|
||||
import binnie.extratrees.worldgen.WorldGenLazy;
|
||||
import binnie.extratrees.worldgen.WorldGenMaple;
|
||||
import binnie.extratrees.worldgen.WorldGenPalm;
|
||||
import binnie.extratrees.worldgen.WorldGenPoplar;
|
||||
import binnie.extratrees.worldgen.WorldGenLoblollyPine;
|
||||
import binnie.extratrees.worldgen.WorldGenLocust;
|
||||
import binnie.extratrees.worldgen.WorldGenLogwood;
|
||||
import binnie.extratrees.worldgen.WorldGenMango;
|
||||
import binnie.extratrees.worldgen.WorldGenMonkeyPuzzle;
|
||||
import binnie.extratrees.worldgen.WorldGenOldFustic;
|
||||
import binnie.extratrees.worldgen.WorldGenOlive;
|
||||
import binnie.extratrees.worldgen.WorldGenOrchardApple;
|
||||
import binnie.extratrees.worldgen.WorldGenOsangeOsange;
|
||||
import binnie.extratrees.worldgen.WorldGenPear;
|
||||
import binnie.extratrees.worldgen.WorldGenPecan;
|
||||
import binnie.extratrees.worldgen.WorldGenPrairieCrabapple;
|
||||
import binnie.extratrees.worldgen.WorldGenPurpleheart;
|
||||
import binnie.extratrees.worldgen.WorldGenRainbowGum;
|
||||
import binnie.extratrees.worldgen.WorldGenRedMaple;
|
||||
import binnie.extratrees.worldgen.WorldGenRoseGum;
|
||||
import binnie.extratrees.worldgen.WorldGenRosewood;
|
||||
import binnie.extratrees.worldgen.WorldGenRowan;
|
||||
import binnie.extratrees.worldgen.WorldGenSallow;
|
||||
import binnie.extratrees.worldgen.WorldGenShrub;
|
||||
import binnie.extratrees.worldgen.WorldGenSorbus;
|
||||
import binnie.extratrees.worldgen.WorldGenSilverFir;
|
||||
import binnie.extratrees.worldgen.WorldGenSwampGum;
|
||||
import binnie.extratrees.worldgen.WorldGenSweetCrabapple;
|
||||
import binnie.extratrees.worldgen.WorldGenSweetgum;
|
||||
import binnie.extratrees.worldgen.WorldGenSycamore;
|
||||
import binnie.extratrees.worldgen.WorldGenTree;
|
||||
import binnie.extratrees.worldgen.WorldGenTree2;
|
||||
import binnie.extratrees.worldgen.WorldGenTree3;
|
||||
import binnie.extratrees.worldgen.WorldGenTropical;
|
||||
import binnie.extratrees.worldgen.WorldGenWalnut;
|
||||
import binnie.extratrees.worldgen.WorldGenWesternHemlock;
|
||||
import binnie.extratrees.worldgen.WorldGenWhitebeam;
|
||||
import binnie.extratrees.worldgen.WorldGenYew;
|
||||
import binnie.genetics.genetics.AlleleHelper;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -71,10 +107,10 @@ import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGermlingIconProvider {
|
||||
OrchardApple("malus", "domestica", 0x648830, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Apple, WorldGenApple.OrchardApple.class),
|
||||
SweetCrabapple("malus", "coronaria", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenApple.SweetCrabapple.class),
|
||||
FloweringCrabapple("malus", "hopa", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenApple.FloweringCrabapple.class),
|
||||
PrairieCrabapple("malus", "ioensis", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenApple.PrairieCrabapple.class),
|
||||
OrchardApple("malus", "domestica", 0x648830, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Apple, WorldGenOrchardApple.class),
|
||||
SweetCrabapple("malus", "coronaria", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenSweetCrabapple.class),
|
||||
FloweringCrabapple("malus", "hopa", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenFloweringCrabapple.class),
|
||||
PrairieCrabapple("malus", "ioensis", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenPrairieCrabapple.class),
|
||||
Blackthorn("prunus", "spinosa ", 0x6d8f1e, ILogType.ForestryLog.PLUM, ExtraTreeFruitGene.Blackthorn),
|
||||
CherryPlum("prunus", "cerasifera", 0x6d8f1e, ILogType.ForestryLog.PLUM, ExtraTreeFruitGene.CherryPlum),
|
||||
Peach("prunus", "persica", 0x6d8f1e, ILogType.ForestryLog.PLUM, ExtraTreeFruitGene.Peach),
|
||||
@@ -99,75 +135,75 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
Banana("musa", "sinensis", 0xa1cd8e, ILogType.ExtraTreeLog.Banana, ExtraTreeFruitGene.Banana, WorldGenBanana.class),
|
||||
RedBanana("musa", "rubra", 0xa1cd8e, ILogType.ExtraTreeLog.Banana, ExtraTreeFruitGene.RedBanana, WorldGenBanana.class),
|
||||
Plantain("musa", "paradisiaca", 0xa1cd8e, ILogType.ExtraTreeLog.Banana, ExtraTreeFruitGene.Plantain, WorldGenBanana.class),
|
||||
Butternut("juglans", "cinerea", 0x82b58c, ILogType.ExtraTreeLog.Butternut, ExtraTreeFruitGene.Butternut, WorldGenWalnut.Butternut.class),
|
||||
Rowan("sorbus", "aucuparia", 0x9ec79b, ILogType.ExtraTreeLog.Rowan, null, WorldGenSorbus.Rowan.class),
|
||||
Hemlock("tsuga", "heterophylla", 0x5cac72, ILogType.ExtraTreeLog.Hemlock, null, WorldGenConifer.WesternHemlock.class),
|
||||
Ash("fraxinus", "excelsior", 0x488e2b, ILogType.ExtraTreeLog.Ash, null, WorldGenAsh.CommonAsh.class),
|
||||
Alder("alnus", "glutinosa", 0x698a33, ILogType.ExtraTreeLog.Alder, null, WorldGenAlder.CommonAlder.class),
|
||||
Beech("fagus", "sylvatica", 0x83a04c, ILogType.ExtraTreeLog.Beech, ExtraTreeFruitGene.Beechnut, WorldGenBeech.CommonBeech.class),
|
||||
CopperBeech("fagus", "purpurea", 0x801318, ILogType.ExtraTreeLog.Beech, ExtraTreeFruitGene.Beechnut, WorldGenBeech.CopperBeech.class),
|
||||
Aspen("populus", "tremula", 0x8acc37, ILogType.ForestryLog.POPLAR, null, WorldGenPoplar.Aspen.class),
|
||||
Yew("taxus", "baccata", 0x948a4d, ILogType.ExtraTreeLog.Yew, null, WorldGenConifer.Yew.class),
|
||||
Cypress("chamaecyparis", "lawsoniana", 0x89c9a7, ILogType.ExtraTreeLog.Cypress, null, WorldGenConifer.Cypress.class),
|
||||
DouglasFir("pseudotsuga", "menziesii", 0x99b582, ILogType.ExtraTreeLog.Fir, null, WorldGenFir.DouglasFir.class),
|
||||
Hazel("Corylus", "avellana", 0x9bb552, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenTree3.Hazel.class),
|
||||
Sycamore("ficus", "sycomorus", 0xa0a52f, ILogType.ExtraTreeLog.Fig, ExtraTreeFruitGene.Fig, WorldGenTree3.Sycamore.class),
|
||||
Whitebeam("sorbus", "aria", 0xbace99, ILogType.ExtraTreeLog.Whitebeam, null, WorldGenSorbus.Whitebeam.class),
|
||||
Hawthorn("crataegus", "monogyna", 0x6ba84a, ILogType.ExtraTreeLog.Hawthorn, null, WorldGenTree3.Hawthorn.class),
|
||||
Pecan("carya", "illinoinensis", 0x85b674, ILogType.ExtraTreeLog.Hickory, ExtraTreeFruitGene.Pecan, WorldGenTree3.Pecan.class),
|
||||
Elm("ulmus", "procera", 0x7c9048, ILogType.ExtraTreeLog.Elm, null, WorldGenTree3.Elm.class),
|
||||
Elder("sambucus", "nigra", 0xaeb873, ILogType.ExtraTreeLog.Elder, ExtraTreeFruitGene.Elderberry, WorldGenTree3.Elder.class),
|
||||
Holly("ilex", "aquifolium", 0x254b4c, ILogType.ExtraTreeLog.Holly, null, WorldGenHolly.Holly.class),
|
||||
Hornbeam("carpinus", "betulus", 0x96a71b, ILogType.ExtraTreeLog.Hornbeam, null, WorldGenTree3.Hornbeam.class),
|
||||
Sallow("salix", "caprea", 0xaeb323, ILogType.ForestryLog.WILLOW, null, WorldGenTree3.Sallow.class),
|
||||
AcornOak("quercus", "robur", 0x66733e, ILogType.VanillaLog.Oak, ExtraTreeFruitGene.Acorn, WorldGenTree3.AcornOak.class),
|
||||
Fir("abies", "alba", 0x6f7c20, ILogType.ExtraTreeLog.Fir, null, WorldGenFir.SilverFir.class),
|
||||
Cedar("cedrus", "libani", 0x95a370, ILogType.ExtraTreeLog.Cedar, null, WorldGenConifer.Cedar.class),
|
||||
Olive("olea", "europaea", 0x3c4834, ILogType.ExtraTreeLog.Olive, ExtraTreeFruitGene.Olive, WorldGenTree2.Olive.class),
|
||||
RedMaple("acer", "ubrum", 0xe82e17, ILogType.ForestryLog.MAPLE, null, WorldGenMaple.RedMaple.class),
|
||||
BalsamFir("abies", "balsamea", 0x74a07c, ILogType.ExtraTreeLog.Fir, null, WorldGenFir.BalsamFir.class),
|
||||
LoblollyPine("pinus", "taeda", 0x6f8a47, ILogType.ForestryLog.PINE, null, WorldGenConifer.LoblollyPine.class),
|
||||
Sweetgum("liquidambar", "styraciflua", 0x8b8762, ILogType.ExtraTreeLog.Sweetgum, null, WorldGenTree2.Sweetgum.class),
|
||||
Locust("robinia", "pseudoacacia", 0x887300, ILogType.ExtraTreeLog.Locust, null, WorldGenTree2.Locust.class),
|
||||
Pear("pyrus", "communis", 0x5e8826, ILogType.ExtraTreeLog.Pear, ExtraTreeFruitGene.Pear, WorldGenTree2.Pear.class),
|
||||
OsangeOsange("maclura", "pomifera", 0x687a50, ILogType.ExtraTreeLog.Maclura, ExtraTreeFruitGene.OsangeOsange, WorldGenJungle.OsangeOsange.class),
|
||||
OldFustic("maclura", "tinctoria", 0x687a50, ILogType.ExtraTreeLog.Maclura, null, WorldGenJungle.OldFustic.class),
|
||||
Brazilwood("caesalpinia", "echinata", 0x607459, ILogType.ExtraTreeLog.Brazilwood, null, WorldGenJungle.Brazilwood.class),
|
||||
Logwood("haematoxylum", "campechianum", 0x889f6b, ILogType.ExtraTreeLog.Logwood, null, WorldGenJungle.Logwood.class),
|
||||
Rosewood("dalbergia", "latifolia", 0x879b22, ILogType.ExtraTreeLog.Rosewood, null, WorldGenJungle.Rosewood.class),
|
||||
Purpleheart("peltogyne", "spp.", 0x778f55, ILogType.ExtraTreeLog.Purpleheart, null, WorldGenJungle.Purpleheart.class),
|
||||
Iroko("milicia", "excelsa", 0xafc86c, ILogType.ExtraTreeLog.Iroko, null, WorldGenTree2.Iroko.class),
|
||||
Gingko("ginkgo", "biloba", 0x719651, ILogType.ExtraTreeLog.Gingko, ExtraTreeFruitGene.GingkoNut, WorldGenTree2.Gingko.class),
|
||||
Brazilnut("bertholletia", "excelsa", 0x7c8f7b, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.BrazilNut, WorldGenJungle.BrazilNut.class),
|
||||
RoseGum("eucalyptus", "grandis", 0x9ca258, ILogType.ExtraTreeLog.Eucalyptus, null, WorldGenEucalyptus.RoseGum.class),
|
||||
SwampGum("eucalyptus", "grandis", 0xa2c686, ILogType.ExtraTreeLog.Eucalyptus2, null, WorldGenEucalyptus.SwampGum.class),
|
||||
Box("boxus", "sempervirens", 0x72996d, ILogType.ExtraTreeLog.Box, null, WorldGenTree2.Box.class),
|
||||
Clove("syzygium", "aromaticum", 0x7a821f, ILogType.ExtraTreeLog.Syzgium, ExtraTreeFruitGene.Clove, WorldGenTree2.Clove.class),
|
||||
Coffee("coffea", "arabica", 0x6f9065, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Coffee, WorldGenJungle.Coffee.class),
|
||||
MonkeyPuzzle("araucaria", "araucana", 0x576158, ILogType.ForestryLog.PINE, null, WorldGenConifer.MonkeyPuzzle.class),
|
||||
RainbowGum("eucalyptus", "deglupta", 0xb7f025, ILogType.ExtraTreeLog.Eucalyptus3, null, WorldGenEucalyptus.RainbowGum.class),
|
||||
Butternut("juglans", "cinerea", 0x82b58c, ILogType.ExtraTreeLog.Butternut, ExtraTreeFruitGene.Butternut, WorldGenButternut.class),
|
||||
Rowan("sorbus", "aucuparia", 0x9ec79b, ILogType.ExtraTreeLog.Rowan, null, WorldGenRowan.class),
|
||||
Hemlock("tsuga", "heterophylla", 0x5cac72, ILogType.ExtraTreeLog.Hemlock, null, WorldGenWesternHemlock.class),
|
||||
Ash("fraxinus", "excelsior", 0x488e2b, ILogType.ExtraTreeLog.Ash, null, WorldGenCommonAsh.class),
|
||||
Alder("alnus", "glutinosa", 0x698a33, ILogType.ExtraTreeLog.Alder, null, WorldGenCommonAlder.class),
|
||||
Beech("fagus", "sylvatica", 0x83a04c, ILogType.ExtraTreeLog.Beech, ExtraTreeFruitGene.Beechnut, WorldGenCommonBeech.class),
|
||||
CopperBeech("fagus", "purpurea", 0x801318, ILogType.ExtraTreeLog.Beech, ExtraTreeFruitGene.Beechnut, WorldGenCopperBeech.class),
|
||||
Aspen("populus", "tremula", 0x8acc37, ILogType.ForestryLog.POPLAR, null, WorldGenAspen.class),
|
||||
Yew("taxus", "baccata", 0x948a4d, ILogType.ExtraTreeLog.Yew, null, WorldGenYew.class),
|
||||
Cypress("chamaecyparis", "lawsoniana", 0x89c9a7, ILogType.ExtraTreeLog.Cypress, null, WorldGenCypress.class),
|
||||
DouglasFir("pseudotsuga", "menziesii", 0x99b582, ILogType.ExtraTreeLog.Fir, null, WorldGenDouglasFir.class),
|
||||
Hazel("Corylus", "avellana", 0x9bb552, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenHazel.class),
|
||||
Sycamore("ficus", "sycomorus", 0xa0a52f, ILogType.ExtraTreeLog.Fig, ExtraTreeFruitGene.Fig, WorldGenSycamore.class),
|
||||
Whitebeam("sorbus", "aria", 0xbace99, ILogType.ExtraTreeLog.Whitebeam, null, WorldGenWhitebeam.class),
|
||||
Hawthorn("crataegus", "monogyna", 0x6ba84a, ILogType.ExtraTreeLog.Hawthorn, null, WorldGenHawthorn.class),
|
||||
Pecan("carya", "illinoinensis", 0x85b674, ILogType.ExtraTreeLog.Hickory, ExtraTreeFruitGene.Pecan, WorldGenPecan.class),
|
||||
Elm("ulmus", "procera", 0x7c9048, ILogType.ExtraTreeLog.Elm, null, WorldGenElm.class),
|
||||
Elder("sambucus", "nigra", 0xaeb873, ILogType.ExtraTreeLog.Elder, ExtraTreeFruitGene.Elderberry, WorldGenElder.class),
|
||||
Holly("ilex", "aquifolium", 0x254b4c, ILogType.ExtraTreeLog.Holly, null, WorldGenHolly.class),
|
||||
Hornbeam("carpinus", "betulus", 0x96a71b, ILogType.ExtraTreeLog.Hornbeam, null, WorldGenHornbeam.class),
|
||||
Sallow("salix", "caprea", 0xaeb323, ILogType.ForestryLog.WILLOW, null, WorldGenSallow.class),
|
||||
AcornOak("quercus", "robur", 0x66733e, ILogType.VanillaLog.Oak, ExtraTreeFruitGene.Acorn, WorldGenAcornOak.class),
|
||||
Fir("abies", "alba", 0x6f7c20, ILogType.ExtraTreeLog.Fir, null, WorldGenSilverFir.class),
|
||||
Cedar("cedrus", "libani", 0x95a370, ILogType.ExtraTreeLog.Cedar, null, WorldGenCedar.class),
|
||||
Olive("olea", "europaea", 0x3c4834, ILogType.ExtraTreeLog.Olive, ExtraTreeFruitGene.Olive, WorldGenOlive.class),
|
||||
RedMaple("acer", "ubrum", 0xe82e17, ILogType.ForestryLog.MAPLE, null, WorldGenRedMaple.class),
|
||||
BalsamFir("abies", "balsamea", 0x74a07c, ILogType.ExtraTreeLog.Fir, null, WorldGenBalsamFir.class),
|
||||
LoblollyPine("pinus", "taeda", 0x6f8a47, ILogType.ForestryLog.PINE, null, WorldGenLoblollyPine.class),
|
||||
Sweetgum("liquidambar", "styraciflua", 0x8b8762, ILogType.ExtraTreeLog.Sweetgum, null, WorldGenSweetgum.class),
|
||||
Locust("robinia", "pseudoacacia", 0x887300, ILogType.ExtraTreeLog.Locust, null, WorldGenLocust.class),
|
||||
Pear("pyrus", "communis", 0x5e8826, ILogType.ExtraTreeLog.Pear, ExtraTreeFruitGene.Pear, WorldGenPear.class),
|
||||
OsangeOsange("maclura", "pomifera", 0x687a50, ILogType.ExtraTreeLog.Maclura, ExtraTreeFruitGene.OsangeOsange, WorldGenOsangeOsange.class),
|
||||
OldFustic("maclura", "tinctoria", 0x687a50, ILogType.ExtraTreeLog.Maclura, null, WorldGenOldFustic.class),
|
||||
Brazilwood("caesalpinia", "echinata", 0x607459, ILogType.ExtraTreeLog.Brazilwood, null, WorldGenBrazilwood.class),
|
||||
Logwood("haematoxylum", "campechianum", 0x889f6b, ILogType.ExtraTreeLog.Logwood, null, WorldGenLogwood.class),
|
||||
Rosewood("dalbergia", "latifolia", 0x879b22, ILogType.ExtraTreeLog.Rosewood, null, WorldGenRosewood.class),
|
||||
Purpleheart("peltogyne", "spp.", 0x778f55, ILogType.ExtraTreeLog.Purpleheart, null, WorldGenPurpleheart.class),
|
||||
Iroko("milicia", "excelsa", 0xafc86c, ILogType.ExtraTreeLog.Iroko, null, WorldGenIroko.class),
|
||||
Gingko("ginkgo", "biloba", 0x719651, ILogType.ExtraTreeLog.Gingko, ExtraTreeFruitGene.GingkoNut, WorldGenGingko.class),
|
||||
Brazilnut("bertholletia", "excelsa", 0x7c8f7b, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.BrazilNut, WorldGenBrazilNut.class),
|
||||
RoseGum("eucalyptus", "grandis", 0x9ca258, ILogType.ExtraTreeLog.Eucalyptus, null, WorldGenRoseGum.class),
|
||||
SwampGum("eucalyptus", "grandis", 0xa2c686, ILogType.ExtraTreeLog.Eucalyptus2, null, WorldGenSwampGum.class),
|
||||
Box("boxus", "sempervirens", 0x72996d, ILogType.ExtraTreeLog.Box, null, WorldGenBox.class),
|
||||
Clove("syzygium", "aromaticum", 0x7a821f, ILogType.ExtraTreeLog.Syzgium, ExtraTreeFruitGene.Clove, WorldGenClove.class),
|
||||
Coffee("coffea", "arabica", 0x6f9065, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Coffee, WorldGenCoffee.class),
|
||||
MonkeyPuzzle("araucaria", "araucana", 0x576158, ILogType.ForestryLog.PINE, null, WorldGenMonkeyPuzzle.class),
|
||||
RainbowGum("eucalyptus", "deglupta", 0xb7f025, ILogType.ExtraTreeLog.Eucalyptus3, null, WorldGenRainbowGum.class),
|
||||
PinkIvory("berchemia", "zeyheri", 0x7c9159, ILogType.ExtraTreeLog.PinkIvory, null, WorldGenTree.class),
|
||||
Blackcurrant("ribes", "nigrum", 0xa6da5c, null, ExtraTreeFruitGene.Blackcurrant, WorldGenShrub.Shrub.class),
|
||||
Redcurrant("ribes", "rubrum", 0x74ac00, null, ExtraTreeFruitGene.Redcurrant, WorldGenShrub.Shrub.class),
|
||||
Blackberry("rubus", "fruticosus", 0x92c15b, null, ExtraTreeFruitGene.Blackberry, WorldGenShrub.Shrub.class),
|
||||
Raspberry("rubus", "idaeus", 0x83b96e, null, ExtraTreeFruitGene.Raspberry, WorldGenShrub.Shrub.class),
|
||||
Blueberry("vaccinium", "corymbosum", 0x72c750, null, ExtraTreeFruitGene.Blueberry, WorldGenShrub.Shrub.class),
|
||||
Cranberry("vaccinium", "oxycoccos", 0x96d179, null, ExtraTreeFruitGene.Cranberry, WorldGenShrub.Shrub.class),
|
||||
Juniper("juniperus", "communis", 0x90b149, null, ExtraTreeFruitGene.Juniper, WorldGenShrub.Shrub.class),
|
||||
Gooseberry("ribes", "grossularia", 0x79bb00, null, ExtraTreeFruitGene.Gooseberry, WorldGenShrub.Shrub.class),
|
||||
GoldenRaspberry("rubus", "occidentalis", 0x83b96e, null, ExtraTreeFruitGene.GoldenRaspberry, WorldGenShrub.Shrub.class),
|
||||
Cinnamon("cinnamomum", "cassia", 0x738e0b, ILogType.ExtraTreeLog.Cinnamon, null, WorldGenLazy.Tree.class),
|
||||
Coconut("cocous", "nucifera", 0x649923, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Coconut, WorldGenPalm.Coconut.class),
|
||||
Cashew("anacardium", "occidentale", 0xabb962, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Cashew, WorldGenLazy.Tree.class),
|
||||
Avacado("persea", "americana", 0x96a375, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Avacado, WorldGenLazy.Tree.class),
|
||||
Nutmeg("myristica", "fragrans", 0x488d4c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Nutmeg, WorldGenLazy.Tree.class),
|
||||
Allspice("pimenta", "dioica", 0x7c9724, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Allspice, WorldGenLazy.Tree.class),
|
||||
Chilli("capsicum", "annuum", 0x2a9f01, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Chilli, WorldGenLazy.Tree.class),
|
||||
StarAnise("illicium", "verum", 0x7fc409, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.StarAnise, WorldGenLazy.Tree.class),
|
||||
Mango("mangifera", "indica", 0x87b574, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Mango, WorldGenTropical.Mango.class),
|
||||
Starfruit("averrhoa", "carambola", 0x6da92d, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Starfruit, WorldGenLazy.Tree.class),
|
||||
Candlenut("aleurites", "moluccana", 0x8aa36c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Candlenut, WorldGenLazy.Tree.class),
|
||||
DwarfHazel("Corylus", "americana", 0x9bb552, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenShrub.Shrub.class);
|
||||
Blackcurrant("ribes", "nigrum", 0xa6da5c, null, ExtraTreeFruitGene.Blackcurrant, WorldGenShrub.class),
|
||||
Redcurrant("ribes", "rubrum", 0x74ac00, null, ExtraTreeFruitGene.Redcurrant, WorldGenShrub.class),
|
||||
Blackberry("rubus", "fruticosus", 0x92c15b, null, ExtraTreeFruitGene.Blackberry, WorldGenShrub.class),
|
||||
Raspberry("rubus", "idaeus", 0x83b96e, null, ExtraTreeFruitGene.Raspberry, WorldGenShrub.class),
|
||||
Blueberry("vaccinium", "corymbosum", 0x72c750, null, ExtraTreeFruitGene.Blueberry, WorldGenShrub.class),
|
||||
Cranberry("vaccinium", "oxycoccos", 0x96d179, null, ExtraTreeFruitGene.Cranberry, WorldGenShrub.class),
|
||||
Juniper("juniperus", "communis", 0x90b149, null, ExtraTreeFruitGene.Juniper, WorldGenShrub.class),
|
||||
Gooseberry("ribes", "grossularia", 0x79bb00, null, ExtraTreeFruitGene.Gooseberry, WorldGenShrub.class),
|
||||
GoldenRaspberry("rubus", "occidentalis", 0x83b96e, null, ExtraTreeFruitGene.GoldenRaspberry, WorldGenShrub.class),
|
||||
Cinnamon("cinnamomum", "cassia", 0x738e0b, ILogType.ExtraTreeLog.Cinnamon, null, WorldGenLazy.class),
|
||||
Coconut("cocous", "nucifera", 0x649923, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Coconut, WorldGenCoconut.class),
|
||||
Cashew("anacardium", "occidentale", 0xabb962, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Cashew, WorldGenLazy.class),
|
||||
Avacado("persea", "americana", 0x96a375, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Avacado, WorldGenLazy.class),
|
||||
Nutmeg("myristica", "fragrans", 0x488d4c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Nutmeg, WorldGenLazy.class),
|
||||
Allspice("pimenta", "dioica", 0x7c9724, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Allspice, WorldGenLazy.class),
|
||||
Chilli("capsicum", "annuum", 0x2a9f01, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Chilli, WorldGenLazy.class),
|
||||
StarAnise("illicium", "verum", 0x7fc409, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.StarAnise, WorldGenLazy.class),
|
||||
Mango("mangifera", "indica", 0x87b574, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Mango, WorldGenMango.class),
|
||||
Starfruit("averrhoa", "carambola", 0x6da92d, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Starfruit, WorldGenLazy.class),
|
||||
Candlenut("aleurites", "moluccana", 0x8aa36c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Candlenut, WorldGenLazy.class),
|
||||
DwarfHazel("Corylus", "americana", 0x9bb552, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenShrub.class);
|
||||
|
||||
public ILogType wood;
|
||||
|
||||
@@ -1169,6 +1205,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
try {
|
||||
return gen.getConstructor(ITreeGenData.class).newInstance(tree);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
@@ -1179,11 +1216,9 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
leafType = type;
|
||||
if (leafType == LeafType.CONIFER) {
|
||||
saplingType = SaplingType.CONIFER;
|
||||
}
|
||||
if (leafType == LeafType.JUNGLE) {
|
||||
} else if (leafType == LeafType.JUNGLE) {
|
||||
saplingType = SaplingType.JUNGLE;
|
||||
}
|
||||
if (leafType == LeafType.PALM) {
|
||||
} else if (leafType == LeafType.PALM) {
|
||||
saplingType = SaplingType.PALM;
|
||||
}
|
||||
return this;
|
||||
@@ -1247,7 +1282,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getLeafColour(ITree tree) {
|
||||
public int getLeafColor(ITree tree) {
|
||||
return color;
|
||||
}
|
||||
|
||||
@@ -1359,14 +1394,14 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
public int getGermlingColour(EnumGermlingType type, int renderPass) {
|
||||
if (type == EnumGermlingType.SAPLING) {
|
||||
if (renderPass == 0) {
|
||||
return getLeafColour(null);
|
||||
return getLeafColor(null);
|
||||
}
|
||||
if (getLog() == null) {
|
||||
return 0xffffff;
|
||||
}
|
||||
return getLog().getColour();
|
||||
}
|
||||
return getLeafColour(null);
|
||||
return getLeafColor(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import binnie.core.Mods;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockTypeLeaf extends BlockType {
|
||||
public BlockTypeLeaf() {
|
||||
super(Mods.forestry.block("leaves"), 0);
|
||||
public BlockTypeLeaf(boolean decay) {
|
||||
super(decay ? Mods.forestry.block("leaves") : ExtraTrees.blockShrubLeaves, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,8 +24,9 @@ public class DefaultTreeGenerator implements ITreeGenerator {
|
||||
|
||||
@Override
|
||||
public void setLogBlock(ITreeGenome genome, World world, int x, int y, int z, ForgeDirection direction) {
|
||||
if (extraTreeSpecies.wood != null)
|
||||
if (extraTreeSpecies.wood != null) {
|
||||
extraTreeSpecies.wood.placeBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenAcornOak extends WorldGenTree {
|
||||
public WorldGenAcornOak(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 3.0f;
|
||||
float width = height * randBetween(0.45f, 0.5f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.4f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.7f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.2f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenAlder {
|
||||
public static class CommonAlder extends WorldGenTree {
|
||||
public CommonAlder(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.4f, 0.45f);
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
}
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenApple {
|
||||
public static class OrchardApple extends WorldGenTree {
|
||||
public OrchardApple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
while (leafSpawn > 2) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 6);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class SweetCrabapple extends WorldGenTree {
|
||||
public SweetCrabapple(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
|
||||
while (leafSpawn > 3) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 4);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class FloweringCrabapple extends WorldGenTree {
|
||||
public FloweringCrabapple(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
|
||||
while (leafSpawn > 3) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.0f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 6);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class PrairieCrabapple extends WorldGenTree {
|
||||
public PrairieCrabapple(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
|
||||
while (leafSpawn > 3) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 4);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenAsh {
|
||||
public static class CommonAsh extends WorldGenTree {
|
||||
public CommonAsh(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.35f, 0.45f);
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
|
||||
}
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenAspen extends WorldGenTree {
|
||||
public WorldGenAspen(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(height / 2, height / 2 + 1) + 1;
|
||||
float width = height * randBetween(0.25f, 0.35f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.5f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.9f, 1.1f) * width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenBalsamFir extends WorldGenTree {
|
||||
public WorldGenBalsamFir(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = 1.0f;
|
||||
float width = height / randBetween(2.0f, 2.5f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= width;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -13,10 +13,10 @@ public class WorldGenBanana extends WorldGenTree {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height + 1;
|
||||
float width = height / randBetween(1.8f, 2.0f);
|
||||
int bottom = randBetween(3, 4);
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.9f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.9f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
|
||||
public class WorldGenBeech {
|
||||
public static class CommonBeech extends WorldGenTree {
|
||||
public CommonBeech(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.47f, 0.5f);
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static class CopperBeech extends CommonBeech {
|
||||
public CopperBeech(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenBox extends WorldGenTree {
|
||||
public WorldGenBox(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = 0.0f;
|
||||
float width = 1.5f;
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenBrazilNut extends WorldGenTree {
|
||||
public WorldGenBrazilNut(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = height - 3;
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(7, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenBrazilwood extends WorldGenTree {
|
||||
public WorldGenBrazilwood(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = 1.0f;
|
||||
float width = height * randBetween(0.15f, 0.2f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.8f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenButternut extends WorldGenTree {
|
||||
public WorldGenButternut(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height + 1;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 5.0f, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > 3) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 5.0f, 1, leaf, false);
|
||||
}
|
||||
if (rand.nextBoolean()) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 4.0f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCedar extends WorldGenTree {
|
||||
public WorldGenCedar(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 3;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.7f, 0.75f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), girth, 1, leaf, false);
|
||||
}
|
||||
|
||||
for (leafSpawn = height + 3; leafSpawn > bottom; leafSpawn += 1 + rand.nextInt(2)) {
|
||||
float cone = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
cone *= 2.0f - cone;
|
||||
|
||||
float radius = (0.7f + rand.nextFloat() * 0.3f) * width;
|
||||
radius *= cone;
|
||||
if (radius < 2.0f) {
|
||||
radius = 2.0f;
|
||||
}
|
||||
|
||||
float xOffset = (-width + rand.nextFloat() * 2.0f * width) / 2.0f;
|
||||
xOffset *= cone;
|
||||
if (xOffset > radius / 2.0f) {
|
||||
xOffset = radius / 2.0f;
|
||||
}
|
||||
|
||||
float yOffset = (-width + rand.nextFloat() * 2.0f * width) / 2.0f;
|
||||
yOffset *= cone;
|
||||
if (yOffset > radius / 2.0f) {
|
||||
yOffset = radius / 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(xOffset, leafSpawn--, yOffset), 0.7f * radius, 1, leaf, false);
|
||||
generateCylinder(new Vector(xOffset, leafSpawn--, yOffset), radius, 1, leaf, false);
|
||||
generateCylinder(new Vector(xOffset, leafSpawn--, yOffset), 0.5f * radius, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenClove extends WorldGenTree {
|
||||
public WorldGenClove(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = 2.0f;
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCoconut extends WorldGenTree {
|
||||
public WorldGenCoconut(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float width = height * randBetween(0.35f, 0.4f);
|
||||
if (width < 1.2) {
|
||||
width = 1.55f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCoffee extends WorldGenTree {
|
||||
public WorldGenCoffee(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = 1.0f;
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.3f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCommonAlder extends WorldGenTree {
|
||||
public WorldGenCommonAlder(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.4f, 0.45f);
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCommonAsh extends WorldGenTree {
|
||||
public WorldGenCommonAsh(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.35f, 0.45f);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCommonBeech extends WorldGenTree {
|
||||
public WorldGenCommonBeech(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.47f, 0.5f);
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
@@ -1,273 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenConifer {
|
||||
public static class WesternHemlock extends WorldGenTree {
|
||||
public WesternHemlock(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 6;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height / randBetween(2.0f, 2.5f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= width;
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(7, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Cypress extends WorldGenTree {
|
||||
public Cypress(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = 1.0f;
|
||||
float width = height * randBetween(0.15f, 0.2f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= width - 1.0f;
|
||||
++radius;
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Yew extends WorldGenTree {
|
||||
public Yew(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.7f, 0.75f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= 2.0f - radius;
|
||||
radius *= width;
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Cedar extends WorldGenTree {
|
||||
public Cedar(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 3;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.7f, 0.75f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), girth, 1, leaf, false);
|
||||
}
|
||||
for (leafSpawn = height + 3; leafSpawn > bottom; leafSpawn += 1 + rand.nextInt(2)) {
|
||||
float cone = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
float radius = (0.7f + rand.nextFloat() * 0.3f) * width;
|
||||
float xOffset = (-width + rand.nextFloat() * 2.0f * width) / 2.0f;
|
||||
float yOffset = (-width + rand.nextFloat() * 2.0f * width) / 2.0f;
|
||||
cone *= 2.0f - cone;
|
||||
xOffset *= cone;
|
||||
yOffset *= cone;
|
||||
radius *= cone;
|
||||
if (radius < 2.0f) {
|
||||
radius = 2.0f;
|
||||
}
|
||||
if (xOffset > radius / 2.0f) {
|
||||
xOffset = radius / 2.0f;
|
||||
}
|
||||
if (yOffset > radius / 2.0f) {
|
||||
yOffset = radius / 2.0f;
|
||||
}
|
||||
float f2 = xOffset;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, yOffset), 0.7f * radius, 1, leaf, false);
|
||||
float f3 = xOffset;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, yOffset), radius, 1, leaf, false);
|
||||
float f4 = xOffset;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, yOffset), 0.5f * radius, 1, leaf, false);
|
||||
}
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class LoblollyPine extends WorldGenTree {
|
||||
public LoblollyPine(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = height * randBetween(0.65f, 0.7f);
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.6f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class MonkeyPuzzle extends WorldGenTree {
|
||||
public MonkeyPuzzle(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.4f, 0.45f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.35f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.55f * width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), 0.75f * width, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), 0.9f * width, 1, leaf, false);
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), 1.0f * width, 1, leaf, false);
|
||||
float f6 = 0.0f;
|
||||
float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
generateCylinder(new Vector(f6, h6, 0.0f), 0.5f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(9, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCopperBeech extends WorldGenCommonBeech {
|
||||
public WorldGenCopperBeech(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCypress extends WorldGenTree {
|
||||
public WorldGenCypress(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = 1.0f;
|
||||
float width = height * randBetween(0.15f, 0.2f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = (1.0f - (leafSpawn - bottom) / coneHeight) * (width - 1.0f) + 1;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -24,11 +24,6 @@ public class WorldGenDefault extends WorldGenTree {
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockType getLeaf() {
|
||||
return new BlockTypeLeaf();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockType getWood() {
|
||||
return new BlockTypeLog(((ExtraTreeSpecies) treeGen.getGenome().getPrimary()).getLog());
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenDouglasFir extends WorldGenTree {
|
||||
public WorldGenDouglasFir(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float patchyBottom = height / 2;
|
||||
float bottom = randBetween(3, 4);
|
||||
float width = height * randBetween(0.35f, 0.4f);
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
|
||||
bushiness = 0.1f;
|
||||
while (leafSpawn > patchyBottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.9f, 1.1f) * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
bushiness = 0.5f;
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.7f, 1.0f) * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(7, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenElder extends WorldGenTree {
|
||||
public WorldGenElder(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 3.0f;
|
||||
float width = height * randBetween(0.55f, 0.6f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenElm extends WorldGenTree {
|
||||
public WorldGenElm(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.45f, 0.5f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -1,151 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import binnie.extratrees.block.ILogType;
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenEucalyptus {
|
||||
public static class SwampGum extends WorldGenTree {
|
||||
public SwampGum(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float weakerBottm = randBetween(0.5f, 0.6f) * height;
|
||||
float bottom = randBetween(0.4f, 0.5f) * height;
|
||||
float width = height * randBetween(0.15f, 0.2f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
bushiness = 0.3f;
|
||||
while (leafSpawn > weakerBottm) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), randBetween(0.9f, 1.0f) * width, 1, leaf, false);
|
||||
}
|
||||
bushiness = 0.6f;
|
||||
while (leafSpawn > bottom) {
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), randBetween(0.8f, 0.9f) * width, 1, leaf, false);
|
||||
}
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), 0.5f * width, 1, leaf, false);
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
float f6 = randBetween(-1, 1);
|
||||
float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
generateSphere(new Vector(f6, h6, randBetween(-1, 1)), randBetween(1, 2), leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(14, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class RoseGum extends WorldGenTree {
|
||||
public RoseGum(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int offset = (girth - 1) / 2;
|
||||
for (int x = 0; x < girth; ++x) {
|
||||
for (int y = 0; y < girth; ++y) {
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
addBlock(x - offset, i, y - offset, new BlockTypeLog(ILogType.ExtraTreeLog.Eucalyptus2), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = randBetween(0.4f, 0.5f) * height;
|
||||
float width = height * randBetween(0.05f, 0.1f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
bushiness = 0.5f;
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
bushiness = 0.1f;
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), randBetween(0.9f, 1.1f) * width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(9, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class RainbowGum extends WorldGenTree {
|
||||
public RainbowGum(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = randBetween(0.5f, 0.6f) * height;
|
||||
float width = height * randBetween(0.15f, 0.2f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(7, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenFir {
|
||||
public static class DouglasFir extends WorldGenTree {
|
||||
public DouglasFir(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float patchyBottom = height / 2;
|
||||
float bottom = randBetween(3, 4);
|
||||
float width = height * randBetween(0.35f, 0.4f);
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
bushiness = 0.1f;
|
||||
while (leafSpawn > patchyBottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), randBetween(0.9f, 1.1f) * width, 1, leaf, false);
|
||||
}
|
||||
bushiness = 0.5f;
|
||||
while (leafSpawn > bottom) {
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), randBetween(0.7f, 1.0f) * width, 1, leaf, false);
|
||||
}
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
float f6 = 0.0f;
|
||||
float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
generateCylinder(new Vector(f6, h6, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(7, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class SilverFir extends WorldGenTree {
|
||||
public SilverFir(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height / randBetween(2.5f, 3.0f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= width;
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(7, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class BalsamFir extends WorldGenTree {
|
||||
public BalsamFir(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = 1.0f;
|
||||
float width = height / randBetween(2.0f, 2.5f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= width;
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenFloweringCrabapple extends WorldGenTree {
|
||||
public WorldGenFloweringCrabapple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > 3) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 6);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenGingko extends WorldGenTree {
|
||||
public WorldGenGingko(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = 2.0f;
|
||||
float width = height * randBetween(0.55f, 0.6f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 2.0f, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom * 2.0f + 1.0f) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.9f, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.9f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenHawthorn extends WorldGenTree {
|
||||
public WorldGenHawthorn(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.4f, 0.45f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenHazel extends WorldGenTree {
|
||||
public WorldGenHazel(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 3.0f;
|
||||
float width = height * randBetween(0.45f, 0.5f);
|
||||
if (width < 2.5f) {
|
||||
width = 2.5f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.3f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 1.2f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -2,45 +2,34 @@ package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenHolly {
|
||||
public static class Holly extends WorldGenTree {
|
||||
public Holly(ITreeGenData tree) {
|
||||
super(tree);
|
||||
public class WorldGenHolly extends WorldGenTree {
|
||||
public WorldGenHolly(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 1.0f;
|
||||
float width = height * randBetween(0.4f, 0.45f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 1.0f;
|
||||
float width = height * randBetween(0.4f, 0.45f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width = 1.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 1.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenHornbeam extends WorldGenTree {
|
||||
public WorldGenHornbeam(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 2.0f;
|
||||
float width = height * randBetween(0.55f, 0.6f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenIroko extends WorldGenTree {
|
||||
public WorldGenIroko(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float width = height * randBetween(0.45f, 0.5f);
|
||||
if (width < 2.5f) {
|
||||
width = 2.5f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.25f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.7f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 2.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -1,341 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenJungle {
|
||||
public static class Brazilwood extends WorldGenTree {
|
||||
public Brazilwood(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = 1.0f;
|
||||
float width = height * randBetween(0.15f, 0.2f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 0.8f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Logwood extends WorldGenTree {
|
||||
public Logwood(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.7f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Rosewood extends WorldGenTree {
|
||||
public Rosewood(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.2f, 0.25f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.7f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Purpleheart extends WorldGenTree {
|
||||
public Purpleheart(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = height - 3;
|
||||
float width = height * randBetween(0.2f, 0.25f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.7f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(7, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class OsangeOsange extends WorldGenTree {
|
||||
public OsangeOsange(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.2f, 0.25f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
}
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class OldFustic extends WorldGenTree {
|
||||
public OldFustic(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 0.7f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Coffee extends WorldGenTree {
|
||||
public Coffee(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = 1.0f;
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.3f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class BrazilNut extends WorldGenTree {
|
||||
public BrazilNut(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = height - 3;
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(7, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Shrub15 extends WorldGenTree {
|
||||
public Shrub15(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = 1.0f;
|
||||
float width = height * randBetween(0.15f, 0.2f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 0.8f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,39 +2,28 @@ package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenLazy {
|
||||
public static class Tree extends WorldGenTree {
|
||||
public Tree(ITreeGenData tree) {
|
||||
super(tree);
|
||||
public class WorldGenLazy extends WorldGenTree {
|
||||
public WorldGenLazy(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float width = height * randBetween(0.35f, 0.4f);
|
||||
if (width < 1.2) {
|
||||
width = 1.55f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = height / 2 - 1;
|
||||
float width = height * randBetween(0.35f, 0.4f);
|
||||
if (width < 1.2) {
|
||||
width = 1.55f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenLoblollyPine extends WorldGenTree {
|
||||
public WorldGenLoblollyPine(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = height * randBetween(0.65f, 0.7f);
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.6f * width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenLocust extends WorldGenTree {
|
||||
public WorldGenLocust(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 2.0f;
|
||||
float width = height * randBetween(0.35f, 0.4f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom + 1.0f) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.3f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.7f, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenLogwood extends WorldGenTree {
|
||||
public WorldGenLogwood(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.7f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenMango extends WorldGenTree {
|
||||
public WorldGenMango(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float width = height * randBetween(0.7f, 0.75f);
|
||||
float bottom = 2.0f;
|
||||
if (width < 1.2) {
|
||||
width = 1.55f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.3f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.7f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.8f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.9f, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenMaple {
|
||||
public static class RedMaple extends WorldGenTree {
|
||||
public RedMaple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = randBetween(1, 2);
|
||||
float bottom2 = (height + bottom) / 2.0f;
|
||||
float width = 2.0f;
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom2) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
}
|
||||
width += 0.6;
|
||||
while (leafSpawn > bottom) {
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width, 1, leaf, false);
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
}
|
||||
if (leafSpawn == bottom) {
|
||||
float f6 = 0.0f;
|
||||
float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
generateCylinder(new Vector(f6, h6, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenMonkeyPuzzle extends WorldGenTree {
|
||||
public WorldGenMonkeyPuzzle(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float width = height * randBetween(0.4f, 0.45f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.35f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.55f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.75f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.9f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.0f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.5f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(9, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenOldFustic extends WorldGenTree {
|
||||
public WorldGenOldFustic(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.7f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenOlive extends WorldGenTree {
|
||||
public WorldGenOlive(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float width = height * randBetween(0.35f, 0.4f);
|
||||
if (width < 1.2) {
|
||||
width = 1.55f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenOrchardApple extends WorldGenTree {
|
||||
public WorldGenOrchardApple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > 2) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 2.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 6);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenOsangeOsange extends WorldGenTree {
|
||||
public WorldGenOsangeOsange(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.2f, 0.25f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenPalm {
|
||||
public static class Coconut extends WorldGenTree {
|
||||
public Coconut(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float width = height * randBetween(0.35f, 0.4f);
|
||||
if (width < 1.2) {
|
||||
width = 1.55f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0, leafSpawn, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenPear extends WorldGenTree {
|
||||
public WorldGenPear(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
+14
-9
@@ -2,24 +2,29 @@ package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenPrune extends WorldGenTree {
|
||||
public WorldGenPrune(ITreeGenData tree) {
|
||||
public class WorldGenPecan extends WorldGenTree {
|
||||
public WorldGenPecan(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
float width = height / randBetween(1.7f, 2.1f);
|
||||
int bottom = randBetween(2, 3);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 2.0f;
|
||||
float width = height * randBetween(0.6f, 0.65f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.6f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.9f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.6f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.6f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1,46 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenPoplar {
|
||||
public static class Aspen extends WorldGenTree {
|
||||
public Aspen(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(height / 2, height / 2 + 1) + 1;
|
||||
float width = height * randBetween(0.25f, 0.35f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.5f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), randBetween(0.9f, 1.1f) * width, 1, leaf, false);
|
||||
}
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenPrairieCrabapple extends WorldGenTree {
|
||||
public WorldGenPrairieCrabapple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > 3) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 2.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 4);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenPurpleheart extends WorldGenTree {
|
||||
public WorldGenPurpleheart(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float width = height * randBetween(0.2f, 0.25f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.7f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(7, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
+12
-8
@@ -2,29 +2,33 @@ package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenCitrus extends WorldGenTree {
|
||||
public WorldGenCitrus(ITreeGenData tree) {
|
||||
public class WorldGenRainbowGum extends WorldGenTree {
|
||||
public WorldGenRainbowGum(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
float width = height / randBetween(1.1f, 1.5f);
|
||||
int bottom = randBetween(1, 2);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = randBetween(0.5f, 0.6f) * height;
|
||||
float width = height * randBetween(0.15f, 0.2f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
minHeight = randBetween(2, 3);
|
||||
height = determineHeight(6, 1);
|
||||
height = determineHeight(7, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenRedMaple extends WorldGenTree {
|
||||
public WorldGenRedMaple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = randBetween(1, 2);
|
||||
float bottom2 = (height + bottom) / 2.0f;
|
||||
float width = 2.0f;
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom2) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
}
|
||||
|
||||
width += 0.6;
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
}
|
||||
|
||||
if (leafSpawn == bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import binnie.extratrees.block.ILogType;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenRoseGum extends WorldGenTree {
|
||||
public WorldGenRoseGum(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int offset = (girth - 1) / 2;
|
||||
for (int x = 0; x < girth; ++x) {
|
||||
for (int y = 0; y < girth; ++y) {
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
addBlock(x - offset, i, y - offset, new BlockTypeLog(ILogType.ExtraTreeLog.Eucalyptus2), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = randBetween(0.4f, 0.5f) * height;
|
||||
float width = height * randBetween(0.05f, 0.1f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
|
||||
bushiness = 0.5f;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
bushiness = 0.1f;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.9f, 1.1f) * width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(9, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenRosewood extends WorldGenTree {
|
||||
public WorldGenRosewood(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.2f, 0.25f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.7f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenRowan extends WorldGenTree {
|
||||
public WorldGenRowan(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.5f, 0.6f);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.5f * width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenSallow extends WorldGenTree {
|
||||
public WorldGenSallow(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 2.0f;
|
||||
float width = height * randBetween(0.6f, 0.65f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.6f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.9f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.6f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -1,41 +1,36 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenShrub {
|
||||
public static class Shrub extends WorldGenTree {
|
||||
public Shrub(ITree tree) {
|
||||
super(tree);
|
||||
public class WorldGenShrub extends WorldGenTree {
|
||||
public WorldGenShrub(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
float leafSpawn = height;
|
||||
float width = height * randBetween(0.7f, 0.9f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
float leafSpawn = height;
|
||||
float width = height * randBetween(0.7f, 0.9f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn >= 0.0f) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
minHeight = 1;
|
||||
height = determineHeight(1, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn >= 0.0f) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
minHeight = 1;
|
||||
height = determineHeight(1, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockType getLeaf() {
|
||||
return new BlockTypeLeaf(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenSilverFir extends WorldGenTree {
|
||||
public WorldGenSilverFir(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height / randBetween(2.5f, 3.0f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= width;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(7, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenSorbus {
|
||||
public static class Whitebeam extends WorldGenTree {
|
||||
public Whitebeam(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.5f, 0.6f);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.6f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Rowan extends WorldGenTree {
|
||||
public Rowan(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.5f, 0.6f);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.5f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ServiceTree extends WorldGenTree {
|
||||
public ServiceTree(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height + 1;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
while (leafSpawn > 2) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.4f + rand.nextFloat() * 0.7f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.9f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(8, 6);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,151 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenSpruce {
|
||||
public static class GiantSpruce extends WorldGenTree {
|
||||
public GiantSpruce(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 3;
|
||||
float bottom = randBetween(3, 4);
|
||||
float width = height / randBetween(2.5f, 3.0f);
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius = 0.15f + 0.85f * radius;
|
||||
radius *= width;
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(15, 4);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class AlpineSpruce extends WorldGenTree {
|
||||
public AlpineSpruce(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 5;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height / randBetween(2.0f, 2.5f);
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
leafSpawn -= 2.0f;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= radius;
|
||||
radius *= width;
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class WhiteSpruce extends WorldGenTree {
|
||||
public WhiteSpruce(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height / randBetween(2.2f, 2.5f);
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius = (float) Math.sqrt(radius);
|
||||
radius *= width;
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class BlackSpruce extends WorldGenTree {
|
||||
public BlackSpruce(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height / randBetween(2.2f, 2.5f);
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius = (float) Math.sqrt(radius);
|
||||
radius *= width;
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenSwampGum extends WorldGenTree {
|
||||
public WorldGenSwampGum(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float weakerBottm = randBetween(0.5f, 0.6f) * height;
|
||||
float bottom = randBetween(0.4f, 0.5f) * height;
|
||||
float width = height * randBetween(0.15f, 0.2f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
|
||||
bushiness = 0.3f;
|
||||
while (leafSpawn > weakerBottm) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.9f, 1.0f) * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
bushiness = 0.6f;
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.8f, 0.9f) * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.5f * width, 1, leaf, false);
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
generateSphere(new Vector(randBetween(-1, 1), leafSpawn--, randBetween(-1, 1)), randBetween(1, 2), leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(14, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenSweetCrabapple extends WorldGenTree {
|
||||
public WorldGenSweetCrabapple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > 3) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 1.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 4);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenSweetgum extends WorldGenTree {
|
||||
public WorldGenSweetgum(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.7f, 0.75f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= 2.0f - radius;
|
||||
radius *= width;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenSycamore extends WorldGenTree {
|
||||
public WorldGenSycamore(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.35f, 0.4f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.3f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.8f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -1,132 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenTilia {
|
||||
public static class Basswood extends WorldGenTree {
|
||||
public Basswood(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.4f, 0.5f);
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
|
||||
}
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class WhiteBasswood extends WorldGenTree {
|
||||
public WhiteBasswood(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.4f, 0.5f);
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
|
||||
}
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class CommonLime extends WorldGenTree {
|
||||
public CommonLime(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.45f, 0.55f);
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
|
||||
}
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(7, 4);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,9 +36,7 @@ public abstract class WorldGenTree extends WorldGenerator {
|
||||
air = new BlockTypeVoid();
|
||||
bushiness = 0.0f;
|
||||
spawnPods = tree.allowsFruitBlocks();
|
||||
if (tree instanceof ITreeGenData) {
|
||||
treeGen = tree;
|
||||
}
|
||||
treeGen = tree;
|
||||
}
|
||||
|
||||
protected int randBetween(int a, int b) {
|
||||
@@ -71,18 +69,13 @@ public abstract class WorldGenTree extends WorldGenerator {
|
||||
return base;
|
||||
}
|
||||
|
||||
protected int modifyByHeight(int val, int min, int max) {
|
||||
int determined = Math.round(val * treeGen.getHeightModifier());
|
||||
return (determined < min) ? min : ((determined > max) ? max : determined);
|
||||
}
|
||||
|
||||
protected int determineHeight(int required, int variation) {
|
||||
int determined = Math.round((required + rand.nextInt(variation)) * treeGen.getHeightModifier());
|
||||
return (determined < minHeight) ? minHeight : ((determined > maxHeight) ? maxHeight : determined);
|
||||
}
|
||||
|
||||
public BlockType getLeaf() {
|
||||
return new BlockTypeLeaf();
|
||||
return new BlockTypeLeaf(true);
|
||||
}
|
||||
|
||||
public BlockType getWood() {
|
||||
@@ -106,7 +99,7 @@ public abstract class WorldGenTree extends WorldGenerator {
|
||||
if (!force && !canGrow()) {
|
||||
return false;
|
||||
}
|
||||
int offset = (girth - 1) / 2;
|
||||
|
||||
for (int x2 = 0; x2 < girth; ++x2) {
|
||||
for (int y2 = 0; y2 < girth; ++y2) {
|
||||
addBlock(x2, 0, y2, new BlockTypeVoid(), true);
|
||||
@@ -116,10 +109,6 @@ public abstract class WorldGenTree extends WorldGenerator {
|
||||
return true;
|
||||
}
|
||||
|
||||
public Vector getStartVector() {
|
||||
return new Vector(startX, startY, startZ);
|
||||
}
|
||||
|
||||
protected void generateTreeTrunk(int height, int width) {
|
||||
generateTreeTrunk(height, width, 0.0f);
|
||||
}
|
||||
@@ -162,31 +151,6 @@ public abstract class WorldGenTree extends WorldGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
protected void generateSupportStems(int height, int girth, float chance, float maxHeight) {
|
||||
for (int offset = 1, x = -offset; x < girth + offset; ++x) {
|
||||
for (int z = -offset; z < girth + offset; ++z) {
|
||||
if (x != -offset || z != -offset) {
|
||||
if (x != girth + offset || z != girth + offset) {
|
||||
if (x != -offset || z != girth + offset) {
|
||||
if (x != girth + offset || z != -offset) {
|
||||
int stemHeight = rand.nextInt(Math.round(height * maxHeight));
|
||||
if (rand.nextFloat() < chance) {
|
||||
for (int i = 0; i < stemHeight; ++i) {
|
||||
addWood(x, i, z, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void clearBlock(int x, int y, int z) {
|
||||
air.setBlock(world, treeGen, startX + x, startY + y, startZ + z);
|
||||
}
|
||||
|
||||
protected void addBlock(int x, int y, int z, BlockType type, boolean doReplace) {
|
||||
if (doReplace || world.isAirBlock(startX + x, startY + y, startZ + z)) {
|
||||
type.setBlock(world, treeGen, startX + x, startY + y, startZ + z);
|
||||
@@ -197,24 +161,10 @@ public abstract class WorldGenTree extends WorldGenerator {
|
||||
addBlock(x, y, z, wood, doReplace);
|
||||
}
|
||||
|
||||
protected void addLeaf(int x, int y, int z, boolean doReplace) {
|
||||
addBlock(x, y, z, leaf, doReplace);
|
||||
}
|
||||
|
||||
protected void addVine(int x, int y, int z) {
|
||||
addBlock(x, y, z, vine, false);
|
||||
}
|
||||
|
||||
protected void generateCuboid(Vector start, Vector area, BlockType block, boolean doReplace) {
|
||||
for (int x = (int) start.x; x < (int) start.x + area.x; ++x) {
|
||||
for (int y = (int) start.y; y < (int) start.y + area.y; ++y) {
|
||||
for (int z = (int) start.z; z < (int) start.z + area.z; ++z) {
|
||||
addBlock(x, y, z, block, doReplace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void generateCylinder(Vector center2, float radius, int height, BlockType block, boolean doReplace) {
|
||||
float centerOffset = (girth - 1) / 2.0f;
|
||||
Vector center3 = new Vector(center2.x + centerOffset, center2.y, center2.z + centerOffset);
|
||||
@@ -233,29 +183,6 @@ public abstract class WorldGenTree extends WorldGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
protected void generateCircle(Vector center, float radius, int width, int height, BlockType block, boolean doReplace) {
|
||||
generateCircle(center, radius, width, height, block, 1.0f, doReplace);
|
||||
}
|
||||
|
||||
protected void generateCircle(Vector center2, float radius, int width, int height, BlockType block, float chance, boolean doReplace) {
|
||||
float centerOffset = (girth % 2 == 0) ? 0.5f : 0.0f;
|
||||
Vector center3 = new Vector(center2.x + centerOffset, center2.y, center2.z + centerOffset);
|
||||
Vector start = new Vector(center3.x - radius, center3.y, center3.z - radius);
|
||||
Vector area = new Vector(radius * 2.0f + 1.0f, height, radius * 2.0f + 1.0f);
|
||||
for (int x = (int) start.x; x < (int) start.x + area.x; ++x) {
|
||||
for (int y = (int) start.y; y < (int) start.y + area.y; ++y) {
|
||||
for (int z = (int) start.z; z < (int) start.z + area.z; ++z) {
|
||||
if (rand.nextFloat() <= chance) {
|
||||
double distance = Vector.distance(new Vector(x, y, z), new Vector(center3.x, y, center3.z));
|
||||
if (radius - width - 0.01 < distance && distance <= radius + 0.01) {
|
||||
addBlock(x, y, z, block, doReplace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void generateSphere(Vector center2, int radius, BlockType block, boolean doReplace) {
|
||||
float centerOffset = (girth - 1) / 2.0f;
|
||||
Vector center3 = new Vector(center2.x + centerOffset, center2.y, center2.z + centerOffset);
|
||||
|
||||
@@ -1,321 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenTree2 {
|
||||
public static class Olive extends WorldGenTree {
|
||||
public Olive(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.35f, 0.4f);
|
||||
if (width < 1.2) {
|
||||
width = 1.55f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Sweetgum extends WorldGenTree {
|
||||
public Sweetgum(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.7f, 0.75f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
|
||||
radius *= 2.0f - radius;
|
||||
radius *= width;
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Locust extends WorldGenTree {
|
||||
public Locust(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 2.0f;
|
||||
float width = height * randBetween(0.35f, 0.4f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom + 1.0f) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.3f, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.7f, 1, leaf, false);
|
||||
}
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width, 1, leaf, false);
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Pear extends WorldGenTree {
|
||||
public Pear(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Iroko extends WorldGenTree {
|
||||
public Iroko(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.45f, 0.5f);
|
||||
if (width < 2.5f) {
|
||||
width = 2.5f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width * 0.25f, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width * 0.5f, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width * 0.7f, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width, 1, leaf, false);
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), width - 2.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Gingko extends WorldGenTree {
|
||||
public Gingko(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 2;
|
||||
float bottom = 2.0f;
|
||||
float width = height * randBetween(0.55f, 0.6f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 2.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom * 2.0f + 1.0f) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width - 1.5f, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.9f, 1, leaf, false);
|
||||
}
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), width - 0.9f, 1, leaf, false);
|
||||
float f6 = 0.0f;
|
||||
float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
generateCylinder(new Vector(f6, h6, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
float f7 = 0.0f;
|
||||
float h7 = leafSpawn;
|
||||
leafSpawn = h7 - 1.0f;
|
||||
generateCylinder(new Vector(f7, h7, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Box extends WorldGenTree {
|
||||
public Box(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = 0.0f;
|
||||
float width = 1.5f;
|
||||
while (leafSpawn > bottom) {
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(3, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Clove extends WorldGenTree {
|
||||
public Clove(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = 2.0f;
|
||||
float width = height * randBetween(0.25f, 0.3f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
}
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,399 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenTree3 {
|
||||
public static class Hazel extends WorldGenTree {
|
||||
public Hazel(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 3.0f;
|
||||
float width = height * randBetween(0.45f, 0.5f);
|
||||
if (width < 2.5f) {
|
||||
width = 2.5f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.3f, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), width - 1.2f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Sycamore extends WorldGenTree {
|
||||
public Sycamore(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.35f, 0.4f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.3f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.8f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Hawthorn extends WorldGenTree {
|
||||
public Hawthorn(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(1, 2);
|
||||
float width = height * randBetween(0.4f, 0.45f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Pecan extends WorldGenTree {
|
||||
public Pecan(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 2.0f;
|
||||
float width = height * randBetween(0.6f, 0.65f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.6f * width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), 0.9f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
float f6 = 0.0f;
|
||||
float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
generateCylinder(new Vector(f6, h6, 0.0f), 0.6f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Elm extends WorldGenTree {
|
||||
public Elm(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.45f, 0.5f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Elder extends WorldGenTree {
|
||||
public Elder(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 3.0f;
|
||||
float width = height * randBetween(0.55f, 0.6f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.4f, 1, leaf, false);
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Hornbeam extends WorldGenTree {
|
||||
public Hornbeam(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 2.0f;
|
||||
float width = height * randBetween(0.55f, 0.6f);
|
||||
if (width < 1.5f) {
|
||||
width = 1.5f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Sallow extends WorldGenTree {
|
||||
public Sallow(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 2.0f;
|
||||
float width = height * randBetween(0.6f, 0.65f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), 0.6f * width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), 0.9f * width, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
float f6 = 0.0f;
|
||||
float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
generateCylinder(new Vector(f6, h6, 0.0f), 0.6f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(4, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class AcornOak extends WorldGenTree {
|
||||
public AcornOak(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 1;
|
||||
float bottom = 3.0f;
|
||||
float width = height * randBetween(0.45f, 0.5f);
|
||||
if (width < 2.0f) {
|
||||
width = 2.0f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width * 0.4f, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width * 0.7f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.2f, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), width - 0.5f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 2);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenTropical {
|
||||
public static class Mango extends WorldGenTree {
|
||||
public Mango(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height;
|
||||
float width = height * randBetween(0.7f, 0.75f);
|
||||
float bottom = 2.0f;
|
||||
if (width < 1.2) {
|
||||
width = 1.55f;
|
||||
}
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width * 0.3f, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width * 0.5f, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width * 0.7f, 1, leaf, false);
|
||||
float f4 = 0.0f;
|
||||
float h4 = leafSpawn;
|
||||
leafSpawn = h4 - 1.0f;
|
||||
generateCylinder(new Vector(f4, h4, 0.0f), width * 0.8f, 1, leaf, false);
|
||||
float f5 = 0.0f;
|
||||
float h5 = leafSpawn;
|
||||
leafSpawn = h5 - 1.0f;
|
||||
generateCylinder(new Vector(f5, h5, 0.0f), width * 0.9f, 1, leaf, false);
|
||||
while (leafSpawn > bottom) {
|
||||
float f6 = 0.0f;
|
||||
float h6 = leafSpawn;
|
||||
leafSpawn = h6 - 1.0f;
|
||||
generateCylinder(new Vector(f6, h6, 0.0f), width, 1, leaf, false);
|
||||
}
|
||||
float f7 = 0.0f;
|
||||
float h7 = leafSpawn;
|
||||
leafSpawn = h7 - 1.0f;
|
||||
generateCylinder(new Vector(f7, h7, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(5, 1);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
|
||||
public class WorldGenWalnut {
|
||||
public static class BlackWalnut extends WorldGenTree {
|
||||
public BlackWalnut(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height + 1;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.6f, 1, leaf, false);
|
||||
while (leafSpawn > randBetween(3, 4)) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.8f, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.7f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.8f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(9, 6);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Butternut extends WorldGenTree {
|
||||
public Butternut(ITree tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height + 1;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.5f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 5.0f, 1, leaf, false);
|
||||
while (leafSpawn > 3) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 5.0f, 1, leaf, false);
|
||||
}
|
||||
if (rand.nextBoolean()) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.0f, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(6, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenWesternHemlock extends WorldGenTree {
|
||||
public WorldGenWesternHemlock(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
float leafSpawn = height + 6;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height / randBetween(2.0f, 2.5f);
|
||||
if (width > 7.0f) {
|
||||
width = 7.0f;
|
||||
}
|
||||
|
||||
float coneHeight = leafSpawn - bottom;
|
||||
while (leafSpawn > bottom) {
|
||||
float radius = (1.0f - (leafSpawn - bottom) / coneHeight) * width;
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), radius, 1, leaf, false);
|
||||
}
|
||||
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
height = determineHeight(7, 3);
|
||||
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package binnie.extratrees.worldgen;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenWhitebeam extends WorldGenTree {
|
||||
public WorldGenWhitebeam(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
generateTreeTrunk(height, girth);
|
||||
int leafSpawn = height + 1;
|
||||
float bottom = randBetween(2, 3);
|
||||
float width = height * randBetween(0.5f, 0.6f);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.6f * width, 1, leaf, false);
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
|
||||
|
||||
while (leafSpawn > bottom) {
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
|
||||
}
|
||||
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 114 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user