WIP: patterns
This commit is contained in:
parent
bd5d7e3937
commit
7e1d018140
48 changed files with 787 additions and 10 deletions
|
@ -4,19 +4,36 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SlabBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.loot.context.LootContext;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class BlockSlab extends SlabBlock {
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.interfaces.Patterned;
|
||||
|
||||
public class BlockSlab extends SlabBlock implements Patterned {
|
||||
public BlockSlab(Block source) {
|
||||
super(FabricBlockSettings.copyOf(source).nonOpaque());
|
||||
super(FabricBlockSettings.copyOf(source));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) {
|
||||
return Collections.singletonList(new ItemStack(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String blockStatePattern(String name) {
|
||||
Identifier patternId = BetterEnd.makeID("patterns/blockstate/pattern_slab.json");
|
||||
return Patterned.createJson(patternId, name.replace("_slab", ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String modelPattern(String name) {
|
||||
Identifier patternId = BetterEnd.makeID("patterns/block/pattern_slab.json");
|
||||
return Patterned.createJson(patternId, name.replace("_slab", ""));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ public class EndModelProvider implements ModelResourceProvider {
|
|||
|
||||
public static final UnbakedModel FLAVOLITE_BLOCK = new BaseBlockModel("block/flavolite");
|
||||
public static final UnbakedModel FLAVOLITE_SLAB = new SlabModel("block/flavolite");
|
||||
public static final UnbakedModel FLAVOLITE_SLAB_TOP = new SlabTopModel("block/flavolite");
|
||||
|
||||
public static void registerModel(String path, UnbakedModel model) {
|
||||
MODELS.put(BetterEnd.makeID(path), model);
|
||||
|
@ -39,7 +38,5 @@ public class EndModelProvider implements ModelResourceProvider {
|
|||
registerModel("item/flavolite", FLAVOLITE_BLOCK);
|
||||
registerModel("block/flavolite", FLAVOLITE_BLOCK);
|
||||
registerModel("item/flavolite_slab", FLAVOLITE_SLAB);
|
||||
registerModel("block/flavolite_slab", FLAVOLITE_SLAB);
|
||||
registerModel("block/flavolite_slab_top", FLAVOLITE_SLAB_TOP);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue