Skip to content

Commit

Permalink
Merge branch 'master' into update-internals-to-upstream-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdmandt committed Mar 9, 2024
2 parents e68a9ef + a3283e2 commit 62ff845
Show file tree
Hide file tree
Showing 6 changed files with 301 additions and 216 deletions.
3 changes: 0 additions & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ dependencies {
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.42.33:dev"){
transitive = false
}
compileOnly("com.github.GTNewHorizons:ArchitectureCraft:1.7.6:dev"){
transitive = false
}
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GT5-Unofficial:5.09.43.46:dev")
runtimeOnlyNonPublishable("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.3.40-GTNH:dev")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@
package org.dynmap.hdmap.renderer;

import com.google.gson.Gson;
import gcewing.architecture.ArchitectureCraft;
import gcewing.architecture.BaseModel;
import gcewing.architecture.Vector3;
import net.minecraft.util.ResourceLocation;

import java.io.InputStream;
import java.io.InputStreamReader;

Expand All @@ -46,13 +42,26 @@ public static class Face {

Vector3 normal;
}
public class Vector3 {
double x;
double y;
double z;

public Vector3(double x, double y, double z) {
this.x = x;
this.y = y;
this.z = z;
}
public String toString() {
return String.format("(%.3f,%.3f,%.3f)", this.x, this.y, this.z);
}
}
static Gson gson = new Gson();

public static ArchitectureCraftModel fromResource(ResourceLocation location) {
// Can't use resource manager because this needs to work on the server
String path = String.format("/assets/%s/%s", location.getResourceDomain(), location.getResourcePath());
InputStream in = BaseModel.class.getResourceAsStream(path);
InputStream in = ArchitectureCraftModel.class.getResourceAsStream(path);
if (in == null) throw new RuntimeException(String.format("Cannot find resource %s", path));
ArchitectureCraftModel model = gson.fromJson(new InputStreamReader(in), ArchitectureCraftModel.class);

Expand All @@ -61,7 +70,7 @@ public static ArchitectureCraftModel fromResource(ResourceLocation location) {
public static ResourceLocation resourceLocation(String path) {

if (path.contains(":")) return new ResourceLocation(path);
else return new ResourceLocation(ArchitectureCraft.mod.modID.toLowerCase(), path);
else return new ResourceLocation("architecturecraft", path);
}
public static ResourceLocation modelLocation(String path) {
return resourceLocation("models/" + path);
Expand Down
Loading

0 comments on commit 62ff845

Please sign in to comment.