if (event instanceof PlayerInteractEntityEvent) {
final PlayerInteractEntityEvent pie = (PlayerInteractEntityEvent) event;
final Player player = (Player) pie.getEntity();
switch (pie.getAction()) {
case RIGHT_CLICK:
player.add(WindowHolder.class).openWindow(new HopperWindow(player, getInventory(), "Minecart"));
}
}
super.onInteract(event);
}