-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from mircokroon/dimension_handling_1_16
Inventory saving, better handling of dimensions
- Loading branch information
Showing
37 changed files
with
815 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package game.data; | ||
|
||
/** | ||
* 2D coordinates with a dimension component. | ||
*/ | ||
public class CoordinateDim2D extends Coordinate2D { | ||
Dimension dimension; | ||
|
||
public CoordinateDim2D(Coordinate2D coordinate2D, Dimension dimension) { | ||
super(coordinate2D.x, coordinate2D.z); | ||
this.dimension = dimension; | ||
} | ||
|
||
public CoordinateDim2D(int x, int z, Dimension dimension) { | ||
super(x, z); | ||
this.dimension = dimension; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
if (!super.equals(o)) { | ||
return false; | ||
} | ||
|
||
CoordinateDim2D that = (CoordinateDim2D) o; | ||
|
||
return dimension == that.dimension; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = super.hashCode(); | ||
result = 31 * result + (dimension != null ? dimension.hashCode() : 0); | ||
return result; | ||
} | ||
|
||
public Dimension getDimension() { | ||
return dimension; | ||
} | ||
|
||
public CoordinateDim2D chunkToDimRegion() { | ||
return new CoordinateDim2D(this.chunkToRegion(), this.dimension); | ||
} | ||
|
||
public CoordinateDim2D copy() { | ||
return new CoordinateDim2D(x, z, dimension); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "(" + x + ", " + z + ", " + dimension + ")"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.