Update for MC 1.13.2, fixes #519. Bump version number

This commit is contained in:
BuildTools 2018-11-13 16:24:42 -05:00
parent 9d99655ef6
commit b4fe66f036
6 changed files with 226 additions and 3 deletions

BIN
lib/craftbukkit-1.13.2.jar Normal file

Binary file not shown.

View File

@ -3,7 +3,7 @@
<groupId>me.blackvein.quests</groupId> <groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId> <artifactId>quests</artifactId>
<version>3.4.1</version> <version>3.4.2</version>
<name>quests</name> <name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url> <url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging> <packaging>jar</packaging>
@ -39,6 +39,13 @@
</repository> </repository>
</repositories> </repositories>
<dependencies> <dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit1132</artifactId>
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftbukkit-1.13.2.jar</systemPath>
</dependency>
<dependency> <dependency>
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit113</artifactId> <artifactId>bukkit113</artifactId>

View File

@ -0,0 +1,120 @@
package me.blackvein.particles;
import org.bukkit.Location;
import org.bukkit.Particle;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
/**
* This is the Eff_1_13_R2 Enum, it contains all valid effects that players can
* use with the 1.13.2 server version.
*
* @author FlyingPikachu
* @since 3.4.1
* @version 3
*/
public enum Eff_1_13_R2 {
EXPLOSION(Particle.EXPLOSION_NORMAL),
EXPLOSION_LARGE(Particle.EXPLOSION_LARGE),
EXPLOSION_HUGE(Particle.EXPLOSION_HUGE),
FIREWORKS_SPARK(Particle.FIREWORKS_SPARK),
BUBBLE(Particle.WATER_BUBBLE),
WAKE(Particle.WATER_WAKE),
SPLASH(Particle.WATER_SPLASH),
SUSPENDED(Particle.SUSPENDED),
DEPTH_SUSPEND(Particle.SUSPENDED_DEPTH),
CRIT(Particle.CRIT),
MAGIC_CRIT(Particle.CRIT_MAGIC),
SMOKE(Particle.SMOKE_NORMAL),
LARGE_SMOKE(Particle.SMOKE_LARGE),
SPELL(Particle.SPELL),
INSTANT_SPELL(Particle.SPELL_INSTANT),
MOB_SPELL(Particle.SPELL_MOB),
MOB_SPELL_AMBIENT(Particle.SPELL_MOB_AMBIENT),
WITCH_MAGIC(Particle.SPELL_WITCH),
DRIP_WATER(Particle.DRIP_WATER),
DRIP_LAVA(Particle.DRIP_LAVA),
ANGRY_VILLAGER(Particle.VILLAGER_ANGRY),
HAPPY_VILLAGER(Particle.VILLAGER_HAPPY),
TOWN_AURA(Particle.TOWN_AURA),
NOTE(Particle.NOTE),
PORTAL(Particle.PORTAL),
ENCHANTMENT_TABLE(Particle.ENCHANTMENT_TABLE),
FLAME(Particle.FLAME),
LAVA(Particle.LAVA),
CLOUD(Particle.CLOUD),
RED_DUST(Particle.REDSTONE),
SNOWBALL_POOF(Particle.SNOWBALL),
SNOW_SHOVEL(Particle.SNOW_SHOVEL),
SLIME(Particle.SLIME),
HEART(Particle.HEART),
BARRIER(Particle.BARRIER),
ICONCRACK_(Particle.ITEM_CRACK),
BLOCKCRACK_(Particle.BLOCK_CRACK),
BLOCKDUST_(Particle.BLOCK_DUST),
DROPLET(Particle.WATER_DROP),
MOB_APPEARANCE(Particle.MOB_APPEARANCE),
SWEEPING_DUST(Particle.SWEEP_ATTACK),
DRAGON_BREATH(Particle.DRAGON_BREATH),
ENDROD(Particle.END_ROD),
DAMAGE_INDICATOR(Particle.DAMAGE_INDICATOR),
FALLING_DUST(Particle.FALLING_DUST),
SPIT(Particle.SPIT),
TOTEM(Particle.TOTEM),
BUBBLE_COLUMN_UP(Particle.BUBBLE_COLUMN_UP),
BUBBLE_POP(Particle.BUBBLE_POP),
CURRENT_DOWN(Particle.CURRENT_DOWN),
SQUID_INK(Particle.SQUID_INK),
NAUTILUS(Particle.NAUTILUS),
DOLPHIN(Particle.DOLPHIN);
/**
* The NMS Particle to be sent to the player.
*/
private final Particle particleEnum;
/**
* Create a new instance of the Eff_1_13_R1 enum with the given particle type
* to be sent.
*
* @param particleEnum
* The particle type to be sent to the player in the
* PacketPlayOutWorldParticles packet.
*/
Eff_1_13_R2(Particle particleEnum) {
this.particleEnum = particleEnum;
}
/**
* Send the given particle to the player via NMS. It should be noted that
* all particles have the range limit set to 256 due to the second variable
* in the packet constructor being false.
*
* @param player
* The player to send the particle to.
* @param location
* The location to play the particle at.
* @param offsetX
* The offset of the particle in the X direction.
* @param offsetY
* The offset of the particle in the Y direction.
* @param offsetZ
* The offset of the particle in the Z direction.
* @param speed
* The speed that the particle effect will be played at.
* @param count
* The number of particles to send to the player.
* @param data
* An integer array needed for some particles, this is used for
* packets such as block crack or particle colour on redstone /
* firework particles.
* @throws Exception
* A ReportedException may be thrown if the network manager
* fails to handle the packet.
*/
public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception {
((CraftPlayer) player).spawnParticle(particleEnum, location, count, offsetX, offsetY, offsetZ, speed, data);
}
}

