Skip to content

Commit

Permalink
v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MetallicGoat committed Sep 25, 2022
1 parent b87bb9f commit 9fc1bc3
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 1,824 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions Extra-Special-Items.iml

This file was deleted.

6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.metallicgoat</groupId>
<artifactId>Extra-Special-Items</artifactId>
<version>2.0.1</version>
<version>2.1.0</version>

<repositories>
<repository>
Expand All @@ -23,14 +23,14 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>de.marcely.bedwars</groupId>
<artifactId>API</artifactId>
<version>5.0.8</version>
<version>5.0.14.2</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

public class ExtraSpecialItems extends JavaPlugin {

public static final int MIN_MBEDWARS_API_VER = 8;
public static final String MIN_MBEDWARS_VER_NAME = "5.0.7";
public static final int MIN_MBEDWARS_API_VER = 14;
public static final String MIN_MBEDWARS_VER_NAME = "5.0.14.2";

private static ExtraSpecialItemsAddon addon;
private static ExtraSpecialItems instance;
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/me/metallicgoat/specialItems/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import me.metallicgoat.specialItems.utils.Console;
import me.metallicgoat.specialItems.ExtraSpecialItems;
import me.metallicgoat.specialItems.config.updater.ConfigUpdater;
import me.metallicgoat.specialItems.utils.XSound;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.configuration.file.FileConfiguration;
Expand Down Expand Up @@ -104,6 +103,10 @@ public static void load(){
ConfigValue.command_item_enabled = mainConfig.getBoolean("Custom-Command-Items.Enabled", ConfigValue.command_item_enabled);
ConfigValue.command_item_player_commands = formatIdCommands(mainConfig.getStringList("Custom-Command-Items.Player"));
ConfigValue.command_item_console_commands = formatIdCommands(mainConfig.getStringList("Custom-Command-Items.Console"));


if(ConfigValue.silverfish_life_display_name == null)
Console.printConfigWarning("Silverfish.Display-Name", "Configuration section is null!");
}

private static Material parseConfigMaterial(FileConfiguration config, String configPath, Material def){
Expand All @@ -125,10 +128,10 @@ private static Sound parseConfigSound(FileConfiguration config, String configPat
final String configSound = config.getString(configPath);

if(configSound != null){
Optional<XSound> soundType = XSound.matchXSound(configSound.toUpperCase());
final Sound sound = Helper.get().getSoundByName(configSound);

if(soundType.isPresent())
return soundType.get().parseSound();
if(sound != null)
return sound;
else
Console.printConfigWarning(configPath, "Cannot parse sound " + configSound);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import de.marcely.bedwars.tools.Helper;
import de.marcely.bedwars.tools.Pair;
import me.metallicgoat.specialItems.utils.XSound;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.configuration.ConfigurationSection;
Expand All @@ -19,7 +18,7 @@ public class ConfigValue {
public static Material tower_block_material = Helper.get().getMaterialByName("WOOL");
public static int tower_block_place_interval = 1;
public static int tower_block_placed_per_interval = 2;
public static Sound tower_place_place_sound = XSound.ENTITY_CHICKEN_EGG.parseSound();
public static Sound tower_place_place_sound = Helper.get().getSoundByName("ENTITY_CHICKEN_EGG");

public static String silverfish_icon_name = "Silverfish";
public static Material silverfish_icon_material = Helper.get().getMaterialByName("SNOWBALL");
Expand All @@ -31,7 +30,7 @@ public class ConfigValue {
public static Material egg_bridger_block_material = Helper.get().getMaterialByName("WOOL");
public static int egg_bridger_max_length = 30;
public static int egg_bridger_max_y_variation = 18;
public static Sound egg_bridger_place_sound = XSound.ENTITY_CHICKEN_EGG.parseSound();
public static Sound egg_bridger_place_sound = Helper.get().getSoundByName("ENTITY_CHICKEN_EGG");

public static String ice_bridger_icon_name = "IceBridger";
public static Material ice_bridger_icon_material = Helper.get().getMaterialByName("ICE");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import de.marcely.bedwars.api.game.specialitem.SpecialItemUseSession;
import me.metallicgoat.specialItems.ExtraSpecialItems;
import me.metallicgoat.specialItems.config.ConfigValue;
import me.metallicgoat.specialItems.utils.XSound;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.entity.Egg;
Expand Down Expand Up @@ -67,7 +66,7 @@ public void run() {
for(Block block:blocks)
new EggBridgeBlockPlacer(block, color, arena);

XSound.matchXSound(ConfigValue.egg_bridger_place_sound).play(eggLocation);
eggLocation.getWorld().playSound(eggLocation, ConfigValue.egg_bridger_place_sound, 1, 1);
}
}, 2L);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import de.marcely.bedwars.tools.Helper;
import me.metallicgoat.specialItems.ExtraSpecialItems;
import me.metallicgoat.specialItems.config.ConfigValue;
import me.metallicgoat.specialItems.utils.XSound;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -45,10 +45,12 @@ public void createIceBridge(PlayerUseSpecialItemEvent e, SpecialItemUseSession s
final Location blockLoc = lookingStraight.add(lookingStraight.getDirection().multiply(i.get())).add(0, -1, 0);
final Block block = blockLoc.getBlock();
final World world = block.getWorld();
final Sound sound = Helper.get().getSoundByName("BLOCK_SNOW_BREAK"); // TODO move to config

setIce(arena, block);

XSound.BLOCK_SNOW_BREAK.play(player);
if(sound != null)
world.playSound(blockLoc, sound, 1, 1);

if ((yaw < 45 || yaw >= 135) && (yaw < -135 || yaw >= -45)) {
setIce(arena, world.getBlockAt(blockLoc.add(1, 0, 0)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

public class BuildTower {

private static BlockFace direction;
private static Block chest;
private static final Queue<Pair<Block, Boolean>> towerBlock = new ArrayDeque<>();
private final BlockFace direction;
private final Block chest;
private final Queue<Pair<Block, Boolean>> towerBlock = new ArrayDeque<>();

public BuildTower(Block chest, SpecialItemUseSession session, BlockFace direction) {
BuildTower.direction = direction;
BuildTower.chest = chest;
this.direction = direction;
this.chest = chest;

addToQueue(-1, 0, -2, false);
addToQueue(-2, 0, -1, false);
Expand Down Expand Up @@ -142,7 +142,7 @@ public BuildTower(Block chest, SpecialItemUseSession session, BlockFace directio
new TowerBlockPlacer(towerBlock, session, direction);
}

private static void addToQueue(int x, int height, int y, boolean ladder){
private void addToQueue(int x, int height, int y, boolean ladder){
Block block = null;
switch(direction) {
case NORTH:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import de.marcely.bedwars.tools.PersistentBlockData;
import me.metallicgoat.specialItems.ExtraSpecialItems;
import me.metallicgoat.specialItems.config.ConfigValue;
import me.metallicgoat.specialItems.utils.XSound;
import org.bukkit.Bukkit;
import org.bukkit.DyeColor;
import org.bukkit.Material;
Expand All @@ -22,11 +21,10 @@

public class TowerBlockPlacer {

private static BukkitTask task;
private static final Material ladderMaterial = Helper.get().getMaterialByName("LADDER");
public BukkitTask task;
public final Material ladderMaterial = Helper.get().getMaterialByName("LADDER");

public TowerBlockPlacer(Queue<Pair<Block, Boolean>> towerBlock, SpecialItemUseSession session, BlockFace face) {

if((session != null && session.getEvent() == null) || session == null || !session.isActive()){
return;
}
Expand All @@ -49,7 +47,7 @@ public TowerBlockPlacer(Queue<Pair<Block, Boolean>> towerBlock, SpecialItemUseSe
if (block != null && block.getType().equals(Material.AIR)) {
//Is block inside region
if (arena.canPlaceBlockAt(block.getLocation())) {
XSound.matchXSound(ConfigValue.tower_place_place_sound).play(block.getLocation());
block.getLocation().getWorld().playSound(block.getLocation(), ConfigValue.tower_place_place_sound, 1, 1);
PlaceBlock(arena, Boolean.TRUE.equals(blockBooleanPair.getValue()), block, face, color);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@
public class UpdateDisplayName {

public void setDisplayName(Team team, Silverfish silverfish){
silverfish.setCustomNameVisible(true);

if(ConfigValue.silverfish_life_display_name == null)
return;

final String teamName = team.getDisplayName();
final String color = "&" + team.getChatColor().getChar();
final String color = team.getChatColor().toString();
final int amountOfTags = ConfigValue.silverfish_life_display_name.getKeys(false).size();
final String[] displayNames = ConfigValue.silverfish_life_display_name.getKeys(false).toArray(new String[0]);
final long time = ConfigValue.silverfish_life_duration / amountOfTags;
final AtomicInteger i = new AtomicInteger(0);

silverfish.setCustomNameVisible(true);

new BukkitRunnable() {
@Override
public void run(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -860,5 +860,4 @@ public String toString() {
}
}
}
}

}
Loading

0 comments on commit 9fc1bc3

Please sign in to comment.