TextureMapping.java

net.minecraft.client.data.models.model.TextureMapping

信息

  • 全限定名:net.minecraft.client.data.models.model.TextureMapping
  • 类型:public class
  • 包:net.minecraft.client.data.models.model
  • 源码路径:src/main/java/net/minecraft/client/data/models/model/TextureMapping.java
  • 起始行号:L19
  • 职责:

    TODO

字段/常量

  • slots

    • 类型: Map<TextureSlot,Material>
    • 修饰符: private final
    • 源码定位: L20
    • 说明:

      TODO

  • forcedSlots

    • 类型: Set<TextureSlot>
    • 修饰符: private final
    • 源码定位: L21
    • 说明:

      TODO

内部类/嵌套类型

构造器

方法

下面的方法块按源码顺序生成。

public TextureMapping put(TextureSlot slot, Material material) @ L23

  • 方法名:put
  • 源码定位:L23
  • 返回类型:TextureMapping
  • 修饰符:public

参数:

  • slot: TextureSlot
  • material: Material

说明:

TODO

public TextureMapping putForced(TextureSlot slot, Material material) @ L28

  • 方法名:putForced
  • 源码定位:L28
  • 返回类型:TextureMapping
  • 修饰符:public

参数:

  • slot: TextureSlot
  • material: Material

说明:

TODO

public Stream<TextureSlot> getForced() @ L34

  • 方法名:getForced
  • 源码定位:L34
  • 返回类型:Stream
  • 修饰符:public

参数:

说明:

TODO

public TextureMapping copySlot(TextureSlot from, TextureSlot to) @ L38

  • 方法名:copySlot
  • 源码定位:L38
  • 返回类型:TextureMapping
  • 修饰符:public

参数:

  • from: TextureSlot
  • to: TextureSlot

说明:

TODO

public TextureMapping copyForced(TextureSlot from, TextureSlot to) @ L42

  • 方法名:copyForced
  • 源码定位:L42
  • 返回类型:TextureMapping
  • 修饰符:public

参数:

  • from: TextureSlot
  • to: TextureSlot

说明:

TODO

public Material get(TextureSlot slot) @ L46

  • 方法名:get
  • 源码定位:L46
  • 返回类型:Material
  • 修饰符:public

参数:

  • slot: TextureSlot

说明:

TODO

public TextureMapping copyAndUpdate(TextureSlot slot, Material material) @ L57

  • 方法名:copyAndUpdate
  • 源码定位:L57
  • 返回类型:TextureMapping
  • 修饰符:public

参数:

  • slot: TextureSlot
  • material: Material

说明:

TODO

public TextureMapping updateSlots(BiFunction<TextureSlot,Material,Material> mapper) @ L65

  • 方法名:updateSlots
  • 源码定位:L65
  • 返回类型:TextureMapping
  • 修饰符:public

参数:

  • mapper: BiFunction<TextureSlot,Material,Material>

说明:

TODO

public TextureMapping forceAllTranslucent() @ L70

  • 方法名:forceAllTranslucent
  • 源码定位:L70
  • 返回类型:TextureMapping
  • 修饰符:public

参数:

说明:

TODO

public static TextureMapping cube(Block block) @ L74

  • 方法名:cube
  • 源码定位:L74
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping defaultTexture(Block block) @ L79

  • 方法名:defaultTexture
  • 源码定位:L79
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping defaultTexture(Material texture) @ L84

  • 方法名:defaultTexture
  • 源码定位:L84
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • texture: Material

说明:

TODO

public static TextureMapping cube(Material all) @ L88

  • 方法名:cube
  • 源码定位:L88
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • all: Material

说明:

TODO

public static TextureMapping cross(Block block) @ L92

  • 方法名:cross
  • 源码定位:L92
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping side(Block block) @ L96

  • 方法名:side
  • 源码定位:L96
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping crossEmissive(Block block) @ L100

  • 方法名:crossEmissive
  • 源码定位:L100
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping cross(Material cross) @ L104

  • 方法名:cross
  • 源码定位:L104
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • cross: Material

说明:

TODO

