More API work

This commit is contained in:
Shane Freeder
2020-02-04 23:03:42 +00:00
parent c916070cd1
commit c2bbbdf24f
45 changed files with 145 additions and 106 deletions

View File

@ -1,4 +1,6 @@
package com.gmail.nossr50.mcmmo.api.data;
public interface MMOEntity {
public interface MMOEntity<N> {
N getNative();
}

View File

@ -1,7 +1,5 @@
package com.gmail.nossr50.mcmmo.api.data;
public interface MMOPlayer<N> extends MMOEntity {
public interface MMOPlayer<N> extends MMOEntity<N> {
N getPlayer();
}

View File

@ -2,6 +2,7 @@ package com.gmail.nossr50.mcmmo.api.platform;
import com.gmail.nossr50.mcmmo.api.platform.scheduler.PlatformScheduler;
import com.gmail.nossr50.mcmmo.api.platform.util.MetadataStore;
import com.gmail.nossr50.mcmmo.api.platform.util.MobHealthBarManager;
import java.io.File;
import java.util.logging.Logger;
@ -35,4 +36,6 @@ public interface PlatformProvider {
PlatformScheduler getScheduler();
void checkMetrics();
MobHealthBarManager getHealthBarManager();
}

View File

@ -0,0 +1,27 @@
package com.gmail.nossr50.mcmmo.api.platform.util;
import com.gmail.nossr50.mcmmo.api.data.MMOEntity;
import com.gmail.nossr50.mcmmo.api.data.MMOPlayer;
@Deprecated // Not really deprecated, just /really/ needs a do-over...
public interface MobHealthBarManager<PT, ET> {
/**
* Fix issues with death messages caused by the mob healthbars.
*
* @param deathMessage The original death message
* @param player The player who died
* @return the fixed death message
*/
public String fixDeathMessage(String deathMessage, MMOPlayer<PT> player);
/**
* Handle the creation of mob healthbars.
*
* @param target the targetted entity
* @param damage damage done by the attack triggering this
*/
public void handleMobHealthbars(MMOEntity<ET> target, double damage);
}