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;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.StairBlock;
import net.minecraft.world.level.block.state.BlockState;
2019-11-04 19:08:49 +01:00
import java.util.function.Supplier;
2018-11-03 13:23:10 +01:00
public class BlockStairsNA extends StairBlock 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) {
super(modelState, properties.dynamicShape());
2018-11-03 13:23:10 +01:00
this.baseName = baseName;
2020-01-29 00:40:28 +01:00
this.textureName = textureName;
2022-06-27 15:24:04 +02:00
ModRegistry.ALL_ITEMS.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
}