public static TextureMapping plant(Block block) @ L108

  • 方法名:plant
  • 源码定位:L108
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping plantEmissive(Block block) @ L112

  • 方法名:plantEmissive
  • 源码定位:L112
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping plant(Material plant) @ L116

  • 方法名:plant
  • 源码定位:L116
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • plant: Material

说明:

TODO

public static TextureMapping rail(Block block) @ L120

  • 方法名:rail
  • 源码定位:L120
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping rail(Material rail) @ L124

  • 方法名:rail
  • 源码定位:L124
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • rail: Material

说明:

TODO

public static TextureMapping wool(Block block) @ L128

  • 方法名:wool
  • 源码定位:L128
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping flowerbed(Block block) @ L132

  • 方法名:flowerbed
  • 源码定位:L132
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping wool(Material cross) @ L136

  • 方法名:wool
  • 源码定位:L136
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • cross: Material

说明:

TODO

public static TextureMapping stem(Block block) @ L140

  • 方法名:stem
  • 源码定位:L140
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping attachedStem(Block stem, Block upperStem) @ L144

  • 方法名:attachedStem
  • 源码定位:L144
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • stem: Block
  • upperStem: Block

说明:

TODO

public static TextureMapping pattern(Block block) @ L148

  • 方法名:pattern
  • 源码定位:L148
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping fan(Block block) @ L152

  • 方法名:fan
  • 源码定位:L152
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping crop(Material id) @ L156

  • 方法名:crop
  • 源码定位:L156
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • id: Material

说明:

TODO

public static TextureMapping pane(Block body, Block edge) @ L160

  • 方法名:pane
  • 源码定位:L160
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • body: Block
  • edge: Block

说明:

TODO

public static TextureMapping singleSlot(TextureSlot slot, Material id) @ L164

  • 方法名:singleSlot
  • 源码定位:L164
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • slot: TextureSlot
  • id: Material

说明:

TODO

public static TextureMapping column(Block block) @ L168

  • 方法名:column
  • 源码定位:L168
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping cubeTop(Block block) @ L172

  • 方法名:cubeTop
  • 源码定位:L172
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping pottedAzalea(Block block) @ L176

  • 方法名:pottedAzalea
  • 源码定位:L176
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping logColumn(Block block) @ L183

  • 方法名:logColumn
  • 源码定位:L183
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping column(Material side, Material end) @ L190

  • 方法名:column
  • 源码定位:L190
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • side: Material
  • end: Material

说明:

TODO

public static TextureMapping fence(Block block) @ L194

  • 方法名:fence
  • 源码定位:L194
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping customParticle(Block block) @ L201

  • 方法名:customParticle
  • 源码定位:L201
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping cubeBottomTop(Block block) @ L205

  • 方法名:cubeBottomTop
  • 源码定位:L205
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping cubeBottomTopWithWall(Block block) @ L212

  • 方法名:cubeBottomTopWithWall
  • 源码定位:L212
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping columnWithWall(Block block) @ L221

  • 方法名:columnWithWall
  • 源码定位:L221
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping door(Material top, Material bottom) @ L230

  • 方法名:door
  • 源码定位:L230
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • top: Material
  • bottom: Material

说明:

TODO

public static TextureMapping door(Block block) @ L234

  • 方法名:door
  • 源码定位:L234
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping particle(Block block) @ L238

  • 方法名:particle
  • 源码定位:L238
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping particle(Material id) @ L242

  • 方法名:particle
  • 源码定位:L242
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • id: Material

说明:

TODO

public static TextureMapping fire0(Block block) @ L246

  • 方法名:fire0
  • 源码定位:L246
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping fire1(Block block) @ L250

  • 方法名:fire1
  • 源码定位:L250
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping lantern(Block block) @ L254

  • 方法名:lantern
  • 源码定位:L254
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping torch(Block block) @ L258

  • 方法名:torch
  • 源码定位:L258
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping torch(Material id) @ L262

  • 方法名:torch
  • 源码定位:L262
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • id: Material

说明:

TODO

public static TextureMapping trialSpawner(Block block, String sideSuffix, String topSuffix) @ L266

  • 方法名:trialSpawner
  • 源码定位:L266
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block
  • sideSuffix: String
  • topSuffix: String

