Skip to content

Commit

Permalink
[Fix] Ensure Signs are allocated to the Atlas Texture
Browse files Browse the repository at this point in the history
Reference: #587
  • Loading branch information
CDAGaming committed Feb 25, 2022
1 parent 6e5a3a3 commit 75f5dc2
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src/main/java/net/id/aether/util/AetherSignType.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
package net.id.aether.util;

import net.id.aether.mixin.util.SignTypeAccessor;
import net.minecraft.client.render.TexturedRenderLayers;
import net.minecraft.client.util.SpriteIdentifier;
import net.minecraft.util.Identifier;
import net.minecraft.util.SignType;

public class AetherSignType extends SignType {
public static final SignType SKYROOT = SignTypeAccessor.callRegister(new AetherSignType("aether_skyroot"));
public static final SignType ORANGE = SignTypeAccessor.callRegister(new AetherSignType("aether_orange"));
public static final SignType WISTERIA = SignTypeAccessor.callRegister(new AetherSignType("aether_wisteria"));
public static final SignType GOLDEN_OAK = SignTypeAccessor.callRegister(new AetherSignType("aether_golden_oak"));
public static final SignType CRYSTAL = SignTypeAccessor.callRegister(new AetherSignType("aether_crystal"));
public static final SignType SKYROOT = register(new AetherSignType("aether_skyroot"));
public static final SignType ORANGE = register(new AetherSignType("aether_orange"));
public static final SignType WISTERIA = register(new AetherSignType("aether_wisteria"));
public static final SignType GOLDEN_OAK = register(new AetherSignType("aether_golden_oak"));
public static final SignType CRYSTAL = register(new AetherSignType("aether_crystal"));

protected AetherSignType(String name) {
super(name);
}

private static SignType register(AetherSignType type) {
SignType sign = SignTypeAccessor.callRegister(type);
TexturedRenderLayers.WOOD_TYPE_TEXTURES.put(
sign, new SpriteIdentifier(
TexturedRenderLayers.SIGNS_ATLAS_TEXTURE, new Identifier("entity/signs/" + sign.getName())
)
);

return sign;
}
}

0 comments on commit 75f5dc2

Please sign in to comment.