Skip to content

Commit

Permalink
v2.1.5.7
Browse files Browse the repository at this point in the history
프로젝트 구조 업데이트
납치 능력 EntityDismountEvent subscriber 제거 (fixes #38)
Blocks 제거
BlockX.isIndestructible 추가
  • Loading branch information
Daybreak365 committed Feb 29, 2020
1 parent 28aefdb commit 80b9841
Show file tree
Hide file tree
Showing 221 changed files with 248 additions and 261 deletions.

This file was deleted.

28 changes: 2 additions & 26 deletions modules/Core/pom.xml → modules/Plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,38 +34,14 @@
</dependency>
<dependency>
<groupId>daybreak.abilitywar</groupId>
<artifactId>v1_12_R1</artifactId>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>daybreak.abilitywar</groupId>
<artifactId>v1_13_R1</artifactId>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>daybreak.abilitywar</groupId>
<artifactId>v1_13_R2</artifactId>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>daybreak.abilitywar</groupId>
<artifactId>v1_14_R1</artifactId>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>daybreak.abilitywar</groupId>
<artifactId>v1_15_R1</artifactId>
<artifactId>Interfaces</artifactId>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
<version>${spigot-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@ public static AbilityWar getPlugin() {

public AbilityWar() {
plugin = this;

}

public Installer getInstaller() throws IllegalStateException {
if (installer != null) {
return installer;
}
throw new IllegalStateException("버전 목록이 아직 불러와지지 않았습니다.");
}

@Override
public void onEnable() {
CompletableFuture.runAsync(new Runnable() {
@Override
public void run() {
Expand All @@ -67,6 +55,22 @@ public void run() {
AbilityWar.this.installer = installer;
}
});
}

public Installer getInstaller() throws IllegalStateException {
if (installer != null) {
return installer;
}
throw new IllegalStateException("버전 목록이 아직 불러와지지 않았습니다.");
}

@Override
public void onLoad() {

}

@Override
public void onEnable() {
ServerVersion.compatVersion(this);
Messager.sendConsoleMessage("Server Version: " + Bukkit.getServer().getBukkitVersion());
Bukkit.getPluginCommand("AbilityWar").setExecutor(new MainCommand(this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@
import daybreak.abilitywar.config.ability.AbilitySettings.SettingObject;
import daybreak.abilitywar.game.games.mode.AbstractGame.Participant;
import daybreak.abilitywar.utils.base.Messager;
import daybreak.abilitywar.utils.base.concurrent.TimeUnit;
import daybreak.abilitywar.utils.library.ParticleLib;
import daybreak.abilitywar.utils.library.SoundLib;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerToggleSneakEvent;

@AbilityManifest(Name = "깃털", Rank = Rank.A, Species = Species.OTHERS)
public class Feather extends AbilityBase implements ActiveHandler {
Expand All @@ -41,17 +46,13 @@ public boolean Condition(Integer value) {

public Feather(Participant participant) {
super(participant,
ChatColor.translateAlternateColorCodes('&', "&f철괴를 우클릭하면 " + DurationConfig.getValue() + "초간 비행할 수 있습니다. " + Messager.formatCooldown(CooldownConfig.getValue())),
ChatColor.translateAlternateColorCodes('&', "&f철괴를 우클릭하면 " + DurationConfig.getValue() + "초간 &b비행&f할 수 있습니다. " + Messager.formatCooldown(CooldownConfig.getValue())),
ChatColor.translateAlternateColorCodes('&', "&b비행 &f중 웅크리면 바라보는 방향으로 돌진합니다."),
ChatColor.translateAlternateColorCodes('&', "&f낙하 대미지를 무시합니다."));
}

private final CooldownTimer cooldownTimer = new CooldownTimer(CooldownConfig.getValue());

private final DurationTimer Duration = new DurationTimer(DurationConfig.getValue(), cooldownTimer) {

@Override
public void onDurationStart() {
}
private final DurationTimer durationTimer = new DurationTimer(DurationConfig.getValue() * 4, cooldownTimer) {

@Override
public void onDurationProcess(int seconds) {
Expand All @@ -61,22 +62,26 @@ public void onDurationProcess(int seconds) {

@Override
public void onDurationEnd() {
getPlayer().setAllowFlight(false);
getPlayer().setFlying(false);
GameMode mode = getPlayer().getGameMode();
getPlayer().setAllowFlight(mode != GameMode.SURVIVAL && mode != GameMode.ADVENTURE);
}

@Override
protected void onDurationSilentEnd() {
getPlayer().setAllowFlight(false);
getPlayer().setFlying(false);
GameMode mode = getPlayer().getGameMode();
getPlayer().setAllowFlight(mode != GameMode.SURVIVAL && mode != GameMode.ADVENTURE);
}

};
}.setPeriod(TimeUnit.TICKS, 5);

@Override
public boolean ActiveSkill(Material materialType, ClickType clickType) {
if (materialType.equals(Material.IRON_INGOT)) {
if (clickType.equals(ClickType.RIGHT_CLICK)) {
if (!Duration.isDuration() && !cooldownTimer.isCooldown()) {
Duration.start();
if (!durationTimer.isDuration() && !cooldownTimer.isCooldown()) {
durationTimer.start();

return true;
}
Expand All @@ -87,14 +92,36 @@ public boolean ActiveSkill(Material materialType, ClickType clickType) {
}

@SubscribeEvent
public void onEntityDamage(EntityDamageEvent e) {
private void onEntityDamage(EntityDamageEvent e) {
if (!e.isCancelled() && getPlayer().equals(e.getEntity()) && e.getCause().equals(DamageCause.FALL)) {
e.setCancelled(true);
getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', "&a낙하 대미지를 받지 않습니다."));
SoundLib.ENTITY_EXPERIENCE_ORB_PICKUP.playSound(getPlayer());
}
}

private final Timer dash = new Timer() {
@Override
protected void run(int count) {
if (getPlayer().isFlying()) {
getPlayer().setVelocity(getPlayer().getLocation().getDirection().multiply(1.25));
ParticleLib.CLOUD.spawnParticle(getPlayer().getLocation(), 0, 0, 0, 1);
} else {
stop(false);
}
}
}.setPeriod(TimeUnit.TICKS, 1);

@SubscribeEvent(onlyRelevant = true)
private void onToogleSneak(PlayerToggleSneakEvent e) {
Player player = e.getPlayer();
if (player.isFlying() && e.isSneaking()) {
dash.start();
} else {
dash.stop(false);
}
}

@Override
public void TargetSkill(Material materialType, LivingEntity entity) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import daybreak.abilitywar.game.games.mode.AbstractGame.Participant;
import daybreak.abilitywar.utils.base.Messager;
import daybreak.abilitywar.utils.base.concurrent.TimeUnit;
import daybreak.abilitywar.utils.base.minecraft.compat.block.BlockHandler;
import daybreak.abilitywar.utils.base.minecraft.compat.block.BlockSnapshot;
import daybreak.abilitywar.utils.base.minecraft.compat.block.BlocksHandler;
import daybreak.abilitywar.utils.library.BlockX;
import daybreak.abilitywar.utils.library.MaterialX;
import daybreak.abilitywar.utils.library.PotionEffects;
Expand Down Expand Up @@ -105,7 +105,7 @@ public void onStart() {
public void run(int count) {
if (totalCount <= 10) {
for (Block block : LocationUtil.getBlocks2D(center, buildCount, true, false)) {
saves.putIfAbsent(block, BlocksHandler.getBlocks().createSnapshot(block));
saves.putIfAbsent(block, BlockHandler.createSnapshot(block));
if (random.nextInt(5) <= 1) {
BlockX.setType(block, MaterialX.STONE_BRICKS);
} else {
Expand All @@ -121,17 +121,17 @@ public void run(int count) {
buildCount++;
} else if (totalCount <= 15) {
for (Block block : LocationUtil.getBlocks2D(center.clone().add(0, totalCount - 10, 0), buildCount - 2, true, false)) {
saves.putIfAbsent(block, BlocksHandler.getBlocks().createSnapshot(block));
saves.putIfAbsent(block, BlockHandler.createSnapshot(block));
BlockX.setType(block, MaterialX.IRON_BARS);
}

for (Block block : LocationUtil.getBlocks2D(center.clone().add(0, totalCount - 10, 0), buildCount - 1, true, false)) {
saves.putIfAbsent(block, BlocksHandler.getBlocks().createSnapshot(block));
saves.putIfAbsent(block, BlockHandler.createSnapshot(block));
BlockX.setType(block, MaterialX.IRON_BARS);
}
} else if (totalCount <= 26) {
for (Block block : LocationUtil.getBlocks2D(center.clone().add(0, 6, 0), buildCount, true, false)) {
saves.putIfAbsent(block, BlocksHandler.getBlocks().createSnapshot(block));
saves.putIfAbsent(block, BlockHandler.createSnapshot(block));
if (random.nextInt(5) <= 1) {
BlockX.setType(block, MaterialX.STONE_BRICKS);
} else {
Expand All @@ -149,7 +149,7 @@ public void onEnd() {
Block check = center.getBlock().getRelative(0, 6, 0);

if (!BlockX.isType(check, MaterialX.STONE_BRICKS)) {
saves.putIfAbsent(check, BlocksHandler.getBlocks().createSnapshot(check));
saves.putIfAbsent(check, BlockHandler.createSnapshot(check));
BlockX.setType(check, MaterialX.STONE_BRICKS);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import daybreak.abilitywar.game.games.mode.AbstractGame.Participant.ActionbarNotification.ActionbarChannel;
import daybreak.abilitywar.utils.base.Messager;
import daybreak.abilitywar.utils.base.concurrent.TimeUnit;
import daybreak.abilitywar.utils.base.minecraft.compat.block.BlocksHandler;
import daybreak.abilitywar.utils.library.BlockX;
import daybreak.abilitywar.utils.library.MaterialX;
import daybreak.abilitywar.utils.math.LocationUtil;
Expand Down Expand Up @@ -99,7 +98,7 @@ public void TargetSkill(Material materialType, LivingEntity entity) {
if (entity != null) {
if (!cooldownTimer.isCooldown()) {
for (Block block : LocationUtil.getBlocks3D(entity.getLocation(), size, true, true)) {
if (!BlocksHandler.getBlocks().isIndestructible(block.getType())) {
if (!BlockX.isIndestructible(block.getType())) {
BlockX.setType(block, MaterialX.WHITE_STAINED_GLASS);
blocks.put(block, solidity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import daybreak.abilitywar.config.ability.AbilitySettings.SettingObject;
import daybreak.abilitywar.game.games.mode.AbstractGame.Participant;
import daybreak.abilitywar.utils.base.Messager;
import daybreak.abilitywar.utils.base.concurrent.TimeUnit;
import daybreak.abilitywar.utils.library.PotionEffects;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
Expand All @@ -21,7 +22,6 @@
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityEvent;
import org.bukkit.projectiles.ProjectileSource;
import org.spigotmc.event.entity.EntityDismountEvent;

@AbilityManifest(Name = "납치", Rank = Rank.B, Species = Species.HUMAN)
public class Kidnap extends AbilityBase implements TargetHandler {
Expand Down Expand Up @@ -56,7 +56,7 @@ public Kidnap(Participant participant) {

private LivingEntity target = null;
private final CooldownTimer cooldownTimer = new CooldownTimer(CooldownConfig.getValue());
private final DurationTimer skill = new DurationTimer(DurationConfig.getValue(), cooldownTimer) {
private final DurationTimer skill = new DurationTimer(DurationConfig.getValue() * 20, cooldownTimer) {
@Override
protected void onDurationStart() {
if (target != null && target.isValid()) {
Expand All @@ -71,6 +71,9 @@ protected void onDurationStart() {
protected void onDurationProcess(int seconds) {
PotionEffects.SPEED.addPotionEffect(getPlayer(), 25, 1, true);
PotionEffects.BLINDNESS.addPotionEffect(target, 40, 0, true);
if (!getPlayer().equals(target.getVehicle())) {
getPlayer().addPassenger(target);
}
}

@Override
Expand All @@ -92,14 +95,7 @@ protected void onDurationSilentEnd() {
target = null;
}
}
};

@SubscribeEvent
private void onPlayerDismount(EntityDismountEvent e) {
if (skill.isRunning() && e.getDismounted().equals(getPlayer()) && e.getEntity().equals(target)) {
e.setCancelled(true);
}
}
}.setPeriod(TimeUnit.TICKS, 1);

@SubscribeEvent
private void onEntityDamageByEntity(EntityDamageByEntityEvent e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import daybreak.abilitywar.game.games.mode.AbstractGame.Participant;
import daybreak.abilitywar.utils.base.Messager;
import daybreak.abilitywar.utils.base.concurrent.TimeUnit;
import daybreak.abilitywar.utils.base.minecraft.compat.block.BlockHandler;
import daybreak.abilitywar.utils.base.minecraft.compat.block.BlockSnapshot;
import daybreak.abilitywar.utils.base.minecraft.compat.block.BlocksHandler;
import daybreak.abilitywar.utils.library.BlockX;
import daybreak.abilitywar.utils.library.MaterialX;
import daybreak.abilitywar.utils.library.PotionEffects;
Expand Down Expand Up @@ -103,20 +103,20 @@ public void run(int sec) {
Block belowBlock = block.getRelative(BlockFace.DOWN);
Material type = belowBlock.getType();
if (type == Material.WATER) {
blockData.putIfAbsent(belowBlock, BlocksHandler.getBlocks().createSnapshot(belowBlock));
blockData.putIfAbsent(belowBlock, BlockHandler.createSnapshot(belowBlock));
belowBlock.setType(Material.PACKED_ICE);
} else if (type == Material.LAVA) {
blockData.putIfAbsent(belowBlock, BlocksHandler.getBlocks().createSnapshot(belowBlock));
blockData.putIfAbsent(belowBlock, BlockHandler.createSnapshot(belowBlock));
belowBlock.setType(Material.OBSIDIAN);
} else if (MaterialX.ACACIA_LEAVES.compareType(belowBlock) || MaterialX.BIRCH_LEAVES.compareType(belowBlock) || MaterialX.DARK_OAK_LEAVES.compareType(belowBlock)
|| MaterialX.JUNGLE_LEAVES.compareType(belowBlock) || MaterialX.OAK_LEAVES.compareType(belowBlock) || MaterialX.SPRUCE_LEAVES.compareType(belowBlock)) {
BlockX.setType(belowBlock, MaterialX.GREEN_WOOL);
} else {
blockData.putIfAbsent(belowBlock, BlocksHandler.getBlocks().createSnapshot(belowBlock));
blockData.putIfAbsent(belowBlock, BlockHandler.createSnapshot(belowBlock));
belowBlock.setType(Material.SNOW_BLOCK);
}

blockData.putIfAbsent(block, BlocksHandler.getBlocks().createSnapshot(block));
blockData.putIfAbsent(block, BlockHandler.createSnapshot(block));
block.setType(Material.SNOW);
}
count++;
Expand Down
Loading

0 comments on commit 80b9841

Please sign in to comment.