Example Usage
Some basic examples of how to use the API
@EventHandler
public void onBreak(BlockBreakEvent event) {
if(MTAPI.isDevice(event.getBlock().getLocation())){
//do something
}
}
@EventHandler
public void onBreak2(BlockBreakEvent event) {
Device device = MTAPI.getDevice(event.getBlock().getLocation());
if(device != null){
event.getPlayer().damage(1.0); //do something
}
}
@EventHandler
public void onBreak3(BlockBreakEvent event) {
PlayerData playerData = MTAPI.getPlayerData(event.getPlayer().getUniqueId());
if(playerData != null){
if(playerData.hasTech("Steam Technology")){
//do something
}
}
}
@EventHandler
public void onBreak4(BlockBreakEvent event) {
PlayerData playerData = MTAPI.getPlayerData(event.getPlayer().getUniqueId());
if(playerData != null){
playerData.unlockTech("Steam Technology");
}
}
@EventHandler
public void onBreak5(BlockBreakEvent event) {
SuperChunk superChunk = MTAPI.getSuperChunk(event.getBlock().getLocation());
if(superChunk != null){
superChunk.addPollution(100);
superChunk.setPollution(0);
superChunk.setLifeSpanPollution(0);///Used for evolution %
ArrayList<Chunk> chunks = superChunk.getChunks();//Get all chunks
}
}
Last updated