Require 1.13

This commit is contained in:
Phoenix616 2020-04-17 23:31:45 +01:00
parent 25efe36b6c
commit 0c35fe9bb9
4 changed files with 64 additions and 27 deletions

View File

@ -52,7 +52,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -362,7 +362,7 @@ public class RandomTeleport extends JavaPlugin implements RandomTeleportAPI {
if (e instanceof Player) {
Location belowLoc = targetLoc.clone().subtract(0, 1, 0);
Block belowBlock = belowLoc.getBlock();
((Player) e).sendBlockChange(belowLoc, belowBlock.getType(), belowBlock.getData());
((Player) e).sendBlockChange(belowLoc, belowBlock.getBlockData());
}
targetLoc.setX(targetLoc.getBlockX() + 0.5);
targetLoc.setY(targetLoc.getY() + 0.1);

View File

@ -47,6 +47,7 @@ public class SignListener implements Listener {
plugin.sendMessage(event.getPlayer(), "sign.no-permission.create", "perm", "randomteleport.sign.create");
} else {
String preset = event.getLine(2);
if (preset != null) {
plugin.sendMessage(event.getPlayer(), "sign.created", "preset", preset);
if (plugin.getConfig().getString("presets." + preset.toLowerCase()) == null) {
plugin.sendMessage(event.getPlayer(), "error.preset-doesnt-exist", "preset", preset);
@ -54,6 +55,7 @@ public class SignListener implements Listener {
}
}
}
}
@EventHandler(ignoreCancelled = true)
public void onSignDestroy(BlockBreakEvent event) {
@ -72,7 +74,8 @@ public class SignListener implements Listener {
@EventHandler(ignoreCancelled = true)
public void onSignClick(PlayerInteractEvent event) {
if (event.getHand() == EquipmentSlot.HAND && event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getType().name().contains("SIGN")) {
if (event.getHand() == EquipmentSlot.HAND && event.getAction() == Action.RIGHT_CLICK_BLOCK
&& event.getClickedBlock() != null && event.getClickedBlock().getType().name().contains("SIGN")) {
Sign sign = (Sign) event.getClickedBlock().getState();
if (plugin.matchesSignVariable(sign.getLine(1))) {
String preset = sign.getLine(2).toLowerCase();

View File

@ -6,54 +6,88 @@ debug: true
# Blocks to teleport on in normal mode
save-blocks:
- sand
- sandstone
- gravel
- dirt
- grass_block
- coarse_dirt
- podzol
- stone
- granite
- diorite
- andesite
- cobblestone
- ender_stone
- end_stone
- netherrack
# Blocks unsave when in "--force blocks" mode
unsave-blocks:
- air
- water
- stationary_water
- lava
- stationary_lava
- sapling
- bed_block
- oak_sapling
- spruce_sapling
- birch_sapling
- jungle_sapling
- acacia_sapling
- dark_oak_sapling
- white_bed
- orange_bed
- magenta_bed
- light_blue_bed
- yellow_bed
- lime_bed
- pink_bed
- gray_bed
- light_gray_bed
- cyan_bed
- purple_bed
- blue_bed
- brown_bed
- green_bed
- red_bed
- black_bed
- powered_rail
- detector_rail
- web
- piston_extension
- cobweb
- piston_head
- tnt
- torch
- fire
- sign_post
- wooden_door
- sign
- ladder
- rails
- rail
- wall_sign
- lever
- stone_plate
- iron_door_block
- redstone_torch_off
- redstone_torch_on
- stone_pressure_plate
- iron_door
- redstone_wall_torch
- redstone_torch
- stone_button
- cactus
- magma
- portal
- magma_block
- nether_portal
- vine
- ender_portal
- end_portal
- end_portal_frame
- tripwire_hook
- tripwire
- wood_button
- flower_pot
- leaves
- leaves_2
- oak_leaves
- spruce_leaves
- birch_leaves
- jungle_leaves
- acacia_leaves
- dark_oak_leaves
- barrier
- iron_trapdoor
- wall_banner
- oak_trapdoor
- spruce_trapdoor
- birch_trapdoor
- jungle_trapdoor
- acacia_trapdoor
- dark_oak_trapdoor
- oak_door
- spruce_door
- birch_door
- jungle_door