safety check for moved earth, otherwise this move could be used on top of a bunch of raised earth to glitch out blocks and sometimes leave lava sources making a mess in the world

This commit is contained in:
PhanaticD 2019-01-14 17:17:35 -05:00
parent be896ecf32
commit 83afd7142f

View file

@ -1,11 +1,15 @@
package com.projectkorra.projectkorra.earthbending.lava;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.ability.LavaAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.TempBlock;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
@ -14,15 +18,11 @@ import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.LavaAbility;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType;
import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.TempBlock;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
public class LavaFlow extends LavaAbility {
@ -386,6 +386,9 @@ public class LavaFlow extends LavaAbility {
*/
public void createLava(final Block block) {
if (isEarth(block) || isSand(block) || isMetal(block)) {
if (EarthAbility.getMovedEarth().containsKey(block)){
return;
}
if (isPlant(block.getRelative(BlockFace.UP)) || isSnow(block.getRelative(BlockFace.UP))) {
final Block above = block.getRelative(BlockFace.UP);
final Block above2 = above.getRelative(BlockFace.UP);