Minor code laying out a new sigil. No functionality currently.
This commit is contained in:
parent
5743d9f475
commit
a2317a3a8a
|
@ -0,0 +1,20 @@
|
||||||
|
package WayofTime.bloodmagic.item.sigil;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import WayofTime.bloodmagic.util.handler.event.GenericHandler;
|
||||||
|
|
||||||
|
public class ItemSigilFilledHand extends ItemSigilToggleableBase
|
||||||
|
{
|
||||||
|
public ItemSigilFilledHand()
|
||||||
|
{
|
||||||
|
super("hand", 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSigilUpdate(ItemStack stack, World world, EntityPlayer player, int itemSlot, boolean isSelected)
|
||||||
|
{
|
||||||
|
GenericHandler.filledHandMap.put(player, 4);
|
||||||
|
}
|
||||||
|
}
|
|
@ -83,7 +83,8 @@ import com.google.common.base.Strings;
|
||||||
@Handler
|
@Handler
|
||||||
public class GenericHandler
|
public class GenericHandler
|
||||||
{
|
{
|
||||||
public Map<EntityPlayer, Double> bounceMap = new HashMap<EntityPlayer, Double>();
|
public static Map<EntityPlayer, Double> bounceMap = new HashMap<EntityPlayer, Double>();
|
||||||
|
public static Map<EntityPlayer, Integer> filledHandMap = new HashMap<EntityPlayer, Integer>();
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onEntityFall(LivingFallEvent event)
|
public void onEntityFall(LivingFallEvent event)
|
||||||
|
@ -116,6 +117,21 @@ public class GenericHandler
|
||||||
{
|
{
|
||||||
event.player.motionY = bounceMap.remove(event.player);
|
event.player.motionY = bounceMap.remove(event.player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.phase == TickEvent.Phase.END)
|
||||||
|
{
|
||||||
|
if (filledHandMap.containsKey(event.player))
|
||||||
|
{
|
||||||
|
int value = filledHandMap.get(event.player) - 1;
|
||||||
|
if (value <= 0)
|
||||||
|
{
|
||||||
|
filledHandMap.remove(event.player);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
filledHandMap.put(event.player, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
Loading…
Reference in a new issue