说明:

TODO

public static TextureMapping vault(Block block, String frontSuffix, String sideSuffix, String topSuffix, String bottomSuffix) @ L273

  • 方法名:vault
  • 源码定位:L273
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block
  • frontSuffix: String
  • sideSuffix: String
  • topSuffix: String
  • bottomSuffix: String

说明:

TODO

public static TextureMapping particleFromItem(Item item) @ L281

  • 方法名:particleFromItem
  • 源码定位:L281
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • item: Item

说明:

TODO

public static TextureMapping commandBlock(Block block) @ L285

  • 方法名:commandBlock
  • 源码定位:L285
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping orientableCube(Block block) @ L292

  • 方法名:orientableCube
  • 源码定位:L292
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping orientableCubeOnlyTop(Block block) @ L300

  • 方法名:orientableCubeOnlyTop
  • 源码定位:L300
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping orientableCubeSameEnds(Block block) @ L307

  • 方法名:orientableCubeSameEnds
  • 源码定位:L307
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping top(Block block) @ L314

  • 方法名:top
  • 源码定位:L314
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping craftingTable(Block table, Block bottomWood) @ L318

  • 方法名:craftingTable
  • 源码定位:L318
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • table: Block
  • bottomWood: Block

说明:

TODO

public static TextureMapping fletchingTable(Block table, Block bottomWood) @ L329

  • 方法名:fletchingTable
  • 源码定位:L329
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • table: Block
  • bottomWood: Block

说明:

TODO

public static TextureMapping snifferEgg(String suffix) @ L340

  • 方法名:snifferEgg
  • 源码定位:L340
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • suffix: String

说明:

TODO

public static TextureMapping driedGhast(String suffix) @ L351

  • 方法名:driedGhast
  • 源码定位:L351
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • suffix: String

说明:

TODO

public static TextureMapping campfire(Block campfire) @ L363

  • 方法名:campfire
  • 源码定位:L363
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • campfire: Block

说明:

TODO

public static TextureMapping candleCake(Block block, boolean lit) @ L367

  • 方法名:candleCake
  • 源码定位:L367
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block
  • lit: boolean

说明:

TODO

public static TextureMapping cauldron(Material contentTextureLoc) @ L376

  • 方法名:cauldron
  • 源码定位:L376
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • contentTextureLoc: Material

说明:

TODO

public static TextureMapping sculkShrieker(boolean canSummon) @ L386

  • 方法名:sculkShrieker
  • 源码定位:L386
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • canSummon: boolean

说明:

TODO

public static TextureMapping bars(Block block) @ L396

  • 方法名:bars
  • 源码定位:L396
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping layer0(Item item) @ L400

  • 方法名:layer0
  • 源码定位:L400
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • item: Item

说明:

TODO

public static TextureMapping layer0(Block block) @ L404

  • 方法名:layer0
  • 源码定位:L404
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static TextureMapping layer0(Material id) @ L408

  • 方法名:layer0
  • 源码定位:L408
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • id: Material

说明:

TODO

public static TextureMapping layered(Material layer0, Material layer1) @ L412

  • 方法名:layered
  • 源码定位:L412
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • layer0: Material
  • layer1: Material

说明:

TODO

public static TextureMapping layered(Material layer0, Material layer1, Material layer2) @ L416

  • 方法名:layered
  • 源码定位:L416
  • 返回类型:TextureMapping
  • 修饰符:public static

参数:

  • layer0: Material
  • layer1: Material
  • layer2: Material

说明:

TODO

public static Material getBlockTexture(Block block) @ L420

  • 方法名:getBlockTexture
  • 源码定位:L420
  • 返回类型:Material
  • 修饰符:public static

参数:

  • block: Block

说明:

TODO

public static Material getBlockTexture(Block block, String suffix) @ L425

  • 方法名:getBlockTexture
  • 源码定位:L425
  • 返回类型:Material
  • 修饰符:public static

参数:

  • block: Block
  • suffix: String

说明:

TODO

public static Material getItemTexture(Item block) @ L430

  • 方法名:getItemTexture
  • 源码定位:L430
  • 返回类型:Material
  • 修饰符:public static

