Skip to content

Commit

Permalink
Configure Icon Names
Browse files Browse the repository at this point in the history
  • Loading branch information
MetallicGoat committed Mar 6, 2022
1 parent c4961dd commit c8493de
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<version>1.18.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

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

<dependency>
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/me/metallicgoat/specialItems/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,33 @@ public static void load(){

final FileConfiguration mainConfig = getConfig();

// SPECIAL
ConfigValue.dye_tower_ukraine = mainConfig.getBoolean("Dye-Tower-Ukraine");

// POP UP TOWER
ConfigValue.tower_icon_name = mainConfig.getString("PopUpTower.Icon-Name");
ConfigValue.tower_icon_material = parseConfigMaterial(mainConfig, "PopUpTower.Icon-Type", ConfigValue.tower_icon_material);
ConfigValue.tower_block_material = parseConfigMaterial(mainConfig, "PopUpTower.Block-Type", ConfigValue.tower_block_material);
ConfigValue.tower_block_place_interval = mainConfig.getInt("PopUpTower.Block-Place-Interval", ConfigValue.tower_block_place_interval);
ConfigValue.tower_block_placed_per_interval = mainConfig.getInt("PopUpTower.Blocks-Placed-Per-Interval", ConfigValue.tower_block_placed_per_interval);
ConfigValue.tower_place_place_sound = parseConfigSound(mainConfig, "PopUpTower.Sound", ConfigValue.tower_place_place_sound);

// SILVERFISH
ConfigValue.silverfish_icon_name = mainConfig.getString("Silverfish.Icon-Name");
ConfigValue.silverfish_icon_material = parseConfigMaterial(mainConfig, "Silverfish.Icon-Type", ConfigValue.silverfish_icon_material);
ConfigValue.silverfish_life_duration = mainConfig.getInt("Silverfish.Life-Duration", ConfigValue.silverfish_life_duration);
ConfigValue.silverfish_life_display_name = mainConfig.getConfigurationSection("Silverfish.Display-Name");

// EGG BRIDGER
ConfigValue.egg_bridger_icon_name = mainConfig.getString("Egg-Bridger.Icon-Name");
ConfigValue.egg_bridger_icon_material = parseConfigMaterial(mainConfig, "Egg-Bridger.Icon-Type", ConfigValue.egg_bridger_icon_material);
ConfigValue.egg_bridger_block_material = parseConfigMaterial(mainConfig, "Egg-Bridger.Block-Type", ConfigValue.egg_bridger_block_material);
ConfigValue.egg_bridger_max_length = mainConfig.getInt("Egg-Bridger.Max-Length", ConfigValue.egg_bridger_max_length);
ConfigValue.egg_bridger_max_y_variation = mainConfig.getInt("Egg-Bridger.Max-Y-Variation", ConfigValue.egg_bridger_max_y_variation);
ConfigValue.egg_bridger_place_sound = parseConfigSound(mainConfig, "Egg-Bridger.Sound", ConfigValue.egg_bridger_place_sound);

// ICE BRIDGER
ConfigValue.ice_bridger_icon_name = mainConfig.getString("Ice-Bridger.Icon-Name");
ConfigValue.ice_bridger_icon_material = parseConfigMaterial(mainConfig, "Ice-Bridger.Icon-Type", ConfigValue.ice_bridger_material);
ConfigValue.ice_bridger_material = parseConfigMaterial(mainConfig, "Ice-Bridger.Block-Type", ConfigValue.ice_bridger_material);
ConfigValue.ice_bridger_max_distance = mainConfig.getInt("Ice-Bridger.Max-Distance", ConfigValue.ice_bridger_max_distance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,29 @@

public class ConfigValue {

//Special
public static boolean dye_tower_ukraine = false;

public static String tower_icon_name = "PopUpTower";
public static Material tower_icon_material = Helper.get().getMaterialByName("CHEST");
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 String silverfish_icon_name = "Silverfish";
public static Material silverfish_icon_material = Helper.get().getMaterialByName("SNOWBALL");
public static int silverfish_life_duration = 400;
public static ConfigurationSection silverfish_life_display_name = null;

public static String egg_bridger_icon_name = "EggBridger";
public static Material egg_bridger_icon_material = Helper.get().getMaterialByName("EGG");
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 String ice_bridger_icon_name = "IceBridger";
public static Material ice_bridger_icon_material = Helper.get().getMaterialByName("ICE");
public static Material ice_bridger_material = Helper.get().getMaterialByName("ICE");
public static int ice_bridger_max_distance = 37;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,25 @@ public static void registerAll(){
register(new CustomSpecialItem(
EggBridgerHandler.getEggBridgeHandler(),
"egg-bridger",
"%EggBridgerItem%",
ConfigValue.egg_bridger_icon_name,
new ItemStack(ConfigValue.egg_bridger_icon_material)));

register(new CustomSpecialItem(
IceBridgerHandler.getIceBridgeHandler(),
"ice-bridger",
"%IceBridgerItem%",
ConfigValue.ice_bridger_icon_name,
new ItemStack(ConfigValue.ice_bridger_icon_material)));

register(new CustomSpecialItem(
TowerHandler.getPopUpTowerHandler(),
"tower",
"%TowerItem%",
ConfigValue.tower_icon_name,
new ItemStack(ConfigValue.tower_icon_material)));

register(new CustomSpecialItem(
SilverfishHandler.getSilverfishHandler(),
"silverfish",
"%SilverFishItem%",
ConfigValue.silverfish_icon_name,
new ItemStack(ConfigValue.silverfish_icon_material)));

if(ConfigValue.command_item_enabled){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ public TowerBlockPlacer(Queue<Pair<Block, Boolean>> towerBlock, SpecialItemUseSe

private void PlaceBlock(Arena arena, boolean isLadder, Block b, BlockFace face, DyeColor color){

if(ConfigValue.dye_tower_ukraine){
if(((int) b.getLocation().getY()) % 2 != 0)
color = DyeColor.BLUE;
else
color = DyeColor.YELLOW;
}

if (!isLadder) {
final PersistentBlockData data = PersistentBlockData.fromMaterial(ConfigValue.tower_block_material).getDyedData(color);
data.place(b, true);
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
# Ice-Bridger - ice-bridger
# Custom-Command-Items - You Choose!

#Speacial Configs (May be removed in the future)
Dye-Tower-Ukraine: false

#Automaticlly builds you a tower
#Note: Block-Place-Interval in ticks (20 ticks = 1 second)
PopUpTower:
Icon-Name: PopUpTower
Icon-Type: CHEST
Block-Type: WOOL
Block-Place-Interval: 1
Expand All @@ -21,6 +24,7 @@ PopUpTower:
#Note: Life-Duration in ticks (20 ticks = 1 second)
#Display-Name Placeholders: {team-name} {team-color}
Silverfish:
Icon-Name: BedBug
Icon-Type: SNOWBALL
Life-Duration: 400
Display-Name:
Expand All @@ -32,6 +36,7 @@ Silverfish:

#Construct a bridger following the path of an egg
Egg-Bridger:
Icon-Name: EggBridger
Icon-Type: EGG
Block-Type: WOOL
Max-Length: 30
Expand All @@ -40,6 +45,7 @@ Egg-Bridger:

#Builds a flat bridge that only lasts for a few seconds
Ice-Bridger:
Icon-Name: IceBridger
Icon-Type: ICE
Block-Type: ICE
Max-Distance: 37
Expand Down

0 comments on commit c8493de

Please sign in to comment.