Skip to content

Commit

Permalink
Add version suffix to MappingKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverSchlueter committed Nov 16, 2023
1 parent 973336e commit d394b2c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public void create() {
case ITEM -> this.display = new Display.ItemDisplay(EntityType.ITEM_DISPLAY, world);
}

final var DATA_INTERPOLATION_DURATION_ID = ReflectionUtils.getStaticValue(Display.class, MappingKeys.DATA_INTERPOLATION_DURATION_ID.getMapping());
final var DATA_INTERPOLATION_DURATION_ID = ReflectionUtils.getStaticValue(Display.class, MappingKeys1_19_4.DATA_INTERPOLATION_DURATION_ID.getMapping());
display.getEntityData().set((EntityDataAccessor<Integer>) DATA_INTERPOLATION_DURATION_ID, 1);

final var DATA_INTERPOLATION_START_DELTA_TICKS_ID = ReflectionUtils.getStaticValue(Display.class, MappingKeys.DATA_INTERPOLATION_START_DELTA_TICKS_ID.getMapping());
final var DATA_INTERPOLATION_START_DELTA_TICKS_ID = ReflectionUtils.getStaticValue(Display.class, MappingKeys1_19_4.DATA_INTERPOLATION_START_DELTA_TICKS_ID.getMapping());
display.getEntityData().set((EntityDataAccessor<Integer>) DATA_INTERPOLATION_START_DELTA_TICKS_ID, 0);