View File

@ -22,6 +22,7 @@ import me.blackvein.particles.Eff_1_10_R1;
import me.blackvein.particles.Eff_1_11_R1; import me.blackvein.particles.Eff_1_11_R1;
import me.blackvein.particles.Eff_1_12_R1; import me.blackvein.particles.Eff_1_12_R1;
import me.blackvein.particles.Eff_1_13_R1; import me.blackvein.particles.Eff_1_13_R1;
import me.blackvein.particles.Eff_1_13_R2;
import me.blackvein.particles.Eff_1_7_R3; import me.blackvein.particles.Eff_1_7_R3;
import me.blackvein.particles.Eff_1_7_R4; import me.blackvein.particles.Eff_1_7_R4;
import me.blackvein.particles.Eff_1_8_R1; import me.blackvein.particles.Eff_1_8_R1;
@ -63,7 +64,9 @@ public class NpcEffectThread implements Runnable {
// effectType is either effectType or Quests.repeatEffect // effectType is either effectType or Quests.repeatEffect
private void showEffect(Player player, NPC npc, String effectType) { private void showEffect(Player player, NPC npc, String effectType) {
if (Quests.bukkitVersion >= 113) { if (Quests.bukkitVersion >= 1132) {
showEffect_1_13_R2(player, npc, effectType);
} else if (Quests.bukkitVersion >= 113) {
showEffect_1_13_R1(player, npc, effectType); showEffect_1_13_R1(player, npc, effectType);
} else if (Quests.bukkitVersion >= 112 ) { } else if (Quests.bukkitVersion >= 112 ) {
showEffect_1_12_R1(player, npc, effectType); showEffect_1_12_R1(player, npc, effectType);
@ -88,6 +91,98 @@ public class NpcEffectThread implements Runnable {
} }
} }
private void showEffect_1_13_R2(Player player, NPC npc, String effectType) {
// Get and set eye location, because npc.getBukkitEntity() is deprecated.
Location eyeLoc = npc.getEntity().getLocation();
eyeLoc.setY(eyeLoc.getY() + 1.5);
if (effectType.equalsIgnoreCase("enchant")) {
try {
Eff_1_13_R2.ENCHANTMENT_TABLE.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 10, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (effectType.equalsIgnoreCase("crit")) {
try {
Eff_1_13_R2.CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (effectType.equalsIgnoreCase("spell")) {
try {
Eff_1_13_R2.INSTANT_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (effectType.equalsIgnoreCase("magiccrit")) {
try {
Eff_1_13_R2.MAGIC_CRIT.sendToPlayer(player, eyeLoc, 0, 0, 0, (float) 0.35, 3, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (effectType.equalsIgnoreCase("mobspell")) {
try {
Eff_1_13_R2.MOB_SPELL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (effectType.equalsIgnoreCase("note")) {
try {
Location old = eyeLoc;
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
Eff_1_13_R2.NOTE.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (effectType.equalsIgnoreCase("portal")) {
try {
Eff_1_13_R2.PORTAL.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 5, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (effectType.equalsIgnoreCase("dust")) {
try {
Location newLoc = new Location(player.getWorld(), eyeLoc.getX(), eyeLoc.getY() + (float) 0.5, eyeLoc.getZ());
Eff_1_13_R2.RED_DUST.sendToPlayer(player, newLoc, 0, 0, 0, 1, 1, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (effectType.equalsIgnoreCase("witch")) {
try {
Eff_1_13_R2.WITCH_MAGIC.sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (effectType.equalsIgnoreCase("snowball")) {
try {
Location old = eyeLoc;
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
Eff_1_13_R2.SNOWBALL_POOF.sendToPlayer(player, newLoc, 0, 0, 0, 1, 3, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (effectType.equalsIgnoreCase("splash")) {
try {
Location old = eyeLoc;
Location newLoc = new Location(player.getWorld(), old.getX(), old.getY() + (float) 0.5, old.getZ());
Eff_1_13_R2.SPLASH.sendToPlayer(player, newLoc, 0, 0, 0, 1, 4, null);
} catch (Exception e) {
e.printStackTrace();
}
} else if (effectType.equalsIgnoreCase("smoke")) {
try {
Eff_1_13_R2.TOWN_AURA.sendToPlayer(player, eyeLoc, 0, 1, 0, 1, 20, null);
} catch (Exception e) {
e.printStackTrace();
}
} else {
try {
Eff_1_13_R2.valueOf(effectType.toUpperCase()).sendToPlayer(player, eyeLoc, 0, 0, 0, 1, 3, null);
} catch (Exception e) {
plugin.getLogger().info(effectType + " is not a valid effect name!");
}
}
}
private void showEffect_1_13_R1(Player player, NPC npc, String effectType) { private void showEffect_1_13_R1(Player player, NPC npc, String effectType) {
// Get and set eye location, because npc.getBukkitEntity() is deprecated. // Get and set eye location, because npc.getBukkitEntity() is deprecated.
Location eyeLoc = npc.getEntity().getLocation(); Location eyeLoc = npc.getEntity().getLocation();

View File

@ -97,7 +97,7 @@ public class ItemStackPrompt extends FixedSetPrompt {
return menu; return menu;
} }
@SuppressWarnings("unchecked") @SuppressWarnings({ "unchecked", "deprecation" })
@Override @Override
protected Prompt acceptValidatedInput(ConversationContext cc, String input) { protected Prompt acceptValidatedInput(ConversationContext cc, String input) {
if (input.equalsIgnoreCase("0")) { if (input.equalsIgnoreCase("0")) {

View File

@ -1,6 +1,7 @@
name: Quests name: Quests
main: me.blackvein.quests.Quests main: me.blackvein.quests.Quests
version: ${project.version}-b${env.BUILD_NUMBER} version: ${project.version}-b${env.BUILD_NUMBER}
api-version: 1.13
description: An extensive questing system. description: An extensive questing system.
website: https://www.spigotmc.org/resources/quests.3711/ website: https://www.spigotmc.org/resources/quests.3711/
dev-url: https://github.com/FlyingPikachu/Quests dev-url: https://github.com/FlyingPikachu/Quests