Search in sources :

Example 1 with GlowBeaconInventory

use of net.glowstone.inventory.GlowBeaconInventory in project Glowstone by GlowstoneMC.

the class BeaconEffectHandler method handle.

@Override
public void handle(GlowSession session, BeaconEffectMessage message) {
    GlowPlayer player = session.getPlayer();
    // Verify that the current player is in a beacon
    if (!(player.getOpenInventory().getTopInventory() instanceof GlowBeaconInventory)) {
        return;
    }
    GlowBeaconInventory beacon = (GlowBeaconInventory) player.getOpenInventory().getTopInventory();
    beacon.setActiveEffects(message.getPrimary(), message.getSecondary());
}
Also used : GlowPlayer(net.glowstone.entity.GlowPlayer) GlowBeaconInventory(net.glowstone.inventory.GlowBeaconInventory)

Aggregations

GlowPlayer (net.glowstone.entity.GlowPlayer)1 GlowBeaconInventory (net.glowstone.inventory.GlowBeaconInventory)1