NaturesAura/src/main/java/de/ellpeck/naturesaura/blocks/BlockStairsNA.java

35 lines
1.1 KiB
Java
Raw Normal View History

2018-11-03 13:23:10 +01:00
package de.ellpeck.naturesaura.blocks;
2020-01-29 00:40:28 +01:00
import de.ellpeck.naturesaura.data.BlockStateGenerator;
import de.ellpeck.naturesaura.reg.ICustomBlockState;
2018-11-03 13:23:10 +01:00
import de.ellpeck.naturesaura.reg.IModItem;
import de.ellpeck.naturesaura.reg.ModRegistry;
2019-11-04 19:08:49 +01:00
import net.minecraft.block.Block;
2019-10-20 22:30:49 +02:00
import net.minecraft.block.BlockState;
2019-11-04 19:08:49 +01:00
import net.minecraft.block.StairsBlock;
import java.util.function.Supplier;
2018-11-03 13:23:10 +01:00
2020-01-29 00:40:28 +01:00
public class BlockStairsNA extends StairsBlock implements IModItem, ICustomBlockState {
2018-11-03 13:23:10 +01:00
2020-01-29 00:40:28 +01:00
public final String textureName;
2020-02-07 15:22:30 +01:00
private final String baseName;
2018-11-03 13:23:10 +01:00
2020-01-29 00:40:28 +01:00
public BlockStairsNA(String baseName, String textureName, Supplier<BlockState> modelState, Block.Properties properties) {
2019-11-04 19:08:49 +01:00
super(modelState, properties.variableOpacity());
2018-11-03 13:23:10 +01:00
this.baseName = baseName;
2020-01-29 00:40:28 +01:00
this.textureName = textureName;
2018-11-29 17:58:47 +01:00
ModRegistry.add(this);
2018-11-03 13:23:10 +01:00
}
@Override
public String getBaseName() {
return this.baseName;
}
2020-01-29 00:40:28 +01:00
@Override
public void generateCustomBlockState(BlockStateGenerator generator) {
generator.stairsBlock(this, generator.modLoc("block/" + this.textureName));
}
2018-11-03 13:23:10 +01:00
}