Compare commits

...
11 Commits
29 changed files with 408 additions and 415 deletions

No files matched your search

+2 -5
View File
@@ -157,16 +157,14 @@ task makeChangelog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
toRef = "HEAD"
templateContent = """
Alpha version, still buggy. Do not create a world you care about with this version, it can and will break things severely.<br/>
Please help the project by trying it out and <a href="https://github.com/ForestryMC/ForestryMC/issues">reporting issues here.</a>
Please help the project by trying it out and <a href="https://github.com/ForestryMC/ForestryMC/issues">reporting issues here.</a><br/>
{{#tags}}
<h3>{{name}}</h3>
<ul>
{{#commits}}
<li>{{{message}}} <small>- {{authorName}}</small></li>
<li>{{{message}}} - {{authorName}}</li>
{{/commits}}
</ul>
<br/>
<hr/>
{{/tags}}
"""
}
@@ -178,7 +176,6 @@ curseforge {
changelog = file('changelog.html')
changelogType = 'html'
releaseType = 'alpha'
addGameVersion '1.9' // works on 1.9 in addition to 1.9.4
}
}
+1
View File
@@ -4,3 +4,4 @@ GenuineSounds;[email protected];2015-02-26
airbreather;[email protected];2015-04-10
ganymedes01;[email protected];2015-05-27
infinityraider;theoneandonlyraider@gmail;com;2015-10-03
girafistudios;[email protected];2016-06-02
+1 -1
View File
@@ -6,4 +6,4 @@ jei_version=3.4.0.+
version_major=5
version_minor=0
version_patch=1
version_patch=2
+1 -1
View File
@@ -46,7 +46,7 @@ import forestry.plugins.PluginManager;
*/
@Mod(
modid = Constants.MOD_ID,
name = Constants.MOD_ID,
name = "Forestry",
version = Constants.VERSION,
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
dependencies = "required-after:Forge@[12.17.0.1932,);"
@@ -8,8 +8,8 @@ import net.minecraft.block.BlockPlanks;
public enum EnumVanillaWoodType implements IWoodType {
OAK(BlockPlanks.EnumType.OAK),
BIRCH(BlockPlanks.EnumType.BIRCH),
SPRUCE(BlockPlanks.EnumType.SPRUCE),
BIRCH(BlockPlanks.EnumType.BIRCH),
JUNGLE(BlockPlanks.EnumType.JUNGLE),
ACACIA(BlockPlanks.EnumType.ACACIA),
DARK_OAK(BlockPlanks.EnumType.DARK_OAK);
@@ -5,6 +5,7 @@
******************************************************************************/
package forestry.api.genetics;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -13,5 +14,5 @@ public interface IFlowerAcceptableRule {
* Checks if the flower at this position is accepted by this rule.
* flowerType is passed in case this rule is registered for multiple flower types.
*/
boolean isAcceptableFlower(String flowerType, World world, BlockPos pos);
boolean isAcceptableFlower(IBlockState blockState, World world, BlockPos pos, String flowerType);
}
@@ -9,6 +9,7 @@ import javax.annotation.Nonnull;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -29,14 +30,14 @@ public interface IFlowerRegistry {
void registerGrowthRule(IFlowerGrowthRule rule, String... flowerTypes);
/**
* Registers an accepted flower with any meta value.
* Registers an accepted flower with any state.
*/
void registerAcceptableFlower(Block flowerBlock, String... flowerTypes);
void registerAcceptableFlower(Block block, String... flowerTypes);
/**
* Registers an accepted flower with a specific meta value.
* Registers an accepted flower with a particular state.
*/
void registerAcceptableFlower(Block flowerBlock, int flowerMeta, String... flowerTypes);
void registerAcceptableFlower(IBlockState blockState, String... flowerTypes);
/**
* Registers custom logic for accepted flowers.
@@ -53,7 +54,7 @@ public interface IFlowerRegistry {
* @param weight Weight for the Flower (Vanilla = 1.0, Modded flowers < 1.0)
* @param flowerTypes See {@link forestry.api.apiculture.FlowerManager}.FlowerTypeXXX
*/
void registerPlantableFlower(Block flowerBlock, int flowerMeta, double weight, String... flowerTypes);
void registerPlantableFlower(IBlockState blockState, double weight, String... flowerTypes);
/**
* Calls the appropriate IFlowerGrowthRule to grow a flower at a specified position.
@@ -129,6 +129,7 @@ public class HasFlowersCache implements INbtWritable, INbtReadable, IStreamable
BlockPos flowerPos = new BlockPos(flowersList[i], flowersList[i + 1], flowersList[i + 2]);
flowerCoords.add(flowerPos);
}
needsSync = true;
}
}
@@ -21,7 +21,9 @@ import java.util.Objects;
import java.util.Random;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.BlockRedFlower;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.init.Blocks;
@@ -37,7 +39,6 @@ import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.SidedProxy;
@@ -47,7 +48,6 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.registry.VillagerRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import forestry.Forestry;
import forestry.api.apiculture.BeeManager;
@@ -71,7 +71,6 @@ import forestry.apiculture.commands.CommandBee;
import forestry.apiculture.entities.EntityMinecartApiary;
import forestry.apiculture.entities.EntityMinecartBeehouse;
import forestry.apiculture.entities.ParticleBee;
import forestry.apiculture.flowers.Flower;
import forestry.apiculture.flowers.FlowerRegistry;
import forestry.apiculture.genetics.BeeBranchDefinition;
import forestry.apiculture.genetics.BeeDefinition;
@@ -114,11 +113,8 @@ import forestry.core.network.IPacketRegistry;
import forestry.core.recipes.RecipeUtil;
import forestry.core.utils.EntityUtil;
import forestry.core.utils.IMCUtil;
import forestry.core.utils.ItemStackUtil;
import forestry.core.utils.Log;
import forestry.core.utils.OreDictUtil;
import forestry.core.utils.Stack;
import forestry.core.utils.Translator;
import forestry.core.utils.VillagerTradeLists;
import forestry.food.PluginFood;
import forestry.food.items.ItemRegistryFood;
@@ -208,19 +204,17 @@ public class PluginApiculture extends BlankForestryPlugin {
@Override
public void doInit() {
File configFile = new File(Forestry.instance.getConfigFolder(), CONFIG_CATEGORY + ".cfg");
if (!configFile.exists()) {
setDefaultsForConfig();
}
LocalizedConfiguration config = new LocalizedConfiguration(configFile, "2.0.0");
LocalizedConfiguration config = new LocalizedConfiguration(configFile, "3.0.0");
if (!Objects.equals(config.getLoadedConfigVersion(), config.getDefinedConfigVersion())) {
boolean deleted = configFile.delete();
if (deleted) {
config = new LocalizedConfiguration(configFile, "2.0.0");
setDefaultsForConfig();
config = new LocalizedConfiguration(configFile, "3.0.0");
}
}
initFlowerRegistry();
List<IBeekeepingMode> beekeepingModes = BeeManager.beeRoot.getBeekeepingModes();
String[] validBeekeepingModeNames = new String[beekeepingModes.size()];
for (int i = 0; i < beekeepingModes.size(); i++) {
@@ -232,34 +226,6 @@ public class PluginApiculture extends BlankForestryPlugin {
secondPrincessChance = config.getFloatLocalized("beekeeping", "second.princess", secondPrincessChance, 0.0f, 100.0f);
String acceptedFlowerMessage = Translator.translateToLocal("for.config.beekeeping.flowers.accepted.comment");
String plantableFlowerMessage = Translator.translateToLocal("for.config.beekeeping.flowers.plantable.comment");
FlowerRegistry flowerRegistry = (FlowerRegistry) FlowerManager.flowerRegistry;
for (String flowerType : flowerRegistry.getFlowerTypes()) {
String[] defaultAccepted = defaultAcceptedFlowers.get(flowerType);
if (defaultAccepted == null) {
defaultAccepted = Constants.EMPTY_STRINGS;
}
Property property = config.get("beekeeping.flowers." + flowerType, "accepted", defaultAccepted);
property.setComment(acceptedFlowerMessage);
parseAcceptedFlowers(property.getStringList(), flowerType);
String[] defaultPlantable = defaultPlantableFlowers.get(flowerType);
if (defaultPlantable == null) {
defaultPlantable = Constants.EMPTY_STRINGS;
}
property = config.get("beekeeping.flowers." + flowerType, "plantable", defaultPlantable);
property.setComment(plantableFlowerMessage);
parsePlantableFlowers(property, flowerType);
Set<Flower> acceptableFlowers = flowerRegistry.getAcceptableFlowers(flowerType);
if (acceptableFlowers == null || acceptableFlowers.isEmpty()) {
Log.error("Flower type '" + flowerType + "' has no valid flowers set in apiculture.cfg. Add valid flowers or delete the config to set it to default.");
}
}
String[] blacklist = config.getStringListLocalized("species", "blacklist", Constants.EMPTY_STRINGS);
parseBeeBlacklist(blacklist);
@@ -346,8 +312,7 @@ public class PluginApiculture extends BlankForestryPlugin {
registerDungeonLoot();
}
private void setDefaultsForConfig() {
private void initFlowerRegistry() {
FlowerRegistry flowerRegistry = (FlowerRegistry) FlowerManager.flowerRegistry;
flowerRegistry.registerAcceptableFlowerRule(new EndFlowerAcceptableRule(), FlowerManager.FlowerTypeEnd);
@@ -361,53 +326,19 @@ public class PluginApiculture extends BlankForestryPlugin {
flowerRegistry.registerAcceptableFlower(Blocks.MELON_STEM, FlowerManager.FlowerTypeGourd);
flowerRegistry.registerAcceptableFlower(Blocks.NETHER_WART, FlowerManager.FlowerTypeNether);
flowerRegistry.registerAcceptableFlower(Blocks.CACTUS, FlowerManager.FlowerTypeCacti);
flowerRegistry.registerAcceptableFlower(Blocks.DOUBLE_PLANT, 0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
flowerRegistry.registerAcceptableFlower(Blocks.DOUBLE_PLANT, 1, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
flowerRegistry.registerAcceptableFlower(Blocks.DOUBLE_PLANT, 4, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
flowerRegistry.registerAcceptableFlower(Blocks.DOUBLE_PLANT, 5, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
// Register plantable plants
for (int meta = 0; meta <= 8; meta++) {
flowerRegistry.registerPlantableFlower(Blocks.RED_FLOWER, meta, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
BlockRedFlower blockRedFlower = (BlockRedFlower) Blocks.RED_FLOWER;
IBlockState defaultState = blockRedFlower.getDefaultState();
for (BlockFlower.EnumFlowerType flowerType : BlockFlower.EnumFlowerType.getTypes(BlockFlower.EnumFlowerColor.RED)) {
IBlockState blockState = defaultState.withProperty(blockRedFlower.getTypeProperty(), flowerType);
flowerRegistry.registerPlantableFlower(blockState, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
}
flowerRegistry.registerPlantableFlower(Blocks.YELLOW_FLOWER, 0, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
flowerRegistry.registerPlantableFlower(Blocks.BROWN_MUSHROOM, 0, 1.0, FlowerManager.FlowerTypeMushrooms);
flowerRegistry.registerPlantableFlower(Blocks.RED_MUSHROOM, 0, 1.0, FlowerManager.FlowerTypeMushrooms);
flowerRegistry.registerPlantableFlower(Blocks.CACTUS, 0, 1.0, FlowerManager.FlowerTypeCacti);
for (String flowerType : flowerRegistry.getFlowerTypes()) {
Set<Flower> flowers = flowerRegistry.getAcceptableFlowers(flowerType);
List<String> acceptedFlowerNames = new ArrayList<>();
List<String> plantableFlowerNames = new ArrayList<>();
if (flowers != null) {
for (Flower flower : flowers) {
String name = ItemStackUtil.getBlockNameFromRegistryAsSting(flower.getBlock());
if (name == null) {
Log.warning("Could not find name for flower: " + flower + " with type: " + flowerType);
continue;
}
int meta = flower.getMeta();
if (flower.getMeta() != OreDictionary.WILDCARD_VALUE) {
name = name + ':' + meta;
}
if (flower.isPlantable()) {
plantableFlowerNames.add(name);
} else {
acceptedFlowerNames.add(name);
}
}
}
String[] acceptedFlowerNamesArray = acceptedFlowerNames.toArray(new String[acceptedFlowerNames.size()]);
defaultAcceptedFlowers.put(flowerType, acceptedFlowerNamesArray);
String[] plantableFlowerNamesArray = plantableFlowerNames.toArray(new String[plantableFlowerNames.size()]);
defaultPlantableFlowers.put(flowerType, plantableFlowerNamesArray);
}
flowerRegistry.registerPlantableFlower(Blocks.YELLOW_FLOWER.getDefaultState(), 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
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);
}
@Override
@@ -866,36 +797,6 @@ public class PluginApiculture extends BlankForestryPlugin {
}
}
private static void parseAcceptedFlowers(String[] acceptedFlowers, String flowerType) {
List<Stack> acceptedFlowerItemStacks = Stack.parseStackStrings(acceptedFlowers, OreDictionary.WILDCARD_VALUE);
for (Stack acceptedFlower : acceptedFlowerItemStacks) {
Block acceptedFlowerBlock = acceptedFlower.getBlock();
int meta = acceptedFlower.getMeta();
if (acceptedFlowerBlock != null) {
FlowerManager.flowerRegistry.registerAcceptableFlower(acceptedFlowerBlock, meta, flowerType);
} else {
Log.warning("No block found for '" + acceptedFlower + "' in apiculture config for '" + flowerType + "'.");
}
}
}
private static void parsePlantableFlowers(Property property, String flowerType) {
for (String string : property.getStringList()) {
Stack plantableFlower = Stack.parseStackString(string, OreDictionary.WILDCARD_VALUE);
if (plantableFlower == null) {
continue;
}
Block plantableFlowerBlock = plantableFlower.getBlock();
int meta = plantableFlower.getMeta();
if (plantableFlowerBlock != null) {
FlowerManager.flowerRegistry.registerPlantableFlower(plantableFlowerBlock, meta, 1.0, flowerType);
} else {
Log.warning("No block found for '" + string + "' in config '" + property.getName() + "'.");
}
}
}
@Override
public ISaveEventHandler getSaveEventHandler() {
return new SaveEventHandlerApiculture();
@@ -946,7 +847,7 @@ public class PluginApiculture extends BlankForestryPlugin {
private static class EndFlowerAcceptableRule implements IFlowerAcceptableRule {
@Override
public boolean isAcceptableFlower(String flowerType, World world, BlockPos pos) {
public boolean isAcceptableFlower(IBlockState blockState, World world, BlockPos pos, String flowerType) {
Biome biomeGenForCoords = world.getBiome(pos);
return BiomeDictionary.isBiomeOfType(biomeGenForCoords, BiomeDictionary.Type.END);
}
@@ -12,19 +12,15 @@ package forestry.apiculture.flowers;
import com.google.common.base.Objects;
import net.minecraft.block.Block;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraft.block.state.IBlockState;
public final class Flower {
private final Block block;
private final int meta;
private final IBlockState blockState;
private Double weight;
public Flower(Block block, int meta, double weight) {
this.block = block;
this.meta = meta;
public Flower(IBlockState blockState, double weight) {
this.blockState = blockState;
this.weight = weight;
}
@@ -40,20 +36,16 @@ public final class Flower {
Flower flower = (Flower) obj;
return Block.isEqualTo(this.block, flower.getBlock()) && (this.meta == OreDictionary.WILDCARD_VALUE || flower.getMeta() == OreDictionary.WILDCARD_VALUE || this.meta == flower.getMeta());
return this.blockState == flower.getBlockState();
}
@Override
public int hashCode() {
return Objects.hashCode(block);
return Objects.hashCode(blockState);
}
public Block getBlock() {
return block;
}
public int getMeta() {
return meta;
public IBlockState getBlockState() {
return blockState;
}
public double getWeight() {
@@ -66,7 +58,7 @@ public final class Flower {
@Override
public String toString() {
return Objects.toStringHelper(this).add("block", block).add("meta", meta).add("weight", weight).toString();
return Objects.toStringHelper(this).add("blockState", blockState).add("weight", weight).toString();
}
}
@@ -13,12 +13,9 @@ package forestry.apiculture.flowers;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -27,18 +24,12 @@ import java.util.Set;
import java.util.TreeMap;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFlowerPot;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFlowerPot;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.FlowerManager;
import forestry.api.apiculture.IBee;
@@ -50,7 +41,7 @@ import forestry.api.genetics.IFlowerGrowthHelper;
import forestry.api.genetics.IFlowerGrowthRule;
import forestry.api.genetics.IFlowerRegistry;
import forestry.api.genetics.IIndividual;
import forestry.core.config.Constants;
import forestry.core.utils.Log;
import forestry.core.utils.VectUtil;
public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelper {
@@ -67,17 +58,19 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
FlowerManager.FlowerTypeGourd
);
private final HashMultimap<String, IFlowerAcceptableRule> registeredRules; // custom check
private final HashMultimap<String, Block> registeredBlocks; // quick first check
private final HashMultimap<String, Flower> registeredFlowers; // full check
private final HashMultimap<String, IFlowerAcceptableRule> registeredRules;
private final HashMultimap<String, Block> acceptableBlocks;
private final HashMultimap<String, IBlockState> acceptableBlockStates;
private final HashMultimap<String, Flower> plantableFlowers;
private final ArrayListMultimap<String, IFlowerGrowthRule> growthRules;
private final Map<String, TreeMap<Double, Flower>> chances;
public FlowerRegistry() {
this.registeredRules = HashMultimap.create();
this.registeredBlocks = HashMultimap.create();
this.registeredFlowers = HashMultimap.create();
this.acceptableBlocks = HashMultimap.create();
this.acceptableBlockStates = HashMultimap.create();
this.plantableFlowers = HashMultimap.create();
this.growthRules = ArrayListMultimap.create();
this.chances = new HashMap<>();
@@ -86,28 +79,40 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
@Override
public void registerAcceptableFlower(Block block, String... flowerTypes) {
registerFlower(block, OreDictionary.WILDCARD_VALUE, 0.0, flowerTypes);
for (String flowerType : flowerTypes) {
if (flowerType == null) {
throw new NullPointerException("Tried to register flower with null type. " + block);
}
this.acceptableBlocks.get(flowerType).add(block);
}
}
@Override
public void registerAcceptableFlower(Block block, int meta, String... flowerTypes) {
registerFlower(block, meta, 0.0, flowerTypes);
public void registerAcceptableFlower(IBlockState blockState, String... flowerTypes) {
for (String flowerType : flowerTypes) {
if (flowerType == null) {
throw new NullPointerException("Tried to register flower with null type. " + blockState);
}
this.acceptableBlockStates.get(flowerType).add(blockState);
}
}
@Override
public void registerAcceptableFlowerRule(IFlowerAcceptableRule acceptableFlower, String... flowerTypes) {
for (String flowerType : flowerTypes) {
if (flowerType == null) {
throw new NullPointerException("Tried to register flower with null type. " + acceptableFlower);
}
registeredRules.put(flowerType, acceptableFlower);
}
}
@Override
public void registerPlantableFlower(Block block, int meta, double weight, String... flowerTypes) {
registerFlower(block, meta, weight, flowerTypes);
}
private void registerFlower(Block block, int meta, double weight, String... flowerTypes) {
if (block == null) {
public void registerPlantableFlower(IBlockState blockState, double weight, String... flowerTypes) {
if (blockState == null) {
return;
}
if (weight <= 0.0) {
@@ -117,18 +122,22 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
weight = 1.0;
}
Flower newFlower = new Flower(block, meta, weight);
if (blockState.getBlock() == Blocks.AIR) {
Log.error("Tried to register AIR as a flower. Bad idea.");
}
Flower newFlower = new Flower(blockState, weight);
for (String flowerType : flowerTypes) {
if (flowerType == null) {
throw new NullPointerException("Tried to register flower with null type. " + block);
throw new NullPointerException("Tried to register flower with null type. " + blockState);
}
Set<Flower> flowers = this.registeredFlowers.get(flowerType);
Set<Flower> flowers = this.plantableFlowers.get(flowerType);
flowers.add(newFlower);
Set<Block> blocks = this.registeredBlocks.get(flowerType);
blocks.add(block);
Set<IBlockState> blocks = this.acceptableBlockStates.get(flowerType);
blocks.add(blockState);
if (this.chances.containsKey(flowerType)) {
this.chances.remove(flowerType);
@@ -145,13 +154,9 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
@Override
@Nonnull
public List<BlockPos> getAcceptedFlowerCoordinates(IBeeHousing beeHousing, IBee bee, String flowerType, int maxFlowers) {
if (!this.registeredFlowers.containsKey(flowerType)) {
return Collections.emptyList();
}
Set<IFlowerAcceptableRule> acceptableRules = this.registeredRules.get(flowerType);
Set<Block> acceptedBlocks = this.registeredBlocks.get(flowerType);
Set<Flower> acceptedFlowers = this.registeredFlowers.get(flowerType);
Set<IBlockState> acceptedBlockStates = this.acceptableBlockStates.get(flowerType);
Set<Block> acceptedBlocks = this.acceptableBlocks.get(flowerType);
World world = beeHousing.getWorldObj();
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(beeHousing);
@@ -161,9 +166,14 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
BlockPos maxPos = minPos.add(area);
List<BlockPos> flowerCoords = new ArrayList<>();
for (BlockPos.MutableBlockPos posBlock : BlockPos.getAllInBoxMutable(minPos, maxPos)) {
for (BlockPos.MutableBlockPos posBlock : VectUtil.getAllInBoxFromCenterMutable(world, minPos, beeHousing.getCoordinates(), maxPos)) {
IBlockState blockState = world.getBlockState(posBlock);
if (blockState.getBlock().isAir(blockState, world, posBlock)) {
continue;
}
for (IFlowerAcceptableRule acceptableRule : acceptableRules) {
if (acceptableRule.isAcceptableFlower(flowerType, world, posBlock)) {
if (acceptableRule.isAcceptableFlower(blockState, world, posBlock, flowerType)) {
flowerCoords.add(posBlock.toImmutable());
if (flowerCoords.size() >= maxFlowers) {
return flowerCoords;
@@ -171,7 +181,7 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
}
}
if (isAcceptedFlower(acceptedBlocks, acceptedFlowers, world, posBlock)) {
if (isAcceptedFlower(blockState, acceptedBlocks, acceptedBlockStates)) {
flowerCoords.add(posBlock.toImmutable());
if (flowerCoords.size() >= maxFlowers) {
return flowerCoords;
@@ -184,44 +194,23 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
@Override
public boolean isAcceptedFlower(String flowerType, World world, BlockPos pos) {
if (!this.registeredFlowers.containsKey(flowerType)) {
return false;
}
IBlockState blockState = world.getBlockState(pos);
Set<IFlowerAcceptableRule> acceptedCustom = this.registeredRules.get(flowerType);
for (IFlowerAcceptableRule acceptableFlower : acceptedCustom) {
if (acceptableFlower.isAcceptableFlower(flowerType, world, pos)) {
if (acceptableFlower.isAcceptableFlower(blockState, world, pos, flowerType)) {
return true;
}
}
Set<Block> acceptedBlocks = this.registeredBlocks.get(flowerType);
Set<Flower> acceptedFlowers = this.registeredFlowers.get(flowerType);
Set<IBlockState> acceptedBlockStates = this.acceptableBlockStates.get(flowerType);
Set<Block> acceptedBlocks = this.acceptableBlocks.get(flowerType);
return isAcceptedFlower(acceptedBlocks, acceptedFlowers, world, pos);
return isAcceptedFlower(blockState, acceptedBlocks, acceptedBlockStates);
}
private static boolean isAcceptedFlower(Set<Block> acceptedBlocks, Set<Flower> acceptedFlowers, World world, BlockPos pos) {
IBlockState blockState = world.getBlockState(pos);
private static boolean isAcceptedFlower(IBlockState blockState, Set<Block> acceptedBlocks, Set<IBlockState> acceptedBlockStates) {
Block block = blockState.getBlock();
final int meta;
if (block instanceof BlockFlowerPot) {
TileEntity tile = world.getTileEntity(pos);
TileEntityFlowerPot tileFlowerPot = (TileEntityFlowerPot) tile;
Item item = tileFlowerPot.getFlowerPotItem();
block = Block.getBlockFromItem(item);
meta = tileFlowerPot.getFlowerPotData();
} else {
if (!acceptedBlocks.contains(block)) {
return false;
}
meta = block.getMetaFromState(blockState);
}
Flower flower = new Flower(block, meta, 0);
return acceptedFlowers.contains(flower);
return acceptedBlocks.contains(block) || acceptedBlockStates.contains(blockState);
}
@Override
@@ -239,10 +228,6 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
return false;
}
public Set<Flower> getAcceptableFlowers(String flowerType) {
return ImmutableSet.copyOf(this.registeredFlowers.get(flowerType));
}
@Override
public void registerGrowthRule(IFlowerGrowthRule rule, String... flowerTypes) {
if (rule == null) {
@@ -260,15 +245,11 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
return chancesMap.get(chancesMap.lowerKey(rand.nextDouble() * maxKey));
}
public Collection<String> getFlowerTypes() {
return new ArrayList<>(Sets.union(defaultFlowerTypes, registeredFlowers.keySet()));
}
private TreeMap<Double, Flower> getChancesMap(String flowerType) {
if (!this.chances.containsKey(flowerType)) {
TreeMap<Double, Flower> flowerChances = new TreeMap<>();
double count = 0.0;
for (Flower flower : this.registeredFlowers.get(flowerType)) {
for (Flower flower : this.plantableFlowers.get(flowerType)) {
if (flower.isPlantable()) {
flowerChances.put(count, flower);
count += flower.getWeight();
@@ -282,8 +263,6 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
private void registerVanillaGrowthRules() {
registerGrowthRule(new GrowthRuleDirtGrass(), FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
registerGrowthRule(new GrowthRuleSnow(), FlowerManager.FlowerTypeSnow);
registerGrowthRule(new GrowthRuleFlowerPot(), FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow, FlowerManager.FlowerTypeMushrooms, FlowerManager.FlowerTypeCacti,
FlowerManager.FlowerTypeJungle);
registerGrowthRule(new GrowthRuleMycelium(), FlowerManager.FlowerTypeMushrooms);
registerGrowthRule(new GrowthRuleNone(), FlowerManager.FlowerTypeEnd);
registerGrowthRule(new GrowthRuleFertilize(Blocks.MELON_STEM, Blocks.PUMPKIN_STEM), FlowerManager.FlowerTypeGourd);
@@ -293,6 +272,6 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe
@Override
public boolean plantRandomFlower(String flowerType, World world, BlockPos pos) {
Flower flower = getRandomPlantableFlower(flowerType, world.rand);
return world.setBlockState(pos, flower.getBlock().getStateFromMeta(flower.getMeta()), Constants.FLAG_BLOCK_SYNC);
return world.setBlockState(pos, flower.getBlockState());
}
}
@@ -1,79 +0,0 @@
/*******************************************************************************
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package forestry.apiculture.flowers;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFlowerPot;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFlowerPot;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import forestry.api.apiculture.FlowerManager;
import forestry.api.genetics.IFlowerGrowthHelper;
import forestry.api.genetics.IFlowerGrowthRule;
public class GrowthRuleFlowerPot implements IFlowerGrowthRule {
@Override
public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos) {
return growFlower(flowerType, world, pos);
}
private static boolean growFlower(String flowerType, World world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
if (!(tile instanceof TileEntityFlowerPot)) {
return false;
}
TileEntityFlowerPot flowerPotTile = (TileEntityFlowerPot) tile;
if (flowerPotTile.getFlowerPotItem() != null) {
return false;
}
Block block = world.getBlockState(pos).getBlock();
if (!(block instanceof BlockFlowerPot)) {
return false;
}
BlockFlowerPot flowerPot = (BlockFlowerPot) block;
int flower;
switch (flowerType) {
case FlowerManager.FlowerTypeVanilla:
case FlowerManager.FlowerTypeSnow:
flower = world.rand.nextInt(2) + 1;
break;
case FlowerManager.FlowerTypeJungle:
flower = 6;
break;
case FlowerManager.FlowerTypeCacti:
flower = world.rand.nextInt(2) + 9;
break;
case FlowerManager.FlowerTypeMushrooms:
flower = world.rand.nextInt(2) + 7;
break;
default:
return false;
}
TileEntityFlowerPot newTile = (TileEntityFlowerPot) flowerPot.createNewTileEntity(world, flower);
flowerPotTile.setFlowerPotData(newTile.getFlowerPotItem(), newTile.getFlowerPotData());
flowerPotTile.markDirty();
if (!world.setBlockState(pos, world.getBlockState(pos).getBlock().getStateFromMeta(1), 2)) {
world.markBlockRangeForRenderUpdate(pos, pos);
}
return true;
}
}
@@ -314,7 +314,7 @@ public class VillageApiaristHouse extends StructureVillagePieces.House1 {
FlowerRegistry flowerRegistry = (FlowerRegistry) FlowerManager.flowerRegistry;
Flower flower = flowerRegistry.getRandomPlantableFlower(FlowerManager.FlowerTypeVanilla, world.rand);
setBlockState(world, flower.getBlock().getStateFromMeta(flower.getMeta()), j, i, k, box);
setBlockState(world, flower.getBlockState(), j, i, k, box);
}
}
}
@@ -11,6 +11,7 @@
package forestry.arboriculture;
import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.List;
@@ -126,13 +127,22 @@ public class WoodAccess implements IWoodAccess {
private static void registerVanilla() {
IBlockState defaultLogState = Blocks.LOG.getDefaultState();
register(EnumVanillaWoodType.OAK, WoodBlockKind.LOG, false, defaultLogState.withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.OAK), new ItemStack(Blocks.LOG, 1, 0));
register(EnumVanillaWoodType.BIRCH, WoodBlockKind.LOG, false, defaultLogState.withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.BIRCH), new ItemStack(Blocks.LOG, 1, 1));
register(EnumVanillaWoodType.SPRUCE, WoodBlockKind.LOG, false, defaultLogState.withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.SPRUCE), new ItemStack(Blocks.LOG, 1, 2));
register(EnumVanillaWoodType.JUNGLE, WoodBlockKind.LOG, false, defaultLogState.withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE), new ItemStack(Blocks.LOG, 1, 3));
List<EnumVanillaWoodType> oldLogTypes = Arrays.asList(EnumVanillaWoodType.OAK, EnumVanillaWoodType.SPRUCE, EnumVanillaWoodType.BIRCH, EnumVanillaWoodType.JUNGLE);
for (EnumVanillaWoodType woodType : oldLogTypes) {
BlockPlanks.EnumType vanillaType = woodType.getVanillaType();
ItemStack itemStack = new ItemStack(Blocks.LOG, 1, vanillaType.getMetadata());
IBlockState blockState = defaultLogState.withProperty(BlockOldLog.VARIANT, vanillaType);
register(woodType, WoodBlockKind.LOG, false, blockState, itemStack);
}
IBlockState defaultLog2State = Blocks.LOG2.getDefaultState();
register(EnumVanillaWoodType.ACACIA, WoodBlockKind.LOG, false, defaultLog2State.withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.ACACIA), new ItemStack(Blocks.LOG2, 1, 0));
register(EnumVanillaWoodType.DARK_OAK, WoodBlockKind.LOG, false, defaultLog2State.withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.DARK_OAK), new ItemStack(Blocks.LOG2, 1, 1));
List<EnumVanillaWoodType> newLogTypes = Arrays.asList(EnumVanillaWoodType.ACACIA, EnumVanillaWoodType.DARK_OAK);
for (EnumVanillaWoodType woodType : newLogTypes) {
BlockPlanks.EnumType vanillaType = woodType.getVanillaType();
ItemStack itemStack = new ItemStack(Blocks.LOG2, 1, vanillaType.getMetadata() - 4);
IBlockState blockState = defaultLog2State.withProperty(BlockNewLog.VARIANT, vanillaType);
register(woodType, WoodBlockKind.LOG, false, blockState, itemStack);
}
IBlockState defaultPlanksState = Blocks.PLANKS.getDefaultState();
IBlockState defaultSlabState = Blocks.WOODEN_SLAB.getDefaultState();
@@ -149,29 +159,29 @@ public class WoodAccess implements IWoodAccess {
}
register(EnumVanillaWoodType.OAK, WoodBlockKind.FENCE, false, Blocks.OAK_FENCE.getDefaultState(), new ItemStack(Blocks.OAK_FENCE));
register(EnumVanillaWoodType.BIRCH, WoodBlockKind.FENCE, false, Blocks.BIRCH_FENCE.getDefaultState(), new ItemStack(Blocks.BIRCH_FENCE));
register(EnumVanillaWoodType.SPRUCE, WoodBlockKind.FENCE, false, Blocks.SPRUCE_FENCE.getDefaultState(), new ItemStack(Blocks.SPRUCE_FENCE));
register(EnumVanillaWoodType.BIRCH, WoodBlockKind.FENCE, false, Blocks.BIRCH_FENCE.getDefaultState(), new ItemStack(Blocks.BIRCH_FENCE));
register(EnumVanillaWoodType.JUNGLE, WoodBlockKind.FENCE, false, Blocks.JUNGLE_FENCE.getDefaultState(), new ItemStack(Blocks.JUNGLE_FENCE));
register(EnumVanillaWoodType.ACACIA, WoodBlockKind.FENCE, false, Blocks.ACACIA_FENCE.getDefaultState(), new ItemStack(Blocks.ACACIA_FENCE));
register(EnumVanillaWoodType.DARK_OAK, WoodBlockKind.FENCE, false, Blocks.DARK_OAK_FENCE.getDefaultState(), new ItemStack(Blocks.DARK_OAK_FENCE));
register(EnumVanillaWoodType.OAK, WoodBlockKind.FENCE_GATE, false, Blocks.OAK_FENCE_GATE.getDefaultState(), new ItemStack(Blocks.OAK_FENCE_GATE));
register(EnumVanillaWoodType.BIRCH, WoodBlockKind.FENCE_GATE, false, Blocks.BIRCH_FENCE_GATE.getDefaultState(), new ItemStack(Blocks.BIRCH_FENCE_GATE));
register(EnumVanillaWoodType.SPRUCE, WoodBlockKind.FENCE_GATE, false, Blocks.SPRUCE_FENCE_GATE.getDefaultState(), new ItemStack(Blocks.SPRUCE_FENCE_GATE));
register(EnumVanillaWoodType.BIRCH, WoodBlockKind.FENCE_GATE, false, Blocks.BIRCH_FENCE_GATE.getDefaultState(), new ItemStack(Blocks.BIRCH_FENCE_GATE));
register(EnumVanillaWoodType.JUNGLE, WoodBlockKind.FENCE_GATE, false, Blocks.JUNGLE_FENCE_GATE.getDefaultState(), new ItemStack(Blocks.JUNGLE_FENCE_GATE));
register(EnumVanillaWoodType.ACACIA, WoodBlockKind.FENCE_GATE, false, Blocks.ACACIA_FENCE_GATE.getDefaultState(), new ItemStack(Blocks.ACACIA_FENCE_GATE));
register(EnumVanillaWoodType.DARK_OAK, WoodBlockKind.FENCE_GATE, false, Blocks.DARK_OAK_FENCE_GATE.getDefaultState(), new ItemStack(Blocks.DARK_OAK_FENCE_GATE));
register(EnumVanillaWoodType.OAK, WoodBlockKind.STAIRS, false, Blocks.OAK_STAIRS.getDefaultState(), new ItemStack(Blocks.OAK_STAIRS));
register(EnumVanillaWoodType.BIRCH, WoodBlockKind.STAIRS, false, Blocks.BIRCH_STAIRS.getDefaultState(), new ItemStack(Blocks.BIRCH_STAIRS));
register(EnumVanillaWoodType.SPRUCE, WoodBlockKind.STAIRS, false, Blocks.SPRUCE_STAIRS.getDefaultState(), new ItemStack(Blocks.SPRUCE_STAIRS));
register(EnumVanillaWoodType.BIRCH, WoodBlockKind.STAIRS, false, Blocks.BIRCH_STAIRS.getDefaultState(), new ItemStack(Blocks.BIRCH_STAIRS));
register(EnumVanillaWoodType.JUNGLE, WoodBlockKind.STAIRS, false, Blocks.JUNGLE_STAIRS.getDefaultState(), new ItemStack(Blocks.JUNGLE_STAIRS));
register(EnumVanillaWoodType.ACACIA, WoodBlockKind.STAIRS, false, Blocks.ACACIA_STAIRS.getDefaultState(), new ItemStack(Blocks.ACACIA_STAIRS));
register(EnumVanillaWoodType.DARK_OAK, WoodBlockKind.STAIRS, false, Blocks.DARK_OAK_STAIRS.getDefaultState(), new ItemStack(Blocks.DARK_OAK_STAIRS));
register(EnumVanillaWoodType.OAK, WoodBlockKind.DOOR, false, Blocks.OAK_DOOR.getDefaultState(), new ItemStack(Items.OAK_DOOR));
register(EnumVanillaWoodType.BIRCH, WoodBlockKind.DOOR, false, Blocks.BIRCH_DOOR.getDefaultState(), new ItemStack(Items.BIRCH_DOOR));
register(EnumVanillaWoodType.SPRUCE, WoodBlockKind.DOOR, false, Blocks.SPRUCE_DOOR.getDefaultState(), new ItemStack(Items.SPRUCE_DOOR));
register(EnumVanillaWoodType.BIRCH, WoodBlockKind.DOOR, false, Blocks.BIRCH_DOOR.getDefaultState(), new ItemStack(Items.BIRCH_DOOR));
register(EnumVanillaWoodType.JUNGLE, WoodBlockKind.DOOR, false, Blocks.JUNGLE_DOOR.getDefaultState(), new ItemStack(Items.JUNGLE_DOOR));
register(EnumVanillaWoodType.ACACIA, WoodBlockKind.DOOR, false, Blocks.ACACIA_DOOR.getDefaultState(), new ItemStack(Items.ACACIA_DOOR));
register(EnumVanillaWoodType.DARK_OAK, WoodBlockKind.DOOR, false, Blocks.DARK_OAK_DOOR.getDefaultState(), new ItemStack(Items.DARK_OAK_DOOR));
@@ -10,11 +10,15 @@
******************************************************************************/
package forestry.core.utils;
import com.google.common.collect.AbstractIterator;
import java.util.Iterator;
import java.util.Random;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i;
import net.minecraft.world.World;
public final class VectUtil {
public static BlockPos getRandomPositionInArea(Random random, Vec3i area) {
@@ -53,4 +57,104 @@ public final class VectUtil {
return EnumFacing.UP;
}
}
public static Iterable<BlockPos.MutableBlockPos> getAllInBoxFromCenterMutable(World world, final BlockPos from, final BlockPos center, final BlockPos to) {
final BlockPos minPos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ()));
final BlockPos maxPos = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()), Math.max(from.getZ(), to.getZ()));
return new Iterable<BlockPos.MutableBlockPos>() {
@Override
public Iterator<BlockPos.MutableBlockPos> iterator() {
return new MutableBlockPosSpiralIterator(world, center, maxPos, minPos);
}
};
}
private static class MutableBlockPosSpiralIterator extends AbstractIterator<BlockPos.MutableBlockPos> {
private final World world;
private final BlockPos center;
private final BlockPos maxPos;
private final BlockPos minPos;
private int spiralLayer;
private final int maxSpiralLayers;
private int direction;
private BlockPos.MutableBlockPos theBlockPos;
public MutableBlockPosSpiralIterator(World world, BlockPos center, BlockPos maxPos, BlockPos minPos) {
this.world = world;
this.center = center;
this.maxPos = maxPos;
this.minPos = minPos;
int xDiameter = maxPos.getX() - minPos.getX();
int zDiameter = maxPos.getZ() - minPos.getZ();
this.maxSpiralLayers = Math.max(xDiameter, zDiameter) / 2;
this.spiralLayer = 1;
}
@Override
protected BlockPos.MutableBlockPos computeNext() {
BlockPos.MutableBlockPos pos;
do {
pos = nextPos();
}
while (pos != null && (pos.getX() > maxPos.getX() || pos.getZ() > maxPos.getZ() || pos.getX() < minPos.getX() || pos.getZ() < minPos.getZ()));
return pos;
}
protected BlockPos.MutableBlockPos nextPos() {
if (this.theBlockPos == null) {
this.theBlockPos = new BlockPos.MutableBlockPos(center.getX(), maxPos.getY(), center.getZ());
int y = Math.min(this.maxPos.getY(), this.world.getHeight(this.theBlockPos).getY());
this.theBlockPos.setY(y);
return this.theBlockPos;
} else if (spiralLayer > maxSpiralLayers) {
return this.endOfData();
} else {
int x = this.theBlockPos.getX();
int y = this.theBlockPos.getY();
int z = this.theBlockPos.getZ();
if (y > minPos.getY() && y > 0) {
y--;
} else {
switch (direction) {
case 0:
++x;
if (x == center.getX() + spiralLayer) {
++direction;
}
break;
case 1:
++z;
if (z == center.getZ() + spiralLayer) {
++direction;
}
break;
case 2:
--x;
if (x == center.getX() - spiralLayer) {
++direction;
}
break;
case 3:
--z;
if (z == center.getZ() - spiralLayer) {
direction = 0;
++spiralLayer;
}
break;
}
this.theBlockPos.setPos(x, y, z);
y = Math.min(this.maxPos.getY(), this.world.getHeight(this.theBlockPos).getY());
}
return this.theBlockPos.setPos(x, y, z);
}
}
}
}
@@ -14,8 +14,10 @@ import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import net.minecraftforge.fml.common.registry.GameRegistry;
@@ -161,48 +163,48 @@ public class PluginBiomesOPlenty extends BlankForestryPlugin {
}
private static void addFlowers() {
Block flowers = GameRegistry.findBlock(BoP, "flowers");
if (flowers != null) {
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 0, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Clover
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 1, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow, FlowerManager.FlowerTypeMushrooms); //Swampflower
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 2, 1.0, FlowerManager.FlowerTypeNether); //Deathbloom
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 3, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //GlowFlower
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 4, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Blue Hydrangea
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 5, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow, FlowerManager.FlowerTypeJungle); //Orange Cosmos
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 6, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Pink Daffodil
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 7, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //WildFlower
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 8, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Violet
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 9, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // White Anemone
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 10, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // Waterlily
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 11, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //EnderLotus (does not actually spawn in the end)
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 12, 1.0, FlowerManager.FlowerTypeCacti); //Bromeliad
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 13, 1.0, FlowerManager.FlowerTypeNether); // EyeBulb
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 14, 1.0, FlowerManager.FlowerTypeNether); // Unlisted top of the eyebulb
FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 15, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // Dandelion Puff
}
Block flowers2 = GameRegistry.findBlock(BoP, "flowers2");
if (flowers2 != null) {
FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 0, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeJungle); //Pink Hibiscus
FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 1, 1.0, FlowerManager.FlowerTypeVanilla); //Lily of the Valley
FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 2, 1.0, FlowerManager.FlowerTypeNether); // Burning Blososm
FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 3, 1.0, FlowerManager.FlowerTypeVanilla); // Lavender
FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 4, 1.0, FlowerManager.FlowerTypeVanilla); // Goldenrod
FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 5, 1.0, FlowerManager.FlowerTypeVanilla); //Bluebells
FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 6, 1.0, FlowerManager.FlowerTypeVanilla); //Miner's delight
FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 7, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Icy Iris
FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 8, 1.0, FlowerManager.FlowerTypeVanilla); // Rose
}
// Toadstool 0 Portobello 1 Blue Milk cap 2 Glowshroom 3 flat mushroom 4 shadow shroom 5 'plants:12' tiny cactus
Block mushrooms = GameRegistry.findBlock(BoP, "mushrooms");
if (mushrooms != null) {
FlowerManager.flowerRegistry.registerPlantableFlower(mushrooms, OreDictionary.WILDCARD_VALUE, 1.0, FlowerManager.FlowerTypeMushrooms);
FlowerManager.flowerRegistry.registerPlantableFlower(mushrooms, 3, 1.0, FlowerManager.FlowerTypeNether);
}
Block plants = GameRegistry.findBlock(BoP, "plants");
if (plants != null) {
FlowerManager.flowerRegistry.registerPlantableFlower(plants, 12, 1.0, FlowerManager.FlowerTypeCacti);
}
// Block flowers = Block.REGISTRY.getObject(new ResourceLocation(BoP, "flowers"));
// if (flowers != null && flowers != Blocks.AIR) {
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 0, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Clover
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 1, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow, FlowerManager.FlowerTypeMushrooms); //Swampflower
// // FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 2, 1.0, FlowerManager.FlowerTypeNether); //Deathbloom
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 3, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //GlowFlower
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 4, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Blue Hydrangea
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 5, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow, FlowerManager.FlowerTypeJungle); //Orange Cosmos
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 6, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Pink Daffodil
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 7, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //WildFlower
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 8, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Violet
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 9, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // White Anemone
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 10, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // Waterlily
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 11, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //EnderLotus (does not actually spawn in the end)
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 12, 1.0, FlowerManager.FlowerTypeCacti); //Bromeliad
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 13, 1.0, FlowerManager.FlowerTypeNether); // EyeBulb
// // FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 14, 1.0, FlowerManager.FlowerTypeNether); // Unlisted top of the eyebulb
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 15, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // Dandelion Puff
// }
//
// Block flowers2 = Block.REGISTRY.getObject(new ResourceLocation(BoP, "flowers2"));
// if (flowers2 != null && flowers2 != Blocks.AIR) {
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 0, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeJungle); //Pink Hibiscus
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 1, 1.0, FlowerManager.FlowerTypeVanilla); //Lily of the Valley
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 2, 1.0, FlowerManager.FlowerTypeNether); // Burning Blososm
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 3, 1.0, FlowerManager.FlowerTypeVanilla); // Lavender
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 4, 1.0, FlowerManager.FlowerTypeVanilla); // Goldenrod
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 5, 1.0, FlowerManager.FlowerTypeVanilla); //Bluebells
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 6, 1.0, FlowerManager.FlowerTypeVanilla); //Miner's delight
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 7, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Icy Iris
// FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 8, 1.0, FlowerManager.FlowerTypeVanilla); // Rose
// }
// // Toadstool 0 Portobello 1 Blue Milk cap 2 Glowshroom 3 flat mushroom 4 shadow shroom 5 'plants:12' tiny cactus
// Block mushrooms = Block.REGISTRY.getObject(new ResourceLocation(BoP, "mushrooms"));
// if (mushrooms != null && mushrooms != Blocks.AIR) {
// FlowerManager.flowerRegistry.registerPlantableFlower(mushrooms, OreDictionary.WILDCARD_VALUE, 1.0, FlowerManager.FlowerTypeMushrooms);
// FlowerManager.flowerRegistry.registerPlantableFlower(mushrooms, 3, 1.0, FlowerManager.FlowerTypeNether);
// }
// Block plants = Block.REGISTRY.getObject(new ResourceLocation(BoP, "plants"));
// if (plants != null && plants != Blocks.AIR) {
// FlowerManager.flowerRegistry.registerPlantableFlower(plants, 12, 1.0, FlowerManager.FlowerTypeCacti);
// }
}
@Override
@@ -45,6 +45,14 @@ public class BackpackDefinition implements IBackpackDefinition {
this.secondaryColor = secondaryColor.getRGB();
}
public Set<Integer> getValidOreIds() {
return validOreIds;
}
public Set<String> getValidItemStacks() {
return validItemStacks;
}
@Override
public String getName(ItemStack backpack) {
Item item = backpack.getItem();
+104 -29
View File
@@ -18,6 +18,7 @@ import java.awt.Color;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -59,6 +60,7 @@ import forestry.core.recipes.RecipeUtil;
import forestry.core.utils.IMCUtil;
import forestry.core.utils.ItemStackUtil;
import forestry.core.utils.Log;
import forestry.core.utils.OreDictUtil;
import forestry.core.utils.Translator;
import forestry.lepidopterology.PluginLepidopterology;
import forestry.lepidopterology.blocks.BlockRegistryLepidopterology;
@@ -82,6 +84,15 @@ public class PluginStorage extends BlankForestryPlugin {
private final Multimap<String, String> backpackOreDictRegexpDefaults = HashMultimap.create();
private final Multimap<String, String> backpackItemDefaults = HashMultimap.create();
private final List<String> forestryBackpackUids = Arrays.asList(
BackpackManager.MINER_UID,
BackpackManager.DIGGER_UID,
BackpackManager.FORESTER_UID,
BackpackManager.HUNTER_UID,
BackpackManager.ADVENTURER_UID,
BackpackManager.BUILDER_UID
);
@Override
public void setupAPI() {
super.setupAPI();
@@ -130,6 +141,7 @@ public class PluginStorage extends BlankForestryPlugin {
@Override
public void preInit() {
registerFenceAndFenceGatesToOreDict();
MinecraftForge.EVENT_BUS.register(this);
}
@@ -142,18 +154,16 @@ public class PluginStorage extends BlankForestryPlugin {
setDefaultsForConfig();
handleBackpackConfig(config, BackpackManager.MINER_UID);
handleBackpackConfig(config, BackpackManager.DIGGER_UID);
handleBackpackConfig(config, BackpackManager.FORESTER_UID);
handleBackpackConfig(config, BackpackManager.HUNTER_UID);
handleBackpackConfig(config, BackpackManager.ADVENTURER_UID);
handleBackpackConfig(config, BackpackManager.BUILDER_UID);
for (String backpackUid : forestryBackpackUids) {
handleBackpackConfig(config, backpackUid);
}
config.save();
}
private void setDefaultsForConfig() {
backpackOreDictRegexpDefaults.get(BackpackManager.MINER_UID).addAll(Arrays.asList(
"obsidian",
"ore[A-Z].*",
"dust[A-Z].*",
"gem[A-Z].*",
@@ -166,17 +176,35 @@ public class PluginStorage extends BlankForestryPlugin {
backpackOreDictRegexpDefaults.get(BackpackManager.DIGGER_UID).addAll(Arrays.asList(
"cobblestone",
"dirt",
"gravel",
"netherrack",
"stone",
"stone[A-Z].*",
"sand"
));
backpackOreDictRegexpDefaults.get(BackpackManager.HUNTER_UID).addAll(Arrays.asList(
"bone",
"egg",
"enderpearl",
"feather",
"fish[A-Z].*",
"gunpowder",
"leather",
"slimeball",
"string"
));
backpackOreDictRegexpDefaults.get(BackpackManager.FORESTER_UID).addAll(Arrays.asList(
"logWood",
"stickWood",
"woodStick",
"saplingTree",
"treeSapling",
"vine",
"sugarcane",
"blockCactus",
"crop[A-Z].*",
"seed[A-Z].*",
"tree[A-Z].*"
@@ -189,11 +217,12 @@ public class PluginStorage extends BlankForestryPlugin {
"stainedClay[A-Z].*",
"stainedGlass[A-Z].*",
"stone",
"sandstone",
"plankWood",
"stairWood",
"slabWood",
"fenceWood",
"fenceGateWood",
OreDictUtil.FENCE_WOOD,
OreDictUtil.FENCE_GATE_WOOD,
"glass",
"paneGlass",
"torch",
@@ -204,7 +233,6 @@ public class PluginStorage extends BlankForestryPlugin {
));
backpackItemDefaults.get(BackpackManager.MINER_UID).addAll(getItemStrings(Arrays.asList(
new ItemStack(Blocks.OBSIDIAN),
new ItemStack(Blocks.COAL_ORE),
new ItemStack(Items.COAL),
PluginCore.items.bronzePickaxe.getItemStack(),
@@ -214,11 +242,10 @@ public class PluginStorage extends BlankForestryPlugin {
backpackItemDefaults.get(BackpackManager.DIGGER_UID).addAll(getItemStrings(Arrays.asList(
new ItemStack(Blocks.DIRT, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Blocks.GRAVEL),
new ItemStack(Items.FLINT),
new ItemStack(Blocks.NETHERRACK),
new ItemStack(Blocks.SANDSTONE, 1, 0),
new ItemStack(Items.CLAY_BALL),
new ItemStack(Items.SNOWBALL),
new ItemStack(Blocks.SOUL_SAND),
PluginCore.items.bronzeShovel.getItemStack(),
PluginCore.items.kitShovel.getItemStack(),
@@ -228,49 +255,55 @@ public class PluginStorage extends BlankForestryPlugin {
backpackItemDefaults.get(BackpackManager.FORESTER_UID).addAll(getItemStrings(Arrays.asList(
new ItemStack(Blocks.RED_MUSHROOM),
new ItemStack(Blocks.BROWN_MUSHROOM),
new ItemStack(Blocks.RED_FLOWER),
new ItemStack(Blocks.RED_FLOWER, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Blocks.YELLOW_FLOWER),
new ItemStack(Blocks.CACTUS),
new ItemStack(Blocks.TALLGRASS, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Blocks.DOUBLE_PLANT, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Blocks.PUMPKIN),
new ItemStack(Blocks.MELON_BLOCK),
new ItemStack(Items.GOLDEN_APPLE),
new ItemStack(Items.NETHER_WART),
new ItemStack(Items.WHEAT_SEEDS),
new ItemStack(Items.PUMPKIN_SEEDS),
new ItemStack(Items.MELON_SEEDS)
new ItemStack(Items.MELON_SEEDS),
new ItemStack(Items.BEETROOT_SEEDS),
new ItemStack(Items.BEETROOT),
new ItemStack(Items.CHORUS_FRUIT),
new ItemStack(Items.APPLE)
)));
backpackItemDefaults.get(BackpackManager.HUNTER_UID).addAll(getItemStrings(Arrays.asList(
new ItemStack(Items.FEATHER),
new ItemStack(Items.GUNPOWDER),
new ItemStack(Items.BLAZE_POWDER),
new ItemStack(Items.BLAZE_ROD),
new ItemStack(Items.BONE),
new ItemStack(Items.STRING),
new ItemStack(Items.ROTTEN_FLESH),
new ItemStack(Items.SKULL, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Items.GHAST_TEAR),
new ItemStack(Items.GOLD_NUGGET),
new ItemStack(Items.ARROW),
new ItemStack(Items.SPECTRAL_ARROW),
new ItemStack(Items.TIPPED_ARROW),
new ItemStack(Items.PORKCHOP),
new ItemStack(Items.COOKED_PORKCHOP),
new ItemStack(Items.BEEF),
new ItemStack(Items.COOKED_BEEF),
new ItemStack(Items.CHICKEN),
new ItemStack(Items.COOKED_CHICKEN),
new ItemStack(Items.LEATHER),
new ItemStack(Items.EGG),
new ItemStack(Items.ENDER_PEARL),
new ItemStack(Items.MUTTON),
new ItemStack(Items.COOKED_MUTTON),
new ItemStack(Items.RABBIT),
new ItemStack(Items.COOKED_RABBIT),
new ItemStack(Items.RABBIT_FOOT),
new ItemStack(Items.RABBIT_HIDE),
new ItemStack(Items.SPIDER_EYE),
new ItemStack(Items.FERMENTED_SPIDER_EYE),
new ItemStack(Items.SLIME_BALL),
new ItemStack(Items.DYE, 1, 0),
new ItemStack(Blocks.HAY_BLOCK),
new ItemStack(Blocks.WOOL, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Items.ENDER_EYE),
new ItemStack(Items.MAGMA_CREAM),
new ItemStack(Items.SPECKLED_MELON),
new ItemStack(Items.FISH),
new ItemStack(Items.COOKED_FISH),
new ItemStack(Items.FISH, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Items.COOKED_FISH, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Items.LEAD),
new ItemStack(Items.FISHING_ROD),
new ItemStack(Items.NAME_TAG),
@@ -283,15 +316,16 @@ public class PluginStorage extends BlankForestryPlugin {
backpackItemDefaults.get(BackpackManager.BUILDER_UID).addAll(getItemStrings(Arrays.asList(
new ItemStack(Blocks.REDSTONE_TORCH),
new ItemStack(Blocks.REDSTONE_LAMP),
new ItemStack(Blocks.SEA_LANTERN),
new ItemStack(Blocks.END_ROD),
new ItemStack(Blocks.STONEBRICK, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Blocks.SANDSTONE, 1, 1),
new ItemStack(Blocks.SANDSTONE, 1, 2),
new ItemStack(Blocks.BRICK_BLOCK),
new ItemStack(Blocks.CLAY),
new ItemStack(Blocks.HARDENED_CLAY, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Blocks.PACKED_ICE),
new ItemStack(Blocks.NETHER_BRICK),
new ItemStack(Blocks.NETHER_BRICK_FENCE),
new ItemStack(Blocks.CRAFTING_TABLE),
new ItemStack(Blocks.FURNACE),
new ItemStack(Blocks.LEVER),
@@ -300,15 +334,27 @@ public class PluginStorage extends BlankForestryPlugin {
new ItemStack(Blocks.LADDER),
new ItemStack(Blocks.IRON_BARS),
new ItemStack(Blocks.QUARTZ_BLOCK, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Blocks.COBBLESTONE_WALL),
new ItemStack(Blocks.QUARTZ_STAIRS),
new ItemStack(Blocks.SANDSTONE_STAIRS),
new ItemStack(Blocks.RED_SANDSTONE_STAIRS),
new ItemStack(Blocks.COBBLESTONE_WALL, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Blocks.STONE_BUTTON),
new ItemStack(Blocks.WOODEN_BUTTON),
new ItemStack(Blocks.STONE_SLAB),
new ItemStack(Blocks.WOODEN_SLAB),
new ItemStack(Blocks.STONE_SLAB, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Blocks.STONE_SLAB2, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Blocks.WOODEN_SLAB, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Blocks.PURPUR_BLOCK),
new ItemStack(Blocks.PURPUR_PILLAR),
new ItemStack(Blocks.PURPUR_STAIRS),
new ItemStack(Blocks.PURPUR_SLAB),
new ItemStack(Blocks.END_BRICKS),
new ItemStack(Blocks.CARPET, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack(Blocks.TRAPDOOR),
new ItemStack(Blocks.IRON_TRAPDOOR),
new ItemStack(Blocks.STONE_PRESSURE_PLATE),
new ItemStack(Blocks.WOODEN_PRESSURE_PLATE),
new ItemStack(Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE),
new ItemStack(Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE),
new ItemStack(Items.SIGN),
new ItemStack(Items.ITEM_FRAME),
new ItemStack(Items.ACACIA_DOOR),
@@ -327,6 +373,35 @@ public class PluginStorage extends BlankForestryPlugin {
new ItemStack(beeBlocks.stump, 1, OreDictionary.WILDCARD_VALUE)
)));
}
// include everything added via the API
for (String backpackUid : forestryBackpackUids) {
BackpackDefinition backpackDefinition = (BackpackDefinition) BackpackManager.backpackInterface.getBackpack(backpackUid);
Collection<String> oreDictDefaults = backpackOreDictRegexpDefaults.get(backpackUid);
for (int oreId : backpackDefinition.getValidOreIds()) {
String oreName = OreDictionary.getOreName(oreId);
oreDictDefaults.add(oreName);
}
backpackItemDefaults.get(backpackUid).addAll(backpackDefinition.getValidItemStacks());
}
}
// Should be ore dicted in Forge at some point.
private static void registerFenceAndFenceGatesToOreDict() {
OreDictionary.registerOre(OreDictUtil.FENCE_WOOD, Blocks.OAK_FENCE);
OreDictionary.registerOre(OreDictUtil.FENCE_WOOD, Blocks.SPRUCE_FENCE);
OreDictionary.registerOre(OreDictUtil.FENCE_WOOD, Blocks.BIRCH_FENCE);
OreDictionary.registerOre(OreDictUtil.FENCE_WOOD, Blocks.JUNGLE_FENCE);
OreDictionary.registerOre(OreDictUtil.FENCE_WOOD, Blocks.DARK_OAK_FENCE);
OreDictionary.registerOre(OreDictUtil.FENCE_WOOD, Blocks.ACACIA_FENCE);
OreDictionary.registerOre(OreDictUtil.FENCE_GATE_WOOD, Blocks.OAK_FENCE_GATE);
OreDictionary.registerOre(OreDictUtil.FENCE_GATE_WOOD, Blocks.SPRUCE_FENCE_GATE);
OreDictionary.registerOre(OreDictUtil.FENCE_GATE_WOOD, Blocks.BIRCH_FENCE_GATE);
OreDictionary.registerOre(OreDictUtil.FENCE_GATE_WOOD, Blocks.JUNGLE_FENCE_GATE);
OreDictionary.registerOre(OreDictUtil.FENCE_GATE_WOOD, Blocks.DARK_OAK_FENCE_GATE);
OreDictionary.registerOre(OreDictUtil.FENCE_GATE_WOOD, Blocks.ACACIA_FENCE_GATE);
}
@Nonnull
@@ -56,7 +56,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesSteadfast"
"speciesUid": "forestry.speciesSteadfast"
}
],
"weight": 1
@@ -10,7 +10,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.treeAcacia"
"speciesUid": "forestry.treeAcacia"
}
],
"weight": 1
@@ -56,7 +56,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesSteadfast"
"speciesUid": "forestry.speciesSteadfast"
}
],
"weight": 1
@@ -68,7 +68,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesModest"
"speciesUid": "forestry.speciesModest"
},
{
"function": "set_count",
@@ -35,7 +35,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesSteadfast"
"speciesUid": "forestry.speciesSteadfast"
},
{
"function": "set_count",
@@ -54,7 +54,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesSteadfast"
"speciesUid": "forestry.speciesSteadfast"
}
],
"weight": 1
@@ -66,7 +66,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesEnded"
"speciesUid": "forestry.speciesEnded"
},
{
"function": "set_count",
@@ -11,7 +11,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesSteadfast"
"speciesUid": "forestry.speciesSteadfast"
}
],
"weight": 1
@@ -23,7 +23,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesWintry"
"speciesUid": "forestry.speciesWintry"
},
{
"function": "set_count",
@@ -11,7 +11,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesSteadfast"
"speciesUid": "forestry.speciesSteadfast"
}
],
"weight": 1
@@ -23,7 +23,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesTropical"
"speciesUid": "forestry.speciesTropical"
},
{
"function": "set_count",
@@ -51,7 +51,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.treeSipiri"
"speciesUid": "forestry.treeSipiri"
}
],
"weight": 1
@@ -11,7 +11,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesSteadfast"
"speciesUid": "forestry.speciesSteadfast"
}
],
"weight": 1
@@ -23,7 +23,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesSinister"
"speciesUid": "forestry.speciesSinister"
}
],
"weight": 1
@@ -11,7 +11,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesSteadfast"
"speciesUid": "forestry.speciesSteadfast"
}
],
"weight": 1
@@ -11,7 +11,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesSteadfast"
"speciesUid": "forestry.speciesSteadfast"
}
],
"weight": 1
@@ -11,7 +11,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesSteadfast"
"speciesUid": "forestry.speciesSteadfast"
}
],
"weight": 1
@@ -11,7 +11,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesSteadfast"
"speciesUid": "forestry.speciesSteadfast"
}
],
"weight": 1
@@ -23,7 +23,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesMonastic"
"speciesUid": "forestry.speciesMonastic"
}
],
"weight": 6
@@ -55,7 +55,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesForest"
"speciesUid": "forestry.speciesForest"
}
],
"weight": 6
@@ -67,7 +67,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesCommon"
"speciesUid": "forestry.speciesCommon"
}
],
"weight": 6
@@ -79,7 +79,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.speciesMeadows"
"speciesUid": "forestry.speciesMeadows"
}
],
"weight": 6
@@ -106,7 +106,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.treeLime"
"speciesUid": "forestry.treeLime"
},
{
"function": "set_count",
@@ -125,7 +125,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.treeCherry"
"speciesUid": "forestry.treeCherry"
},
{
"function": "set_count",
@@ -144,7 +144,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.treeLarch"
"speciesUid": "forestry.treeLarch"
},
{
"function": "set_count",
@@ -163,7 +163,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.treeTeak"
"speciesUid": "forestry.treeTeak"
},
{
"function": "set_count",
@@ -179,7 +179,7 @@
"functions": [
{
"function": "set_species_nbt",
"speciesUid": "Forestry.treePadauk"
"speciesUid": "forestry.treePadauk"
},
{
"function": "set_count",