Merge pull request #455 from grasshopperMatt/master

Fixed blocks not being returned to their previous state
This commit is contained in:
OmniCypher 2016-03-25 18:20:32 -07:00
commit e004ede011

View file

@ -1,16 +1,8 @@
package com.projectkorra.projectkorra.ability; package com.projectkorra.projectkorra.ability;
import com.projectkorra.projectkorra.BendingPlayer; import java.util.ArrayList;
import com.projectkorra.projectkorra.Element; import java.util.HashSet;
import com.projectkorra.projectkorra.GeneralMethods; import java.util.concurrent.ConcurrentHashMap;
import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.earthbending.EarthPassive;
import com.projectkorra.projectkorra.earthbending.LavaFlow;
import com.projectkorra.projectkorra.earthbending.RaiseEarth;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.Information;
import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.TempBlock;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Effect; import org.bukkit.Effect;
@ -25,9 +17,17 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import java.util.ArrayList; import com.projectkorra.projectkorra.BendingPlayer;
import java.util.HashSet; import com.projectkorra.projectkorra.Element;
import java.util.concurrent.ConcurrentHashMap; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.earthbending.EarthPassive;
import com.projectkorra.projectkorra.earthbending.LavaFlow;
import com.projectkorra.projectkorra.earthbending.RaiseEarth;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.Information;
import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.TempBlock;
public abstract class EarthAbility extends ElementalAbility { public abstract class EarthAbility extends ElementalAbility {
@ -240,15 +240,19 @@ public abstract class EarthAbility extends ElementalAbility {
* *
* @param block The block to use as a base * @param block The block to use as a base
*/ */
@SuppressWarnings("deprecation")
public static void addTempAirBlock(Block block) { public static void addTempAirBlock(Block block) {
Information info; Information info;
if (MOVED_EARTH.containsKey(block)) { if (MOVED_EARTH.containsKey(block)) {
info = MOVED_EARTH.get(block); info = MOVED_EARTH.get(block);
MOVED_EARTH.remove(block); MOVED_EARTH.remove(block);
} else { } else {
info = new Information(); info = new Information();
info.setBlock(block); info.setBlock(block);
info.setState(block.getState()); info.setData(block.getData());
} }
block.setType(Material.AIR); block.setType(Material.AIR);
info.setTime(System.currentTimeMillis()); info.setTime(System.currentTimeMillis());