Merge branch 'mc-1.12' into self-breeding

This commit is contained in:
Nedelosk authored and GitHub committed 2018-03-14 17:06:16 +01:00
commit 2b8d905e0e
22 files changed
+394 -65

No files matched your search

@@ -22,6 +22,8 @@ import java.util.Random;
import java.util.Set;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.BlockFlowerPot;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.passive.EntityVillager;
@@ -153,7 +155,7 @@ public class ModuleApiculture extends BlankForestryModule {
public static String beekeepingMode = "NORMAL";
public static int ticksPerBeeWorkCycle = 550;
public static boolean hivesDamageOnPeaceful = false;
public static boolean doSelfPollination = true;
@@ -235,17 +237,17 @@ public class ModuleApiculture extends BlankForestryModule {
// Commands
ModuleCore.rootCommand.addChildCommand(new CommandBee());
if(ModuleManager.getInstance().isModuleEnabled(Constants.MOD_ID, ForestryModuleUids.SORTING)){
if (ModuleManager.getInstance().isModuleEnabled(Constants.MOD_ID, ForestryModuleUids.SORTING)) {
ApicultureFilterRuleType.init();
ApicultureFilterRule.init();
}
}
// TODO: Buildcraft for 1.9
// @Override
// public void registerTriggers() {
// ApicultureTriggers.initialize();
// }
// @Override
// public void registerTriggers() {
// ApicultureTriggers.initialize();
// }
@Override
public void doInit() {
@@ -276,9 +278,9 @@ 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);
doSelfPollination = config.getBooleanLocalized("beekeeping", "self.pollination", false);
@@ -410,6 +412,28 @@ public class ModuleApiculture extends BlankForestryModule {
flowerRegistry.registerPlantableFlower(Blocks.BROWN_MUSHROOM.getDefaultState(), 1.0, FlowerManager.FlowerTypeMushrooms);
flowerRegistry.registerPlantableFlower(Blocks.RED_MUSHROOM.getDefaultState(), 1.0, FlowerManager.FlowerTypeMushrooms);
flowerRegistry.registerPlantableFlower(Blocks.CACTUS.getDefaultState(), 1.0, FlowerManager.FlowerTypeCacti);
//Flower Pots
IBlockState flowerPot = Blocks.FLOWER_POT.getBlockState().getBaseState();
PropertyEnum<BlockFlowerPot.EnumFlowerType> CONTENTS = BlockFlowerPot.CONTENTS;
String[] standardTypes = new String[]{FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow};
for (BlockFlowerPot.EnumFlowerType flowerType : BlockFlowerPot.EnumFlowerType.values()) {
if (flowerType == BlockFlowerPot.EnumFlowerType.EMPTY ||
flowerType.getName().contains("sapling") ||
flowerType == BlockFlowerPot.EnumFlowerType.DEAD_BUSH ||
flowerType == BlockFlowerPot.EnumFlowerType.FERN) {
continue;
} else if (flowerType == BlockFlowerPot.EnumFlowerType.MUSHROOM_RED ||
flowerType == BlockFlowerPot.EnumFlowerType.MUSHROOM_BROWN) {
flowerRegistry.registerAcceptableFlower(flowerPot.withProperty(CONTENTS, flowerType), FlowerManager.FlowerTypeMushrooms);
} else if (flowerType == BlockFlowerPot.EnumFlowerType.CACTUS) {
flowerRegistry.registerAcceptableFlower(flowerPot.withProperty(CONTENTS, flowerType), FlowerManager.FlowerTypeCacti);
} else {
flowerRegistry.registerAcceptableFlower(flowerPot.withProperty(CONTENTS, flowerType), standardTypes);
}
}
}
@Override
@@ -514,9 +538,9 @@ public class ModuleApiculture extends BlankForestryModule {
"C",
'B', new ItemStack(blocks.apiary),
'C', Items.MINECART);
for(int blockCount = 0;blockCount < blocks.beeCombs.length;blockCount++){
for (int blockCount = 0; blockCount < blocks.beeCombs.length; blockCount++) {
BlockHoneyComb block = blocks.beeCombs[blockCount];
for(int blockMeta = 0;blockMeta < EnumHoneyComb.VALUES.length - blockCount * 16;blockMeta++){
for (int blockMeta = 0; blockMeta < EnumHoneyComb.VALUES.length - blockCount * 16; blockMeta++) {
int itemMeta = blockMeta + blockCount * 16;
RecipeUtil.addRecipe("comb." + itemMeta, new ItemStack(block, 1, blockMeta),
"###",
@@ -918,8 +942,11 @@ public class ModuleApiculture extends BlankForestryModule {
}
@Override
public void populateChunk(IChunkGenerator chunkGenerator, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) {
if(!world.provider.getDimensionType().equals(DimensionType.THE_END)) return;
public void populateChunk(IChunkGenerator chunkGenerator, World world, Random rand, int chunkX, int chunkZ,
boolean hasVillageGenerated) {
if (!world.provider.getDimensionType().equals(DimensionType.THE_END)) {
return;
}
if (Config.getBeehivesAmount() > 0.0) {
HiveDecorator.decorateHives(world, rand, chunkX, chunkZ);
}
@@ -957,7 +984,7 @@ public class ModuleApiculture extends BlankForestryModule {
return true;
} else if (message.key.equals("blacklist-hives-dimension")) {
int[] dims = message.getNBTValue().getIntArray("dimensions");
for(int dim : dims) {
for (int dim : dims) {
HiveConfig.addBlacklistedDim(dim);
}
return true;