updateHologram();
Expand Down Expand Up @@ -106,11 +106,11 @@ public void update() {

if (display instanceof TextDisplay textDisplay && data.getTypeData() instanceof TextHologramData textData) {
// line width
final var DATA_LINE_WIDTH_ID = ReflectionUtils.getStaticValue(TextDisplay.class, MappingKeys.DATA_LINE_WIDTH_ID.getMapping());
final var DATA_LINE_WIDTH_ID = ReflectionUtils.getStaticValue(TextDisplay.class, MappingKeys1_19_4.DATA_LINE_WIDTH_ID.getMapping());
display.getEntityData().set((EntityDataAccessor<Integer>) DATA_LINE_WIDTH_ID, Hologram.LINE_WIDTH);

// background
final var DATA_BACKGROUND_COLOR_ID = ReflectionUtils.getStaticValue(TextDisplay.class, MappingKeys.DATA_BACKGROUND_COLOR_ID.getMapping());
final var DATA_BACKGROUND_COLOR_ID = ReflectionUtils.getStaticValue(TextDisplay.class, MappingKeys1_19_4.DATA_BACKGROUND_COLOR_ID.getMapping());

final var background = textData.getBackground();
if (background == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.oliver.fancyholograms.version;

public enum MappingKeys {
public enum MappingKeys1_19_4 {

DATA_INTERPOLATION_DURATION_ID("r"),
DATA_INTERPOLATION_START_DELTA_TICKS_ID("q"),
Expand All @@ -10,7 +10,7 @@ public enum MappingKeys {

private final String mapping;

MappingKeys(String mapping) {
MappingKeys1_19_4(String mapping) {
this.mapping = mapping;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public void create() {
case ITEM -> this.display = new Display.ItemDisplay(EntityType.ITEM_DISPLAY, world);
}

final var DATA_INTERPOLATION_DURATION_ID = ReflectionUtils.getStaticValue(Display.class, MappingKeys.DATA_INTERPOLATION_DURATION_ID.getMapping());
final var DATA_INTERPOLATION_DURATION_ID = ReflectionUtils.getStaticValue(Display.class, MappingKeys1_20_1.DATA_INTERPOLATION_DURATION_ID.getMapping());
display.getEntityData().set((EntityDataAccessor<Integer>) DATA_INTERPOLATION_DURATION_ID, 1);

final var DATA_INTERPOLATION_START_DELTA_TICKS_ID = ReflectionUtils.getStaticValue(Display.class, MappingKeys.DATA_INTERPOLATION_START_DELTA_TICKS_ID.getMapping());
final var DATA_INTERPOLATION_START_DELTA_TICKS_ID = ReflectionUtils.getStaticValue(Display.class, MappingKeys1_20_1.DATA_INTERPOLATION_START_DELTA_TICKS_ID.getMapping());
display.getEntityData().set((EntityDataAccessor<Integer>) DATA_INTERPOLATION_START_DELTA_TICKS_ID, 0);

updateHologram();
Expand Down Expand Up @@ -106,11 +106,11 @@ public void update() {

if (display instanceof TextDisplay textDisplay && data.getTypeData() instanceof TextHologramData textData) {
// line width
final var DATA_LINE_WIDTH_ID = ReflectionUtils.getStaticValue(TextDisplay.class, MappingKeys.DATA_LINE_WIDTH_ID.getMapping());
final var DATA_LINE_WIDTH_ID = ReflectionUtils.getStaticValue(TextDisplay.class, MappingKeys1_20_1.DATA_LINE_WIDTH_ID.getMapping());
display.getEntityData().set((EntityDataAccessor<Integer>) DATA_LINE_WIDTH_ID, Hologram.LINE_WIDTH);

// background
final var DATA_BACKGROUND_COLOR_ID = ReflectionUtils.getStaticValue(TextDisplay.class, MappingKeys.DATA_BACKGROUND_COLOR_ID.getMapping());
final var DATA_BACKGROUND_COLOR_ID = ReflectionUtils.getStaticValue(TextDisplay.class, MappingKeys1_20_1.DATA_BACKGROUND_COLOR_ID.getMapping()); //DATA_BACKGROUND_COLOR_ID

final var background = textData.getBackground();
if (background == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.oliver.fancyholograms.version;

public enum MappingKeys {
public enum MappingKeys1_20_1 {

DATA_INTERPOLATION_DURATION_ID("q"),
DATA_INTERPOLATION_START_DELTA_TICKS_ID("p"),
Expand All @@ -10,7 +10,7 @@ public enum MappingKeys {

private final String mapping;

MappingKeys(String mapping) {
MappingKeys1_20_1(String mapping) {
this.mapping = mapping;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public void create() {
case ITEM -> this.display = new Display.ItemDisplay(EntityType.ITEM_DISPLAY, world);
}

final var DATA_INTERPOLATION_DURATION_ID = ReflectionUtils.getStaticValue(Display.class, MappingKeys.DATA_INTERPOLATION_DURATION_ID.getMapping());
final var DATA_INTERPOLATION_DURATION_ID = ReflectionUtils.getStaticValue(Display.class, MappingKeys1_20_2.DATA_INTERPOLATION_DURATION_ID.getMapping());
display.getEntityData().set((EntityDataAccessor<Integer>) DATA_INTERPOLATION_DURATION_ID, 1);

final var DATA_INTERPOLATION_START_DELTA_TICKS_ID = ReflectionUtils.getStaticValue(Display.class, MappingKeys.DATA_INTERPOLATION_START_DELTA_TICKS_ID.getMapping());
final var DATA_INTERPOLATION_START_DELTA_TICKS_ID = ReflectionUtils.getStaticValue(Display.class, MappingKeys1_20_2.DATA_INTERPOLATION_START_DELTA_TICKS_ID.getMapping());
display.getEntityData().set((EntityDataAccessor<Integer>) DATA_INTERPOLATION_START_DELTA_TICKS_ID, 0);

updateHologram();
Expand Down Expand Up @@ -106,11 +106,11 @@ public void update() {

if (display instanceof TextDisplay textDisplay && data.getTypeData() instanceof TextHologramData textData) {
// line width
final var DATA_LINE_WIDTH_ID = ReflectionUtils.getStaticValue(TextDisplay.class, MappingKeys.DATA_LINE_WIDTH_ID.getMapping());
final var DATA_LINE_WIDTH_ID = ReflectionUtils.getStaticValue(TextDisplay.class, MappingKeys1_20_2.DATA_LINE_WIDTH_ID.getMapping());
display.getEntityData().set((EntityDataAccessor<Integer>) DATA_LINE_WIDTH_ID, Hologram.LINE_WIDTH);

// background
final var DATA_BACKGROUND_COLOR_ID = ReflectionUtils.getStaticValue(TextDisplay.class, MappingKeys.DATA_BACKGROUND_COLOR_ID.getMapping());
final var DATA_BACKGROUND_COLOR_ID = ReflectionUtils.getStaticValue(TextDisplay.class, MappingKeys1_20_2.DATA_BACKGROUND_COLOR_ID.getMapping());

final var background = textData.getBackground();
if (background == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.oliver.fancyholograms.version;

public enum MappingKeys {
public enum MappingKeys1_20_2 {

DATA_INTERPOLATION_DURATION_ID("r"),
DATA_INTERPOLATION_START_DELTA_TICKS_ID("q"),
Expand All @@ -10,7 +10,7 @@ public enum MappingKeys {

private final String mapping;

MappingKeys(String mapping) {
MappingKeys1_20_2(String mapping) {
this.mapping = mapping;
}

Expand Down

0 comments on commit d394b2c

Please sign in to comment.