Convert tabs to whitespace.

This commit is contained in:
MattBDev
2019-07-22 16:42:40 -04:00
parent 4d8cf04be1
commit 46f5b12b36
75 changed files with 513 additions and 546 deletions

View File

@ -277,7 +277,7 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit
sections[y4] = section = new ChunkSection(y4 << 4, nmsWorld.worldProvider.g());
}
if (existing.e() != blockData.e() || existing.getMaterial().f() != blockData.getMaterial().f()) {
nmsChunk.setType(pos = new BlockPosition(x, y, z), blockData, false);
nmsChunk.setType(pos = new BlockPosition(x, y, z), blockData, false);
} else {
section.setType(x & 15, y & 15, z & 15, blockData);
}
@ -555,25 +555,25 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit
return material.getCraftBlockData();
}
@Override
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundTag nbtData) {
// TODO Auto-generated method stub
@Override
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundTag nbtData) {
// TODO Auto-generated method stub
}
}
@Override
public void notifyAndLightBlock(Location position, BlockState previousType) {
this.setBlock(position.getChunk(), position.getBlockX(), position.getBlockY(), position.getBlockZ(), previousType, true);
}
@Override
public void notifyAndLightBlock(Location position, BlockState previousType) {
this.setBlock(position.getChunk(), position.getBlockX(), position.getBlockY(), position.getBlockZ(), previousType, true);
}
@Override
public boolean setBlock(Location location, BlockStateHolder<?> state, boolean notifyAndLight) {
return this.setBlock(location.getChunk(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), state, notifyAndLight);
}
@Override
public boolean setBlock(Location location, BlockStateHolder<?> state, boolean notifyAndLight) {
return this.setBlock(location.getChunk(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), state, notifyAndLight);
}
@Override
public void sendFakeOP(Player player) {
// TODO Auto-generated method stub
@Override
public void sendFakeOP(Player player) {
// TODO Auto-generated method stub
}
}
}

View File

