Block class rename
This commit is contained in:
parent
4b55bf30a8
commit
5f3547de8e
157 changed files with 748 additions and 756 deletions
|
@ -0,0 +1,59 @@
|
|||
package ru.betterend.blocks.basis;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
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.TrapdoorBlock;
|
||||
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.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class EndTrapdoorBlock extends TrapdoorBlock implements IRenderTypeable, BlockPatterned {
|
||||
public EndTrapdoorBlock(Block source) {
|
||||
super(FabricBlockSettings.copyOf(source).nonOpaque());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) {
|
||||
return Collections.singletonList(new ItemStack(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ERenderLayer getRenderLayer() {
|
||||
return ERenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
String block = Registry.BLOCK.getId(this).getPath();
|
||||
return Patterns.createJson(data, block, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
String name = blockId.getPath();
|
||||
return Patterns.createJson(Patterns.BLOCK_TRAPDOOR, new HashMap<String, String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
{
|
||||
put("%block%", name);
|
||||
put("%texture%", name.replace("trapdoor", "door_side"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterns.STATE_TRAPDOOR;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue