Compare commits

...
11 Commits
25 changed files with 278 additions and 49 deletions

No files matched your search

+3 -3
View File
@@ -1,10 +1,10 @@
mcversion=1.9.4
forgeversion=12.17.0.1950
forgeversion=12.17.0.1957
mcp_mappings=snapshot_20160525
jei_version=3.4.0.+
jei_version=3.6.0.+
ic2_version=2.5.5-ex19
version_major=5
version_minor=0
version_patch=9
version_patch=12
+1 -1
Submodule lang updated: 50cc3f6cfc...ac5825bcc9.
+1
View File
@@ -57,6 +57,7 @@ import forestry.plugins.PluginManager;
+ "after:IC2@[2.3.235,);"
+ "after:Natura@[2.2.0,);"
+ "after:HardcoreEnderExpansion;"
+ "after:JEI@[3.6.0,);"
+ "after:basemetals;")
public class Forestry {
@@ -130,16 +130,12 @@ public class PluginApiculture extends BlankForestryPlugin {
public static String beekeepingMode = "NORMAL";
private static float secondPrincessChance = 0;
public static final int ticksPerBeeWorkCycle = 550;
public static boolean fancyRenderedBees = false;
public static ItemRegistryApiculture items;
public static BlockRegistryApiculture blocks;
public static HiveRegistry hiveRegistry;
private final Map<String, String[]> defaultAcceptedFlowers = new HashMap<>();
private final Map<String, String[]> defaultPlantableFlowers = new HashMap<>();
public static VillagerRegistry.VillagerProfession villagerApiarist;
@Override
@@ -275,9 +271,12 @@ public class PluginApiculture extends BlankForestryPlugin {
villagerRegistry.register(villagerApiarist);
ItemStack wildcardPrincess = new ItemStack(items.beePrincessGE, 1);
ItemStack wildcardDrone = new ItemStack(items.beeDroneGE, 1);
ItemStack apiary = new ItemStack(blocks.apiary);
ItemStack provenFrames = items.frameProven.getItemStack();
ItemStack monasticDrone = BeeDefinition.MONASTIC.getMemberStack(EnumBeeType.DRONE);
ItemStack endDrone = BeeDefinition.ENDED.getMemberStack(EnumBeeType.DRONE);
ItemStack propolis = new ItemStack(PluginApiculture.items.propolis,1);
VillagerRegistry.VillagerCareer apiaristCareer = new VillagerRegistry.VillagerCareer(villagerApiarist, "apiarist");
apiaristCareer.addTrade(1,
@@ -287,14 +286,16 @@ public class PluginApiculture extends BlankForestryPlugin {
);
apiaristCareer.addTrade(2,
new VillagerTradeLists.GiveItemForEmeralds(new EntityVillager.PriceInfo(1, 4), new ItemStack(items.smoker), null),
new VillagerTradeLists.GiveItemForLogsAndEmeralds(apiary, new EntityVillager.PriceInfo(1, 1), new EntityVillager.PriceInfo(16, 32), new EntityVillager.PriceInfo(1, 2))
new VillagerTradeLists.GiveItemForLogsAndEmeralds(apiary, new EntityVillager.PriceInfo(1, 1), new EntityVillager.PriceInfo(16, 32), new EntityVillager.PriceInfo(1, 2)),
new VillagerApiaristTrades.GiveRandomHiveDroneForItems(propolis, null, wildcardDrone, new EntityVillager.PriceInfo(2, 4))
);
apiaristCareer.addTrade(3,
new VillagerTradeLists.GiveEmeraldForItems(wildcardPrincess, null),
new VillagerTradeLists.GiveItemForEmeralds(new EntityVillager.PriceInfo(1, 2), provenFrames, new EntityVillager.PriceInfo(1, 6))
);
apiaristCareer.addTrade(4,
new VillagerTradeLists.GiveItemForItemAndEmerald(wildcardPrincess, null, new EntityVillager.PriceInfo(10, 64), monasticDrone, null)
new VillagerTradeLists.GiveItemForItemAndEmerald(wildcardPrincess, null, new EntityVillager.PriceInfo(10, 64), monasticDrone, null),
new VillagerTradeLists.GiveItemForTwoItems(wildcardPrincess, null,new ItemStack(Items.ENDER_EYE),new EntityVillager.PriceInfo(12, 16),endDrone, null)
);
}
@@ -9,6 +9,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.village.MerchantRecipe;
import net.minecraft.village.MerchantRecipeList;
import forestry.api.apiculture.EnumBeeType;
import forestry.apiculture.genetics.BeeDefinition;
public class VillagerApiaristTrades {
public static class GiveRandomCombsForItems implements EntityVillager.ITradeList {
@@ -42,5 +45,46 @@ public class VillagerApiaristTrades {
recipeList.add(new MerchantRecipe(itemToBuy, randomComb));
}
}
public static class GiveRandomHiveDroneForItems implements EntityVillager.ITradeList {
@Nonnull
public ItemStack buyingItemStack;
@Nullable
public EntityVillager.PriceInfo buyingPriceInfo;
@Nonnull
public ItemStack buyingItemStackTwo;
@Nullable
public EntityVillager.PriceInfo buyingPriceItemTwoInfo;
public GiveRandomHiveDroneForItems(
@Nonnull ItemStack buyingItemStack,
@Nullable EntityVillager.PriceInfo buyingPriceInfo,
@Nonnull ItemStack buyingItemStackTwo,
@Nullable EntityVillager.PriceInfo buyingPriceItemTwoInfo) {
this.buyingItemStack = buyingItemStack;
this.buyingPriceInfo = buyingPriceInfo;
this.buyingItemStackTwo = buyingItemStackTwo;
this.buyingPriceItemTwoInfo = buyingPriceItemTwoInfo;
}
@Override
public void modifyMerchantRecipeList(@Nonnull MerchantRecipeList recipeList, @Nonnull Random random) {
int buyAmount = 1;
if (this.buyingPriceInfo != null) {
buyAmount = this.buyingPriceInfo.getPrice(random);
}
int buyTwoAmount = 1;
if (this.buyingPriceItemTwoInfo != null) {
buyTwoAmount = this.buyingPriceItemTwoInfo.getPrice(random);
}
BeeDefinition [] forestryMundane = new BeeDefinition[] { BeeDefinition.FOREST, BeeDefinition.MEADOWS, BeeDefinition.MODEST, BeeDefinition.WINTRY, BeeDefinition.TROPICAL, BeeDefinition.MARSHY };
ItemStack randomHiveDrone = forestryMundane[random.nextInt(forestryMundane.length)].getMemberStack(EnumBeeType.DRONE);
ItemStack buyItemStack = this.buyingItemStack.copy();
buyItemStack.stackSize = buyAmount;
ItemStack buyItemStackTwo = this.buyingItemStackTwo.copy();
buyItemStackTwo.stackSize = buyTwoAmount;
recipeList.add(new MerchantRecipe(buyItemStack, buyItemStackTwo, randomHiveDrone));
}
}
}
@@ -1,15 +1,20 @@
package forestry.apiculture.compat;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import forestry.api.genetics.IAlleleSpecies;
import forestry.apiculture.PluginApiculture;
import forestry.apiculture.genetics.BeeGenome;
import mezz.jei.api.BlankModPlugin;
import mezz.jei.api.IModRegistry;
import mezz.jei.api.INbtRegistry;
import mezz.jei.api.JEIPlugin;
@JEIPlugin
@@ -34,5 +39,21 @@ public class ApicultureJeiPlugin extends BlankModPlugin {
registry.addDescription(new ItemStack(PluginApiculture.items.habitatLocator), "for.jei.description.habitat.locator");
registry.addDescription(new ItemStack(PluginApiculture.items.scoop), "for.jei.description.scoop");
INbtRegistry nbtRegistry = registry.getJeiHelpers().getNbtRegistry();
nbtRegistry.registerNbtInterpreter(PluginApiculture.items.beeDroneGE, BeeNbtInterpreter.INSTANCE);
nbtRegistry.registerNbtInterpreter(PluginApiculture.items.beePrincessGE, BeeNbtInterpreter.INSTANCE);
nbtRegistry.registerNbtInterpreter(PluginApiculture.items.beeQueenGE, BeeNbtInterpreter.INSTANCE);
}
private static class BeeNbtInterpreter implements INbtRegistry.INbtInterpreter {
public static BeeNbtInterpreter INSTANCE = new BeeNbtInterpreter();
@Nullable
@Override
public String getSubtypeInfoFromNbt(@Nonnull NBTTagCompound nbtTagCompound) {
IAlleleSpecies species = BeeGenome.getSpeciesDirectly(nbtTagCompound);
return species == null ? null : species.getUID();
}
}
}
@@ -32,6 +32,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.RecipeSorter;
import forestry.api.circuits.ChipsetManager;
import forestry.api.core.ForestryAPI;
@@ -61,6 +62,7 @@ import forestry.core.network.IPacketRegistry;
import forestry.core.network.PacketRegistryCore;
import forestry.core.proxy.Proxies;
import forestry.core.recipes.RecipeUtil;
import forestry.core.recipes.ShapedRecipeCustom;
import forestry.core.render.TextureManager;
import forestry.core.utils.ClimateUtil;
import forestry.core.utils.ForestryModEnvWarningCallable;
@@ -133,6 +135,8 @@ public class PluginCore extends BlankForestryPlugin {
AlleleHelper.instance.init();
Proxies.render.initRendering();
RecipeSorter.register("forestry:shaped", ShapedRecipeCustom.class, RecipeSorter.Category.SHAPED, "");
}
@Override
+18 -10
View File
@@ -10,6 +10,16 @@
******************************************************************************/
package forestry.core;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.registry.GameRegistry;
import forestry.api.core.ForestryAPI;
import forestry.api.fuels.FuelManager;
import forestry.api.fuels.GeneratorFuel;
@@ -23,14 +33,6 @@ import forestry.core.utils.Log;
import forestry.plugins.BlankForestryPlugin;
import forestry.plugins.ForestryPlugin;
import forestry.plugins.ForestryPluginUids;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.registry.GameData;
import net.minecraftforge.fml.common.registry.GameRegistry;
@ForestryPlugin(pluginID = ForestryPluginUids.FLUIDS, name = "Fluids", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.plugin.fluids.description")
public class PluginFluids extends BlankForestryPlugin {
@@ -62,14 +64,20 @@ public class PluginFluids extends BlankForestryPlugin {
if (fluidBlock != null) {
String name = "fluid." + forestryFluid.getTag();
fluidBlock.setUnlocalizedName("forestry." + name);
GameRegistry.registerBlock(fluidBlock, ItemBlock.class, name);
fluidBlock.setRegistryName(name);
GameRegistry.register(fluidBlock);
ItemBlock itemBlock = new ItemBlock(fluidBlock);
itemBlock.setRegistryName(name);
GameRegistry.register(itemBlock);
Proxies.render.registerFluidStateMapper(fluidBlock, forestryFluid);
if (forestryFluid.getOtherContainers().isEmpty()) {
FluidRegistry.addBucketForFluid(fluid);
}
}
} else {
ResourceLocation resourceLocation = GameData.getBlockRegistry().getNameForObject(fluidBlock);
ResourceLocation resourceLocation = ForgeRegistries.BLOCKS.getKey(fluidBlock);
Log.warning("Pre-existing {} fluid block detected, deferring to {}:{}, "
+ "this may cause issues if the server/client have different mod load orders, "
+ "recommended that you disable all but one instance of {} fluid blocks via your configs.", fluid.getName(), resourceLocation.getResourceDomain(), resourceLocation.getResourcePath(), fluid.getName());
@@ -115,11 +115,15 @@ public abstract class Genome implements IGenome {
* Quickly gets the species without loading the whole genome.
* We need this because the client uses the species for rendering.
*/
protected static IAlleleSpecies getSpeciesDirectly(ItemStack itemStack) {
public static IAlleleSpecies getSpeciesDirectly(ItemStack itemStack) {
NBTTagCompound nbtTagCompound = itemStack.getTagCompound();
if (nbtTagCompound == null) {
return null;
}
return getSpeciesDirectly(nbtTagCompound);
}
public static IAlleleSpecies getSpeciesDirectly(@Nonnull NBTTagCompound nbtTagCompound) {
NBTTagCompound genomeNBT = nbtTagCompound.getCompoundTag("Genome");
if (genomeNBT == null) {
@@ -12,11 +12,54 @@ package forestry.core.tiles;
import javax.annotation.Nonnull;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fluids.capability.IFluidTankProperties;
import forestry.core.fluids.ITankManager;
public interface ILiquidTankTile extends ILocatable {
public interface ILiquidTankTile extends ILocatable, IFluidHandler {
@Nonnull
ITankManager getTankManager();
@Override
default int fill(EnumFacing from, FluidStack resource, boolean doFill) {
return getTankManager().fill(resource, doFill);
}
@Override
default FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) {
return getTankManager().drain(resource, doDrain);
}
@Override
default FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) {
return getTankManager().drain(maxDrain, doDrain);
}
@Override
default boolean canFill(EnumFacing from, Fluid fluid) {
return getTankManager().canFillFluidType(new FluidStack(fluid, Fluid.BUCKET_VOLUME));
}
@Override
default boolean canDrain(EnumFacing from, Fluid fluid) {
return getTankManager().canDrainFluidType(new FluidStack(fluid, Fluid.BUCKET_VOLUME));
}
@Override
default FluidTankInfo[] getTankInfo(EnumFacing from) {
IFluidTankProperties[] tankProperties = getTankManager().getTankProperties();
FluidTankInfo[] tankInfos = new FluidTankInfo[tankProperties.length];
for (int i = 0; i < tankProperties.length; i++) {
IFluidTankProperties fluidTankProperties = tankProperties[i];
tankInfos[i] = new FluidTankInfo(fluidTankProperties.getContents(), fluidTankProperties.getCapacity());
}
return tankInfos;
}
}
@@ -23,12 +23,12 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.FMLControlledNamespacedRegistry;
import net.minecraftforge.fml.common.registry.GameData;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.registry.IForgeRegistry;
import net.minecraftforge.oredict.OreDictionary;
public abstract class ItemStackUtil {
@@ -68,8 +68,8 @@ public abstract class ItemStackUtil {
if (item == null) {
return null;
}
FMLControlledNamespacedRegistry<Item> itemRegistry = GameData.getItemRegistry();
return itemRegistry.getNameForObject(item);
IForgeRegistry<Item> itemRegistry = ForgeRegistries.ITEMS;
return itemRegistry.getKey(item);
}
/**
@@ -125,12 +125,8 @@ public abstract class ItemStackUtil {
if (itemName == null) {
return null;
}
FMLControlledNamespacedRegistry<Item> itemRegistry = GameData.getItemRegistry();
int registryID = itemRegistry.getId(itemName);
if (registryID == -1) {
return null;
}
return itemRegistry.getRaw(registryID);
IForgeRegistry<Item> itemRegistry = ForgeRegistries.ITEMS;
return itemRegistry.getValue(itemName);
}
/**
@@ -141,8 +137,8 @@ public abstract class ItemStackUtil {
if (block == null) {
return null;
}
FMLControlledNamespacedRegistry<Block> blockRegistry = GameData.getBlockRegistry();
return blockRegistry.getNameForObject(block);
IForgeRegistry<Block> blockRegistry = ForgeRegistries.BLOCKS;
return blockRegistry.getKey(block);
}
/**
@@ -169,12 +165,8 @@ public abstract class ItemStackUtil {
if (itemName == null) {
return null;
}
FMLControlledNamespacedRegistry<Block> blockRegistry = GameData.getBlockRegistry();
int registryID = blockRegistry.getId(itemName);
if (registryID == -1) {
return null;
}
return blockRegistry.getRaw(registryID);
IForgeRegistry<Block> blockRegistry = ForgeRegistries.BLOCKS;
return blockRegistry.getValue(itemName);
}
/**
@@ -174,4 +174,59 @@ public class VillagerTradeLists {
recipeList.add(new MerchantRecipe(randomLog, new ItemStack(Items.EMERALD, emeraldsAmount), itemToSell));
}
}
public static class GiveItemForTwoItems implements EntityVillager.ITradeList {
@Nonnull
public ItemStack buyingItemStack;
@Nullable
public EntityVillager.PriceInfo buyingPriceInfo;
@Nonnull
public ItemStack buyingItemStackTwo;
@Nullable
public EntityVillager.PriceInfo buyingPriceItemTwoInfo;
@Nonnull
public ItemStack sellingItemstack;
@Nullable
public EntityVillager.PriceInfo sellingPriceInfo;
public GiveItemForTwoItems(
@Nonnull ItemStack buyingItemStack,
@Nullable EntityVillager.PriceInfo buyingPriceInfo,
@Nonnull ItemStack buyingItemStackTwo,
@Nullable EntityVillager.PriceInfo buyingPriceItemTwoInfo,
@Nonnull ItemStack sellingItemstack,
@Nullable EntityVillager.PriceInfo sellingPriceInfo) {
this.buyingItemStack = buyingItemStack;
this.buyingPriceInfo = buyingPriceInfo;
this.buyingItemStackTwo = buyingItemStackTwo;
this.buyingPriceItemTwoInfo = buyingPriceItemTwoInfo;
this.sellingItemstack = sellingItemstack;
this.sellingPriceInfo = sellingPriceInfo;
}
@Override
public void modifyMerchantRecipeList(MerchantRecipeList recipeList, Random random) {
int buyAmount = 1;
if (this.buyingPriceInfo != null) {
buyAmount = this.buyingPriceInfo.getPrice(random);
}
int buyTwoAmount = 1;
if (this.buyingPriceItemTwoInfo != null) {
buyTwoAmount = this.buyingPriceItemTwoInfo.getPrice(random);
}
int sellAmount = 1;
if (this.sellingPriceInfo != null) {
sellAmount = this.sellingPriceInfo.getPrice(random);
}
ItemStack buyItemStack = this.buyingItemStack.copy();
buyItemStack.stackSize = buyAmount;
ItemStack buyItemStackTwo = this.buyingItemStackTwo.copy();
buyItemStackTwo.stackSize = buyTwoAmount;
ItemStack sellItemStack = this.sellingItemstack.copy();
sellItemStack.stackSize = sellAmount;
recipeList.add(new MerchantRecipe(buyItemStack, buyItemStackTwo, sellItemStack));
}
}
}
@@ -22,6 +22,12 @@ public class BottlerRecipeHandler implements IRecipeHandler<BottlerRecipeWrapper
return ForestryRecipeCategoryUid.BOTTLER;
}
@Nonnull
@Override
public String getRecipeCategoryUid(@Nonnull BottlerRecipeWrapper recipe) {
return ForestryRecipeCategoryUid.BOTTLER;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull BottlerRecipeWrapper recipe) {
@@ -22,6 +22,12 @@ public class CarpenterRecipeHandler implements IRecipeHandler<CarpenterRecipeWra
return ForestryRecipeCategoryUid.CARPENTER;
}
@Nonnull
@Override
public String getRecipeCategoryUid(@Nonnull CarpenterRecipeWrapper recipe) {
return ForestryRecipeCategoryUid.CARPENTER;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull CarpenterRecipeWrapper recipe) {
@@ -24,6 +24,12 @@ public class CentrifugeRecipeHandler implements IRecipeHandler<CentrifugeRecipeW
return ForestryRecipeCategoryUid.CENTRIFUGE;
}
@Nonnull
@Override
public String getRecipeCategoryUid(@Nonnull CentrifugeRecipeWrapper recipe) {
return ForestryRecipeCategoryUid.CENTRIFUGE;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull CentrifugeRecipeWrapper recipe) {
@@ -22,6 +22,12 @@ public class FabricatorRecipeHandler implements IRecipeHandler<FabricatorRecipeW
return ForestryRecipeCategoryUid.FABRICATOR;
}
@Nonnull
@Override
public String getRecipeCategoryUid(@Nonnull FabricatorRecipeWrapper recipe) {
return ForestryRecipeCategoryUid.FABRICATOR;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull FabricatorRecipeWrapper recipe) {
@@ -22,6 +22,12 @@ public class FermenterRecipeHandler implements IRecipeHandler<FermenterRecipeWra
return ForestryRecipeCategoryUid.FERMENTER;
}
@Nonnull
@Override
public String getRecipeCategoryUid(@Nonnull FermenterRecipeWrapper recipe) {
return ForestryRecipeCategoryUid.FERMENTER;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull FermenterRecipeWrapper recipe) {
@@ -22,6 +22,12 @@ public class MoistenerRecipeHandler implements IRecipeHandler<MoistenerRecipeWra
return ForestryRecipeCategoryUid.MOISTENER;
}
@Nonnull
@Override
public String getRecipeCategoryUid(@Nonnull MoistenerRecipeWrapper recipe) {
return ForestryRecipeCategoryUid.MOISTENER;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull MoistenerRecipeWrapper recipe) {
@@ -20,6 +20,12 @@ public class RainmakerRecipeHandler implements IRecipeHandler<RainmakerRecipeWra
return ForestryRecipeCategoryUid.RAINMAKER;
}
@Nonnull
@Override
public String getRecipeCategoryUid(@Nonnull RainmakerRecipeWrapper recipe) {
return ForestryRecipeCategoryUid.RAINMAKER;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull RainmakerRecipeWrapper recipe) {
@@ -31,6 +31,12 @@ public class SqueezerRecipeHandler<R extends ForestryRecipeWrapper> implements I
return ForestryRecipeCategoryUid.SQUEEZER;
}
@Nonnull
@Override
public String getRecipeCategoryUid(@Nonnull R recipe) {
return ForestryRecipeCategoryUid.SQUEEZER;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull R recipe) {
@@ -22,6 +22,12 @@ public class StillRecipeHandler implements IRecipeHandler<StillRecipeWrapper> {
return ForestryRecipeCategoryUid.STILL;
}
@Nonnull
@Override
public String getRecipeCategoryUid(@Nonnull StillRecipeWrapper recipe) {
return ForestryRecipeCategoryUid.STILL;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull StillRecipeWrapper recipe) {
@@ -13,6 +13,7 @@ package forestry.lepidopterology.commands;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.WrongUsageException;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.EntitySelectors;
import forestry.core.commands.CommandHelpers;
import forestry.core.commands.SubCommand;
@@ -43,10 +44,8 @@ public class CommandButterfly extends SubCommand {
CommandHelpers.throwWrongUsage(sender, this);
}
for (Object entity : sender.getEntityWorld().getLoadedEntityList()) {
if (entity instanceof EntityButterfly) {
((EntityButterfly) entity).setDead();
}
for (EntityButterfly butterfly : sender.getEntityWorld().getEntities(EntityButterfly.class, EntitySelectors.IS_ALIVE)) {
butterfly.setDead();
}
}
@@ -131,9 +131,11 @@ public class EntityButterfly extends EntityCreature implements IEntityButterfly
public void writeEntityToNBT(NBTTagCompound nbttagcompound) {
super.writeEntityToNBT(nbttagcompound);
NBTTagCompound bio = new NBTTagCompound();
contained.writeToNBT(bio);
nbttagcompound.setTag("BTFLY", bio);
if (contained != null) {
NBTTagCompound bio = new NBTTagCompound();
contained.writeToNBT(bio);
nbttagcompound.setTag("BTFLY", bio);
}
if (pollen != null) {
NBTTagCompound pln = new NBTTagCompound();
@@ -21,4 +21,5 @@ public class ForestryPluginUids {
public static final String BUILDCRAFT_TRANSPORT = "forestry.buildcraft.transport";
public static final String CHISEL = "forestry.chisel";
public static final String NATURA = "forestry.natura";
public static final String INDUSTRIALCRAFT2 = "forestry.industrialcraft2";
}
@@ -67,7 +67,7 @@ import ic2.api.item.IC2Items;
import ic2.api.recipe.RecipeInputItemStack;
import ic2.api.recipe.Recipes;
@ForestryPlugin(pluginID = "IC2", name = "IndustrialCraft2", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.ic2.description")
@ForestryPlugin(pluginID = ForestryPluginUids.INDUSTRIALCRAFT2, name = "IndustrialCraft2", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.ic2.description")
public class PluginIC2 extends BlankForestryPlugin {
public static final String modId = "IC2";
public static PluginIC2 instance;