mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-28 03:15:42 +00:00
Fix memory leaks by closing streams
This commit is contained in:
1 parent
39e51bc8c2
commit
540508a2be
18 files changed
+96
-60
No files matched your search
@@ -93,10 +93,11 @@ public class RenderNPCPony extends RenderNPCInterface {
|
||||
if (check) {
|
||||
try {
|
||||
IResource resource = Minecraft.getMinecraft().getResourceManager().getResource(loc);
|
||||
BufferedImage bufferedimage = ImageIO.read(resource.getInputStream());
|
||||
try (InputStream stream = resource.getInputStream()) {
|
||||
BufferedImage bufferedimage = ImageIO.read(stream);
|
||||
|
||||
pony.isPegasus = false;
|
||||
pony.isUnicorn = false;
|
||||
pony.isPegasus = false;
|
||||
pony.isUnicorn = false;
|
||||
Color color = new Color(bufferedimage.getRGB(0, 0), true);
|
||||
Color color1 = new Color(249, 177, 49, 255);
|
||||
Color color2 = new Color(136, 202, 240, 255);
|
||||
@@ -114,8 +115,8 @@ public class RenderNPCPony extends RenderNPCInterface {
|
||||
pony.isPegasus = true;
|
||||
pony.isUnicorn = true;
|
||||
}
|
||||
pony.checked = loc;
|
||||
|
||||
pony.checked = loc;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user