mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Convert tabs to whitespace.
This commit is contained in:
@ -20,22 +20,21 @@
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.StringTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.blocks.TileEntityBlock;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.function.mask.ABlockMask;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.registry.state.PropertyKey;
|
||||
import com.sk89q.worldedit.world.registry.BlockMaterial;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Represents a "snapshot" of a block with NBT Data.
|
||||
@ -71,7 +70,7 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
* @param blockState The blockstate
|
||||
*/
|
||||
public BaseBlock(BlockState blockState) {
|
||||
this.blockState = blockState;
|
||||
this.blockState = blockState;
|
||||
nbtData = null;
|
||||
}
|
||||
|
||||
@ -244,31 +243,31 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
|
||||
@Override
|
||||
public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException {
|
||||
set.setFullBlock(extent, this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBlock withPropertyId(int propertyId) {
|
||||
return getBlockType().withPropertyId(propertyId).toBaseBlock(getNbtData());
|
||||
}
|
||||
@Override
|
||||
public BaseBlock withPropertyId(int propertyId) {
|
||||
return getBlockType().withPropertyId(propertyId).toBaseBlock(getNbtData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalBlockTypeId() {
|
||||
return toImmutableState().getInternalBlockTypeId();
|
||||
}
|
||||
@Override
|
||||
public int getInternalBlockTypeId() {
|
||||
return toImmutableState().getInternalBlockTypeId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalPropertiesId() {
|
||||
return toImmutableState().getInternalPropertiesId();
|
||||
}
|
||||
@Override
|
||||
public int getInternalPropertiesId() {
|
||||
return toImmutableState().getInternalPropertiesId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <V> BaseBlock with(PropertyKey property, V value) {
|
||||
return toImmutableState().with(property, value).toBaseBlock(getNbtData());
|
||||
}
|
||||
@Override
|
||||
public <V> BaseBlock with(PropertyKey property, V value) {
|
||||
return toImmutableState().with(property, value).toBaseBlock(getNbtData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBlock toBaseBlock(CompoundTag compoundTag) {
|
||||
|
@ -338,13 +338,13 @@ public class BlockState implements BlockStateHolder<BlockState>, FawePattern {
|
||||
return new BaseBlock(this, compoundTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInternalId() {
|
||||
return internalId;
|
||||
}
|
||||
@Override
|
||||
public int getInternalId() {
|
||||
return internalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockMaterial getMaterial() {
|
||||
@Override
|
||||
public BlockMaterial getMaterial() {
|
||||
if (this.material == null) {
|
||||
if (blockType == BlockTypes.__RESERVED__) {
|
||||
return this.material = blockType.getMaterial();
|
||||
@ -352,7 +352,7 @@ public class BlockState implements BlockStateHolder<BlockState>, FawePattern {
|
||||
this.material = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(this);
|
||||
}
|
||||
return material;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getOrdinal() {
|
||||
|
@ -19,7 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extension.platform.Capability;
|
||||
@ -35,19 +36,16 @@ import com.sk89q.worldedit.world.item.ItemType;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
import com.sk89q.worldedit.world.registry.BlockMaterial;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class BlockType implements FawePattern, Keyed {
|
||||
private final String id;
|
||||
private final String id;
|
||||
private final BlockTypes.Settings settings;
|
||||
|
||||
private boolean initItemType;
|
||||
@ -61,7 +59,7 @@ public class BlockType implements FawePattern, Keyed {
|
||||
|
||||
@Deprecated
|
||||
public int getMaxStateId() {
|
||||
return settings.permutations;
|
||||
return settings.permutations;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -248,7 +246,7 @@ public class BlockType implements FawePattern, Keyed {
|
||||
* @return The material
|
||||
*/
|
||||
public BlockMaterial getMaterial() {
|
||||
return this.settings.blockMaterial;
|
||||
return this.settings.blockMaterial;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -272,7 +270,7 @@ public class BlockType implements FawePattern, Keyed {
|
||||
* @return internal id
|
||||
*/
|
||||
public int getInternalId() {
|
||||
return this.settings.internalId;
|
||||
return this.settings.internalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -107,14 +107,14 @@ public class ItemType implements RegistryItem, Keyed {
|
||||
}
|
||||
|
||||
public void setBlockType(BlockType blockType) {
|
||||
this.blockType = blockType;
|
||||
this.blockType = blockType;
|
||||
}
|
||||
|
||||
public BaseItem getDefaultState() {
|
||||
if (defaultState == null) {
|
||||
this.defaultState = new BaseItemStack(this);
|
||||
}
|
||||
return this.defaultState;
|
||||
return this.defaultState;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -245,26 +245,26 @@ public final class LegacyMapper {
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
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 static LegacyMapper getInstance() {
|
||||
|
Reference in New Issue
Block a user