mirror of
https://github.com/TotalFreedomMC/PlayerParticles.git
synced 2024-12-28 10:24:15 +00:00
Added support for new 1.18 particle block_marker
This commit is contained in:
parent
45b4a05ad5
commit
bff7eef740
8 changed files with 15 additions and 14 deletions
|
@ -10,7 +10,7 @@ sourceCompatibility = 1.8
|
||||||
targetCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
compileJava.options.encoding = 'UTF-8'
|
compileJava.options.encoding = 'UTF-8'
|
||||||
group = 'dev.esophose'
|
group = 'dev.esophose'
|
||||||
version = '7.23-SNAPSHOT'
|
version = '7.23'
|
||||||
|
|
||||||
java {
|
java {
|
||||||
withJavadocJar()
|
withJavadocJar()
|
||||||
|
@ -35,7 +35,7 @@ dependencies {
|
||||||
compileOnly 'org.jetbrains:annotations:16.0.2'
|
compileOnly 'org.jetbrains:annotations:16.0.2'
|
||||||
compileOnly 'me.clip:placeholderapi:2.10.4'
|
compileOnly 'me.clip:placeholderapi:2.10.4'
|
||||||
compileOnly 'org.xerial:sqlite-jdbc:3.23.1'
|
compileOnly 'org.xerial:sqlite-jdbc:3.23.1'
|
||||||
compileOnly 'org.spigotmc:spigot:1.17.1'
|
compileOnly 'org.spigotmc:spigot-api:1.18-pre5-R0.1-SNAPSHOT'
|
||||||
}
|
}
|
||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
|
|
|
@ -86,7 +86,7 @@ public class AddCommandModule implements CommandModule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
||||||
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) {
|
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST || effect == ParticleEffect.BLOCK_MARKER) {
|
||||||
blockData = inputParser.next(Material.class);
|
blockData = inputParser.next(Material.class);
|
||||||
if (blockData == null || !blockData.isBlock()) {
|
if (blockData == null || !blockData.isBlock()) {
|
||||||
localeManager.sendMessage(pplayer, "data-invalid-block");
|
localeManager.sendMessage(pplayer, "data-invalid-block");
|
||||||
|
@ -163,7 +163,7 @@ public class AddCommandModule implements CommandModule {
|
||||||
}
|
}
|
||||||
StringUtil.copyPartialMatches(args[args.length - 1], possibleValues, matches);
|
StringUtil.copyPartialMatches(args[args.length - 1], possibleValues, matches);
|
||||||
} else if (args.length == 3 && effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
} else if (args.length == 3 && effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
||||||
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) { // Block material
|
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST || effect == ParticleEffect.BLOCK_MARKER) { // Block material
|
||||||
StringUtil.copyPartialMatches(args[2], ParticleUtils.BLOCK_MATERIALS_STRING, matches);
|
StringUtil.copyPartialMatches(args[2], ParticleUtils.BLOCK_MATERIALS_STRING, matches);
|
||||||
} else if (effect == ParticleEffect.ITEM) { // Item material
|
} else if (effect == ParticleEffect.ITEM) { // Item material
|
||||||
StringUtil.copyPartialMatches(args[2], ParticleUtils.ITEM_MATERIALS_STRING, matches);
|
StringUtil.copyPartialMatches(args[2], ParticleUtils.ITEM_MATERIALS_STRING, matches);
|
||||||
|
|
|
@ -171,7 +171,7 @@ public class EditCommandModule implements CommandModule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
||||||
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) {
|
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST || effect == ParticleEffect.BLOCK_MARKER) {
|
||||||
blockData = inputParser.next(Material.class);
|
blockData = inputParser.next(Material.class);
|
||||||
if (blockData == null || !blockData.isBlock()) {
|
if (blockData == null || !blockData.isBlock()) {
|
||||||
localeManager.sendMessage(pplayer, "data-invalid-block");
|
localeManager.sendMessage(pplayer, "data-invalid-block");
|
||||||
|
@ -277,7 +277,7 @@ public class EditCommandModule implements CommandModule {
|
||||||
}
|
}
|
||||||
StringUtil.copyPartialMatches(args[args.length - 1], possibleValues, matches);
|
StringUtil.copyPartialMatches(args[args.length - 1], possibleValues, matches);
|
||||||
} else if (args.length == 3 && effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
} else if (args.length == 3 && effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
||||||
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) { // Block material
|
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST || effect == ParticleEffect.BLOCK_MARKER) { // Block material
|
||||||
StringUtil.copyPartialMatches(args[2], ParticleUtils.BLOCK_MATERIALS_STRING, matches);
|
StringUtil.copyPartialMatches(args[2], ParticleUtils.BLOCK_MATERIALS_STRING, matches);
|
||||||
} else if (effect == ParticleEffect.ITEM) { // Item material
|
} else if (effect == ParticleEffect.ITEM) { // Item material
|
||||||
StringUtil.copyPartialMatches(args[2], ParticleUtils.ITEM_MATERIALS_STRING, matches);
|
StringUtil.copyPartialMatches(args[2], ParticleUtils.ITEM_MATERIALS_STRING, matches);
|
||||||
|
|
|
@ -215,7 +215,7 @@ public class FixedCommandModule implements CommandModule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
||||||
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) {
|
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST || effect == ParticleEffect.BLOCK_MARKER) {
|
||||||
blockData = inputParser.next(Material.class);
|
blockData = inputParser.next(Material.class);
|
||||||
if (blockData == null || !blockData.isBlock()) {
|
if (blockData == null || !blockData.isBlock()) {
|
||||||
localeManager.sendMessage(pplayer, "fixed-create-data-error");
|
localeManager.sendMessage(pplayer, "fixed-create-data-error");
|
||||||
|
@ -354,7 +354,7 @@ public class FixedCommandModule implements CommandModule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
||||||
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) {
|
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST || effect == ParticleEffect.BLOCK_MARKER) {
|
||||||
blockData = inputParser.next(Material.class);
|
blockData = inputParser.next(Material.class);
|
||||||
if (blockData == null || !blockData.isBlock()) {
|
if (blockData == null || !blockData.isBlock()) {
|
||||||
localeManager.sendMessage(pplayer, "fixed-edit-data-error");
|
localeManager.sendMessage(pplayer, "fixed-edit-data-error");
|
||||||
|
@ -680,7 +680,7 @@ public class FixedCommandModule implements CommandModule {
|
||||||
}
|
}
|
||||||
StringUtil.copyPartialMatches(args[args.length - 1], possibleValues, matches);
|
StringUtil.copyPartialMatches(args[args.length - 1], possibleValues, matches);
|
||||||
} else if (args.length == 7 && effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
} else if (args.length == 7 && effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
||||||
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) { // Block material
|
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST || effect == ParticleEffect.BLOCK_MARKER) { // Block material
|
||||||
StringUtil.copyPartialMatches(args[6], ParticleUtils.BLOCK_MATERIALS_STRING, matches);
|
StringUtil.copyPartialMatches(args[6], ParticleUtils.BLOCK_MATERIALS_STRING, matches);
|
||||||
} else if (effect == ParticleEffect.ITEM) { // Item material
|
} else if (effect == ParticleEffect.ITEM) { // Item material
|
||||||
StringUtil.copyPartialMatches(args[6], ParticleUtils.ITEM_MATERIALS_STRING, matches);
|
StringUtil.copyPartialMatches(args[6], ParticleUtils.ITEM_MATERIALS_STRING, matches);
|
||||||
|
@ -790,7 +790,7 @@ public class FixedCommandModule implements CommandModule {
|
||||||
}
|
}
|
||||||
StringUtil.copyPartialMatches(args[args.length - 1], possibleValues, matches);
|
StringUtil.copyPartialMatches(args[args.length - 1], possibleValues, matches);
|
||||||
} else if (args.length == 4 && effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
} else if (args.length == 4 && effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
||||||
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) { // Block material
|
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST || effect == ParticleEffect.BLOCK_MARKER) { // Block material
|
||||||
StringUtil.copyPartialMatches(args[3], ParticleUtils.BLOCK_MATERIALS_STRING, matches);
|
StringUtil.copyPartialMatches(args[3], ParticleUtils.BLOCK_MATERIALS_STRING, matches);
|
||||||
} else if (effect == ParticleEffect.ITEM) { // Item material
|
} else if (effect == ParticleEffect.ITEM) { // Item material
|
||||||
StringUtil.copyPartialMatches(args[3], ParticleUtils.ITEM_MATERIALS_STRING, matches);
|
StringUtil.copyPartialMatches(args[3], ParticleUtils.ITEM_MATERIALS_STRING, matches);
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class UseCommandModule implements CommandModule {
|
||||||
primaryParticle.setColor(colorData);
|
primaryParticle.setColor(colorData);
|
||||||
}
|
}
|
||||||
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
||||||
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) {
|
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST || effect == ParticleEffect.BLOCK_MARKER) {
|
||||||
Material blockData = inputParser.next(Material.class);
|
Material blockData = inputParser.next(Material.class);
|
||||||
if (blockData == null || !blockData.isBlock()) {
|
if (blockData == null || !blockData.isBlock()) {
|
||||||
localeManager.sendMessage(pplayer, "data-invalid-block");
|
localeManager.sendMessage(pplayer, "data-invalid-block");
|
||||||
|
@ -177,7 +177,7 @@ public class UseCommandModule implements CommandModule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (args.length == 2 && effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
} else if (args.length == 2 && effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
||||||
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) { // Block material
|
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST || effect == ParticleEffect.BLOCK_MARKER) { // Block material
|
||||||
possibleValues.addAll(ParticleUtils.BLOCK_MATERIALS_STRING);
|
possibleValues.addAll(ParticleUtils.BLOCK_MATERIALS_STRING);
|
||||||
} else if (effect == ParticleEffect.ITEM) { // Item material
|
} else if (effect == ParticleEffect.ITEM) { // Item material
|
||||||
possibleValues.addAll(ParticleUtils.ITEM_MATERIALS_STRING);
|
possibleValues.addAll(ParticleUtils.ITEM_MATERIALS_STRING);
|
||||||
|
|
|
@ -130,7 +130,7 @@ public class DataManager extends Manager {
|
||||||
} else {
|
} else {
|
||||||
statement.close();
|
statement.close();
|
||||||
|
|
||||||
String updateQuery = "INSERT INTO " + this.getTablePrefix() + "settings (player_uuid, particles_hidden, particles_hidden_self) VALUES (?, ?)";
|
String updateQuery = "INSERT INTO " + this.getTablePrefix() + "settings (player_uuid, particles_hidden, particles_hidden_self) VALUES (?, ?, ?)";
|
||||||
try (PreparedStatement updateStatement = connection.prepareStatement(updateQuery)) {
|
try (PreparedStatement updateStatement = connection.prepareStatement(updateQuery)) {
|
||||||
updateStatement.setString(1, playerUUID.toString());
|
updateStatement.setString(1, playerUUID.toString());
|
||||||
updateStatement.setBoolean(2, false);
|
updateStatement.setBoolean(2, false);
|
||||||
|
|
|
@ -172,7 +172,7 @@ public class ParticleGroupPresetManager extends Manager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
} else if (effect.hasProperty(ParticleProperty.REQUIRES_MATERIAL_DATA)) {
|
||||||
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST) {
|
if (effect == ParticleEffect.BLOCK || effect == ParticleEffect.FALLING_DUST || effect == ParticleEffect.BLOCK_MARKER) {
|
||||||
blockData = inputParser.next(Material.class);
|
blockData = inputParser.next(Material.class);
|
||||||
if (blockData == null || !blockData.isBlock()) {
|
if (blockData == null || !blockData.isBlock()) {
|
||||||
PlayerParticles.getInstance().getLogger().severe("Invalid block: '" + dataString + "'!");
|
PlayerParticles.getInstance().getLogger().severe("Invalid block: '" + dataString + "'!");
|
||||||
|
|
|
@ -35,6 +35,7 @@ public enum ParticleEffect {
|
||||||
ASH("ASH", Collections.singletonList("BLACKSTONE")),
|
ASH("ASH", Collections.singletonList("BLACKSTONE")),
|
||||||
BARRIER("BARRIER", Collections.singletonList("BARRIER")),
|
BARRIER("BARRIER", Collections.singletonList("BARRIER")),
|
||||||
BLOCK("BLOCK_CRACK", Collections.singletonList("STONE"), ParticleProperty.REQUIRES_MATERIAL_DATA),
|
BLOCK("BLOCK_CRACK", Collections.singletonList("STONE"), ParticleProperty.REQUIRES_MATERIAL_DATA),
|
||||||
|
BLOCK_MARKER("BLOCK_MARKER", Collections.singletonList("LIGHT"), ParticleProperty.REQUIRES_MATERIAL_DATA),
|
||||||
BUBBLE("WATER_BUBBLE", Arrays.asList("BUBBLE_CORAL", "GLASS")),
|
BUBBLE("WATER_BUBBLE", Arrays.asList("BUBBLE_CORAL", "GLASS")),
|
||||||
BUBBLE_COLUMN_UP("BUBBLE_COLUMN_UP", Collections.singletonList("MAGMA_BLOCK")),
|
BUBBLE_COLUMN_UP("BUBBLE_COLUMN_UP", Collections.singletonList("MAGMA_BLOCK")),
|
||||||
BUBBLE_POP("BUBBLE_POP", Collections.singletonList("BUBBLE_CORAL_FAN")),
|
BUBBLE_POP("BUBBLE_POP", Collections.singletonList("BUBBLE_CORAL_FAN")),
|
||||||
|
|
Loading…
Reference in a new issue