Changed aurelia behaviour

Copy/pasted some code from sweed. Should no longer spew petals everywhere and overwrite things.
Reduced radius of petal spawning from 8 to 5. Petals will only spawn on dirt and grass.
This commit is contained in:
KryptonCaptain committed 2016-07-14 19:25:22 +10:00
1 parent 2c07d7f455
commit 96e85541ff
8 files changed
+66 -7

No files matched your search

+2
View File
@@ -67,6 +67,8 @@ MinecraftForge*
README.txt
*.psd
*.pdn
basesNodes*
basesNew*
##API
/src/api
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 950 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

+23
View File
@@ -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.
+9
View File
@@ -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
@@ -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;
+2 -1
View File
@@ -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<String> authors = new ArrayList<String>();
authors.add("Modbder");
authors.add("KryptonCaptain");
meta.authorList = authors;
}
}
+1 -1
View File
@@ -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, "");