-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not crash if missing texture file when in production (#63)
Still crashes when in dev
- Loading branch information
Showing
13 changed files
with
203 additions
and
60 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
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
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
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
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
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
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
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
40 changes: 40 additions & 0 deletions
40
src/main/java/com/ldtteam/blockui/util/texture/MissingCursorTexture.java
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.ldtteam.blockui.util.texture; | ||
|
||
import com.ldtteam.blockui.mod.BlockUI; | ||
import net.minecraft.client.renderer.texture.MissingTextureAtlasSprite; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.server.packs.resources.ResourceManager; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Backed by missing vanilla texture. | ||
*/ | ||
public final class MissingCursorTexture extends CursorTexture | ||
{ | ||
public static final MissingCursorTexture INSTANCE = new MissingCursorTexture(); | ||
|
||
private MissingCursorTexture() | ||
{ | ||
super(new ResourceLocation(BlockUI.MOD_ID, "missing_cursor_texture")); | ||
super.nativeImage = MissingTextureAtlasSprite.getTexture().getPixels(); | ||
} | ||
|
||
@Override | ||
public void close() | ||
{ | ||
// Noop | ||
} | ||
|
||
@Override | ||
protected void destroyCursorHandle() | ||
{ | ||
// Noop | ||
} | ||
|
||
@Override | ||
public void load(final ResourceManager resourceManager) throws IOException | ||
{ | ||
// Noop | ||
} | ||
} |
Oops, something went wrong.