mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-15 01:24:59 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a8f1751d9 | ||
|
|
b95bb8315f | ||
|
|
2cc2540bdc | ||
|
|
84af238d82 | ||
|
|
89960db2bd | ||
|
|
c5f53bda3e | ||
|
|
2e1b62e58d | ||
|
|
982aefa165 | ||
|
|
2cccf95775 |
No files matched your search
+1
-1
@@ -8,4 +8,4 @@ ic2_version=2.6.5-ex110
|
||||
|
||||
version_major=5
|
||||
version_minor=2
|
||||
version_patch=2
|
||||
version_patch=4
|
||||
@@ -9,6 +9,7 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -38,7 +39,7 @@ public interface IModelBaker {
|
||||
|
||||
void addModel(@Nonnull AxisAlignedBB renderBounds, @Nonnull TextureAtlasSprite texture, int colorIndex);
|
||||
|
||||
void addBakedModel(@Nonnull IBakedModel model);
|
||||
void addBakedModel(@Nullable IBlockState state, @Nonnull IBakedModel model);
|
||||
|
||||
void addFace(@Nonnull EnumFacing facing, @Nonnull TextureAtlasSprite sprite);
|
||||
|
||||
|
||||
@@ -12,10 +12,11 @@ package forestry.apiculture.blocks;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.blocks.BlockBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BlockApiculture extends BlockBase<BlockTypeApiculture> {
|
||||
public BlockApiculture(BlockTypeApiculture type) {
|
||||
super(type);
|
||||
super(type, Material.WOOD);
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setHarvestLevel("axe", 0);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ package forestry.apiculture.blocks;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
@@ -36,7 +37,7 @@ public class BlockRegistryApiculture extends BlockRegistry {
|
||||
beeHouse = new BlockApiculture(BlockTypeApiculture.BEE_HOUSE);
|
||||
registerBlock(beeHouse, new ItemBlockForestry(beeHouse), "bee_house");
|
||||
|
||||
beeChest = new BlockBase<>(BlockTypeApicultureTesr.APIARIST_CHEST);
|
||||
beeChest = new BlockBase<>(BlockTypeApicultureTesr.APIARIST_CHEST, Material.WOOD);
|
||||
registerBlock(beeChest, new ItemBlockForestry(beeChest), "bee_chest");
|
||||
beeChest.setCreativeTab(Tabs.tabApiculture);
|
||||
beeChest.setHarvestLevel("axe", 0);
|
||||
|
||||
@@ -15,21 +15,13 @@ import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IBeeHousingInventory;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IBeekeepingLogic;
|
||||
import forestry.api.core.BiomeHelper;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
@@ -48,6 +40,13 @@ import forestry.core.network.DataOutputStreamForestry;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.BlockUtil;
|
||||
import forestry.core.utils.Translator;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
public class AlvearyController extends RectangularMultiblockControllerBase implements IAlvearyControllerInternal, IClimateControlled {
|
||||
|
||||
@@ -355,8 +354,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;
|
||||
Biome biome = getBiome();
|
||||
if (beeModifier.isHellish() || BiomeHelper.isBiomeHellish(biome)) {
|
||||
if (tempChange >= 0) {
|
||||
return EnumTemperature.HELLISH;
|
||||
}
|
||||
}
|
||||
|
||||
return EnumTemperature.getFromValue(getExactTemperature());
|
||||
|
||||
@@ -12,10 +12,12 @@ package forestry.arboriculture.blocks;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.blocks.BlockBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BlockArboriculture extends BlockBase<BlockTypeArboricultureTesr> {
|
||||
public BlockArboriculture(BlockTypeArboricultureTesr type) {
|
||||
super(type);
|
||||
super(type, Material.WOOD);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setHarvestLevel("axe", 0);
|
||||
}
|
||||
}
|
||||
@@ -531,7 +531,7 @@ public abstract class BlockPile extends BlockStructure implements ITileEntityPro
|
||||
}
|
||||
|
||||
public static IAlleleTreeSpecies getTreeSpecies(ItemStack stack) {
|
||||
if (stack != null) {
|
||||
if (stack != null && stack.hasTagCompound()) {
|
||||
NBTTagCompound tagCompound = stack.getTagCompound();
|
||||
|
||||
// legacy
|
||||
|
||||
@@ -74,8 +74,8 @@ public class BlockBase<P extends Enum<P> & IBlockType & IStringSerializable> ext
|
||||
|
||||
protected final BlockStateContainer blockState;
|
||||
|
||||
public BlockBase(@Nonnull P blockType) {
|
||||
super(Material.IRON);
|
||||
public BlockBase(@Nonnull P blockType, Material material) {
|
||||
super(material);
|
||||
|
||||
this.blockType = blockType;
|
||||
blockType.getMachineProperties().setBlock(this);
|
||||
@@ -90,6 +90,10 @@ public class BlockBase<P extends Enum<P> & IBlockType & IStringSerializable> ext
|
||||
|
||||
particleCallback = new MachineParticleCallback<>(this, blockType);
|
||||
}
|
||||
|
||||
public BlockBase(@Nonnull P blockType) {
|
||||
this(blockType, Material.IRON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
|
||||
@@ -13,5 +13,6 @@ package forestry.core.blocks;
|
||||
public class BlockCore extends BlockBase<BlockTypeCoreTesr> {
|
||||
public BlockCore(BlockTypeCoreTesr blockType) {
|
||||
super(blockType);
|
||||
setHarvestLevel("pickaxe", 0);
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,9 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
@@ -48,6 +50,15 @@ public class ItemForestryTool extends ItemForestry {
|
||||
public void setEfficiencyOnProperMaterial(float efficiencyOnProperMaterial) {
|
||||
this.efficiencyOnProperMaterial = efficiencyOnProperMaterial;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(IBlockState block) {
|
||||
if(this == PluginCore.items.bronzePickaxe){
|
||||
Material material = block.getMaterial();
|
||||
return material == Material.ROCK ? true : (material == Material.IRON ? true : material == Material.ANVIL);
|
||||
}
|
||||
return super.canHarvestBlock(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack itemstack, IBlockState state) {
|
||||
@@ -56,6 +67,10 @@ public class ItemForestryTool extends ItemForestry {
|
||||
return efficiencyOnProperMaterial;
|
||||
}
|
||||
}
|
||||
if(this == PluginCore.items.bronzePickaxe){
|
||||
Material material = state.getMaterial();
|
||||
return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(itemstack, state) : this.efficiencyOnProperMaterial;
|
||||
}
|
||||
return super.getStrVsBlock(itemstack, state);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -60,6 +61,7 @@ import gnu.trove.map.hash.TIntObjectHashMap;
|
||||
public class ModelCrate extends BlankItemModel {
|
||||
|
||||
private static final Map<String, IBakedModel> cache = Maps.newHashMap();
|
||||
private static final String CUSTOM_CRATES = "forestry:item/crates/";
|
||||
|
||||
private static IModel crateModel;
|
||||
private static ModelBlock MODEL_GENERATED;
|
||||
@@ -174,6 +176,24 @@ public class ModelCrate extends BlankItemModel {
|
||||
return new CrateOverrideList();
|
||||
}
|
||||
|
||||
private static IModel getCustomContentModel(ItemCrated crateItem){
|
||||
ItemStack contained = crateItem.getContained();
|
||||
if(contained != null){
|
||||
try {
|
||||
return ModelLoaderRegistry.getModel(getCustomContentModelLocation(crateItem));
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static ResourceLocation getCustomContentModelLocation(ItemCrated crateItem){
|
||||
String containedName = crateItem.getRegistryName().getResourcePath().replace("crated.", "");
|
||||
return new ResourceLocation(CUSTOM_CRATES + containedName);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Bake the crate model.
|
||||
*/
|
||||
@@ -181,6 +201,7 @@ public class ModelCrate extends BlankItemModel {
|
||||
List<IBakedModel> models = new ArrayList<>();
|
||||
|
||||
IBakedModel containedModel = getModel(crateItem.getContained());
|
||||
IModel customContentModel = getCustomContentModel(crateItem);
|
||||
|
||||
IdentityHashMap<Item, TIntObjectHashMap<ModelResourceLocation>> modelResourceLocations = ObfuscationReflectionHelper.getPrivateValue(ItemModelMesherForge.class, (ItemModelMesherForge) Minecraft.getMinecraft().getRenderItem().getItemModelMesher(), 0);
|
||||
|
||||
@@ -189,6 +210,11 @@ public class ModelCrate extends BlankItemModel {
|
||||
|
||||
models.add(crateModel);
|
||||
|
||||
if(customContentModel != null){
|
||||
containedModel = customContentModel.bake(ModelManager.getInstance().DEFAULT_ITEM, DefaultVertexFormats.ITEM, new DefaultTextureGetter());
|
||||
location = getCustomContentModelLocation(crateItem);
|
||||
}
|
||||
|
||||
if (hasItemModel(location)) {
|
||||
models.add(new TRSRBakedModel(containedModel, -0.0625F, 0, 0.0625F, 0.5F));
|
||||
models.add(new TRSRBakedModel(containedModel, -0.0625F, 0, -0.0625F, 0.5F));
|
||||
|
||||
@@ -13,6 +13,7 @@ package forestry.core.models.baker;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.lwjgl.util.vector.Vector3f;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -48,7 +49,7 @@ public class ModelBaker implements IModelBaker {
|
||||
|
||||
private static final float quadsUV[] = new float[]{0, 0, 1, 1, 0, 0, 1, 1};
|
||||
private final List<ModelBakerFace> faces = new ArrayList<>();
|
||||
private final List<IBakedModel> bakedModels = new ArrayList<>();
|
||||
private final List<Pair<IBlockState, IBakedModel>> bakedModels = new ArrayList<>();
|
||||
|
||||
protected AxisAlignedBB renderBounds;
|
||||
|
||||
@@ -126,8 +127,10 @@ public class ModelBaker implements IModelBaker {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBakedModel(@Nonnull IBakedModel model) {
|
||||
this.bakedModels.add(model);
|
||||
public void addBakedModel(@Nullable IBlockState state, @Nonnull IBakedModel model) {
|
||||
if(model != null){
|
||||
this.bakedModels.add(Pair.of(state, model));
|
||||
}
|
||||
}
|
||||
|
||||
protected static float[] getFaceUvs(final EnumFacing face, final Vector3f to_16, final Vector3f from_16) {
|
||||
@@ -217,7 +220,7 @@ public class ModelBaker implements IModelBaker {
|
||||
}
|
||||
|
||||
//Add baked models to the current model.
|
||||
for(IBakedModel bakedModel : bakedModels){
|
||||
for(Pair<IBlockState, IBakedModel> bakedModel : bakedModels){
|
||||
currentModel.addModelQuads(bakedModel);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ModelBakerModel implements IModelBakerModel {
|
||||
|
||||
private final Map<EnumFacing, List<BakedQuad>> faceQuads;
|
||||
private final List<BakedQuad> generalQuads;
|
||||
private final List<IBakedModel> models;
|
||||
private final List<Pair<IBlockState, IBakedModel>> models;
|
||||
|
||||
private float[] rotation = getDefaultRotation();
|
||||
private float[] translation = getDefaultTranslation();
|
||||
@@ -68,7 +68,7 @@ public class ModelBakerModel implements IModelBakerModel {
|
||||
}
|
||||
}
|
||||
|
||||
private ModelBakerModel(List<IBakedModel> models, Map<EnumFacing, List<BakedQuad>> faceQuads, List<BakedQuad> generalQuads, boolean isGui3d, boolean isAmbientOcclusion, IModelState modelState, float[] rotation, float[] translation, float[] scale, TextureAtlasSprite particleSprite) {
|
||||
private ModelBakerModel(List<Pair<IBlockState, IBakedModel>> models, Map<EnumFacing, List<BakedQuad>> faceQuads, List<BakedQuad> generalQuads, boolean isGui3d, boolean isAmbientOcclusion, IModelState modelState, float[] rotation, float[] translation, float[] scale, TextureAtlasSprite particleSprite) {
|
||||
this.models = models;
|
||||
this.faceQuads = faceQuads;
|
||||
this.generalQuads = generalQuads;
|
||||
@@ -178,8 +178,10 @@ public class ModelBakerModel implements IModelBakerModel {
|
||||
return modelState;
|
||||
}
|
||||
|
||||
public void addModelQuads(IBakedModel model) {
|
||||
this.models.add(model);
|
||||
public void addModelQuads(Pair<IBlockState, IBakedModel> model) {
|
||||
if(model != null){
|
||||
this.models.add(model);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -194,8 +196,11 @@ public class ModelBakerModel implements IModelBakerModel {
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) {
|
||||
List<BakedQuad> quads = new ArrayList<>();
|
||||
for (IBakedModel model : this.models) {
|
||||
quads.addAll(model.getQuads(state, side, rand));
|
||||
for (Pair<IBlockState, IBakedModel> model : this.models) {
|
||||
List<BakedQuad> modelQuads = model.getRight().getQuads(model.getLeft(), side, rand);
|
||||
if(modelQuads != null && !modelQuads.isEmpty()){
|
||||
quads.addAll(modelQuads);
|
||||
}
|
||||
}
|
||||
if(side != null){
|
||||
quads.addAll(faceQuads.get(side));
|
||||
|
||||
@@ -64,15 +64,15 @@ public class CamouflageUtil {
|
||||
}
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if(tile instanceof ICamouflageHandler){
|
||||
return (ICamouflageHandler) tile;
|
||||
}
|
||||
if(tile instanceof IMultiblockComponent){
|
||||
IMultiblockComponent component = (IMultiblockComponent) tile;
|
||||
if(component.getMultiblockLogic().getController() instanceof ICamouflageHandler){
|
||||
return (ICamouflageHandler) component.getMultiblockLogic().getController();
|
||||
}
|
||||
}
|
||||
if(tile instanceof ICamouflageHandler){
|
||||
return (ICamouflageHandler) tile;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ public class BlockEngine extends BlockBase<BlockTypeEngine> {
|
||||
|
||||
public BlockEngine(BlockTypeEngine blockType) {
|
||||
super(blockType);
|
||||
setHarvestLevel("pickaxe", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,5 +15,6 @@ import forestry.core.blocks.BlockBase;
|
||||
public class BlockFactoryPlain extends BlockBase<BlockTypeFactoryPlain> {
|
||||
public BlockFactoryPlain(BlockTypeFactoryPlain type) {
|
||||
super(type);
|
||||
setHarvestLevel("pickaxe", 0);
|
||||
}
|
||||
}
|
||||
@@ -15,5 +15,6 @@ import forestry.core.blocks.BlockBase;
|
||||
public class BlockFactoryTESR extends BlockBase<BlockTypeFactoryTesr> {
|
||||
public BlockFactoryTESR(BlockTypeFactoryTesr type) {
|
||||
super(type);
|
||||
setHarvestLevel("pickaxe", 0);
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.greenhouse;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -71,23 +72,23 @@ public class PluginGreenhouse extends BlankForestryPlugin {
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
|
||||
ItemStack greenhousePlainBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.PLAIN);
|
||||
Block greenhousePlainBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.PLAIN);
|
||||
RecipeUtil.addRecipe(greenhousePlainBlock,
|
||||
"###",
|
||||
"#X#",
|
||||
"###",
|
||||
'X', Blocks.BRICK_BLOCK,
|
||||
'#', PluginCore.items.craftingMaterial.getCamouflagedPaneling());
|
||||
|
||||
ItemStack greenhouseGlassBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.GLASS);
|
||||
|
||||
Block greenhouseGlassBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.GLASS);
|
||||
RecipeUtil.addRecipe(greenhouseGlassBlock,
|
||||
"###",
|
||||
"#X#",
|
||||
"###",
|
||||
'X', "blockGlass",
|
||||
'#', PluginCore.items.craftingMaterial.getCamouflagedPaneling());
|
||||
|
||||
ItemStack greenhouseHatchInputBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.HATCH_INPUT);
|
||||
|
||||
Block greenhouseHatchInputBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.HATCH_INPUT);
|
||||
RecipeUtil.addRecipe(greenhouseHatchInputBlock,
|
||||
"TXT",
|
||||
"#H#",
|
||||
@@ -95,8 +96,8 @@ public class PluginGreenhouse extends BlankForestryPlugin {
|
||||
'H', OreDictUtil.TRAPDOOR_WOOD,
|
||||
'#', "gearTin",
|
||||
'T', PluginCore.items.tubes.get(EnumElectronTube.BRONZE, 1));
|
||||
|
||||
ItemStack greenhouseHatchOutputBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.HATCH_OUTPUT);
|
||||
|
||||
Block greenhouseHatchOutputBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.HATCH_OUTPUT);
|
||||
RecipeUtil.addRecipe(greenhouseHatchOutputBlock,
|
||||
"#H#",
|
||||
"TXT",
|
||||
@@ -104,31 +105,31 @@ public class PluginGreenhouse extends BlankForestryPlugin {
|
||||
'H', OreDictUtil.TRAPDOOR_WOOD,
|
||||
'#', "gearTin",
|
||||
'T', PluginCore.items.tubes.get(EnumElectronTube.BRONZE, 1));
|
||||
|
||||
ItemStack greenhouseControlBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.CONTROL);
|
||||
|
||||
Block greenhouseControlBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.CONTROL);
|
||||
RecipeUtil.addRecipe(greenhouseControlBlock,
|
||||
" X ",
|
||||
"#T#",
|
||||
'X', blocks.getGreenhouseBlock(BlockGreenhouseType.PLAIN),
|
||||
'#', "dustRedstone",
|
||||
'T', PluginCore.items.tubes.get(EnumElectronTube.GOLD, 1));
|
||||
|
||||
ItemStack greenhouseGearBoxBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.GEARBOX);
|
||||
|
||||
Block greenhouseGearBoxBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.GEARBOX);
|
||||
RecipeUtil.addRecipe(greenhouseGearBoxBlock,
|
||||
" X ",
|
||||
"###",
|
||||
'X', blocks.getGreenhouseBlock(BlockGreenhouseType.PLAIN),
|
||||
'#', "gearTin");
|
||||
|
||||
ItemStack greenhouseValveBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.VALVE);
|
||||
|
||||
Block greenhouseValveBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.VALVE);
|
||||
RecipeUtil.addRecipe(greenhouseValveBlock,
|
||||
" X ",
|
||||
"#G#",
|
||||
'X', blocks.getGreenhouseBlock(BlockGreenhouseType.PLAIN),
|
||||
'#', "blockGlass",
|
||||
'G', "gearTin");
|
||||
|
||||
ItemStack greenhouseHeaterBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.HEATER);
|
||||
|
||||
Block greenhouseHeaterBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.HEATER);
|
||||
RecipeUtil.addRecipe(greenhouseHeaterBlock,
|
||||
"T#T",
|
||||
"#X#",
|
||||
@@ -136,8 +137,8 @@ public class PluginGreenhouse extends BlankForestryPlugin {
|
||||
'X', blocks.getGreenhouseBlock(BlockGreenhouseType.PLAIN),
|
||||
'#', "ingotGold",
|
||||
'T', PluginCore.items.tubes.get(EnumElectronTube.GOLD, 1));
|
||||
|
||||
ItemStack greenhouseFanlock = blocks.getGreenhouseBlock(BlockGreenhouseType.FAN);
|
||||
|
||||
Block greenhouseFanlock = blocks.getGreenhouseBlock(BlockGreenhouseType.FAN);
|
||||
RecipeUtil.addRecipe(greenhouseFanlock,
|
||||
"T#T",
|
||||
"#X#",
|
||||
@@ -145,8 +146,8 @@ public class PluginGreenhouse extends BlankForestryPlugin {
|
||||
'X', blocks.getGreenhouseBlock(BlockGreenhouseType.PLAIN),
|
||||
'#', "ingotTin",
|
||||
'T', PluginCore.items.tubes.get(EnumElectronTube.TIN, 1));
|
||||
|
||||
ItemStack greenhouseDryerBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.DRYER);
|
||||
|
||||
Block greenhouseDryerBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.DRYER);
|
||||
RecipeUtil.addRecipe(greenhouseDryerBlock,
|
||||
"T#T",
|
||||
"#X#",
|
||||
@@ -154,8 +155,8 @@ public class PluginGreenhouse extends BlankForestryPlugin {
|
||||
'X', blocks.getGreenhouseBlock(BlockGreenhouseType.PLAIN),
|
||||
'#', "ingotBronze",
|
||||
'T', PluginCore.items.tubes.get(EnumElectronTube.BLAZE, 1));
|
||||
|
||||
ItemStack greenhouseSprinklerBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.SPRINKLER);
|
||||
|
||||
Block greenhouseSprinklerBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.SPRINKLER);
|
||||
RecipeUtil.addRecipe(greenhouseSprinklerBlock,
|
||||
"TXT",
|
||||
" I ",
|
||||
@@ -163,14 +164,15 @@ public class PluginGreenhouse extends BlankForestryPlugin {
|
||||
'X', blocks.getGreenhouseBlock(BlockGreenhouseType.GLASS),
|
||||
'I', "ingotIron",
|
||||
'T', PluginCore.items.tubes.get(EnumElectronTube.LAPIS, 1));
|
||||
|
||||
ItemStack greenhouseDoorBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.DOOR);
|
||||
|
||||
Block greenhouseDoorBlock = blocks.getGreenhouseBlock(BlockGreenhouseType.DOOR);
|
||||
RecipeUtil.addRecipe(greenhouseDoorBlock,
|
||||
true,
|
||||
"GG ",
|
||||
"GG ",
|
||||
"GG ",
|
||||
'G', blocks.getGreenhouseBlock(BlockGreenhouseType.GLASS));
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FACTORY)) {
|
||||
RecipeManagers.carpenterManager.addRecipe(50, Fluids.BIOMASS.getFluid(500), null, PluginCore.items.craftingMaterial.getCamouflagedPaneling(),
|
||||
" A ", "###", "RPR",
|
||||
|
||||
@@ -140,7 +140,7 @@ public abstract class BlockGreenhouse extends BlockStructure implements ISpriteR
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos) {
|
||||
if (getGreenhouseType() == BlockGreenhouseType.SPRINKLER) {
|
||||
return SPRINKLER_BOUNDS;
|
||||
return SPRINKLER_BOUNDS.offset(pos);
|
||||
}
|
||||
return super.getSelectedBoundingBox(state, worldIn, pos);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package forestry.greenhouse.blocks;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.core.blocks.BlockRegistry;
|
||||
import forestry.core.items.ItemBlockForestry;
|
||||
@@ -24,9 +24,8 @@ public class BlockRegistryGreenhouse extends BlockRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack getGreenhouseBlock(BlockGreenhouseType type) {
|
||||
BlockGreenhouse greenhouseBlock = greenhouseBlockMap.get(type);
|
||||
return new ItemStack(greenhouseBlock);
|
||||
public BlockGreenhouse getGreenhouseBlock(BlockGreenhouseType type) {
|
||||
return greenhouseBlockMap.get(type);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BlockModelShapes;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
@@ -51,8 +52,9 @@ public class ModelGreenhouse extends ModelBlockDefault<BlockGreenhouse> {
|
||||
private static void bakeBlockModel(@Nonnull BlockGreenhouse block, @Nullable IBlockAccess world, @Nullable BlockPos pos, @Nullable IExtendedBlockState stateExtended, @Nonnull IModelBaker baker, @Nullable ItemStack camouflageStack) {
|
||||
if (camouflageStack != null) {
|
||||
BlockModelShapes modelShapes = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes();
|
||||
IBlockState state = Block.getBlockFromItem(camouflageStack.getItem()).getStateFromMeta(camouflageStack.getItemDamage());
|
||||
|
||||
baker.addBakedModel(modelShapes.getModelForState(Block.getBlockFromItem(camouflageStack.getItem()).getStateFromMeta(camouflageStack.getItemDamage())));
|
||||
baker.addBakedModel(state, modelShapes.getModelForState(state));
|
||||
baker.setParticleSprite(modelShapes.getModelForState(Block.getBlockFromItem(camouflageStack.getItem()).getStateFromMeta(camouflageStack.getItemDamage())).getParticleTexture());
|
||||
}
|
||||
|
||||
|
||||
@@ -34,9 +34,14 @@ public class ProxyGreenhouseClient extends ProxyGreenhouse {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileGreenhouseSprinkler.class, new AnimationTESR<>());
|
||||
continue;
|
||||
}
|
||||
Proxies.render.registerBlockModel(new BlockModelIndex(new ModelResourceLocation("forestry:greenhouse." + greenhouseType),
|
||||
new ModelResourceLocation("forestry:greenhouse", "inventory"), new ModelGreenhouse(),
|
||||
Block.getBlockFromItem(PluginGreenhouse.blocks.getGreenhouseBlock(greenhouseType).getItem())));
|
||||
|
||||
Block greenhouseBlock = PluginGreenhouse.blocks.getGreenhouseBlock(greenhouseType);
|
||||
if (greenhouseBlock != null) {
|
||||
ModelResourceLocation blockModelLocation = new ModelResourceLocation("forestry:greenhouse." + greenhouseType);
|
||||
ModelResourceLocation itemModelLocation = new ModelResourceLocation("forestry:greenhouse", "inventory");
|
||||
BlockModelIndex blockModelIndex = new BlockModelIndex(blockModelLocation, itemModelLocation, new ModelGreenhouse(), greenhouseBlock);
|
||||
Proxies.render.registerBlockModel(blockModelIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -158,7 +158,7 @@ public class BlockCocoon extends Block implements ITileEntityProvider, IStateMap
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos) {
|
||||
return BOUNDING_BOX;
|
||||
return BOUNDING_BOX.offset(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,10 +12,12 @@ package forestry.lepidopterology.blocks;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.blocks.BlockBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BlockLepidopterology extends BlockBase<BlockTypeLepidopterologyTesr> {
|
||||
public BlockLepidopterology(BlockTypeLepidopterologyTesr type) {
|
||||
super(type);
|
||||
super(type, Material.WOOD);
|
||||
setCreativeTab(Tabs.tabLepidopterology);
|
||||
setHarvestLevel("axe", 0);
|
||||
}
|
||||
}
|
||||
@@ -15,5 +15,6 @@ import forestry.core.blocks.BlockBase;
|
||||
public class BlockMail extends BlockBase<BlockTypeMail> {
|
||||
public BlockMail(BlockTypeMail blockType) {
|
||||
super(blockType);
|
||||
setHarvestLevel("pickaxe", 0);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,17 @@
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import forestry.core.blocks.BlockBase;
|
||||
import forestry.core.blocks.BlockRegistry;
|
||||
import forestry.energy.blocks.BlockEngine;
|
||||
import forestry.energy.blocks.BlockTypeEngine;
|
||||
import forestry.energy.items.ItemEngine;
|
||||
|
||||
public class BlockRegistryIC2 extends BlockRegistry {
|
||||
public final BlockEngine electricalEngine;
|
||||
public final BlockBase electricalEngine;
|
||||
public final BlockEngine generator;
|
||||
|
||||
public BlockRegistryIC2() {
|
||||
electricalEngine = new BlockEngine(BlockTypeEngine.ELECTRICAL);
|
||||
electricalEngine = new BlockBase(BlockTypeEngine.ELECTRICAL);
|
||||
registerBlock(electricalEngine, new ItemEngine(electricalEngine), "engine_electrical");
|
||||
|
||||
generator = new BlockEngine(BlockTypeEngine.GENERATOR);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"textures": {
|
||||
"particle": "forestry:blocks/lepidopterology/cocoons/cocoon_early",
|
||||
"0": "forestry:blocks/lepidopterology/cocoons/cocoon_early"
|
||||
},
|
||||
"elements": [
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"textures": {
|
||||
"particle": "forestry:blocks/lepidopterology/cocoons/cocoon_late",
|
||||
"0": "forestry:blocks/lepidopterology/cocoons/cocoon_late"
|
||||
},
|
||||
"elements": [
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"textures": {
|
||||
"particle": "forestry:blocks/lepidopterology/cocoons/cocoon_middle",
|
||||
"0": "forestry:blocks/lepidopterology/cocoons/cocoon_middle"
|
||||
},
|
||||
"elements": [
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"textures": {
|
||||
"particle": "forestry:blocks/lepidopterology/cocoons/cocoon_silk_late",
|
||||
"0": "forestry:blocks/lepidopterology/cocoons/cocoon_silk_late"
|
||||
},
|
||||
"elements": [
|
||||
|
||||
Reference in new issue
Block a user