Continue mapping migration
This commit is contained in:
parent
99ade39404
commit
f03fd03bd0
499 changed files with 12567 additions and 12723 deletions
|
@ -4,48 +4,50 @@ import java.io.Reader;
|
|||
import java.util.List;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.ChestBlock;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
import ru.betterend.registry.EndBlockEntities;
|
||||
|
||||
public class EndChestBlock extends ChestBlock implements BlockPatterned {
|
||||
private final Block parent;
|
||||
|
||||
|
||||
public EndChestBlock(Block source) {
|
||||
super(FabricBlockSettings.copyOf(source).nonOpaque(), () -> {
|
||||
super(FabricBlockSettings.copyOf(source).noOcclusion(), () -> {
|
||||
return EndBlockEntities.CHEST;
|
||||
});
|
||||
this.parent = source;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BlockEntity createBlockEntity(BlockView world) {
|
||||
return EndBlockEntities.CHEST.instantiate();
|
||||
public BlockEntity newBlockEntity(BlockGetter world)
|
||||
{
|
||||
return EndBlockEntities.CHEST.create();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder)
|
||||
{
|
||||
List<ItemStack> drop = super.getDrops(state, builder);
|
||||
drop.add(new ItemStack(this.asItem()));
|
||||
return drop;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
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 path) {
|
||||
ResourceLocation blockId = Registry.BLOCK.getKey(this);
|
||||
|
@ -55,7 +57,7 @@ public class EndChestBlock extends ChestBlock implements BlockPatterned {
|
|||
}
|
||||
return Patterns.createJson(Patterns.BLOCK_EMPTY, parentId.getPath());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResourceLocation statePatternId() {
|
||||
return Patterns.STATE_SIMPLE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue