fix fallback textures

This commit is contained in:
Sen 2025-06-22 18:21:07 +02:00
parent eb5c03dda3
commit e85166666f
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
14 changed files with 53 additions and 36 deletions

View file

@ -1011,4 +1011,8 @@ public class Block {
public final int getEncouragement() {
return this.encouragement;
}
public String getFallbackTexture() {
return null;
}
}

View file

@ -152,6 +152,10 @@ public class BlockFloorPortal extends Block
}
public void getAnimatedTextures(Map<String, Object> map) {
map.put("blocks/floor_portal", 5);
map.put("floor_portal", 5);
}
public String getFallbackTexture() {
return "obsidian";
}
}

View file

@ -293,7 +293,7 @@ public class BlockPortal extends Block
}
public void getAnimatedTextures(Map<String, Object> map) {
map.put("blocks/portal", 1);
map.put("portal", 1);
}
// public BlockPattern.PatternHelper func_181089_f(World p_181089_1_, BlockPos p_181089_2_)

View file

@ -315,6 +315,12 @@ public class BlockDynamicLiquid extends BlockLiquid
}
public void getAnimatedTextures(Map<String, Object> map) {
map.put("blocks/" + BlockRegistry.getNameFromBlock(this.staticBlock) + "_flow", this.animation);
map.put(BlockRegistry.getNameFromBlock(this.staticBlock) + "_flow", this.animation);
}
public String getFallbackTexture() {
if(this.cachedTexture == null)
this.cachedTexture = BlockRegistry.getNameFromBlock(this.staticBlock) + "_still";
return this.cachedTexture;
}
}

View file

@ -37,6 +37,8 @@ public abstract class BlockLiquid extends Block
protected final boolean opaque;
protected final int flowRate;
protected final Object animation;
protected String cachedTexture;
public BlockLiquid(Material materialIn, boolean tick, boolean opaque, int rate, Object animation)
{

View file

@ -114,6 +114,12 @@ public class BlockStaticLiquid extends BlockLiquid
}
public void getAnimatedTextures(Map<String, Object> map) {
map.put("blocks/" + BlockRegistry.getNameFromBlock(this) + "_still", this.animation);
map.put(BlockRegistry.getNameFromBlock(this) + "_still", this.animation);
}
public String getFallbackTexture() {
if(this.cachedTexture == null)
this.cachedTexture = BlockRegistry.getNameFromBlock(this) + "_still";
return this.cachedTexture;
}
}

View file

@ -1144,8 +1144,8 @@ public class BlockFire extends Block
}
public void getAnimatedTextures(Map<String, Object> map) {
map.put("blocks/fire_layer_0", TextureAnimation.FIRE1);
map.put("blocks/fire_layer_1", TextureAnimation.FIRE2);
map.put("fire_layer_0", TextureAnimation.FIRE1);
map.put("fire_layer_1", TextureAnimation.FIRE2);
}
public boolean canExtinguish() {

View file

@ -30,7 +30,7 @@ public class BlockTintedFire extends BlockFire {
}
public void getAnimatedTextures(Map<String, Object> map) {
map.put("blocks/flame_layer_0", TextureAnimation.FLAME1);
map.put("blocks/flame_layer_1", TextureAnimation.FLAME2);
map.put("flame_layer_0", TextureAnimation.FLAME1);
map.put("flame_layer_1", TextureAnimation.FLAME2);
}
}

View file

@ -634,4 +634,8 @@ public class BlockChest extends BlockContainer implements Rotatable
{
return true;
}
public String getFallbackTexture() {
return "oak_planks";
}
}

View file

@ -21,6 +21,6 @@ public class BlockTianReactor extends BlockMachine {
}
public void getAnimatedTextures(Map<String, Object> map) {
map.put("blocks/tian_reactor_front", 5);
map.put("tian_reactor_front", 5);
}
}

View file

@ -144,4 +144,8 @@ public class BlockBanner extends BlockContainer implements Rotatable
public Transforms getTransform() {
return Transforms.BANNER;
}
public String getFallbackTexture() {
return "oak_planks";
}
}

View file

@ -131,4 +131,8 @@ public class BlockSign extends BlockContainer
{
return true;
}
public String getFallbackTexture() {
return "oak_planks";
}
}