mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-15 17:44:55 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d1f64c5f6 | ||
|
|
cd9f82001c | ||
|
|
f7b8435d28 | ||
|
|
013806f158 | ||
|
|
062b5ee75f | ||
|
|
56adc25fdf | ||
|
|
df375b1b30 | ||
|
|
789da29af0 | ||
|
|
e0df2f84a0 | ||
|
|
01656f13a6 | ||
|
|
b466e9ce4a | ||
|
|
60c9dad874 | ||
|
|
d734ca55e6 | ||
|
|
f16f349f10 | ||
|
|
66561ac66d | ||
|
|
ad96e21b37 | ||
|
|
3967d21b06 | ||
|
|
2a025254a0 | ||
|
|
97bfbe2213 | ||
|
|
98c56973db | ||
|
|
b83da5c628 | ||
|
|
4a2af4743f | ||
|
|
e90771e38a | ||
|
|
9c98a6a00b | ||
|
|
75a3a7b935 | ||
|
|
99020cde7f | ||
|
|
98e13299d6 | ||
|
|
010fe4662a | ||
|
|
92ee6dbc0d | ||
|
|
96cc1b869c | ||
|
|
1941690330 | ||
|
|
53f4107ee3 | ||
|
|
22258c2dac | ||
|
|
dd21d83ea3 | ||
|
|
d11034e4aa | ||
|
|
f0099b728f | ||
|
|
c875e8ed5d | ||
|
|
4228ef73d7 | ||
|
|
d8bcab07ba | ||
|
|
2368f05778 | ||
|
|
9c532dd076 | ||
|
|
3de8bac1ad | ||
|
|
abca8b13f3 |
No files matched your search
+1
-1
@@ -2,4 +2,4 @@ mcversion=1.7.10
|
||||
forgeversion=10.13.4.1566-1.7.10
|
||||
version_major=4
|
||||
version_minor=2
|
||||
version_patch=9
|
||||
version_patch=15
|
||||
+1
-1
Submodule lang updated: cb5900228e...4cfdcf1595.
@@ -49,6 +49,7 @@ public class VillageHandlerApiculture implements IVillageCreationHandler, IVilla
|
||||
@Override
|
||||
public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
|
||||
ItemStack wildcardPrincess = new ItemStack(PluginApiculture.items.beePrincessGE, 1, OreDictionary.WILDCARD_VALUE);
|
||||
ItemStack wildcardDrone = new ItemStack(PluginApiculture.items.beeDroneGE, 4, OreDictionary.WILDCARD_VALUE);
|
||||
recipeList.add(new MerchantRecipe(wildcardPrincess, new ItemStack(Items.emerald, 1)));
|
||||
|
||||
ItemStack randomComb = PluginApiculture.items.beeComb.getRandomComb(1, random, false);
|
||||
@@ -62,6 +63,23 @@ public class VillageHandlerApiculture implements IVillageCreationHandler, IVilla
|
||||
|
||||
ItemStack monasticDrone = BeeDefinition.MONASTIC.getMemberStack(EnumBeeType.DRONE);
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 12), wildcardPrincess, monasticDrone));
|
||||
|
||||
ItemStack endDrone = BeeDefinition.ENDED.getMemberStack(EnumBeeType.DRONE);
|
||||
recipeList.add(new MerchantRecipe(new ItemStack(Items.ender_eye, 16), wildcardPrincess, endDrone));
|
||||
|
||||
ItemStack propolis = new ItemStack(PluginApiculture.items.propolis,1);
|
||||
ItemStack forestDrone = BeeDefinition.FOREST.getMemberStack(EnumBeeType.DRONE);
|
||||
ItemStack meadowsDrone = BeeDefinition.MEADOWS.getMemberStack(EnumBeeType.DRONE);
|
||||
ItemStack modestDrone = BeeDefinition.MODEST.getMemberStack(EnumBeeType.DRONE);
|
||||
ItemStack tropicalDrone = BeeDefinition.TROPICAL.getMemberStack(EnumBeeType.DRONE);
|
||||
ItemStack wintryDrone = BeeDefinition.WINTRY.getMemberStack(EnumBeeType.DRONE);
|
||||
ItemStack marshyDrone = BeeDefinition.MARSHY.getMemberStack(EnumBeeType.DRONE);
|
||||
recipeList.add(new MerchantRecipe(propolis, wildcardDrone, forestDrone));
|
||||
recipeList.add(new MerchantRecipe(propolis, wildcardDrone, meadowsDrone));
|
||||
recipeList.add(new MerchantRecipe(propolis, wildcardDrone, modestDrone));
|
||||
recipeList.add(new MerchantRecipe(propolis, wildcardDrone, tropicalDrone));
|
||||
recipeList.add(new MerchantRecipe(propolis, wildcardDrone, wintryDrone));
|
||||
recipeList.add(new MerchantRecipe(propolis, wildcardDrone, marshyDrone));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ package forestry.apiculture.genetics;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -33,9 +34,17 @@ public class JubilanceRequiresResource implements IJubilanceProvider {
|
||||
public boolean isJubilant(IAlleleBeeSpecies species, IBeeGenome genome, IBeeHousing housing) {
|
||||
World world = housing.getWorld();
|
||||
ChunkCoordinates housingCoords = housing.getCoordinates();
|
||||
Block block;
|
||||
TileEntity tile;
|
||||
int meta;
|
||||
int i = 1;
|
||||
do {
|
||||
block = world.getBlock(housingCoords.posX, housingCoords.posY - i, housingCoords.posZ);
|
||||
meta = world.getBlockMetadata(housingCoords.posX, housingCoords.posY - i, housingCoords.posZ);
|
||||
tile = world.getTileEntity(housingCoords.posX, housingCoords.posY - i, housingCoords.posZ);
|
||||
i++;
|
||||
} while (tile instanceof IBeeHousing);
|
||||
|
||||
Block block = world.getBlock(housingCoords.posX, housingCoords.posY - 1, housingCoords.posZ);
|
||||
int meta = world.getBlockMetadata(housingCoords.posX, housingCoords.posY - 1, housingCoords.posZ);
|
||||
return ItemStackUtil.equals(block, meta, blockRequired);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class AlleleEffectRadioactive extends AlleleEffectThrottled {
|
||||
|
||||
// Entities are not attacked if they wear a full set of apiarist's armor.
|
||||
int count = BeeManager.armorApiaristHelper.wearsItems(entity, getUID(), true);
|
||||
damage -= count;
|
||||
damage -= (count * 2);
|
||||
if (damage <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import forestry.api.core.BiomeHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -359,8 +360,11 @@ public class AlvearyController extends RectangularMultiblockControllerBase imple
|
||||
@Override
|
||||
public EnumTemperature getTemperature() {
|
||||
IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(this);
|
||||
if (beeModifier.isHellish() && tempChange >= 0) {
|
||||
return EnumTemperature.HELLISH;
|
||||
BiomeGenBase biome = getBiome();
|
||||
if (beeModifier.isHellish() || BiomeHelper.isBiomeHellish(biome)) {
|
||||
if (tempChange >= 0) {
|
||||
return EnumTemperature.HELLISH;
|
||||
}
|
||||
}
|
||||
|
||||
return EnumTemperature.getFromValue(getExactTemperature());
|
||||
|
||||
@@ -211,7 +211,31 @@ public enum Fluids {
|
||||
@Override
|
||||
public EnumSet<EnumContainerType> getContainerTypes() {
|
||||
return EnumSet.of(
|
||||
EnumContainerType.BUCKET
|
||||
EnumContainerType.BUCKET,
|
||||
EnumContainerType.CAN,
|
||||
EnumContainerType.CAPSULE,
|
||||
EnumContainerType.REFRACTORY
|
||||
);
|
||||
}
|
||||
},
|
||||
MEAD("Mead", new Color(202, 102, 0), 1000, 1200) {
|
||||
@Override
|
||||
public String getTag() {
|
||||
return "mead";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block makeBlock() {
|
||||
return new BlockForestryFluid(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<EnumContainerType> getContainerTypes() {
|
||||
return EnumSet.of(
|
||||
EnumContainerType.BUCKET,
|
||||
EnumContainerType.CAN,
|
||||
EnumContainerType.CAPSULE,
|
||||
EnumContainerType.REFRACTORY
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -260,7 +284,7 @@ public enum Fluids {
|
||||
CREOSOTE(new Color(0x635c03)),
|
||||
STEAM(new Color(0x91938F));
|
||||
|
||||
public static final Fluids[] forestryFluids = {ETHANOL, BIOMASS, GLASS, HONEY, LEGACY_HONEY, ICE, JUICE, MILK, SEEDOIL, SHORT_MEAD};
|
||||
public static final Fluids[] forestryFluids = {ETHANOL, BIOMASS, GLASS, HONEY, LEGACY_HONEY, ICE, JUICE, MILK, SEEDOIL, SHORT_MEAD, MEAD};
|
||||
|
||||
private static final Map<String, Fluids> tagToFluid = new HashMap<>();
|
||||
|
||||
|
||||
Executable → Regular
-1
@@ -148,7 +148,6 @@ public abstract class SpeciesRoot implements ISpeciesRoot {
|
||||
return chromosomes;
|
||||
}
|
||||
|
||||
/* BREEDING TRACKER */
|
||||
@Override
|
||||
public void syncBreedingTrackerToPlayer(EntityPlayer player) {
|
||||
getBreedingTracker(player.worldObj, player.getGameProfile()).synchToPlayer(player);
|
||||
|
||||
+4
-1
@@ -12,6 +12,7 @@ package forestry.core.genetics.mutations;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
@@ -32,13 +33,15 @@ public class MutationConditionRequiresResource implements IMutationCondition {
|
||||
@Override
|
||||
public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) {
|
||||
Block block;
|
||||
TileEntity tile;
|
||||
int meta;
|
||||
int i = 1;
|
||||
do {
|
||||
block = world.getBlock(x, y - i, z);
|
||||
meta = world.getBlockMetadata(x, y - i, z);
|
||||
tile = world.getTileEntity(x, y - i, z);
|
||||
i++;
|
||||
} while (block instanceof IBeeHousing);
|
||||
} while (tile instanceof IBeeHousing);
|
||||
|
||||
return ItemStackUtil.equals(block, meta, blockRequired) ? 1 : 0;
|
||||
}
|
||||
|
||||
+4
-1
@@ -14,6 +14,7 @@ import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
@@ -44,12 +45,14 @@ public class MutationConditionRequiresResourceOreDict implements IMutationCondit
|
||||
public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) {
|
||||
Block block;
|
||||
int meta;
|
||||
TileEntity tile;
|
||||
int i = 1;
|
||||
do {
|
||||
block = world.getBlock(x, y - i, z);
|
||||
meta = world.getBlockMetadata(x, y - i, z);
|
||||
tile = world.getTileEntity(x, y-i, z);
|
||||
i++;
|
||||
} while (block instanceof IBeeHousing);
|
||||
} while (tile instanceof IBeeHousing);
|
||||
|
||||
int[] oreIds = OreDictionary.getOreIDs(new ItemStack(block, 1, meta));
|
||||
for (int oreId : oreIds) {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class SlotWorking extends SlotForestry {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getHasStack() {
|
||||
public boolean canTakeStack(EntityPlayer stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -407,6 +407,22 @@ public abstract class InventoryUtil {
|
||||
return ((float) amount / (float) stackMax) >= percent;
|
||||
}
|
||||
|
||||
public static boolean containsAmount(IInventory inventory, int amount) {
|
||||
int total = 0;
|
||||
int slot1 = 0;
|
||||
int length = inventory.getSizeInventory();
|
||||
for (ItemStack itemStack : getStacks(inventory, slot1, length)) {
|
||||
if (itemStack == null) {
|
||||
continue;
|
||||
}
|
||||
total += itemStack.stackSize;
|
||||
if (total >= amount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isEmpty(IInventory inventory, int slotStart, int slotCount) {
|
||||
for (int i = slotStart; i < slotStart + slotCount; i++) {
|
||||
if (inventory.getStackInSlot(i) != null) {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.energy.gui;
|
||||
|
||||
import forestry.core.network.packets.PacketGuiUpdate;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
|
||||
@@ -36,13 +37,9 @@ public class ContainerEngineElectric extends ContainerSocketed<TileEngineElectri
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
if (tile == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (Object crafter : crafters) {
|
||||
tile.sendGUINetworkData(this, (ICrafting) crafter);
|
||||
if (tile != null) {
|
||||
PacketGuiUpdate packet = new PacketGuiUpdate(tile);
|
||||
sendPacketToCrafters(packet);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,13 +10,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.energy.tiles;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.CircuitSocketType;
|
||||
import forestry.api.circuits.ICircuitBoard;
|
||||
@@ -26,15 +19,25 @@ import forestry.core.circuits.ISocketable;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.errors.EnumErrorCode;
|
||||
import forestry.core.inventory.InventoryAdapter;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.network.IStreamableGui;
|
||||
import forestry.core.tiles.TemperatureState;
|
||||
import forestry.core.tiles.TileEngine;
|
||||
import forestry.energy.gui.ContainerEngineElectric;
|
||||
import forestry.energy.gui.GuiEngineElectric;
|
||||
import forestry.plugins.compat.PluginIC2;
|
||||
|
||||
import ic2.api.energy.prefab.BasicSink;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class TileEngineElectric extends TileEngine implements ISocketable, IInventory {
|
||||
import java.io.IOException;
|
||||
|
||||
public class TileEngineElectric extends TileEngine implements ISocketable, IInventory, IStreamableGui {
|
||||
protected static class EuConfig {
|
||||
|
||||
public int euForCycle;
|
||||
@@ -92,6 +95,32 @@ public class TileEngineElectric extends TileEngine implements ISocketable, IInve
|
||||
sockets.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeGuiData(DataOutputStreamForestry data) throws IOException {
|
||||
data.writeVarInt(currentOutput);
|
||||
data.writeVarInt(heat);
|
||||
sockets.writeData(data);
|
||||
energyManager.writeData(data);
|
||||
final boolean hasIc2EnergySink = (ic2EnergySink != null);
|
||||
data.writeBoolean(hasIc2EnergySink);
|
||||
if (hasIc2EnergySink) {
|
||||
data.writeVarInt((int) ic2EnergySink.getEnergyStored());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readGuiData(DataInputStreamForestry data) throws IOException {
|
||||
currentOutput = data.readVarInt();
|
||||
heat = data.readVarInt();
|
||||
sockets.readData(data);
|
||||
energyManager.readData(data);
|
||||
final boolean hasIc2EnergySink = data.readBoolean();
|
||||
if (hasIc2EnergySink) {
|
||||
final int energyStored = data.readVarInt();
|
||||
ic2EnergySink.setEnergyStored(energyStored);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
if (ic2EnergySink != null) {
|
||||
@@ -219,35 +248,12 @@ public class TileEngineElectric extends TileEngine implements ISocketable, IInve
|
||||
// / SMP GUI
|
||||
@Override
|
||||
public void getGUINetworkData(int i, int j) {
|
||||
|
||||
switch (i) {
|
||||
|
||||
case 0:
|
||||
currentOutput = j;
|
||||
break;
|
||||
case 1:
|
||||
energyManager.fromGuiInt(j);
|
||||
break;
|
||||
case 2:
|
||||
heat = j;
|
||||
break;
|
||||
case 3:
|
||||
if (ic2EnergySink != null) {
|
||||
ic2EnergySink.setEnergyStored(j);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// handled by IStreamableGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendGUINetworkData(Container containerEngine, ICrafting iCrafting) {
|
||||
iCrafting.sendProgressBarUpdate(containerEngine, 0, currentOutput);
|
||||
iCrafting.sendProgressBarUpdate(containerEngine, 1, energyManager.toGuiInt());
|
||||
iCrafting.sendProgressBarUpdate(containerEngine, 2, heat);
|
||||
if (ic2EnergySink != null) {
|
||||
iCrafting.sendProgressBarUpdate(containerEngine, 3, (short) ic2EnergySink.getEnergyStored());
|
||||
}
|
||||
// handled by IStreamableGui
|
||||
}
|
||||
|
||||
// / ENERGY CONFIG CHANGE
|
||||
|
||||
@@ -70,17 +70,21 @@ public class SqueezerRecipeManager implements ISqueezerManager {
|
||||
}
|
||||
}
|
||||
|
||||
// First try to match a specific recipe (without OreDictionary)
|
||||
for (ISqueezerRecipe recipe : recipes) {
|
||||
if (ItemStackUtil.containsSets(recipe.getResources(), items, false, false) > 0) {
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
|
||||
// If that fails - try again with OreDictionary support enabled
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ISqueezerRecipe findRecipeWithIngredient(ItemStack ingredient) {
|
||||
for (ISqueezerRecipe recipe : recipes) {
|
||||
if (ItemStackUtil.containsSets(recipe.getResources(), items, true, false) > 0) {
|
||||
return recipe;
|
||||
for (ItemStack recipeIngredient : recipe.getResources()) {
|
||||
if (ItemStackUtil.isCraftingEquivalent(recipeIngredient, ingredient, false, false)) {
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -246,11 +246,9 @@ public class NEIHandlerSqueezer extends RecipeHandlerBase {
|
||||
return;
|
||||
}
|
||||
|
||||
ISqueezerRecipe recipe = SqueezerRecipeManager.findMatchingRecipe(new ItemStack[]{ingred});
|
||||
ISqueezerRecipe recipe = SqueezerRecipeManager.findRecipeWithIngredient(ingred);
|
||||
if (recipe != null) {
|
||||
CachedSqueezerRecipe crecipe = new CachedSqueezerRecipe(recipe);
|
||||
// Override recipe to show the right input in case it's OD
|
||||
crecipe.setIngredients(new ItemStack[]{ingred});
|
||||
this.arecipes.add(crecipe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ package forestry.farming.logic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -47,6 +48,7 @@ public class CropBasicAgriCraft extends Crop {
|
||||
harvest.remove(0);
|
||||
Proxies.common.addBlockDestroyEffects(world, pos.x, pos.y, pos.z, Blocks.melon_block, 0);
|
||||
world.setBlockMetadataWithNotify(pos.x, pos.y, pos.z, 0, Constants.FLAG_BLOCK_SYNCH);
|
||||
harvest.removeAll(Collections.singleton(null)); //sanatize nulls that get thru from Agricraft+Harvestcraft (sesameseed)
|
||||
return harvest;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,9 @@ import forestry.core.utils.InventoryUtil;
|
||||
import forestry.core.utils.PlayerUtil;
|
||||
import forestry.core.utils.SlotUtil;
|
||||
import forestry.plugins.PluginCore;
|
||||
import forestry.plugins.PluginManager;
|
||||
|
||||
import ic2.api.item.IC2Items;
|
||||
|
||||
public class InventoryFarm extends InventoryAdapterRestricted implements IFarmInventory {
|
||||
public static final int SLOT_RESOURCES_1 = 0;
|
||||
@@ -132,8 +135,14 @@ public class InventoryFarm extends InventoryAdapterRestricted implements IFarmIn
|
||||
if (itemstack == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Item item = itemstack.getItem();
|
||||
if (PluginManager.Module.INDUSTRIALCRAFT.isEnabled()) {
|
||||
Item ic2fert = IC2Items.getItem("fertilizer").getItem();
|
||||
if (ic2fert == item) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return PluginCore.items.fertilizerCompound == item;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,6 @@ public class TriggerLowFertilizer extends Trigger {
|
||||
|
||||
TileFarmHatch tileHatch = (TileFarmHatch) tile;
|
||||
IInventory fertilizerInventory = tileHatch.getMultiblockLogic().getController().getFarmInventory().getFertilizerInventory();
|
||||
return InventoryUtil.containsPercent(fertilizerInventory, threshold);
|
||||
return !InventoryUtil.containsPercent(fertilizerInventory, threshold);
|
||||
}
|
||||
}
|
||||
@@ -47,6 +47,6 @@ public class TriggerLowGermlings extends Trigger {
|
||||
|
||||
TileFarmHatch tileHatch = (TileFarmHatch) tile;
|
||||
IInventory germlingsInventory = tileHatch.getMultiblockLogic().getController().getFarmInventory().getGermlingsInventory();
|
||||
return InventoryUtil.containsPercent(germlingsInventory, threshold);
|
||||
return !InventoryUtil.containsPercent(germlingsInventory, threshold);
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import forestry.farming.tiles.TileFarmHatch;
|
||||
|
||||
import buildcraft.api.statements.IStatementContainer;
|
||||
import buildcraft.api.statements.IStatementParameter;
|
||||
import buildcraft.api.statements.StatementParameterItemStack;
|
||||
|
||||
public class TriggerLowSoil extends Trigger {
|
||||
|
||||
@@ -49,6 +50,11 @@ public class TriggerLowSoil extends Trigger {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IStatementParameter createParameter(int index) {
|
||||
return new StatementParameterItemStack();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the tile given in parameter activates the trigger, given
|
||||
* the parameters.
|
||||
@@ -67,14 +73,14 @@ public class TriggerLowSoil extends Trigger {
|
||||
TileFarmHatch tileHatch = (TileFarmHatch) tile;
|
||||
IFarmController farmController = tileHatch.getMultiblockLogic().getController();
|
||||
IFarmInventory farmInventory = farmController.getFarmInventory();
|
||||
IInventory resourcesInventory = farmInventory.getResourcesInventory();
|
||||
|
||||
if (parameter == null || parameter.getItemStack() == null) {
|
||||
IInventory resourcesInventory = farmInventory.getResourcesInventory();
|
||||
return InventoryUtil.containsPercent(resourcesInventory, threshold);
|
||||
return !InventoryUtil.containsAmount(resourcesInventory, threshold);
|
||||
} else {
|
||||
ItemStack filter = parameter.getItemStack().copy();
|
||||
filter.stackSize = threshold;
|
||||
return farmInventory.hasResources(new ItemStack[]{filter});
|
||||
return !InventoryUtil.contains(resourcesInventory, new ItemStack[]{filter});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,8 +22,8 @@ import forestry.core.render.TextureManager;
|
||||
|
||||
public enum EnumBeverage implements ItemBeverage.IBeverageInfo {
|
||||
MEAD_SHORT("meadShort", "glass", new Color(0xec9a19), new Color(0xffffff), 1, 0.2f, true),
|
||||
MEAD_CURATIVE("meadCurative", "glass", new Color(0xc5feff), new Color(0xffffff), 1, 0.2f, true);
|
||||
|
||||
MEAD_CURATIVE("meadCurative", "glass", new Color(0xc5feff), new Color(0xffffff), 1, 0.2f, true),
|
||||
MEAD("mead", "glass", new Color(0xcc6600), new Color(0xffffff), 10, 0.1f, true);
|
||||
public static final EnumBeverage[] VALUES = values();
|
||||
|
||||
private final String name;
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.List;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -49,7 +50,7 @@ public class ItemBeverage extends ItemForestryFood {
|
||||
|
||||
public ItemBeverage() {
|
||||
super(1, 0.2f);
|
||||
setMaxStackSize(1);
|
||||
setMaxStackSize(8);
|
||||
this.beverages = EnumBeverage.VALUES;
|
||||
}
|
||||
|
||||
@@ -64,11 +65,18 @@ public class ItemBeverage extends ItemForestryFood {
|
||||
@Override
|
||||
public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) {
|
||||
List<IBeverageEffect> effects = BeverageEffect.loadEffects(itemstack);
|
||||
ItemStack container = new ItemStack(Items.glass_bottle, 1);
|
||||
|
||||
itemstack.stackSize--;
|
||||
if (!entityplayer.inventory.addItemStackToInventory(container)) {
|
||||
entityplayer.dropPlayerItemWithRandomChoice(container, false);
|
||||
} else {
|
||||
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, container);
|
||||
}
|
||||
entityplayer.inventory.markDirty();
|
||||
|
||||
entityplayer.getFoodStats().func_151686_a(this, itemstack);
|
||||
world.playSoundAtEntity(entityplayer, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F);
|
||||
|
||||
if (world.isRemote) {
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
@@ -710,6 +710,8 @@ public class PluginApiculture extends ForestryPlugin {
|
||||
|
||||
// / FERMENTER
|
||||
RecipeManagers.fermenterManager.addRecipe(items.honeydew.getItemStack(), 500, 1.0f, Fluids.SHORT_MEAD.getFluid(1), Fluids.HONEY.getFluid(1));
|
||||
// / STILL
|
||||
RecipeManagers.stillManager.addRecipe(Constants.STILL_DESTILLATION_DURATION, Fluids.SHORT_MEAD.getFluid(10), Fluids.MEAD.getFluid(5));
|
||||
}
|
||||
|
||||
// ANALYZER
|
||||
|
||||
@@ -258,15 +258,14 @@ public class PluginFactory extends ForestryPlugin {
|
||||
|
||||
if (PluginManager.Module.APICULTURE.isEnabled()) {
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.items;
|
||||
FluidStack liquidGlass = Fluids.GLASS.getFluid(Constants.BUCKET_VOLUME);
|
||||
FluidStack liquidGlassX4 = Fluids.GLASS.getFluid(Constants.BUCKET_VOLUME * 4);
|
||||
for (int i = 0; i < 16; i++) {
|
||||
RecipeManagers.fabricatorManager.addRecipe(beeItems.waxCast.getWildcard(), liquidGlass, new ItemStack(Blocks.stained_glass, 4, 15 - i), new Object[]{
|
||||
RecipeManagers.fabricatorManager.addRecipe(beeItems.waxCast.getWildcard(), liquidGlassX4, new ItemStack(Blocks.stained_glass, 4, 15 - i), new Object[]{
|
||||
"#", "X",
|
||||
'#', dyes[i],
|
||||
'X', beeItems.propolis.getWildcard()});
|
||||
}
|
||||
RecipeManagers.fabricatorManager.addRecipe(beeItems.waxCast.getWildcard(), liquidGlassX4, new ItemStack(Blocks.glass, 1, 0), new Object[]{
|
||||
RecipeManagers.fabricatorManager.addRecipe(beeItems.waxCast.getWildcard(), liquidGlassX4, new ItemStack(Blocks.glass, 4, 0), new Object[]{
|
||||
"#", "X",
|
||||
'X', beeItems.propolis.getWildcard()});
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -175,6 +176,11 @@ public class PluginFluids extends ForestryPlugin {
|
||||
public static class FillBucketHook {
|
||||
@SubscribeEvent
|
||||
public void fillBucket(FillBucketEvent event) {
|
||||
ItemStack bucket = event.current;
|
||||
if (bucket == null || bucket.getItem() != Items.bucket) {
|
||||
return;
|
||||
}
|
||||
|
||||
MovingObjectPosition movingObjectPosition = event.target;
|
||||
int x = movingObjectPosition.blockX;
|
||||
int y = movingObjectPosition.blockY;
|
||||
|
||||
@@ -50,6 +50,7 @@ public class PluginFood extends ForestryPlugin {
|
||||
super.preInit();
|
||||
|
||||
LiquidRegistryHelper.registerLiquidContainer(Fluids.SHORT_MEAD, Constants.BUCKET_VOLUME, items.beverage.get(EnumBeverage.MEAD_SHORT, 1), new ItemStack(Items.glass_bottle));
|
||||
LiquidRegistryHelper.registerLiquidContainer(Fluids.MEAD, Constants.BUCKET_VOLUME, items.beverage.get(EnumBeverage.MEAD, 1), new ItemStack(Items.glass_bottle));
|
||||
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.items;
|
||||
if (beeItems != null) {
|
||||
|
||||
@@ -57,6 +57,7 @@ import forestry.plugins.compat.PluginHarvestCraft;
|
||||
import forestry.plugins.compat.PluginIC2;
|
||||
import forestry.plugins.compat.PluginImmersiveEngineering;
|
||||
import forestry.plugins.compat.PluginMagicalCrops;
|
||||
import forestry.plugins.compat.PluginMineFactoryReloaded;
|
||||
import forestry.plugins.compat.PluginNatura;
|
||||
import forestry.plugins.compat.PluginPlantMegaPack;
|
||||
import forestry.plugins.compat.PluginRotaryCraft;
|
||||
@@ -115,6 +116,7 @@ public class PluginManager {
|
||||
IMMERSIVEENGINEERING(new PluginImmersiveEngineering()),
|
||||
INDUSTRIALCRAFT(new PluginIC2()),
|
||||
MAGICALCROPS(new PluginMagicalCrops()),
|
||||
MINEFACTORYRELOADED(new PluginMineFactoryReloaded()),
|
||||
NATURA(new PluginNatura()),
|
||||
PLANTMEGAPACK(new PluginPlantMegaPack()),
|
||||
ROTARYCRAFT(new PluginRotaryCraft()),
|
||||
|
||||
@@ -89,7 +89,8 @@ public class PluginHarvestCraft extends ForestryPlugin {
|
||||
"persimmon",
|
||||
"avocado",
|
||||
"coconut",
|
||||
"durian"
|
||||
"durian",
|
||||
"gooseberry"
|
||||
);
|
||||
|
||||
ImmutableList<String> trees = ImmutableList.of(
|
||||
@@ -112,7 +113,8 @@ public class PluginHarvestCraft extends ForestryPlugin {
|
||||
|
||||
ImmutableList<String> spices = ImmutableList.of(
|
||||
"ginger",
|
||||
"spiceleaf"
|
||||
"spiceleaf",
|
||||
"curryleaf"
|
||||
//"mustardseed" Mustard is inconsistent and annoying.
|
||||
);
|
||||
|
||||
@@ -149,7 +151,8 @@ public class PluginHarvestCraft extends ForestryPlugin {
|
||||
"wintersquash",
|
||||
"zucchini",
|
||||
"bambooshoot",
|
||||
"spinach"
|
||||
"spinach",
|
||||
"waterchestnut"
|
||||
);
|
||||
|
||||
ImmutableList<String> grains = ImmutableList.of(
|
||||
@@ -159,7 +162,8 @@ public class PluginHarvestCraft extends ForestryPlugin {
|
||||
);
|
||||
|
||||
ImmutableList<String> cropNuts = ImmutableList.of(
|
||||
"peanut"
|
||||
"peanut",
|
||||
"sesameseeds"
|
||||
);
|
||||
|
||||
ImmutableList<String> nuts = ImmutableList.of(
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/*******************************************************************************
|
||||
* 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.plugins.compat;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.apiculture.items.EnumPropolis;
|
||||
import forestry.apiculture.items.ItemRegistryApiculture;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
import forestry.plugins.PluginManager;
|
||||
|
||||
@Plugin(pluginID = "MinefactoryReloaded", name = "MineFactoryReloaded", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.minefactoryreloaded.description")
|
||||
public class PluginMineFactoryReloaded extends ForestryPlugin {
|
||||
|
||||
private static final String MFR = "MineFactoryReloaded";
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded(MFR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "MineFactoryReloaded not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
Block rubbersapling = GameRegistry.findBlock(MFR, "rubberwood.sapling");
|
||||
Item saplingItem = GameRegistry.findItem(MFR, "rubberwood.sapling");
|
||||
ItemStack saplingStack = new ItemStack(saplingItem, 1, 0);
|
||||
ItemStack rubberRaw = GameRegistry.findItemStack(MFR,"rubber.raw", 1);
|
||||
GameRegistry.findItemStack(MFR,"rubber.raw", 1);
|
||||
|
||||
if (PluginManager.Module.APICULTURE.isEnabled() && !PluginManager.Module.INDUSTRIALCRAFT.isEnabled()) {
|
||||
if (rubberRaw != null) {
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.items;
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, beeItems.propolis.get(EnumPropolis.NORMAL, 1), ImmutableMap.of(rubberRaw, 1.0f));
|
||||
}
|
||||
}
|
||||
if (rubbersapling != null && rubberRaw != null) {
|
||||
RecipeUtil.addFermenterRecipes(saplingStack, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS);
|
||||
String saplingName = GameData.getItemRegistry().getNameForObject(saplingItem);
|
||||
FMLInterModComms.sendMessage(Constants.MOD, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -67,12 +67,20 @@ public class PluginPlantMegaPack extends ForestryPlugin {
|
||||
|
||||
ImmutableList<String> landCropPlant = ImmutableList.of(
|
||||
"Beet",
|
||||
"BellPepperOrange",
|
||||
"BellPepperRed",
|
||||
"BellPepperYellow",
|
||||
"Broccoli",
|
||||
"Cassava",
|
||||
"Celery",
|
||||
"Corn",
|
||||
"Cucumber",
|
||||
"Eggplant",
|
||||
"GreenBean",
|
||||
"Leek",
|
||||
"Lettuce",
|
||||
"Onion",
|
||||
"Sorrel",
|
||||
"Spinach",
|
||||
"Tomato"
|
||||
);
|
||||
|
||||
@@ -77,7 +77,7 @@ public class PluginWitchery extends ForestryPlugin {
|
||||
|
||||
Item saplingItem = GameRegistry.findItem(Witch, "witchsapling");
|
||||
ItemStack saplingStack = new ItemStack(saplingItem, 1, OreDictionary.WILDCARD_VALUE);
|
||||
RecipeUtil.addFermenterRecipes(saplingStack, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS);
|
||||
RecipeUtil.addFermenterRecipes(saplingStack, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS);
|
||||
String saplingName = GameData.getItemRegistry().getNameForObject(saplingItem);
|
||||
FMLInterModComms.sendMessage(Constants.MOD, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName));
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
@@ -0,0 +1 @@
|
||||
{"animation":{"width":1,"height":32,"frametime":1,"frames":[{"index":0,"time":2},{"index":1,"time":2},{"index":2,"time":2},{"index":3,"time":2},{"index":4,"time":2},{"index":5,"time":2},{"index":6,"time":2},{"index":7,"time":2},{"index":8,"time":2},{"index":9,"time":2},{"index":10,"time":2},{"index":11,"time":2},{"index":12,"time":2},{"index":13,"time":2},{"index":14,"time":2},{"index":15,"time":2},{"index":16,"time":2},{"index":17,"time":2},{"index":18,"time":2},{"index":19,"time":2},{"index":20,"time":2},{"index":21,"time":2},{"index":22,"time":2},{"index":23,"time":2},{"index":24,"time":2},{"index":25,"time":2},{"index":26,"time":2},{"index":27,"time":2},{"index":28,"time":2},{"index":29,"time":2},{"index":30,"time":2},{"index":31,"time":2}]}}
|
||||
Reference in new issue
Block a user