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
8e87f63
commit 39388cc
Showing
8 changed files
with
228 additions
and
0 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
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,12 @@ | ||
package com.laytonsmith.abstraction; | ||
|
||
import com.laytonsmith.abstraction.enums.MCArt; | ||
|
||
/** | ||
* | ||
*/ | ||
public interface MCPainting extends MCHanging { | ||
MCArt getArt(); | ||
boolean setArt(MCArt art); | ||
boolean setArt(MCArt art, boolean force); | ||
} |
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
32 changes: 32 additions & 0 deletions
32
src/main/java/com/laytonsmith/abstraction/bukkit/BukkitMCPainting.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,32 @@ | ||
package com.laytonsmith.abstraction.bukkit; | ||
|
||
import com.laytonsmith.abstraction.MCPainting; | ||
import com.laytonsmith.abstraction.enums.MCArt; | ||
import com.laytonsmith.abstraction.enums.bukkit.BukkitMCArt; | ||
import org.bukkit.entity.Painting; | ||
|
||
/** | ||
* | ||
*/ | ||
public class BukkitMCPainting extends BukkitMCHanging implements MCPainting { | ||
|
||
Painting p; | ||
|
||
public BukkitMCPainting(Painting painting){ | ||
super(painting); | ||
this.p = painting; | ||
} | ||
|
||
public MCArt getArt() { | ||
return BukkitMCArt.getConvertor().getAbstractedEnum(p.getArt()); | ||
} | ||
|
||
public boolean setArt(MCArt art) { | ||
return setArt(art, false); | ||
} | ||
|
||
public boolean setArt(MCArt art, boolean force) { | ||
return p.setArt(BukkitMCArt.getConvertor().getConcreteEnum(art), force); | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/com/laytonsmith/abstraction/enums/MCArt.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,33 @@ | ||
package com.laytonsmith.abstraction.enums; | ||
|
||
/** | ||
* | ||
*/ | ||
public enum MCArt { | ||
KEBAB, | ||
AZTEC, | ||
ALBAN, | ||
AZTEC2, | ||
BOMB, | ||
PLANT, | ||
WASTELAND, | ||
POOL, | ||
COURBET, | ||
SEA, | ||
SUNSET, | ||
CREEBET, | ||
WANDERER, | ||
GRAHAM, | ||
MATCH, | ||
BUST, | ||
STAGE, | ||
VOID, | ||
SKULL_AND_ROSES, | ||
WITHER, | ||
FIGHTERS, | ||
POINTER, | ||
PIGSCENE, | ||
BURNINGSKULL, | ||
SKELETON, | ||
DONKEYKONG; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/laytonsmith/abstraction/enums/bukkit/BukkitMCArt.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,25 @@ | ||
package com.laytonsmith.abstraction.enums.bukkit; | ||
|
||
import com.laytonsmith.abstraction.Implementation; | ||
import com.laytonsmith.abstraction.enums.EnumConvertor; | ||
import com.laytonsmith.abstraction.enums.MCArt; | ||
import com.laytonsmith.annotations.abstractionenum; | ||
import org.bukkit.Art; | ||
|
||
@abstractionenum( | ||
implementation = Implementation.Type.BUKKIT, | ||
forAbstractEnum = MCArt.class, | ||
forConcreteEnum = Art.class) | ||
public class BukkitMCArt extends EnumConvertor<MCArt, Art> { | ||
|
||
private static com.laytonsmith.abstraction.enums.bukkit.BukkitMCArt instance; | ||
|
||
public static com.laytonsmith.abstraction.enums.bukkit.BukkitMCArt getConvertor() { | ||
if (instance == null) { | ||
instance = new com.laytonsmith.abstraction.enums.bukkit.BukkitMCArt(); | ||
} | ||
return instance; | ||
} | ||
|
||
|
||
} |
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