mirror of
https://github.com/GTNewHorizons/JustEnoughCalculation.git
synced 2026-11-13 16:54:02 +00:00
Finally the 0.2 release
This commit is contained in:
1 parent
17ae58680e
commit
9673fb830c
1 file changed
+15
-2
@@ -1,19 +1,32 @@
|
||||
package pers.towdium.justEnoughCalculation.event;
|
||||
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import pers.towdium.justEnoughCalculation.JustEnoughCalculation;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent.*;
|
||||
import pers.towdium.justEnoughCalculation.gui.guis.calculator.ContainerCalculator;
|
||||
|
||||
/**
|
||||
* @author Towdium
|
||||
*/
|
||||
public class PlayerEventHandler {
|
||||
@SubscribeEvent
|
||||
public void onLogin(net.minecraftforge.event.entity.player.PlayerEvent.LoadFromFile event){
|
||||
public void onLogin(LoadFromFile event){
|
||||
JustEnoughCalculation.proxy.getPlayerHandler().handleLogin(event);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onSave(net.minecraftforge.event.entity.player.PlayerEvent.SaveToFile event){
|
||||
public void onSave(SaveToFile event){
|
||||
JustEnoughCalculation.proxy.getPlayerHandler().handleSave(event);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTooltip(ItemTooltipEvent event){
|
||||
if(event.entityPlayer.openContainer instanceof ContainerCalculator){
|
||||
long l = event.itemStack.hasTagCompound() ? (event.itemStack.getTagCompound().getLong("amount")+99)/100 : 0;
|
||||
if(l > 999){
|
||||
event.toolTip.add("Amount: " + l);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user