Skip to content

Commit 6d3a345

Browse files
committed
Big refactor, mainly: listener/onTick/settings.txt
1 parent 3543abc commit 6d3a345

17 files changed

Lines changed: 153 additions & 143 deletions

src/main/java/net/evmodder/evmod/Configs.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,7 @@ public static final class Hotkeys{
325325
Main.mapArtFeaturesOnly ? "" : "A", KeybindSettings.PRESS_ALLOWEXTRA).apply(HOTKEYS_KEY);
326326
public static final ConfigHotkey EJECT_JUNK_ITEMS = new ConfigHotkey("ejectJunkItems",
327327
Main.mapArtFeaturesOnly ? "" : "R", GUI_OR_INGAME_SETTINGS).apply(HOTKEYS_KEY);
328-
public static final ConfigHotkey CRAFT_RESTOCK = new ConfigHotkey("craftingRestock",
329-
Main.mapArtFeaturesOnly ? "" : " ", KeybindSettings.GUI).apply(HOTKEYS_KEY);
328+
public static final ConfigHotkey CRAFT_RESTOCK = new ConfigHotkey("craftingRestock", " ", KeybindSettings.GUI).apply(HOTKEYS_KEY);
330329
public static final ConfigHotkey HOTBAR_TYPE_INCR = new ConfigHotkey("hotbarSlotItemTypeIncrement", "").apply(HOTKEYS_KEY);
331330
public static final ConfigHotkey HOTBAR_TYPE_DECR = new ConfigHotkey("hotbarSlotItemTypeDecrement", "").apply(HOTKEYS_KEY);
332331

