diff --git a/.gitignore b/.gitignore index f3e7f97..3b8b5c2 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,8 @@ MinecraftForge* README.txt *.psd *.pdn +basesNodes* +basesNew* ##API /src/api diff --git a/bases.png b/bases.png deleted file mode 100644 index 7741e28..0000000 Binary files a/bases.png and /dev/null differ diff --git a/bases2.png b/bases2.png deleted file mode 100644 index 63bfa47..0000000 Binary files a/bases2.png and /dev/null differ diff --git a/build.gradle b/build.gradle index 962e568..3df86e0 100644 --- a/build.gradle +++ b/build.gradle @@ -42,6 +42,13 @@ dependencies { } +ext.configFile = file('build.properties') + +ext.config = parseConfig(configFile) + +version = "${config.version}-${config.build_number}" +archivesBaseName = config.mod_name + processResources { // this will ensure that this task is redone when the versions change. @@ -61,3 +68,19 @@ processResources exclude 'mcmod.info' } } + + +def parseConfig(File config) { + config.withReader { + def prop = new Properties() + prop.load(it) + return (new ConfigSlurper().parse(prop)) + } +} + +jar { + //rename the default output, for some better... sanity with scipts + archiveName = "${baseName} ${version}.${extension}" +} + +defaultTasks 'build', 'sort' //remove clean if you want faster builds, this will stop rare inconsistancies. diff --git a/build.properties b/build.properties new file mode 100644 index 0000000..0177409 --- /dev/null +++ b/build.properties @@ -0,0 +1,9 @@ +# +#Sat Sep 26 08:25:20 EDT 2015 +version=1.4.1710 +dir_output=../Build Output/TB/ +mc_version=1.7.10 +forge_version=10.13.4.1558 +dir_repo=./ +build_number=2 +mod_name=ThaumicBased diff --git a/src/main/java/tb/common/block/BlockAureliaPlant.java b/src/main/java/tb/common/block/BlockAureliaPlant.java index 980491d..10bd6c2 100644 --- a/src/main/java/tb/common/block/BlockAureliaPlant.java +++ b/src/main/java/tb/common/block/BlockAureliaPlant.java @@ -6,6 +6,8 @@ import tb.init.TBBlocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockGrass; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.init.Blocks; @@ -38,17 +40,29 @@ public class BlockAureliaPlant extends Block{ { return icons[meta]; } + + protected boolean canPlaceBlockOn(Block b) + { + return b != null && (b == Blocks.grass || b == Blocks.dirt || b instanceof BlockGrass || b instanceof BlockDirt); + } public void updateTick(World w, int x, int y, int z, Random rnd) { checkForMoonlight(w,x,y,z); if(w.getBlockMetadata(x, y, z) == 1) { - int rndX = x + rnd.nextInt(8) - rnd.nextInt(8); - int rndZ = z + rnd.nextInt(8) - rnd.nextInt(8); - int rndY = findSutableGround(w,rndX,y+2,rndZ)+1; - if(rndY > 2) - w.setBlock(rndX, rndY, rndZ, TBBlocks.aureliaPetal,0,3); + int rndX = x + rnd.nextInt(5) - rnd.nextInt(5); + int rndZ = z + rnd.nextInt(5) - rnd.nextInt(5); + //int rndY = findSutableGround(w,rndX,y+2,rndZ)+1; + //if(rndY > 2) + //w.setBlock(rndX, rndY, rndZ, TBBlocks.aureliaPetal,0,3); + + ForgeDirection dir = ForgeDirection.VALID_DIRECTIONS[2+w.rand.nextInt(4)]; + //int newX = x+dir.offsetX; + //int newZ = z+dir.offsetZ; + int newY = findSutableY(w,rndX,y,rndZ); + if(canPlaceBlockOn(w.getBlock(rndX, newY-1, rndZ)) && w.isAirBlock(rndX, newY, rndZ)) //fix for the Sweeds destroying blocks. Totally not copy-pasted code... + w.setBlock(rndX, newY, rndZ, TBBlocks.aureliaPetal, 0, 3); } } @@ -60,6 +74,16 @@ public class BlockAureliaPlant extends Block{ return y; } + public int findSutableY(World w, int x, int y, int z) + { + int bY = y; + y += 1; + while(!canPlaceBlockOn(w.getBlock(x, y, z)) && y > bY - 2) + --y; + + return y+1; + } + public int tickRate(World w) { return 10; diff --git a/src/main/java/tb/core/TBCore.java b/src/main/java/tb/core/TBCore.java index 0e4c3c0..614390c 100644 --- a/src/main/java/tb/core/TBCore.java +++ b/src/main/java/tb/core/TBCore.java @@ -37,7 +37,7 @@ import static tb.core.TBCore.*; public class TBCore { public static final String modid = "thaumicbases"; - public static final String version = "1.4.1710.0"; + public static final String version = "1.4.1710.2"; public static final String name = "Thaumic Bases"; public static final String serverProxy = "tb.network.proxy.TBServer"; public static final String clientProxy = "tb.network.proxy.TBClient"; @@ -96,6 +96,7 @@ public class TBCore { meta.description = "A Thaumcraft addon, that adds more earlygame and midgame content"; ArrayList authors = new ArrayList(); authors.add("Modbder"); + authors.add("KryptonCaptain"); meta.authorList = authors; } } diff --git a/src/main/java/tb/utils/TBConfig.java b/src/main/java/tb/utils/TBConfig.java index f6dfaf6..330a50e 100644 --- a/src/main/java/tb/utils/TBConfig.java +++ b/src/main/java/tb/utils/TBConfig.java @@ -103,7 +103,7 @@ public class TBConfig implements IDummyConfig{ */ enableEntityDecon = cfg.getBoolean("enableEntityDecon", "General", false, - "Enables the Entity Deconstructor. Warning: Buggy piece of shit that crashes if you go too far from it."); + "Enables the Entity Deconstructor. Warning: Buggy piece of shit that WILL crash you."); //pyrofluid minBlazePowderFromPyrofluid = cfg.getInt("minBlazePowderFromPyrofluid", "Pyrofluid", 5, 0, Integer.MAX_VALUE, "");