Update for 1.11. Missing assets, unstable.

This commit is contained in:
mezz committed 2016-12-22 16:47:56 -08:00
1 parent 30d7365518
commit 9611ae08ae
1145 files changed
+15561 -18107

No files matched your search

@@ -1,5 +1,7 @@
package forestry.plugins.compat;
import javax.annotation.Nullable;
import forestry.api.core.ForestryAPI;
import forestry.api.farming.Farmables;
import forestry.api.farming.ICrop;
@@ -15,15 +17,13 @@ import forestry.plugins.ForestryPluginUids;
import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@ForestryPlugin(pluginID = ForestryPluginUids.IMMERSIVE_ENGINEERING, name = "ImmersiveEngineering", author = "marcin212", url = Constants.URL, unlocalizedDescription = "for.plugin.immersiveengineering.description")
public class PluginImmersiveEngineering extends BlankForestryPlugin {
private static final String IE = "immersiveengineering";
@@ -43,9 +43,9 @@ public class PluginImmersiveEngineering extends BlankForestryPlugin {
ItemStack hempSeed = getItemStack("seed");
Block hempCrop = getBlock("hemp");
int seedAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
IProperty age = hempCrop.getBlockState().getProperties().stream().filter(p -> p.getName().equals("type")).findAny().get();
IProperty age = hempCrop.getBlockState().getProperties().stream().filter(p -> p.getName().equals("type")).findAny().orElseGet(null);
if (hempSeed != null && hempCrop != null && age != null) {
if (hempSeed != null && hempCrop != Blocks.AIR && age != null) {
IBlockState planted = hempCrop.getDefaultState().withProperty(age, (Comparable) age.parseValue("bottom0").get());
IBlockState mature = hempCrop.getDefaultState().withProperty(age, (Comparable) age.parseValue("top0").get());
Farmables.farmables.get("farmWheat").add(new FarmableBase(hempSeed, planted, mature, false) {
@@ -59,11 +59,12 @@ public class PluginImmersiveEngineering extends BlankForestryPlugin {
}
});
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{hempSeed}, Fluids.SEED_OIL.getFluid(seedAmount));
RecipeManagers.squeezerManager.addRecipe(10, hempSeed, Fluids.SEED_OIL.getFluid(seedAmount));
}
}
private static Block getBlock(@Nonnull String blockName) {
@Nullable
private static Block getBlock(String blockName) {
ResourceLocation key = new ResourceLocation(IE, blockName);
if (ForgeRegistries.BLOCKS.containsKey(key)) {
return ForgeRegistries.BLOCKS.getValue(key);
@@ -73,7 +74,7 @@ public class PluginImmersiveEngineering extends BlankForestryPlugin {
}
@Nullable
private static ItemStack getItemStack(@Nonnull String itemName, int meta) {
private static ItemStack getItemStack(String itemName, int meta) {
ResourceLocation key = new ResourceLocation(IE, itemName);
if (ForgeRegistries.ITEMS.containsKey(key)) {
return new ItemStack(ForgeRegistries.ITEMS.getValue(key), 1, meta);
@@ -83,7 +84,7 @@ public class PluginImmersiveEngineering extends BlankForestryPlugin {
}
@Nullable
private static ItemStack getItemStack(@Nonnull String itemName) {
private static ItemStack getItemStack(String itemName) {
return getItemStack(itemName, 0);
}
}