Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@
<version>6.0.54</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.32</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.lishid</groupId>
<artifactId>openinvplugin</artifactId>
Expand Down
97 changes: 95 additions & 2 deletions src/main/java/de/minebench/syncinv/MapData.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import lombok.Data;
import org.bukkit.map.MapView;

import java.io.Serial;
import java.io.Serializable;
import java.util.UUID;

@Data
public class MapData implements Serializable {
@Serial
private static final long serialVersionUID = 4376356835175363489L;
private final int id;
private final UUID worldId;
Expand All @@ -36,4 +36,97 @@ public class MapData implements Serializable {
private boolean locked;
private boolean trackingPosition;
private boolean unlimitedTracking;

public MapData(int id, UUID worldId, int centerX, int centerZ, MapView.Scale scale, byte[] colors) {
this.id = id;
this.worldId = worldId;
this.centerX = centerX;
this.centerZ = centerZ;
this.scale = scale;
this.colors = colors;
}

/**
* @return The id of the map
*/
public int getId() {
return id;
}

/**
* @return the unique id of the world the map is in
*/
public UUID getWorldId() {
return worldId;
}

/**
* @return the x coordinate of the center of the map
*/
public int getCenterX() {
return centerX;
}

/**
* @return the z coordinate of the center of the map
*/
public int getCenterZ() {
return centerZ;
}

/**
* @return the scale of the map
*/
public MapView.Scale getScale() {
return scale;
}

/**
* @return the colors of the map
*/
public byte[] getColors() {
return colors;
}

/**
* @return if the map is locked
*/
public boolean isLocked() {
return locked;
}

/**
* @param locked if the map should be locked
*/
public void setLocked(boolean locked) {
this.locked = locked;
}

/**
* @return if the map should track position
*/
public boolean isTrackingPosition() {
return trackingPosition;
}

/**
* @param trackingPosition if the map should track position
*/
public void setTrackingPosition(boolean trackingPosition) {
this.trackingPosition = trackingPosition;
}

/**
* @return Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map's range.
*/
public boolean isUnlimitedTracking() {
return unlimitedTracking;
}

/**
* @param unlimitedTracking Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map's range.
*/
public void setUnlimitedTracking(boolean unlimitedTracking) {
this.unlimitedTracking = unlimitedTracking;
}
}
Loading