Added spotless back and reformatted

This commit is contained in:
Sebastian Hartte
2020-07-27 20:07:27 +02:00
parent 49296915c9
commit 780f68952b
593 changed files with 4192 additions and 3969 deletions
@@ -45,23 +45,25 @@ public interface ICellModelRegistry {
* the game. See
* {@see net.minecraftforge.client.model.ModelLoader#addSpecialModel}.
*
* This method only maps an {@link Item} to a {@link Identifier} which can
* be looked up from the {@link net.minecraft.client.render.model.BakedModelManager}. No validation about missing models
* will be done.
* This method only maps an {@link Item} to a {@link Identifier} which can be
* looked up from the
* {@link net.minecraft.client.render.model.BakedModelManager}. No validation
* about missing models will be done.
*
* Will throw an exception in case a model is already registered for an item.
*
* For examples look at our cell part models within the drive model directory.
*
* @param item The cell item
* @param model The {@link net.minecraft.util.Identifier} representing the model.
* @param model The {@link net.minecraft.util.Identifier} representing the
* model.
* @return
*/
void registerModel(@Nonnull Item item, @Nonnull Identifier model);
/**
* The {@link Identifier} of the model used to render the given storage
* cell {@link Item} when inserted into a drive or similar.
* The {@link Identifier} of the model used to render the given storage cell
* {@link Item} when inserted into a drive or similar.
*
* @param item
* @return null, if no model is registered.
@@ -75,7 +75,6 @@ public enum SecurityPermissions {
return this.translationKey + ".tip";
}
public Text tooltipText() {
return new TranslatableText(getTranslatedTip());
}
@@ -75,7 +75,7 @@ public interface ICraftingHelper {
* equivalent items to craft this recipe.
*/
ItemStack encodeCraftingPattern(@Nullable ItemStack stack, CraftingRecipe recipe, ItemStack[] in, ItemStack out,
boolean allowSubstitutes);
boolean allowSubstitutes);
/**
* Same as {@link #decodePattern(ItemStack, World, boolean)} with no auto
@@ -29,8 +29,8 @@ import java.util.Set;
import javax.annotation.Nonnull;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemConvertible;
import net.minecraft.item.ItemStack;
import appeng.api.features.AEFeature;
@@ -23,10 +23,11 @@
package appeng.api.events;
import appeng.api.features.ILocatable;
import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import appeng.api.features.ILocatable;
/**
* Input Event:
* <p>
@@ -34,11 +35,12 @@ import net.fabricmc.fabric.api.event.EventFactory;
*/
public interface LocatableEventAnnounce {
Event<LocatableEventAnnounce> EVENT = EventFactory.createArrayBacked(LocatableEventAnnounce.class, listeners -> (ILocatable target, LocatableEvent change) -> {
for (LocatableEventAnnounce listener : listeners) {
listener.onLocatableAnnounce(target, change);
}
});
Event<LocatableEventAnnounce> EVENT = EventFactory.createArrayBacked(LocatableEventAnnounce.class,
listeners -> (ILocatable target, LocatableEvent change) -> {
for (LocatableEventAnnounce listener : listeners) {
listener.onLocatableAnnounce(target, change);
}
});
void onLocatableAnnounce(final ILocatable target, final LocatableEvent change);
@@ -26,9 +26,10 @@ package appeng.api.features;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import alexiil.mc.lib.attributes.Attribute;
import net.minecraft.item.ItemStack;
import alexiil.mc.lib.attributes.Attribute;
import appeng.api.config.TunnelType;
/**
@@ -1,6 +1,12 @@
package appeng.api.parts;
import appeng.api.util.AEPartLocation;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.function.Supplier;
import javax.annotation.Nullable;
import net.fabricmc.fabric.api.renderer.v1.render.RenderContext;
import net.minecraft.block.BlockState;
import net.minecraft.client.render.model.BakedModel;
@@ -12,33 +18,32 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockRenderView;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.function.Supplier;
import appeng.api.util.AEPartLocation;
/**
* This interface can be implemented by baked models returned by {@link IPart#getStaticModels()} to indicate that
* they would like to use the model data returned by {@link IPart#getModelData()}.
* This interface can be implemented by baked models returned by
* {@link IPart#getStaticModels()} to indicate that they would like to use the
* model data returned by {@link IPart#getModelData()}.
*/
public interface IDynamicPartBakedModel extends BakedModel {
/**
* See {@link net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel#emitBlockQuads(BlockRenderView, BlockState, BlockPos, Supplier, RenderContext)}
* See
* {@link net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel#emitBlockQuads(BlockRenderView, BlockState, BlockPos, Supplier, RenderContext)}
* for context.
* <p>
* The given <code>context</code> will already have been transformed so that the model renders from the
* rotated location the part is attached to.
* The given <code>context</code> will already have been transformed so that the
* model renders from the rotated location the part is attached to.
*
* @param partSide The side of the cable bus that the part is attached to.
* @param partSide The side of the cable bus that the part is attached to.
* @param modelData The model data returned by {@link IPart#getModelData()}
*/
void emitQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context,
Direction partSide, @Nullable Object modelData);
void emitQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier,
RenderContext context, Direction partSide, @Nullable Object modelData);
/**
* Unless you use your dynamic model for other purposes, this method will not be called.
* Unless you use your dynamic model for other purposes, this method will not be
* called.
*/
@Override
default List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction face, Random random) {
+17 -14
View File
@@ -23,11 +23,13 @@
package appeng.api.parts;
import alexiil.mc.lib.attributes.AttributeList;
import appeng.api.networking.IGridNode;
import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.api.util.AEPartLocation;
import java.io.IOException;
import java.util.List;
import java.util.Random;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.entity.BlockEntity;
@@ -46,11 +48,12 @@ import net.minecraft.util.math.Vec3d;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.List;
import java.util.Random;
import alexiil.mc.lib.attributes.AttributeList;
import appeng.api.networking.IGridNode;
import appeng.api.util.AECableType;
import appeng.api.util.AEColor;
import appeng.api.util.AEPartLocation;
public interface IPart extends ICustomCableConnection {
@@ -343,14 +346,14 @@ public interface IPart extends ICustomCableConnection {
*
* @see alexiil.mc.lib.attributes.AttributeProvider
*/
default void addAllAttributes(AttributeList<?> to) {}
default void addAllAttributes(AttributeList<?> to) {
}
/**
* Additional rendering data to be passed to the models for rendering this part.
*
* @return The rendering data to pass to the model. Only useful if custom models are
* used. Can be null to not pass anything.
* @return The rendering data to pass to the model. Only useful if custom models
* are used. Can be null to not pass anything.
*/
@Nullable
default Object getModelData() {
@@ -26,9 +26,9 @@ package appeng.api.parts;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.World;
public interface IPartHelper {
+5 -5
View File
@@ -25,16 +25,16 @@ package appeng.api.parts;
import java.util.Set;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d;
import appeng.api.util.AEColor;
import appeng.api.util.AEPartLocation;
import appeng.api.util.DimensionalCoord;
import net.minecraft.util.math.Vec3d;
/**
* Implemented on AE's TileEntity.
@@ -115,8 +115,8 @@ public interface IPartHost extends ICustomCableConnection {
DimensionalCoord getLocation();
/**
* @return the block entity for the host, this can either be an FMP tile, or a AE
* tile
* @return the block entity for the host, this can either be an FMP tile, or a
* AE tile
*/
BlockEntity getTile();
@@ -31,8 +31,8 @@ import javax.annotation.Nonnull;
import net.minecraft.util.Identifier;
/**
* A container to store a collection of {@link Identifier} as models for a
* part as well as other properties.
* A container to store a collection of {@link Identifier} as models for a part
* as well as other properties.
*/
public interface IPartModel {
@@ -22,12 +22,12 @@ import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.text.Text;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.World;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.server.world.ServerWorld;
public interface ISpatialDimension {
ServerWorld getWorld(RegistryKey<World> cellDim);
@@ -115,11 +115,11 @@ public interface IStorageHelper {
/**
* Inserts items into a {@link IMEInventory} respecting power requirements.
*
* @param energy Energy source.
* @param inv Inventory to insert into.
* @param input Items to insert.
* @param src Action source.
* @param mode Simulate or modulate
* @param energy Energy source.
* @param inv Inventory to insert into.
* @param input Items to insert.
* @param src Action source.
* @param mode Simulate or modulate
* @return items not inserted or {@code null} if everything was inserted.
*/
<T extends IAEStack<T>> T poweredInsert(final IEnergySource energy, final IMEInventory<T> inv, final T input,
@@ -23,9 +23,10 @@
package appeng.api.storage.cells;
import alexiil.mc.lib.attributes.item.FixedItemInv;
import net.minecraft.item.ItemStack;
import alexiil.mc.lib.attributes.item.FixedItemInv;
import appeng.api.config.FuzzyMode;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.data.IAEStack;
@@ -23,9 +23,10 @@
package appeng.api.storage.cells;
import alexiil.mc.lib.attributes.item.FixedItemInv;
import net.minecraft.item.ItemStack;
import alexiil.mc.lib.attributes.item.FixedItemInv;
import appeng.api.config.FuzzyMode;
public interface ICellWorkbenchItem {