This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Optional; | |
import java.util.function.Consumer; | |
@SuppressWarnings("all") | |
public class SwitchClass { | |
static public <T> void cswitch(Object object, Consumer... consumers) { | |
for (Consumer consumer : consumers) { | |
consumer.accept(object); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.ParameterizedType; | |
import java.lang.reflect.Type; | |
public class GenericClass<T> { | |
public GenericClass() { | |
Type superclass = this.getClass().getGenericSuperclass(); | |
Type genericClass = ((ParameterizedType) superclass).getActualTypeArguments()[0]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EventHandler(priority = EventPriority.HIGHEST) | |
public void onMove(PlayerMoveEvent event) { | |
Location from = event.getFrom(); | |
Location to = event.getTo(); | |
if(!from.getWorld().getName().equalsIgnoreCase(to.getWorld().getName())) { | |
return; | |
} |
OlderNewer