From 8ed4fa8d7b85576b96fbc21203308ace933c21e8 Mon Sep 17 00:00:00 2001 From: temp1011 <34900092+temp1011@users.noreply.github.com> Date: Sat, 30 Dec 2017 00:09:41 +0000 Subject: [PATCH 1/6] make non hellish hives flammable --- .../java/forestry/apiculture/worldgen/HiveDescription.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/forestry/apiculture/worldgen/HiveDescription.java b/src/main/java/forestry/apiculture/worldgen/HiveDescription.java index df2bf1b37..a1143f4a2 100644 --- a/src/main/java/forestry/apiculture/worldgen/HiveDescription.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveDescription.java @@ -146,6 +146,10 @@ public enum HiveDescription implements IHiveDescription { @Override public void postGen(World world, Random rand, BlockPos pos) { + if(isGoodBiome(world.getBiome(pos))) + { + Blocks.FIRE.setFireInfo(world.getBlockState(pos).getBlock(), 5, 5); + } } From c107c75cbe193c8215a038c9c5e86c57705065c4 Mon Sep 17 00:00:00 2001 From: temp1011 <34900092+temp1011@users.noreply.github.com> Date: Sat, 30 Dec 2017 23:22:19 +0000 Subject: [PATCH 2/6] update config in apiculture --- .../java/forestry/apiculture/ModuleApiculture.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/forestry/apiculture/ModuleApiculture.java b/src/main/java/forestry/apiculture/ModuleApiculture.java index cf0ec60f3..61638091d 100644 --- a/src/main/java/forestry/apiculture/ModuleApiculture.java +++ b/src/main/java/forestry/apiculture/ModuleApiculture.java @@ -150,8 +150,11 @@ public class ModuleApiculture extends BlankForestryModule { private static HiveRegistry hiveRegistry; public static String beekeepingMode = "NORMAL"; - //TODO: Add to config - public static final int ticksPerBeeWorkCycle = 550; + + public static int ticksPerBeeWorkCycle = 550; + + public static boolean hivesDamageOnPeaceful = false; + public static int maxFlowersSpawnedPerHive = 20; @Nullable public static VillagerRegistry.VillagerProfession villagerApiarist; @@ -265,6 +268,10 @@ public class ModuleApiculture extends BlankForestryModule { String[] blacklist = config.getStringListLocalized("species", "blacklist", Constants.EMPTY_STRINGS); parseBeeBlacklist(blacklist); + + ticksPerBeeWorkCycle = config.getIntLocalized("beekeeping", "ticks.work", 550, 250, 850); + + hivesDamageOnPeaceful = config.getBooleanLocalized("beekeeping", "hivedamage.peaceful", false); config.save(); From 5f7f7fbed67c85190c78e27b2e43bd539964dfcc Mon Sep 17 00:00:00 2001 From: temp1011 <34900092+temp1011@users.noreply.github.com> Date: Sat, 30 Dec 2017 23:24:45 +0000 Subject: [PATCH 3/6] add damage option to hives based on config --- src/main/java/forestry/apiculture/tiles/TileHive.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/forestry/apiculture/tiles/TileHive.java b/src/main/java/forestry/apiculture/tiles/TileHive.java index 488f49fd4..e36136fc7 100644 --- a/src/main/java/forestry/apiculture/tiles/TileHive.java +++ b/src/main/java/forestry/apiculture/tiles/TileHive.java @@ -125,7 +125,7 @@ public class TileHive extends TileEntity implements ITickable, IHiveTile, IActiv if (tickHelper.updateOnInterval(angry ? 10 : 200)) { if (calmTime == 0) { if (canWork) { - if(world.getWorldInfo().getDifficulty() != EnumDifficulty.PEACEFUL) { + if(world.getWorldInfo().getDifficulty() != EnumDifficulty.PEACEFUL || ModuleApiculture.hivesDamageOnPeaceful) { AxisAlignedBB boundingBox = AlleleEffect.getBounding(getContainedBee().getGenome(), this); List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, boundingBox, beeTargetPredicate); if (!entities.isEmpty()) { From 7a0dde1140e7c71940dee5334bf011fc861598ea Mon Sep 17 00:00:00 2001 From: temp1011 <34900092+temp1011@users.noreply.github.com> Date: Tue, 2 Jan 2018 20:36:16 +0000 Subject: [PATCH 4/6] Woops --- src/main/java/forestry/apiculture/tiles/TileHive.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/forestry/apiculture/tiles/TileHive.java b/src/main/java/forestry/apiculture/tiles/TileHive.java index e36136fc7..7dba24428 100644 --- a/src/main/java/forestry/apiculture/tiles/TileHive.java +++ b/src/main/java/forestry/apiculture/tiles/TileHive.java @@ -65,6 +65,7 @@ import forestry.apiculture.blocks.BlockBeeHives; import forestry.apiculture.genetics.BeeDefinition; import forestry.apiculture.genetics.alleles.AlleleEffect; import forestry.apiculture.network.packets.PacketActiveUpdate; +import forestry.apiculture.ModuleApiculture; import forestry.core.config.Config; import forestry.core.inventory.InventoryAdapter; import forestry.core.tiles.IActivatable; From b5b4ff2de6c4dbe811e6c1d03d6d0b6179deb679 Mon Sep 17 00:00:00 2001 From: temp1011 <34900092+temp1011@users.noreply.github.com> Date: Fri, 5 Jan 2018 16:13:40 +0000 Subject: [PATCH 5/6] Fix hive flammability Hive placed in the overworld burned whereas hive placed in nether did not in my tests. Hopefully this works better. --- .../apiculture/blocks/BlockBeeHives.java | 29 ++++++++++++++++++- .../apiculture/worldgen/HiveDescription.java | 8 +---- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/main/java/forestry/apiculture/blocks/BlockBeeHives.java b/src/main/java/forestry/apiculture/blocks/BlockBeeHives.java index c6180388d..0a6e4be90 100755 --- a/src/main/java/forestry/apiculture/blocks/BlockBeeHives.java +++ b/src/main/java/forestry/apiculture/blocks/BlockBeeHives.java @@ -25,6 +25,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.EnumFacing; import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; @@ -39,6 +40,7 @@ import forestry.api.apiculture.IBee; import forestry.api.apiculture.IHiveDrop; import forestry.api.apiculture.IHiveTile; import forestry.api.apiculture.hives.IHiveRegistry.HiveType; +import forestry.api.core.BiomeHelper; import forestry.api.core.IItemModelRegister; import forestry.api.core.IModelManager; import forestry.api.core.Tabs; @@ -197,5 +199,30 @@ public class BlockBeeHives extends BlockContainer implements IItemModelRegister, public String getNameFromMeta(int meta) { return HiveType.VALUES[meta].getName(); } - + + @Override + public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face) + { + if(!BiomeHelper.isBiomeHellish(world.getBiome(pos))) + { + return 5; + } + return 0; + } + + @Override + public boolean isFlammable(IBlockAccess world, BlockPos pos, EnumFacing face) + { + return !BiomeHelper.isBiomeHellish(world.getBiome(pos)); + } + + @Override + public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face) + { + if(!BiomeHelper.isBiomeHellish(world.getBiome(pos))) + { + return 5; + } + return 0; + } } diff --git a/src/main/java/forestry/apiculture/worldgen/HiveDescription.java b/src/main/java/forestry/apiculture/worldgen/HiveDescription.java index a1143f4a2..4c6b79d17 100644 --- a/src/main/java/forestry/apiculture/worldgen/HiveDescription.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveDescription.java @@ -145,13 +145,7 @@ public enum HiveDescription implements IHiveDescription { } @Override - public void postGen(World world, Random rand, BlockPos pos) { - if(isGoodBiome(world.getBiome(pos))) - { - Blocks.FIRE.setFireInfo(world.getBlockState(pos).getBlock(), 5, 5); - } - - } + public void postGen(World world, Random rand, BlockPos pos) {} protected static void postGenFlowers(World world, Random rand, BlockPos hivePos, List flowerStates) { int plantedCount = 0; From d9ade6dae0f0910e0d78190562161a1e411eaaef Mon Sep 17 00:00:00 2001 From: temp1011 <34900092+temp1011@users.noreply.github.com> Date: Sat, 6 Jan 2018 14:34:20 +0000 Subject: [PATCH 6/6] No biome check --- .../forestry/apiculture/blocks/BlockBeeHives.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/main/java/forestry/apiculture/blocks/BlockBeeHives.java b/src/main/java/forestry/apiculture/blocks/BlockBeeHives.java index 0a6e4be90..e10fd3cec 100755 --- a/src/main/java/forestry/apiculture/blocks/BlockBeeHives.java +++ b/src/main/java/forestry/apiculture/blocks/BlockBeeHives.java @@ -203,26 +203,18 @@ public class BlockBeeHives extends BlockContainer implements IItemModelRegister, @Override public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face) { - if(!BiomeHelper.isBiomeHellish(world.getBiome(pos))) - { - return 5; - } - return 0; + return 5; } @Override public boolean isFlammable(IBlockAccess world, BlockPos pos, EnumFacing face) { - return !BiomeHelper.isBiomeHellish(world.getBiome(pos)); + return true; } @Override public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face) { - if(!BiomeHelper.isBiomeHellish(world.getBiome(pos))) - { - return 5; - } - return 0; + return 5; } }