diff --git a/dependencies.gradle b/dependencies.gradle index d664dee..41bbabe 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.50.58:dev') {transitive=false} + compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.50.67:dev') {transitive=false} compile('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') compile('com.github.GTNewHorizons:CodeChickenLib:1.3.0:dev') diff --git a/gradle.properties b/gradle.properties index 663e3ab..bdc216b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -50,10 +50,10 @@ enableGenericInjection = false # Generate a class with a String field for the mod version named as defined below. # If generateGradleTokenClass is empty or not missing, no such class will be generated. # If gradleTokenVersion is empty or missing, the field will not be present in the class. -generateGradleTokenClass = +generateGradleTokenClass = tb.core.Tags # Name of the token containing the project's current version to generate/replace. -gradleTokenVersion = GRADLETOKEN_VERSION +gradleTokenVersion = VERSION # [DEPRECATED] Mod ID replacement token. gradleTokenModId = @@ -70,7 +70,7 @@ gradleTokenGroupName = # The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's # version in @Mod([...], version = VERSION, [...]). # Leave these properties empty to skip individual token replacements. -replaceGradleTokenInFile = TBCore.java +replaceGradleTokenInFile = # In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can # leave this property empty. diff --git a/src/main/java/tb/common/block/BlockTBPlant.java b/src/main/java/tb/common/block/BlockTBPlant.java index 143479c..1dd6c37 100644 --- a/src/main/java/tb/common/block/BlockTBPlant.java +++ b/src/main/java/tb/common/block/BlockTBPlant.java @@ -8,6 +8,7 @@ import net.minecraft.block.IGrowable; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; @@ -52,7 +53,7 @@ public Item getItem(World w, int x, int y, int z) { } protected boolean canPlaceBlockOn(Block b) { - return requiresFarmland ? b == Blocks.farmland : true; + return !requiresFarmland || b == Blocks.farmland; } public void updateTick(World w, int x, int y, int z, Random rnd) { @@ -143,6 +144,12 @@ public void func_149853_b(World w, Random r, int x, int y, int z) { 3); } + @Override + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) { + // Prevent placement of fully grown plants + worldIn.setBlockMetadataWithNotify(x, y, z, 0, 2); + } + @Override public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float pX, float pY, float pZ) { @@ -177,7 +184,7 @@ public int getRenderType() { @Override public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); + ArrayList ret = new ArrayList<>(); if (this.dropItem != null && metadata >= growthStages - 1) { // You can approximate the fortune bonus by diving https://oeis.org/A000169 with https://oeis.org/A000435 diff --git a/src/main/java/tb/core/TBCore.java b/src/main/java/tb/core/TBCore.java index 22407ce..42a626f 100644 --- a/src/main/java/tb/core/TBCore.java +++ b/src/main/java/tb/core/TBCore.java @@ -40,7 +40,7 @@ public class TBCore { public static final String modid = "thaumicbases"; - public static final String version = "GRADLETOKEN_VERSION"; + public static final String version = Tags.VERSION; 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"; @@ -104,7 +104,7 @@ public void setupModInfo(ModMetadata meta) { meta.name = name; meta.version = version; meta.description = "A Thaumcraft addon, that adds more earlygame and midgame content"; - ArrayList authors = new ArrayList(); + ArrayList authors = new ArrayList<>(); authors.add("Modbder"); authors.add("KryptonCaptain"); authors.add("bartimaeusnek");