mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-15 09:34:57 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e34b71c13e | ||
|
|
cc8bcf384a | ||
|
|
1f21952beb | ||
|
|
1ed4ced65f | ||
|
|
beb74e635d | ||
|
|
40c4fc5d1f | ||
|
|
645dba903d | ||
|
|
1ac4acdb47 | ||
|
|
74aa33e80c |
No files matched your search
+2
-2
@@ -40,7 +40,6 @@ targetCompatibility = 1.8
|
||||
minecraft {
|
||||
version = mcversion + "-" + forgeversion
|
||||
runDir = "run"
|
||||
useDepAts = true
|
||||
mappings = mcp_mappings
|
||||
|
||||
replace '@VERSION@', project.version
|
||||
@@ -66,7 +65,8 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
deobfCompile "mezz.jei:jei_${mcversion}:${jei_version}"
|
||||
deobfCompile "mezz.jei:jei_${mcversion}:${jei_version}:api"
|
||||
runtime "mezz.jei:jei_${mcversion}:${jei_version}"
|
||||
deobfCompile "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
mcversion=1.9.4
|
||||
forgeversion=12.17.0.1968
|
||||
mcversion=1.10
|
||||
forgeversion=12.18.0.1984-1.10.0
|
||||
mcp_mappings=snapshot_20160525
|
||||
|
||||
jei_version=3.6.4.+
|
||||
jei_version=3.7.0.+
|
||||
ic2_version=2.5.5-ex19
|
||||
|
||||
version_major=5
|
||||
version_minor=0
|
||||
version_patch=22
|
||||
version_minor=1
|
||||
version_patch=1
|
||||
@@ -49,16 +49,9 @@ import forestry.plugins.PluginManager;
|
||||
name = "Forestry",
|
||||
version = Constants.VERSION,
|
||||
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
|
||||
dependencies = "required-after:Forge@[12.17.0.1963,);"
|
||||
+ "after:Buildcraft|Core@[7.2,);"
|
||||
+ "after:BuildCraft|Energy@[7.2,);"
|
||||
+ "after:ExtrabiomesXL;"
|
||||
+ "after:BiomesOPlenty;"
|
||||
+ "after:IC2@[2.3.235,);"
|
||||
+ "after:Natura@[2.2.0,);"
|
||||
+ "after:HardcoreEnderExpansion;"
|
||||
+ "after:JEI@[3.6.4,);"
|
||||
+ "after:basemetals;")
|
||||
acceptedMinecraftVersions = "[1.10]",
|
||||
dependencies = "required-after:Forge@[12.18.0.1984,);"
|
||||
+ "after:JEI@[3.7.0,);")
|
||||
public class Forestry {
|
||||
|
||||
@Mod.Instance(Constants.MOD_ID)
|
||||
|
||||
@@ -84,7 +84,7 @@ public interface ITree extends IIndividual, ITreeGenData {
|
||||
* @return Integer denoting the size of the tree trunk.
|
||||
*/
|
||||
@Override
|
||||
int getGirth(World world, BlockPos pos);
|
||||
int getGirth();
|
||||
|
||||
/**
|
||||
* @return Growth conditions at the given position.
|
||||
|
||||
@@ -18,7 +18,7 @@ import forestry.api.arboriculture.ITreeGenome;
|
||||
|
||||
public interface ITreeGenData {
|
||||
|
||||
int getGirth(World world, BlockPos pos);
|
||||
int getGirth();
|
||||
|
||||
float getHeightModifier();
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public class AIAvoidPlayers extends EntityAIBase {
|
||||
}
|
||||
|
||||
path = pathNavigator.getPathToXYZ(randomTarget.xCoord, randomTarget.yCoord, randomTarget.zCoord);
|
||||
return path != null && path.isDestinationSame(randomTarget);
|
||||
return path != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -69,7 +69,6 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 {
|
||||
private static final Random random = new Random();
|
||||
|
||||
private int averageGroundLevel = -1;
|
||||
private boolean isInDesert = false;
|
||||
private IBlockState planks;
|
||||
private IBlockState slabs;
|
||||
private IBlockState logs;
|
||||
@@ -86,8 +85,6 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 {
|
||||
public VillageApiaristHouse(StructureVillagePieces.Start startPiece, int componentType, Random random, StructureBoundingBox boundingBox, EnumFacing facing) {
|
||||
super(startPiece, componentType, random, boundingBox, facing);
|
||||
|
||||
isInDesert = startPiece.inDesert;
|
||||
|
||||
createBuildingBlocks(random);
|
||||
}
|
||||
|
||||
@@ -280,7 +277,7 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 {
|
||||
private void buildGarden(World world, StructureBoundingBox box) {
|
||||
|
||||
Block ground = Blocks.DIRT;
|
||||
if (isInDesert) {
|
||||
if (field_189928_h == 1) { // desert
|
||||
ground = Blocks.SAND;
|
||||
}
|
||||
|
||||
@@ -293,7 +290,7 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 {
|
||||
|
||||
private void plantFlowerGarden(World world, StructureBoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) {
|
||||
|
||||
if (isInDesert) {
|
||||
if (field_189928_h == 1) { // desert
|
||||
setBlockState(world, Blocks.CACTUS.getDefaultState(), 4, 1, 7, box);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ public class Tree extends Individual implements ITree, IPlantable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGirth(World world, BlockPos pos) {
|
||||
public int getGirth() {
|
||||
return genome.getGirth();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import forestry.arboriculture.blocks.BlockSapling;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -61,6 +62,7 @@ public abstract class WorldGenArboriculture extends WorldGenBase {
|
||||
}
|
||||
|
||||
if (genPos != null) {
|
||||
clearSaplings(world, genPos);
|
||||
List<BlockPos> branchEnds = new ArrayList<>(generateTrunk(world, rand, wood, genPos));
|
||||
Collections.sort(branchEnds, TopDownBlockPosComparator.INSTANCE);
|
||||
generateLeaves(world, rand, leaf, branchEnds, genPos);
|
||||
@@ -96,6 +98,18 @@ public abstract class WorldGenArboriculture extends WorldGenBase {
|
||||
@Nullable
|
||||
public abstract BlockPos getValidGrowthPos(World world, BlockPos pos);
|
||||
|
||||
public void clearSaplings(World world, BlockPos genPos) {
|
||||
int treeGirth = tree.getGirth();
|
||||
for (int x = 0; x < treeGirth; x++) {
|
||||
for (int z = 0; z < treeGirth; z++) {
|
||||
BlockPos saplingPos = genPos.add(x, 0, z);
|
||||
if (world.getBlockState(saplingPos).getBlock() instanceof BlockSapling) {
|
||||
world.setBlockToAir(saplingPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasPods() {
|
||||
return tree.allowsFruitBlocks();
|
||||
}
|
||||
|
||||
@@ -47,12 +47,13 @@ public class WorldGenCherry extends WorldGenTree {
|
||||
|
||||
@Override
|
||||
protected void generateLeaves(World world, Random rand, TreeBlockTypeLeaf leaf, List<BlockPos> branchEnds, BlockPos startPos) {
|
||||
int leafSpawn = height + 1;
|
||||
int leafSpawn = height + 2;
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn--, 0), girth, girth, 1, WorldGenHelper.EnumReplaceMode.SOFT);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn, 0), girth, (float) 1 + girth, 1, WorldGenHelper.EnumReplaceMode.SOFT);
|
||||
WorldGenHelper.generateCylinderFromTreeStartPos(world, leaf, startPos.add(0, leafSpawn, 0), girth, 1 + girth, 1, WorldGenHelper.EnumReplaceMode.SOFT);
|
||||
|
||||
for (BlockPos branchEnd : branchEnds) {
|
||||
WorldGenHelper.generateCircle(world, rand, branchEnd, 4, 3, 2, leaf, 1.0f, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCircle(world, rand, branchEnd.up(), 3, 3, 1, leaf, 1.0f, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
WorldGenHelper.generateCircle(world, rand, branchEnd, 4, 3, 1, leaf, 1.0f, WorldGenHelper.EnumReplaceMode.AIR);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,11 +31,10 @@ public class WorldGenEbony extends WorldGenTree {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<BlockPos> generateTrunk(World world, Random rand, TreeBlockTypeLog wood, BlockPos startPos) {
|
||||
int offset = (girth - 1) / 2;
|
||||
int trunksGenerated = 0;
|
||||
|
||||
for (int x = -offset; x < -offset + girth; x++) {
|
||||
for (int z = -offset; z < -offset + girth; z++) {
|
||||
for (int x = 0; x < girth; x++) {
|
||||
for (int z = 0; z < girth; z++) {
|
||||
if (rand.nextFloat() < 0.6f) {
|
||||
for (int y = 0; y < height; y++) {
|
||||
WorldGenHelper.addBlock(world, startPos.add(x, y, z), wood, WorldGenHelper.EnumReplaceMode.ALL);
|
||||
@@ -68,8 +67,8 @@ public class WorldGenEbony extends WorldGenTree {
|
||||
h = height / 2 + rand.nextInt(height / 2);
|
||||
}
|
||||
|
||||
int x_off = -girth + rand.nextInt(2 * girth);
|
||||
int y_off = -girth + rand.nextInt(2 * girth);
|
||||
int x_off = rand.nextInt(girth);
|
||||
int y_off = rand.nextInt(girth);
|
||||
|
||||
BlockPos center = startPos.add(x_off, h, y_off);
|
||||
int radius = 1 + rand.nextInt(girth);
|
||||
|
||||
@@ -74,7 +74,7 @@ public abstract class WorldGenTree extends WorldGenArboriculture {
|
||||
public final void preGenerate(World world, Random rand, BlockPos startPos) {
|
||||
super.preGenerate(world, rand, startPos);
|
||||
height = determineHeight(world, rand, baseHeight, heightVariation);
|
||||
girth = tree.getGirth(world, startPos);
|
||||
girth = tree.getGirth();
|
||||
}
|
||||
|
||||
protected int modifyByHeight(World world, int val, int min, int max) {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class SlotWorking extends SlotForestry {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getHasStack() {
|
||||
public boolean canTakeStack(EntityPlayer stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -423,9 +423,15 @@ public abstract class ItemStackUtil {
|
||||
}
|
||||
|
||||
public static ItemStack copyWithRandomSize(ItemStack template, int max, Random rand) {
|
||||
int size = rand.nextInt(max);
|
||||
int size = max <= 0 ? 0 : rand.nextInt(max);
|
||||
ItemStack created = template.copy();
|
||||
created.stackSize = size <= 0 ? 1 : size > created.getMaxStackSize() ? created.getMaxStackSize() : size;
|
||||
if (size <= 0) {
|
||||
created.stackSize = 1;
|
||||
} else if (size > created.getMaxStackSize()) {
|
||||
created.stackSize = created.getMaxStackSize();
|
||||
} else {
|
||||
created.stackSize = size;
|
||||
}
|
||||
return created;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,19 +6,17 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.factory.gui.ContainerWorktable;
|
||||
import forestry.factory.inventory.InventoryCraftingForestry;
|
||||
import forestry.factory.recipes.MemorizedRecipe;
|
||||
|
||||
import mezz.jei.api.gui.IGuiIngredient;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferError;
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferHandler;
|
||||
import mezz.jei.gui.ingredients.IGuiIngredient;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
class WorktableRecipeTransferHandler implements IRecipeTransferHandler {
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user