Update to PlotSquared-we branch

This commit is contained in:
Jesse Boyd
2019-11-06 09:29:20 +00:00
parent 0bfb1dbdd1
commit 240b2de90c
27 changed files with 284 additions and 198 deletions

View File

@ -19,9 +19,6 @@
package com.sk89q.worldedit.world.registry;
import com.github.intellectualsites.plotsquared.plot.object.LegacyPlotBlock;
import com.github.intellectualsites.plotsquared.plot.object.PlotBlock;
import com.github.intellectualsites.plotsquared.plot.object.StringPlotBlock;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.google.common.io.Resources;
@ -244,29 +241,6 @@ public final class LegacyMapper {
return combinedId == null ? null : new int[] { combinedId >> 4, combinedId & 0xF };
}
public BaseBlock getBaseBlockFromPlotBlock(PlotBlock plotBlock) {
if(plotBlock instanceof StringPlotBlock) {
try {
return BlockTypes.get(plotBlock.toString()).getDefaultState().toBaseBlock();
} catch (Throwable failed) {
log.error("Unable to convert StringPlotBlock " + plotBlock + " to BaseBlock!");
failed.printStackTrace();
return null;
}
}else if(plotBlock instanceof LegacyPlotBlock) {
try {
return BaseBlock.getState(((LegacyPlotBlock)plotBlock).getId(), ((LegacyPlotBlock)plotBlock).getData()).toBaseBlock();
} catch (Throwable failed) {
log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!");
failed.printStackTrace();
return null;
}
}else {
log.error("Unable to convert LegacyPlotBlock " + plotBlock + " to BaseBlock!");
return null;
}
}
public final static LegacyMapper getInstance() {
return INSTANCE;
}