Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add EnderDragon phase to entity_spec()
- Loading branch information
1 parent
81aad94
commit d3e225d
Showing
6 changed files
with
104 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
9 changes: 5 additions & 4 deletions
9
src/main/java/com/laytonsmith/abstraction/entities/MCEnderDragon.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
package com.laytonsmith.abstraction.entities; | ||
|
||
/** | ||
* | ||
* @author Hekta | ||
*/ | ||
import com.laytonsmith.abstraction.enums.MCEnderDragonPhase; | ||
|
||
public interface MCEnderDragon extends MCComplexLivingEntity { | ||
|
||
MCEnderDragonPhase getPhase(); | ||
void setPhase(MCEnderDragonPhase phase); | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/laytonsmith/abstraction/enums/MCEnderDragonPhase.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.laytonsmith.abstraction.enums; | ||
|
||
public enum MCEnderDragonPhase { | ||
|
||
BREATH_ATTACK, | ||
CHARGE_PLAYER, | ||
CIRCLING, | ||
DYING, | ||
FLY_TO_PORTAL, | ||
HOVER, | ||
LAND_ON_PORTAL, | ||
LEAVE_PORTAL, | ||
ROAR_BEFORE_ATTACK, | ||
SEARCH_FOR_BREATH_ATTACK_TARGET, | ||
STRAFING | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/com/laytonsmith/abstraction/enums/bukkit/BukkitMCEnderDragonPhase.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
package com.laytonsmith.abstraction.enums.bukkit; | ||
|
||
import com.laytonsmith.abstraction.Implementation; | ||
import com.laytonsmith.abstraction.enums.EnumConvertor; | ||
import com.laytonsmith.abstraction.enums.MCEnderDragonPhase; | ||
import com.laytonsmith.abstraction.enums.MCVersion; | ||
import com.laytonsmith.annotations.abstractionenum; | ||
import com.laytonsmith.core.Static; | ||
import org.bukkit.entity.EnderDragon; | ||
|
||
@abstractionenum( | ||
implementation=Implementation.Type.BUKKIT, | ||
forAbstractEnum=MCEnderDragonPhase.class, | ||
forConcreteEnum=EnderDragon.Phase.class | ||
) | ||
public class BukkitMCEnderDragonPhase extends EnumConvertor<MCEnderDragonPhase, EnderDragon.Phase> { | ||
|
||
private static BukkitMCEnderDragonPhase instance; | ||
|
||
public static BukkitMCEnderDragonPhase getConvertor() { | ||
if (instance == null) { | ||
instance = new BukkitMCEnderDragonPhase(); | ||
} | ||
return instance; | ||
} | ||
|
||
@Override | ||
protected EnderDragon.Phase getConcreteEnumCustom(MCEnderDragonPhase abstracted) { | ||
if(Static.getServer().getMinecraftVersion().lt(MCVersion.MC1_9_X)) { | ||
return null; | ||
} | ||
return super.getConcreteEnumCustom(abstracted); | ||
} | ||
} |
This file contains 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
This file contains 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