Invalid tree animation in config handling, fix typo

This commit is contained in:
Esophose 2019-04-27 20:17:40 -06:00
parent 5ce176841e
commit 0e1afcef84
3 changed files with 8 additions and 7 deletions

View File

@ -20,7 +20,7 @@ import java.util.List;
public class TreeAnimationDisintegrate extends TreeAnimation {
public TreeAnimationDisintegrate(DetectedTree detectedTree, Player player) {
super(TreeAnimationType.DISINTIGRATE, detectedTree, player);
super(TreeAnimationType.DISINTEGRATE, detectedTree, player);
}
@Override

View File

@ -5,7 +5,7 @@ package com.songoda.ultimatetimber.animation;
*/
public enum TreeAnimationType {
FANCY,
DISINTIGRATE,
DISINTEGRATE,
CRUMBLE,
NONE;

View File

@ -7,6 +7,7 @@ import com.songoda.ultimatetimber.animation.TreeAnimationCrumble;
import com.songoda.ultimatetimber.animation.TreeAnimationDisintegrate;
import com.songoda.ultimatetimber.animation.TreeAnimationFancy;
import com.songoda.ultimatetimber.animation.TreeAnimationNone;
import com.songoda.ultimatetimber.animation.TreeAnimationType;
import com.songoda.ultimatetimber.tree.DetectedTree;
import com.songoda.ultimatetimber.tree.ITreeBlock;
import com.songoda.ultimatetimber.tree.TreeDefinition;
@ -73,17 +74,17 @@ public class TreeAnimationManager extends Manager implements Listener, Runnable
* @param player The Player who toppled the tree
*/
public void runAnimation(DetectedTree detectedTree, Player player) {
switch (ConfigurationManager.Setting.TREE_ANIMATION_TYPE.getString()) {
case "FANCY":
switch (TreeAnimationType.fromString(ConfigurationManager.Setting.TREE_ANIMATION_TYPE.getString())) {
case FANCY:
this.registerTreeAnimation(new TreeAnimationFancy(detectedTree, player));
break;
case "DISINTEGRATE":
case DISINTEGRATE:
this.registerTreeAnimation(new TreeAnimationDisintegrate(detectedTree, player));
break;
case "CRUMBLE":
case CRUMBLE:
this.registerTreeAnimation(new TreeAnimationCrumble(detectedTree, player));
break;
case "NONE":
case NONE:
this.registerTreeAnimation(new TreeAnimationNone(detectedTree, player));
break;
}