Skip to content

Commit 1ad6ad8

Browse files
committed
Address deprecation warnings
1 parent 8812e85 commit 1ad6ad8

37 files changed

+100
-100
lines changed

src/main/java/com/sk89q/craftbook/mechanics/Ammeter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,6 @@ else if (data > 0)
117117
public void loadConfiguration (YAMLProcessor config, String path) {
118118

119119
config.setComment(path + "item", "Set the item that is the ammeter tool.");
120-
item = BukkitAdapter.asItemType(ItemSyntax.getItem(config.getString(path + "item", ItemTypes.COAL.getId())).getType());
120+
item = BukkitAdapter.asItemType(ItemSyntax.getItem(config.getString(path + "item", ItemTypes.COAL.id())).getType());
121121
}
122122
}

src/main/java/com/sk89q/craftbook/mechanics/BetterPistons.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,12 @@ public static boolean isEnabled(Types type) {
453453

454454
public static List<String> getDefaultBlacklist() {
455455
return Lists.newArrayList(
456-
BlockTypes.OBSIDIAN.getId(),
457-
BlockTypes.BEDROCK.getId(),
458-
BlockTypes.NETHER_PORTAL.getId(),
459-
BlockTypes.END_PORTAL.getId(),
460-
BlockTypes.END_PORTAL_FRAME.getId(),
461-
BlockTypes.END_GATEWAY.getId()
456+
BlockTypes.OBSIDIAN.id(),
457+
BlockTypes.BEDROCK.id(),
458+
BlockTypes.NETHER_PORTAL.id(),
459+
BlockTypes.END_PORTAL.id(),
460+
BlockTypes.END_PORTAL_FRAME.id(),
461+
BlockTypes.END_GATEWAY.id()
462462
);
463463
}
464464

src/main/java/com/sk89q/craftbook/mechanics/BounceBlocks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class BounceBlocks extends AbstractCraftBookMechanic {
3939
public void loadConfiguration (YAMLProcessor config, String path) {
4040

4141
config.setComment(path + "blocks", "A list of blocks that can be jumped on.");
42-
blocks = BlockSyntax.getBlocks(config.getStringList(path + "blocks", Collections.singletonList(BlockTypes.DIAMOND_BLOCK.getId())), true);
42+
blocks = BlockSyntax.getBlocks(config.getStringList(path + "blocks", Collections.singletonList(BlockTypes.DIAMOND_BLOCK.id())), true);
4343

4444
config.setComment(path + "sensitivity", "The sensitivity of jumping.");
4545
sensitivity = config.getDouble(path + "sensitivity", 0.1);

src/main/java/com/sk89q/craftbook/mechanics/GlowStone.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ public void onBlockBreak(BlockBreakEvent event) {
7373
public void loadConfiguration (YAMLProcessor config, String path) {
7474

7575
config.setComment(path + "glowstone-off-block", "Sets the block that the redstone glowstone mechanic turns into when turned off.");
76-
offBlock = BlockSyntax.getBlock(config.getString(path + "glowstone-off-block", BlockTypes.GLASS.getId()), true);
76+
offBlock = BlockSyntax.getBlock(config.getString(path + "glowstone-off-block", BlockTypes.GLASS.id()), true);
7777
}
7878
}

src/main/java/com/sk89q/craftbook/mechanics/LightStone.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,6 @@ private static String getLightLine(int data) {
8787
public void loadConfiguration (YAMLProcessor config, String path) {
8888

8989
config.setComment(path + "item", "The item that the lightstone mechanic uses.");
90-
item = BukkitAdapter.asItemType(ItemSyntax.getItem(config.getString(path + "item", ItemTypes.GLOWSTONE_DUST.getId())).getType());
90+
item = BukkitAdapter.asItemType(ItemSyntax.getItem(config.getString(path + "item", ItemTypes.GLOWSTONE_DUST.id())).getType());
9191
}
9292
}

src/main/java/com/sk89q/craftbook/mechanics/Snow.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -563,14 +563,14 @@ public int hashCode() {
563563

564564
private static List<String> getDefaultReplacables() {
565565
return Lists.newArrayList(
566-
BlockTypes.DEAD_BUSH.getId(),
567-
BlockTypes.SHORT_GRASS.getId(),
568-
BlockTypes.DANDELION.getId(),
569-
BlockTypes.POPPY.getId(),
570-
BlockTypes.BROWN_MUSHROOM.getId(),
571-
BlockTypes.RED_MUSHROOM.getId(),
572-
BlockTypes.FIRE.getId(),
573-
BlockTypes.FERN.getId());
566+
BlockTypes.DEAD_BUSH.id(),
567+
BlockTypes.SHORT_GRASS.id(),
568+
BlockTypes.DANDELION.id(),
569+
BlockTypes.POPPY.id(),
570+
BlockTypes.BROWN_MUSHROOM.id(),
571+
BlockTypes.RED_MUSHROOM.id(),
572+
BlockTypes.FIRE.id(),
573+
BlockTypes.FERN.id());
574574
}
575575

576576
@Override

src/main/java/com/sk89q/craftbook/mechanics/TreeLopper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ else if (data instanceof Tree)
178178
public void loadConfiguration (YAMLProcessor config, String path) {
179179

180180
config.setComment(path + "block-list", "A list of log blocks. This can be modified to include more logs. (for mod support etc)");
181-
enabledBlocks = BlockSyntax.getBlocks(config.getStringList(path + "block-list", BlockCategories.LOGS.getAll().stream().map(BlockType::getId).sorted(String::compareToIgnoreCase).collect(Collectors.toList())), true);
181+
enabledBlocks = BlockSyntax.getBlocks(config.getStringList(path + "block-list", BlockCategories.LOGS.getAll().stream().map(BlockType::id).sorted(String::compareToIgnoreCase).collect(Collectors.toList())), true);
182182

183183
config.setComment(path + "tool-list", "A list of tools that can trigger the TreeLopper mechanic.");
184-
enabledItems = config.getStringList(path + "tool-list", Arrays.asList(ItemTypes.IRON_AXE.getId(), ItemTypes.WOODEN_AXE.getId(),
185-
ItemTypes.STONE_AXE.getId(), ItemTypes.DIAMOND_AXE.getId(), ItemTypes.GOLDEN_AXE.getId()))
184+
enabledItems = config.getStringList(path + "tool-list", Arrays.asList(ItemTypes.IRON_AXE.id(), ItemTypes.WOODEN_AXE.id(),
185+
ItemTypes.STONE_AXE.id(), ItemTypes.DIAMOND_AXE.id(), ItemTypes.GOLDEN_AXE.id()))
186186
.stream().map(ItemSyntax::getItem).map(ItemStack::getType).map(BukkitAdapter::asItemType).collect(Collectors.toList());
187187

188188
config.setComment(path + "max-size", "The maximum amount of blocks the TreeLopper can break.");

src/main/java/com/sk89q/craftbook/mechanics/XPStorer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ public void loadConfiguration(YAMLProcessor config, String path) {
297297
xpPerBottle = config.getInt(path + "xp-per-bottle", 16);
298298

299299
config.setComment(path + "block", "The block that is an XP Storer.");
300-
block = BlockSyntax.getBlock(config.getString(path + "block", BlockTypes.SPAWNER.getId()), true);
300+
block = BlockSyntax.getBlock(config.getString(path + "block", BlockTypes.SPAWNER.id()), true);
301301

302302
config.setComment(path + "require-sneaking-state", "Sets how the player must be sneaking in order to use the XP Storer.");
303303
sneakingState = TernaryState.getFromString(config.getString(path + "require-sneaking-state", "no"));

src/main/java/com/sk89q/craftbook/mechanics/area/AreaCommands.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public void saveArea(CommandContext context, CommandSender sender) throws Comman
9090
BlockVector3 size = max.subtract(min).add(1, 1, 1);
9191

9292
// Check maximum size
93-
if (Area.instance.maxAreaSize != -1 && size.getBlockX() * size.getBlockY() * size.getBlockZ()
93+
if (Area.instance.maxAreaSize != -1 && size.x() * size.y() * size.z()
9494
> Area.instance.maxAreaSize) {
9595
throw new CommandException("Area is larger than allowed " + Area.instance.maxAreaSize + " blocks.");
9696
}

src/main/java/com/sk89q/craftbook/mechanics/area/simple/Bridge.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,10 @@ public boolean isApplicableSign(String line) {
317317

318318
public List<String> getDefaultBlocks() {
319319
List<String> materials = new ArrayList<>();
320-
materials.add(BlockTypes.COBBLESTONE.getId());
321-
materials.add(BlockTypes.GLASS.getId());
322-
materials.addAll(BlockCategories.PLANKS.getAll().stream().map(BlockType::getId).collect(Collectors.toList()));
323-
materials.addAll(BlockCategories.SLABS.getAll().stream().map(BlockType::getId).collect(Collectors.toList()));
320+
materials.add(BlockTypes.COBBLESTONE.id());
321+
materials.add(BlockTypes.GLASS.id());
322+
materials.addAll(BlockCategories.PLANKS.getAll().stream().map(BlockType::id).toList());
323+
materials.addAll(BlockCategories.SLABS.getAll().stream().map(BlockType::id).toList());
324324
return materials;
325325
}
326326

0 commit comments

Comments
 (0)