Package org.terasology.logic.inventory.events

Examples of org.terasology.logic.inventory.events.BeforeItemRemovedFromInventory.consume()


        Mockito.when(inventory.send(Matchers.any(BeforeItemRemovedFromInventory.class))).then(
                new Answer<Object>() {
                    @Override
                    public Object answer(InvocationOnMock invocation) throws Exception {
                        BeforeItemRemovedFromInventory event = (BeforeItemRemovedFromInventory) invocation.getArguments()[0];
                        event.consume();
                        return null;
                    }
                }
        );
View Full Code Here


                    public Object answer(InvocationOnMock invocation) throws Exception {
                        Object arg = invocation.getArguments()[0];
                        if (arg instanceof BeforeItemRemovedFromInventory) {
                            BeforeItemRemovedFromInventory event = (BeforeItemRemovedFromInventory) arg;
                            if (event.getSlot() == 1) {
                                event.consume();
                            }
                        }
                        return null;
                    }
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.