use of forestry.api.arboriculture.IWoodType in project Binnie by ForestryMC.
the class ModuleWood method registerWithoutVariants.
private <T extends Block & IWoodTyped> void registerWithoutVariants(WoodAccess woodAccess, T woodTyped, WoodBlockKind woodBlockKind) {
boolean fireproof = woodTyped.isFireproof();
IBlockState blockState = woodTyped.getDefaultState();
IWoodType woodType = woodTyped.getWoodType(0);
ItemStack itemStack = new ItemStack(woodTyped);
if (!(woodType instanceof EnumVanillaWoodType)) {
ModuleArboriculture.proxy.registerWoodModel(woodTyped, false);
}
woodAccess.register(woodType, woodBlockKind, fireproof, blockState, itemStack);
}
use of forestry.api.arboriculture.IWoodType in project Binnie by ForestryMC.
the class ItemBlockETWood method getItemStackDisplayName.
@Override
public String getItemStackDisplayName(ItemStack itemstack) {
IWoodTyped wood = getBlock();
int meta = itemstack.getMetadata();
IWoodType woodType = wood.getWoodType(meta);
return WoodManager.getDisplayName(wood, woodType);
}
use of forestry.api.arboriculture.IWoodType in project YABBA by LatvianModder.
the class ForestryIntegration method registerSkins.
@SubscribeEvent
public static void registerSkins(YabbaSkinsEvent event) {
Yabba.LOGGER.info("Loading Forestry Integration");
for (IWoodType type : TreeManager.woodAccess.getRegisteredWoodTypes()) {
if (!(type instanceof EnumVanillaWoodType)) {
try {
BarrelSkin skin = new BarrelSkin(OtherMods.FORESTRY + ":planks_" + type.getName(), TextureSet.of("all=" + type.getPlankTexture()));
try {
skin.state = TreeManager.woodAccess.getBlock(type, WoodBlockKind.PLANKS, false);
} catch (Exception ex1) {
}
skin.displayName = TreeManager.woodAccess.getStack(type, WoodBlockKind.PLANKS, false).getDisplayName();
event.addSkin(skin);
skin = new BarrelSkin(OtherMods.FORESTRY + ":log_" + type.getName(), TextureSet.of("up&down=" + type.getHeartTexture() + ",all=" + type.getBarkTexture()));
try {
skin.state = TreeManager.woodAccess.getBlock(type, WoodBlockKind.LOG, false);
} catch (Exception ex1) {
}
skin.displayName = TreeManager.woodAccess.getStack(type, WoodBlockKind.LOG, false).getDisplayName();
event.addSkin(skin);
} catch (Exception ex) {
}
}
}
}
use of forestry.api.arboriculture.IWoodType in project ForestryMC by ForestryMC.
the class WoodAccess method registerWithVariants.
private <T extends Block & IWoodTyped, V extends Enum<V> & IWoodType> void registerWithVariants(T woodTyped, WoodBlockKind woodBlockKind, PropertyWoodType<V> property) {
boolean fireproof = woodTyped.isFireproof();
for (V value : property.getAllowedValues()) {
IBlockState blockState = woodTyped.getDefaultState().withProperty(property, value);
int meta = woodTyped.getMetaFromState(blockState);
IWoodType woodType = woodTyped.getWoodType(meta);
ItemStack itemStack = new ItemStack(woodTyped, 1, meta);
if (!(woodType instanceof EnumVanillaWoodType)) {
ModuleArboriculture.proxy.registerWoodModel(woodTyped, true);
}
register(woodType, woodBlockKind, fireproof, blockState, itemStack);
}
}
use of forestry.api.arboriculture.IWoodType in project ForestryMC by ForestryMC.
the class WoodHelper method getResourceLocations.
public static ResourceLocation[] getResourceLocations(IWoodTyped typed) {
List<ResourceLocation> resourceLocations = new ArrayList<>();
WoodBlockKind blockKind = typed.getBlockKind();
for (IWoodType woodType : typed.getWoodTypes()) {
if (woodType instanceof EnumVanillaWoodType) {
resourceLocations.add(new ResourceLocation("minecraft", woodType + "_" + blockKind));
} else {
resourceLocations.add(new ResourceLocation(Constants.MOD_ID, blockKind + "/" + woodType));
}
}
return resourceLocations.toArray(new ResourceLocation[resourceLocations.size()]);
}
Aggregations