Skip to content

Commit

Permalink
RenderTabNameEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
babbaj committed Feb 15, 2019
1 parent 6b7b1ee commit 51a1650
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/main/java/com/matt/forgehax/asm/events/RenderTabNameEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.matt.forgehax.asm.events;

import java.util.OptionalInt;
import javax.annotation.Nullable;
import net.minecraftforge.fml.common.eventhandler.Event;

public class RenderTabNameEvent extends Event {

private final String name;
private final int color;

private @Nullable String newName;
private OptionalInt newColor = OptionalInt.empty();

public RenderTabNameEvent(String name, int color) {
this.name = name;
this.color = color;
}

public void setName(String newName) {
this.newName = newName;
}

public void setColor(int newColor) {
this.newColor = OptionalInt.of(newColor);
}

public String getName() {
return this.newName != null ? this.newName : this.name;
}

public int getColor() {
return newColor.orElse(this.color);
}
}

0 comments on commit 51a1650

Please sign in to comment.