use of com.teamwizardry.wizardry.api.capability.player.miscdata.IMiscCapability in project Wizardry by TeamWizardry.
the class ModCapabilities method onRespawn.
@SubscribeEvent
public static void onRespawn(PlayerEvent.PlayerRespawnEvent event) {
if (event.player.world.isRemote)
return;
IManaCapability manaCap = ManaCapabilityProvider.getCap(event.player);
if (manaCap != null)
manaCap.dataChanged(event.player);
IMiscCapability miscCap = MiscCapabilityProvider.getCap(event.player);
if (miscCap != null)
miscCap.dataChanged(event.player);
}
use of com.teamwizardry.wizardry.api.capability.player.miscdata.IMiscCapability in project Wizardry by TeamWizardry.
the class ModCapabilities method onDimChange.
@SubscribeEvent
public static void onDimChange(PlayerEvent.PlayerChangedDimensionEvent event) {
if (event.player.world.isRemote)
return;
IManaCapability manaCap = ManaCapabilityProvider.getCap(event.player);
if (manaCap != null)
manaCap.dataChanged(event.player);
IMiscCapability miscCap = MiscCapabilityProvider.getCap(event.player);
if (miscCap != null)
miscCap.dataChanged(event.player);
}
use of com.teamwizardry.wizardry.api.capability.player.miscdata.IMiscCapability in project Wizardry by TeamWizardry.
the class ItemFairyBell method onScroll.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void onScroll(MouseEvent event) {
EntityPlayer player = Minecraft.getMinecraft().player;
if (player == null)
return;
if (Keyboard.isCreated() && event.getDwheel() != 0) {
for (EnumHand hand : EnumHand.values()) {
ItemStack stack = player.getHeldItem(hand);
if (stack.getItem() != ModItems.FAIRY_BELL)
continue;
IMiscCapability cap = MiscCapabilityProvider.getCap(Minecraft.getMinecraft().player);
if (cap == null)
continue;
cap.setSelectedFairy(null);
PacketHandler.NETWORK.sendToServer(new PacketUpdateMiscCapToServer(cap.serializeNBT()));
}
}
}
use of com.teamwizardry.wizardry.api.capability.player.miscdata.IMiscCapability in project Wizardry by TeamWizardry.
the class PacketUpdateMiscCapToClient method handle.
@Override
public void handle(@Nonnull MessageContext ctx) {
if (ctx.side.isServer())
return;
EntityPlayer player = LibrarianLib.PROXY.getClientPlayer();
IMiscCapability cap = MiscCapabilityProvider.getCap(player);
if (cap != null) {
cap.deserializeNBT(tags);
}
}
use of com.teamwizardry.wizardry.api.capability.player.miscdata.IMiscCapability in project Wizardry by TeamWizardry.
the class PacketUpdateMiscCapToServer method reply.
@Nullable
@Override
public PacketBase reply(@NotNull MessageContext ctx) {
EntityPlayer player = ctx.getServerHandler().player;
IMiscCapability cap = MiscCapabilityProvider.getCap(player);
if (cap != null) {
cap.deserializeNBT(tags);
}
return new PacketUpdateMiscCapToClient(tags);
}
Aggregations