src/main/java/net/evmodder/evmod/InitUtils.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ final class InitUtils{
3131
// }
3232
static final String getModId(){
3333
// Get the path of the current class
34-
String classPath = Main.class.getName().replace('.', '/') + ".class";
35-
String modId = FabricLoader.getInstance().getAllMods().stream()
34+
final String classPath = Main.class.getName().replace('.', '/') + ".class";
35+
final String modId = FabricLoader.getInstance().getAllMods().stream()
3636
.filter(container -> container.findPath(classPath).isPresent())
3737
.map(container -> container.getMetadata().getId())
3838
.findFirst()
@@ -70,7 +70,7 @@ static final void refreshClickRenderer(){
7070
static final int DUMMY_CLIENT_ID = 67; // Accessor: Configs.java (for setting default value)
7171
private static final String DUMMY_CLIENT_KEY = "yesyesyes";
7272
private static boolean sendPingRequest = true;
73-
static final void refreshRemoteServerSender(RemoteServerSender rms){
73+
static final void refreshRemoteServerSender(final RemoteServerSender rms){
7474
assert rms != null;
7575
final String fullAddress = Configs.Database.ADDRESS.getStringValue();
7676
final int sep = fullAddress.indexOf(':');
@@ -95,7 +95,7 @@ static final void refreshRemoteServerSender(RemoteServerSender rms){
9595
}
9696

9797
private static boolean requestedKey = false;
98-
static final boolean checkValidClientKeyAndRequestIfNot(RemoteServerSender rms, Configs configs){
98+
static final boolean checkValidClientKeyAndRequestIfNot(final RemoteServerSender rms, final Configs configs){
9999
if(Configs.Database.ADDRESS.getStringValue().isBlank()) return false;
100100
if(Configs.Database.CLIENT_ID.getIntegerValue() != DUMMY_CLIENT_ID) return true;
101101
if(requestedKey) return false;
@@ -128,8 +128,8 @@ static final boolean checkValidClientKeyAndRequestIfNot(RemoteServerSender rms,
128128
return false;
129129
}
130130

131-
static final void sendRemoteMsg(RemoteServerSender rms, String msg){ // Accessor: KeybindCallbacks
132-
String[] arr = msg.split(",");
131+
static final void sendRemoteMsg(final RemoteServerSender rms, final String msg){ // Accessor: KeybindCallbacks
132+
final String[] arr = msg.split(",");
133133
if(arr.length < 2){
134134
Main.LOGGER.error("Invalid remote msg syntax, expected 'COMMAND,UUID...' got: "+msg);
135135
return;
@@ -149,14 +149,14 @@ static final void sendRemoteMsg(RemoteServerSender rms, String msg){ // Accessor
149149
rms.sendBotMessage(command, /*udp=*/true, /*timeout=*/5000, byteMsg, /*recv=*/null);
150150
}
151151

152-
static final void sendChatMsg(String msg){ // Accessor: KeybindCallbacks
152+
static final void sendChatMsg(final String msg){ // Accessor: KeybindCallbacks
153153
if(msg.isBlank()) return;
154154
MinecraftClient mc = MinecraftClient.getInstance();
155155
if(msg.charAt(0) == '/') mc.player.networkHandler.sendChatCommand(msg.substring(1));
156156
else mc.player.networkHandler.sendChatMessage(msg);
157157
}
158158

159-
static final void toggleSkinLayer(PlayerModelPart part){ // Accessor: KeybindCallbacks
159+
static final void toggleSkinLayer(final PlayerModelPart part){ // Accessor: KeybindCallbacks
160160
final MinecraftClient client = MinecraftClient.getInstance();
161161
if(Configs.Hotkeys.SYNC_CAPE_WITH_ELYTRA.getBooleanValue() && part == PlayerModelPart.CAPE
162162
&& client.player != null && client.options.isPlayerModelPartEnabled(part)){

src/main/java/net/evmodder/evmod/KeyCallbacks.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
import fi.dy.masa.malilib.hotkeys.IKeybindProvider;
2626

2727
final class KeyCallbacks{
28-
private final void valueChangeCallback(ConfigBase<?> hotkey, Runnable callback){
28+
private final void valueChangeCallback(final ConfigBase<?> hotkey, final Runnable callback){
2929
hotkey.setValueChangeCallback(_0 -> callback.run());
3030
}
3131

32-
private final void keybindCallback(IHotkey hotkey, Function<Screen, Boolean> allowInScreen, Runnable callback){
32+
private final void keybindCallback(final IHotkey hotkey, final Function<Screen, Boolean> allowInScreen, final Runnable callback){
3333
if(allowInScreen == null) hotkey.getKeybind().setCallback((_0, _1) -> {callback.run(); return true;});
3434
else hotkey.getKeybind().setCallback((_0, _1) -> {
3535
if(allowInScreen.apply(MinecraftClient.getInstance().currentScreen)){callback.run(); return true;}
@@ -39,7 +39,7 @@ private final void keybindCallback(IHotkey hotkey, Function<Screen, Boolean> all
3939

4040
KeyCallbacks(Configs configs,
4141
RemoteServerSender remoteSender, EpearlLookup epearlLookup, KeybindCraftingRestock kbCraftRestock,
42-
GameMessageFilter gameMessageFilter, WhisperPlaySound whisperPlaySound, KeybindInventoryOrganize[] kbInvOrgs, KeybindInventoryRestock kbInvRestock
42+
WhisperPlaySound whisperPlaySound, GameMessageFilter gameMessageFilter, KeybindInventoryOrganize[] kbInvOrgs, KeybindInventoryRestock kbInvRestock
4343
){
4444
InputEventHandler.getKeybindManager().registerKeybindProvider(new IKeybindProvider(){
4545
@Override public void addKeysToMap(IKeybindManager manager){
@@ -57,10 +57,10 @@ private final void keybindCallback(IHotkey hotkey, Function<Screen, Boolean> all
5757
});
5858

5959
if(!Main.mapArtFeaturesOnly){
60-
KeybindAIETravelHelper kbAIE = new KeybindAIETravelHelper();
61-
KeybindEjectJunk kbej = new KeybindEjectJunk();
62-
KeybindEbounceTravelHelper kbEbounce = new KeybindEbounceTravelHelper(kbej);
63-
KeybindHotbarTypeScroller kbHbScroll = new KeybindHotbarTypeScroller();
60+
final KeybindAIETravelHelper kbAIE = new KeybindAIETravelHelper();
61+
final KeybindEjectJunk kbej = new KeybindEjectJunk();
62+
final KeybindEbounceTravelHelper kbEbounce = new KeybindEbounceTravelHelper(kbej);
63+
final KeybindHotbarTypeScroller kbHbScroll = new KeybindHotbarTypeScroller();
6464

6565
// Value change callbacks
6666
valueChangeCallback(Configs.Database.ADDRESS, ()->InitUtils.refreshRemoteServerSender(remoteSender));
@@ -131,10 +131,10 @@ private final void keybindCallback(IHotkey hotkey, Function<Screen, Boolean> all
131131
()->MinecraftClient.getInstance().player.setAngles(Configs.Hotkeys.SNAP_ANGLE_2.getYaw(), Configs.Hotkeys.SNAP_ANGLE_2.getPitch()));
132132
}
133133

134-
KeybindMapCopy kbMapCopy = new KeybindMapCopy();
135-
KeybindMapLoad kbMapLoad = new KeybindMapLoad();
136-
KeybindMapMove kbMapMove = new KeybindMapMove();
137-
KeybindMapMoveBundle kbMapMoveBundle = new KeybindMapMoveBundle();
134+
final KeybindMapCopy kbMapCopy = new KeybindMapCopy();
135+
final KeybindMapLoad kbMapLoad = new KeybindMapLoad();
136+
final KeybindMapMove kbMapMove = new KeybindMapMove();
137+
final KeybindMapMoveBundle kbMapMoveBundle = new KeybindMapMoveBundle();
138138

139139
valueChangeCallback(Configs.Generic.CLICK_LIMIT_COUNT, InitUtils::refreshClickLimits);
140140
valueChangeCallback(Configs.Generic.CLICK_LIMIT_WINDOW, InitUtils::refreshClickLimits);

src/main/java/net/evmodder/evmod/Main.java

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import net.evmodder.evmod.onTick.UpdateItemFrameContents;
4343
import net.fabricmc.loader.api.FabricLoader;
4444
import net.fabricmc.loader.api.metadata.ModMetadata;
45-
import net.minecraft.client.MinecraftClient;
4645

4746
//MC source code will be in ~/.gradle/caches/fabric-loom or ./.gradle/loom-cache
4847
// gradle tasks --all
@@ -119,47 +118,51 @@ public class Main{
119118

120119
if(settings.serverJoinListener) new ServerJoinListener(remoteSender);
121120
if(settings.serverQuitListener) new ServerQuitListener(remoteSender);
122-
final WhisperPlaySound whisperPlaySound = mapArtFeaturesOnly ? null : new WhisperPlaySound();
123-
if(settings.gameMessageListener) new GameMessageListener(remoteSender, epearlLookup, whisperPlaySound);
124-
final GameMessageFilter gameMessageFilter = settings.gameMessageFilter ? new GameMessageFilter(remoteSender) : null;
125-
if(settings.mapLoaderBot) TickListener.register(new TickListener(){
126-
@Override public void onTickStart(MinecraftClient client){MapLoaderBot.onTickStart(client);}
127-
});
128-
final KeybindInventoryOrganize[] kbInvOrgs = mapArtFeaturesOnly ? null : new KeybindInventoryOrganize[]{
129-
new KeybindInventoryOrganize(Configs.Hotkeys.INV_ORGANIZE_1.getStrings()),
130-
new KeybindInventoryOrganize(Configs.Hotkeys.INV_ORGANIZE_2.getStrings()),
131-
new KeybindInventoryOrganize(Configs.Hotkeys.INV_ORGANIZE_3.getStrings())
132-
};
133-
final KeybindInventoryRestock kbInvRestock = kbInvOrgs == null ? null : new KeybindInventoryRestock(kbInvOrgs);
134-
if(settings.containerOpenCloseListener){
135-
TickListener.register(new ContainerOpenCloseListener(kbInvRestock));
136-
BlockClickListener.register();
121+
if(settings.blockClickListener) new BlockClickListener();
122+
final WhisperPlaySound whisperPlaySound;
123+
final GameMessageFilter gameMessageFilter;
124+
final KeybindInventoryOrganize[] kbInvOrgs;
125+
final KeybindInventoryRestock kbInvRestock;
126+
if(mapArtFeaturesOnly){whisperPlaySound = null; gameMessageFilter = null; kbInvOrgs = null; kbInvRestock = null; kbCraftRestock = null;}
127+
else{
128+
whisperPlaySound = new WhisperPlaySound();
129+
if(settings.gameMessageListener) new GameMessageListener(remoteSender, epearlLookup, whisperPlaySound);
130+
gameMessageFilter = settings.gameMessageFilter ? new GameMessageFilter(remoteSender) : null;
131+
kbInvOrgs = new KeybindInventoryOrganize[]{
132+
new KeybindInventoryOrganize(Configs.Hotkeys.INV_ORGANIZE_1.getStrings()),
133+
new KeybindInventoryOrganize(Configs.Hotkeys.INV_ORGANIZE_2.getStrings()),
134+
new KeybindInventoryOrganize(Configs.Hotkeys.INV_ORGANIZE_3.getStrings())
135+
};
136+
kbInvRestock = new KeybindInventoryRestock(kbInvOrgs);
137+
kbCraftRestock = new KeybindCraftingRestock();
138+
139+
if(settings.broadcaster) ChatBroadcaster.refreshBroadcast();
140+
if(settings.tooltipRepairCost) Tooltip.register(new TooltipRepairCost());
137141
}
138-
kbCraftRestock = new KeybindCraftingRestock();
139142

140143
if(settings.placementHelperIframeAutoPlace) new AutoPlaceItemFrames();
141144
if(settings.placementHelperMapArt) new MapHangListener(settings.placementHelperMapArtAutoPlace, settings.placementHelperMapArtAutoRemove);
142-
if(settings.broadcaster) ChatBroadcaster.refreshBroadcast();
143145

144-
if(settings.cmdAssignPearl) new CommandAssignPearl(epearlLookup);
146+
if(/*!mapArtFeaturesOnly && */settings.cmdAssignPearl) new CommandAssignPearl(epearlLookup);
145147
if(settings.cmdDeletedMapsNearby) new CommandDeletedMapsNearby();
146148
if(settings.cmdExportMapImg) new CommandExportMapImg();
147149
if(settings.cmdMapArtGroup) new CommandMapArtGroup();
148150
if(settings.cmdMapHashCode) new CommandMapHashCode();
149-
if(settings.cmdSeen) new CommandSeen();
150-
if(settings.cmdSendAs) new CommandSendAs(remoteSender);
151-
if(settings.cmdTimeOnline) new CommandTimeOnline(remoteSender);
151+
if(/*!mapArtFeaturesOnly && */settings.cmdSeen) new CommandSeen();
152+
if(/*!mapArtFeaturesOnly && */settings.cmdSendAs) new CommandSendAs(remoteSender);
153+
if(/*!mapArtFeaturesOnly && */settings.cmdTimeOnline) new CommandTimeOnline(remoteSender);
152154

153155
if(settings.onTickInventory) TickListener.register(new UpdateInventoryContents());
154156
if(settings.onTickIframes) TickListener.register(new UpdateItemFrameContents());
155157
if(settings.onTickContainer) TickListener.register(new UpdateContainerContents());
158+
if(settings.containerOpenCloseListener) TickListener.register(new ContainerOpenCloseListener(kbInvRestock));
159+
if(settings.mapLoaderBot) TickListener.register(new MapLoaderBot());
156160

157161
if(settings.tooltipMapHighlights) Tooltip.register(new TooltipMapNameColor());
158162
if(settings.tooltipMapMetadata) Tooltip.register(new TooltipMapLoreMetadata());
159-
if(settings.tooltipRepairCost) Tooltip.register(new TooltipRepairCost());
160163

161164
ConfigManager.getInstance().registerConfigHandler(MOD_ID, configs);
162165
Registry.CONFIG_SCREEN.registerConfigScreenFactory(new ModInfo(MOD_ID, MOD_NAME, ()->new ConfigGui(configs)));
163-
new KeyCallbacks(configs, remoteSender, epearlLookup, kbCraftRestock, gameMessageFilter, whisperPlaySound, kbInvOrgs, kbInvRestock);
166+
new KeyCallbacks(configs, remoteSender, epearlLookup, kbCraftRestock, whisperPlaySound, gameMessageFilter, kbInvOrgs, kbInvRestock);
164167
}
165168
}

src/main/java/net/evmodder/evmod/Settings.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final class Settings{
1616
final boolean showNicheConfigs;
1717
final boolean storeDataInInstanceFolder, database, epearlOwners;
1818
final boolean placementHelperIframeAutoPlace, placementHelperMapArt, placementHelperMapArtAutoPlace, placementHelperMapArtAutoRemove;
19-
final boolean serverJoinListener, serverQuitListener, gameMessageListener, gameMessageFilter;
19+
final boolean serverJoinListener, serverQuitListener, gameMessageListener, gameMessageFilter, blockClickListener;
2020
final boolean onTickInventory, onTickContainer, onTickIframes, containerOpenCloseListener, mapLoaderBot, broadcaster;
2121
final boolean tooltipMapHighlights, tooltipMapMetadata, tooltipRepairCost;
2222
final boolean cmdAssignPearl, cmdDeletedMapsNearby, cmdExportMapImg, cmdMapArtGroup, cmdMapHashCode, cmdSeen, cmdSendAs, cmdTimeOnline;
@@ -80,6 +80,7 @@ private final boolean extractConfigValue(final HashMap<String, Boolean> config,
8080
mapLoaderBot = extractConfigValue(settings, "map_bot.loader");
8181
serverJoinListener = extractConfigValue(settings, "listener.server_join");
8282
serverQuitListener = extractConfigValue(settings, "listener.server_quit");
83+
blockClickListener = extractConfigValue(settings, "listener.block_click");
8384
gameMessageListener = extractConfigValue(settings, "listener.game_message.read");
8485
gameMessageFilter = extractConfigValue(settings, "listener.game_message.filter");
8586
tooltipMapHighlights = (onTickInventory || onTickIframes) && extractConfigValue(settings, "tooltip.map_highlights");

src/main/java/net/evmodder/evmod/apis/ChatBroadcaster.java

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12,57 +12,60 @@
1212
import net.minecraft.client.MinecraftClient;
1313
import net.minecraft.client.network.ClientPlayNetworkHandler;
1414

15-
public class ChatBroadcaster{
15+
public final class ChatBroadcaster{
1616
private static Timer timer;
1717
private static int msgIndex;
1818

1919
public final static void refreshBroadcast(){
2020
if(timer != null) timer.cancel();
2121
final long unix_evt_ts = Long.parseLong(Configs.Generic.TEMP_BROADCAST_TIMESTAMP.getStringValue());
22-
List<String> evt_msgs = Configs.Generic.TEMP_BROADCAST_MSGS.getStrings();
22+
final List<String> evt_msgs = Configs.Generic.TEMP_BROADCAST_MSGS.getStrings();
2323
final String username = MinecraftClient.getInstance().getSession().getUsername();
24-
if(unix_evt_ts*1000L > System.currentTimeMillis() && !evt_msgs.isEmpty() && username.equalsIgnoreCase(Configs.Generic.TEMP_BROADCAST_ACCOUNT.getStringValue())){
25-
final long evt_ts = unix_evt_ts*1000L;
26-
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("CST"));
27-
cal.setTimeInMillis(evt_ts);
28-
final long evt_hr = cal.get(Calendar.HOUR_OF_DAY);
29-
if(System.currentTimeMillis() > evt_ts) return;
30-
msgIndex = Integer.parseInt(FileIO.loadFile("temp_event_index", "0"));
24+
final long ts = System.currentTimeMillis();
25+
if(unix_evt_ts*1000L <= ts || evt_msgs.isEmpty() || !username.equalsIgnoreCase(Configs.Generic.TEMP_BROADCAST_ACCOUNT.getStringValue())) return;
3126

32-
Main.LOGGER.info("Chat Broadcaster initialized");
27+
final long evt_ts = unix_evt_ts*1000L;
28+
final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("CST"));
29+
cal.setTimeInMillis(evt_ts);
30+
final long evt_hr = cal.get(Calendar.HOUR_OF_DAY);
31+
if(ts > evt_ts) return;
32+
msgIndex = Integer.parseInt(FileIO.loadFile("temp_event_index", "-1"));
3333

34-
timer = new Timer(/*isDaemon=*/true);
35-
timer.scheduleAtFixedRate(new TimerTask(){
36-
@Override public void run(){
37-
Main.LOGGER.info("chat msg gogogo");
38-
final Calendar cal = Calendar.getInstance();
39-
final int hr = cal.get(Calendar.HOUR_OF_DAY);
40-
if(cal.get(Calendar.MINUTE) % 30 == 0) return; // Advertise once per 1/2 hour
41-
if(hr > evt_hr || evt_hr - hr > 5) return; // Advertise in the 5 hrs leading up the event, on preceeding days
42-
43-
long ts = System.currentTimeMillis();
44-
if(ts > evt_ts) return; // Event has passed
45-
46-
if(msgIndex >= evt_msgs.size()) msgIndex = 0;
47-
long hrsTillEvent = Duration.ofMillis(evt_ts-System.currentTimeMillis()).toHours();
48-
long daysTillEvent = hrsTillEvent/24;
49-
hrsTillEvent %= 24;
50-
String timeStr = (daysTillEvent != 0 ? daysTillEvent+"d" : "") + (hrsTillEvent != 0 ? hrsTillEvent+"h" : "");
51-
if(timeStr.isEmpty()){
52-
Main.LOGGER.error("Timeleft till event is 0??");
53-
timeStr = "...soon(tm)";
54-
}
55-
56-
String msg = evt_msgs.get(msgIndex).replace("{time}", timeStr).replace("{t}", timeStr);
57-
Main.LOGGER.info("msg to send: "+msg);
58-
59-
MinecraftClient instance = MinecraftClient.getInstance();
60-
ClientPlayNetworkHandler handler = instance.getNetworkHandler();
61-
if(handler == null) Main.LOGGER.warn("Player appears to be offline (or otherwise unable to send chats)");
62-
else handler.sendChatMessage(msg);
63-
++msgIndex;
34+
Main.LOGGER.info("Chat Broadcaster initialized");
35+
36+
timer = new Timer(/*isDaemon=*/true);
37+
timer.scheduleAtFixedRate(new TimerTask(){
38+
@Override public void run(){
39+
final Calendar cal = Calendar.getInstance();
40+
final int hr = cal.get(Calendar.HOUR_OF_DAY);
41+
if(cal.get(Calendar.MINUTE) % 30 == 0) return; // Advertise once per 1/2 hour
42+
if(hr > evt_hr || evt_hr - hr > 5) return; // Advertise in the 5 hrs leading up the event, on preceeding days
43+
44+
final long ts = System.currentTimeMillis();
45+
if(ts > evt_ts) return; // Event has passed
46+
47+
final ClientPlayNetworkHandler handler = MinecraftClient.getInstance().getNetworkHandler();
48+
if(handler == null){
49+
Main.LOGGER.warn("Player appears to be offline (or otherwise unable to send chats)");
50+
return;
6451
}
65-
}, 1L, 15_000L); // Runs every 15s
66-
}
52+
53+
if(++msgIndex >= evt_msgs.size()) msgIndex = 0;
54+
FileIO.saveFile("temp_event_index", ""+msgIndex);
55+
56+
long hrsTillEvent = Duration.ofMillis(evt_ts-System.currentTimeMillis()).toHours();
57+
final long daysTillEvent = hrsTillEvent/24;
58+
hrsTillEvent %= 24;
59+
String timeStr = (daysTillEvent != 0 ? daysTillEvent+"d" : "") + (hrsTillEvent != 0 ? hrsTillEvent+"h" : "");
60+
if(timeStr.isEmpty()){
61+
Main.LOGGER.error("Timeleft till event is 0??");
62+
timeStr = "...soon(tm)";
63+
}
64+
65+
final String msg = evt_msgs.get(msgIndex).replace("{time}", timeStr).replace("{t}", timeStr);
66+
Main.LOGGER.info("sending msg: "+msg);
67+
handler.sendChatMessage(msg);
68+
}
69+
}, 1L, 15_000L); // Runs every 15s
6770
}
6871
}

src/main/java/net/evmodder/evmod/apis/Tooltip.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
import net.minecraft.text.Text;
99

1010
public interface Tooltip{
11-
public abstract void get(ItemStack item, TooltipContext context, TooltipType type, List<Text> lines);
12-
13-
public static void register(Tooltip tooltip){
14-
ItemTooltipCallback.EVENT.register(tooltip::get);
15-
}
11+
public abstract void get(final ItemStack item, final TooltipContext context, final TooltipType type, final List<Text> lines);
12+
public static void register(final Tooltip tooltip){ItemTooltipCallback.EVENT.register(tooltip::get);}
1613
}

0 commit comments

Comments
 (0)