Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b802db5
commit 7738797
Showing
5 changed files
with
94 additions
and
12 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCShulker.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,36 @@ | ||
package com.laytonsmith.abstraction.bukkit.entities; | ||
|
||
import com.laytonsmith.abstraction.entities.MCShulker; | ||
import com.laytonsmith.abstraction.enums.MCDyeColor; | ||
import com.laytonsmith.abstraction.enums.bukkit.BukkitMCDyeColor; | ||
import org.bukkit.entity.Entity; | ||
import org.bukkit.entity.Shulker; | ||
|
||
public class BukkitMCShulker extends BukkitMCLivingEntity implements MCShulker { | ||
|
||
private Shulker sh; | ||
|
||
public BukkitMCShulker(Entity be) { | ||
super(be); | ||
this.sh = (Shulker) be; | ||
} | ||
|
||
@Override | ||
public MCDyeColor getColor() { | ||
try { | ||
return BukkitMCDyeColor.getConvertor().getAbstractedEnum(sh.getColor()); | ||
} catch(NoSuchMethodError ex) { | ||
// probably prior to 1.12 | ||
} | ||
return MCDyeColor.PURPLE; | ||
} | ||
|
||
@Override | ||
public void setColor(MCDyeColor color) { | ||
try { | ||
sh.setColor(BukkitMCDyeColor.getConvertor().getConcreteEnum(color)); | ||
} catch(NoSuchMethodError ex) { | ||
// probably prior to 1.12 | ||
} | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
src/main/java/com/laytonsmith/abstraction/entities/MCShulker.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,11 @@ | ||
package com.laytonsmith.abstraction.entities; | ||
|
||
import com.laytonsmith.abstraction.MCLivingEntity; | ||
import com.laytonsmith.abstraction.enums.MCDyeColor; | ||
|
||
public interface MCShulker extends MCLivingEntity { | ||
|
||
MCDyeColor getColor(); | ||
void setColor(MCDyeColor color); | ||
|
||
} |
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