Start migration

This commit is contained in:
Aleksey 2021-04-08 21:55:07 +03:00
parent 6630ce0cab
commit 47ed597358
491 changed files with 12045 additions and 11953 deletions

View file

@ -5,41 +5,42 @@ 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.StairsBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.StairsBlock;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.core.Registry;
import ru.betterend.patterns.BlockPatterned;
import ru.betterend.patterns.Patterns;
public class EndStairsBlock extends StairsBlock implements BlockPatterned {
private final Block parent;
public EndStairsBlock(Block source) {
super(source.getDefaultState(), FabricBlockSettings.copyOf(source));
super(source.defaultBlockState(), FabricBlockSettings.copyOf(source));
this.parent = source;
}
@Override
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) {
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
return Collections.singletonList(new ItemStack(this));
}
@Override
public String getStatesPattern(Reader data) {
Identifier blockId = Registry.BLOCK.getId(this);
Identifier parentId = Registry.BLOCK.getId(parent);
ResourceLocation blockId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
return Patterns.createJson(data, parentId.getPath(), blockId.getPath());
}
@Override
public String getModelPattern(String block) {
Identifier blockId = Registry.BLOCK.getId(this);
Identifier parentId = Registry.BLOCK.getId(parent);
ResourceLocation blockId = Registry.BLOCK.getKey(this);
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
if (block.contains("inner")) {
return Patterns.createJson(Patterns.BLOCK_STAIR_INNER, parentId.getPath(), blockId.getPath());
}
@ -48,9 +49,9 @@ public class EndStairsBlock extends StairsBlock implements BlockPatterned {
}
return Patterns.createJson(Patterns.BLOCK_STAIR, parentId.getPath(), blockId.getPath());
}
@Override
public Identifier statePatternId() {
public ResourceLocation statePatternId() {
return Patterns.STATE_STAIRS;
}
}