-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
made texture generation slightly saner
- Loading branch information
1 parent
bd4a488
commit ffa8dd7
Showing
11 changed files
with
318 additions
and
367 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
44 changes: 44 additions & 0 deletions
44
src/main/java/mods/betterfoliage/client/resource/BufferedImageResource.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,44 @@ | ||
package mods.betterfoliage.client.resource; | ||
|
||
import java.awt.image.BufferedImage; | ||
import java.io.ByteArrayInputStream; | ||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import javax.imageio.ImageIO; | ||
|
||
import net.minecraft.client.resources.IResource; | ||
import net.minecraft.client.resources.data.IMetadataSection; | ||
|
||
public class BufferedImageResource implements IResource { | ||
|
||
/** Raw PNG data*/ | ||
protected byte[] data = null; | ||
|
||
public BufferedImageResource(BufferedImage image) { | ||
// create PNG image | ||
try { | ||
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | ||
ImageIO.write(image, "PNG", baos); | ||
data = baos.toByteArray(); | ||
} catch (IOException e) { | ||
} | ||
} | ||
|
||
@Override | ||
public InputStream getInputStream() { | ||
return data == null ? null : new ByteArrayInputStream(data); | ||
} | ||
|
||
@Override | ||
public boolean hasMetadata() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public IMetadataSection getMetadata(String var1) { | ||
return null; | ||
} | ||
|
||
} |
74 changes: 0 additions & 74 deletions
74
src/main/java/mods/betterfoliage/client/resource/HalfTextureResource.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.