Skip to content

Commit

Permalink
did a little work on included resource packs
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Apr 29, 2024
1 parent 58d70d2 commit c9de955
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions common/src/main/java/trinsdar/gt4r/proxy/ClientHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
import muramasa.antimatter.AntimatterAPI;
import muramasa.antimatter.client.ModelUtils;
import muramasa.antimatter.proxy.IProxyHandler;
import muramasa.antimatter.util.AntimatterPlatformUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.server.packs.AbstractPackResources;
import net.minecraft.server.packs.FilePackResources;
import net.minecraft.server.packs.PackResources;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.level.Level;
import org.apache.commons.io.FileUtils;
import trinsdar.gt4r.GT4Reimagined;
import trinsdar.gt4r.block.BlockCasing;
import trinsdar.gt4r.block.BlockRedstoneMachine;
Expand Down Expand Up @@ -36,28 +41,36 @@ public static void setup() {
}

private static void copyProgrammerArtIfMissing() {
File dir = new File(".", "resourcepacks");
File dir = new File(AntimatterPlatformUtils.getConfigDir().getParent().toFile(), "resourcepacks");
File target = new File(dir, "GT4R-Programmer-Art.zip");
File target2 = new File(dir, "GT4R-Classic-Tools.zip");
File target3 = new File(dir, "GT4R-Machine-Alt.zip");


//if(!target.exists())
try {
dir.mkdirs();
InputStream in = GT4Reimagined.class.getResourceAsStream("/assets/gt4r/programmer_art.zip");
FileOutputStream out = new FileOutputStream(target);

InputStream in = GT4Reimagined.class.getResourceAsStream("/assets/gt4r/gt4r-machine-alt.zip");
FileOutputStream out = new FileOutputStream(target3);
byte[] buf = new byte[16384];
int len = 0;
while((len = in.read(buf)) > 0)
out.write(buf, 0, len);

in.close();
out.close();

in = GT4Reimagined.class.getResourceAsStream("/assets/gt4r/programmer_art.zip");
out = new FileOutputStream(target);
buf = new byte[16384];
while((len = in.read(buf)) > 0)
out.write(buf, 0, len);

in.close();
out.close();
in = GT4Reimagined.class.getResourceAsStream("/assets/gt4r/classic_tools.zip");
out = new FileOutputStream(target2);
buf = new byte[16384];
len = 0;
while((len = in.read(buf)) > 0)
out.write(buf, 0, len);

Expand Down
Binary file not shown.

0 comments on commit c9de955

Please sign in to comment.