blob: 9b7ca99f0676c869a71bb588553535adb369139a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
package at.hannibal2.skyhanni.mixins.transformers.tileentity;
import at.hannibal2.skyhanni.sign.IModifiedSign;
import net.minecraft.tileentity.TileEntitySign;
import net.minecraft.util.IChatComponent;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(TileEntitySign.class)
public class TileEntitySignMixin implements IModifiedSign {
private final TileEntitySign that = (TileEntitySign) (Object) this;
private int selectionStart = -1;
private int selectionEnd = -1;
private boolean caretVisible;
@Override
public IChatComponent getText(int line) {
return this.that.signText[line];
}
@Override
public void setText(int line, IChatComponent component) {
this.that.signText[line] = component;
}
@Override
public void setSelectionState(int currentRow, int selectionStart, int selectionEnd, boolean caretVisible) {
this.that.lineBeingEdited = currentRow;
this.selectionStart = selectionStart;
this.selectionEnd = selectionEnd;
this.caretVisible = caretVisible;
}
@Override
public void resetSelectionState() {
this.that.lineBeingEdited = -1;
this.selectionStart = -1;
this.selectionEnd = -1;
this.caretVisible = false;
}
@Override
public boolean getCaretVisible() {
return this.caretVisible;
}
@Override
public int getSelectionStart() {
return this.selectionStart;
}
@Override
public int getSelectionEnd() {
return this.selectionEnd;
}
}
|