forked from ChestShop-authors/ChestShop-3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add firework info Add book info Add skull info Add basic block state info
- Loading branch information
1 parent
4364c24
commit 9dead2c
Showing
2 changed files
with
160 additions
and
58 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/main/java/com/Acrobot/Breeze/Utils/FireworkEffectTypeNames.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,31 @@ | ||
package com.Acrobot.Breeze.Utils; | ||
|
||
import java.util.HashMap; | ||
import org.bukkit.FireworkEffect; | ||
|
||
public class FireworkEffectTypeNames { | ||
private static final HashMap<FireworkEffect.Type, String> typeToName; | ||
static { | ||
typeToName = new HashMap<FireworkEffect.Type, String>(); | ||
addType(FireworkEffect.Type.BALL, "Small Ball"); | ||
addType(FireworkEffect.Type.BALL_LARGE, "Large Ball"); | ||
addType(FireworkEffect.Type.BURST, "Burst"); | ||
addType(FireworkEffect.Type.STAR, "Star-shaped"); | ||
addType(FireworkEffect.Type.CREEPER, "Creeper-shaped"); | ||
} | ||
|
||
private static void addType(FireworkEffect.Type type, String name) { | ||
typeToName.put(type, name); | ||
} | ||
|
||
public static String getName(FireworkEffect.Type type) { | ||
if (type == null) { | ||
return null; | ||
} | ||
String name = typeToName.get(type); | ||
if (name != null) { | ||
return name; | ||
} | ||
return StringUtil.capitalizeFirstLetter(type.name(), '_'); | ||
} | ||
} |
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