mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
Minor:
Fix BukkitLegacyMappings method map usage Move obtaining legacy block to default clause Task should be async
This commit is contained in:
parent
8ba661aa35
commit
f62777bc1a
@ -1723,8 +1723,6 @@ import java.util.regex.Pattern;
|
||||
Block block = event.getClickedBlock();
|
||||
location = BukkitUtil.getLocation(block.getLocation());
|
||||
Material blockType = block.getType();
|
||||
int blockId = ((LegacyPlotBlock) PlotSquared.get().IMP.getLegacyMappings()
|
||||
.fromStringToLegacy(blockType.name())).id;
|
||||
switch (blockType) {
|
||||
case ANVIL:
|
||||
case ACACIA_DOOR:
|
||||
@ -1849,6 +1847,8 @@ import java.util.regex.Pattern;
|
||||
eventType = PlayerBlockEventType.TELEPORT_OBJECT;
|
||||
break;
|
||||
default:
|
||||
int blockId = ((LegacyPlotBlock) PlotSquared.get().IMP.getLegacyMappings()
|
||||
.fromStringToLegacy(blockType.name())).id;
|
||||
if (blockId > 197) {
|
||||
eventType = PlayerBlockEventType.INTERACT_BLOCK;
|
||||
}
|
||||
|
@ -776,11 +776,11 @@ public final class BukkitLegacyMappings extends LegacyMappings {
|
||||
}
|
||||
|
||||
public PlotBlock fromLegacyToString(final String id) {
|
||||
return NEW_STRING_TO_LEGACY_PLOT_BLOCK.get(id);
|
||||
return OLD_STRING_TO_STRING_PLOT_BLOCK.get(id);
|
||||
}
|
||||
|
||||
public PlotBlock fromStringToLegacy(final String id) {
|
||||
return OLD_STRING_TO_STRING_PLOT_BLOCK.get(id.toLowerCase(Locale.ENGLISH));
|
||||
return NEW_STRING_TO_LEGACY_PLOT_BLOCK.get(id.toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
@Getter @EqualsAndHashCode @ToString @RequiredArgsConstructor
|
||||
|
@ -32,7 +32,7 @@ public abstract class TaskManager {
|
||||
if (IMP == null) {
|
||||
throw new IllegalArgumentException("disabled");
|
||||
}
|
||||
return IMP.taskRepeat(runnable, interval);
|
||||
return IMP.taskRepeatAsync(runnable, interval);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user