41 lines
1.2 KiB
Java
41 lines
1.2 KiB
Java
package ru.betterend.blocks.basis;
|
|
|
|
import java.io.Reader;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
import net.minecraft.block.BlockState;
|
|
import net.minecraft.block.PillarBlock;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.loot.context.LootContext;
|
|
import net.minecraft.util.Identifier;
|
|
import net.minecraft.util.registry.Registry;
|
|
import ru.betterend.interfaces.Patterned;
|
|
|
|
public class BlockPillar extends PillarBlock implements Patterned {
|
|
public BlockPillar(Settings settings) {
|
|
super(settings);
|
|
}
|
|
|
|
@Override
|
|
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) {
|
|
return Collections.singletonList(new ItemStack(this));
|
|
}
|
|
|
|
@Override
|
|
public String getStatesPattern(Reader data) {
|
|
Identifier blockId = Registry.BLOCK.getId(this);
|
|
return Patterned.createJson(data, blockId, blockId.getPath());
|
|
}
|
|
|
|
@Override
|
|
public String getModelPattern(String block) {
|
|
Identifier blockId = Registry.BLOCK.getId(this);
|
|
return Patterned.createJson(Patterned.BLOCK_PILLAR, blockId, blockId.getPath());
|
|
}
|
|
|
|
@Override
|
|
public Identifier statePatternId() {
|
|
return Patterned.STATE_PILLAR;
|
|
}
|
|
}
|