diff --git a/.gitignore b/.gitignore index fec5f0ba7a..2d21f4217d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,12 @@ /.classpath /.project /build +/.settings *~ out /resources/compiled /resources/classes +/resources/target +/target/ +**/dependency-reduced-pom.xml +*.json diff --git a/README.md b/README.md new file mode 100644 index 0000000000..3cbead3690 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +Haven and Hearth Client +======================= + +Hi, ProgrammerDan here. + +You've found an amazing project, Loftar's Haven and Hearth open source client. It has been modified by EnderWiggin, and now by ProgrammerDan. + +The most significant change so far is that I've mavenized as much of the toolchain as I could. + +Some ANT-bits remain, and for posterity (or those who enjoy `ant`) I've left build.xml where it is. + +However, this project can now be build in one go via maven, as follows: + +``` +> mvn clean package -f parent-pom.xml +``` + +This will build the haven client; then, this will build the haven local resources jar, and put everything into the `target` folder. + +You can double-click the hafen.jar file to run it, or invoke from the `target` folder using: + +``` +> javaw -jar hafen.jar -U http://game.havenandhearth.com/res/ game.havenandhearth.com +``` + +Enjoy, and happy playing Haven and Hearth. diff --git a/parent-pom.xml b/parent-pom.xml new file mode 100644 index 0000000000..85964fa534 --- /dev/null +++ b/parent-pom.xml @@ -0,0 +1,80 @@ + + 4.0.0 + com.havenandhearth + hafen-parent + 1.0.0 + HnH Client Parent + Mavenized Haven and Hearth Client orchestration pom. + pom + + + . + resources + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + + + -Xlint:unchecked + -Xlint:-options + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-antrun-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-resources-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + + + + + org.apache.maven.plugins + maven-clean-plugin + false + + true + + + + + + + + project.local + project + file:${project.basedir}/repo + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000000..88de153a6a --- /dev/null +++ b/pom.xml @@ -0,0 +1,227 @@ + + 4.0.0 + hafen + 1.0.0-SNAPSHOT + HnH Client + Mavenized Haven and Hearth Client, modified by EnderWiggin and ProgrammerDan + + + com.havenandhearth + hafen-parent + 1.0.0 + parent-pom.xml + + + + src + hafen + + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.apache.maven.plugins + maven-antrun-plugin + + + res-jars + generate-resources + + + + + + + + + + + + git-rev = ${gitrev} + version = ${iversion} + + + + + + run + + + + + + + org.apache.maven.plugins + maven-shade-plugin + + + + + haven.MainFrame + jogl.jar gluegen-rt.jar client-res.jar builtin-res.jar hafen-res.jar + + + + changelog.txt + changelog.txt + + + haven/ressrv.crt + etc/ressrv.crt + + + haven/authsrv.crt + etc/authsrv.crt + + + haven/res-preload + etc/res-preload + + + haven/res-bgload + etc/res-bgload + + + haven/icon.png + etc/icon.png + + + haven/font.ttf + etc/font.ttf + + + META-INF/glob + target/META-INF/glob + + + + + dolda:jglob + + ** + + + META-INF/** + + + + com.google.code.gson:gson + + ** + + + META-INF/** + + + + io.reactivex:rxjava + + ** + + + META-INF/** + + + + + + org.jogamp.gluegen:* + org.jogamp.jogl:* + javax.jnlp:* + + + + + + package + + shade + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + copy-resources + generate-resources + + copy-resources + + + ${basedir}/target + + + lib + false + + hafen-res.jar + builtin-res.jar + gluegen-rt.jar + jogl.jar + + + + lib/jogl-natives + false + + *.jar + + + + + + + + + + + src + + **/*.java + + + + + + + + + io.reactivex + rxjava + 1.1.5 + + + org.jogamp.gluegen + gluegen-rt-main + 2.3.1 + + + org.jogamp.jogl + jogl-all-main + 2.3.1 + + + com.google.code.gson + gson + 2.3.1 + + + javax.jnlp + jnlp-api + 7.0 + + + dolda + jglob + 1.0 + + + \ No newline at end of file diff --git a/repo/dolda/jglob/1.0/jglob-1.0.jar b/repo/dolda/jglob/1.0/jglob-1.0.jar new file mode 100644 index 0000000000..a8a074f3b6 Binary files /dev/null and b/repo/dolda/jglob/1.0/jglob-1.0.jar differ diff --git a/repo/dolda/jglob/1.0/jglob-1.0.jar.md5 b/repo/dolda/jglob/1.0/jglob-1.0.jar.md5 new file mode 100644 index 0000000000..63cb6f6786 --- /dev/null +++ b/repo/dolda/jglob/1.0/jglob-1.0.jar.md5 @@ -0,0 +1 @@ +6c7b0d9569167a31cc0a8fa544ac6ac6 \ No newline at end of file diff --git a/repo/dolda/jglob/1.0/jglob-1.0.jar.sha1 b/repo/dolda/jglob/1.0/jglob-1.0.jar.sha1 new file mode 100644 index 0000000000..a36e6bc936 --- /dev/null +++ b/repo/dolda/jglob/1.0/jglob-1.0.jar.sha1 @@ -0,0 +1 @@ +ea3070a8a00b14f3ef2a9a39e64b2cd17af5fce7 \ No newline at end of file diff --git a/repo/dolda/jglob/1.0/jglob-1.0.pom b/repo/dolda/jglob/1.0/jglob-1.0.pom new file mode 100644 index 0000000000..ed96a9e334 --- /dev/null +++ b/repo/dolda/jglob/1.0/jglob-1.0.pom @@ -0,0 +1,8 @@ + + + 4.0.0 + dolda + jglob + 1.0 + diff --git a/repo/dolda/jglob/1.0/jglob-1.0.pom.md5 b/repo/dolda/jglob/1.0/jglob-1.0.pom.md5 new file mode 100644 index 0000000000..e0b8c9f461 --- /dev/null +++ b/repo/dolda/jglob/1.0/jglob-1.0.pom.md5 @@ -0,0 +1 @@ +9058e98e9c617e12d8d6bda932ae9c74 \ No newline at end of file diff --git a/repo/dolda/jglob/1.0/jglob-1.0.pom.sha1 b/repo/dolda/jglob/1.0/jglob-1.0.pom.sha1 new file mode 100644 index 0000000000..bdc03aa98f --- /dev/null +++ b/repo/dolda/jglob/1.0/jglob-1.0.pom.sha1 @@ -0,0 +1 @@ +6a94ff59da60758b80419f0308e71ff199eb8259 \ No newline at end of file diff --git a/repo/dolda/jglob/maven-metadata.xml b/repo/dolda/jglob/maven-metadata.xml new file mode 100644 index 0000000000..ed1da0be97 --- /dev/null +++ b/repo/dolda/jglob/maven-metadata.xml @@ -0,0 +1,12 @@ + + + dolda + jglob + + 1.0 + + 1.0 + + 20210325043806 + + diff --git a/repo/dolda/jglob/maven-metadata.xml.md5 b/repo/dolda/jglob/maven-metadata.xml.md5 new file mode 100644 index 0000000000..099e7af610 --- /dev/null +++ b/repo/dolda/jglob/maven-metadata.xml.md5 @@ -0,0 +1 @@ +8d130fb6a890553f5aef1250f8feabb2 \ No newline at end of file diff --git a/repo/dolda/jglob/maven-metadata.xml.sha1 b/repo/dolda/jglob/maven-metadata.xml.sha1 new file mode 100644 index 0000000000..58f37987c0 --- /dev/null +++ b/repo/dolda/jglob/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +102afc3d3fa5bcd81ca34b7834a7baf4d009da35 \ No newline at end of file diff --git a/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.jar b/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.jar new file mode 100644 index 0000000000..4467866ebe Binary files /dev/null and b/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.jar differ diff --git a/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.jar.md5 b/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.jar.md5 new file mode 100644 index 0000000000..44eb30c39e --- /dev/null +++ b/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.jar.md5 @@ -0,0 +1 @@ +3dc14d59e1629a53473fe874ba0e9a7f \ No newline at end of file diff --git a/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.jar.sha1 b/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.jar.sha1 new file mode 100644 index 0000000000..97d68f3f71 --- /dev/null +++ b/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.jar.sha1 @@ -0,0 +1 @@ +30f65c08f06d5349ccb825b1625d2d2c751c2724 \ No newline at end of file diff --git a/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.pom b/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.pom new file mode 100644 index 0000000000..80f1214fe8 --- /dev/null +++ b/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.pom @@ -0,0 +1,8 @@ + + + 4.0.0 + javax.jnlp + jnlp-api + 7.0 + diff --git a/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.pom.md5 b/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.pom.md5 new file mode 100644 index 0000000000..9b3c376e21 --- /dev/null +++ b/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.pom.md5 @@ -0,0 +1 @@ +78a99f25a9e732f6e3c768d3619f5329 \ No newline at end of file diff --git a/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.pom.sha1 b/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.pom.sha1 new file mode 100644 index 0000000000..7d7511df10 --- /dev/null +++ b/repo/javax/jnlp/jnlp-api/7.0/jnlp-api-7.0.pom.sha1 @@ -0,0 +1 @@ +30e14a281d2b6560c2f410869278b2f071749360 \ No newline at end of file diff --git a/repo/javax/jnlp/jnlp-api/maven-metadata.xml b/repo/javax/jnlp/jnlp-api/maven-metadata.xml new file mode 100644 index 0000000000..7ea677331b --- /dev/null +++ b/repo/javax/jnlp/jnlp-api/maven-metadata.xml @@ -0,0 +1,12 @@ + + + javax.jnlp + jnlp-api + + 7.0 + + 7.0 + + 20210325043435 + + diff --git a/repo/javax/jnlp/jnlp-api/maven-metadata.xml.md5 b/repo/javax/jnlp/jnlp-api/maven-metadata.xml.md5 new file mode 100644 index 0000000000..a1fcc5b501 --- /dev/null +++ b/repo/javax/jnlp/jnlp-api/maven-metadata.xml.md5 @@ -0,0 +1 @@ +4ac11e386eb5f2443acc1b5e044f62dd \ No newline at end of file diff --git a/repo/javax/jnlp/jnlp-api/maven-metadata.xml.sha1 b/repo/javax/jnlp/jnlp-api/maven-metadata.xml.sha1 new file mode 100644 index 0000000000..6eb582cf61 --- /dev/null +++ b/repo/javax/jnlp/jnlp-api/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +1c8e25dc56f2bf0da80ca593fdc88098cef718af \ No newline at end of file diff --git a/resources/pom.xml b/resources/pom.xml new file mode 100644 index 0000000000..8b12927bc8 --- /dev/null +++ b/resources/pom.xml @@ -0,0 +1,97 @@ + + 4.0.0 + client-res + 1.0.0-SNAPSHOT + HnH Client Resources + Mavenized Haven and Hearth Client Resources, modified by EnderWiggin and ProgrammerDan + + + com.havenandhearth + hafen-parent + 1.0.0 + ../parent-pom.xml + + + + java + classes + client-res + + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.apache.maven.plugins + maven-antrun-plugin + + + resources + process-classes + + + + + + + + + + + + + run + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + haven/** + **/**.class + + ../target + + + + + + + compiled + + + . + + item_data/** + + + + ../ + + i10n/**/**.json + + + + ../etc + + radar.xml + gob_path.json + gob_radius.json + + + + + + + + com.havenandhearth + hafen + 1.0.0-SNAPSHOT + + + \ No newline at end of file diff --git a/src/haven/FastMesh.java b/src/haven/FastMesh.java index 3ceb7e40be..e4144ca826 100644 --- a/src/haven/FastMesh.java +++ b/src/haven/FastMesh.java @@ -59,7 +59,7 @@ private FillBuffer indfill(Indices ibuf, Environment env) { FillBuffer dst = env.fillbuf(ibuf); ShortBuffer buf = dst.push().asShortBuffer(); ShortBuffer tx = indb.duplicate(); - tx.rewind(); + ((Buffer) tx).rewind(); buf.put(tx); return(dst); } diff --git a/src/haven/Utils.java b/src/haven/Utils.java index f9c561b018..cbaac78816 100644 --- a/src/haven/Utils.java +++ b/src/haven/Utils.java @@ -1248,25 +1248,25 @@ public static boolean parsebool(String s, boolean def) { public static FloatBuffer bufcp(float[] a) { FloatBuffer b = mkfbuf(a.length); b.put(a); - b.rewind(); + ((Buffer)b).rewind(); return(b); } public static ShortBuffer bufcp(short[] a) { ShortBuffer b = mksbuf(a.length); b.put(a); - b.rewind(); + ((Buffer)b).rewind(); return(b); } public static FloatBuffer bufcp(FloatBuffer a) { - a.rewind(); + ((Buffer)a).rewind(); FloatBuffer ret = mkfbuf(a.remaining()); - ret.put(a).rewind(); + ((Buffer)ret.put(a)).rewind(); return(ret); } public static IntBuffer bufcp(IntBuffer a) { - a.rewind(); + ((Buffer)a).rewind(); IntBuffer ret = mkibuf(a.remaining()); - ret.put(a).rewind(); + ((Buffer)ret.put(a)).rewind(); return(ret); } public static ByteBuffer mkbbuf(int n) { @@ -1317,15 +1317,15 @@ public static ShortBuffer wsbuf(int n) { return(ShortBuffer.wrap(new short[n])); } public static FloatBuffer wbufcp(FloatBuffer a) { - a.rewind(); + ((Buffer)a).rewind(); FloatBuffer ret = wfbuf(a.remaining()); - ret.put(a.slice()).rewind(); + ((Buffer)ret.put(a.slice())).rewind(); return(ret); } public static IntBuffer wbufcp(IntBuffer a) { - a.rewind(); + ((Buffer)a).rewind(); IntBuffer ret = wibuf(a.remaining()); - ret.put(a.slice()).rewind(); + ((Buffer)ret.put(a.slice())).rewind(); return(ret); } @@ -1335,7 +1335,7 @@ public static ByteBuffer growbuf(ByteBuffer buf, int req) { int sz = buf.capacity(); while(sz - buf.position() < req) sz <<= 1; - return(ByteBuffer.allocate(sz).order(buf.order()).put((ByteBuffer)buf.flip())); + return(ByteBuffer.allocate(sz).order(buf.order()).put((ByteBuffer)((Buffer)buf).flip())); } public static float[] c2fa(Color c) { diff --git a/src/haven/VertexBuf.java b/src/haven/VertexBuf.java index f772266cdc..ecf9bddefb 100644 --- a/src/haven/VertexBuf.java +++ b/src/haven/VertexBuf.java @@ -158,7 +158,7 @@ public void data(ByteBuffer bdst, int offset, int stride) { throw(new AssertionError()); FloatBuffer dst = bdst.asFloatBuffer(); if(stride == elfmt.size()) { - dst.position(offset / 4); + ((Buffer)dst).position(offset / 4); dst.put(data); } else if((stride % 4) == 0) { for(int i = 0, o = offset / 4, fs = stride / 4; i < data.capacity(); i += elfmt.nc, o += fs) { @@ -188,7 +188,7 @@ public void data(ByteBuffer bdst, int offset, int stride) { throw(new AssertionError()); IntBuffer dst = bdst.asIntBuffer(); if(stride == elfmt.size()) { - dst.position(offset / 4); + ((Buffer)dst).position(offset / 4); dst.put(data); } else if((stride % 4) == 0) { for(int i = 0, o = offset / 4, fs = stride / 4; i < data.capacity(); i += elfmt.nc, o += fs) { diff --git a/src/haven/render/gl/BGL.java b/src/haven/render/gl/BGL.java index efc4cdd02c..88684a276f 100644 --- a/src/haven/render/gl/BGL.java +++ b/src/haven/render/gl/BGL.java @@ -228,11 +228,11 @@ public void bglCallList(final BufferBGL list) { public void bglCopyBufferf(final FloatBuffer dst, final int doff, final FloatBuffer src, final int soff, final int len) { add(new Command() { public void run(GL3 gl) { - dst.position(doff); - src.position(soff).limit(len); + ((Buffer)dst).position(doff); + ((Buffer)src).position(soff).limit(len); dst.put(src); - dst.rewind(); - src.rewind().limit(src.capacity()); + ((Buffer)dst).rewind(); + ((Buffer)src).rewind().limit(src.capacity()); } }); } @@ -240,9 +240,9 @@ public void run(GL3 gl) { public void bglCopyBufferf(final FloatBuffer dst, final int doff, final float[] src, final int soff, final int len) { add(new Command() { public void run(GL3 gl) { - dst.position(doff); + ((Buffer)dst).position(doff); dst.put(src, soff, len); - dst.rewind(); + ((Buffer)dst).rewind(); } }); } diff --git a/src/haven/render/gl/GLRender.java b/src/haven/render/gl/GLRender.java index 722e1f7669..f98f9d33dd 100644 --- a/src/haven/render/gl/GLRender.java +++ b/src/haven/render/gl/GLRender.java @@ -223,7 +223,7 @@ public void run(GL3 gl) { if(data.va.bufs[i].usage == EPHEMERAL) buf.put(((HeapBuffer)bufs[i]).buf); } - buf.flip(); + ((Buffer)buf).flip(); gl.glBufferData(GL.GL_ARRAY_BUFFER, jdsz, buf, GL3.GL_STREAM_DRAW); } }); @@ -436,7 +436,7 @@ public void pget(Pipe pipe, FragData buf, Area area, VectorFormat fmt, Consumer< cgl.glBindBuffer(GL3.GL_PIXEL_PACK_BUFFER, 0); pbo.dispose(); GLException.checkfor(cgl, env); - data.rewind(); + ((Buffer)data).rewind(); /* XXX: It's not particularly nice to do the * flipping on the dispatch thread, but OpenGL * does not seem to offer any GPU-assisted @@ -486,7 +486,7 @@ public void pget(Texture.Image img, VectorFormat fmt, Consumer callb cgl.glBindBuffer(GL3.GL_PIXEL_PACK_BUFFER, 0); pbo.dispose(); GLException.checkfor(cgl, env); - data.rewind(); + ((Buffer)data).rewind(); /* XXX: It's not particularly nice to do the * flipping on the dispatch thread, but OpenGL * does not seem to offer any GPU-assisted diff --git a/src/haven/render/gl/StreamBuffer.java b/src/haven/render/gl/StreamBuffer.java index 5b2439f08e..1262cdd64b 100644 --- a/src/haven/render/gl/StreamBuffer.java +++ b/src/haven/render/gl/StreamBuffer.java @@ -63,7 +63,7 @@ public ByteBuffer get() { if(!used[i]) { if(xfbufs[i] == null) xfbufs[i] = mkbuf(); - xfbufs[i].rewind(); + ((Buffer)xfbufs[i]).rewind(); used[i] = true; return(xfbufs[i]); } @@ -120,7 +120,7 @@ ByteBuffer get() { synchronized(this) { ByteBuffer ret = this.data; this.data = null; - ret.rewind(); + ((Buffer)ret).rewind(); return(ret); } }