diff --git a/dependencies.gradle b/dependencies.gradle index c5293b3..719e18f 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -4,16 +4,16 @@ dependencies { api("com.github.GTNewHorizons:CropLoadCore:0.2.0:dev") api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - devOnlyNonPublishable("com.github.GTNewHorizons:GT5-Unofficial:5.09.50.49:dev") + devOnlyNonPublishable("com.github.GTNewHorizons:GT5-Unofficial:5.09.50.65:dev") compileOnly(deobf("https://media.forgecdn.net/files/2499/612/BiomesOPlenty-1.7.10-2.1.0.2308-universal.jar")) - compileOnly("com.github.GTNewHorizons:twilightforest:2.6.34:dev") { + compileOnly("com.github.GTNewHorizons:twilightforest:2.6.35:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.12.12-GTNH:dev") - compileOnly("com.github.GTNewHorizons:Natura:2.7.4:dev") { + compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.12.13-GTNH:dev") + compileOnly("com.github.GTNewHorizons:Natura:2.7.5:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.6.68:dev") { + compileOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.6.76:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:Galacticraft:3.2.5-GTNH:dev") { @@ -23,10 +23,10 @@ dependencies { // for testing //runtimeOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") - //runtimeOnly("com.github.GTNewHorizons:twilightforest:2.6.34:dev") - //runtimeOnly("com.github.GTNewHorizons:TinkersConstruct:1.12.12-GTNH:dev") - //runtimeOnly("com.github.GTNewHorizons:EnderIO:2.8.19:dev") - //runtimeOnly("com.github.GTNewHorizons:Natura:2.7.4:dev") - //runtimeOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.6.68:dev") + //runtimeOnly("com.github.GTNewHorizons:twilightforest:2.6.35:dev") + //runtimeOnly("com.github.GTNewHorizons:TinkersConstruct:1.12.13-GTNH:dev") + //runtimeOnly("com.github.GTNewHorizons:EnderIO:2.8.21:dev") + //runtimeOnly("com.github.GTNewHorizons:Natura:2.7.5:dev") + //runtimeOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.6.76:dev") //runtimeOnly("com.github.GTNewHorizons:Galacticraft:3.2.5-GTNH:dev") } diff --git a/settings.gradle b/settings.gradle index 3d3ba12..aa612ad 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.27' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.29' } diff --git a/src/main/java/com/github/bartimaeusnek/cropspp/BiomeHumidityBonus.java b/src/main/java/com/github/bartimaeusnek/cropspp/BiomeHumidityBonus.java index 21c4fac..951bb33 100644 --- a/src/main/java/com/github/bartimaeusnek/cropspp/BiomeHumidityBonus.java +++ b/src/main/java/com/github/bartimaeusnek/cropspp/BiomeHumidityBonus.java @@ -17,7 +17,6 @@ public static void apply() { Crops.instance.addBiomehumidityBonus(BiomeDictionary.Type.SAVANNA, -5); Crops.instance.addBiomehumidityBonus(BiomeDictionary.Type.CONIFEROUS, 7); Crops.instance.addBiomehumidityBonus(BiomeDictionary.Type.JUNGLE, 10); - Crops.instance.addBiomehumidityBonus(BiomeDictionary.Type.SPOOKY, 7); Crops.instance.addBiomehumidityBonus(BiomeDictionary.Type.DEAD, -5); Crops.instance.addBiomehumidityBonus(BiomeDictionary.Type.LUSH, 7); Crops.instance.addBiomehumidityBonus(BiomeDictionary.Type.NETHER, -10); diff --git a/src/main/java/com/github/bartimaeusnek/cropspp/items/ItemBppSpade.java b/src/main/java/com/github/bartimaeusnek/cropspp/items/ItemBppSpade.java index 6d485bd..8780195 100644 --- a/src/main/java/com/github/bartimaeusnek/cropspp/items/ItemBppSpade.java +++ b/src/main/java/com/github/bartimaeusnek/cropspp/items/ItemBppSpade.java @@ -13,11 +13,14 @@ import net.minecraft.item.ItemTool; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.UseHoeEvent; import com.github.bartimaeusnek.croploadcore.MyRandom; import com.github.bartimaeusnek.croploadcore.Operators; import com.google.common.collect.Sets; +import cpw.mods.fml.common.eventhandler.Event; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.core.IC2; @@ -107,18 +110,43 @@ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, @Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { - if (side != 0 && world.getBlock(x, y + 1, z).getMaterial() == Material.air - && (world.getBlock(x, y, z) == Blocks.grass || world.getBlock(x, y, z) == Blocks.dirt - || world.getBlock(x, y, z) == Blocks.mycelium)) { - world.setBlock(x, y, z, Blocks.farmland); + if (!player.canPlayerEdit(x, y, z, side, stack)) { + return false; + } + + var event = new UseHoeEvent(player, stack, world, x, y, z); + if (MinecraftForge.EVENT_BUS.post(event)) { + return false; + } + + if (event.getResult() == Event.Result.ALLOW) { return true; - } else if (side != 0 && world.getBlock(x, y + 1, z).getMaterial() == Material.air - && (world.getBlock(x, y, z) == Blocks.farmland)) { - world.setBlock(x, y, z, Blocks.dirt); - return true; - } else { - return false; + } + + if (side != 0 && world.getBlock(x, y + 1, z).getMaterial() == Material.air) { + if (world.getBlock(x, y, z) == Blocks.grass || world.getBlock(x, y, z) == Blocks.dirt + || world.getBlock(x, y, z) == Blocks.mycelium + || world.getBlock(x, y, z) == Blocks.farmland) { + var spadeBlock = Blocks.farmland; + world.playSoundEffect( + x + 0.5f, + y + 0.5f, + z + 0.5f, + spadeBlock.stepSound.getStepResourcePath(), + (spadeBlock.stepSound.getVolume() + 1f) / 2f, + spadeBlock.stepSound.getPitch() * 0.8f); + if (!world.isRemote) { + world.setBlock( + x, + y, + z, + (world.getBlock(x, y, z) == Blocks.farmland) ? Blocks.dirt : Blocks.farmland); } + return true; + } + } + + return false; } @Override