Add fence gates

This commit is contained in:
Nedelosk committed 2016-03-20 09:17:09 +01:00
1 parent 806b5121a8
commit 9f62f1f853
6 files changed
+29 -7

No files matched your search

@@ -8,7 +8,6 @@ package forestry.api.greenhouse;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import forestry.api.core.IErrorLogicSource;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
public interface IGreenhouseHousing extends IErrorLogicSource {
@@ -40,6 +40,8 @@ public class BlockRegistryArboriculture extends BlockRegistry {
public final List<BlockArbSlab> slabsDoubleFireproof;
public final List<BlockArbFence> fences;
public final List<BlockArbFence> fencesFireproof;
public final List<BlockArbFenceGate> fenceGates;
public final List<BlockArbFenceGate> fenceGatesFireproof;
public final List<BlockArbStairs> stairs;
public final List<BlockArbStairs> stairsFireproof;
@@ -108,6 +110,18 @@ public class BlockRegistryArboriculture extends BlockRegistry {
registerOreDictWildcard("fenceWood", fenceFireproof);
fencesFireproof.add(fenceFireproof);
}
fenceGates = new ArrayList<>();
fenceGatesFireproof = new ArrayList<>();
for (EnumWoodType woodType : EnumWoodType.VALUES) {
BlockArbFenceGate fence = registerBlock(new BlockArbFenceGate(false, woodType), ItemBlockWood.class, "fence.gates." + woodType);
registerOreDictWildcard("fenceGateWood", fence);
fenceGates.add(fence);
BlockArbFenceGate fenceFireproof = registerBlock(new BlockArbFenceGate(true, woodType), ItemBlockWood.class, "fence.gates.fireproof." + woodType);
registerOreDictWildcard("fenceGateWood", fenceFireproof);
fenceGatesFireproof.add(fenceFireproof);
}
stairs = new ArrayList<>();
for (BlockArbPlanks plank : planks) {
@@ -5,6 +5,8 @@ import com.google.common.collect.Maps;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import net.minecraft.block.Block;
@@ -12,7 +14,6 @@ import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -29,6 +30,8 @@ class WoodTypeStateMapper extends StateMapperBase {
private final String blockPath;
@Nullable
private final PropertyWoodType propertyWoodType;
@Nonnull
private final List<IProperty> propertysToRemove = new ArrayList();
public WoodTypeStateMapper(@Nonnull IWoodTyped woodTyped, @Nullable PropertyWoodType propertyWoodType) {
this.woodTyped = woodTyped;
@@ -41,6 +44,11 @@ class WoodTypeStateMapper extends StateMapperBase {
this.blockPath = blockPath;
this.propertyWoodType = propertyWoodType;
}
public WoodTypeStateMapper addPropertyToRemove(IProperty property){
this.propertysToRemove.add(property);
return this;
}
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
@@ -49,7 +57,11 @@ class WoodTypeStateMapper extends StateMapperBase {
properties = Maps.newLinkedHashMap(state.getProperties());
properties.remove(propertyWoodType);
} else {
properties = state.getProperties();
properties = Maps.newLinkedHashMap(state.getProperties());
}
for(IProperty property : propertysToRemove){
properties.remove(property);
}
Block block = state.getBlock();
@@ -10,11 +10,9 @@
******************************************************************************/
package forestry.greenhouse;
import forestry.api.core.IClimateManager;
import forestry.api.greenhouse.IGreenhouseHelper;
import forestry.api.greenhouse.IGreenhouseState;
import forestry.api.greenhouse.IInternalBlock;
import forestry.api.multiblock.IGreenhouseController;
import forestry.core.multiblock.IMultiblockControllerInternal;
import forestry.core.multiblock.MultiblockRegistry;
import forestry.greenhouse.multiblock.IGreenhouseControllerInternal;
@@ -30,7 +30,6 @@ import forestry.api.greenhouse.GreenhouseEvents.CreateInternalBlockEvent;
import forestry.api.core.EnumCamouflageType;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import forestry.api.core.ForestryAPI;
import forestry.api.core.ICamouflagedBlock;
import forestry.api.multiblock.IGreenhouseComponent;
import forestry.api.multiblock.IGreenhouseController;