@ -1,5 +1,7 @@
package com.boydti.fawe.bukkit.filter;
import static com.google.common.base.Preconditions.checkNotNull;
import com.boydti.fawe.Fawe;
import com.boydti.fawe.FaweAPI;
import com.boydti.fawe.object.RunnableVal;
@ -13,9 +15,6 @@ import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import org.bukkit.World;
import static com.google.common.base.Preconditions.checkNotNull;
public class WorldGuardFilter extends CuboidRegionFilter {
private final World world;
private boolean large;
@ -32,8 +31,8 @@ public class WorldGuardFilter extends CuboidRegionFilter {
public void run(Object value) {
WorldGuardFilter.this.manager = WorldGuard.getInstance().getPlatform().getRegionContainer().get(FaweAPI.getWorld(world.getName()));
for (ProtectedRegion region : manager.getRegions().values()) {
BlockVector3 min = region.getMinimumPoint();
BlockVector3 max = region.getMaximumPoint();
BlockVector3 min = region.getMinimumPoint();
BlockVector3 max = region.getMaximumPoint();
if (max.getBlockX() - min.getBlockX() > 1024 || max.getBlockZ() - min.getBlockZ() > 1024) {
Fawe.debug("Large or complex region shapes cannot be optimized. Filtering will be slower");
large = true;

View File

@ -125,7 +125,7 @@ public class CFIPacketListener implements Listener {
VirtualWorld gen = getGenerator(event);
if (gen != null) {
BlockVector3 origin = gen.getOrigin().toBlockPoint();
BlockVector3 origin = gen.getOrigin().toBlockPoint();
PacketContainer packet = event.getPacket();
StructureModifier<Integer> ints = packet.getIntegers();
int cx = ints.read(0);
@ -160,8 +160,8 @@ public class CFIPacketListener implements Listener {
Location pos = player.getLocation();
VirtualWorld gen = getGenerator(event);
if (gen != null) {
BlockVector3 origin = gen.getOrigin().toBlockPoint();
BlockVector3 pt = BlockVector3.at(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
BlockVector3 origin = gen.getOrigin().toBlockPoint();
BlockVector3 pt = BlockVector3.at(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
StructureModifier<Integer> ints = event.getPacket().getIntegers();
int id = ints.read(0);
@ -185,8 +185,8 @@ public class CFIPacketListener implements Listener {
Location pos = player.getLocation();
VirtualWorld gen = getGenerator(event);
if (gen != null) {
BlockVector3 origin = gen.getOrigin().toBlockPoint();
BlockVector3 from = BlockVector3.at(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
BlockVector3 origin = gen.getOrigin().toBlockPoint();
BlockVector3 from = BlockVector3.at(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
PacketContainer packet = event.getPacket();
StructureModifier<Double> doubles = packet.getDoubles();
@ -248,7 +248,7 @@ public class CFIPacketListener implements Listener {
BlockInteractEvent toCall = new BlockInteractEvent(actor, location, action);
platform.handleBlockInteract(toCall);
if (toCall.isCancelled() || action == Interaction.OPEN) {
BlockVector3 realPos = pt.add(gen.getOrigin().toBlockPoint());
BlockVector3 realPos = pt.add(gen.getOrigin().toBlockPoint());
BlockStateHolder block = gen.getBlock(pt);
sendBlockChange(plr, realPos, block);
return true;
@ -287,7 +287,7 @@ public class CFIPacketListener implements Listener {
private void handleBlockEvent(PacketEvent event, boolean relative, RunnableVal3<PacketEvent, VirtualWorld, BlockVector3> task) {
VirtualWorld gen = getGenerator(event);
if (gen != null) {
BlockVector3 pt = getRelPos(event, gen);
BlockVector3 pt = getRelPos(event, gen);
if (pt != null) {
if (relative) pt = getRelative(event, pt);
if (gen.contains(pt)) {

View File

@ -22,9 +22,9 @@ import java.util.Map;
public class WorldguardFlag extends BukkitMaskManager implements Listener {
private WorldGuardPlugin worldguard;
FaweBukkit plugin;
private FaweBukkit plugin;
public WorldguardFlag(final Plugin p2, final FaweBukkit p3) {
public WorldguardFlag(Plugin p2, FaweBukkit p3) {
super("worldguardflag");
this.worldguard = (WorldGuardPlugin) p2; // this.getWorldGuard();
this.plugin = p3;
@ -66,9 +66,9 @@ public class WorldguardFlag extends BukkitMaskManager implements Listener {
@Override
public BlockVector3 getMinimumPoint() {
BlockVector3 point = null;
BlockVector3 point = null;
for (Map.Entry<String, ProtectedRegion> entry : manager.getRegions().entrySet()) {
BlockVector3 p = entry.getValue().getMinimumPoint();
BlockVector3 p = entry.getValue().getMinimumPoint();
if (point == null) {
point = p;
continue;
@ -80,9 +80,9 @@ public class WorldguardFlag extends BukkitMaskManager implements Listener {
@Override
public BlockVector3 getMaximumPoint() {
BlockVector3 point = null;
BlockVector3 point = null;
for (Map.Entry<String, ProtectedRegion> entry : manager.getRegions().entrySet()) {
BlockVector3 p = entry.getValue().getMaximumPoint();
BlockVector3 p = entry.getValue().getMaximumPoint();
if (point == null) {
point = p;
continue;

View File

@ -601,29 +601,29 @@ public final class Spigot_v1_14_R1 extends CachedBukkitAdapter implements Bukkit
return material.getCraftBlockData();
}
@Override
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundTag nbtData) {
@Override
public void sendFakeNBT(Player player, BlockVector3 pos, CompoundTag nbtData) {
((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutTileEntityData(
new BlockPosition(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()),
7,
(NBTTagCompound) fromNative(nbtData)
));
}
}
@Override
public void notifyAndLightBlock(Location position, BlockState previousType) {
this.setBlock(position.getChunk(), position.getBlockX(), position.getBlockY(), position.getBlockZ(), previousType, true);
}
@Override
public void notifyAndLightBlock(Location position, BlockState previousType) {
this.setBlock(position.getChunk(), position.getBlockX(), position.getBlockY(), position.getBlockZ(), previousType, true);
}
@Override
public boolean setBlock(Location location, BlockStateHolder<?> state, boolean notifyAndLight) {
return this.setBlock(location.getChunk(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), state, notifyAndLight);
}
@Override
public boolean setBlock(Location location, BlockStateHolder<?> state, boolean notifyAndLight) {
return this.setBlock(location.getChunk(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), state, notifyAndLight);
}
@Override
public void sendFakeOP(Player player) {
@Override
public void sendFakeOP(Player player) {
((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityStatus(
((CraftPlayer) player).getHandle(), (byte) 28
));
}
}
}

View File

@ -366,20 +366,20 @@ public class AsyncBlock implements Block {
this.getUnsafeBlock().removeMetadata(metadataKey, owningPlugin);
}
@Override
public boolean isPassable() {
return this.getUnsafeBlock().isPassable();
}
@Override
public boolean isPassable() {
return this.getUnsafeBlock().isPassable();
}
@Override
public RayTraceResult rayTrace(@NotNull Location arg0, @NotNull Vector arg1, double arg2, @NotNull FluidCollisionMode arg3) {
return this.getUnsafeBlock().rayTrace(arg0, arg1, arg2, arg3);
}
@Override
public RayTraceResult rayTrace(@NotNull Location arg0, @NotNull Vector arg1, double arg2, @NotNull FluidCollisionMode arg3) {
return this.getUnsafeBlock().rayTrace(arg0, arg1, arg2, arg3);
}
@NotNull @Override
public BoundingBox getBoundingBox() {
return this.getUnsafeBlock().getBoundingBox();
}
@NotNull @Override
public BoundingBox getBoundingBox() {
return this.getUnsafeBlock().getBoundingBox();
}
@Override
public @NotNull BlockSoundGroup getSoundGroup() {

View File

@ -172,15 +172,15 @@ public class AsyncChunk implements Chunk {
return false;
}
@Override
public boolean isForceLoaded() {
return world.isChunkForceLoaded(x, z);
}
@Override
public boolean isForceLoaded() {
return world.isChunkForceLoaded(x, z);
}
@Override
public void setForceLoaded(boolean arg0) {
world.getChunkAt(x, z).setForceLoaded(arg0);
}
@Override
public void setForceLoaded(boolean arg0) {
world.getChunkAt(x, z).setForceLoaded(arg0);
}
@Override
public boolean addPluginChunkTicket(final Plugin plugin) {

View File

@ -1088,97 +1088,97 @@ public class AsyncWorld extends DelegateFaweQueue implements World, HasFaweQueue
return adapter;
}
@Override
public Collection<Entity> getNearbyEntities(BoundingBox arg0) {
return parent.getNearbyEntities(arg0);
}
@Override
public Collection<Entity> getNearbyEntities(BoundingBox arg0) {
return parent.getNearbyEntities(arg0);
}
@Override
public Collection<Entity> getNearbyEntities(BoundingBox arg0, Predicate<Entity> arg1) {
return parent.getNearbyEntities(arg0, arg1);
}
@Override
public Collection<Entity> getNearbyEntities(BoundingBox arg0, Predicate<Entity> arg1) {
return parent.getNearbyEntities(arg0, arg1);
}
@Override
public Collection<Entity> getNearbyEntities(Location arg0, double arg1, double arg2, double arg3,
Predicate<Entity> arg4) {
return parent.getNearbyEntities(arg0, arg1, arg2, arg3, arg4);
}
@Override
public Collection<Entity> getNearbyEntities(Location arg0, double arg1, double arg2, double arg3,
Predicate<Entity> arg4) {
return parent.getNearbyEntities(arg0, arg1, arg2, arg3, arg4);
}
@Override
public boolean isChunkForceLoaded(int arg0, int arg1) {
return parent.isChunkForceLoaded(arg0, arg1);
}
@Override
public boolean isChunkForceLoaded(int arg0, int arg1) {
return parent.isChunkForceLoaded(arg0, arg1);
}
@Override
public Location locateNearestStructure(Location arg0, StructureType arg1, int arg2, boolean arg3) {
return parent.locateNearestStructure(arg0, arg1, arg2, arg3);
}
@Override
public Location locateNearestStructure(Location arg0, StructureType arg1, int arg2, boolean arg3) {
return parent.locateNearestStructure(arg0, arg1, arg2, arg3);
}
@Override
public RayTraceResult rayTrace(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3, boolean arg4,
double arg5, Predicate<Entity> arg6) {
return parent.rayTrace(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
@Override
public RayTraceResult rayTrace(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3, boolean arg4,
double arg5, Predicate<Entity> arg6) {
return parent.rayTrace(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
}
@Override
public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2) {
return parent.rayTraceBlocks(arg0, arg1, arg2);
}
@Override
public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2) {
return parent.rayTraceBlocks(arg0, arg1, arg2);
}
@Override
public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3) {
return parent.rayTraceBlocks(arg0, arg1, arg2, arg3);
}
@Override
public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3) {
return parent.rayTraceBlocks(arg0, arg1, arg2, arg3);
}
@Override
public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3,
boolean arg4) {
return parent.rayTraceBlocks(arg0, arg1, arg2, arg3, arg4);
}
@Override
public RayTraceResult rayTraceBlocks(Location arg0, Vector arg1, double arg2, FluidCollisionMode arg3,
boolean arg4) {
return parent.rayTraceBlocks(arg0, arg1, arg2, arg3, arg4);
}
@Override
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2) {
return parent.rayTraceEntities(arg0, arg1, arg2);
}
@Override
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2) {
return parent.rayTraceEntities(arg0, arg1, arg2);
}
@Override
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, double arg3) {
return parent.rayTraceEntities(arg0, arg1, arg2, arg3);
}
@Override
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, double arg3) {
return parent.rayTraceEntities(arg0, arg1, arg2, arg3);
}
@Override
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, Predicate<Entity> arg3) {
return parent.rayTraceEntities(arg0, arg1, arg2, arg3);
}
@Override
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, Predicate<Entity> arg3) {
return parent.rayTraceEntities(arg0, arg1, arg2, arg3);
}
@Override
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, double arg3,
Predicate<Entity> arg4) {
return parent.rayTraceEntities(arg0, arg1, arg2, arg3, arg4);
}
@Override
public RayTraceResult rayTraceEntities(Location arg0, Vector arg1, double arg2, double arg3,
Predicate<Entity> arg4) {
return parent.rayTraceEntities(arg0, arg1, arg2, arg3, arg4);
}
@Override
public <T> void spawnParticle(Particle arg0, Location arg1, int arg2, double arg3, double arg4, double arg5,
double arg6, T arg7, boolean arg8) {
parent.spawnParticle(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
}
@Override
public <T> void spawnParticle(Particle arg0, Location arg1, int arg2, double arg3, double arg4, double arg5,
double arg6, T arg7, boolean arg8) {
parent.spawnParticle(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
}
@Override
public <T> void spawnParticle(Particle arg0, double arg1, double arg2, double arg3, int arg4, double arg5,
double arg6, double arg7, double arg8, T arg9, boolean arg10) {
parent.spawnParticle(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
@Override
public <T> void spawnParticle(Particle arg0, double arg1, double arg2, double arg3, int arg4, double arg5,
double arg6, double arg7, double arg8, T arg9, boolean arg10) {
parent.spawnParticle(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
}
}
@Override
public void setChunkForceLoaded(int x, int z, boolean forced) {
parent.setChunkForceLoaded(x, z, forced);
}
@Override
public void setChunkForceLoaded(int x, int z, boolean forced) {
parent.setChunkForceLoaded(x, z, forced);
}
@Override
public Collection<Chunk> getForceLoadedChunks() {
return parent.getForceLoadedChunks();
}
@Override
public Collection<Chunk> getForceLoadedChunks() {
return parent.getForceLoadedChunks();
}
@Override
public boolean addPluginChunkTicket(int x, int z, @NotNull Plugin plugin) {

View File

@ -20,7 +20,7 @@ public class AsyncSign extends AsyncBlockState implements Sign {
public AsyncSign(AsyncBlock block, int combined) {
super(block, combined);
}
private boolean isEditable = false;
@Override
@ -60,15 +60,15 @@ public class AsyncSign extends AsyncBlockState implements Sign {
}
}
@Override
public boolean isEditable() {
return this.isEditable;
}
@Override
public boolean isEditable() {
return this.isEditable;
}
@Override
public void setEditable(boolean arg0) {
this.isEditable = arg0;
}
@Override
public void setEditable(boolean arg0) {
this.isEditable = arg0;
}
@Override
public @NotNull PersistentDataContainer getPersistentDataContainer() {

View File

@ -327,7 +327,7 @@ public enum BukkitAdapter {
* @return The Bukkit BlockData
*/
public static BlockData adapt(@NotNull BlockStateHolder block) {
return getAdapter().adapt(block);
return getAdapter().adapt(block);
}
public static BlockData getBlockData(int combinedId) {
@ -341,11 +341,11 @@ public enum BukkitAdapter {
* @return The WorldEdit BlockState
*/
public static BlockState asBlockState(ItemStack itemStack) throws WorldEditException {
checkNotNull(itemStack);
if (itemStack.getType().isBlock()) {
checkNotNull(itemStack);
if (itemStack.getType().isBlock()) {
return getAdapter().asBlockState(itemStack);
} else {
throw new NotABlockException();
throw new NotABlockException();
}
}

View File

@ -1,23 +1,18 @@
package com.sk89q.worldedit.bukkit.adapter;
import com.bekvon.bukkit.residence.commands.material;
import com.sk89q.worldedit.bukkit.adapter.IBukkitAdapter;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.item.ItemType;
import com.sk89q.worldedit.world.item.ItemTypes;
import org.bukkit.Bukkit;
import java.util.List;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.block.data.BlockData;
import java.util.List;
import static com.google.common.base.Preconditions.checkNotNull;
public abstract class CachedBukkitAdapter implements IBukkitAdapter {
private int[] itemTypes;
private int[] blockTypes;
@ -63,7 +58,7 @@ public abstract class CachedBukkitAdapter implements IBukkitAdapter {
@Override
public BlockType adapt(Material material) {
try {
return BlockTypes.values[blockTypes[material.ordinal()]];
return BlockTypes.values[blockTypes[material.ordinal()]];
} catch (NullPointerException e) {
if (init()) return adapt(material);
throw e;

View File

@ -1,8 +1,14 @@
package com.sk89q.worldedit.bukkit.adapter;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.worldedit.NotABlockException;
import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.bukkit.*;
import com.sk89q.worldedit.bukkit.BukkitEntity;
import com.sk89q.worldedit.bukkit.BukkitItemStack;
import com.sk89q.worldedit.bukkit.BukkitPlayer;
import com.sk89q.worldedit.bukkit.BukkitWorld;
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.Vector3;
@ -19,6 +25,7 @@ import com.sk89q.worldedit.world.entity.EntityTypes;
import com.sk89q.worldedit.world.gamemode.GameMode;
import com.sk89q.worldedit.world.gamemode.GameModes;
import com.sk89q.worldedit.world.item.ItemType;
import java.util.Locale;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Biome;
@ -26,10 +33,6 @@ import org.bukkit.block.data.BlockData;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import java.util.Locale;
import static com.google.common.base.Preconditions.checkNotNull;
public interface IBukkitAdapter {
/**
@ -143,7 +146,7 @@ public interface IBukkitAdapter {
}
default org.bukkit.Location adapt(org.bukkit.World world, BlockVector3 position){
return adapt(world, position.toVector3());
return adapt(world, position.toVector3());
}
/**