Reformat src/main/java
Removes several pointless imports. And, more importantly, fixes the build.
This commit is contained in:
parent
1255bd00fd
commit
58054ad2d1
|
@ -89,9 +89,9 @@ public final String[] list( String path ) throws LuaException
|
|||
*
|
||||
* @param arguments The paths to combine.
|
||||
* @return The new path, with separators added between parts as needed.
|
||||
* @throws LuaException On argument errors.
|
||||
* @cc.tparam string path The first part of the path. For example, a parent directory path.
|
||||
* @cc.tparam string ... Additional parts of the path to combine.
|
||||
* @throws LuaException On argument errors.
|
||||
*/
|
||||
@LuaFunction
|
||||
public final String combine( IArguments arguments ) throws LuaException
|
||||
|
|
|
@ -323,9 +323,9 @@ public final double clock()
|
|||
*
|
||||
* @param args The locale of the time, or a table filled by {@code os.date("*t")} to decode. Defaults to {@code ingame} locale if not specified.
|
||||
* @return The hour of the selected locale, or a UNIX timestamp from the table, depending on the argument passed in.
|
||||
* @throws LuaException If an invalid locale is passed.
|
||||
* @cc.tparam [opt] string|table locale The locale of the time, or a table filled by {@code os.date("*t")} to decode. Defaults to {@code ingame} locale if not specified.
|
||||
* @see #date To get a date table that can be converted with this function.
|
||||
* @throws LuaException If an invalid locale is passed.
|
||||
*/
|
||||
@LuaFunction
|
||||
public final Object time( IArguments args ) throws LuaException
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
import dan200.computercraft.core.filesystem.TrackingCloseable;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
import dan200.computercraft.api.lua.LuaValues;
|
||||
import dan200.computercraft.core.filesystem.TrackingCloseable;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.FileChannel;
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.WritableByteChannel;
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
|
||||
import dan200.computercraft.core.apis.IAPIEnvironment.IPeripheralChangeListener;
|
||||
|
||||
/**
|
||||
* Represents the "environment" that a {@link Computer} exists in.
|
||||
*
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
* This file is part of ComputerCraft - http://www.computercraft.info
|
||||
* Copyright Daniel Ratcliffe, 2011-2021. Do not distribute without permission.
|
||||
* Send enquiries to dratcliffe@gmail.com
|
||||
*/
|
||||
package dan200.computercraft.core.filesystem;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
import dan200.computercraft.core.apis.http.options.AddressRuleConfig;
|
||||
import dan200.computercraft.shared.peripheral.monitor.MonitorRenderer;
|
||||
import net.minecraftforge.common.ForgeConfigSpec;
|
||||
import net.minecraftforge.common.ForgeConfigSpec.Builder;
|
||||
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
@ -28,12 +30,6 @@
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static net.minecraftforge.common.ForgeConfigSpec.Builder;
|
||||
import static net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
|
||||
|
||||
import net.minecraftforge.common.ForgeConfigSpec.Builder;
|
||||
import net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
|
||||
|
||||
@Mod.EventBusSubscriber( modid = ComputerCraft.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD )
|
||||
public final class Config
|
||||
{
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block.Properties;
|
||||
|
||||
public abstract class BlockGeneric extends Block
|
||||
{
|
||||
private final RegistryObject<? extends TileEntityType<? extends TileGeneric>> type;
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block.Properties;
|
||||
|
||||
public class BlockComputer extends BlockComputerBase<TileComputer>
|
||||
{
|
||||
public static final EnumProperty<ComputerState> STATE = EnumProperty.create( "state", ComputerState.class );
|
||||
|
|
|
@ -34,8 +34,6 @@
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block.Properties;
|
||||
|
||||
public abstract class BlockComputerBase<T extends TileComputerBase> extends BlockGeneric implements IBundledRedstoneBlock
|
||||
{
|
||||
private static final ResourceLocation DROP = new ResourceLocation( ComputerCraft.MOD_ID, "computer" );
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.Item.Properties;
|
||||
|
||||
public class ItemComputer extends ItemComputerBase
|
||||
{
|
||||
public ItemComputer( BlockComputer block, Properties settings )
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.Item.Properties;
|
||||
|
||||
public abstract class ItemComputerBase extends BlockItem implements IComputerItem, IMedia
|
||||
{
|
||||
private final ComputerFamily family;
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import dan200.computercraft.shared.computer.recipe.ComputerFamilyRecipe.Serializer;
|
||||
|
||||
public class ComputerUpgradeRecipe extends ComputerFamilyRecipe
|
||||
{
|
||||
public ComputerUpgradeRecipe( ResourceLocation identifier, String group, int width, int height, NonNullList<Ingredient> ingredients, ItemStack result, ComputerFamily family )
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.world.storage.loot.conditions.ILootCondition.IBuilder;
|
||||
|
||||
/**
|
||||
* A loot condition which checks if the tile entity has a name.
|
||||
*/
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.world.storage.loot.conditions.ILootCondition.IBuilder;
|
||||
|
||||
/**
|
||||
* A loot condition which checks if the tile entity has has a non-0 ID.
|
||||
*/
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.world.storage.loot.conditions.ILootCondition.IBuilder;
|
||||
|
||||
/**
|
||||
* A loot condition which checks if the entity is in creative mode.
|
||||
*/
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.Item.Properties;
|
||||
|
||||
public class ItemDisk extends Item implements IMedia, IColouredItem
|
||||
{
|
||||
private static final String NBT_ID = "DiskId";
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.Item.Properties;
|
||||
|
||||
public class ItemPrintout extends Item
|
||||
{
|
||||
private static final String NBT_TITLE = "Title";
|
||||
|
|
|
@ -29,8 +29,6 @@
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.Item.Properties;
|
||||
|
||||
public class ItemTreasureDisk extends Item implements IMedia
|
||||
{
|
||||
private static final String NBT_TITLE = "Title";
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block.Properties;
|
||||
|
||||
public class BlockDiskDrive extends BlockGeneric
|
||||
{
|
||||
static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
|
||||
|
|
|
@ -121,7 +121,6 @@ public static int size( IItemHandler inventory )
|
|||
* @return The number of transferred items.
|
||||
* @throws LuaException If the peripheral to transfer to doesn't exist or isn't an inventory.
|
||||
* @throws LuaException If either source or destination slot is out of range.
|
||||
*
|
||||
* @cc.see peripheral.getName Allows you to get the name of a @{peripheral.wrap|wrapped} peripheral.
|
||||
* @cc.usage Wrap two chests, and push an item from one to another.
|
||||
* <pre>{@code
|
||||
|
@ -169,7 +168,6 @@ public static int pushItems(
|
|||
* @return The number of transferred items.
|
||||
* @throws LuaException If the peripheral to transfer to doesn't exist or isn't an inventory.
|
||||
* @throws LuaException If either source or destination slot is out of range.
|
||||
*
|
||||
* @cc.see peripheral.getName Allows you to get the name of a @{peripheral.wrap|wrapped} peripheral.
|
||||
* @cc.usage Wrap two chests, and push an item from one to another.
|
||||
* <pre>{@code
|
||||
|
|
|
@ -40,8 +40,6 @@
|
|||
|
||||
import static dan200.computercraft.shared.util.WaterloggableHelpers.*;
|
||||
|
||||
import net.minecraft.block.Block.Properties;
|
||||
|
||||
public class BlockCable extends BlockGeneric implements IWaterLoggable
|
||||
{
|
||||
public static final EnumProperty<CableModemVariant> MODEM = EnumProperty.create( "modem", CableModemVariant.class );
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
|
||||
import net.minecraft.block.Block.Properties;
|
||||
|
||||
public class BlockWiredModemFull extends BlockGeneric
|
||||
{
|
||||
public static final BooleanProperty MODEM_ON = BooleanProperty.create( "modem" );
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
|
||||
import static dan200.computercraft.shared.peripheral.modem.wired.BlockCable.*;
|
||||
|
||||
import net.minecraft.item.Item.Properties;
|
||||
|
||||
public abstract class ItemBlockCable extends BlockItem
|
||||
{
|
||||
private String translationKey;
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
|
||||
import static dan200.computercraft.shared.util.WaterloggableHelpers.*;
|
||||
|
||||
import net.minecraft.block.Block.Properties;
|
||||
|
||||
public class BlockWirelessModem extends BlockGeneric implements IWaterLoggable
|
||||
{
|
||||
public static final DirectionProperty FACING = BlockStateProperties.FACING;
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block.Properties;
|
||||
|
||||
public class BlockMonitor extends BlockGeneric
|
||||
{
|
||||
public static final DirectionProperty ORIENTATION = DirectionProperty.create( "orientation",
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block.Properties;
|
||||
|
||||
public class BlockPrinter extends BlockGeneric
|
||||
{
|
||||
private static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
|
||||
|
|
|
@ -46,8 +46,8 @@ public String getType()
|
|||
* Writes text to the current page.
|
||||
*
|
||||
* @param arguments The values to write to the page.
|
||||
* @cc.tparam string|number ... The values to write to the page.
|
||||
* @throws LuaException If any values couldn't be converted to a string, or if no page is started.
|
||||
* @cc.tparam string|number ... The values to write to the page.
|
||||
*/
|
||||
@LuaFunction
|
||||
public final void write( IArguments arguments ) throws LuaException
|
||||
|
@ -62,9 +62,9 @@ public final void write( IArguments arguments ) throws LuaException
|
|||
* Returns the current position of the cursor on the page.
|
||||
*
|
||||
* @return The position of the cursor.
|
||||
* @throws LuaException If a page isn't being printed.
|
||||
* @cc.treturn number The X position of the cursor.
|
||||
* @cc.treturn number The Y position of the cursor.
|
||||
* @throws LuaException If a page isn't being printed.
|
||||
*/
|
||||
@LuaFunction
|
||||
public final Object[] getCursorPos() throws LuaException
|
||||
|
@ -93,9 +93,9 @@ public final void setCursorPos( int x, int y ) throws LuaException
|
|||
* Returns the size of the current page.
|
||||
*
|
||||
* @return The size of the page.
|
||||
* @throws LuaException If a page isn't being printed.
|
||||
* @cc.treturn number The width of the page.
|
||||
* @cc.treturn number The height of the page.
|
||||
* @throws LuaException If a page isn't being printed.
|
||||
*/
|
||||
@LuaFunction
|
||||
public final Object[] getPageSize() throws LuaException
|
||||
|
|
|
@ -17,7 +17,10 @@
|
|||
import net.minecraft.inventory.ItemStackHelper;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
import net.minecraft.inventory.container.INamedContainerProvider;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.item.DyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.*;
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block.Properties;
|
||||
|
||||
public class BlockSpeaker extends BlockGeneric
|
||||
{
|
||||
private static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
|
||||
|
|
|
@ -45,8 +45,6 @@
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.Item.Properties;
|
||||
|
||||
public class ItemPocketComputer extends Item implements IComputerItem, IMedia, IColouredItem
|
||||
{
|
||||
private static final String NBT_UPGRADE = "Upgrade";
|
||||
|
|
|
@ -44,8 +44,6 @@
|
|||
import static dan200.computercraft.shared.util.WaterloggableHelpers.*;
|
||||
import static net.minecraft.state.properties.BlockStateProperties.WATERLOGGED;
|
||||
|
||||
import net.minecraft.block.Block.Properties;
|
||||
|
||||
public class BlockTurtle extends BlockComputerBase<TileTurtle> implements IWaterLoggable
|
||||
{
|
||||
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
|
||||
import static dan200.computercraft.shared.turtle.core.TurtleBrain.*;
|
||||
|
||||
import net.minecraft.item.Item.Properties;
|
||||
|
||||
public class ItemTurtle extends ItemComputerBase implements ITurtleItem
|
||||
{
|
||||
public ItemTurtle( BlockTurtle block, Properties settings )
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import dan200.computercraft.shared.computer.recipe.ComputerFamilyRecipe.Serializer;
|
||||
|
||||
public final class TurtleRecipe extends ComputerFamilyRecipe
|
||||
{
|
||||
private TurtleRecipe( ResourceLocation identifier, String group, int width, int height, NonNullList<Ingredient> ingredients, ItemStack result, ComputerFamily family )
|
||||
|
|
Loading…
Reference in New Issue