Records: Deprecate getters (use x() instead of getX())

This commit is contained in:
Bixilon 2020-11-29 22:37:18 +01:00
parent 7ffed6a053
commit ec87b86c3c
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
11 changed files with 30 additions and 0 deletions

View File

@ -14,14 +14,17 @@
package de.bixilon.minosoft.data;
public record Vector(int x, int y, int z) {
@Deprecated
public int getX() {
return x;
}
@Deprecated
public int getY() {
return y;
}
@Deprecated
public int getZ() {
return z;
}

View File

@ -21,14 +21,17 @@ public record Location(double x, double y, double z) {
return new Location(position.x(), position.y(), position.z());
}
@Deprecated
public double getX() {
return x;
}
@Deprecated
public double getY() {
return y;
}
@Deprecated
public double getZ() {
return z;
}

View File

@ -14,14 +14,17 @@
package de.bixilon.minosoft.data.entities;
public record RelativeLocation(double x, double y, double z) {
@Deprecated
public double getX() {
return x;
}
@Deprecated
public double getY() {
return y;
}
@Deprecated
public double getZ() {
return z;
}

View File

@ -16,14 +16,17 @@ package de.bixilon.minosoft.data.entities;
import de.bixilon.minosoft.data.mappings.MobEffect;
public record StatusEffect(MobEffect effect, int amplifier, int duration) {
@Deprecated
public int getAmplifier() {
return amplifier;
}
@Deprecated
public int getDuration() {
return duration;
}
@Deprecated
public MobEffect getEffect() {
return effect;
}

View File

@ -14,14 +14,17 @@
package de.bixilon.minosoft.data.entities;
public record Velocity(short x, short y, short z) {
@Deprecated
public short getX() {
return x;
}
@Deprecated
public short getY() {
return y;
}
@Deprecated
public short getZ() {
return z;
}

View File

@ -21,14 +21,17 @@ public record VillagerData(VillagerTypes type, VillagerProfessions profession, V
this(VillagerTypes.byId(type), VillagerProfessions.byId(profession, versionId), VillagerLevels.byId(level));
}
@Deprecated
public VillagerTypes getType() {
return type;
}
@Deprecated
public VillagerProfessions getProfession() {
return profession;
}
@Deprecated
public VillagerLevels getLevel() {
return level;
}

View File

@ -17,6 +17,7 @@ import de.bixilon.minosoft.data.inventory.Slot;
public record Ingredient(Slot[] slot) {
@Deprecated
public Slot[] getSlot() {
return slot;
}

View File

@ -18,14 +18,17 @@ public record BlockPosition(int x, int y, int z) {
return new ChunkLocation(x / 16, z / 16);
}
@Deprecated
public int getX() {
return x;
}
@Deprecated
public int getY() {
return y;
}
@Deprecated
public int getZ() {
return z;
}

View File

@ -17,10 +17,12 @@ package de.bixilon.minosoft.data.world;
* Chunk X and Z location (block position / 16, rounded down)
*/
public record ChunkLocation(int x, int z) {
@Deprecated
public int getX() {
return x;
}
@Deprecated
public int getZ() {
return z;
}

View File

@ -23,14 +23,17 @@ public record InChunkLocation(int x, int y, int z) {
}
}
@Deprecated
public int getX() {
return x;
}
@Deprecated
public int getY() {
return y;
}
@Deprecated
public int getZ() {
return z;
}

View File

@ -17,14 +17,17 @@ package de.bixilon.minosoft.data.world;
* Chunk X, Y and Z location (max 16x16x16)
*/
public record InChunkSectionLocation(int x, int y, int z) {
@Deprecated
public int getX() {
return x;
}
@Deprecated
public int getY() {
return y;
}
@Deprecated
public int getZ() {
return z;
}