Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.13 anvil #128

Merged
merged 89 commits into from
Feb 17, 2020
Merged
Changes from 1 commit
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
44f6a26
Added TAG_Long_Array
mmdanggg2 Sep 30, 2018
38b8932
Started on reading new format, displaying something...
mmdanggg2 Oct 1, 2018
e40411b
Now using BitSet to access the long array as a sequence of bits.
mmdanggg2 Oct 1, 2018
53596d6
Fix bits per block calculation
mmdanggg2 Oct 1, 2018
64f3a85
Converted block ID's to use Strings
mmdanggg2 Oct 4, 2018
23f6c92
Fix preview drawing
mmdanggg2 Oct 4, 2018
f75d2b6
Slightly fixed liquid rendering
mmdanggg2 Oct 4, 2018
d4d7f70
Added barrier blocks
mmdanggg2 Oct 5, 2018
ae93207
Make sure string comparisons use .equals as == is not reliable for st…
mmdanggg2 Oct 5, 2018
20f2f14
Converted most of blocks.conf (Thanks Arbiter617)
mmdanggg2 Oct 5, 2018
c4daeff
1.13 has changed texture locations, added new texsplit conf
mmdanggg2 Oct 5, 2018
968879d
Added Path model
mmdanggg2 Oct 6, 2018
d2e7783
Merge branch 'master' into 1.13Anvil
mmdanggg2 Oct 6, 2018
180b1ac
Updated texsplit_1.13.conf properly (Thanks again Arbiter617!)
mmdanggg2 Oct 6, 2018
da1c998
More block updates
mmdanggg2 Oct 7, 2018
69f3a82
Changed data values to be a HashMap of state values from their proper…
mmdanggg2 Oct 8, 2018
5224348
Fixed ladders and hopefully stairs
mmdanggg2 Oct 8, 2018
ba4a9e4
removed Quartz (same as logs)
mmdanggg2 Oct 8, 2018
e66c0c9
Updated more blocks models. (Thanks Arbiter617!)
mmdanggg2 Oct 9, 2018
c7bab54
More block fixes (Arbiter617)
mmdanggg2 Oct 9, 2018
b61645d
Fixed banners!
mmdanggg2 Oct 10, 2018
00b0762
More block updates (Arbiter617)
mmdanggg2 Oct 10, 2018
ae79206
More blocks added & fixed (Arbiter617)
mmdanggg2 Oct 14, 2018
9021a0c
Fixed Mesh block models
mmdanggg2 Oct 14, 2018
92aa0a5
Block updates (Arbiter617)
mmdanggg2 Oct 17, 2018
9105a2b
Mesh models can now have their materials overridden
mmdanggg2 Oct 24, 2018
e09fed0
Fix build errors
mmdanggg2 Oct 24, 2018
71369d5
added Chorus plant (Arbiter617)
mmdanggg2 Nov 8, 2018
0fbf149
New blocks and fixes (Arbiter617)
mmdanggg2 Nov 13, 2018
dcc4223
Added flowerpots with potted plants.
mmdanggg2 Nov 15, 2018
6edb89c
Added Transform toString, helps with debug.
mmdanggg2 Nov 15, 2018
4b957af
Added dragon head and others (Arbiter617)
mmdanggg2 Nov 18, 2018
30c99ab
Fixed waterlogged blocks
mmdanggg2 Nov 17, 2018
de6fb52
Export time changed to debug log
mmdanggg2 Nov 17, 2018
8eb9e67
Fixed banner material export
mmdanggg2 Nov 18, 2018
605e8b3
Fix dragon heads & chorus flower (Arbiter617)
mmdanggg2 Nov 19, 2018
df0d949
Fix panes and added connected hopper (Arbiter617)
mmdanggg2 Jan 5, 2019
c5f715c
Fixed locked repeaters
mmdanggg2 Jan 5, 2019
d1f48c3
Fix < 1.13 chunk crash
mmdanggg2 Jan 6, 2019
73f3ea1
Fix dark_oak_fence_gate texture
mmdanggg2 Jan 6, 2019
0675ad8
Fix torch flame particle
mmdanggg2 Jan 6, 2019
7b88ad7
Added to credits.
mmdanggg2 Jan 6, 2019
3d16b0b
Bumped version
mmdanggg2 Jan 6, 2019
b54804a
Revamped the update system to use GitHub releases.
mmdanggg2 Jan 7, 2019
22ab6ea
gitignore blockselection.dat
mmdanggg2 Jan 7, 2019
bb451bb
Fixed underwater plants and bubble columns not integrating with water…
mmdanggg2 Jan 17, 2019
691a343
Fixed Prismarine occlusions
mmdanggg2 Jan 19, 2019
36b7825
Named viewer and memory monitor threads
mmdanggg2 Jan 19, 2019
1df3e81
Version 102
mmdanggg2 Jan 20, 2019
47e0b17
Again changed block data, now uses the BlockData class.
mmdanggg2 Jan 23, 2019
d82d2ad
Version 103
mmdanggg2 Feb 3, 2019
e86ed0f
Fix dark oak using 'big' oak texture names
mmdanggg2 Apr 6, 2019
0693b87
Fix Nether portals & End portal frames
mmdanggg2 Apr 7, 2019
3ecc7d5
Version 104
mmdanggg2 Apr 7, 2019
c7cabd9
Added fire blockstates
mmdanggg2 Apr 14, 2019
e7e8445
1.6 resource format up to 1.12 not 1.13
mmdanggg2 Apr 17, 2019
1e0b5a0
Added CUSTOM occlusion for more complicated blocks
mmdanggg2 May 13, 2019
967eee0
Much better chunk format detection.
mmdanggg2 May 14, 2019
a44a8e6
Fix Chunk not adding id to BlockData
mmdanggg2 May 16, 2019
a4a4b97
Added custom slab occlusion
mmdanggg2 May 20, 2019
11d6f52
Correct spelling of neighbour
mmdanggg2 May 21, 2019
de69a07
Change Transform to use double, helps with issues with blocks on 0 co…
mmdanggg2 May 27, 2019
f979760
Stairs now have custom occlusion
mmdanggg2 May 27, 2019
7603518
Version 105
mmdanggg2 May 27, 2019
9a55699
Fix straight stairs occluding other stairs facing the same way when i…
mmdanggg2 Jun 2, 2019
c77be8a
Version 106
mmdanggg2 Jun 2, 2019
d33e76a
Added CubeFacing for blocks that use the facing property
mmdanggg2 Jul 11, 2019
22b448c
Merging
Arbiter617 Jul 11, 2019
af523fc
Fixed CubeFacing occlusion
mmdanggg2 Jul 13, 2019
2a2e80a
Merge branch '1.13Anvil' of https://github.com/jmc2obj/j-mc-2-obj int…
Arbiter617 Jul 13, 2019
99b303e
Added 1.14 new blocks
Arbiter617 Jul 14, 2019
740a246
Added missing files
Arbiter617 Jul 14, 2019
ec4f1d2
Merge pull request #120 from Arbiter617/1.13Anvil
mmdanggg2 Jul 15, 2019
4097fab
code cleanup
mmdanggg2 Jul 16, 2019
eaa5a8d
Made normal and specular export optional, speeds up export when not u…
mmdanggg2 Jul 16, 2019
dc1cff5
Fixed texsplit to work with new particle and painting folder structure
Arbiter617 Jul 16, 2019
e52acfd
Added new potted plants
mmdanggg2 Jul 16, 2019
4357e29
Removed level .dat logging from console window
mmdanggg2 Jul 16, 2019
d7c5c5f
Fixed barrel occulsion & sweet_berry_bush model
mmdanggg2 Jul 18, 2019
ae6f201
Merge remote-tracking branch 'remotes/Arbiter617/1.13Anvil' into 1.13…
mmdanggg2 Jul 18, 2019
68655e3
Fix mossy cobblestone material
mmdanggg2 Jul 19, 2019
9206df9
Version 107
mmdanggg2 Jul 19, 2019
7ce836d
Allow selecting .jar files as custom resource packs
mmdanggg2 Aug 12, 2019
3c836e3
Split texture exporting to a separate command --tex_export
mmdanggg2 Aug 14, 2019
6cd8ccb
Optimized texture exporting
TheDuckCow Aug 17, 2019
7a6b4e2
Removing a debug line I added before while exploring early
TheDuckCow Aug 17, 2019
da96712
Move Load button from button bar to save selection bar
opl- Sep 28, 2019
e89fe7d
Merge pull request #124 from TheDuckCow/1.13Anvil
danijel3 Oct 22, 2019
52f02d0
Merge pull request #126 from opl-/better-world-choice-ui
danijel3 Oct 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change Transform to use double, helps with issues with blocks on 0 co…
…ordinate.
  • Loading branch information
