mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
More 1.13 bug fixes
This commit is contained in:
parent
a62f03eb1b
commit
db08dbcd80
7 changed files with 22 additions and 15 deletions
|
@ -107,7 +107,7 @@ public class ProjectKorra extends JavaPlugin {
|
|||
PassiveManager.registerPassives(player);
|
||||
GeneralMethods.removeUnusableAbilities(player.getName());
|
||||
}
|
||||
}, 5);
|
||||
}, 30);
|
||||
}
|
||||
|
||||
final Metrics metrics = new Metrics(this);
|
||||
|
|
|
@ -183,7 +183,7 @@ public abstract class EarthAbility extends ElementalAbility {
|
|||
final Block topblock = affectedblock.getRelative(BlockFace.UP);
|
||||
if (!isAir(topblock.getType())) {
|
||||
GeneralMethods.breakBlock(affectedblock);
|
||||
} else {
|
||||
} else if (!affectedblock.isLiquid() && !isAir(affectedblock.getType())){
|
||||
moveEarthBlock(affectedblock, topblock);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -44,7 +44,7 @@ public class PassiveManager {
|
|||
}
|
||||
|
||||
try {
|
||||
final Class<? extends CoreAbility> clazz = PASSIVE_CLASSES.get(ability);
|
||||
final Class<? extends CoreAbility> clazz = PASSIVE_CLASSES.get((PassiveAbility) ability);
|
||||
final Constructor<?> constructor = clazz.getConstructor(Player.class);
|
||||
final Object object = constructor.newInstance(player);
|
||||
((CoreAbility) object).start();
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.projectkorra.projectkorra.chiblocking;
|
|||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -15,6 +14,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
|||
import com.projectkorra.projectkorra.ability.ChiAbility;
|
||||
import com.projectkorra.projectkorra.attribute.Attribute;
|
||||
import com.projectkorra.projectkorra.command.Commands;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
|
||||
public class Smokescreen extends ChiAbility {
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class Smokescreen extends ChiAbility {
|
|||
for (int i = 0; i < 125; i++) {
|
||||
final Location newLoc = new Location(loc.getWorld(), loc.getX() + x, loc.getY() + y, loc.getZ() + z);
|
||||
for (int direction = 0; direction < 8; direction++) {
|
||||
loc.getWorld().playEffect(newLoc, Effect.SMOKE, direction);
|
||||
ParticleEffect.SMOKE_NORMAL.display(newLoc, 4, 0.5, 0.5, 0.5);
|
||||
}
|
||||
if (z == 2) {
|
||||
z = -2;
|
||||
|
|
|
@ -20,6 +20,7 @@ import com.projectkorra.projectkorra.earthbending.passive.DensityShift;
|
|||
import com.projectkorra.projectkorra.util.BlockSource;
|
||||
import com.projectkorra.projectkorra.util.ClickType;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
|
||||
public class EarthBlast extends EarthAbility {
|
||||
private boolean isProgressing;
|
||||
|
@ -156,6 +157,8 @@ public class EarthBlast extends EarthAbility {
|
|||
final Block block = BlockSource.getEarthSourceBlock(this.player, this.range, ClickType.SHIFT_DOWN);
|
||||
if (block == null || !this.isEarthbendable(block)) {
|
||||
return false;
|
||||
} else if (TempBlock.isTempBlock(block)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean selectedABlockInUse = false;
|
||||
|
|
|
@ -130,6 +130,10 @@ public class TempBlock {
|
|||
public Block getBlock() {
|
||||
return this.block;
|
||||
}
|
||||
|
||||
public BlockData getBlockData() {
|
||||
return this.newdata;
|
||||
}
|
||||
|
||||
public Location getLocation() {
|
||||
return this.block.getLocation();
|
||||
|
@ -176,7 +180,7 @@ public class TempBlock {
|
|||
}
|
||||
|
||||
public void setType(final Material material) {
|
||||
this.setType(material, this.newdata);
|
||||
this.setType(material, material.createBlockData());
|
||||
}
|
||||
|
||||
public void setType(final Material material, final BlockData data) {
|
||||
|
|
|
@ -148,23 +148,21 @@ public class SurgeWave extends WaterAbility {
|
|||
}
|
||||
|
||||
for (final Block block : GeneralMethods.getBlocksAroundPoint(this.frozenLocation, freezeradius)) {
|
||||
if (GeneralMethods.isRegionProtectedFromBuild(this, block.getLocation()) || GeneralMethods.isRegionProtectedFromBuild(this.player, "PhaseChange", block.getLocation())) {
|
||||
if (GeneralMethods.isRegionProtectedFromBuild(this, block.getLocation())) {
|
||||
continue;
|
||||
} else if (TempBlock.isTempBlock(block)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final Block oldBlock = block;
|
||||
final TempBlock tblock = new TempBlock(block, block.getType());
|
||||
if (block.getType() == Material.AIR || block.getType() == Material.SNOW || isWater(block)) {
|
||||
tblock.setType(Material.ICE);
|
||||
if (!isAir(block.getType()) && block.getType() != Material.SNOW && !isWater(block) && !isPlant(block)) {
|
||||
continue;
|
||||
} else if (isPlant(block)) {
|
||||
block.breakNaturally();
|
||||
tblock.setType(Material.ICE);
|
||||
} else {
|
||||
tblock.revertBlock();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
final TempBlock tblock = new TempBlock(block, Material.ICE);
|
||||
|
||||
tblock.setRevertTask(new RevertTask() {
|
||||
|
||||
@Override
|
||||
|
@ -173,8 +171,10 @@ public class SurgeWave extends WaterAbility {
|
|||
}
|
||||
|
||||
});
|
||||
|
||||
tblock.setRevertTime(this.iceRevertTime + (new Random().nextInt(1000)));
|
||||
this.frozenBlocks.put(block, oldBlock.getType());
|
||||
|
||||
for (final Block sound : this.frozenBlocks.keySet()) {
|
||||
if ((new Random()).nextInt(4) == 0) {
|
||||
playWaterbendingSound(sound.getLocation());
|
||||
|
|
Loading…
Reference in a new issue