Skip to content

Commit

Permalink
Merge pull request #41 from SoSeDiK/master
Browse files Browse the repository at this point in the history
Fix for #40
  • Loading branch information
TheBusyBiscuit committed Jan 9, 2019
2 parents 393fe10 + f8d846b commit 8e3785e
Show file tree
Hide file tree
Showing 13 changed files with 10 additions and 23 deletions.
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
<include>plugin.yml</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src</directory>
<filtering>false</filtering>
<includes>
<include>config.yml</include>
<include>**/schematics/*.schematic</include>
</includes>
</resource>
</resources>
</build>
<dependencies>
Expand Down
25 changes: 2 additions & 23 deletions src/me/mrCookieSlime/ExoticGarden/ExoticGarden.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package me.mrCookieSlime.ExoticGarden;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
Expand Down Expand Up @@ -688,25 +684,8 @@ public void registerTree(String name, MaterialData material, String texture, Str
}
}

InputStream stream = Tree.class.getResourceAsStream("schematics/" + id + "_TREE.schematic");
OutputStream out = null;
int read;
byte[] buffer = new byte[4096];
try {
out = new FileOutputStream(new File("plugins/ExoticGarden/schematics/" + id + "_TREE.schematic"));
while ((read = stream.read(buffer)) > 0) {
out.write(buffer, 0, read);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
stream.close();
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (!new File("plugins/ExoticGarden/schematics", id + "_TREE.schematic").exists())
saveResource("schematics/" + id + "_TREE.schematic", false);
}

public void registerBerry(String name, String color, Color pcolor, PlantType type, PlantData data) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8e3785e

Please sign in to comment.