mmdanggg2 committed May 27, 2019
commit de69a073271a27c0e1e590f99104a0648a1cd029
100 changes: 50 additions & 50 deletions src/org/jmc/geom/Transform.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
*
*/
public class Transform {
float matrix[][];
double matrix[][];

public Transform() {
matrix = new float[4][4];
matrix = new double[4][4];
identity();
}

Expand Down Expand Up @@ -44,9 +44,9 @@ public Vertex multiply(Vertex vertex) {
throw new RuntimeException("matrix multiply error: last row doesn't add to 1");

Vertex ret = new Vertex(0, 0, 0);
ret.x = vertex.x * matrix[0][0] + vertex.y * matrix[0][1] + vertex.z * matrix[0][2] + matrix[0][3];
ret.y = vertex.x * matrix[1][0] + vertex.y * matrix[1][1] + vertex.z * matrix[1][2] + matrix[1][3];
ret.z = vertex.x * matrix[2][0] + vertex.y * matrix[2][1] + vertex.z * matrix[2][2] + matrix[2][3];
ret.x = (float) (vertex.x * matrix[0][0] + vertex.y * matrix[0][1] + vertex.z * matrix[0][2] + matrix[0][3]);
ret.y = (float) (vertex.x * matrix[1][0] + vertex.y * matrix[1][1] + vertex.z * matrix[1][2] + matrix[1][3]);
ret.z = (float) (vertex.x * matrix[2][0] + vertex.y * matrix[2][1] + vertex.z * matrix[2][2] + matrix[2][3]);
return ret;
}

Expand All @@ -64,19 +64,19 @@ public Face multiply(Face face) {
}

public Vertex applyToNormal(Vertex norm) {
float[][] invt = new float[3][3]; // inverse transpose
double[][] invt = new double[3][3]; // inverse transpose

float a = matrix[0][0];
float b = matrix[0][1];
float c = matrix[0][2];
float d = matrix[1][0];
float e = matrix[1][1];
float f = matrix[1][2];
float g = matrix[2][0];
float h = matrix[2][1];
float k = matrix[2][2];
double a = matrix[0][0];
double b = matrix[0][1];
double c = matrix[0][2];
double d = matrix[1][0];
double e = matrix[1][1];
double f = matrix[1][2];
double g = matrix[2][0];
double h = matrix[2][1];
double k = matrix[2][2];

float det = a * (e * k - f * h) + b * (f * g - d * k) + c * (d * h - e * g);
double det = a * (e * k - f * h) + b * (f * g - d * k) + c * (d * h - e * g);

invt[0][0] = (e * k - f * h) / det;
invt[0][1] = (f * g - d * k) / det;
Expand All @@ -88,8 +88,8 @@ public Vertex applyToNormal(Vertex norm) {
invt[2][1] = (c * d - a * f) / det;
invt[2][2] = (a * e - b * d) / det;

return new Vertex(norm.x * invt[0][0] + norm.y * invt[0][1] + norm.z * invt[0][2], norm.x * invt[1][0] + norm.y
* invt[1][1] + norm.z * invt[1][2], norm.x * invt[2][0] + norm.y * invt[2][1] + norm.z * invt[2][2]);
return new Vertex((float) (norm.x * invt[0][0] + norm.y * invt[0][1] + norm.z * invt[0][2]),(float) (norm.x * invt[1][0] + norm.y
* invt[1][1] + norm.z * invt[1][2]),(float) (norm.x * invt[2][0] + norm.y * invt[2][1] + norm.z * invt[2][2]));
}

public void translate(float x, float y, float z) {
Expand All @@ -108,75 +108,75 @@ public void scale(float x, float y, float z) {
matrix[2][2] = z;
}

public void rotate(float a, float b, float g) {
public void rotate(double a, double b, double g) {
// convert to rad
a = (float) (a * Math.PI / 180.0);
b = (float) (b * Math.PI / 180.0);
g = (float) (g * Math.PI / 180.0);
a = Math.toRadians(a);
b = Math.toRadians(b);
g = Math.toRadians(g);

identity();
Transform ret;
Transform trans = new Transform();

trans.matrix[1][1] = (float) Math.cos(a);
trans.matrix[1][2] = (float) -Math.sin(a);
trans.matrix[2][1] = (float) Math.sin(a);
trans.matrix[2][2] = (float) Math.cos(a);
trans.matrix[1][1] = Math.cos(a);
trans.matrix[1][2] = -Math.sin(a);
trans.matrix[2][1] = Math.sin(a);
trans.matrix[2][2] = Math.cos(a);

ret = multiply(trans);
matrix = ret.matrix;

trans.identity();
trans.matrix[0][0] = (float) Math.cos(b);
trans.matrix[0][2] = (float) -Math.sin(b);
trans.matrix[2][0] = (float) Math.sin(b);
trans.matrix[2][2] = (float) Math.cos(b);
trans.matrix[0][0] = Math.cos(b);
trans.matrix[0][2] = -Math.sin(b);
trans.matrix[2][0] = Math.sin(b);
trans.matrix[2][2] = Math.cos(b);

ret = multiply(trans);
matrix = ret.matrix;

trans.identity();
trans.matrix[0][0] = (float) Math.cos(g);
trans.matrix[0][1] = (float) -Math.sin(g);
trans.matrix[1][0] = (float) Math.sin(g);
trans.matrix[1][1] = (float) Math.cos(g);
trans.matrix[0][0] = Math.cos(g);
trans.matrix[0][1] = -Math.sin(g);
trans.matrix[1][0] = Math.sin(g);
trans.matrix[1][1] = Math.cos(g);

ret = multiply(trans);
matrix = ret.matrix;
}

public void rotate2(float yaw, float pitch, float roll) {
public void rotate2(double yaw, double pitch, double roll) {
// TODO: check if this works correctly
// convert to rad
roll = (float) (roll * Math.PI / 180.0);
pitch = (float) (pitch * Math.PI / 180.0);
yaw = (float) (yaw * Math.PI / 180.0);
roll = Math.toRadians(roll);
pitch = Math.toRadians(pitch);
yaw = Math.toRadians(yaw);

identity();
Transform ret;
Transform trans = new Transform();

trans.matrix[0][0] = (float) Math.cos(yaw);
trans.matrix[0][2] = (float) -Math.sin(yaw);
trans.matrix[2][0] = (float) Math.sin(yaw);
trans.matrix[2][2] = (float) Math.cos(yaw);
trans.matrix[0][0] = Math.cos(yaw);
trans.matrix[0][2] = -Math.sin(yaw);
trans.matrix[2][0] = Math.sin(yaw);
trans.matrix[2][2] = Math.cos(yaw);
ret = multiply(trans);
matrix = ret.matrix;

trans.identity();
trans.matrix[1][1] = (float) Math.cos(pitch);
trans.matrix[1][2] = (float) -Math.sin(pitch);
trans.matrix[2][1] = (float) Math.sin(pitch);
trans.matrix[2][2] = (float) Math.cos(pitch);
trans.matrix[1][1] = Math.cos(pitch);
trans.matrix[1][2] = -Math.sin(pitch);
trans.matrix[2][1] = Math.sin(pitch);
trans.matrix[2][2] = Math.cos(pitch);

ret = multiply(trans);
matrix = ret.matrix;

trans.identity();
trans.matrix[0][0] = (float) Math.cos(roll);
trans.matrix[0][1] = (float) -Math.sin(roll);
trans.matrix[1][0] = (float) Math.sin(roll);
trans.matrix[1][1] = (float) Math.cos(roll);
trans.matrix[0][0] = Math.cos(roll);
trans.matrix[0][1] = -Math.sin(roll);
trans.matrix[1][0] = Math.sin(roll);
trans.matrix[1][1] = Math.cos(roll);

ret = multiply(trans);
matrix = ret.matrix;
Expand Down