参数:

  • block: Item

说明:

TODO

public static Material getItemTexture(Item item, String suffix) @ L435

  • 方法名:getItemTexture
  • 源码定位:L435
  • 返回类型:Material
  • 修饰符:public static

参数:

  • item: Item
  • suffix: String

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class TextureMapping {
    private final Map<TextureSlot, Material> slots = Maps.newHashMap();
    private final Set<TextureSlot> forcedSlots = Sets.newHashSet();
 
    public TextureMapping put(TextureSlot slot, Material material) {
        this.slots.put(slot, material);
        return this;
    }
 
    public TextureMapping putForced(TextureSlot slot, Material material) {
        this.slots.put(slot, material);
        this.forcedSlots.add(slot);
        return this;
    }
 
    public Stream<TextureSlot> getForced() {
        return this.forcedSlots.stream();
    }
 
    public TextureMapping copySlot(TextureSlot from, TextureSlot to) {
        return this.put(to, this.slots.get(from));
    }
 
    public TextureMapping copyForced(TextureSlot from, TextureSlot to) {
        return this.putForced(to, this.slots.get(from));
    }
 
    public Material get(TextureSlot slot) {
        for (TextureSlot currentSlot = slot; currentSlot != null; currentSlot = currentSlot.getParent()) {
            Material result = this.slots.get(currentSlot);
            if (result != null) {
                return result;
            }
        }
 
        throw new IllegalStateException("Can't find texture for slot " + slot);
    }
 
    public TextureMapping copyAndUpdate(TextureSlot slot, Material material) {
        TextureMapping result = new TextureMapping();
        result.slots.putAll(this.slots);
        result.forcedSlots.addAll(this.forcedSlots);
        result.put(slot, material);
        return result;
    }
 
    public TextureMapping updateSlots(BiFunction<TextureSlot, Material, Material> mapper) {
        this.slots.replaceAll(mapper);
        return this;
    }
 
    public TextureMapping forceAllTranslucent() {
        return this.updateSlots((var0, material) -> material.withForceTranslucent(true));
    }
 
    public static TextureMapping cube(Block block) {
        Material texture = getBlockTexture(block);
        return cube(texture);
    }
 
    public static TextureMapping defaultTexture(Block block) {
        Material texture = getBlockTexture(block);
        return defaultTexture(texture);
    }
 
    public static TextureMapping defaultTexture(Material texture) {
        return new TextureMapping().put(TextureSlot.TEXTURE, texture);
    }
 
    public static TextureMapping cube(Material all) {
        return new TextureMapping().put(TextureSlot.ALL, all);
    }
 
    public static TextureMapping cross(Block block) {
        return singleSlot(TextureSlot.CROSS, getBlockTexture(block));
    }
 
    public static TextureMapping side(Block block) {
        return singleSlot(TextureSlot.SIDE, getBlockTexture(block));
    }
 
    public static TextureMapping crossEmissive(Block block) {
        return new TextureMapping().put(TextureSlot.CROSS, getBlockTexture(block)).put(TextureSlot.CROSS_EMISSIVE, getBlockTexture(block, "_emissive"));
    }
 
    public static TextureMapping cross(Material cross) {
        return singleSlot(TextureSlot.CROSS, cross);
    }
 
    public static TextureMapping plant(Block block) {
        return singleSlot(TextureSlot.PLANT, getBlockTexture(block));
    }
 
    public static TextureMapping plantEmissive(Block block) {
        return new TextureMapping().put(TextureSlot.PLANT, getBlockTexture(block)).put(TextureSlot.CROSS_EMISSIVE, getBlockTexture(block, "_emissive"));
    }
 
    public static TextureMapping plant(Material plant) {
        return singleSlot(TextureSlot.PLANT, plant);
    }
 
    public static TextureMapping rail(Block block) {
        return singleSlot(TextureSlot.RAIL, getBlockTexture(block));
    }
 
    public static TextureMapping rail(Material rail) {
        return singleSlot(TextureSlot.RAIL, rail);
    }
 
    public static TextureMapping wool(Block block) {
        return singleSlot(TextureSlot.WOOL, getBlockTexture(block));
    }
 
    public static TextureMapping flowerbed(Block block) {
        return new TextureMapping().put(TextureSlot.FLOWERBED, getBlockTexture(block)).put(TextureSlot.STEM, getBlockTexture(block, "_stem"));
    }
 
    public static TextureMapping wool(Material cross) {
        return singleSlot(TextureSlot.WOOL, cross);
    }
 
    public static TextureMapping stem(Block block) {
        return singleSlot(TextureSlot.STEM, getBlockTexture(block));
    }
 
    public static TextureMapping attachedStem(Block stem, Block upperStem) {
        return new TextureMapping().put(TextureSlot.STEM, getBlockTexture(stem)).put(TextureSlot.UPPER_STEM, getBlockTexture(upperStem));
    }
 
    public static TextureMapping pattern(Block block) {
        return singleSlot(TextureSlot.PATTERN, getBlockTexture(block));
    }
 
    public static TextureMapping fan(Block block) {
        return singleSlot(TextureSlot.FAN, getBlockTexture(block));
    }
 
    public static TextureMapping crop(Material id) {
        return singleSlot(TextureSlot.CROP, id);
    }
 
    public static TextureMapping pane(Block body, Block edge) {
        return new TextureMapping().put(TextureSlot.PANE, getBlockTexture(body)).put(TextureSlot.EDGE, getBlockTexture(edge, "_top"));
    }
 
    public static TextureMapping singleSlot(TextureSlot slot, Material id) {
        return new TextureMapping().put(slot, id);
    }
 
    public static TextureMapping column(Block block) {
        return new TextureMapping().put(TextureSlot.SIDE, getBlockTexture(block, "_side")).put(TextureSlot.END, getBlockTexture(block, "_top"));
    }
 
    public static TextureMapping cubeTop(Block block) {
        return new TextureMapping().put(TextureSlot.SIDE, getBlockTexture(block, "_side")).put(TextureSlot.TOP, getBlockTexture(block, "_top"));
    }
 
    public static TextureMapping pottedAzalea(Block block) {
        return new TextureMapping()
            .put(TextureSlot.PLANT, getBlockTexture(block, "_plant"))
            .put(TextureSlot.SIDE, getBlockTexture(block, "_side"))
            .put(TextureSlot.TOP, getBlockTexture(block, "_top"));
    }
 
    public static TextureMapping logColumn(Block block) {
        return new TextureMapping()
            .put(TextureSlot.SIDE, getBlockTexture(block))
            .put(TextureSlot.END, getBlockTexture(block, "_top"))
            .put(TextureSlot.PARTICLE, getBlockTexture(block));
    }
 
    public static TextureMapping column(Material side, Material end) {
        return new TextureMapping().put(TextureSlot.SIDE, side).put(TextureSlot.END, end);
    }
 
    public static TextureMapping fence(Block block) {
        return new TextureMapping()
            .put(TextureSlot.TEXTURE, getBlockTexture(block))
            .put(TextureSlot.SIDE, getBlockTexture(block, "_side"))
            .put(TextureSlot.TOP, getBlockTexture(block, "_top"));
    }
 
    public static TextureMapping customParticle(Block block) {
        return new TextureMapping().put(TextureSlot.TEXTURE, getBlockTexture(block)).put(TextureSlot.PARTICLE, getBlockTexture(block, "_particle"));
    }
 
    public static TextureMapping cubeBottomTop(Block block) {
        return new TextureMapping()
            .put(TextureSlot.SIDE, getBlockTexture(block, "_side"))
            .put(TextureSlot.TOP, getBlockTexture(block, "_top"))
            .put(TextureSlot.BOTTOM, getBlockTexture(block, "_bottom"));
    }
 
    public static TextureMapping cubeBottomTopWithWall(Block block) {
        Material side = getBlockTexture(block);
        return new TextureMapping()
            .put(TextureSlot.WALL, side)
            .put(TextureSlot.SIDE, side)
            .put(TextureSlot.TOP, getBlockTexture(block, "_top"))
            .put(TextureSlot.BOTTOM, getBlockTexture(block, "_bottom"));
    }
 
    public static TextureMapping columnWithWall(Block block) {
        Material side = getBlockTexture(block);
        return new TextureMapping()
            .put(TextureSlot.TEXTURE, side)
            .put(TextureSlot.WALL, side)
            .put(TextureSlot.SIDE, side)
            .put(TextureSlot.END, getBlockTexture(block, "_top"));
    }
 
    public static TextureMapping door(Material top, Material bottom) {
        return new TextureMapping().put(TextureSlot.TOP, top).put(TextureSlot.BOTTOM, bottom);
    }
 
    public static TextureMapping door(Block block) {
        return new TextureMapping().put(TextureSlot.TOP, getBlockTexture(block, "_top")).put(TextureSlot.BOTTOM, getBlockTexture(block, "_bottom"));
    }
 
    public static TextureMapping particle(Block block) {
        return new TextureMapping().put(TextureSlot.PARTICLE, getBlockTexture(block));
    }
 
    public static TextureMapping particle(Material id) {
        return new TextureMapping().put(TextureSlot.PARTICLE, id);
    }
 
    public static TextureMapping fire0(Block block) {
        return new TextureMapping().put(TextureSlot.FIRE, getBlockTexture(block, "_0"));
    }
 
    public static TextureMapping fire1(Block block) {
        return new TextureMapping().put(TextureSlot.FIRE, getBlockTexture(block, "_1"));
    }
 
    public static TextureMapping lantern(Block block) {
        return new TextureMapping().put(TextureSlot.LANTERN, getBlockTexture(block));
    }
 
    public static TextureMapping torch(Block block) {
        return new TextureMapping().put(TextureSlot.TORCH, getBlockTexture(block));
    }
 
    public static TextureMapping torch(Material id) {
        return new TextureMapping().put(TextureSlot.TORCH, id);
    }
 
    public static TextureMapping trialSpawner(Block block, String sideSuffix, String topSuffix) {
        return new TextureMapping()
            .put(TextureSlot.SIDE, getBlockTexture(block, sideSuffix))
            .put(TextureSlot.TOP, getBlockTexture(block, topSuffix))
            .put(TextureSlot.BOTTOM, getBlockTexture(block, "_bottom"));
    }
 
    public static TextureMapping vault(Block block, String frontSuffix, String sideSuffix, String topSuffix, String bottomSuffix) {
        return new TextureMapping()
            .put(TextureSlot.FRONT, getBlockTexture(block, frontSuffix))
            .put(TextureSlot.SIDE, getBlockTexture(block, sideSuffix))
            .put(TextureSlot.TOP, getBlockTexture(block, topSuffix))
            .put(TextureSlot.BOTTOM, getBlockTexture(block, bottomSuffix));
    }
 
    public static TextureMapping particleFromItem(Item item) {
        return new TextureMapping().put(TextureSlot.PARTICLE, getItemTexture(item));
    }
 
    public static TextureMapping commandBlock(Block block) {
        return new TextureMapping()
            .put(TextureSlot.SIDE, getBlockTexture(block, "_side"))
            .put(TextureSlot.FRONT, getBlockTexture(block, "_front"))
            .put(TextureSlot.BACK, getBlockTexture(block, "_back"));
    }
 
    public static TextureMapping orientableCube(Block block) {
        return new TextureMapping()
            .put(TextureSlot.SIDE, getBlockTexture(block, "_side"))
            .put(TextureSlot.FRONT, getBlockTexture(block, "_front"))
            .put(TextureSlot.TOP, getBlockTexture(block, "_top"))
            .put(TextureSlot.BOTTOM, getBlockTexture(block, "_bottom"));
    }
 
    public static TextureMapping orientableCubeOnlyTop(Block block) {
        return new TextureMapping()
            .put(TextureSlot.SIDE, getBlockTexture(block, "_side"))
            .put(TextureSlot.FRONT, getBlockTexture(block, "_front"))
            .put(TextureSlot.TOP, getBlockTexture(block, "_top"));
    }
 
    public static TextureMapping orientableCubeSameEnds(Block block) {
        return new TextureMapping()
            .put(TextureSlot.SIDE, getBlockTexture(block, "_side"))
            .put(TextureSlot.FRONT, getBlockTexture(block, "_front"))
            .put(TextureSlot.END, getBlockTexture(block, "_end"));
    }
 
    public static TextureMapping top(Block block) {
        return new TextureMapping().put(TextureSlot.TOP, getBlockTexture(block, "_top"));
    }
 
    public static TextureMapping craftingTable(Block table, Block bottomWood) {
        return new TextureMapping()
            .put(TextureSlot.PARTICLE, getBlockTexture(table, "_front"))
            .put(TextureSlot.DOWN, getBlockTexture(bottomWood))
            .put(TextureSlot.UP, getBlockTexture(table, "_top"))
            .put(TextureSlot.NORTH, getBlockTexture(table, "_front"))
            .put(TextureSlot.EAST, getBlockTexture(table, "_side"))
            .put(TextureSlot.SOUTH, getBlockTexture(table, "_side"))
            .put(TextureSlot.WEST, getBlockTexture(table, "_front"));
    }
 
    public static TextureMapping fletchingTable(Block table, Block bottomWood) {
        return new TextureMapping()
            .put(TextureSlot.PARTICLE, getBlockTexture(table, "_front"))
            .put(TextureSlot.DOWN, getBlockTexture(bottomWood))
            .put(TextureSlot.UP, getBlockTexture(table, "_top"))
            .put(TextureSlot.NORTH, getBlockTexture(table, "_front"))
            .put(TextureSlot.SOUTH, getBlockTexture(table, "_front"))
            .put(TextureSlot.EAST, getBlockTexture(table, "_side"))
            .put(TextureSlot.WEST, getBlockTexture(table, "_side"));
    }
 
    public static TextureMapping snifferEgg(String suffix) {
        return new TextureMapping()
            .put(TextureSlot.PARTICLE, getBlockTexture(Blocks.SNIFFER_EGG, suffix + "_north"))
            .put(TextureSlot.BOTTOM, getBlockTexture(Blocks.SNIFFER_EGG, suffix + "_bottom"))
            .put(TextureSlot.TOP, getBlockTexture(Blocks.SNIFFER_EGG, suffix + "_top"))
            .put(TextureSlot.NORTH, getBlockTexture(Blocks.SNIFFER_EGG, suffix + "_north"))
            .put(TextureSlot.SOUTH, getBlockTexture(Blocks.SNIFFER_EGG, suffix + "_south"))
            .put(TextureSlot.EAST, getBlockTexture(Blocks.SNIFFER_EGG, suffix + "_east"))
            .put(TextureSlot.WEST, getBlockTexture(Blocks.SNIFFER_EGG, suffix + "_west"));
    }
 
    public static TextureMapping driedGhast(String suffix) {
        return new TextureMapping()
            .put(TextureSlot.PARTICLE, getBlockTexture(Blocks.DRIED_GHAST, suffix + "_north"))
            .put(TextureSlot.BOTTOM, getBlockTexture(Blocks.DRIED_GHAST, suffix + "_bottom"))
            .put(TextureSlot.TOP, getBlockTexture(Blocks.DRIED_GHAST, suffix + "_top"))
            .put(TextureSlot.NORTH, getBlockTexture(Blocks.DRIED_GHAST, suffix + "_north"))
            .put(TextureSlot.SOUTH, getBlockTexture(Blocks.DRIED_GHAST, suffix + "_south"))
            .put(TextureSlot.EAST, getBlockTexture(Blocks.DRIED_GHAST, suffix + "_east"))
            .put(TextureSlot.WEST, getBlockTexture(Blocks.DRIED_GHAST, suffix + "_west"))
            .put(TextureSlot.TENTACLES, getBlockTexture(Blocks.DRIED_GHAST, suffix + "_tentacles"));
    }
 
    public static TextureMapping campfire(Block campfire) {
        return new TextureMapping().put(TextureSlot.LIT_LOG, getBlockTexture(campfire, "_log_lit")).put(TextureSlot.FIRE, getBlockTexture(campfire, "_fire"));
    }
 
    public static TextureMapping candleCake(Block block, boolean lit) {
        return new TextureMapping()
            .put(TextureSlot.PARTICLE, getBlockTexture(Blocks.CAKE, "_side"))
            .put(TextureSlot.BOTTOM, getBlockTexture(Blocks.CAKE, "_bottom"))
            .put(TextureSlot.TOP, getBlockTexture(Blocks.CAKE, "_top"))
            .put(TextureSlot.SIDE, getBlockTexture(Blocks.CAKE, "_side"))
            .put(TextureSlot.CANDLE, getBlockTexture(block, lit ? "_lit" : ""));
    }
 
    public static TextureMapping cauldron(Material contentTextureLoc) {
        return new TextureMapping()
            .put(TextureSlot.PARTICLE, getBlockTexture(Blocks.CAULDRON, "_side"))
            .put(TextureSlot.SIDE, getBlockTexture(Blocks.CAULDRON, "_side"))
            .put(TextureSlot.TOP, getBlockTexture(Blocks.CAULDRON, "_top"))
            .put(TextureSlot.BOTTOM, getBlockTexture(Blocks.CAULDRON, "_bottom"))
            .put(TextureSlot.INSIDE, getBlockTexture(Blocks.CAULDRON, "_inner"))
            .put(TextureSlot.CONTENT, contentTextureLoc);
    }
 
    public static TextureMapping sculkShrieker(boolean canSummon) {
        String innerTopString = canSummon ? "_can_summon" : "";
        return new TextureMapping()
            .put(TextureSlot.PARTICLE, getBlockTexture(Blocks.SCULK_SHRIEKER, "_bottom"))
            .put(TextureSlot.SIDE, getBlockTexture(Blocks.SCULK_SHRIEKER, "_side"))
            .put(TextureSlot.TOP, getBlockTexture(Blocks.SCULK_SHRIEKER, "_top"))
            .put(TextureSlot.INNER_TOP, getBlockTexture(Blocks.SCULK_SHRIEKER, innerTopString + "_inner_top"))
            .put(TextureSlot.BOTTOM, getBlockTexture(Blocks.SCULK_SHRIEKER, "_bottom"));
    }
 
    public static TextureMapping bars(Block block) {
        return new TextureMapping().put(TextureSlot.BARS, getBlockTexture(block)).put(TextureSlot.EDGE, getBlockTexture(block));
    }
 
    public static TextureMapping layer0(Item item) {
        return new TextureMapping().put(TextureSlot.LAYER0, getItemTexture(item));
    }
 
    public static TextureMapping layer0(Block block) {
        return new TextureMapping().put(TextureSlot.LAYER0, getBlockTexture(block));
    }
 
    public static TextureMapping layer0(Material id) {
        return new TextureMapping().put(TextureSlot.LAYER0, id);
    }
 
    public static TextureMapping layered(Material layer0, Material layer1) {
        return new TextureMapping().put(TextureSlot.LAYER0, layer0).put(TextureSlot.LAYER1, layer1);
    }
 
    public static TextureMapping layered(Material layer0, Material layer1, Material layer2) {
        return new TextureMapping().put(TextureSlot.LAYER0, layer0).put(TextureSlot.LAYER1, layer1).put(TextureSlot.LAYER2, layer2);
    }
 
    public static Material getBlockTexture(Block block) {
        Identifier id = BuiltInRegistries.BLOCK.getKey(block);
        return new Material(id.withPrefix("block/"));
    }
 
    public static Material getBlockTexture(Block block, String suffix) {
        Identifier id = BuiltInRegistries.BLOCK.getKey(block);
        return new Material(id.withPath(path -> "block/" + path + suffix));
    }
 
    public static Material getItemTexture(Item block) {
        Identifier id = BuiltInRegistries.ITEM.getKey(block);
        return new Material(id.withPrefix("item/"));
    }
 
    public static Material getItemTexture(Item item, String suffix) {
        Identifier id = BuiltInRegistries.ITEM.getKey(item);
        return new Material(id.withPath(path -> "item/" + path + suffix));
    }
}

引用的其他类

  • TextureSlot

    • 引用位置: 参数/字段/返回值
  • Material

    • 引用位置: 参数/字段/构造调用/返回值
    • 关联成员: Material()
  • Item

    • 引用位置: 参数
  • Block

    • 引用位置: 参数