-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] Ensure Signs are allocated to the Atlas Texture
Reference: #587
- Loading branch information
Showing
1 changed file
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |