mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-16 18:55:02 +00:00
Also changes like all packages inb4 "jared changes a package name in ModTweaker2 breaking compatability with everything" drama tweet.
This commit is contained in:
1 parent
4fd2551072
commit
ec562b62ea
187 files changed
+977
-991
No files matched your search
@@ -0,0 +1,43 @@
|
||||
package modtweaker2;
|
||||
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import static modtweaker2.helpers.LogHelper.*;
|
||||
|
||||
public class ClientEvents {
|
||||
public static int cooldown;
|
||||
public static boolean active;
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDrawTooltip(ItemTooltipEvent event) {
|
||||
IPlayer player = MineTweakerMC.getIPlayer(event.entityPlayer);
|
||||
if (player != null) {
|
||||
IItemStack hand = MineTweakerMC.getIItemStack(event.itemStack);
|
||||
if (hand != null) {
|
||||
|
||||
if (active) {
|
||||
|
||||
String print = hand.toString();
|
||||
event.toolTip.add(print);
|
||||
if (GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindSprint)) {
|
||||
if (cooldown <= 0) {
|
||||
cooldown = 30;
|
||||
print(print + " -- " + hand.getDisplayName());
|
||||
} else
|
||||
cooldown--;
|
||||
} else
|
||||
cooldown--;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user