Patterns refactor
This commit is contained in:
parent
ce8ae2e7fe
commit
14434e4028
33 changed files with 397 additions and 356 deletions
|
@ -8,7 +8,7 @@ import net.minecraft.util.Identifier;
|
|||
import net.minecraft.util.registry.Registry;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.blocks.basis.BlockPedestal;
|
||||
import ru.betterend.interfaces.Patterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class EndPedestal extends BlockPedestal {
|
||||
|
||||
|
@ -31,16 +31,16 @@ public class EndPedestal extends BlockPedestal {
|
|||
}
|
||||
};
|
||||
if (block.contains("column_top")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_COLUMN_TOP, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_COLUMN_TOP, textures);
|
||||
} else if (block.contains("column")) {
|
||||
return Patterned.createJson(Patterned.BLOKC_PEDESTAL_COLUMN, textures);
|
||||
return Patterns.createJson(Patterns.BLOKC_PEDESTAL_COLUMN, textures);
|
||||
} else if (block.contains("top")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_TOP, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_TOP, textures);
|
||||
} else if (block.contains("bottom")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_BOTTOM, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_BOTTOM, textures);
|
||||
} else if (block.contains("pillar")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_PILLAR, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_PILLAR, textures);
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_DEFAULT, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_DEFAULT, textures);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import ru.betterend.blocks.basis.BlockPedestal;
|
||||
import ru.betterend.interfaces.Patterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class PedestalVanilla extends BlockPedestal {
|
||||
|
||||
|
@ -30,16 +30,16 @@ public class PedestalVanilla extends BlockPedestal {
|
|||
}
|
||||
};
|
||||
if (block.contains("column_top")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_COLUMN_TOP, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_COLUMN_TOP, textures);
|
||||
} else if (block.contains("column")) {
|
||||
return Patterned.createJson(Patterned.BLOKC_PEDESTAL_COLUMN, textures);
|
||||
return Patterns.createJson(Patterns.BLOKC_PEDESTAL_COLUMN, textures);
|
||||
} else if (block.contains("top")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_TOP, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_TOP, textures);
|
||||
} else if (block.contains("bottom")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_BOTTOM, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_BOTTOM, textures);
|
||||
} else if (block.contains("pillar")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_PILLAR, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_PILLAR, textures);
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_DEFAULT, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_DEFAULT, textures);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@ import java.io.Reader;
|
|||
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.interfaces.Patterned;
|
||||
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockBark extends BlockPillar {
|
||||
public BlockBark(Settings settings) {
|
||||
|
@ -15,15 +15,13 @@ public class BlockBark extends BlockPillar {
|
|||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
String name = getName(blockId);
|
||||
return Patterned.createJson(Patterned.BLOCK_BASE, BetterEnd.makeID(name), blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_BASE, getName(blockId), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
String name = getName(blockId);
|
||||
return Patterned.createJson(data, BetterEnd.makeID(name), blockId.getPath());
|
||||
return Patterns.createJson(data, getName(blockId), blockId.getPath());
|
||||
}
|
||||
|
||||
private String getName(Identifier blockId) {
|
||||
|
|
|
@ -26,10 +26,11 @@ import net.minecraft.util.registry.Registry;
|
|||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import ru.betterend.blocks.entities.EBarrelBlockEntity;
|
||||
import ru.betterend.interfaces.Patterned;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
import ru.betterend.registry.EndBlockEntities;
|
||||
|
||||
public class BlockBarrel extends BarrelBlock implements Patterned {
|
||||
public class BlockBarrel extends BarrelBlock implements BlockPatterned {
|
||||
public BlockBarrel(Block source) {
|
||||
super(FabricBlockSettings.copyOf(source).nonOpaque());
|
||||
}
|
||||
|
@ -89,21 +90,21 @@ public class BlockBarrel extends BarrelBlock implements Patterned {
|
|||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(data, blockId, blockId.getPath());
|
||||
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 texture = Registry.BLOCK.getId(this).getPath();
|
||||
if (block.contains("open")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_BARREL_OPEN, blockId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_BARREL_OPEN, texture, texture);
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_BOTTOM_TOP, blockId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_BOTTOM_TOP, texture, texture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_BARREL;
|
||||
return Patterns.STATE_BARREL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,9 +10,10 @@ 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;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockBase extends Block implements Patterned {
|
||||
public class BlockBase extends Block implements BlockPatterned {
|
||||
public BlockBase(Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
@ -24,18 +25,18 @@ public class BlockBase extends Block implements Patterned {
|
|||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(data, blockId, blockId.getPath());
|
||||
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);
|
||||
return Patterned.createJson(Patterned.BLOCK_BASE, blockId, block);
|
||||
return Patterns.createJson(Patterns.BLOCK_BASE, blockId.getPath(), block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_SIMPLE;
|
||||
return Patterns.STATE_SIMPLE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@ import net.minecraft.loot.context.LootContext;
|
|||
import net.minecraft.loot.context.LootContextParameters;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.interfaces.Patterned;
|
||||
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockBookshelf extends BlockBase {
|
||||
public BlockBookshelf(Block source) {
|
||||
|
@ -37,21 +37,19 @@ public class BlockBookshelf extends BlockBase {
|
|||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_SIMPLE;
|
||||
return Patterns.STATE_SIMPLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
String name = getName(blockId);
|
||||
return Patterned.createJson(Patterned.BLOCK_BOOKSHELF, BetterEnd.makeID(name), blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_BOOKSHELF, getName(blockId), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
String name = getName(blockId);
|
||||
return Patterned.createJson(data, BetterEnd.makeID(name), blockId.getPath());
|
||||
return Patterns.createJson(data, getName(blockId), blockId.getPath());
|
||||
}
|
||||
|
||||
private String getName(Identifier blockId) {
|
||||
|
|
|
@ -13,10 +13,11 @@ import net.minecraft.loot.context.LootContext;
|
|||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.BlockView;
|
||||
import ru.betterend.interfaces.Patterned;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
import ru.betterend.registry.EndBlockEntities;
|
||||
|
||||
public class BlockChest extends ChestBlock implements Patterned {
|
||||
public class BlockChest extends ChestBlock implements BlockPatterned {
|
||||
|
||||
private final Block parent;
|
||||
|
||||
|
@ -45,7 +46,7 @@ public class BlockChest extends ChestBlock implements Patterned {
|
|||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
return Patterned.createJson(data, parentId, blockId.getPath());
|
||||
return Patterns.createJson(data, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -53,13 +54,13 @@ public class BlockChest extends ChestBlock implements Patterned {
|
|||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
if (path.contains("item")) {
|
||||
return Patterned.createJson(Patterned.ITEM_CHEST, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.ITEM_CHEST, blockId.getPath());
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_EMPTY, parentId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_EMPTY, parentId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_SIMPLE;
|
||||
return Patterns.STATE_SIMPLE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,9 +13,10 @@ 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;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockCraftingTable extends CraftingTableBlock implements Patterned {
|
||||
public class BlockCraftingTable extends CraftingTableBlock implements BlockPatterned {
|
||||
public BlockCraftingTable(Block source) {
|
||||
super(FabricBlockSettings.copyOf(source));
|
||||
}
|
||||
|
@ -27,15 +28,15 @@ public class BlockCraftingTable extends CraftingTableBlock implements Patterned
|
|||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(data, blockId, blockId.getPath());
|
||||
String blockId = Registry.BLOCK.getId(this).getPath();
|
||||
return Patterns.createJson(data, blockId, blockId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
String blockName = blockId.getPath();
|
||||
return Patterned.createJson(Patterned.BLOCK_SIDED, new HashMap<String, String>() {
|
||||
return Patterns.createJson(Patterns.BLOCK_SIDED, new HashMap<String, String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
{
|
||||
put("%particle%", blockName + "_front");
|
||||
|
@ -51,6 +52,6 @@ public class BlockCraftingTable extends CraftingTableBlock implements Patterned
|
|||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_SIMPLE;
|
||||
return Patterns.STATE_SIMPLE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,9 +15,10 @@ 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.interfaces.Patterned;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockDoor extends DoorBlock implements IRenderTypeable, Patterned {
|
||||
public class BlockDoor extends DoorBlock implements IRenderTypeable, BlockPatterned {
|
||||
public BlockDoor(Block block) {
|
||||
super(FabricBlockSettings.copy(block).nonOpaque());
|
||||
}
|
||||
|
@ -37,30 +38,30 @@ public class BlockDoor extends DoorBlock implements IRenderTypeable, Patterned {
|
|||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(data, blockId, blockId.getPath());
|
||||
String blockId = Registry.BLOCK.getId(this).getPath();
|
||||
return Patterns.createJson(data, blockId, blockId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
String blockId = Registry.BLOCK.getId(this).getPath();
|
||||
if (block.contains("item")) {
|
||||
return Patterned.createJson(Patterned.ITEM_MODEL, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.ITEM_MODEL, blockId);
|
||||
}
|
||||
if (block.contains("top_hinge")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_DOOR_TOP_HINGE, blockId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_DOOR_TOP_HINGE, blockId, blockId);
|
||||
}
|
||||
if (block.contains("bottom_hinge")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_DOOR_BOTTOM_HINGE, blockId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_DOOR_BOTTOM_HINGE, blockId, blockId);
|
||||
}
|
||||
if (block.contains("top")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_DOOR_TOP, blockId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_DOOR_TOP, blockId, blockId);
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_DOOR_BOTTOM, blockId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_DOOR_BOTTOM, blockId, blockId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_DOOR;
|
||||
return Patterns.STATE_DOOR;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import net.minecraft.world.WorldView;
|
|||
import net.minecraft.world.gen.feature.Feature;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.interfaces.Patterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public abstract class BlockFeatureSapling extends BlockBaseNotFull implements Fertilizable, IRenderTypeable {
|
||||
|
@ -100,20 +100,20 @@ public abstract class BlockFeatureSapling extends BlockBaseNotFull implements Fe
|
|||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(data, blockId, blockId.getPath());
|
||||
return Patterns.createJson(data, blockId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
if (block.contains("item")) {
|
||||
block = block.split("/")[1];
|
||||
return Patterned.createJson(Patterned.ITEM_BLOCK, block);
|
||||
return Patterns.createJson(Patterns.ITEM_BLOCK, block);
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_SAPLING, block);
|
||||
return Patterns.createJson(Patterns.BLOCK_SAPLING, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_SAPLING;
|
||||
return Patterns.STATE_SAPLING;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,10 @@ 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;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockFence extends FenceBlock implements Patterned {
|
||||
public class BlockFence extends FenceBlock implements BlockPatterned {
|
||||
|
||||
private final Block parent;
|
||||
|
||||
|
@ -32,7 +33,7 @@ public class BlockFence extends FenceBlock implements Patterned {
|
|||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
return Patterned.createJson(data, parentId, blockId.getPath());
|
||||
return Patterns.createJson(data, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,16 +41,16 @@ public class BlockFence extends FenceBlock implements Patterned {
|
|||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
if (block.contains("item")) {
|
||||
return Patterned.createJson(Patterned.ITEM_FENCE, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.ITEM_FENCE, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
if (block.contains("side")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_FENCE_SIDE, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_FENCE_SIDE, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_FENCE_POST, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_FENCE_POST, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_FENCE;
|
||||
return Patterns.STATE_FENCE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,10 @@ 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;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockGate extends FenceGateBlock implements Patterned {
|
||||
public class BlockGate extends FenceGateBlock implements BlockPatterned {
|
||||
|
||||
private final Block parent;
|
||||
|
||||
|
@ -32,7 +33,7 @@ public class BlockGate extends FenceGateBlock implements Patterned {
|
|||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
return Patterned.createJson(data, parentId, blockId.getPath());
|
||||
return Patterns.createJson(data, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,19 +42,19 @@ public class BlockGate extends FenceGateBlock implements Patterned {
|
|||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
if (block.contains("wall")) {
|
||||
if (block.contains("open")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_GATE_OPEN_WALL, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_GATE_OPEN_WALL, parentId.getPath(), blockId.getPath());
|
||||
} else {
|
||||
return Patterned.createJson(Patterned.BLOCK_GATE_CLOSED_WALL, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_GATE_CLOSED_WALL, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
}
|
||||
if (block.contains("open")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_GATE_OPEN, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_GATE_OPEN, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_GATE_CLOSED, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_GATE_CLOSED, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_GATE;
|
||||
return Patterns.STATE_GATE;
|
||||
}
|
||||
}
|
|
@ -27,10 +27,11 @@ import net.minecraft.world.WorldAccess;
|
|||
import net.minecraft.world.WorldView;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.interfaces.Patterned;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class BlockLadder extends BlockBaseNotFull implements IRenderTypeable, Patterned {
|
||||
public class BlockLadder extends BlockBaseNotFull implements IRenderTypeable, BlockPatterned {
|
||||
public static final DirectionProperty FACING = HorizontalFacingBlock.FACING;
|
||||
public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
|
||||
protected static final VoxelShape EAST_SHAPE = Block.createCuboidShape(0.0D, 0.0D, 0.0D, 3.0D, 16.0D, 16.0D);
|
||||
|
@ -138,21 +139,21 @@ public class BlockLadder extends BlockBaseNotFull implements IRenderTypeable, Pa
|
|||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(data, blockId, blockId.getPath());
|
||||
String blockId = Registry.BLOCK.getId(this).getPath();
|
||||
return Patterns.createJson(data, blockId, blockId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
if (block.contains("item")) {
|
||||
return Patterned.createJson(Patterned.ITEM_BLOCK, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.ITEM_BLOCK, blockId.getPath());
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_LADDER, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_LADDER, blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_LADDER;
|
||||
return Patterns.STATE_LADDER;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,9 +10,10 @@ 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.interfaces.Patterned;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockLeaves extends LeavesBlock implements Patterned, IRenderTypeable {
|
||||
public class BlockLeaves extends LeavesBlock implements BlockPatterned, IRenderTypeable {
|
||||
public BlockLeaves(MaterialColor color) {
|
||||
super(FabricBlockSettings.copyOf(Blocks.OAK_LEAVES)
|
||||
.allowsSpawning((state, world, pos, type) -> { return false; })
|
||||
|
@ -32,19 +33,19 @@ public class BlockLeaves extends LeavesBlock implements Patterned, IRenderTypeab
|
|||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(data, blockId, blockId.getPath());
|
||||
String blockId = Registry.BLOCK.getId(this).getPath();
|
||||
return Patterns.createJson(data, blockId, blockId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(Patterned.BLOCK_BASE, blockId, blockId.getPath());
|
||||
String blockId = Registry.BLOCK.getId(this).getPath();
|
||||
return Patterns.createJson(Patterns.BLOCK_BASE, blockId, blockId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_SIMPLE;
|
||||
return Patterns.STATE_SIMPLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,7 +39,7 @@ import net.minecraft.world.WorldAccess;
|
|||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.blocks.BlockProperties.PedestalState;
|
||||
import ru.betterend.blocks.entities.PedestalBlockEntity;
|
||||
import ru.betterend.interfaces.Patterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
|
@ -304,8 +304,8 @@ public class BlockPedestal extends BlockBaseNotFull implements BlockEntityProvid
|
|||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(data, blockId, blockId.getPath());
|
||||
String texture = Registry.BLOCK.getId(this).getPath();
|
||||
return Patterns.createJson(data, texture, texture);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -323,22 +323,22 @@ public class BlockPedestal extends BlockBaseNotFull implements BlockEntityProvid
|
|||
}
|
||||
};
|
||||
if (block.contains("column_top")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_COLUMN_TOP, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_COLUMN_TOP, textures);
|
||||
} else if (block.contains("column")) {
|
||||
return Patterned.createJson(Patterned.BLOKC_PEDESTAL_COLUMN, textures);
|
||||
return Patterns.createJson(Patterns.BLOKC_PEDESTAL_COLUMN, textures);
|
||||
} else if (block.contains("top")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_TOP, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_TOP, textures);
|
||||
} else if (block.contains("bottom")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_BOTTOM, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_BOTTOM, textures);
|
||||
} else if (block.contains("pillar")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_PILLAR, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_PILLAR, textures);
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_PEDESTAL_DEFAULT, textures);
|
||||
return Patterns.createJson(Patterns.BLOCK_PEDESTAL_DEFAULT, textures);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_PEDESTAL;
|
||||
return Patterns.STATE_PEDESTAL;
|
||||
}
|
||||
|
||||
static {
|
||||
|
|
|
@ -10,9 +10,10 @@ 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;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockPillar extends PillarBlock implements Patterned {
|
||||
public class BlockPillar extends PillarBlock implements BlockPatterned {
|
||||
public BlockPillar(Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
@ -24,18 +25,18 @@ public class BlockPillar extends PillarBlock implements Patterned {
|
|||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(data, blockId, blockId.getPath());
|
||||
String texture = Registry.BLOCK.getId(this).getPath();
|
||||
return Patterns.createJson(data, texture, texture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(Patterned.BLOCK_PILLAR, blockId, blockId.getPath());
|
||||
String texture = Registry.BLOCK.getId(this).getPath();
|
||||
return Patterns.createJson(Patterns.BLOCK_PILLAR, texture, texture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_PILLAR;
|
||||
return Patterns.STATE_PILLAR;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,10 @@ 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;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockPressurePlate extends PressurePlateBlock implements Patterned {
|
||||
public class BlockPressurePlate extends PressurePlateBlock implements BlockPatterned {
|
||||
|
||||
private final Block parent;
|
||||
|
||||
|
@ -32,7 +33,7 @@ public class BlockPressurePlate extends PressurePlateBlock implements Patterned
|
|||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
return Patterned.createJson(data, parentId, blockId.getPath());
|
||||
return Patterns.createJson(data, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,13 +41,13 @@ public class BlockPressurePlate extends PressurePlateBlock implements Patterned
|
|||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
if (block.contains("down")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PLATE_DOWN, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_PLATE_DOWN, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_PLATE_UP, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_PLATE_UP, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_PLATE;
|
||||
return Patterns.STATE_PLATE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,9 +38,10 @@ import net.minecraft.world.World;
|
|||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.WorldView;
|
||||
import ru.betterend.blocks.entities.ESignBlockEntity;
|
||||
import ru.betterend.interfaces.Patterned;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockSign extends AbstractSignBlock implements Patterned {
|
||||
public class BlockSign extends AbstractSignBlock implements BlockPatterned {
|
||||
public static final IntProperty ROTATION = Properties.ROTATION;
|
||||
public static final BooleanProperty FLOOR = BooleanProperty.of("floor");
|
||||
private static final VoxelShape[] WALL_SHAPES = new VoxelShape[] {
|
||||
|
@ -154,7 +155,7 @@ public class BlockSign extends AbstractSignBlock implements Patterned {
|
|||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
return Patterned.createJson(data, parentId, blockId.getPath());
|
||||
return Patterns.createJson(data, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -162,14 +163,14 @@ public class BlockSign extends AbstractSignBlock implements Patterned {
|
|||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
if (path.contains("item")) {
|
||||
return Patterned.createJson(Patterned.ITEM_MODEL, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.ITEM_MODEL, blockId.getPath());
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_EMPTY, parentId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_EMPTY, parentId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_SIMPLE;
|
||||
return Patterns.STATE_SIMPLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,7 +10,7 @@ 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.interfaces.Patterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockSimpleLeaves extends BlockBaseNotFull implements IRenderTypeable {
|
||||
public BlockSimpleLeaves(MaterialColor color) {
|
||||
|
@ -38,19 +38,19 @@ public class BlockSimpleLeaves extends BlockBaseNotFull implements IRenderTypeab
|
|||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(data, blockId, blockId.getPath());
|
||||
String texture = Registry.BLOCK.getId(this).getPath();
|
||||
return Patterns.createJson(data, texture, texture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(Patterned.BLOCK_BASE, blockId, blockId.getPath());
|
||||
String texture = Registry.BLOCK.getId(this).getPath();
|
||||
return Patterns.createJson(Patterns.BLOCK_BASE, texture, texture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_SIMPLE;
|
||||
return Patterns.STATE_SIMPLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -12,9 +12,10 @@ 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;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockSlab extends SlabBlock implements Patterned {
|
||||
public class BlockSlab extends SlabBlock implements BlockPatterned {
|
||||
|
||||
private final Block parent;
|
||||
|
||||
|
@ -32,18 +33,18 @@ public class BlockSlab extends SlabBlock implements Patterned {
|
|||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
return Patterned.createJson(data, parentId, blockId.getPath());
|
||||
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);
|
||||
return Patterned.createJson(Patterned.BLOCK_SLAB, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_SLAB, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_SLAB;
|
||||
return Patterns.STATE_SLAB;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,10 @@ 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;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockStairs extends StairsBlock implements Patterned {
|
||||
public class BlockStairs extends StairsBlock implements BlockPatterned {
|
||||
|
||||
private final Block parent;
|
||||
|
||||
|
@ -32,7 +33,7 @@ public class BlockStairs extends StairsBlock implements Patterned {
|
|||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
return Patterned.createJson(data, parentId, blockId.getPath());
|
||||
return Patterns.createJson(data, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,16 +41,16 @@ public class BlockStairs extends StairsBlock implements Patterned {
|
|||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
if (block.contains("inner")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_STAIR_INNER, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_STAIR_INNER, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
if (block.contains("outer")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_STAIR_OUTER, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_STAIR_OUTER, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_STAIR, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_STAIR, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_STAIRS;
|
||||
return Patterns.STATE_STAIRS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,10 @@ 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;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockStoneButton extends StoneButtonBlock implements Patterned {
|
||||
public class BlockStoneButton extends StoneButtonBlock implements BlockPatterned {
|
||||
|
||||
private final Block parent;
|
||||
|
||||
|
@ -32,7 +33,7 @@ public class BlockStoneButton extends StoneButtonBlock implements Patterned {
|
|||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
return Patterned.createJson(data, parentId, blockId.getPath());
|
||||
return Patterns.createJson(data, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,16 +41,16 @@ public class BlockStoneButton extends StoneButtonBlock implements Patterned {
|
|||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
if (block.contains("item")) {
|
||||
return Patterned.createJson(Patterned.ITEM_BUTTON, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.ITEM_BUTTON, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
if (block.contains("pressed")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_BUTTON_PRESSED, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_BUTTON_PRESSED, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_BUTTON, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_BUTTON, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_BUTTON;
|
||||
return Patterns.STATE_BUTTON;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ import net.minecraft.world.WorldAccess;
|
|||
import net.minecraft.world.WorldView;
|
||||
import ru.betterend.blocks.AuroraCrystalBlock;
|
||||
import ru.betterend.interfaces.IColorProvider;
|
||||
import ru.betterend.interfaces.Patterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
import ru.betterend.util.MHelper;
|
||||
|
||||
public class BlockStoneLantern extends BlockBaseNotFull implements IColorProvider, Waterloggable {
|
||||
|
@ -126,21 +126,21 @@ public class BlockStoneLantern extends BlockBaseNotFull implements IColorProvide
|
|||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_STONE_LANTERN;
|
||||
return Patterns.STATE_STONE_LANTERN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModelPattern(String block) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
String texture = Registry.BLOCK.getId(this).getPath();
|
||||
if (block.contains("ceil")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_STONE_LANTERN_CEIL, blockId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_CEIL, texture, texture);
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_STONE_LANTERN_FLOOR, blockId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_FLOOR, texture, texture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(data, blockId, blockId.getPath());
|
||||
String block = Registry.BLOCK.getId(this).getPath();
|
||||
return Patterns.createJson(data, block, block);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,10 @@ 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;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockStonePressurePlate extends PressurePlateBlock implements Patterned {
|
||||
public class BlockStonePressurePlate extends PressurePlateBlock implements BlockPatterned {
|
||||
|
||||
private final Block parent;
|
||||
|
||||
|
@ -32,7 +33,7 @@ public class BlockStonePressurePlate extends PressurePlateBlock implements Patte
|
|||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
return Patterned.createJson(data, parentId, blockId.getPath());
|
||||
return Patterns.createJson(data, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,13 +41,13 @@ public class BlockStonePressurePlate extends PressurePlateBlock implements Patte
|
|||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
if (block.contains("down")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_PLATE_DOWN, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_PLATE_DOWN, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_PLATE_UP, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_PLATE_UP, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_PLATE;
|
||||
return Patterns.STATE_PLATE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,9 +15,10 @@ 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.interfaces.Patterned;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockTrapdoor extends TrapdoorBlock implements IRenderTypeable, Patterned {
|
||||
public class BlockTrapdoor extends TrapdoorBlock implements IRenderTypeable, BlockPatterned {
|
||||
public BlockTrapdoor(Block source) {
|
||||
super(FabricBlockSettings.copyOf(source).nonOpaque());
|
||||
}
|
||||
|
@ -34,15 +35,15 @@ public class BlockTrapdoor extends TrapdoorBlock implements IRenderTypeable, Pat
|
|||
|
||||
@Override
|
||||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
return Patterned.createJson(data, blockId, blockId.getPath());
|
||||
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 Patterned.createJson(Patterned.BLOCK_TRAPDOOR, new HashMap<String, String>() {
|
||||
return Patterns.createJson(Patterns.BLOCK_TRAPDOOR, new HashMap<String, String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
{
|
||||
put("%block%", name);
|
||||
|
@ -53,6 +54,6 @@ public class BlockTrapdoor extends TrapdoorBlock implements IRenderTypeable, Pat
|
|||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_TRAPDOOR;
|
||||
return Patterns.STATE_TRAPDOOR;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,10 @@ 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;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockWall extends WallBlock implements Patterned {
|
||||
public class BlockWall extends WallBlock implements BlockPatterned {
|
||||
|
||||
private final Block parent;
|
||||
|
||||
|
@ -32,7 +33,7 @@ public class BlockWall extends WallBlock implements Patterned {
|
|||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
return Patterned.createJson(data, parentId, blockId.getPath());
|
||||
return Patterns.createJson(data, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,19 +41,19 @@ public class BlockWall extends WallBlock implements Patterned {
|
|||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
if (block.contains("item")) {
|
||||
return Patterned.createJson(Patterned.ITEM_WALL, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.ITEM_WALL, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
if (block.contains("side_tall")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_WALL_SIDE_TALL, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_WALL_SIDE_TALL, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
if (block.contains("side")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_WALL_SIDE, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_WALL_SIDE, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_WALL_POST, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_WALL_POST, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_WALL;
|
||||
return Patterns.STATE_WALL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,9 +12,10 @@ 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;
|
||||
import ru.betterend.patterns.BlockPatterned;
|
||||
import ru.betterend.patterns.Patterns;
|
||||
|
||||
public class BlockWoodenButton extends WoodenButtonBlock implements Patterned {
|
||||
public class BlockWoodenButton extends WoodenButtonBlock implements BlockPatterned {
|
||||
|
||||
private final Block parent;
|
||||
|
||||
|
@ -32,7 +33,7 @@ public class BlockWoodenButton extends WoodenButtonBlock implements Patterned {
|
|||
public String getStatesPattern(Reader data) {
|
||||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
return Patterned.createJson(data, parentId, blockId.getPath());
|
||||
return Patterns.createJson(data, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,16 +41,16 @@ public class BlockWoodenButton extends WoodenButtonBlock implements Patterned {
|
|||
Identifier blockId = Registry.BLOCK.getId(this);
|
||||
Identifier parentId = Registry.BLOCK.getId(parent);
|
||||
if (block.contains("item")) {
|
||||
return Patterned.createJson(Patterned.ITEM_BUTTON, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.ITEM_BUTTON, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
if (block.contains("pressed")) {
|
||||
return Patterned.createJson(Patterned.BLOCK_BUTTON_PRESSED, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_BUTTON_PRESSED, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
return Patterned.createJson(Patterned.BLOCK_BUTTON, parentId, blockId.getPath());
|
||||
return Patterns.createJson(Patterns.BLOCK_BUTTON, parentId.getPath(), blockId.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier statePatternId() {
|
||||
return Patterned.STATE_BUTTON;
|
||||
return Patterns.STATE_BUTTON;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue