Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ead630aa51 | ||
|
|
85b71c785a | ||
|
|
04cb58dfa2 | ||
|
|
3822e90ada | ||
|
|
af5cb93689 | ||
|
|
6a62024dd4 | ||
|
|
bedb7ffe85 | ||
|
|
4a21641bcd | ||
|
|
21d0b832b9 | ||
|
|
ce9081249f | ||
|
|
f6786cd44a | ||
|
|
a045c18a89 | ||
|
|
d6af85ad77 |
No files matched your search
@@ -7,4 +7,4 @@ ic2_version=2.5.5-ex19
|
||||
|
||||
version_major=5
|
||||
version_minor=0
|
||||
version_patch=13
|
||||
version_patch=16
|
||||
@@ -10,6 +10,9 @@ import javax.annotation.Nonnull;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
|
||||
/**
|
||||
@@ -18,6 +21,7 @@ import forestry.api.core.IModelManager;
|
||||
* There is no default implementation because every sapling has a unique icon.
|
||||
*/
|
||||
public interface IGermlingModelProvider {
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModels(Item item, IModelManager manager, EnumGermlingType type);
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -30,6 +30,4 @@ public interface IModelManager {
|
||||
|
||||
void registerItemModel(Item item, ItemMeshDefinition definition);
|
||||
|
||||
void registerVariant(Item item, ResourceLocation... resources);
|
||||
|
||||
}
|
||||
@@ -14,9 +14,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
@@ -38,6 +36,7 @@ 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.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
@@ -560,9 +559,9 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{items.honeydew.getItemStack()}, honeyDropFluid);
|
||||
|
||||
ItemStack phosphor = PluginCore.items.phosphor.getItemStack(2);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.SAND)}, Fluids.LAVA.getFluid(2000));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.SAND, 1, 1)}, Fluids.LAVA.getFluid(2000));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.DIRT)}, Fluids.LAVA.getFluid(1600));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.SAND)}, new FluidStack(FluidRegistry.WATER, 2000));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.SAND, 1, 1)}, new FluidStack(FluidRegistry.LAVA, 2000));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.DIRT)}, new FluidStack(FluidRegistry.LAVA, 1600));
|
||||
|
||||
// / CARPENTER
|
||||
RecipeManagers.carpenterManager.addRecipe(50, Fluids.FOR_HONEY.getFluid(500), null, PluginCore.items.craftingMaterial.getScentedPaneling(),
|
||||
@@ -571,14 +570,14 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
'J', items.royalJelly,
|
||||
'W', PluginCore.items.beeswax,
|
||||
'P', items.pollenCluster.get(EnumPollenCluster.NORMAL, 1));
|
||||
|
||||
RecipeManagers.carpenterManager.addRecipe(30, Fluids.WATER.getFluid(600), null, blocks.candle.getUnlitCandle(24),
|
||||
|
||||
RecipeManagers.carpenterManager.addRecipe(30, new FluidStack(FluidRegistry.WATER, 600), null, blocks.candle.getUnlitCandle(24),
|
||||
" X ",
|
||||
"###",
|
||||
"###",
|
||||
'#', PluginCore.items.beeswax,
|
||||
'X', Items.STRING);
|
||||
RecipeManagers.carpenterManager.addRecipe(10, Fluids.WATER.getFluid(200), null, blocks.candle.getUnlitCandle(6),
|
||||
RecipeManagers.carpenterManager.addRecipe(10, new FluidStack(FluidRegistry.WATER, 200), null, blocks.candle.getUnlitCandle(6),
|
||||
"#X#",
|
||||
'#', PluginCore.items.beeswax,
|
||||
'X', PluginCore.items.craftingMaterial.getSilkWisp());
|
||||
|
||||
@@ -12,6 +12,7 @@ package forestry.apiculture.genetics;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -47,7 +48,7 @@ public class DefaultBeeModelProvider implements IBeeModelProvider {
|
||||
}
|
||||
|
||||
models[beeType.ordinal()] = manager.getModelLocation(beeTypeNameBase);
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:" + beeTypeNameBase));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:" + beeTypeNameBase));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.util.EnumFacing;
|
||||
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
|
||||
@@ -50,9 +51,9 @@ public class TileAlvearyHygroregulator extends TileAlveary implements IInventory
|
||||
super(BlockAlvearyType.HYGRO);
|
||||
|
||||
this.inventory = new InventoryHygroregulator(this);
|
||||
|
||||
Fluid water = Fluids.WATER.getFluid();
|
||||
Fluid lava = Fluids.LAVA.getFluid();
|
||||
|
||||
Fluid water = FluidRegistry.WATER;
|
||||
Fluid lava = FluidRegistry.LAVA;
|
||||
Fluid liquidIce = Fluids.ICE.getFluid();
|
||||
|
||||
this.liquidTank = new FilteredTank(Constants.PROCESSOR_TANK_CAPACITY).setFilters(water, lava, liquidIce);
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.Random;
|
||||
import net.minecraft.block.BlockDoor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -51,7 +52,7 @@ public class BlockArbDoor extends BlockDoor implements IWoodTyped, IItemModelReg
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodHelper.WoodMeshDefinition(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.block.BlockPlanks.EnumType;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -59,11 +60,6 @@ public class BlockForestryFenceGate<T extends Enum<T> & IWoodType> extends Block
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Material getMaterial(IBlockState state) {
|
||||
return MaterialArbWood.ARB_WOOD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFireproof() {
|
||||
return fireproof;
|
||||
@@ -124,7 +120,7 @@ public class BlockForestryFenceGate<T extends Enum<T> & IWoodType> extends Block
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodMeshDefinition(this));
|
||||
}
|
||||
}
|
||||
@@ -214,17 +214,16 @@ public class BlockForestryLeaves extends BlockLeaves implements ITileEntityProvi
|
||||
|
||||
@Override
|
||||
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) {
|
||||
String speciesUid = TreeDefinition.Oak.getUID();
|
||||
|
||||
TileLeaves leaves = TileUtil.getTile(world, pos, TileLeaves.class);
|
||||
if (leaves == null) {
|
||||
return null;
|
||||
if (leaves != null) {
|
||||
ITree tree = leaves.getTree();
|
||||
if (tree != null) {
|
||||
speciesUid = tree.getGenome().getPrimary().getUID();
|
||||
}
|
||||
}
|
||||
|
||||
ITree tree = leaves.getTree();
|
||||
if (tree == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String speciesUid = tree.getGenome().getPrimary().getUID();
|
||||
|
||||
return Collections.singletonList(PluginArboriculture.blocks.getDecorativeLeaves(speciesUid));
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.Collections;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -38,16 +39,11 @@ public class BlockForestryStairs<T extends Enum<T> & IWoodType> extends BlockSta
|
||||
setHarvestLevel("axe", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Material getMaterial(IBlockState state) {
|
||||
return MaterialArbWood.ARB_WOOD;
|
||||
}
|
||||
|
||||
/* MODELS */
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodHelper.WoodMeshDefinition(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package forestry.arboriculture.blocks;
|
||||
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class MaterialArbWood extends Material {
|
||||
|
||||
public static final Material ARB_WOOD = new MaterialArbWood();
|
||||
|
||||
private MaterialArbWood() {
|
||||
super(MapColor.WOOD);
|
||||
setBurning();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -35,7 +36,6 @@ import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
import forestry.arboriculture.WoodHelper;
|
||||
import forestry.arboriculture.blocks.MaterialArbWood;
|
||||
import forestry.arboriculture.blocks.WoodTypeStateMapper;
|
||||
import forestry.arboriculture.blocks.property.PropertyWoodType;
|
||||
import forestry.core.proxy.Proxies;
|
||||
@@ -48,7 +48,7 @@ public abstract class BlockForestryFence<T extends Enum<T> & IWoodType> extends
|
||||
private final int blockNumber;
|
||||
|
||||
protected BlockForestryFence(boolean fireproof, int blockNumber) {
|
||||
super(MaterialArbWood.ARB_WOOD, BlockPlanks.EnumType.OAK.getMapColor());
|
||||
super(Material.WOOD, BlockPlanks.EnumType.OAK.getMapColor());
|
||||
this.fireproof = fireproof;
|
||||
this.blockNumber = blockNumber;
|
||||
|
||||
@@ -104,7 +104,7 @@ public abstract class BlockForestryFence<T extends Enum<T> & IWoodType> extends
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodHelper.WoodMeshDefinition(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.block.BlockLog;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -29,7 +30,6 @@ import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.WoodHelper;
|
||||
import forestry.arboriculture.blocks.MaterialArbWood;
|
||||
import forestry.arboriculture.blocks.WoodTypeStateMapper;
|
||||
import forestry.arboriculture.blocks.property.PropertyWoodType;
|
||||
import forestry.core.proxy.Proxies;
|
||||
@@ -67,11 +67,6 @@ public abstract class BlockForestryLog<T extends Enum<T> & IWoodType> extends Bl
|
||||
return blockNumber;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Material getMaterial(IBlockState state) {
|
||||
return MaterialArbWood.ARB_WOOD;
|
||||
}
|
||||
|
||||
private static EnumAxis getAxis(int meta) {
|
||||
switch (meta & 12) {
|
||||
case 0:
|
||||
@@ -187,7 +182,7 @@ public abstract class BlockForestryLog<T extends Enum<T> & IWoodType> extends Bl
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public final void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodHelper.WoodMeshDefinition(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,10 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -29,7 +31,6 @@ import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.WoodHelper;
|
||||
import forestry.arboriculture.blocks.MaterialArbWood;
|
||||
import forestry.arboriculture.blocks.WoodTypeStateMapper;
|
||||
import forestry.arboriculture.blocks.property.PropertyWoodType;
|
||||
import forestry.core.proxy.Proxies;
|
||||
@@ -42,7 +43,7 @@ public abstract class BlockForestryPlanks<T extends Enum<T> & IWoodType> extends
|
||||
private final int blockNumber;
|
||||
|
||||
protected BlockForestryPlanks(boolean fireproof, int blockNumber) {
|
||||
super(MaterialArbWood.ARB_WOOD);
|
||||
super(Material.WOOD);
|
||||
this.fireproof = fireproof;
|
||||
this.blockNumber = blockNumber;
|
||||
|
||||
@@ -120,7 +121,7 @@ public abstract class BlockForestryPlanks<T extends Enum<T> & IWoodType> extends
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodHelper.WoodMeshDefinition(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,11 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -30,7 +32,6 @@ import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.WoodHelper;
|
||||
import forestry.arboriculture.blocks.MaterialArbWood;
|
||||
import forestry.arboriculture.blocks.WoodTypeStateMapper;
|
||||
import forestry.arboriculture.blocks.property.PropertyWoodType;
|
||||
import forestry.core.proxy.Proxies;
|
||||
@@ -43,7 +44,7 @@ public abstract class BlockForestrySlab<T extends Enum<T> & IWoodType> extends B
|
||||
private final int blockNumber;
|
||||
|
||||
protected BlockForestrySlab(boolean fireproof, int blockNumber) {
|
||||
super(MaterialArbWood.ARB_WOOD);
|
||||
super(Material.WOOD);
|
||||
this.fireproof = fireproof;
|
||||
this.blockNumber = blockNumber;
|
||||
|
||||
@@ -132,7 +133,7 @@ public abstract class BlockForestrySlab<T extends Enum<T> & IWoodType> extends B
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerVariant(item, WoodHelper.getResourceLocations(this));
|
||||
ModelBakery.registerItemVariants(item, WoodHelper.getResourceLocations(this));
|
||||
manager.registerItemModel(item, new WoodHelper.WoodMeshDefinition(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -12,10 +12,14 @@ package forestry.arboriculture.models;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.arboriculture.EnumGermlingType;
|
||||
import forestry.api.arboriculture.IGermlingModelProvider;
|
||||
import forestry.api.core.IModelManager;
|
||||
@@ -31,14 +35,15 @@ public class ModelProviderGermling implements IGermlingModelProvider {
|
||||
this.name = modelUid.substring("forestry.".length());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModels(Item item, IModelManager manager, EnumGermlingType type) {
|
||||
if(type == EnumGermlingType.SAPLING){
|
||||
germlingModel = manager.getModelLocation("germlings/sapling." + name);
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:germlings/sapling." + name));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:germlings/sapling." + name));
|
||||
}else if(type == EnumGermlingType.POLLEN){
|
||||
pollenModel = manager.getModelLocation("pollen");
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:pollen"));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:pollen"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.arboriculture.render;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import static forestry.arboriculture.multiblock.EnumPilePosition.BACK;
|
||||
import static forestry.arboriculture.multiblock.EnumPilePosition.CORNER_BACK_LEFT;
|
||||
import static forestry.arboriculture.multiblock.EnumPilePosition.CORNER_BACK_RIGHT;
|
||||
@@ -46,8 +48,12 @@ public class CharcoalPileRenderer extends TileEntitySpecialRenderer<TilePile> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TilePile pile, double x, double y, double z, float p_147500_8_, int destroyStage) {
|
||||
public void renderTileEntityAt(@Nonnull TilePile pile, double x, double y, double z, float p_147500_8_, int destroyStage) {
|
||||
IBlockState state = pile.getWorld().getBlockState(pile.getPos());
|
||||
if (!(state.getBlock() instanceof BlockPile)) {
|
||||
return;
|
||||
}
|
||||
|
||||
EnumPilePosition pilePosition = state.getValue(BlockPile.PILE_POSITION);
|
||||
MultiblockLogic<ICharcoalPileControllerInternal> logic = pile.getMultiblockLogic();
|
||||
if (pilePosition != EnumPilePosition.INTERIOR && logic.isConnected() && logic.getController() != null) {
|
||||
|
||||
@@ -17,7 +17,6 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import forestry.core.fluids.Fluids;
|
||||
import net.minecraft.command.ICommand;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -27,6 +26,8 @@ import net.minecraft.world.storage.loot.functions.LootFunctionManager;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.IFuelHandler;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -265,7 +266,7 @@ public class PluginCore extends BlankForestryPlugin {
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FACTORY)) {
|
||||
// / CARPENTER
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Fluids.WATER.getFluid(2000), null, PluginCore.items.portableAlyzer.getItemStack(),
|
||||
RecipeManagers.carpenterManager.addRecipe(100, new FluidStack(FluidRegistry.WATER, 2000), null, PluginCore.items.portableAlyzer.getItemStack(),
|
||||
"X#X", "X#X", "RDR",
|
||||
'#', OreDictUtil.PANE_GLASS,
|
||||
'X', OreDictUtil.INGOT_TIN,
|
||||
@@ -340,9 +341,9 @@ public class PluginCore extends BlankForestryPlugin {
|
||||
int bogEarthOutputCan = ForestryAPI.activeMode.getIntegerSetting("recipe.output.bogearth.can");
|
||||
if (bogEarthOutputCan > 0) {
|
||||
ItemStack bogEarth = blocks.bogEarth.get(BlockBogEarth.SoilType.BOG_EARTH, bogEarthOutputCan);
|
||||
ItemStack canWater = PluginFluids.items.getContainer(EnumContainerType.CAN, Fluids.WATER);
|
||||
ItemStack waxCapsuleWater = PluginFluids.items.getContainer(EnumContainerType.CAPSULE, Fluids.WATER);
|
||||
ItemStack refractoryWater = PluginFluids.items.getContainer(EnumContainerType.REFRACTORY, Fluids.WATER);
|
||||
ItemStack canWater = PluginFluids.items.getContainer(EnumContainerType.CAN, FluidRegistry.WATER);
|
||||
ItemStack waxCapsuleWater = PluginFluids.items.getContainer(EnumContainerType.CAPSULE, FluidRegistry.WATER);
|
||||
ItemStack refractoryWater = PluginFluids.items.getContainer(EnumContainerType.REFRACTORY, FluidRegistry.WATER);
|
||||
RecipeUtil.addRecipe(bogEarth, "#Y#", "YXY", "#Y#", '#', Blocks.DIRT, 'X', canWater, 'Y', OreDictUtil.SAND);
|
||||
RecipeUtil.addRecipe(bogEarth, "#Y#", "YXY", "#Y#", '#', Blocks.DIRT, 'X', waxCapsuleWater, 'Y', OreDictUtil.SAND);
|
||||
RecipeUtil.addRecipe(bogEarth, "#Y#", "YXY", "#Y#", '#', Blocks.DIRT, 'X', refractoryWater, 'Y', OreDictUtil.SAND);
|
||||
|
||||
@@ -92,7 +92,7 @@ public class PluginFluids extends BlankForestryPlugin {
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
for (Fluids fluidType : Fluids.FORESTRY_FLUIDs) {
|
||||
for (Fluids fluidType : Fluids.values()) {
|
||||
createFluid(fluidType);
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ public final class CommandSaveStats extends SubCommand {
|
||||
}
|
||||
}
|
||||
|
||||
File file = new File(Proxies.common.getForestryRoot(), "config/" + Constants.MOD_ID + "/stats/" + player.getDisplayName() + '-' + saveHelper.getFileSuffix() + ".log");
|
||||
File file = new File(Proxies.common.getForestryRoot(), "config/" + Constants.MOD_ID + "/stats/" + player.getDisplayNameString() + '-' + saveHelper.getFileSuffix() + ".log");
|
||||
try {
|
||||
File folder = file.getParentFile();
|
||||
if (folder != null && !folder.exists()) {
|
||||
|
||||
@@ -242,8 +242,8 @@ public class Config {
|
||||
|
||||
private static void loadConfigFluids(File configFile) {
|
||||
configFluid = new LocalizedConfiguration(configFile, "1.0.0");
|
||||
|
||||
for (Fluids fluid : Fluids.FORESTRY_FLUIDs) {
|
||||
|
||||
for (Fluids fluid : Fluids.values()) {
|
||||
String fluidName = Translator.translateToLocal("fluid." + fluid.getTag());
|
||||
|
||||
boolean enabledFluid = !Config.disabledFluids.contains(fluid.getTag());
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.core.entities;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -27,7 +26,9 @@ public class ParticleColoredDripParticle extends Particle {
|
||||
private int bobTimer;
|
||||
|
||||
public ParticleColoredDripParticle(World world, double x, double y, double z, float red, float green, float blue) {
|
||||
super(world, x, y, z);
|
||||
super(world, x, y, z, 0.0D, 0.0D, 0.0D);
|
||||
this.motionX = this.motionY = this.motionZ = 0.0D;
|
||||
|
||||
this.particleRed = red;
|
||||
this.particleGreen = green;
|
||||
this.particleBlue = blue;
|
||||
@@ -37,6 +38,7 @@ public class ParticleColoredDripParticle extends Particle {
|
||||
this.particleGravity = 0.06F;
|
||||
this.bobTimer = 40;
|
||||
this.particleMaxAge = (int) (64.0D / (Math.random() * 0.8D + 0.2D));
|
||||
this.motionX = this.motionY = this.motionZ = 0.0D;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,15 +76,21 @@ public class ParticleColoredDripParticle extends Particle {
|
||||
this.motionX *= 0.699999988079071D;
|
||||
this.motionZ *= 0.699999988079071D;
|
||||
}
|
||||
|
||||
IBlockState state = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)));
|
||||
Block block = state.getBlock();
|
||||
Material material = block.getMaterial(state);
|
||||
|
||||
|
||||
BlockPos blockpos = new BlockPos(this.posX, this.posY, this.posZ);
|
||||
IBlockState iblockstate = this.worldObj.getBlockState(blockpos);
|
||||
Material material = iblockstate.getMaterial();
|
||||
|
||||
if (material.isLiquid() || material.isSolid()) {
|
||||
double d0 = MathHelper.floor_double(this.posY) + 1 - BlockLiquid.getLiquidHeightPercent(block.getMetaFromState(state));
|
||||
|
||||
if (this.posY < d0) {
|
||||
double d0 = 0.0D;
|
||||
|
||||
if (iblockstate.getBlock() instanceof BlockLiquid) {
|
||||
d0 = BlockLiquid.getLiquidHeightPercent(iblockstate.getValue(BlockLiquid.LEVEL));
|
||||
}
|
||||
|
||||
double d1 = (double) (MathHelper.floor_double(this.posY) + 1) - d0;
|
||||
|
||||
if (this.posY < d1) {
|
||||
this.setExpired();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class BlockForestryFluid extends BlockFluidClassic implements IItemModelR
|
||||
}
|
||||
|
||||
public BlockForestryFluid(Fluids forestryFluid, int flammability, boolean flammable) {
|
||||
this(forestryFluid.getFluid(), flammability, flammable, forestryFluid.getColor());
|
||||
this(forestryFluid.getFluid(), flammability, flammable, forestryFluid.getParticleColor());
|
||||
}
|
||||
|
||||
private BlockForestryFluid(Fluid fluid, int flammability, boolean flammable, Color color) {
|
||||
@@ -119,8 +119,8 @@ public class BlockForestryFluid extends BlockFluidClassic implements IItemModelR
|
||||
double px = d0 + rand.nextFloat();
|
||||
double py = d1 - 1.05D;
|
||||
double pz = d2 + rand.nextFloat();
|
||||
|
||||
Particle fx = new ParticleColoredDripParticle(worldIn, px, py, pz, color.getRed(), color.getGreen(), color.getBlue());
|
||||
|
||||
Particle fx = new ParticleColoredDripParticle(worldIn, px, py, pz, color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f);
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(fx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,19 +120,8 @@ public enum Fluids {
|
||||
public Block makeBlock() {
|
||||
return new BlockForestryFluid(this);
|
||||
}
|
||||
},
|
||||
// Vanilla
|
||||
WATER(new Color(0x2432ec)),
|
||||
LAVA(new Color(0xfd461f)),
|
||||
// BuildCraft
|
||||
FUEL(new Color(0xffff00)),
|
||||
OIL(new Color(0x404040)),
|
||||
// Railcraft
|
||||
CREOSOTE(new Color(0x635c03)),
|
||||
STEAM(new Color(0x91938F));
|
||||
|
||||
public static final Fluids[] FORESTRY_FLUIDs = {BIO_ETHANOL, BIOMASS, GLASS, FOR_HONEY, ICE, JUICE, MILK, SEED_OIL, SHORT_MEAD};
|
||||
|
||||
};
|
||||
|
||||
private static final Map<String, Fluids> tagToFluid = new HashMap<>();
|
||||
|
||||
static {
|
||||
@@ -144,17 +133,17 @@ public enum Fluids {
|
||||
private final String tag;
|
||||
private final int density, viscosity;
|
||||
@Nonnull
|
||||
private final Color color;
|
||||
private final Color particleColor;
|
||||
|
||||
private final ResourceLocation[] resources = new ResourceLocation[2];
|
||||
|
||||
Fluids(@Nonnull Color color) {
|
||||
this(color, 1000, 1000);
|
||||
|
||||
Fluids(@Nonnull Color particleColor) {
|
||||
this(particleColor, 1000, 1000);
|
||||
}
|
||||
|
||||
Fluids(@Nonnull Color color, int density, int viscosity) {
|
||||
|
||||
Fluids(@Nonnull Color particleColor, int density, int viscosity) {
|
||||
this.tag = name().toLowerCase(Locale.ENGLISH).replace('_', '.');
|
||||
this.color = color;
|
||||
this.particleColor = particleColor;
|
||||
this.density = density;
|
||||
this.viscosity = viscosity;
|
||||
|
||||
@@ -197,8 +186,8 @@ public enum Fluids {
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public final Color getColor() {
|
||||
return color;
|
||||
public final Color getParticleColor() {
|
||||
return particleColor;
|
||||
}
|
||||
|
||||
public final boolean is(Fluid fluid) {
|
||||
@@ -231,21 +220,6 @@ public enum Fluids {
|
||||
return a.isFluidEqual(b);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public static Color getFluidColor(FluidStack fluidStack) {
|
||||
if (fluidStack != null) {
|
||||
Fluid fluid = fluidStack.getFluid();
|
||||
if (fluid != null) {
|
||||
Fluids fluidDefinition = tagToFluid.get(fluid.getName());
|
||||
if (fluidDefinition != null) {
|
||||
return fluidDefinition.getColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Fluids.WATER.getColor();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Fluids getFluidDefinition(FluidStack fluidStack) {
|
||||
if (fluidStack != null) {
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import forestry.api.core.INbtWritable;
|
||||
@@ -48,7 +49,7 @@ public class PipetteContents implements INbtWritable {
|
||||
}
|
||||
|
||||
public boolean isFull() {
|
||||
return contents.amount >= 1000;
|
||||
return contents.amount >= Fluid.BUCKET_VOLUME;
|
||||
}
|
||||
|
||||
public void addTooltip(List<String> list) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
@@ -62,7 +63,7 @@ public class ContainerLiquidTanksHelper<T extends TileEntity & ILiquidTankTile>
|
||||
if (pipette.canPipette(itemstack) && liquidAmount > 0) {
|
||||
if (liquidAmount > 0) {
|
||||
if (tank instanceof FluidTank) {
|
||||
FluidStack fillAmount = ((FluidTank) tank).drainInternal(1000, false);
|
||||
FluidStack fillAmount = ((FluidTank) tank).drainInternal(Fluid.BUCKET_VOLUME, false);
|
||||
int filled = pipette.fill(itemstack, fillAmount, true);
|
||||
tank.drain(filled, true);
|
||||
player.updateHeldItem();
|
||||
|
||||
@@ -154,27 +154,21 @@ public class InventoryAdapter implements IInventoryAdapter, IStreamable {
|
||||
}
|
||||
|
||||
/* ISIDEDINVENTORY */
|
||||
private int[][] slotMap;
|
||||
private int[] slotMap;
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side) {
|
||||
if (allowAutomation) {
|
||||
return slotMap[side.ordinal()];
|
||||
return slotMap;
|
||||
}
|
||||
return Constants.SLOTS_NONE;
|
||||
}
|
||||
|
||||
private void configureSided() {
|
||||
slotMap = new int[6][0];
|
||||
|
||||
int count = getSizeInventory();
|
||||
int[] slots = new int[count];
|
||||
slotMap = new int[count];
|
||||
for (int i = 0; i < count; i++) {
|
||||
slots[i] = i;
|
||||
}
|
||||
|
||||
for (EnumFacing side : EnumFacing.VALUES) {
|
||||
slotMap[side.getIndex()] = slots;
|
||||
slotMap[i] = i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ package forestry.core.items;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import forestry.core.fluids.Fluids;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -22,14 +22,16 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.FoodStats;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
@@ -40,9 +42,11 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.core.CreativeTabForestry;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.utils.Translator;
|
||||
|
||||
public class ItemFluidContainerForestry extends ItemForestry implements IColoredItem {
|
||||
public class ItemFluidContainerForestry extends ItemForestry {
|
||||
private final EnumContainerType type;
|
||||
|
||||
public ItemFluidContainerForestry(EnumContainerType type) {
|
||||
@@ -54,8 +58,9 @@ public class ItemFluidContainerForestry extends ItemForestry implements IColored
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerItemModel(item, 0, "liquids/" + type.toString().toLowerCase(Locale.ENGLISH) + "_empty");
|
||||
manager.registerItemModel(item, 1, "liquids/" + type.toString().toLowerCase(Locale.ENGLISH));
|
||||
String identifier = "liquids/" + type.toString().toLowerCase(Locale.ENGLISH);
|
||||
manager.registerItemModel(item, 0, identifier + "_empty");
|
||||
ModelLoader.setCustomModelResourceLocation(item, 1, new ModelResourceLocation(new ResourceLocation(Constants.MOD_ID, identifier), "inventory"));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -74,16 +79,6 @@ public class ItemFluidContainerForestry extends ItemForestry implements IColored
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorFromItemstack(ItemStack itemStack, int tintIndex) {
|
||||
if (tintIndex > 0) {
|
||||
FluidStack fluidStack = getContained(itemStack);
|
||||
return Fluids.getFluidColor(fluidStack).getRGB();
|
||||
} else {
|
||||
return 0xffffff;
|
||||
}
|
||||
}
|
||||
|
||||
public EnumContainerType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ package forestry.core.items;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -106,8 +107,8 @@ public class ItemPipette extends ItemForestry implements IToolPipette, IFluidCon
|
||||
models = new ModelResourceLocation[2];
|
||||
models[0] = manager.getModelLocation("pipette.0");
|
||||
models[1] = manager.getModelLocation("pipette.1");
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:pipette.0"));
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:pipette.1"));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:pipette.0"));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:pipette.1"));
|
||||
manager.registerItemModel(item, new PipetteMeshDefinition());
|
||||
}
|
||||
|
||||
|
||||
@@ -13,11 +13,15 @@ package forestry.core.items;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
|
||||
import forestry.core.fluids.Fluids;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
|
||||
import forestry.core.fluids.Fluids;
|
||||
|
||||
public class ItemRegistryFluids extends ItemRegistry {
|
||||
public final ItemFluidContainerForestry canEmpty;
|
||||
public final ItemFluidContainerForestry waxCapsuleEmpty;
|
||||
@@ -26,9 +30,13 @@ public class ItemRegistryFluids extends ItemRegistry {
|
||||
private final Map<EnumContainerType, ItemFluidContainerForestry> containers = new EnumMap<>(EnumContainerType.class);
|
||||
|
||||
public ItemStack getContainer(EnumContainerType type, Fluids fluid) {
|
||||
return getContainer(type, fluid.getFluid());
|
||||
}
|
||||
|
||||
public ItemStack getContainer(EnumContainerType type, Fluid fluid) {
|
||||
ItemStack container = new ItemStack(containers.get(type));
|
||||
IFluidHandler fluidHandler = FluidUtil.getFluidHandler(container);
|
||||
fluidHandler.fill(fluid.getFluid(Integer.MAX_VALUE), true);
|
||||
fluidHandler.fill(new FluidStack(fluid, Integer.MAX_VALUE), true);
|
||||
return container;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@ public class ItemWrench extends ItemForestry {//implements IToolWrench {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) {
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
if (block.rotateBlock(world, pos, side)) {
|
||||
player.swingArm(hand);
|
||||
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||
Block block = worldIn.getBlockState(pos).getBlock();
|
||||
if (block.rotateBlock(worldIn, pos, facing)) {
|
||||
playerIn.swingArm(hand);
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
return EnumActionResult.FAIL;
|
||||
|
||||
@@ -143,12 +143,7 @@ public class ModelManager implements IModelManager {
|
||||
public void registerItemModel(Item item, ItemMeshDefinition definition) {
|
||||
ModelLoader.setCustomMeshDefinition(item, definition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerVariant(Item item, ResourceLocation... resources) {
|
||||
ModelBakery.registerItemVariants(item, resources);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(Item item) {
|
||||
String itemName = ItemStackUtil.getItemNameFromRegistry(item).getResourcePath();
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DataInputStreamForestry extends DataInputStream {
|
||||
|
||||
if (!itemName.isEmpty()) {
|
||||
Item item = ItemStackUtil.getItemFromRegistry(itemName);
|
||||
byte stackSize = readByte();
|
||||
int stackSize = readVarInt();
|
||||
int meta = readVarInt();
|
||||
itemstack = new ItemStack(item, stackSize, meta);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class DataOutputStreamForestry extends DataOutputStream {
|
||||
writeUTF("");
|
||||
} else {
|
||||
writeUTF(ItemStackUtil.getItemNameFromRegistryAsString(itemstack.getItem()));
|
||||
writeByte(itemstack.stackSize);
|
||||
writeVarInt(itemstack.stackSize);
|
||||
writeVarInt(itemstack.getItemDamage());
|
||||
|
||||
if (itemstack.getItem().isDamageable() || itemstack.getItem().getShareTag()) {
|
||||
|
||||
@@ -25,6 +25,7 @@ import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
@@ -42,8 +43,8 @@ public abstract class RecipeUtil {
|
||||
if (RecipeManagers.fermenterManager == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
RecipeManagers.fermenterManager.addRecipe(resource, fermentationValue, 1.0f, output.getFluid(1), Fluids.WATER.getFluid(1));
|
||||
|
||||
RecipeManagers.fermenterManager.addRecipe(resource, fermentationValue, 1.0f, output.getFluid(1), new FluidStack(FluidRegistry.WATER, 1));
|
||||
|
||||
if (FluidRegistry.isFluidRegistered(Fluids.JUICE.getFluid())) {
|
||||
RecipeManagers.fermenterManager.addRecipe(resource, fermentationValue, 1.5f, output.getFluid(1), Fluids.JUICE.getFluid(1));
|
||||
|
||||
@@ -55,7 +55,7 @@ public class JEIUtils {
|
||||
if (fluidStack == null && Block.getBlockFromItem(stack.getItem()) instanceof IFluidBlock) {
|
||||
Fluid fluid = ((IFluidBlock) Block.getBlockFromItem(stack.getItem())).getFluid();
|
||||
if (fluid != null) {
|
||||
fluidStack = new FluidStack(fluid, 1000);
|
||||
fluidStack = new FluidStack(fluid, Fluid.BUCKET_VOLUME);
|
||||
}
|
||||
}
|
||||
return fluidStack;
|
||||
|
||||
@@ -23,6 +23,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import forestry.core.blocks.BlockBase;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.tiles.IRenderableTile;
|
||||
import forestry.core.tiles.TileBase;
|
||||
@@ -171,8 +172,10 @@ public class RenderMachine extends TileEntitySpecialRenderer<TileBase> {
|
||||
if (textureResourceTankLevel == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Color primaryTankColor = renderInfo.getFluidColor();
|
||||
|
||||
// TODO: render fluid overlay on tank
|
||||
Fluids fluidDefinition = Fluids.getFluidDefinition(renderInfo.getFluidStack());
|
||||
Color primaryTankColor = fluidDefinition == null ? Color.BLUE : fluidDefinition.getParticleColor();
|
||||
float[] colors = new float[3];
|
||||
primaryTankColor.getRGBColorComponents(colors);
|
||||
GlStateManager.color(colors[0], colors[1], colors[2], 1.0f);
|
||||
|
||||
@@ -11,34 +11,33 @@
|
||||
package forestry.core.render;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
|
||||
import forestry.core.fluids.Fluids;
|
||||
|
||||
public class TankRenderInfo {
|
||||
public static final TankRenderInfo EMPTY = new TankRenderInfo(Fluids.WATER.getColor(), EnumTankLevel.EMPTY);
|
||||
public static final TankRenderInfo EMPTY = new TankRenderInfo(new FluidStack(FluidRegistry.WATER, 0), EnumTankLevel.EMPTY);
|
||||
|
||||
@Nonnull
|
||||
private final Color fluidColor;
|
||||
private final FluidStack fluidStack;
|
||||
@Nonnull
|
||||
private final EnumTankLevel level;
|
||||
|
||||
public TankRenderInfo(@Nonnull IFluidTank fluidTank) {
|
||||
this(Fluids.getFluidColor(fluidTank.getFluid()), EnumTankLevel.rateTankLevel(fluidTank));
|
||||
this(fluidTank.getFluid(), EnumTankLevel.rateTankLevel(fluidTank));
|
||||
}
|
||||
|
||||
public TankRenderInfo(@Nonnull Color fluidColor, @Nonnull EnumTankLevel level) {
|
||||
this.fluidColor = fluidColor;
|
||||
|
||||
public TankRenderInfo(@Nonnull FluidStack fluidStack, @Nonnull EnumTankLevel level) {
|
||||
this.fluidStack = fluidStack;
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
public Color getFluidColor() {
|
||||
return fluidColor;
|
||||
public FluidStack getFluidStack() {
|
||||
return fluidStack;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
public EnumTankLevel getLevel() {
|
||||
return level;
|
||||
|
||||
@@ -32,7 +32,6 @@ import forestry.api.fuels.FuelManager;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.errors.EnumErrorCode;
|
||||
import forestry.core.fluids.FluidHelper;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.fluids.TankManager;
|
||||
import forestry.core.fluids.tanks.FilteredTank;
|
||||
import forestry.core.fluids.tanks.StandardTank;
|
||||
@@ -111,7 +110,7 @@ public class TileEngineBiogas extends TileEngine implements ISidedInventory, ILi
|
||||
} else if (shutdown)
|
||||
|
||||
{
|
||||
if (heatingTank.getFluidAmount() > 0 && Fluids.LAVA.is(heatingTank.getFluid())) {
|
||||
if (heatingTank.getFluidAmount() > 0 && heatingTank.getFluid().getFluid() == FluidRegistry.LAVA) {
|
||||
addHeat(Constants.ENGINE_HEAT_VALUE_LAVA);
|
||||
heatingTank.drainInternal(1, true);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
@@ -152,7 +153,7 @@ public class PluginFactory extends BlankForestryPlugin {
|
||||
|
||||
FuelManager.bronzeEngineFuel.put(Fluids.BIOMASS.getFluid(), new EngineBronzeFuel(Fluids.BIOMASS.getFluid(),
|
||||
Constants.ENGINE_FUEL_VALUE_BIOMASS, (int) (Constants.ENGINE_CYCLE_DURATION_BIOMASS * ForestryAPI.activeMode.getFloatSetting("fuel.biomass.biogas")), 1));
|
||||
FuelManager.bronzeEngineFuel.put(Fluids.WATER.getFluid(), new EngineBronzeFuel(Fluids.WATER.getFluid(),
|
||||
FuelManager.bronzeEngineFuel.put(FluidRegistry.WATER, new EngineBronzeFuel(FluidRegistry.WATER,
|
||||
Constants.ENGINE_FUEL_VALUE_WATER, Constants.ENGINE_CYCLE_DURATION_WATER, 3));
|
||||
FuelManager.bronzeEngineFuel.put(Fluids.MILK.getFluid(), new EngineBronzeFuel(Fluids.MILK.getFluid(),
|
||||
Constants.ENGINE_FUEL_VALUE_MILK, Constants.ENGINE_CYCLE_DURATION_MILK, 3));
|
||||
@@ -269,8 +270,8 @@ public class PluginFactory extends BlankForestryPlugin {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Items.WHEAT_SEEDS)}, seedOil);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Items.PUMPKIN_SEEDS)}, seedOil);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Items.MELON_SEEDS)}, seedOil);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{PluginCore.items.phosphor.getItemStack(2), new ItemStack(Blocks.COBBLESTONE)}, Fluids.LAVA.getFluid(1600));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Blocks.CACTUS)}, Fluids.WATER.getFluid(500));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{PluginCore.items.phosphor.getItemStack(2), new ItemStack(Blocks.COBBLESTONE)}, new FluidStack(FluidRegistry.LAVA, 1600));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Blocks.CACTUS)}, new FluidStack(FluidRegistry.WATER, 500));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Items.SNOWBALL), PluginCore.items.craftingMaterial.getIceShard(4)}, Fluids.ICE.getFluid(4000));
|
||||
|
||||
// STILL
|
||||
@@ -323,30 +324,30 @@ public class PluginFactory extends BlankForestryPlugin {
|
||||
"#",
|
||||
"#",
|
||||
'#', "logWood");
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(250), null,
|
||||
RecipeManagers.carpenterManager.addRecipe(5, new FluidStack(FluidRegistry.WATER, 250), null,
|
||||
PluginCore.items.woodPulp.getItemStack(4),
|
||||
"#",
|
||||
'#', "logWood");
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(250), null,
|
||||
RecipeManagers.carpenterManager.addRecipe(5, new FluidStack(FluidRegistry.WATER, 250), null,
|
||||
new ItemStack(Items.PAPER, 1),
|
||||
"#",
|
||||
"#",
|
||||
'#', "pulpWood");
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(1000), null,
|
||||
RecipeManagers.carpenterManager.addRecipe(5, new FluidStack(FluidRegistry.WATER, 1000), null,
|
||||
new ItemStack(PluginCore.blocks.humus, 9),
|
||||
"###",
|
||||
"#X#",
|
||||
"###",
|
||||
'#', Blocks.DIRT,
|
||||
'X', PluginCore.items.mulch);
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(1000), null,
|
||||
RecipeManagers.carpenterManager.addRecipe(5, new FluidStack(FluidRegistry.WATER, 1000), null,
|
||||
PluginCore.blocks.bogEarth.get(BlockBogEarth.SoilType.BOG_EARTH, 8),
|
||||
"#X#",
|
||||
"XYX", "#X#",
|
||||
'#', Blocks.DIRT,
|
||||
'X', "sand",
|
||||
'Y', PluginCore.items.mulch);
|
||||
RecipeManagers.carpenterManager.addRecipe(75, Fluids.WATER.getFluid(5000), null, PluginCore.items.hardenedCasing.getItemStack(),
|
||||
RecipeManagers.carpenterManager.addRecipe(75, new FluidStack(FluidRegistry.WATER, 5000), null, PluginCore.items.hardenedCasing.getItemStack(),
|
||||
"# #",
|
||||
" Y ",
|
||||
"# #",
|
||||
@@ -355,21 +356,21 @@ public class PluginFactory extends BlankForestryPlugin {
|
||||
|
||||
// / CHIPSETS
|
||||
ItemCircuitBoard circuitBoard = PluginCore.items.circuitboards;
|
||||
RecipeManagers.carpenterManager.addRecipe(20, Fluids.WATER.getFluid(1000), null, ItemCircuitBoard.createCircuitboard(EnumCircuitBoardType.BASIC, null, new ICircuit[]{}),
|
||||
RecipeManagers.carpenterManager.addRecipe(20, new FluidStack(FluidRegistry.WATER, 1000), null, ItemCircuitBoard.createCircuitboard(EnumCircuitBoardType.BASIC, null, new ICircuit[]{}),
|
||||
"R R", "R#R", "R R", '#', "ingotTin", 'R', "dustRedstone");
|
||||
RecipeManagers.carpenterManager.addRecipe(40, Fluids.WATER.getFluid(1000), null, ItemCircuitBoard.createCircuitboard(EnumCircuitBoardType.ENHANCED, null, new ICircuit[]{}),
|
||||
RecipeManagers.carpenterManager.addRecipe(40, new FluidStack(FluidRegistry.WATER, 1000), null, ItemCircuitBoard.createCircuitboard(EnumCircuitBoardType.ENHANCED, null, new ICircuit[]{}),
|
||||
"R#R", "R#R", "R#R", '#', "ingotBronze", 'R', "dustRedstone");
|
||||
RecipeManagers.carpenterManager.addRecipe(80, Fluids.WATER.getFluid(1000), null, ItemCircuitBoard.createCircuitboard(EnumCircuitBoardType.REFINED, null, new ICircuit[]{}),
|
||||
RecipeManagers.carpenterManager.addRecipe(80, new FluidStack(FluidRegistry.WATER, 1000), null, ItemCircuitBoard.createCircuitboard(EnumCircuitBoardType.REFINED, null, new ICircuit[]{}),
|
||||
"R#R", "R#R", "R#R", '#', "ingotIron", 'R', "dustRedstone");
|
||||
RecipeManagers.carpenterManager.addRecipe(80, Fluids.WATER.getFluid(1000), null, ItemCircuitBoard.createCircuitboard(EnumCircuitBoardType.INTRICATE, null, new ICircuit[]{}),
|
||||
RecipeManagers.carpenterManager.addRecipe(80, new FluidStack(FluidRegistry.WATER, 1000), null, ItemCircuitBoard.createCircuitboard(EnumCircuitBoardType.INTRICATE, null, new ICircuit[]{}),
|
||||
"R#R", "R#R", "R#R", '#', "ingotGold", 'R', "dustRedstone");
|
||||
RecipeManagers.carpenterManager.addRecipe(40, Fluids.WATER.getFluid(1000), null, PluginCore.items.solderingIron.getItemStack(),
|
||||
RecipeManagers.carpenterManager.addRecipe(40, new FluidStack(FluidRegistry.WATER, 1000), null, PluginCore.items.solderingIron.getItemStack(),
|
||||
" # ", "# #", " B", '#', "ingotIron", 'B', "ingotBronze");
|
||||
|
||||
// RAIN SUBSTRATES
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.items;
|
||||
if (beeItems != null) {
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(1000), null, PluginCore.items.iodineCharge.getItemStack(),
|
||||
RecipeManagers.carpenterManager.addRecipe(5, new FluidStack(FluidRegistry.WATER, 1000), null, PluginCore.items.iodineCharge.getItemStack(),
|
||||
"Z#Z",
|
||||
"#Y#",
|
||||
"X#X",
|
||||
@@ -377,7 +378,7 @@ public class PluginFactory extends BlankForestryPlugin {
|
||||
'X', Items.GUNPOWDER,
|
||||
'Y', PluginFluids.items.canEmpty,
|
||||
'Z', beeItems.honeyDrop);
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(1000), null, PluginCore.items.craftingMaterial.getDissipationCharge(),
|
||||
RecipeManagers.carpenterManager.addRecipe(5, new FluidStack(FluidRegistry.WATER, 1000), null, PluginCore.items.craftingMaterial.getDissipationCharge(),
|
||||
"Z#Z",
|
||||
"#Y#",
|
||||
"X#X",
|
||||
@@ -392,14 +393,14 @@ public class PluginFactory extends BlankForestryPlugin {
|
||||
PluginCore.items.craftingMaterial.getPulsatingMesh());
|
||||
|
||||
// Woven Silk
|
||||
RecipeManagers.carpenterManager.addRecipe(10, Fluids.WATER.getFluid(500), null, PluginCore.items.craftingMaterial.getWovenSilk(),
|
||||
RecipeManagers.carpenterManager.addRecipe(10, new FluidStack(FluidRegistry.WATER, 500), null, PluginCore.items.craftingMaterial.getWovenSilk(),
|
||||
"###",
|
||||
"###",
|
||||
"###",
|
||||
'#', PluginCore.items.craftingMaterial.getSilkWisp());
|
||||
|
||||
// Boxes
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(1000), null, PluginCore.items.carton.getItemStack(2),
|
||||
RecipeManagers.carpenterManager.addRecipe(5, new FluidStack(FluidRegistry.WATER, 1000), null, PluginCore.items.carton.getItemStack(2),
|
||||
" # ", "# #", " # ", '#', "pulpWood");
|
||||
|
||||
// Assembly Kits
|
||||
|
||||
@@ -17,11 +17,11 @@ import java.util.Set;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import forestry.api.recipes.IFermenterManager;
|
||||
import forestry.api.recipes.IFermenterRecipe;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
|
||||
public class FermenterRecipeManager implements IFermenterManager {
|
||||
@@ -38,7 +38,7 @@ public class FermenterRecipeManager implements IFermenterManager {
|
||||
|
||||
@Override
|
||||
public void addRecipe(ItemStack resource, int fermentationValue, float modifier, FluidStack output) {
|
||||
addRecipe(resource, fermentationValue, modifier, output, Fluids.WATER.getFluid(1000));
|
||||
addRecipe(resource, fermentationValue, modifier, output, new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME));
|
||||
}
|
||||
|
||||
public static IFermenterRecipe findMatchingRecipe(ItemStack res, FluidStack liqu) {
|
||||
|
||||
@@ -32,7 +32,6 @@ import forestry.api.core.IErrorLogic;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.errors.EnumErrorCode;
|
||||
import forestry.core.fluids.FluidHelper;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.fluids.TankManager;
|
||||
import forestry.core.fluids.tanks.FilteredTank;
|
||||
import forestry.core.network.DataInputStreamForestry;
|
||||
@@ -45,7 +44,7 @@ import forestry.factory.gui.GuiRaintank;
|
||||
import forestry.factory.inventory.InventoryRaintank;
|
||||
|
||||
public class TileRaintank extends TileBase implements ISidedInventory, ILiquidTankTile {
|
||||
private static final FluidStack STACK_WATER = Fluids.WATER.getFluid(Constants.RAINTANK_AMOUNT_PER_UPDATE);
|
||||
private static final FluidStack STACK_WATER = new FluidStack(FluidRegistry.WATER, Constants.RAINTANK_AMOUNT_PER_UPDATE);
|
||||
|
||||
private final FilteredTank resourceTank;
|
||||
private final TankManager tankManager;
|
||||
@@ -119,14 +118,14 @@ public class TileRaintank extends TileBase implements ISidedInventory, ILiquidTa
|
||||
}
|
||||
|
||||
if (!isFilling()) {
|
||||
FluidHelper.FillStatus canFill = FluidHelper.fillContainers(tankManager, this, InventoryRaintank.SLOT_RESOURCE, InventoryRaintank.SLOT_PRODUCT, Fluids.WATER.getFluid(), false);
|
||||
FluidHelper.FillStatus canFill = FluidHelper.fillContainers(tankManager, this, InventoryRaintank.SLOT_RESOURCE, InventoryRaintank.SLOT_PRODUCT, FluidRegistry.WATER, false);
|
||||
if (canFill == FluidHelper.FillStatus.SUCCESS) {
|
||||
fillingTime = Constants.RAINTANK_FILLING_TIME;
|
||||
}
|
||||
} else {
|
||||
fillingTime--;
|
||||
if (fillingTime <= 0) {
|
||||
FluidHelper.FillStatus filled = FluidHelper.fillContainers(tankManager, this, InventoryRaintank.SLOT_RESOURCE, InventoryRaintank.SLOT_PRODUCT, Fluids.WATER.getFluid(), true);
|
||||
FluidHelper.FillStatus filled = FluidHelper.fillContainers(tankManager, this, InventoryRaintank.SLOT_RESOURCE, InventoryRaintank.SLOT_PRODUCT, FluidRegistry.WATER, true);
|
||||
if (filled == FluidHelper.FillStatus.SUCCESS) {
|
||||
fillingTime = 0;
|
||||
}
|
||||
|
||||
@@ -21,11 +21,12 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import forestry.api.farming.FarmDirection;
|
||||
import forestry.api.farming.IFarmHousing;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.utils.BlockUtil;
|
||||
import forestry.farming.FarmHelper;
|
||||
|
||||
@@ -33,8 +34,8 @@ public abstract class FarmLogicWatered extends FarmLogic {
|
||||
|
||||
protected final IBlockState ground;
|
||||
private final ItemStack resource;
|
||||
|
||||
private static final FluidStack STACK_WATER = Fluids.WATER.getFluid(1000);
|
||||
|
||||
private static final FluidStack STACK_WATER = new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME);
|
||||
|
||||
protected List<ItemStack> produce = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Stack;
|
||||
|
||||
import forestry.core.fluids.FluidHelper;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -62,7 +61,7 @@ import forestry.core.access.EnumAccess;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.errors.EnumErrorCode;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.fluids.FluidHelper;
|
||||
import forestry.core.fluids.TankManager;
|
||||
import forestry.core.fluids.tanks.FilteredTank;
|
||||
import forestry.core.fluids.tanks.StandardTank;
|
||||
@@ -632,7 +631,7 @@ public class FarmController extends RectangularMultiblockControllerBase implemen
|
||||
|
||||
final int fertilizerConsumption = logic.getFertilizerConsumption();
|
||||
int liquidConsumption = logic.getWaterConsumption(hydrationModifier);
|
||||
FluidStack liquid = Fluids.WATER.getFluid(liquidConsumption);
|
||||
FluidStack liquid = new FluidStack(FluidRegistry.WATER, liquidConsumption);
|
||||
|
||||
if (farmTargets != null) {
|
||||
for (FarmTarget target : farmTargets) {
|
||||
@@ -748,7 +747,7 @@ public class FarmController extends RectangularMultiblockControllerBase implemen
|
||||
// Check water
|
||||
float hydrationModifier = hydrationManager.getHydrationModifier();
|
||||
int waterConsumption = provider.getWaterConsumption(hydrationModifier);
|
||||
FluidStack requiredLiquid = Fluids.WATER.getFluid(waterConsumption);
|
||||
FluidStack requiredLiquid = new FluidStack(FluidRegistry.WATER, waterConsumption);
|
||||
boolean hasLiquid = requiredLiquid.amount == 0 || hasLiquid(requiredLiquid);
|
||||
|
||||
if (errorLogic.setCondition(!hasLiquid, EnumErrorCode.NO_LIQUID_FARM)) {
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@@ -181,7 +182,7 @@ public class ItemButterflyGE extends ItemGE implements ISpriteRegister, IColored
|
||||
for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) {
|
||||
if (allele instanceof IAlleleButterflyCocoon) {
|
||||
for(int age = 0;age < 3;age++){
|
||||
manager.registerVariant(this, ((IAlleleButterflyCocoon) allele).getCocoonItemModel(age));
|
||||
ModelBakery.registerItemVariants(this, ((IAlleleButterflyCocoon) allele).getCocoonItemModel(age));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -100,13 +101,13 @@ public class LetterProperties {
|
||||
models = new ModelResourceLocation[3][4];
|
||||
for (int i = 0; i < 3; i++) {
|
||||
models[i][0] = new ModelResourceLocation("forestry:mail/letter." + i + ".fresh", "inventory");
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:mail/letter." + i + ".fresh"));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:mail/letter." + i + ".fresh"));
|
||||
models[i][1] = new ModelResourceLocation("forestry:mail/letter." + i + ".stamped", "inventory");
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:mail/letter." + i + ".stamped"));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:mail/letter." + i + ".stamped"));
|
||||
models[i][2] = new ModelResourceLocation("forestry:mail/letter." + i + ".opened", "inventory");
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:mail/letter." + i + ".opened"));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:mail/letter." + i + ".opened"));
|
||||
models[i][3] = new ModelResourceLocation("forestry:mail/letter." + i + ".emptied", "inventory");
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:mail/letter." + i + ".emptied"));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:mail/letter." + i + ".emptied"));
|
||||
}
|
||||
manager.registerItemModel(item, new LetterMeshDefinition());
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import forestry.api.circuits.ICircuit;
|
||||
import forestry.api.mail.EnumAddressee;
|
||||
@@ -133,7 +135,7 @@ public class PluginMail extends BlankForestryPlugin {
|
||||
RecipeUtil.addRecipe(new ItemStack(Items.PAPER), "###", '#', OreDictUtil.EMPTIED_LETTER_ORE_DICT);
|
||||
|
||||
// Carpenter
|
||||
RecipeManagers.carpenterManager.addRecipe(10, Fluids.WATER.getFluid(250), null, items.letters.getItemStack(), "###", "###", '#', PluginCore.items.woodPulp);
|
||||
RecipeManagers.carpenterManager.addRecipe(10, new FluidStack(FluidRegistry.WATER, 250), null, items.letters.getItemStack(), "###", "###", '#', PluginCore.items.woodPulp);
|
||||
|
||||
RecipeUtil.addShapelessRecipe(items.catalogue.getItemStack(), items.stamps.getWildcard(), new ItemStack(Items.BOOK));
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ContainerCatalogue extends Container implements IGuiSelectable, ILe
|
||||
// for display on client
|
||||
private int stationCount;
|
||||
|
||||
private boolean needsSynch = true;
|
||||
private boolean needsSync = true;
|
||||
private int currentFilter = 1;
|
||||
|
||||
private static final String[] FILTER_NAMES = new String[]{"all", "online", "offline"};
|
||||
@@ -158,7 +158,7 @@ public class ContainerCatalogue extends Container implements IGuiSelectable, ILe
|
||||
} else {
|
||||
setTradeInfo(null);
|
||||
}
|
||||
needsSynch = true;
|
||||
needsSync = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -178,7 +178,7 @@ public class ContainerCatalogue extends Container implements IGuiSelectable, ILe
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
if (needsSynch) {
|
||||
if (needsSync) {
|
||||
for (IContainerListener crafter : listeners) {
|
||||
crafter.sendProgressBarUpdate(this, 0, stationIndex);
|
||||
crafter.sendProgressBarUpdate(this, 1, stations.size());
|
||||
@@ -186,7 +186,7 @@ public class ContainerCatalogue extends Container implements IGuiSelectable, ILe
|
||||
}
|
||||
|
||||
Proxies.net.sendToPlayer(new PacketLetterInfoResponse(EnumAddressee.TRADER, currentTrade, null), player);
|
||||
needsSynch = false;
|
||||
needsSync = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,6 +225,6 @@ public class ContainerCatalogue extends Container implements IGuiSelectable, ILe
|
||||
break;
|
||||
}
|
||||
|
||||
needsSynch = true;
|
||||
needsSync = true;
|
||||
}
|
||||
}
|
||||
@@ -110,6 +110,8 @@ public class PacketLetterInfoResponse extends ForestryPacket implements IForestr
|
||||
}
|
||||
|
||||
type = EnumAddressee.fromString(data.readUTF());
|
||||
tradeInfo = null;
|
||||
address = null;
|
||||
|
||||
if (type == EnumAddressee.PLAYER) {
|
||||
if (data.readShort() < 0) {
|
||||
|
||||
@@ -34,7 +34,7 @@ public class PluginBuildCraftFuels extends BlankForestryPlugin {
|
||||
// @Override
|
||||
// public void doInit() {
|
||||
// ICoolantManager coolantManager = BuildcraftFuelRegistry.coolant;
|
||||
// ICoolant waterCoolant = coolantManager.getCoolant(Fluids.WATER.getFluid());
|
||||
// ICoolant waterCoolant = coolantManager.getCoolant(FluidRegistry.WATER);
|
||||
// float waterCooling = waterCoolant.getDegreesCoolingPerMB(100);
|
||||
//
|
||||
// coolantManager.addCoolant(Fluids.ICE.getFluid(), Constants.ICE_COOLING_MULTIPLIER * waterCooling);
|
||||
|
||||
@@ -18,8 +18,8 @@ import java.util.Set;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
|
||||
@@ -52,7 +52,6 @@ import forestry.core.utils.Log;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.energy.PluginEnergy;
|
||||
import forestry.energy.blocks.BlockRegistryEnergy;
|
||||
import forestry.energy.blocks.BlockTypeEngine;
|
||||
import forestry.energy.circuits.CircuitElectricBoost;
|
||||
import forestry.energy.circuits.CircuitElectricChoke;
|
||||
import forestry.energy.circuits.CircuitElectricEfficiency;
|
||||
@@ -256,11 +255,11 @@ public class PluginIC2 extends BlankForestryPlugin {
|
||||
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.ENERGY)) {
|
||||
FluidStack biogas = FluidRegistry.getFluidStack("ic2biogas", 1000);
|
||||
Fluid biogas = FluidRegistry.getFluid("ic2biogas");
|
||||
if (biogas != null) {
|
||||
int burnDuration = Math.round(Constants.ENGINE_CYCLE_DURATION_BIOMASS * ForestryAPI.activeMode.getFloatSetting("fuel.biomass.biogas"));
|
||||
EngineBronzeFuel bronzeFuel = new EngineBronzeFuel(Fluids.BIOMASS.getFluid(), Constants.ENGINE_FUEL_VALUE_BIOMASS, burnDuration, 1);
|
||||
FuelManager.bronzeEngineFuel.put(biogas.getFluid(), bronzeFuel);
|
||||
FuelManager.bronzeEngineFuel.put(biogas, bronzeFuel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
@@ -53,7 +55,6 @@ import forestry.core.IResupplyHandler;
|
||||
import forestry.core.PluginCore;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.LocalizedConfiguration;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.items.ItemCrated;
|
||||
import forestry.core.models.ModelCrate;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
@@ -477,7 +478,7 @@ public class PluginStorage extends BlankForestryPlugin {
|
||||
}
|
||||
|
||||
private static void addCrating(@Nonnull ItemStack crateStack, @Nonnull Object uncrated) {
|
||||
FluidStack water = Fluids.WATER.getFluid(Constants.CARPENTER_CRATING_LIQUID_QUANTITY);
|
||||
FluidStack water = new FluidStack(FluidRegistry.WATER, Constants.CARPENTER_CRATING_LIQUID_QUANTITY);
|
||||
ItemStack box = items.crate.getItemStack();
|
||||
RecipeManagers.carpenterManager.addRecipe(Constants.CARPENTER_CRATING_CYCLES, water, box, crateStack, "###", "###", "###", '#', uncrated);
|
||||
}
|
||||
@@ -543,7 +544,7 @@ public class PluginStorage extends BlankForestryPlugin {
|
||||
// / CARPENTER
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FACTORY)) {
|
||||
// / CRATES
|
||||
RecipeManagers.carpenterManager.addRecipe(20, Fluids.WATER.getFluid(1000), null, items.crate.getItemStack(24),
|
||||
RecipeManagers.carpenterManager.addRecipe(20, new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME), null, items.crate.getItemStack(24),
|
||||
" # ", "# #", " # ", '#', "logWood");
|
||||
|
||||
// / BACKPACKS WOVEN
|
||||
@@ -573,7 +574,7 @@ public class PluginStorage extends BlankForestryPlugin {
|
||||
|
||||
private static void addT2BackpackRecipe(Item backpackT1, Item backpackT2) {
|
||||
ItemStack wovenSilk = PluginCore.items.craftingMaterial.getWovenSilk();
|
||||
RecipeManagers.carpenterManager.addRecipe(200, Fluids.WATER.getFluid(1000), null, new ItemStack(backpackT2),
|
||||
RecipeManagers.carpenterManager.addRecipe(200, new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME), null, new ItemStack(backpackT2),
|
||||
"WXW",
|
||||
"WTW",
|
||||
"WWW",
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -97,11 +98,10 @@ public class ItemBackpack extends ItemWithGui implements IColoredItem {
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) {
|
||||
// We only do this when shift is clicked
|
||||
if (!player.isSneaking()) {
|
||||
return EnumActionResult.FAIL;
|
||||
if (player.isSneaking()) {
|
||||
return evaluateTileHit(stack, player, world, pos, side) ? EnumActionResult.PASS : EnumActionResult.FAIL;
|
||||
}
|
||||
|
||||
return evaluateTileHit(stack, player, world, pos, side) ? EnumActionResult.PASS : EnumActionResult.FAIL;
|
||||
return super.onItemUseFirst(stack, player, world, pos, side, hitX, hitY, hitZ, hand);
|
||||
}
|
||||
|
||||
public static void tryStowing(EntityPlayer player, ItemStack backpackStack, ItemStack stack) {
|
||||
@@ -138,7 +138,7 @@ public class ItemBackpack extends ItemWithGui implements IColoredItem {
|
||||
|
||||
private static IItemHandler getInventoryHit(World world, BlockPos pos, EnumFacing side) {
|
||||
TileEntity targeted = world.getTileEntity(pos);
|
||||
return TileUtil.getInventoryFromTile(targeted, side);
|
||||
return TileUtil.getInventoryFromTile(targeted, null);
|
||||
}
|
||||
|
||||
private boolean evaluateTileHit(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side) {
|
||||
@@ -217,10 +217,10 @@ public class ItemBackpack extends ItemWithGui implements IColoredItem {
|
||||
models[1] = new ModelResourceLocation("forestry:" + typeTag + "_locked", "inventory");
|
||||
models[2] = new ModelResourceLocation("forestry:" + typeTag + "_receive", "inventory");
|
||||
models[3] = new ModelResourceLocation("forestry:" + typeTag + "_resupply", "inventory");
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:" + typeTag + "_neutral"));
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:" + typeTag + "_locked"));
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:" + typeTag + "_receive"));
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:" + typeTag + "_resupply"));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:" + typeTag + "_neutral"));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:" + typeTag + "_locked"));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:" + typeTag + "_receive"));
|
||||
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:" + typeTag + "_resupply"));
|
||||
manager.registerItemModel(item, new BackpackMeshDefinition());
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"forge_marker": 1,
|
||||
"variants": {
|
||||
"inventory": {
|
||||
"model": "forge:forgebucket",
|
||||
"textures": {
|
||||
"base": "forestry:items/liquids/can.bottle",
|
||||
"fluid": "forestry:items/liquids/can.contents"
|
||||
},
|
||||
"transform": "forge:default-item"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"forge_marker": 1,
|
||||
"variants": {
|
||||
"inventory": {
|
||||
"model": "forge:forgebucket",
|
||||
"textures": {
|
||||
"base": "forestry:items/liquids/capsule.bottle",
|
||||
"fluid": "forestry:items/liquids/capsule.contents"
|
||||
},
|
||||
"transform": "forge:default-item"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"forge_marker": 1,
|
||||
"variants": {
|
||||
"inventory": {
|
||||
"model": "forge:forgebucket",
|
||||
"textures": {
|
||||
"base": "forestry:items/liquids/refractory.bottle",
|
||||
"fluid": "forestry:items/liquids/refractory.contents"
|
||||
},
|
||||
"transform": "forge:default-item"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "forestry:items/liquids/can.bottle",
|
||||
"layer1": "forestry:items/liquids/can.contents"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "forestry:items/liquids/capsule.bottle",
|
||||
"layer1": "forestry:items/liquids/capsule.contents"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "forestry:items/liquids/refractory.bottle",
|
||||
"layer1": "forestry:items/liquids/refractory.contents"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 165 B |
|
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 174 B |
|
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 169 B |
|
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 171 B |
|
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 183 B |