diff --git a/.editorconfig b/.editorconfig index f29a94248..618e76e1a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,6 +3,7 @@ root = true [*] charset = utf-8 tab_width = 4 +indent_size = 4 [*.java] indent_style = tab diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 3aba40d94..e20e8e9df 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,8 +1,8 @@ -First of all, thank you for you efforts in contributing to TechReborn project +First of all, thank you for your efforts in contributing to TechReborn project In order to ease code review of your pull request, please, go through this checklist. - * The code compiles )). + * The code compiles. * The code has been developer-tested. * The code includes javadoc where appropriate. * The code is tidy (indentation, line length, no commented-out code, no spelling mistakes, etc). @@ -15,5 +15,3 @@ In order to ease code review of your pull request, please, go through this check * Are there any hardcoded, development only things still in the code? * Was performance considered? * Corner cases well documented or any workarounds for a known limitation of the MC, Fabric, RC, etc used. - - diff --git a/README.md b/README.md index 51407ec35..f9264fbfb 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ To report an issue or make a suggestion, please head up to the `Issues` tab up a # Translation -Techreborn is available in a range of diffrent languages, if you want to help out translate the mod please see our crowdin project at [https://translate.techreborn.ovh/](https://translate.techreborn.ovh/) The translations are automaticly included in the jar files at build time. +Techreborn is available in a range of different languages, if you want to help out translate the mod please see our crowdin project at [https://translate.techreborn.ovh/](https://translate.techreborn.ovh/) The translations are automatically included in the jar files at build time. # Screenshots diff --git a/RebornCore/src/main/java/io/github/cottonmc/libcd/api/CustomOutputRecipe.java b/RebornCore/src/main/java/io/github/cottonmc/libcd/api/CustomOutputRecipe.java index 6588e5b71..11a986e95 100644 --- a/RebornCore/src/main/java/io/github/cottonmc/libcd/api/CustomOutputRecipe.java +++ b/RebornCore/src/main/java/io/github/cottonmc/libcd/api/CustomOutputRecipe.java @@ -25,11 +25,12 @@ package io.github.cottonmc.libcd.api; import net.minecraft.item.Item; +import net.minecraft.recipe.Recipe; import java.util.Collection; /** - * A recipe that has output behavior that cannot be described by just the Recipe#getOutput() method. + * A recipe that has output behavior that cannot be described by just the {@link Recipe#getOutput()} method. * Used for RecipeTweaker remove-by-output code. */ public interface CustomOutputRecipe { diff --git a/RebornCore/src/main/java/reborncore/RebornCore.java b/RebornCore/src/main/java/reborncore/RebornCore.java index c8cec9c7a..66c1b69a6 100644 --- a/RebornCore/src/main/java/reborncore/RebornCore.java +++ b/RebornCore/src/main/java/reborncore/RebornCore.java @@ -33,8 +33,8 @@ import net.fabricmc.fabric.api.event.world.WorldTickCallback; import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.util.Identifier; -import org.slf4j.LoggerFactory; import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import reborncore.api.ToolManager; import reborncore.api.blockentity.UnloadHandler; import reborncore.common.RebornCoreCommands; @@ -77,7 +77,7 @@ public class RebornCore implements ModInitializer { public void onInitialize() { new Configuration(RebornCoreConfig.class, MOD_ID); PowerSystem.init(); - CalenderUtils.loadCalender(); //Done early as some features need this + CalenderUtils.loadCalender(); // Done early as some features need this ToolManager.INSTANCE.customToolHandlerList.add(new GenericWrenchHelper(new Identifier("ic2:wrench"), true)); ToolManager.INSTANCE.customToolHandlerList.add(new GenericWrenchHelper(new Identifier("forestry:wrench"), false)); diff --git a/RebornCore/src/main/java/reborncore/RebornRegistry.java b/RebornCore/src/main/java/reborncore/RebornRegistry.java index 3be543b2b..d068b7bd8 100644 --- a/RebornCore/src/main/java/reborncore/RebornRegistry.java +++ b/RebornCore/src/main/java/reborncore/RebornRegistry.java @@ -44,11 +44,11 @@ public class RebornRegistry { private static final HashMap objIdentMap = new HashMap<>(); /** - * Registers Block and BlockItem in vanilla registries + * Registers {@link Block} and {@link BlockItem} in vanilla registries * - * @param block Block Block to register - * @param builder Item.Settings Settings builder for BlockItem - * @param name Identifier Registry name for block and item + * @param block {@link Block} Block to register + * @param builder {@link Item.Settings} Settings builder for {@link BlockItem} + * @param name {@link Identifier} Registry name for block and item */ public static void registerBlock(Block block, Item.Settings builder, Identifier name) { Registry.register(Registry.BLOCK, name, block); @@ -63,11 +63,11 @@ public class RebornRegistry { } /** - * Registers Block and BlockItem in vanilla registries. + * Registers Block and BlockItem in vanilla registries. * Block should have registered identifier in RebornRegistry via {@link #registerIdent registerIdent} method * - * @param block Block Block to register - * @param itemGroup Item.Settings Settings builder for BlockItem + * @param block {@link Block} Block to register + * @param itemGroup {@link Item.Settings} Settings builder for {@link BlockItem} */ public static void registerBlock(Block block, Item.Settings itemGroup) { Validate.isTrue(objIdentMap.containsKey(block)); @@ -80,9 +80,11 @@ public class RebornRegistry { } /** - * Register only Block, without BlockItem in vanilla registries - * Block should have registered identifier in RebornRegistry via {@link #registerIdent registerIdent} method - * @param block Block Block to register + * Register only {@link Block}, without {@link BlockItem} in vanilla registries + * Block should have registered identifier in {@link RebornRegistry} via + * {@link #registerIdent registerIdent} method + * + * @param block {@link Block} Block to register */ public static void registerBlockNoItem(Block block) { Validate.isTrue(objIdentMap.containsKey(block)); @@ -91,20 +93,23 @@ public class RebornRegistry { /** - * Register Item in vanilla registries + * Register {@link Item} in vanilla registries * - * @param item Item Item to register - * @param name Identifier Registry name for item + * @param item {@link Item} Item to register + * @param name {@link Identifier} Registry name for item */ public static void registerItem(Item item, Identifier name) { Registry.register(Registry.ITEM, name, item); } /** - * Register Item in vanilla registries - * Item should have registered identifier in RebornRegistry via {@link #registerIdent registerIdent} method + *

Register {@link Item} in vanilla registries

+ *

+ * {@link Item} should have registered identifier in {@link RebornRegistry} + * via {@link #registerIdent registerIdent} method + *

* - * @param item Item Item to register + * @param item {@link Item} Item to register */ public static void registerItem(Item item){ Validate.isTrue(objIdentMap.containsKey(item)); @@ -112,10 +117,10 @@ public class RebornRegistry { } /** - * Registers Identifier in internal RebornCore map + * Registers {@link Identifier} in internal RebornCore map * - * @param object Object Item, Block or whatever to be put into map - * @param identifier Identifier Registry name for object + * @param object {@link Object}, {@link Item}, {@link Block} or whatever to be put into map + * @param identifier {@link Identifier} Registry name for object */ public static void registerIdent(Object object, Identifier identifier){ objIdentMap.put(object, identifier); diff --git a/RebornCore/src/main/java/reborncore/api/IToolHandler.java b/RebornCore/src/main/java/reborncore/api/IToolHandler.java index d3f6aaeb4..7750545f1 100644 --- a/RebornCore/src/main/java/reborncore/api/IToolHandler.java +++ b/RebornCore/src/main/java/reborncore/api/IToolHandler.java @@ -36,15 +36,16 @@ import net.minecraft.world.World; public interface IToolHandler { /** - * Called when a machine is actived with the item that has IToolHandler on it + * Called when a machine is activated with the item that has {@link IToolHandler} on it * - * @param stack the held itemstack - * @param pos the pos of the block - * @param world the world of the block - * @param player the player that actived the block - * @param side the side that the player actived - * @param damage if the tool should be damged, or power taken - * @return If the tool can handle being actived on the block, return false when the tool is broken or out of power for example. + * @param stack {@link ItemStack} The held itemstack + * @param pos {@link BlockPos} The pos of the block + * @param world {@link World} The world of the block + * @param player {@link PlayerEntity} The player that activated the block + * @param side {@link Direction} The side that the player activated + * @param damage {@code boolean} If the tool should be damaged, or power taken + * @return {@code boolean} If the tool can handle being activated on the block, + * return false when the tool is broken or out of power for example. */ boolean handleTool(ItemStack stack, BlockPos pos, World world, PlayerEntity player, Direction side, boolean damage); diff --git a/RebornCore/src/main/java/reborncore/api/blockentity/IUpgradeable.java b/RebornCore/src/main/java/reborncore/api/blockentity/IUpgradeable.java index 84538497c..0342023dc 100644 --- a/RebornCore/src/main/java/reborncore/api/blockentity/IUpgradeable.java +++ b/RebornCore/src/main/java/reborncore/api/blockentity/IUpgradeable.java @@ -33,7 +33,7 @@ public interface IUpgradeable { return true; } - Inventory getUpgradeInvetory(); + Inventory getUpgradeInventory(); int getUpgradeSlotCount(); diff --git a/RebornCore/src/main/java/reborncore/api/events/ApplyArmorToDamageCallback.java b/RebornCore/src/main/java/reborncore/api/events/ApplyArmorToDamageCallback.java index 0ac2dea1e..b0c8387fd 100644 --- a/RebornCore/src/main/java/reborncore/api/events/ApplyArmorToDamageCallback.java +++ b/RebornCore/src/main/java/reborncore/api/events/ApplyArmorToDamageCallback.java @@ -41,13 +41,15 @@ public interface ApplyArmorToDamageCallback { }); /** - * Apply armor to amount of damage inflicted. Decreases it in most cases unless armor should increase damage inflicted. - * Event is called after damage is being reduced by armor already and before damage reduction from enchants. + *

Apply armor to amount of damage inflicted.

+ * Decreases it in most cases unless armor should increase damage inflicted. * - * @param player PlayerEntity Player being damaged - * @param source DamageSource Type of damage - * @param amount float Current amount of damage - * @return float Amount of damage after reduction + *

Event is called after damage is being reduced by armor already and before damage reduction from enchants.

+ * + * @param player {@link PlayerEntity} Player being damaged + * @param source {@link DamageSource} Type of damage + * @param amount {@code float} Current amount of damage + * @return {@code float} Amount of damage after reduction */ float applyArmorToDamage(PlayerEntity player, DamageSource source, float amount); } diff --git a/RebornCore/src/main/java/reborncore/api/items/InventoryBase.java b/RebornCore/src/main/java/reborncore/api/items/InventoryBase.java index 3173c05aa..d6b56ecee 100644 --- a/RebornCore/src/main/java/reborncore/api/items/InventoryBase.java +++ b/RebornCore/src/main/java/reborncore/api/items/InventoryBase.java @@ -94,7 +94,7 @@ public abstract class InventoryBase implements Inventory { @Override public void markDirty() { - //Stuff happens in the super methods + // Stuff happens in the super methods } @Override diff --git a/RebornCore/src/main/java/reborncore/client/ClientChunkManager.java b/RebornCore/src/main/java/reborncore/client/ClientChunkManager.java index 9e1db20cd..ee41d7e0d 100644 --- a/RebornCore/src/main/java/reborncore/client/ClientChunkManager.java +++ b/RebornCore/src/main/java/reborncore/client/ClientChunkManager.java @@ -50,7 +50,7 @@ public class ClientChunkManager { public static void toggleLoadedChunks(BlockPos chunkLoader) { if (loadedChunks.size() == 0) { - NetworkManager.sendToServer(ServerBoundPackets.requestChunkloaderChunks(chunkLoader)); + NetworkManager.sendToServer(ServerBoundPackets.requestChunkLoaderChunks(chunkLoader)); } else { loadedChunks.clear(); } diff --git a/RebornCore/src/main/java/reborncore/client/ItemStackRenderer.java b/RebornCore/src/main/java/reborncore/client/ItemStackRenderer.java index 8d44ff3a6..9792f7cc0 100644 --- a/RebornCore/src/main/java/reborncore/client/ItemStackRenderer.java +++ b/RebornCore/src/main/java/reborncore/client/ItemStackRenderer.java @@ -44,7 +44,8 @@ import java.nio.file.Files; import java.nio.file.Path; /** - * Initially take from https://github.com/JamiesWhiteShirt/developer-mode/tree/experimental-item-render and then ported to 1.15 + * Initially taken from https://github.com/JamiesWhiteShirt/developer-mode/tree/experimental-item-render + * and then ported to 1.15 * Thanks 2xsaiko for fixing the lighting + odd issues above */ public class ItemStackRenderer implements HudRenderCallback { diff --git a/RebornCore/src/main/java/reborncore/client/ModelSantaHat.java b/RebornCore/src/main/java/reborncore/client/ModelSantaHat.java index c17acfbb3..479d8f0ab 100644 --- a/RebornCore/src/main/java/reborncore/client/ModelSantaHat.java +++ b/RebornCore/src/main/java/reborncore/client/ModelSantaHat.java @@ -40,151 +40,151 @@ import java.util.Arrays; import java.util.Collections; public class ModelSantaHat extends EntityModel { - private final ModelPart hatband1; - private final ModelPart hatband2; - private final ModelPart hatband3; - private final ModelPart hatband4; - private final ModelPart hatbase1; - private final ModelPart hatband5; - private final ModelPart hatband6; - private final ModelPart hatbase2; - private final ModelPart hatextension1; - private final ModelPart hatextension2; - private final ModelPart hatextension3; - private final ModelPart hatextension4; - private final ModelPart hatball1; - private final ModelPart hatball2; - private final ModelPart hatball3; - private final ModelPart hatball4; - private final ModelPart hatball5; - private final ModelPart hatball6; + private final ModelPart hatBand1; + private final ModelPart hatBand2; + private final ModelPart hatBand3; + private final ModelPart hatBand4; + private final ModelPart hatBase1; + private final ModelPart hatBand5; + private final ModelPart hatBand6; + private final ModelPart hatBase2; + private final ModelPart hatExtension1; + private final ModelPart hatExtension2; + private final ModelPart hatExtension3; + private final ModelPart hatExtension4; + private final ModelPart hatBall1; + private final ModelPart hatBall2; + private final ModelPart hatBall3; + private final ModelPart hatBall4; + private final ModelPart hatBall5; + private final ModelPart hatBall6; public ModelSantaHat() { - ModelPart.Cuboid[] hatband1Cuboids = { + ModelPart.Cuboid[] hatBand1Cuboids = { new ModelPart.Cuboid(0, 32, -4F, -8F, -5F, 8F, 1F, 1F, 0F, 0F, 0F, true, 64F, 64F) }; - hatband1 = new ModelPart(Arrays.asList(hatband1Cuboids), Collections.emptyMap()); - hatband1.setPivot(0F, 0F, 0F); - setRotation(hatband1, 0F, 0F, 0F); + hatBand1 = new ModelPart(Arrays.asList(hatBand1Cuboids), Collections.emptyMap()); + hatBand1.setPivot(0F, 0F, 0F); + setRotation(hatBand1, 0F, 0F, 0F); - ModelPart.Cuboid[] hatband2Cuboids = { + ModelPart.Cuboid[] hatBand2Cuboids = { new ModelPart.Cuboid(0, 32, -4F, -8F, 4F, 8F, 1F, 1F, 0F, 0F, 0F, true, 64F, 64F) }; - hatband2 = new ModelPart(Arrays.asList(hatband2Cuboids), Collections.emptyMap()); - hatband2.setPivot(0F, 0F, 0F); - setRotation(hatband2, 0F, 0F, 0F); + hatBand2 = new ModelPart(Arrays.asList(hatBand2Cuboids), Collections.emptyMap()); + hatBand2.setPivot(0F, 0F, 0F); + setRotation(hatBand2, 0F, 0F, 0F); - ModelPart.Cuboid[] hatband3Cuboids = { + ModelPart.Cuboid[] hatBand3Cuboids = { new ModelPart.Cuboid(0, 34, -5F, -8F, -4F, 1F, 1F, 8F, 0F, 0F, 0F, true, 64F, 64F) }; - hatband3 = new ModelPart(Arrays.asList(hatband3Cuboids), Collections.emptyMap()); - hatband3.setPivot(0F, 0F, 0F); - setRotation(hatband3, 0F, 0F, 0F); + hatBand3 = new ModelPart(Arrays.asList(hatBand3Cuboids), Collections.emptyMap()); + hatBand3.setPivot(0F, 0F, 0F); + setRotation(hatBand3, 0F, 0F, 0F); - ModelPart.Cuboid[] hatband4Cuboids = { + ModelPart.Cuboid[] hatBand4Cuboids = { new ModelPart.Cuboid(0, 34, 4F, -8F, -4F, 1F, 1F, 8F, 0F, 0F, 0F, true, 64F, 64F) }; - hatband4 = new ModelPart(Arrays.asList(hatband4Cuboids), Collections.emptyMap()); - hatband4.setPivot(0F, 0F, 0F); - setRotation(hatband4, 0F, 0F, 0F); + hatBand4 = new ModelPart(Arrays.asList(hatBand4Cuboids), Collections.emptyMap()); + hatBand4.setPivot(0F, 0F, 0F); + setRotation(hatBand4, 0F, 0F, 0F); - ModelPart.Cuboid[] hatbase1Cuboids = { + ModelPart.Cuboid[] hatBase1Cuboids = { new ModelPart.Cuboid(0, 43, -4F, -9F, -4F, 8F, 1F, 8F, 0F, 0F, 0F, true, 64F, 64F) }; - hatbase1 = new ModelPart(Arrays.asList(hatbase1Cuboids), Collections.emptyMap()); - hatbase1.setPivot(0F, 0F, 0F); - setRotation(hatbase1, 0F, 0F, 0F); + hatBase1 = new ModelPart(Arrays.asList(hatBase1Cuboids), Collections.emptyMap()); + hatBase1.setPivot(0F, 0F, 0F); + setRotation(hatBase1, 0F, 0F, 0F); - ModelPart.Cuboid[] hatband5Cuboids = { + ModelPart.Cuboid[] hatBand5Cuboids = { new ModelPart.Cuboid(18, 41, 0F, -7F, -5F, 4F, 1F, 1F, 0F, 0F, 0F, true, 64F, 64F) }; - hatband5 = new ModelPart(Arrays.asList(hatband5Cuboids), Collections.emptyMap()); - hatband5.setPivot(0F, 0F, 0F); - setRotation(hatband5, 0F, 0F, 0F); + hatBand5 = new ModelPart(Arrays.asList(hatBand5Cuboids), Collections.emptyMap()); + hatBand5.setPivot(0F, 0F, 0F); + setRotation(hatBand5, 0F, 0F, 0F); - ModelPart.Cuboid[] hatband6Cuboids = { + ModelPart.Cuboid[] hatBand6Cuboids = { new ModelPart.Cuboid(18, 41, -4F, -7F, 0F, 4F, 1F, 1F, 0F, 0F, 0F, true, 64F, 64F) }; - hatband6 = new ModelPart(Arrays.asList(hatband6Cuboids), Collections.emptyMap()); - hatband6.setPivot(0F, 0F, 4F); - setRotation(hatband6, 0F, 0F, 0F); + hatBand6 = new ModelPart(Arrays.asList(hatBand6Cuboids), Collections.emptyMap()); + hatBand6.setPivot(0F, 0F, 4F); + setRotation(hatBand6, 0F, 0F, 0F); - ModelPart.Cuboid[] hatbase2Cuboids = { + ModelPart.Cuboid[] hatBase2Cuboids = { new ModelPart.Cuboid(18, 34, -3F, -10F, -3F, 6F, 1F, 6F, 0F, 0F, 0F, true, 64F, 64F) }; - hatbase2 = new ModelPart(Arrays.asList(hatbase2Cuboids), Collections.emptyMap()); - hatbase2.setPivot(0F, 0F, 0F); - setRotation(hatbase2, 0F, 0.1115358F, 0F); + hatBase2 = new ModelPart(Arrays.asList(hatBase2Cuboids), Collections.emptyMap()); + hatBase2.setPivot(0F, 0F, 0F); + setRotation(hatBase2, 0F, 0.1115358F, 0F); - ModelPart.Cuboid[] hatextension1Cuboids = { + ModelPart.Cuboid[] hatExtension1Cuboids = { new ModelPart.Cuboid(0, 52, -3F, -11F, -2F, 4F, 2F, 4F, 0F, 0F, 0F, true, 64F, 64F) }; - hatextension1 = new ModelPart(Arrays.asList(hatextension1Cuboids), Collections.emptyMap()); - hatextension1.setPivot(0F, 0F, 0F); - setRotation(hatextension1, 0F, -0.0371786F, 0.0743572F); + hatExtension1 = new ModelPart(Arrays.asList(hatExtension1Cuboids), Collections.emptyMap()); + hatExtension1.setPivot(0F, 0F, 0F); + setRotation(hatExtension1, 0F, -0.0371786F, 0.0743572F); - ModelPart.Cuboid[] hatextension2Cuboids = { + ModelPart.Cuboid[] hatExtension2Cuboids = { new ModelPart.Cuboid(16, 52, -2.4F, -12F, -1.5F, 3F, 2F, 3F, 0F, 0F, 0F, true, 64F, 64F) }; - hatextension2 = new ModelPart(Arrays.asList(hatextension2Cuboids), Collections.emptyMap()); - hatextension2.setPivot(0F, 0F, 0F); - setRotation(hatextension2, 0F, 0.0743572F, 0.0743572F); + hatExtension2 = new ModelPart(Arrays.asList(hatExtension2Cuboids), Collections.emptyMap()); + hatExtension2.setPivot(0F, 0F, 0F); + setRotation(hatExtension2, 0F, 0.0743572F, 0.0743572F); - ModelPart.Cuboid[] hatextension3Cuboids = { + ModelPart.Cuboid[] hatExtension3Cuboids = { new ModelPart.Cuboid(28, 52, -3.5F, -13F, -1F, 2F, 2F, 2F, 0F, 0F, 0F, true, 64F, 64F) }; - hatextension3 = new ModelPart(Arrays.asList(hatextension3Cuboids), Collections.emptyMap()); - hatextension3.setPivot(0F, 0F, 0F); - setRotation(hatextension3, 0F, 0F, 0.2230717F); + hatExtension3 = new ModelPart(Arrays.asList(hatExtension3Cuboids), Collections.emptyMap()); + hatExtension3.setPivot(0F, 0F, 0F); + setRotation(hatExtension3, 0F, 0F, 0.2230717F); - ModelPart.Cuboid[] hatextension4Cuboids = { + ModelPart.Cuboid[] hatExtension4Cuboids = { new ModelPart.Cuboid(0, 58, -13F, -6.6F, -1F, 2F, 3F, 2F, 0F, 0F, 0F, true, 64F, 64F) }; - hatextension4 = new ModelPart(Arrays.asList(hatextension4Cuboids), Collections.emptyMap()); - hatextension4.setPivot(0F, 0F, 0F); - setRotation(hatextension4, 0F, 0F, 1.264073F); + hatExtension4 = new ModelPart(Arrays.asList(hatExtension4Cuboids), Collections.emptyMap()); + hatExtension4.setPivot(0F, 0F, 0F); + setRotation(hatExtension4, 0F, 0F, 1.264073F); - ModelPart.Cuboid[] hatball1Cuboids = { + ModelPart.Cuboid[] hatBall1Cuboids = { new ModelPart.Cuboid(8, 58, 2F, -14.4F, -1.001F, 2F, 2F, 2F, 0F, 0F, 0F, true, 64F, 64F) }; - hatball1 = new ModelPart(Arrays.asList(hatball1Cuboids), Collections.emptyMap()); - hatball1.setPivot(0F, 0F, 0F); - setRotation(hatball1, 0F, 0F, 0F); + hatBall1 = new ModelPart(Arrays.asList(hatBall1Cuboids), Collections.emptyMap()); + hatBall1.setPivot(0F, 0F, 0F); + setRotation(hatBall1, 0F, 0F, 0F); - ModelPart.Cuboid[] hatball2Cuboids = { + ModelPart.Cuboid[] hatBall2Cuboids = { new ModelPart.Cuboid(16, 57, 2.5F, -14.8F, -0.5F, 1F, 1F, 1F, 0F, 0F, 0F, true, 64F, 64F) }; - hatball2 = new ModelPart(Arrays.asList(hatball2Cuboids), Collections.emptyMap()); - hatball2.setPivot(0F, 0F, 0F); - setRotation(hatball2, 0F, 0F, 0F); + hatBall2 = new ModelPart(Arrays.asList(hatBall2Cuboids), Collections.emptyMap()); + hatBall2.setPivot(0F, 0F, 0F); + setRotation(hatBall2, 0F, 0F, 0F); - ModelPart.Cuboid[] hatball3Cuboids = { + ModelPart.Cuboid[] hatBall3Cuboids = { new ModelPart.Cuboid(16, 57, 2.5F, -13F, -0.5F, 1F, 1F, 1F, 0F, 0F, 0F, true, 64F, 64F) }; - hatball3 = new ModelPart(Arrays.asList(hatball3Cuboids), Collections.emptyMap()); - hatball3.setPivot(0F, 0F, 0F); - setRotation(hatball3, 0F, 0F, 0F); + hatBall3 = new ModelPart(Arrays.asList(hatBall3Cuboids), Collections.emptyMap()); + hatBall3.setPivot(0F, 0F, 0F); + setRotation(hatBall3, 0F, 0F, 0F); - ModelPart.Cuboid[] hatball4Cuboids = { + ModelPart.Cuboid[] hatBall4Cuboids = { new ModelPart.Cuboid(16, 57, 3.4F, -14F, -0.5F, 1F, 1F, 1F, 0F, 0F, 0F, true, 64F, 64F) }; - hatball4 = new ModelPart(Arrays.asList(hatball4Cuboids), Collections.emptyMap()); - hatball4.setPivot(0F, 0F, 0F); - setRotation(hatball4, 0F, 0F, 0F); + hatBall4 = new ModelPart(Arrays.asList(hatBall4Cuboids), Collections.emptyMap()); + hatBall4.setPivot(0F, 0F, 0F); + setRotation(hatBall4, 0F, 0F, 0F); - ModelPart.Cuboid[] hatball5Cuboids = { + ModelPart.Cuboid[] hatBall5Cuboids = { new ModelPart.Cuboid(16, 57, 2.5F, -14F, 0.4F, 1F, 1F, 1F, 0F, 0F, 0F, true, 64F, 64F) }; - hatball5 = new ModelPart(Arrays.asList(hatball5Cuboids), Collections.emptyMap()); - hatball5.setPivot(0F, 0F, 0F); - setRotation(hatball5, 0F, 0F, 0F); + hatBall5 = new ModelPart(Arrays.asList(hatBall5Cuboids), Collections.emptyMap()); + hatBall5.setPivot(0F, 0F, 0F); + setRotation(hatBall5, 0F, 0F, 0F); - ModelPart.Cuboid[] hatball6Cuboids = { + ModelPart.Cuboid[] hatBall6Cuboids = { new ModelPart.Cuboid(16, 57, 2.5F, -14F, -1.4F, 1F, 1F, 1F, 0F, 0F, 0F, true, 64F, 64F) }; - hatball6 = new ModelPart(Arrays.asList(hatball6Cuboids), Collections.emptyMap()); - hatball6.setPivot(0F, 0F, 0F); - setRotation(hatball6, 0F, 0F, 0F); + hatBall6 = new ModelPart(Arrays.asList(hatBall6Cuboids), Collections.emptyMap()); + hatBall6.setPivot(0F, 0F, 0F); + setRotation(hatBall6, 0F, 0F, 0F); } @Override @@ -194,24 +194,24 @@ public class ModelSantaHat extends EntityModel { @Override public void render(MatrixStack matrixStack, VertexConsumer vertexConsumer, int light, int overlay, float r, float g, float b, float f) { - hatband1.render(matrixStack, vertexConsumer, light, overlay); - hatband2.render(matrixStack, vertexConsumer, light, overlay); - hatband3.render(matrixStack, vertexConsumer, light, overlay); - hatband4.render(matrixStack, vertexConsumer, light, overlay); - hatbase1.render(matrixStack, vertexConsumer, light, overlay); - hatband5.render(matrixStack, vertexConsumer, light, overlay); - hatband6.render(matrixStack, vertexConsumer, light, overlay); - hatbase2.render(matrixStack, vertexConsumer, light, overlay); - hatextension1.render(matrixStack, vertexConsumer, light, overlay); - hatextension2.render(matrixStack, vertexConsumer, light, overlay); - hatextension3.render(matrixStack, vertexConsumer, light, overlay); - hatextension4.render(matrixStack, vertexConsumer, light, overlay); - hatball1.render(matrixStack, vertexConsumer, light, overlay); - hatball2.render(matrixStack, vertexConsumer, light, overlay); - hatball3.render(matrixStack, vertexConsumer, light, overlay); - hatball4.render(matrixStack, vertexConsumer, light, overlay); - hatball5.render(matrixStack, vertexConsumer, light, overlay); - hatball6.render(matrixStack, vertexConsumer, light, overlay); + hatBand1.render(matrixStack, vertexConsumer, light, overlay); + hatBand2.render(matrixStack, vertexConsumer, light, overlay); + hatBand3.render(matrixStack, vertexConsumer, light, overlay); + hatBand4.render(matrixStack, vertexConsumer, light, overlay); + hatBase1.render(matrixStack, vertexConsumer, light, overlay); + hatBand5.render(matrixStack, vertexConsumer, light, overlay); + hatBand6.render(matrixStack, vertexConsumer, light, overlay); + hatBase2.render(matrixStack, vertexConsumer, light, overlay); + hatExtension1.render(matrixStack, vertexConsumer, light, overlay); + hatExtension2.render(matrixStack, vertexConsumer, light, overlay); + hatExtension3.render(matrixStack, vertexConsumer, light, overlay); + hatExtension4.render(matrixStack, vertexConsumer, light, overlay); + hatBall1.render(matrixStack, vertexConsumer, light, overlay); + hatBall2.render(matrixStack, vertexConsumer, light, overlay); + hatBall3.render(matrixStack, vertexConsumer, light, overlay); + hatBall4.render(matrixStack, vertexConsumer, light, overlay); + hatBall5.render(matrixStack, vertexConsumer, light, overlay); + hatBall6.render(matrixStack, vertexConsumer, light, overlay); } private void setRotation(ModelPart model, float x, float y, float z) { diff --git a/RebornCore/src/main/java/reborncore/client/gui/GuiButtonCustomTexture.java b/RebornCore/src/main/java/reborncore/client/gui/GuiButtonCustomTexture.java index 94308faee..80051b08f 100644 --- a/RebornCore/src/main/java/reborncore/client/gui/GuiButtonCustomTexture.java +++ b/RebornCore/src/main/java/reborncore/client/gui/GuiButtonCustomTexture.java @@ -37,10 +37,10 @@ import reborncore.common.util.Color; public class GuiButtonCustomTexture extends ButtonWidget { public int textureU; public int textureV; - public String texturename; + public String textureName; public String linkedPage; public Text name; - public String imageprefix = "techreborn:textures/manual/elements/"; + public String imagePrefix = "techreborn:textures/manual/elements/"; public int buttonHeight; public int buttonWidth; public int buttonU; @@ -49,11 +49,11 @@ public class GuiButtonCustomTexture extends ButtonWidget { public int textureW; public GuiButtonCustomTexture(int xPos, int yPos, int u, int v, int buttonWidth, int buttonHeight, - String texturename, String linkedPage, Text name, int buttonU, int buttonV, int textureH, int textureW, ButtonWidget.PressAction pressAction) { + String textureName, String linkedPage, Text name, int buttonU, int buttonV, int textureH, int textureW, ButtonWidget.PressAction pressAction) { super(xPos, yPos, buttonWidth, buttonHeight, LiteralText.EMPTY, pressAction); this.textureU = u; this.textureV = v; - this.texturename = texturename; + this.textureName = textureName; this.name = name; this.linkedPage = linkedPage; this.buttonHeight = height; @@ -87,7 +87,7 @@ public class GuiButtonCustomTexture extends ButtonWidget { } public void renderImage(MatrixStack matrixStack, int offsetX, int offsetY) { - RenderSystem.setShaderTexture(0, new Identifier(imageprefix + this.texturename + ".png")); + RenderSystem.setShaderTexture(0, new Identifier(imagePrefix + this.textureName + ".png")); RenderSystem.enableBlend(); RenderSystem.blendFunc(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE_MINUS_SRC_ALPHA); diff --git a/RebornCore/src/main/java/reborncore/client/gui/builder/GuiBase.java b/RebornCore/src/main/java/reborncore/client/gui/builder/GuiBase.java index f1ef1fb55..33b5d8402 100644 --- a/RebornCore/src/main/java/reborncore/client/gui/builder/GuiBase.java +++ b/RebornCore/src/main/java/reborncore/client/gui/builder/GuiBase.java @@ -389,13 +389,13 @@ public class GuiBase extends HandledScreen { } /** - * @param rectX int Top left corner of region - * @param rectY int Top left corner of region - * @param rectWidth int Width of region - * @param rectHeight int Height of region - * @param pointX int Mouse pointer - * @param pointY int Mouse pointer - * @return boolean Returns true if mouse pointer is in region specified + * @param rectX {@code int} Top left corner of region + * @param rectY {@code int} Top left corner of region + * @param rectWidth {@code int} Width of region + * @param rectHeight {@code int} Height of region + * @param pointX {@code int} Mouse pointer + * @param pointY {@code int} Mouse pointer + * @return {@code boolean} Returns true if mouse pointer is in region specified */ public boolean isPointInRect(int rectX, int rectY, int rectWidth, int rectHeight, double pointX, double pointY) { return super.isPointWithinBounds(rectX, rectY, rectWidth, rectHeight, pointX, pointY); @@ -422,7 +422,7 @@ public class GuiBase extends HandledScreen { } public MinecraftClient getMinecraft() { - // Just to stop complains from IDEA + // Just to stop complaints from IDEA if (client == null) { throw new NullPointerException("Minecraft client is null."); } @@ -454,7 +454,7 @@ public class GuiBase extends HandledScreen { @Override protected boolean isClickOutsideBounds(double mouseX, double mouseY, int left, int top, int mouseButton) { - // Upgrades are normally outside of the bounds, so let's pretend we are within the bounds if there is a slot here. + // Upgrades are normally outside the bounds, so let's pretend we are within the bounds if there is a slot here. return getSlotAt(mouseX, mouseY) == null && super.isClickOutsideBounds(mouseX, mouseY, left, top, mouseButton); } diff --git a/RebornCore/src/main/java/reborncore/client/gui/builder/slot/SlotConfigGui.java b/RebornCore/src/main/java/reborncore/client/gui/builder/slot/SlotConfigGui.java index 4b1060a6c..18667c951 100644 --- a/RebornCore/src/main/java/reborncore/client/gui/builder/slot/SlotConfigGui.java +++ b/RebornCore/src/main/java/reborncore/client/gui/builder/slot/SlotConfigGui.java @@ -109,7 +109,7 @@ public class SlotConfigGui { } String json = machine.getSlotConfiguration().toJson(machine.getClass().getCanonicalName()); MinecraftClient.getInstance().keyboard.setClipboard(json); - MinecraftClient.getInstance().player.sendSystemMessage(new LiteralText("Slot configuration copyied to clipboard"), Util.NIL_UUID); + MinecraftClient.getInstance().player.sendSystemMessage(new LiteralText("Slot configuration copied to clipboard"), Util.NIL_UUID); } public static void pasteFromClipboard() { diff --git a/RebornCore/src/main/java/reborncore/client/gui/builder/slot/elements/FluidConfigPopupElement.java b/RebornCore/src/main/java/reborncore/client/gui/builder/slot/elements/FluidConfigPopupElement.java index fdc9c2605..327e71d89 100644 --- a/RebornCore/src/main/java/reborncore/client/gui/builder/slot/elements/FluidConfigPopupElement.java +++ b/RebornCore/src/main/java/reborncore/client/gui/builder/slot/elements/FluidConfigPopupElement.java @@ -55,7 +55,7 @@ public class FluidConfigPopupElement extends ElementBase { public boolean filter = false; ConfigFluidElement fluidElement; - double lastMousex, lastMousey; + double lastMouseX, lastMouseY; public FluidConfigPopupElement(int x, int y, ConfigFluidElement fluidElement) { super(x, y, Sprite.SLOT_CONFIG_POPUP); @@ -93,24 +93,24 @@ public class FluidConfigPopupElement extends ElementBase { @Override public boolean onRelease(MachineBaseBlockEntity provider, GuiBase gui, double mouseX, double mouseY) { if (isInBox(23, 4, 16, 16, mouseX, mouseY, gui)) { - cyleConfig(MachineFacing.UP.getFacing(provider), gui); + cycleConfig(MachineFacing.UP.getFacing(provider), gui); } else if (isInBox(23, 23, 16, 16, mouseX, mouseY, gui)) { - cyleConfig(MachineFacing.FRONT.getFacing(provider), gui); + cycleConfig(MachineFacing.FRONT.getFacing(provider), gui); } else if (isInBox(42, 23, 16, 16, mouseX, mouseY, gui)) { - cyleConfig(MachineFacing.RIGHT.getFacing(provider), gui); + cycleConfig(MachineFacing.RIGHT.getFacing(provider), gui); } else if (isInBox(4, 23, 16, 16, mouseX, mouseY, gui)) { - cyleConfig(MachineFacing.LEFT.getFacing(provider), gui); + cycleConfig(MachineFacing.LEFT.getFacing(provider), gui); } else if (isInBox(23, 42, 16, 16, mouseX, mouseY, gui)) { - cyleConfig(MachineFacing.DOWN.getFacing(provider), gui); + cycleConfig(MachineFacing.DOWN.getFacing(provider), gui); } else if (isInBox(42, 42, 16, 16, mouseX, mouseY, gui)) { - cyleConfig(MachineFacing.BACK.getFacing(provider), gui); + cycleConfig(MachineFacing.BACK.getFacing(provider), gui); } else { return false; } return true; } - public void cyleConfig(Direction side, GuiBase guiBase) { + public void cycleConfig(Direction side, GuiBase guiBase) { FluidConfiguration.FluidConfig config = guiBase.getMachine().fluidConfiguration.getSideDetail(side); FluidConfiguration.ExtractConfig fluidIO = config.getIoConfig().getNext(); @@ -137,8 +137,8 @@ public class FluidConfigPopupElement extends ElementBase { @Override public boolean onHover(MachineBaseBlockEntity provider, GuiBase gui, double mouseX, double mouseY) { - lastMousex = mouseX; - lastMousey = mouseY; + lastMouseX = mouseX; + lastMouseY = mouseY; return super.onHover(provider, gui, mouseX, mouseY); } @@ -148,7 +148,7 @@ public class FluidConfigPopupElement extends ElementBase { int sy = iny + getY() + gui.getGuiTop(); FluidConfiguration fluidConfiguration = machineBase.fluidConfiguration; if (fluidConfiguration == null) { - RebornCore.LOGGER.debug("Humm, this isnt suppoed to happen"); + RebornCore.LOGGER.debug("Hmm, this isn't supposed to happen"); return; } FluidConfiguration.FluidConfig fluidConfig = fluidConfiguration.getSideDetail(side); @@ -197,4 +197,4 @@ public class FluidConfigPopupElement extends ElementBase { matrixStack.pop(); } -} \ No newline at end of file +} diff --git a/RebornCore/src/main/java/reborncore/client/gui/builder/slot/elements/SlotConfigPopupElement.java b/RebornCore/src/main/java/reborncore/client/gui/builder/slot/elements/SlotConfigPopupElement.java index a4187c637..1d7956d74 100644 --- a/RebornCore/src/main/java/reborncore/client/gui/builder/slot/elements/SlotConfigPopupElement.java +++ b/RebornCore/src/main/java/reborncore/client/gui/builder/slot/elements/SlotConfigPopupElement.java @@ -97,27 +97,27 @@ public class SlotConfigPopupElement extends ElementBase { @Override public boolean onRelease(MachineBaseBlockEntity provider, GuiBase gui, double mouseX, double mouseY) { if (isInBox(23, 4, 16, 16, mouseX, mouseY, gui)) { - cyleSlotConfig(MachineFacing.UP.getFacing(provider), gui); + cycleSlotConfig(MachineFacing.UP.getFacing(provider), gui); } else if (isInBox(23, 23, 16, 16, mouseX, mouseY, gui)) { - cyleSlotConfig(MachineFacing.FRONT.getFacing(provider), gui); + cycleSlotConfig(MachineFacing.FRONT.getFacing(provider), gui); } else if (isInBox(42, 23, 16, 16, mouseX, mouseY, gui)) { - cyleSlotConfig(MachineFacing.RIGHT.getFacing(provider), gui); + cycleSlotConfig(MachineFacing.RIGHT.getFacing(provider), gui); } else if (isInBox(4, 23, 16, 16, mouseX, mouseY, gui)) { - cyleSlotConfig(MachineFacing.LEFT.getFacing(provider), gui); + cycleSlotConfig(MachineFacing.LEFT.getFacing(provider), gui); } else if (isInBox(23, 42, 16, 16, mouseX, mouseY, gui)) { - cyleSlotConfig(MachineFacing.DOWN.getFacing(provider), gui); + cycleSlotConfig(MachineFacing.DOWN.getFacing(provider), gui); } else if (isInBox(42, 42, 16, 16, mouseX, mouseY, gui)) { - cyleSlotConfig(MachineFacing.BACK.getFacing(provider), gui); + cycleSlotConfig(MachineFacing.BACK.getFacing(provider), gui); } else { return false; } return true; } - public void cyleSlotConfig(Direction side, GuiBase guiBase) { + public void cycleSlotConfig(Direction side, GuiBase guiBase) { SlotConfiguration.SlotConfig currentSlot = guiBase.getMachine().getSlotConfiguration().getSlotDetails(id).getSideDetail(side); - //Bit of a mess, in the future have a way to remove config options from this list + // A bit of a mess, in the future have a way to remove config options from this list SlotConfiguration.ExtractConfig nextConfig = currentSlot.getSlotIO().getIoConfig().getNext(); if (!allowInput && nextConfig == SlotConfiguration.ExtractConfig.INPUT) { nextConfig = SlotConfiguration.ExtractConfig.OUTPUT; @@ -154,7 +154,7 @@ public class SlotConfigPopupElement extends ElementBase { int sy = iny + getY() + gui.getGuiTop(); SlotConfiguration.SlotConfigHolder slotConfigHolder = machineBase.getSlotConfiguration().getSlotDetails(slotID); if (slotConfigHolder == null) { - RebornCore.LOGGER.debug("Humm, this isnt suppoed to happen"); + RebornCore.LOGGER.debug("Hmm, this isn't supposed to happen"); return; } SlotConfiguration.SlotConfig slotConfig = slotConfigHolder.getSideDetail(side); @@ -206,4 +206,4 @@ public class SlotConfigPopupElement extends ElementBase { public void drawState(GuiBase gui, World world, BakedModel model, BlockState actualState, BlockPos pos, BlockRenderManager dispatcher, int x, int y) { drawState(gui, world, model, actualState, pos, dispatcher, x, y, null); } -} \ No newline at end of file +} diff --git a/RebornCore/src/main/java/reborncore/client/gui/componets/GuiHiddenButton.java b/RebornCore/src/main/java/reborncore/client/gui/componets/GuiHiddenButton.java index 8f3cf61ac..f1e2f962e 100644 --- a/RebornCore/src/main/java/reborncore/client/gui/componets/GuiHiddenButton.java +++ b/RebornCore/src/main/java/reborncore/client/gui/componets/GuiHiddenButton.java @@ -47,7 +47,7 @@ public class GuiHiddenButton extends ButtonWidget { @Override public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) { if (this.visible) { - TextRenderer fontrenderer = MinecraftClient.getInstance().textRenderer; + TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer; RenderSystem.setShaderTexture(0, WIDGETS_TEXTURE); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); this.hovered = mouseX >= this.x && mouseY >= this.y @@ -63,7 +63,7 @@ public class GuiHiddenButton extends ButtonWidget { l = 16777120; } - this.drawTextWithShadow(matrixStack, fontrenderer, this.getMessage(), this.x + this.width / 2, + this.drawTextWithShadow(matrixStack, textRenderer, this.getMessage(), this.x + this.width / 2, this.y + (this.height - 8) / 2, l); } } diff --git a/RebornCore/src/main/java/reborncore/client/gui/guibuilder/GuiBuilder.java b/RebornCore/src/main/java/reborncore/client/gui/guibuilder/GuiBuilder.java index a4a53e92b..ecf976d43 100644 --- a/RebornCore/src/main/java/reborncore/client/gui/guibuilder/GuiBuilder.java +++ b/RebornCore/src/main/java/reborncore/client/gui/guibuilder/GuiBuilder.java @@ -136,10 +136,10 @@ public class GuiBuilder { /** * Draws button with JEI icon in the given coords. * - * @param gui GuiBase GUI to draw on - * @param x int Top left corner where to place button - * @param y int Top left corner where to place button - * @param layer Layer Layer to draw on + * @param gui {@link GuiBase} The GUI to draw on + * @param x {@code int} Top left corner where to place button + * @param y {@code int} Top left corner where to place button + * @param layer {@link GuiBase.Layer} The layer to draw on */ public void drawJEIButton(MatrixStack matrixStack, GuiBase gui, int x, int y, GuiBase.Layer layer) { if (gui.hideGuiElements()) return; @@ -156,13 +156,13 @@ public class GuiBuilder { /** * Draws lock button in either locked or unlocked state * - * @param gui GuiBase GUI to draw on - * @param x int Top left corner where to place button - * @param y int Top left corner where to place button - * @param mouseX int Mouse cursor position to check for tooltip - * @param mouseY int Mouse cursor position to check for tooltip - * @param layer Layer Layer to draw on - * @param locked boolean Set to true if it is in locked state + * @param gui {@link GuiBase} The GUI to draw on + * @param x {@code int} Top left corner where to place button + * @param y {@code int} Top left corner where to place button + * @param mouseX {@code int} Mouse cursor position to check for tooltip + * @param mouseY {@code int} Mouse cursor position to check for tooltip + * @param layer {@link GuiBase.Layer} The layer to draw on + * @param locked {@code boolean} Set to true if it is in locked state */ public void drawLockButton(MatrixStack matrixStack, GuiBase gui, int x, int y, int mouseX, int mouseY, GuiBase.Layer layer, boolean locked) { if (gui.hideGuiElements()) return; @@ -188,12 +188,12 @@ public class GuiBuilder { /** * Draws hologram toggle button * - * @param gui GuiBase GUI to draw on - * @param x int Top left corner where to place button - * @param y int Top left corner where to place button - * @param mouseX int Mouse cursor position to check for tooltip - * @param mouseY int Mouse cursor position to check for tooltip - * @param layer Layer Layer to draw on + * @param gui {@link GuiBase} The GUI to draw on + * @param x {@code int} Top left corner where to place button + * @param y {@code int} Top left corner where to place button + * @param mouseX {@code int} Mouse cursor position to check for tooltip + * @param mouseY {@code int} Mouse cursor position to check for tooltip + * @param layer {@link GuiBase.Layer} The layer to draw on */ public void drawHologramButton(MatrixStack matrixStack, GuiBase gui, int x, int y, int mouseX, int mouseY, GuiBase.Layer layer) { if (gui.isTabOpen()) return; @@ -223,12 +223,12 @@ public class GuiBuilder { /** * Draws big horizontal bar for heat value * - * @param gui GuiBase GUI to draw on - * @param x int Top left corner where to place bar - * @param y int Top left corner where to place bar - * @param value int Current heat value - * @param max int Maximum heat value - * @param layer Layer Layer to draw on + * @param gui {@link GuiBase} The GUI to draw on + * @param x {@code int} Top left corner where to place bar + * @param y {@code int} Top left corner where to place bar + * @param value {@code int} Current heat value + * @param max {@code int} Maximum heat value + * @param layer {@link GuiBase.Layer} The layer to draw on */ public void drawBigHeatBar(MatrixStack matrixStack, GuiBase gui, int x, int y, int value, int max, GuiBase.Layer layer) { if (gui.hideGuiElements()) return; @@ -255,17 +255,17 @@ public class GuiBuilder { /** * Draws big horizontal blue bar * - * @param gui GuiBase GUI to draw on - * @param x int Top left corner where to place bar - * @param y int Top left corner where to place bar - * @param value int Current value - * @param max int Maximum value - * @param mouseX int Mouse cursor position to check for tooltip - * @param mouseY int Mouse cursor position to check for tooltip - * @param suffix String String to put on the bar and tooltip after percentage value - * @param line2 String String to put into tooltip as a second line - * @param format String Formatted value to put on the bar - * @param layer Layer Layer to draw on + * @param gui {@link GuiBase} The GUI to draw on + * @param x {@code int} Top left corner where to place bar + * @param y {@code int} Top left corner where to place bar + * @param value {@code int} Current value + * @param max {@code int} Maximum value + * @param mouseX {@code int} Mouse cursor position to check for tooltip + * @param mouseY {@code int} Mouse cursor position to check for tooltip + * @param suffix {@link String} String to put on the bar and tooltip after percentage value + * @param line2 {@link String} String to put into tooltip as a second line + * @param format {@link String} Formatted value to put on the bar + * @param layer {@link GuiBase.Layer} The layer to draw on */ public void drawBigBlueBar(MatrixStack matrixStack, GuiBase gui, int x, int y, int value, int max, int mouseX, int mouseY, String suffix, Text line2, String format, GuiBase.Layer layer) { if (gui.hideGuiElements()) return; @@ -343,8 +343,8 @@ public class GuiBuilder { /** * Shades GUI and draw gray bar on top of GUI * - * @param gui GuiBase GUI to draw on - * @param layer Layer Layer to draw on + * @param gui {@link GuiBase} The GUI to draw on + * @param layer {@link GuiBase.Layer} The layer to draw on */ public void drawMultiblockMissingBar(MatrixStack matrixStack, GuiBase gui, GuiBase.Layer layer) { if (gui.hideGuiElements()) return; @@ -369,9 +369,9 @@ public class GuiBuilder { * Draws upgrade slots on the left side of machine GUI. Draws on the background * level. * - * @param gui GuiBase GUI to draw on - * @param x int Top left corner where to place slots - * @param y int Top left corner where to place slots + * @param gui {@link GuiBase} The GUI to draw on + * @param x {@code int} Top left corner where to place slots + * @param y {@code int} Top left corner where to place slots */ public void drawUpgrades(MatrixStack matrixStack, GuiBase gui, int x, int y) { RenderSystem.setShaderTexture(0, resourceLocation); @@ -381,10 +381,10 @@ public class GuiBuilder { /** * Draws tab on the left side of machine GUI. Draws on the background level. * - * @param gui GuiBase GUI to draw on - * @param x int Top left corner where to place tab - * @param y int Top left corner where to place tab - * @param stack ItemStack Item to show as tab icon + * @param gui {@link GuiBase} The GUI to draw on + * @param x {@code int} Top left corner where to place tab + * @param y {@code int} Top left corner where to place tab + * @param stack {@link ItemStack} Item to show as tab icon */ public void drawSlotTab(MatrixStack matrixStack, GuiBase gui, int x, int y, ItemStack stack) { RenderSystem.setShaderTexture(0, resourceLocation); @@ -396,11 +396,11 @@ public class GuiBuilder { /** * Draws Slot Configuration tips instead of player inventory * - * @param gui GuiBase GUI to draw on - * @param x int Top left corner where to place tips list - * @param y int Top left corner where to place tips list - * @param mouseX int Mouse cursor position - * @param mouseY int Mouse cursor position + * @param gui {@link GuiBase} The GUI to draw on + * @param x {@code int} Top left corner where to place tips list + * @param y {@code int} Top left corner where to place tips list + * @param mouseX {@code int} Mouse cursor position + * @param mouseY {@code int} Mouse cursor position */ public void drawSlotConfigTips(MatrixStack matrixStack, GuiBase gui, int x, int y, int mouseX, int mouseY, GuiTab guiTab) { List tips = guiTab.getTips().stream() @@ -468,15 +468,16 @@ public class GuiBuilder { } } - //TODO: change to double + // TODO: change to double + /** * Draws energy output value and icon * - * @param gui GuiBase GUI to draw on - * @param x int Top left corner where to place energy output - * @param y int Top left corner where to place energy output - * @param maxOutput int Energy output value - * @param layer Layer Layer to draw on + * @param gui {@link GuiBase} The GUI to draw on + * @param x {@code int} Top left corner where to place energy output + * @param y {@code int} Top left corner where to place energy output + * @param maxOutput {@code int} Energy output value + * @param layer {@link GuiBase.Layer} The layer to draw on */ public void drawEnergyOutput(MatrixStack matrixStack, GuiBase gui, int x, int y, int maxOutput, GuiBase.Layer layer) { if (gui.hideGuiElements()) return; @@ -498,15 +499,15 @@ public class GuiBuilder { /** * Draws progress arrow in direction specified. * - * @param gui GuiBase GUI to draw on - * @param progress int Current progress - * @param maxProgress int Maximum progress - * @param x int Top left corner where to place progress arrow - * @param y int Top left corner where to place progress arrow - * @param mouseX int Mouse cursor position to check for tooltip - * @param mouseY int Mouse cursor position to check for tooltip - * @param direction ProgressDirection Direction of progress arrow - * @param layer Layer Layer to draw on + * @param gui {@link GuiBase} The GUI to draw on + * @param progress {@code int} Current progress + * @param maxProgress {@code int} Maximum progress + * @param x {@code int} Top left corner where to place progress arrow + * @param y {@code int} Top left corner where to place progress arrow + * @param mouseX {@code int} Mouse cursor position to check for tooltip + * @param mouseY {@code int} Mouse cursor position to check for tooltip + * @param direction {@link ProgressDirection} Direction of the progress arrow + * @param layer {@link GuiBase.Layer} The layer to draw on */ public void drawProgressBar(MatrixStack matrixStack, GuiBase gui, int progress, int maxProgress, int x, int y, int mouseX, int mouseY, ProgressDirection direction, GuiBase.Layer layer) { if (gui.hideGuiElements()) return; @@ -560,15 +561,15 @@ public class GuiBuilder { /** * Draws multi-energy bar * - * @param gui GuiBase GUI to draw on - * @param x int Top left corner where to place energy bar - * @param y int Top left corner where to place energy bar - * @param energyStored int Current amount of energy - * @param maxEnergyStored int Maximum amount of energy - * @param mouseX int Mouse cursor position to check for tooltip - * @param mouseY int Mouse cursor position to check for tooltip - * @param buttonID int Button ID used to switch energy systems - * @param layer Layer Layer to draw on + * @param gui {@link GuiBase} The GUI to draw on + * @param x {@code int} Top left corner where to place energy bar + * @param y {@code int} Top left corner where to place energy bar + * @param energyStored {@code int} Current amount of energy + * @param maxEnergyStored {@code int} Maximum amount of energy + * @param mouseX {@code int} Mouse cursor position to check for tooltip + * @param mouseY {@code int} Mouse cursor position to check for tooltip + * @param buttonID {@code int} Button ID used to switch energy systems + * @param layer {@link GuiBase.Layer} The layer to draw on */ public void drawMultiEnergyBar(MatrixStack matrixStack, GuiBase gui, int x, int y, int energyStored, int maxEnergyStored, int mouseX, int mouseY, int buttonID, GuiBase.Layer layer) { @@ -641,15 +642,15 @@ public class GuiBuilder { /** * Draws tank and fluid inside it * - * @param gui GuiBase GUI to draw on - * @param x int Top left corner of tank - * @param y int Top left corner of tank - * @param mouseX int Mouse cursor position to check for tooltip - * @param mouseY int Mouse cursor position to check for tooltip - * @param fluid FluidStack Fluid to draw in tank - * @param maxCapacity int Maximum tank capacity - * @param isTankEmpty boolean True if tank is empty - * @param layer Layer Layer to draw on + * @param gui {@link GuiBase} The GUI to draw on + * @param x {@code int} Top left corner of tank + * @param y {@code int} Top left corner of tank + * @param mouseX {@code int} Mouse cursor position to check for tooltip + * @param mouseY {@code int} Mouse cursor position to check for tooltip + * @param fluid {@link FluidInstance} to draw in tank + * @param maxCapacity {@code int} Maximum tank capacity + * @param isTankEmpty {@code boolean} True if tank is empty + * @param layer {@link GuiBase.Layer} The layer to draw on */ public void drawTank(MatrixStack matrixStack, GuiBase gui, int x, int y, int mouseX, int mouseY, FluidInstance fluid, FluidValue maxCapacity, boolean isTankEmpty, GuiBase.Layer layer) { if (gui.hideGuiElements()) return; @@ -704,13 +705,13 @@ public class GuiBuilder { /** * Draws fluid in tank * - * @param gui GuiBase GUI to draw on - * @param fluid FluidStack Fluid to draw - * @param x int Top left corner of fluid - * @param y int Top left corner of fluid - * @param width int Width of fluid to draw - * @param height int Height of fluid to draw - * @param maxCapacity int Maximum capacity of tank + * @param gui {@link GuiBase} The GUI to draw on + * @param fluid {@link FluidInstance} Fluid to draw + * @param x {@code int} Top left corner of fluid + * @param y {@code int} Top left corner of fluid + * @param width {@code int} Width of fluid to draw + * @param height {@code int} Height of fluid to draw + * @param maxCapacity {@code int} Maximum capacity of tank */ public void drawFluid(MatrixStack matrixStack, GuiBase gui, FluidInstance fluid, int x, int y, int width, int height, long maxCapacity) { if (fluid.getFluid() == Fluids.EMPTY) { @@ -746,14 +747,14 @@ public class GuiBuilder { /** * Draws burning progress, similar to vanilla furnace * - * @param gui GuiBase GUI to draw on - * @param progress int Current progress - * @param maxProgress int Maximum progress - * @param x int Top left corner where to place burn bar - * @param y int Top left corner where to place burn bar - * @param mouseX int Mouse cursor position to check for tooltip - * @param mouseY int Mouse cursor position to check for tooltip - * @param layer Layer Layer to draw on + * @param gui {@link GuiBase} The GUI to draw on + * @param progress {@code int} Current progress + * @param maxProgress {@code int} Maximum progress + * @param x {@code int} Top left corner where to place burn bar + * @param y {@code int} Top left corner where to place burn bar + * @param mouseX {@code int} Mouse cursor position to check for tooltip + * @param mouseY {@code int} Mouse cursor position to check for tooltip + * @param layer {@link GuiBase.Layer} The layer to draw on */ public void drawBurnBar(MatrixStack matrixStack, GuiBase gui, int progress, int maxProgress, int x, int y, int mouseX, int mouseY, GuiBase.Layer layer) { if (gui.hideGuiElements()) return; @@ -785,10 +786,10 @@ public class GuiBuilder { /** * Draws bar containing output slots * - * @param gui GuiBase GUI to draw on - * @param x int Top left corner where to place slots bar - * @param y int Top left corner where to place slots bar - * @param count int Number of output slots + * @param gui {@link GuiBase} The GUI to draw on + * @param x {@code int} Top left corner where to place slots bar + * @param y {@code int} Top left corner where to place slots bar + * @param count {@code int} Number of output slots */ public void drawOutputSlotBar(MatrixStack matrixStack, GuiBase gui, int x, int y, int count) { RenderSystem.setShaderTexture(0, resourceLocation); diff --git a/RebornCore/src/main/java/reborncore/client/gui/slots/SlotFake.java b/RebornCore/src/main/java/reborncore/client/gui/slots/SlotFake.java index 5e72e922b..5795c8ace 100644 --- a/RebornCore/src/main/java/reborncore/client/gui/slots/SlotFake.java +++ b/RebornCore/src/main/java/reborncore/client/gui/slots/SlotFake.java @@ -31,14 +31,14 @@ public class SlotFake extends BaseSlot { public boolean mCanInsertItem; public boolean mCanStackItem; - public int mMaxStacksize = 127; + public int mMaxStackSize = 127; public SlotFake(Inventory itemHandler, int par2, int par3, int par4, boolean aCanInsertItem, - boolean aCanStackItem, int aMaxStacksize) { + boolean aCanStackItem, int aMaxStackSize) { super(itemHandler, par2, par3, par4); this.mCanInsertItem = aCanInsertItem; this.mCanStackItem = aCanStackItem; - this.mMaxStacksize = aMaxStacksize; + this.mMaxStackSize = aMaxStackSize; } @Override @@ -48,7 +48,7 @@ public class SlotFake extends BaseSlot { @Override public int getMaxItemCount() { - return this.mMaxStacksize; + return this.mMaxStackSize; } @Override diff --git a/RebornCore/src/main/java/reborncore/client/multiblock/MultiblockComponent.java b/RebornCore/src/main/java/reborncore/client/multiblock/MultiblockComponent.java index 1ceed613f..5e5fec467 100644 --- a/RebornCore/src/main/java/reborncore/client/multiblock/MultiblockComponent.java +++ b/RebornCore/src/main/java/reborncore/client/multiblock/MultiblockComponent.java @@ -22,9 +22,9 @@ * SOFTWARE. */ -/** +/* * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: + * part of the Botania Mod. Get the Source Code in GitHub: * https://github.com/Vazkii/Botania *

* Botania is Open Source and distributed under the diff --git a/RebornCore/src/main/java/reborncore/client/screen/builder/BlockEntityScreenHandlerBuilder.java b/RebornCore/src/main/java/reborncore/client/screen/builder/BlockEntityScreenHandlerBuilder.java index e89b83091..5c0b58d33 100644 --- a/RebornCore/src/main/java/reborncore/client/screen/builder/BlockEntityScreenHandlerBuilder.java +++ b/RebornCore/src/main/java/reborncore/client/screen/builder/BlockEntityScreenHandlerBuilder.java @@ -130,17 +130,18 @@ public class BlockEntityScreenHandlerBuilder { private BlockEntityScreenHandlerBuilder upgradeSlots(IUpgradeable upgradeable) { if (upgradeable.canBeUpgraded()) { for (int i = 0; i < upgradeable.getUpgradeSlotCount(); i++) { - this.parent.slots.add(new UpgradeSlot(upgradeable.getUpgradeInvetory(), i, -18, i * 18 + 12)); + this.parent.slots.add(new UpgradeSlot(upgradeable.getUpgradeInventory(), i, -18, i * 18 + 12)); } } return this; } /** - * @param supplier The supplier it can supply a variable holding in an Object it - * will be synced with a custom packet - * @param setter The setter to call when the variable has been updated. - * @return ContainerTileInventoryBuilder Inventory which will do the sync + * @param The type of the block entity + * @param supplier {@link Supplier} The supplier it can supply a variable holding in an Object. + * it will be synced with a custom packet + * @param setter {@link Consumer} The setter to call when the variable has been updated. + * @return {@link BlockEntityScreenHandlerBuilder} Inventory which will do the sync */ public BlockEntityScreenHandlerBuilder sync(final Supplier supplier, final Consumer setter) { this.parent.objectValues.add(Pair.of(supplier, setter)); diff --git a/RebornCore/src/main/java/reborncore/client/screen/builder/BuiltScreenHandler.java b/RebornCore/src/main/java/reborncore/client/screen/builder/BuiltScreenHandler.java index 076d8e6aa..83206005d 100644 --- a/RebornCore/src/main/java/reborncore/client/screen/builder/BuiltScreenHandler.java +++ b/RebornCore/src/main/java/reborncore/client/screen/builder/BuiltScreenHandler.java @@ -37,8 +37,8 @@ import net.minecraft.screen.slot.Slot; import net.minecraft.util.math.BlockPos; import org.apache.commons.lang3.Range; import org.apache.commons.lang3.tuple.Pair; -import org.slf4j.LoggerFactory; import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.network.ClientBoundPackets; import reborncore.common.network.NetworkManager; @@ -62,7 +62,7 @@ public class BuiltScreenHandler extends ScreenHandler { private final List> playerSlotRanges; private final List> blockEntitySlotRanges; - // Holds the syncpair along with the last value + // Holds the SyncPair along with the last value private final Map syncPairCache = new HashMap<>(); private final Int2ObjectMap syncPairIdLookup = new Int2ObjectOpenHashMap<>(); @@ -257,7 +257,7 @@ public class BuiltScreenHandler extends ScreenHandler { } } - //If we moved some, but still have more left over lets try again + // If we moved some, but still have more left over lets try again if (!stackToShift.isEmpty() && stackToShift.getCount() != inCount) { shiftItemStack(stackToShift, start, end); } diff --git a/RebornCore/src/main/java/reborncore/client/screen/builder/PlayerScreenHandlerBuilder.java b/RebornCore/src/main/java/reborncore/client/screen/builder/PlayerScreenHandlerBuilder.java index 0147309cd..3fb42d806 100644 --- a/RebornCore/src/main/java/reborncore/client/screen/builder/PlayerScreenHandlerBuilder.java +++ b/RebornCore/src/main/java/reborncore/client/screen/builder/PlayerScreenHandlerBuilder.java @@ -86,7 +86,7 @@ public final class PlayerScreenHandlerBuilder { this.parent.addPlayerInventoryRange(this.main); } if (this.armor != null) { - this.parent.addBlockEnityInventoryRange(this.armor); + this.parent.addBlockEntityInventoryRange(this.armor); } return this.parent; @@ -139,4 +139,4 @@ public final class PlayerScreenHandlerBuilder { return this.parent; } } -} \ No newline at end of file +} diff --git a/RebornCore/src/main/java/reborncore/client/screen/builder/ScreenHandlerBuilder.java b/RebornCore/src/main/java/reborncore/client/screen/builder/ScreenHandlerBuilder.java index b21663a82..5c2171dc4 100644 --- a/RebornCore/src/main/java/reborncore/client/screen/builder/ScreenHandlerBuilder.java +++ b/RebornCore/src/main/java/reborncore/client/screen/builder/ScreenHandlerBuilder.java @@ -76,7 +76,7 @@ public class ScreenHandlerBuilder { this.playerInventoryRanges.add(range); } - void addBlockEnityInventoryRange(final Range range) { + void addBlockEntityInventoryRange(final Range range) { this.blockEntityInventoryRanges.add(range); } diff --git a/RebornCore/src/main/java/reborncore/client/screen/builder/slot/FilteredSlot.java b/RebornCore/src/main/java/reborncore/client/screen/builder/slot/FilteredSlot.java index c7133af10..4ed15d5e4 100644 --- a/RebornCore/src/main/java/reborncore/client/screen/builder/slot/FilteredSlot.java +++ b/RebornCore/src/main/java/reborncore/client/screen/builder/slot/FilteredSlot.java @@ -28,7 +28,6 @@ import net.minecraft.inventory.Inventory; import net.minecraft.item.ItemStack; import reborncore.client.gui.slots.BaseSlot; -import java.util.function.BiPredicate; import java.util.function.Predicate; public class FilteredSlot extends BaseSlot { diff --git a/RebornCore/src/main/java/reborncore/client/screen/builder/slot/SpriteSlot.java b/RebornCore/src/main/java/reborncore/client/screen/builder/slot/SpriteSlot.java index 1ade6e48b..4c58ad3d1 100644 --- a/RebornCore/src/main/java/reborncore/client/screen/builder/slot/SpriteSlot.java +++ b/RebornCore/src/main/java/reborncore/client/screen/builder/slot/SpriteSlot.java @@ -35,12 +35,12 @@ import org.jetbrains.annotations.Nullable; public class SpriteSlot extends FilteredSlot { private final Identifier spriteName; - int stacksize; + int stackSize; - public SpriteSlot(final Inventory inventory, final int index, final int xPosition, final int yPosition, final Identifier sprite, final int stacksize) { + public SpriteSlot(final Inventory inventory, final int index, final int xPosition, final int yPosition, final Identifier sprite, final int stackSize) { super(inventory, index, xPosition, yPosition); this.spriteName = sprite; - this.stacksize = stacksize; + this.stackSize = stackSize; } public SpriteSlot(final Inventory inventory, final int index, final int xPosition, final int yPosition, final Identifier sprite) { @@ -49,7 +49,7 @@ public class SpriteSlot extends FilteredSlot { @Override public int getMaxItemCount() { - return this.stacksize; + return this.stackSize; } @Override diff --git a/RebornCore/src/main/java/reborncore/common/blockentity/FluidConfiguration.java b/RebornCore/src/main/java/reborncore/common/blockentity/FluidConfiguration.java index 94946ed6c..d61a58a0e 100644 --- a/RebornCore/src/main/java/reborncore/common/blockentity/FluidConfiguration.java +++ b/RebornCore/src/main/java/reborncore/common/blockentity/FluidConfiguration.java @@ -89,7 +89,7 @@ public class FluidConfiguration implements NBTSerializable { if (autoInput() && fluidConfig.getIoConfig().isInsert()) { StorageUtil.move(tank, machineBase.getTank(), fv -> true, machineBase.fluidTransferAmount().getRawValue(), null); } - if (autoOutput() && fluidConfig.getIoConfig().isExtact()) { + if (autoOutput() && fluidConfig.getIoConfig().isExtract()) { StorageUtil.move(machineBase.getTank(), tank, fv -> true, machineBase.fluidTransferAmount().getRawValue(), null); } } @@ -187,16 +187,16 @@ public class FluidConfiguration implements NBTSerializable { OUTPUT(true, false), ALL(true, true); - boolean extact; + boolean extract; boolean insert; - ExtractConfig(boolean extact, boolean insert) { - this.extact = extact; + ExtractConfig(boolean extract, boolean insert) { + this.extract = extract; this.insert = insert; } - public boolean isExtact() { - return extact; + public boolean isExtract() { + return extract; } public boolean isInsert() { @@ -204,7 +204,7 @@ public class FluidConfiguration implements NBTSerializable { } public boolean isEnabled() { - return extact || insert; + return extract || insert; } public FluidConfiguration.ExtractConfig getNext() { diff --git a/RebornCore/src/main/java/reborncore/common/blockentity/MachineBaseBlockEntity.java b/RebornCore/src/main/java/reborncore/common/blockentity/MachineBaseBlockEntity.java index d94c19e30..72e72f7c5 100644 --- a/RebornCore/src/main/java/reborncore/common/blockentity/MachineBaseBlockEntity.java +++ b/RebornCore/src/main/java/reborncore/common/blockentity/MachineBaseBlockEntity.java @@ -75,19 +75,31 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi public boolean renderMultiblock = false; - private int ticktime = 0; + private int tickTime = 0; /** - * This is used to change the speed of the crafting operation. + *

+ * This is used to change the speed of the crafting operation. *

- * 0 = none; 0.2 = 20% speed increase 0.75 = 75% increase + * + *

    + *
  • 0 = Normal speed
  • + *
  • 0.2 = 20% increase
  • + *
  • 0.75 = 75% increase
  • + *
*/ double speedMultiplier = 0; /** - * This is used to change the power of the crafting operation. + *

+ * This is used to change the power of the crafting operation. *

- * 1 = none; 1.2 = 20% speed increase 1.75 = 75% increase 5 = uses 5 times - * more power + * + *

    + *
  • 1 = Normal power
  • + *
  • 1.2 = 20% increase
  • + *
  • 1.75 = 75% increase
  • + *
  • 5 = 500% increase
  • + *
*/ double powerMultiplier = 1; @@ -139,10 +151,10 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi @Override public void tick(World world, BlockPos pos, BlockState state, MachineBaseBlockEntity blockEntity) { - if (ticktime == 0) { + if (tickTime == 0) { onLoad(); } - ticktime++; + tickTime++; @Nullable RecipeCrafter crafter = null; if (getOptionalCrafter().isPresent()) { @@ -151,7 +163,7 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi if (canBeUpgraded()) { resetUpgrades(); for (int i = 0; i < getUpgradeSlotCount(); i++) { - ItemStack stack = getUpgradeInvetory().getStack(i); + ItemStack stack = getUpgradeInventory().getStack(i); if (!stack.isEmpty() && stack.getItem() instanceof IUpgrade) { ((IUpgrade) stack.getItem()).process(this, this, stack); } @@ -173,8 +185,8 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi } public void resetUpgrades() { - resetPowerMulti(); - resetSpeedMulti(); + resetPowerMultiplier(); + resetSpeedMultiplier(); } protected void afterUpgradesApplication() { @@ -289,10 +301,10 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi } return true; } - //Inventory end + // Inventory end @Override - public Inventory getUpgradeInvetory() { + public Inventory getUpgradeInventory() { return upgradeInventory; } @@ -306,7 +318,7 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi } @Override - public void resetSpeedMulti() { + public void resetSpeedMultiplier() { speedMultiplier = 0; } @@ -316,12 +328,12 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi } @Override - public void addPowerMulti(double amount) { + public void addPowerMultiplier(double amount) { powerMultiplier = powerMultiplier * (1f + amount); } @Override - public void resetPowerMulti() { + public void resetPowerMultiplier() { powerMultiplier = 1; } @@ -336,7 +348,7 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi } @Override - public void addSpeedMulti(double amount) { + public void addSpeedMultiplier(double amount) { if (speedMultiplier + amount <= 0.99) { speedMultiplier += amount; } else { @@ -357,12 +369,12 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi return getTank() != null; } - //The amount of ticks between a slot tranfer atempt, less is faster + //The amount of ticks between a slot transfer attempt, less is faster public int slotTransferSpeed() { return 4; } - //The amount of fluid transfured each tick buy the fluid config + //The amount of fluid transferred each tick buy the fluid config public FluidValue fluidTransferAmount() { return FluidValue.BUCKET_QUARTER; } @@ -459,7 +471,7 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi @Override public int[] getAvailableSlots(Direction side) { if(slotConfiguration == null){ - return new int[]{}; //I think should be ok, if needed this can return all the slots + return new int[]{}; // I think should be ok, if needed this can return all the slots } return slotConfiguration.getSlotsForSide(side).stream() .filter(Objects::nonNull) @@ -491,7 +503,7 @@ public class MachineBaseBlockEntity extends BlockEntity implements BlockEntityTi } SlotConfiguration.SlotConfigHolder slotConfigHolder = slotConfiguration.getSlotDetails(index); SlotConfiguration.SlotConfig slotConfig = slotConfigHolder.getSideDetail(direction); - return slotConfig.getSlotIO().ioConfig.isExtact(); + return slotConfig.getSlotIO().ioConfig.isExtract(); } public void onBreak(World world, PlayerEntity playerEntity, BlockPos blockPos, BlockState blockState){ diff --git a/RebornCore/src/main/java/reborncore/common/blockentity/MultiblockWriter.java b/RebornCore/src/main/java/reborncore/common/blockentity/MultiblockWriter.java index fee068b38..b3c9fbf8d 100644 --- a/RebornCore/src/main/java/reborncore/common/blockentity/MultiblockWriter.java +++ b/RebornCore/src/main/java/reborncore/common/blockentity/MultiblockWriter.java @@ -50,36 +50,36 @@ import java.util.function.BiPredicate; /** * Writes a multiblock for either verification or hologram rendering * + * @author ramidzkh * @see MultiblockVerifier * @see HologramRenderer - * @author ramidzkh */ public interface MultiblockWriter { /** * Adds a block to the multiblock * - * @param x X - * @param y Y - * @param z Z - * @param predicate Predicate of the position - * @param state The state for the hologram - * @return This. Useful for chaining + * @param x {@code int} X + * @param y {@code int} Y + * @param z {@code int} Z + * @param predicate {@link BiPredicate} Predicate of the position + * @param state {@link BlockState} The state for the hologram + * @return {@link MultiblockWriter} This. Useful for chaining */ MultiblockWriter add(int x, int y, int z, BiPredicate predicate, BlockState state); /** * Fills a section between (ax, ay, az) to (bx, by, bz) * - * @param ax X of the first point - * @param ay Y of the first point - * @param az Z of the first point - * @param bx X of the second point - * @param by X of the second point - * @param bz Z of the second point - * @param predicate Predicate of the position - * @param state The state for the hologram - * @return This. Useful for chaining + * @param ax {@code int} X of the first point + * @param ay {@code int} Y of the first point + * @param az {@code int} Z of the first point + * @param bx {@code int} X of the second point + * @param by {@code int} X of the second point + * @param bz {@code int} Z of the second point + * @param predicate {@link BiPredicate} Predicate of the position + * @param state {@link BlockState} The state for the hologram + * @return {@link MultiblockWriter} This. Useful for chaining */ default MultiblockWriter fill(int ax, int ay, int az, int bx, int by, int bz, BiPredicate predicate, BlockState state) { for (int x = ax; x < bx; x++) { @@ -97,15 +97,15 @@ public interface MultiblockWriter { * Fills the outer ring of (0, 0, 0) to (pX, pY, pZ) through the axis, using the predicate and * state. The inside of the ring uses holePredicate and holeHologramState * - * @param through The axis to go through - * @param pX Size on the X axis - * @param pY Size on the Y axis - * @param pZ Size on the Z axis - * @param predicate Predicate for the ring - * @param state The ring state for the hologram - * @param holePredicate Predicate for the hole - * @param holeHologramState The hole state for the hologram - * @return This. Useful for chaining + * @param through {@link Direction.Axis} The axis to go through + * @param pX {@code int} Size on the X axis + * @param pY {@code int} Size on the Y axis + * @param pZ {@code int} Size on the Z axis + * @param predicate {@link BiPredicate} Predicate for the ring + * @param state {@link BlockState} The state for the hologram + * @param holePredicate {@link BiPredicate} Predicate for the hole + * @param holeHologramState {@link BlockState} The hole state for the hologram + * @return {@link MultiblockWriter} This. Useful for chaining */ default MultiblockWriter ring(Direction.Axis through, int pX, int pY, int pZ, BiPredicate predicate, BlockState state, BiPredicate holePredicate, BlockState holeHologramState) { if (holePredicate == null) { diff --git a/RebornCore/src/main/java/reborncore/common/blockentity/RedstoneConfiguration.java b/RebornCore/src/main/java/reborncore/common/blockentity/RedstoneConfiguration.java index fdda3eaeb..4f234fc37 100644 --- a/RebornCore/src/main/java/reborncore/common/blockentity/RedstoneConfiguration.java +++ b/RebornCore/src/main/java/reborncore/common/blockentity/RedstoneConfiguration.java @@ -47,7 +47,7 @@ import java.util.stream.Collectors; public class RedstoneConfiguration implements NBTSerializable, Syncable { - //Set in TR to be a better item such as a battery or a cell + // Set in TR to be a better item such as a battery or a cell public static ItemStack powerStack = new ItemStack(Items.CARROT_ON_A_STICK); public static ItemStack fluidStack = new ItemStack(Items.BUCKET); @@ -168,7 +168,7 @@ public class RedstoneConfiguration implements NBTSerializable, Syncable { stateMap.put(element, state); } - //Ensure all active states are in the map, will happen if a new state is added when the world is upgraded + // Ensure all active states are in the map, will happen if a new state is added when the world is upgraded for (Element element : getElements()) { if (!stateMap.containsKey(element)) { stateMap.put(element, State.IGNORED); @@ -185,7 +185,7 @@ public class RedstoneConfiguration implements NBTSerializable, Syncable { return ELEMENT_MAP.get(name); } - //Could be power input/output, item/fluid io, machine processing + // Could be power input/output, item/fluid io, machine processing public static class Element { private final String name; private final BooleanFunction isApplicable; diff --git a/RebornCore/src/main/java/reborncore/common/blockentity/SlotConfiguration.java b/RebornCore/src/main/java/reborncore/common/blockentity/SlotConfiguration.java index 0edf015c1..57fd7f60d 100644 --- a/RebornCore/src/main/java/reborncore/common/blockentity/SlotConfiguration.java +++ b/RebornCore/src/main/java/reborncore/common/blockentity/SlotConfiguration.java @@ -67,7 +67,7 @@ public class SlotConfiguration implements NBTSerializable { SlotConfigHolder holder = getSlotDetails(i); if (holder == null) { RebornCore.LOGGER.debug("Fixed slot " + i + " in " + machineBase); - //humm somthing has gone wrong + // hmm, something has gone wrong updateSlotDetails(new SlotConfigHolder(i)); } } @@ -88,8 +88,8 @@ public class SlotConfiguration implements NBTSerializable { /** * Replaces or adds a slot detail for the slot id * - * @param slotConfigHolder - * @return SlotConfigHolder + * @param slotConfigHolder {@link SlotConfigHolder} + * @return {@link SlotConfigHolder} Updated SlotConfigHolder */ public SlotConfigHolder updateSlotDetails(SlotConfigHolder slotConfigHolder) { SlotConfigHolder lookup = getSlotDetails(slotConfigHolder.slotID); @@ -209,7 +209,7 @@ public class SlotConfiguration implements NBTSerializable { this.output = output; } - public void setfilter(boolean filter) { + public void setFilter(boolean filter) { this.filter = filter; } @@ -236,7 +236,7 @@ public class SlotConfiguration implements NBTSerializable { }); input = nbt.getBoolean("input"); output = nbt.getBoolean("output"); - if (nbt.contains("filter")) { //Was added later, this allows old saves to be upgraded + if (nbt.contains("filter")) { // Was added later, this allows old saves to be upgraded filter = nbt.getBoolean("filter"); } } @@ -367,16 +367,16 @@ public class SlotConfiguration implements NBTSerializable { INPUT(false, true), OUTPUT(true, false); - boolean extact; + boolean extract; boolean insert; - ExtractConfig(boolean extact, boolean insert) { - this.extact = extact; + ExtractConfig(boolean extract, boolean insert) { + this.extract = extract; this.insert = insert; } - public boolean isExtact() { - return extact; + public boolean isExtract() { + return extract; } public boolean isInsert() { @@ -404,7 +404,7 @@ public class SlotConfiguration implements NBTSerializable { try { compound = StringNbtReader.parse(json); } catch (CommandSyntaxException e) { - throw new UnsupportedOperationException("Clipboard conetents isnt a valid slot configuation"); + throw new UnsupportedOperationException("Clipboard contents isn't a valid slot configuration"); } if (!compound.contains("machine") || !compound.getString("machine").equals(machineIdent)) { throw new UnsupportedOperationException("Machine config is not for this machine."); @@ -412,7 +412,7 @@ public class SlotConfiguration implements NBTSerializable { read(compound.getCompound("data")); } - //DO NOT CALL THIS, use the inventory access on the inventory + // DO NOT CALL THIS, use the inventory access on the inventory public static boolean canInsertItem(int index, ItemStack itemStackIn, Direction direction, MachineBaseBlockEntity blockEntity) { if(itemStackIn.isEmpty()){ return false; @@ -430,11 +430,11 @@ public class SlotConfiguration implements NBTSerializable { return false; } - //DO NOT CALL THIS, use the inventory access on the inventory + // DO NOT CALL THIS, use the inventory access on the inventory public static boolean canExtractItem(int index, ItemStack stack, Direction direction, MachineBaseBlockEntity blockEntity) { SlotConfiguration.SlotConfigHolder slotConfigHolder = blockEntity.getSlotConfiguration().getSlotDetails(index); SlotConfiguration.SlotConfig slotConfig = slotConfigHolder.getSideDetail(direction); - if (slotConfig.getSlotIO().getIoConfig().isExtact()) { + if (slotConfig.getSlotIO().getIoConfig().isExtract()) { return true; } return false; diff --git a/RebornCore/src/main/java/reborncore/common/blocks/BlockMachineBase.java b/RebornCore/src/main/java/reborncore/common/blocks/BlockMachineBase.java index 69ebeddca..a72edc0af 100644 --- a/RebornCore/src/main/java/reborncore/common/blocks/BlockMachineBase.java +++ b/RebornCore/src/main/java/reborncore/common/blocks/BlockMachineBase.java @@ -83,7 +83,7 @@ public abstract class BlockMachineBase extends BaseBlockEntityProvider implement this.setDefaultState( this.getStateManager().getDefaultState().with(FACING, Direction.NORTH).with(ACTIVE, false)); } - BlockWrenchEventHandler.wrenableBlocks.add(this); + BlockWrenchEventHandler.wrenchableBlocks.add(this); } public void setFacing(Direction facing, World world, BlockPos pos) { @@ -180,7 +180,7 @@ public abstract class BlockMachineBase extends BaseBlockEntityProvider implement ItemStack stack = playerIn.getStackInHand(hand); BlockEntity blockEntity = worldIn.getBlockEntity(pos); - // We extended BlockTileBase. Thus we should always have blockEntity entity. I hope. + // We extended BlockTileBase. Thus, we should always have blockEntity entity. I hope. if (blockEntity == null) { return ActionResult.PASS; } @@ -200,7 +200,7 @@ public abstract class BlockMachineBase extends BaseBlockEntityProvider implement } else if (stack.getItem() instanceof IUpgrade && blockEntity instanceof IUpgradeable upgradeableEntity) { if (upgradeableEntity.canBeUpgraded()) { int inserted = (int) insertItemStacked( - InventoryStorage.of(upgradeableEntity.getUpgradeInvetory(), null), + InventoryStorage.of(upgradeableEntity.getUpgradeInventory(), null), ItemVariant.of(stack), stack.getCount() ); diff --git a/RebornCore/src/main/java/reborncore/common/blocks/BlockWrenchEventHandler.java b/RebornCore/src/main/java/reborncore/common/blocks/BlockWrenchEventHandler.java index 36b3200b1..a038fdc65 100644 --- a/RebornCore/src/main/java/reborncore/common/blocks/BlockWrenchEventHandler.java +++ b/RebornCore/src/main/java/reborncore/common/blocks/BlockWrenchEventHandler.java @@ -36,7 +36,7 @@ import java.util.List; public class BlockWrenchEventHandler { - public static List wrenableBlocks = new ArrayList<>(); + public static List wrenchableBlocks = new ArrayList<>(); public static void setup() { @@ -47,7 +47,7 @@ public class BlockWrenchEventHandler { } if (ToolManager.INSTANCE.canHandleTool(playerEntity.getStackInHand(Hand.MAIN_HAND))) { BlockState state = world.getBlockState(blockHitResult.getBlockPos()); - if (wrenableBlocks.contains(state.getBlock())) { + if (wrenchableBlocks.contains(state.getBlock())) { Block block = state.getBlock(); block.onUse(state, world, blockHitResult.getBlockPos(), playerEntity, hand, blockHitResult); return ActionResult.SUCCESS; @@ -57,5 +57,4 @@ public class BlockWrenchEventHandler { }); } - } diff --git a/RebornCore/src/main/java/reborncore/common/chunkloading/ChunkLoaderManager.java b/RebornCore/src/main/java/reborncore/common/chunkloading/ChunkLoaderManager.java index 1083d5a60..af4119d10 100644 --- a/RebornCore/src/main/java/reborncore/common/chunkloading/ChunkLoaderManager.java +++ b/RebornCore/src/main/java/reborncore/common/chunkloading/ChunkLoaderManager.java @@ -47,7 +47,7 @@ import reborncore.common.network.NetworkManager; import java.util.*; import java.util.stream.Collectors; -//This does not do the actual chunk loading, just keeps track of what chunks the chunk loader has loaded +// This does not do the actual chunk loading, just keeps track of what chunks the chunk loader has loaded public class ChunkLoaderManager extends PersistentState { public static Codec> CODEC = Codec.list(LoadedChunk.CODEC); @@ -103,10 +103,10 @@ public class ChunkLoaderManager extends PersistentState { .findFirst(); } - public List getLoadedChunks(World world, BlockPos chunkloader){ + public List getLoadedChunks(World world, BlockPos chunkLoader){ return loadedChunks.stream() .filter(loadedChunk -> loadedChunk.getWorld().equals(getWorldName(world))) - .filter(loadedChunk -> loadedChunk.getChunkLoader().equals(chunkloader)) + .filter(loadedChunk -> loadedChunk.getChunkLoader().equals(chunkLoader)) .collect(Collectors.toList()); } diff --git a/RebornCore/src/main/java/reborncore/common/config/Config.java b/RebornCore/src/main/java/reborncore/common/config/Config.java index 7fb549afc..9ef6b92d0 100644 --- a/RebornCore/src/main/java/reborncore/common/config/Config.java +++ b/RebornCore/src/main/java/reborncore/common/config/Config.java @@ -36,28 +36,29 @@ public @interface Config { /** * This the category of the config * - * @return + * @return {@link String} */ String category() default "config"; /** * This is the key for the config, the default is the field name. * - * @return + * @return {@link String} */ String key() default ""; /** * This is a comment that will be supplied along with the config, use this to explain what the config does * - * @return + * @return {@link String} */ String comment() default ""; /** - * this is the config file name, the default is just config.cgf, use this is you whish to split the config into more than one file. + * This is the config file name, the default is {@code config.cgf}, + * use this if you wish to split the config into more than one file. * - * @return + * @return {@link String} */ String config() default "config"; diff --git a/RebornCore/src/main/java/reborncore/common/config/Configuration.java b/RebornCore/src/main/java/reborncore/common/config/Configuration.java index 80fb6aa8c..f8ba127ca 100644 --- a/RebornCore/src/main/java/reborncore/common/config/Configuration.java +++ b/RebornCore/src/main/java/reborncore/common/config/Configuration.java @@ -76,7 +76,7 @@ public class Configuration { readFromJson(configs); } - //Save the configs + // Save the configs for (Map.Entry entry : toJson().entrySet()) { final File configFile = new File(configDir, entry.getKey() + ".json"); final String jsonStr = GSON.toJson(entry.getValue()); @@ -123,7 +123,7 @@ public class Configuration { String key = annotation.key().isEmpty() ? field.getName() : annotation.key(); if (categoryObject.has(key)) { - throw new UnsupportedOperationException("Some bad happened, duplicate key found: " + key); + throw new UnsupportedOperationException("Something bad happened, duplicate key found: " + key); } JsonObject fieldObject = new JsonObject(); @@ -155,7 +155,7 @@ public class Configuration { final JsonObject config = configs.get(annotation.config()); if (config == null) { - continue; //Could be possible if a new config is added + continue; // Could be possible if a new config is added } JsonObject categoryObject = config.getAsJsonObject(annotation.category()); diff --git a/RebornCore/src/main/java/reborncore/common/crafting/RebornRecipe.java b/RebornCore/src/main/java/reborncore/common/crafting/RebornRecipe.java index 87071e275..0c5b17539 100644 --- a/RebornCore/src/main/java/reborncore/common/crafting/RebornRecipe.java +++ b/RebornCore/src/main/java/reborncore/common/crafting/RebornRecipe.java @@ -81,7 +81,9 @@ public class RebornRecipe implements Recipe, CustomOutputRecipe { return type; } - // use the RebornIngredient version to ensure stack sizes are checked + /** + * use the {@link RebornIngredient} version to ensure stack sizes are checked + */ @Deprecated @Override public DefaultedList getIngredients() { @@ -105,8 +107,8 @@ public class RebornRecipe implements Recipe, CustomOutputRecipe { } /** - * @param blockEntity the blockEntity that is doing the crafting - * @return if true the recipe will craft, if false it will not + * @param blockEntity {@link BlockEntity} The blockEntity that is doing the crafting + * @return {@code boolean} If true, the recipe will craft, if false it will not */ public boolean canCraft(BlockEntity blockEntity) { if (blockEntity instanceof IRecipeCrafterProvider) { @@ -116,14 +118,14 @@ public class RebornRecipe implements Recipe, CustomOutputRecipe { } /** - * @param blockEntity the blockEntity that is doing the crafting - * @return return true if fluid was taken and should craft + * @param blockEntity {@link BlockEntity} The blockEntity that is doing the crafting + * @return {@code boolean} Returns true if fluid was taken and should craft */ public boolean onCraft(BlockEntity blockEntity) { return true; } - //Done as our recipes do not support these functions, hopefully nothing blidly calls them + // Done as our recipes do not support these functions, hopefully nothing blindly calls them @Deprecated @Override @@ -143,7 +145,10 @@ public class RebornRecipe implements Recipe, CustomOutputRecipe { throw new UnsupportedOperationException(); } - // Do not call directly, this is implemented only as a fallback. getOutputs() will return all of the outputs + /** + * Do not call directly, this is implemented only as a fallback. + * {@link RebornRecipe#getOutputs()} will return all the outputs + */ @Deprecated @Override public ItemStack getOutput() { @@ -158,7 +163,7 @@ public class RebornRecipe implements Recipe, CustomOutputRecipe { throw new UnsupportedOperationException(); } - //Done to try and stop the table from loading it + // Done to try and stop the table from loading it @Override public boolean isIgnoredInRecipeBook() { return true; diff --git a/RebornCore/src/main/java/reborncore/common/crafting/ingredient/StackIngredient.java b/RebornCore/src/main/java/reborncore/common/crafting/ingredient/StackIngredient.java index cdbc8e77b..661fbd0fa 100644 --- a/RebornCore/src/main/java/reborncore/common/crafting/ingredient/StackIngredient.java +++ b/RebornCore/src/main/java/reborncore/common/crafting/ingredient/StackIngredient.java @@ -107,8 +107,8 @@ public class StackIngredient extends RebornIngredient { return false; } - //Bit of a meme here, as DataFixer likes to use the most basic primative type over using an int. - //So we have to go to json and back on the incoming stack to be sure its using types that match our input. + // A bit of a meme here, as DataFixer likes to use the most basic primitive type over using an int. + // So we have to go to json and back on the incoming stack to be sure it's using types that match our input. NbtCompound compoundTag = itemStack.getNbt(); JsonElement jsonElement = Dynamic.convert(NbtOps.INSTANCE, JsonOps.INSTANCE, compoundTag); diff --git a/RebornCore/src/main/java/reborncore/common/crafting/ingredient/TagIngredient.java b/RebornCore/src/main/java/reborncore/common/crafting/ingredient/TagIngredient.java index fadfa8781..7a88649fa 100644 --- a/RebornCore/src/main/java/reborncore/common/crafting/ingredient/TagIngredient.java +++ b/RebornCore/src/main/java/reborncore/common/crafting/ingredient/TagIngredient.java @@ -114,7 +114,7 @@ public class TagIngredient extends RebornIngredient { } private JsonObject toItemJsonObject() { - //Tags are not synced across the server so we sync all the items + // Tags are not synced across the server, so we sync all the items JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("tag_server_sync", true); diff --git a/RebornCore/src/main/java/reborncore/common/crafting/serde/RecipeSerdeException.java b/RebornCore/src/main/java/reborncore/common/crafting/serde/RecipeSerdeException.java index ad47a1126..c9492a411 100644 --- a/RebornCore/src/main/java/reborncore/common/crafting/serde/RecipeSerdeException.java +++ b/RebornCore/src/main/java/reborncore/common/crafting/serde/RecipeSerdeException.java @@ -33,7 +33,7 @@ public class RecipeSerdeException extends RuntimeException { public RecipeSerdeException(Identifier identifier, Throwable cause) { super("Failed to ser/de " + identifier, cause); - // Dont trust minecraft to log this. + // Don't trust minecraft to log this. LOGGER.error(getMessage(), this); } } diff --git a/RebornCore/src/main/java/reborncore/common/fluid/FluidValue.java b/RebornCore/src/main/java/reborncore/common/fluid/FluidValue.java index 6c597b8d0..1b26e2f9c 100644 --- a/RebornCore/src/main/java/reborncore/common/fluid/FluidValue.java +++ b/RebornCore/src/main/java/reborncore/common/fluid/FluidValue.java @@ -129,7 +129,7 @@ public final class FluidValue { return fromRaw(droplets); } } else if (jsonElement.isJsonPrimitive() && jsonElement.getAsJsonPrimitive().isNumber()) { - //TODO add a warning here + // TODO add a warning here return fromMillibuckets(jsonElement.getAsJsonPrimitive().getAsInt()); } throw new JsonSyntaxException("Could not parse fluid value"); diff --git a/RebornCore/src/main/java/reborncore/common/fluid/RebornFluidRenderManager.java b/RebornCore/src/main/java/reborncore/common/fluid/RebornFluidRenderManager.java index d37929c28..39e884b87 100644 --- a/RebornCore/src/main/java/reborncore/common/fluid/RebornFluidRenderManager.java +++ b/RebornCore/src/main/java/reborncore/common/fluid/RebornFluidRenderManager.java @@ -56,7 +56,8 @@ public class RebornFluidRenderManager implements ClientSpriteRegistryCallback, S } private static void setupFluidRenderer(RebornFluid fluid) { - //Done lazy as we want to ensure we get the sprite at the correct time, but also dont want to be making these calls every time its required. + // Done lazy as we want to ensure we get the sprite at the correct time, + // but also don't want to be making these calls every time its required. TemporaryLazy sprites = new TemporaryLazy<>(() -> { FluidSettings fluidSettings = fluid.getFluidSettings(); return new Sprite[]{RenderUtil.getSprite(fluidSettings.getStillTexture()), RenderUtil.getSprite(fluidSettings.getFlowingTexture())}; @@ -81,7 +82,7 @@ public class RebornFluidRenderManager implements ClientSpriteRegistryCallback, S @Override public void reload(ResourceManager manager) { - //Reset the cached fluid sprites + // Reset the cached fluid sprites spriteMap.forEach((key, value) -> value.reset()); } diff --git a/RebornCore/src/main/java/reborncore/common/misc/ModSounds.java b/RebornCore/src/main/java/reborncore/common/misc/ModSounds.java index 99c4226b2..d561d053a 100644 --- a/RebornCore/src/main/java/reborncore/common/misc/ModSounds.java +++ b/RebornCore/src/main/java/reborncore/common/misc/ModSounds.java @@ -31,7 +31,6 @@ import net.minecraft.util.registry.Registry; /** * @author drcrazy */ - public class ModSounds { public static SoundEvent BLOCK_DISMANTLE; diff --git a/RebornCore/src/main/java/reborncore/common/misc/TagConvertible.java b/RebornCore/src/main/java/reborncore/common/misc/TagConvertible.java index 89070f702..4653368c3 100644 --- a/RebornCore/src/main/java/reborncore/common/misc/TagConvertible.java +++ b/RebornCore/src/main/java/reborncore/common/misc/TagConvertible.java @@ -24,17 +24,21 @@ package reborncore.common.misc; +import net.minecraft.block.Block; +import net.minecraft.item.Item; import net.minecraft.tag.Tag; /** * Tells if an item, block etc. has a tag solely for compatibility with other mods. * For example, several mods have bronze ingots, so TechReborn will tag its bronze ingot with a common tag. - * @param The type of the object, like {@link net.minecraft.item.Item} or {@link net.minecraft.block.Block}. + * + * @param The type of the object, like {@link Item} or {@link Block}. */ public interface TagConvertible { /** * Returns the common tag of this object. + * * @return the common tag of this object */ Tag.Identified asTag(); diff --git a/RebornCore/src/main/java/reborncore/common/multiblock/IMultiblockPart.java b/RebornCore/src/main/java/reborncore/common/multiblock/IMultiblockPart.java index 2a6c200c2..b7130220b 100644 --- a/RebornCore/src/main/java/reborncore/common/multiblock/IMultiblockPart.java +++ b/RebornCore/src/main/java/reborncore/common/multiblock/IMultiblockPart.java @@ -34,11 +34,11 @@ import java.util.Set; /** * Basic interface for a multiblock machine part. This is defined as an abstract - * class as we need the basic functionality of a BlockEntity as well. Preferably, - * you should derive from MultiblockBlockEntityBase, which does all the hard work + * class as we need the basic functionality of a {@link BlockEntity} as well. Preferably, + * you should derive from {@link MultiblockBlockEntityBase}, which does all the hard work * for you. - *

- * {@link MultiblockBlockEntityBase} + * + *

{@link MultiblockBlockEntityBase}

*/ public abstract class IMultiblockPart extends BlockEntity { public static final int INVALID_DISTANCE = Integer.MAX_VALUE; @@ -48,22 +48,22 @@ public abstract class IMultiblockPart extends BlockEntity { } /** - * @return True if this block is connected to a multiblock controller. False + * @return {@code boolean} True if this block is connected to a multiblock controller. False * otherwise. */ public abstract boolean isConnected(); /** - * @return The attached multiblock controller for this blockEntity entity. + * @return {@link MultiblockControllerBase} The attached multiblock controller for this {@link BlockEntity} entity. */ public abstract MultiblockControllerBase getMultiblockController(); /** - * Returns the location of this blockEntity entity in the world, in BlockPos + * Returns the location of this {@link BlockEntity} entity in the world, in {@link BlockPos} * form. * - * @return A BlockPos with its x,y,z members set to the location of this - * blockEntity entity in the world. + * @return A {@link BlockPos} with its x,y,z members set to the location of this + * {@link BlockEntity} entity in the world. */ public abstract BlockPos getWorldLocation(); @@ -72,16 +72,16 @@ public abstract class IMultiblockPart extends BlockEntity { /** * Called after this block has been attached to a new multiblock controller. * - * @param newController The new multiblock controller to which this blockEntity entity is - * attached. + * @param newController {@link MultiblockControllerBase} The new multiblock controller to which this + * {@link BlockEntity} entity is attached. */ public abstract void onAttached(MultiblockControllerBase newController); /** * Called after this block has been detached from a multiblock controller. * - * @param multiblockController The multiblock controller that no longer controls this blockEntity - * entity. + * @param multiblockController {@link MultiblockControllerBase} The multiblock controller that no longer + * controls this blockEntity entity. */ public abstract void onDetached(MultiblockControllerBase multiblockController); @@ -91,11 +91,11 @@ public abstract class IMultiblockPart extends BlockEntity { * NOT mark the part as disconnected. onDetached will be called immediately * afterwards. * - * @param oldController The controller which is orphaning this block. - * @param oldControllerSize The number of connected blocks in the controller prior to - * shedding orphans. - * @param newControllerSize The number of connected blocks in the controller after - * shedding orphans. + * @param oldController {@link MultiblockControllerBase} The controller which is orphaning this block. + * @param oldControllerSize {@code int} The number of connected blocks in the controller prior to + * shedding orphans. + * @param newControllerSize {@code int} The number of connected blocks in the controller after + * shedding orphans. * @see #onDetached(MultiblockControllerBase) */ public abstract void onOrphaned(MultiblockControllerBase oldController, int oldControllerSize, @@ -108,7 +108,7 @@ public abstract class IMultiblockPart extends BlockEntity { * not attach this blockEntity entity to it. Override this in your game code! * * @return A new Multiblock Controller, derived from - * MultiblockControllerBase. + * {@link MultiblockControllerBase}. */ public abstract MultiblockControllerBase createNewMultiblock(); @@ -116,7 +116,7 @@ public abstract class IMultiblockPart extends BlockEntity { * Retrieve the type of multiblock controller which governs this part. Used * to ensure that incompatible multiblocks are not merged. * - * @return The class/type of the multiblock controller which governs this + * @return {@link Class} The class/type of the multiblock controller which governs this * type of part. */ public abstract Class getMultiblockControllerType(); @@ -126,8 +126,8 @@ public abstract class IMultiblockPart extends BlockEntity { * controller. A special case of attach/detach, done here for efficiency to * avoid triggering lots of recalculation logic. * - * @param newController The new controller into which this blockEntity entity is being - * merged. + * @param newController {@link MultiblockControllerBase} The new controller into which this + * {@link BlockEntity} entity is being merged. */ public abstract void onAssimilated(MultiblockControllerBase newController); @@ -146,7 +146,7 @@ public abstract class IMultiblockPart extends BlockEntity { public abstract void setUnvisited(); /** - * @return True if this block has been visited by your validation algorithms + * @return {@code boolean} True if this block has been visited by your validation algorithms * since the last reset. */ public abstract boolean isVisited(); @@ -166,22 +166,22 @@ public abstract class IMultiblockPart extends BlockEntity { /** * Is this block the designated save/load & network delegate? * - * @return Boolean + * @return {@code boolean} */ public abstract boolean isMultiblockSaveDelegate(); /** - * Returns an array containing references to neighboring IMultiblockPart - * blockEntity entities. Primarily a utility method. Only works after blockentity + * Returns an array containing references to neighboring {@link IMultiblockPart} + * {@link BlockEntity} entities. Primarily a utility method. Only works after {@link BlockEntity} * construction, so it cannot be used in - * MultiblockControllerBase::attachBlock. + * {@link MultiblockControllerBase#attachBlock}. *

* This method is chunk-safe on the server; it will not query for parts in * chunks that are unloaded. Note that no method is chunk-safe on the * client, because ChunkProviderClient is stupid. + *

* - * @return An array of references to neighboring IMultiblockPart blockEntity - * entities. + * @return An array of references to neighboring {@link IMultiblockPart} {@link BlockEntity} entities. */ public abstract IMultiblockPart[] getNeighboringParts(); @@ -194,7 +194,8 @@ public abstract class IMultiblockPart extends BlockEntity { * actually be part of the machine! They form an outer bounding box for the * whole machine itself. * - * @param multiblockControllerBase The controller to which this part is being assembled. + * @param multiblockControllerBase {@link MultiblockControllerBase} The controller to + * which this part is being assembled. */ public abstract void onMachineAssembled(MultiblockControllerBase multiblockControllerBase); @@ -221,12 +222,12 @@ public abstract class IMultiblockPart extends BlockEntity { /** * Called when this part should check its neighbors. This method MUST NOT * cause additional chunks to load. ALWAYS check to see if a chunk is loaded - * before querying for its blockEntity entity This part should inform the + * before querying for its {@link BlockEntity} entity This part should inform the * controller that it is attaching at this time. * - * @return A Set of multiblock controllers to which this object would like + * @return A Set of {@link MultiblockControllerBase} to which this object would like * to attach. It should have attached to one of the controllers in - * this list. Return null if there are no compatible controllers + * this list. Return {@code null} if there are no compatible controllers * nearby. */ public abstract Set attachToNeighbors(); @@ -238,12 +239,12 @@ public abstract class IMultiblockPart extends BlockEntity { public abstract void assertDetached(); /** - * @return True if a part has multiblock game-data saved inside it. + * @return {@code boolean} True if a part has multiblock game-data saved inside it. */ public abstract boolean hasMultiblockSaveData(); /** - * @return The part's saved multiblock game-data in NBT format, or null if + * @return {@link NbtCompound} The part's saved multiblock game-data in NBT format, or null if * there isn't any. */ public abstract NbtCompound getMultiblockSaveData(); diff --git a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockBlockEntityBase.java b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockBlockEntityBase.java index 7bfb7ddc0..7d9da6844 100644 --- a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockBlockEntityBase.java +++ b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockBlockEntityBase.java @@ -41,7 +41,7 @@ import java.util.List; import java.util.Set; /** - * Base logic class for Multiblock-connected blockEntity entities. Most multiblock + * Base logic class for Multiblock-connected {@link BlockEntity} entities. Most multiblock * machines should derive from this and implement their game logic in certain * abstract methods. */ @@ -117,7 +117,7 @@ public abstract class MultiblockBlockEntityBase extends IMultiblockPart implemen // We can't directly initialize a multiblock controller yet, so we cache // the data here until - // we receive a validate() call, which creates the controller and hands + // we receive a "validate()" call, which creates the controller and hands // off the cached data. if (data.contains("multiblockData")) { this.cachedMultiblockData = data.getCompound("multiblockData"); @@ -142,10 +142,9 @@ public abstract class MultiblockBlockEntityBase extends IMultiblockPart implemen } /** - * Called from Minecraft's blockEntity entity loop, after all blockEntity entities have - * been ticked, as the chunk in which this blockEntity entity is contained is + * Called from Minecraft's {@link BlockEntity} entity loop, after all {@link BlockEntity} entities have + * been ticked, as the chunk in which this {@link BlockEntity} entity is contained is * unloading. - * */ @Override public void onUnload() { @@ -153,15 +152,20 @@ public abstract class MultiblockBlockEntityBase extends IMultiblockPart implemen } /** - * This is called when a block is being marked as valid by the chunk, but - * has not yet fully been placed into the world's BlockEntity cache. - * this.worldObj, xCoord, yCoord and zCoord have been initialized, but any - * attempts to read data about the world can cause infinite loops - if you - * call getBlockEntity on this BlockEntity's coordinate from within - * validate(), you will blow your call stack. *

- * TL;DR: Here there be dragons. + * This is called when a block is being marked as valid by the chunk, but + * has not yet fully been placed into the world's {@link BlockEntity} cache. + *

* + *

+ * {@code this.worldObj}, {@code xCoord}, {@code yCoord} and {@code zCoord} + * have been initialized, but any attempts to read data about the world can + * cause infinite loops - if you call {@code getBlockEntity} on this + * {@link BlockEntity}'s coordinate from within {@code validate()}, you will + * blow your call stack. + *

+ * + *

TL;DR: Here there be dragons.

*/ @Override public void cancelRemoval() { @@ -182,10 +186,10 @@ public abstract class MultiblockBlockEntityBase extends IMultiblockPart implemen /** * Override this to easily modify the description packet's data without * having to worry about sending the packet itself. Decode this data in - * decodeDescriptionPacket. + * {@link #decodeDescriptionPacket}. * - * @param packetData An NBT compound tag into which you should write your custom - * description data. + * @param packetData {@link NbtCompound} An NBT compound tag into which + * you should write your custom description data. */ protected void encodeDescriptionPacket(NbtCompound packetData) { if (this.isMultiblockSaveDelegate() && isConnected()) { @@ -196,10 +200,11 @@ public abstract class MultiblockBlockEntityBase extends IMultiblockPart implemen } /** - * Override this to easily read in data from a BlockEntity's description - * packet. Encoded in encodeDescriptionPacket. + * Override this to easily read in data from a {@link BlockEntity}'s description + * packet. Encoded in {@link #encodeDescriptionPacket}. * - * @param packetData The NBT data from the blockEntity entity's description packet. + * @param packetData {@link NbtCompound} The NBT data from the {@link BlockEntity} + * entity's description packet. */ protected void decodeDescriptionPacket(NbtCompound packetData) { if (packetData.contains("multiblockData")) { @@ -334,7 +339,7 @@ public abstract class MultiblockBlockEntityBase extends IMultiblockPart implemen getWorld().markDirty(getPos()); } - // // Helper functions for notifying neighboring blocks + // /// Helper functions for notifying neighboring blocks protected void notifyNeighborsOfBlockChange() { world.updateNeighborsAlways(getPos(), getCachedState().getBlock()); } @@ -344,9 +349,10 @@ public abstract class MultiblockBlockEntityBase extends IMultiblockPart implemen } // /// Private/Protected Logic Helpers - /* - * Detaches this block from its controller. Calls detachBlock() and clears - * the controller member. + + /** + * Detaches this block from its controller. Calls {@link MultiblockControllerBase#detachBlock} + * and clears the controller member. */ protected void detachSelf(boolean chunkUnloading) { if (this.controller != null) { diff --git a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockControllerBase.java b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockControllerBase.java index 18c4cbd3b..bd2252477 100644 --- a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockControllerBase.java +++ b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockControllerBase.java @@ -41,8 +41,9 @@ import java.util.Set; * Conceptually, they are meta-TileEntities. They govern the logic for an * associated group of TileEntities. *

- * Subordinate TileEntities implement the IMultiblockPart class and, generally, - * should not have an update() loop. + * Subordinate TileEntities implement the {@link IMultiblockPart} class and, generally, + * should not have an update() loop. + *

*/ public abstract class MultiblockControllerBase { public static final short DIMENSION_UNBOUNDED = -1; @@ -124,16 +125,16 @@ public abstract class MultiblockControllerBase { * multiblock. The part will be notified that the data has been used after * this call completes. * - * @param part Attached part - * @param data The NBT tag containing this controller's data. + * @param part {@link IMultiblockPart} Attached part + * @param data {@link NbtCompound} The NBT tag containing this controller's data. */ public abstract void onAttachedPartWithMultiblockData(IMultiblockPart part, NbtCompound data); /** * Check if a block is being tracked by this machine. * - * @param blockCoord Coordinate to check. - * @return True if the blockEntity entity at blockCoord is being tracked by this + * @param blockCoord {@link BlockPos} Coordinate to check. + * @return {@code boolean} True if the blockEntity entity at blockCoord is being tracked by this * machine, false otherwise. */ public boolean hasBlock(BlockPos blockCoord) { @@ -143,7 +144,7 @@ public abstract class MultiblockControllerBase { /** * Attach a new part to this machine. * - * @param part The part to add. + * @param part {@link IMultiblockPart} The part to add. */ public void attachBlock(IMultiblockPart part) { //IMultiblockPart candidate; @@ -218,7 +219,7 @@ public abstract class MultiblockControllerBase { * Called when a new part is added to the machine. Good time to register * things into lists. * - * @param newPart The part being added. + * @param newPart {@link IMultiblockPart} The part being added. */ protected abstract void onBlockAdded(IMultiblockPart newPart); @@ -226,7 +227,7 @@ public abstract class MultiblockControllerBase { * Called when a part is removed from the machine. Good time to clean up * lists. * - * @param oldPart The part being removed. + * @param oldPart {@link IMultiblockPart} The part being removed. */ protected abstract void onBlockRemoved(IMultiblockPart oldPart); @@ -257,7 +258,7 @@ public abstract class MultiblockControllerBase { * Callback whenever a part is removed (or will very shortly be removed) * from a controller. Do housekeeping/callbacks, also nulls min/max coords. * - * @param part The part being removed. + * @param part {@link IMultiblockPart} The part being removed. */ private void onDetachBlock(IMultiblockPart part) { // Strip out this part @@ -276,11 +277,11 @@ public abstract class MultiblockControllerBase { /** * Call to detach a block from this machine. Generally, this should be - * called when the blockEntity entity is being released, e.g. on block destruction. + * called when the {@link BlockEntity} entity is being released, e.g. on block destruction. * - * @param part The part to detach from this machine. - * @param chunkUnloading Is this entity detaching due to the chunk unloading? If true, - * the multiblock will be paused instead of broken. + * @param part {@link IMultiblockPart} The part to detach from this machine. + * @param chunkUnloading {@code boolean} Is this entity detaching due to the chunk unloading? If true, + * the multiblock will be paused instead of broken. */ public void detachBlock(IMultiblockPart part, boolean chunkUnloading) { if (chunkUnloading && this.assemblyState == AssemblyState.Assembled) { @@ -316,7 +317,7 @@ public abstract class MultiblockControllerBase { * blocks to actually assemble it. This isn't as simple as xmax*ymax*zmax * for non-cubic machines or for machines with hollow/complex interiors. * - * @return The minimum number of blocks connected to the machine for it to + * @return {@code int} The minimum number of blocks connected to the machine for it to * be assembled. */ protected abstract int getMinimumNumberOfBlocksForAssembledMachine(); @@ -326,7 +327,7 @@ public abstract class MultiblockControllerBase { * (DIMENSION_UNBOUNDED) to disable dimension checking in X. (This is not * recommended.) * - * @return The maximum X dimension size of the machine, or -1 + * @return {@code int} The maximum X dimension size of the machine, or -1 */ protected abstract int getMaximumXSize(); @@ -335,7 +336,7 @@ public abstract class MultiblockControllerBase { * (DIMENSION_UNBOUNDED) to disable dimension checking in X. (This is not * recommended.) * - * @return The maximum Z dimension size of the machine, or -1 + * @return {@code int} The maximum Z dimension size of the machine, or -1 */ protected abstract int getMaximumZSize(); @@ -344,7 +345,7 @@ public abstract class MultiblockControllerBase { * (DIMENSION_UNBOUNDED) to disable dimension checking in X. (This is not * recommended.) * - * @return The maximum Y dimension size of the machine, or -1 + * @return {@code int} The maximum Y dimension size of the machine, or -1 */ protected abstract int getMaximumYSize(); @@ -352,7 +353,7 @@ public abstract class MultiblockControllerBase { * Returns the minimum X dimension size of the machine. Must be at least 1, * because nothing else makes sense. * - * @return The minimum X dimension size of the machine + * @return {@code int} The minimum X dimension size of the machine */ protected int getMinimumXSize() { return 1; @@ -362,7 +363,7 @@ public abstract class MultiblockControllerBase { * Returns the minimum Y dimension size of the machine. Must be at least 1, * because nothing else makes sense. * - * @return The minimum Y dimension size of the machine + * @return {@code int} The minimum Y dimension size of the machine */ protected int getMinimumYSize() { return 1; @@ -372,15 +373,15 @@ public abstract class MultiblockControllerBase { * Returns the minimum Z dimension size of the machine. Must be at least 1, * because nothing else makes sense. * - * @return The minimum Z dimension size of the machine + * @return {@code int} The minimum Z dimension size of the machine */ protected int getMinimumZSize() { return 1; } /** - * @return An exception representing the last error encountered when trying - * to assemble this multiblock, or null if there is no error. + * @return {@link MultiblockValidationException} An exception representing the last error encountered when trying + * to assemble this multiblock, or {@code null} if there is no error. */ public MultiblockValidationException getLastValidationException() { return lastValidationException; @@ -389,6 +390,8 @@ public abstract class MultiblockControllerBase { /** * Checks if a machine is whole. If not, throws an exception with the reason * why. + * + * @throws MultiblockValidationException if the machine is not whole. */ protected abstract void isMachineWhole() throws MultiblockValidationException; @@ -396,7 +399,6 @@ public abstract class MultiblockControllerBase { * Check if the machine is whole or not. If the machine was not whole, but * now is, assemble the machine. If the machine was whole, but no longer is, * disassemble the machine. - * */ public void checkIfMachineIsWhole() { AssemblyState oldState = this.assemblyState; @@ -422,8 +424,10 @@ public abstract class MultiblockControllerBase { /** * Called when a machine becomes "whole" and should begin functioning as a - * game-logically finished machine. Calls onMachineAssembled on all attached + * game-logically finished machine. Calls {@link #onMachineAssembled} on all attached * parts. + * + * @param oldState {@link AssemblyState} The previous state of the machine. */ private void assembleMachine(AssemblyState oldState) { for (IMultiblockPart part : connectedParts) { @@ -441,7 +445,7 @@ public abstract class MultiblockControllerBase { /** * Called when the machine needs to be disassembled. It is not longer * "whole" and should not be functional, usually as a result of a block - * being removed. Calls onMachineBroken on all attached parts. + * being removed. Calls {@link IMultiblockPart#onMachineBroken} on all attached parts. */ private void disassembleMachine() { for (IMultiblockPart part : connectedParts) { @@ -453,10 +457,12 @@ public abstract class MultiblockControllerBase { } /** - * Assimilate another controller into this controller. Acquire all of the + * Assimilate another controller into this controller. Acquire all the * other controller's blocks and attach them to this one. * - * @param other The controller to merge into this one. + * @param other {@link MultiblockControllerBase} The controller to merge into this one. + * @throws IllegalArgumentException if the controller with the lowest minimum-coord value does not consume + * the one with the higher value. */ public void assimilate(MultiblockControllerBase other) { BlockPos otherReferenceCoord = other.getReferenceCoord(); @@ -467,7 +473,7 @@ public abstract class MultiblockControllerBase { Set partsToAcquire = new HashSet<>(other.connectedParts); - // releases all blocks and references gently so they can be incorporated into another multiblock + // releases all blocks and references gently, so they can be incorporated into another multiblock other._onAssimilated(this); for (IMultiblockPart acquiredPart : partsToAcquire) { @@ -489,7 +495,7 @@ public abstract class MultiblockControllerBase { * Called when this machine is consumed by another controller. Essentially, * forcibly tear down this object. * - * @param otherController The controller consuming this controller. + * @param otherController {@link MultiblockControllerBase} The controller consuming this controller. */ private void _onAssimilated(MultiblockControllerBase otherController) { if (referenceCoord == null) { return; } @@ -509,7 +515,7 @@ public abstract class MultiblockControllerBase { * Callback. Called after this controller assimilates all the blocks from * another controller. Use this to absorb that controller's game data. * - * @param assimilated The controller whose uniqueness was added to our own. + * @param assimilated {@link MultiblockControllerBase} The controller whose uniqueness was added to our own. */ protected abstract void onAssimilate(MultiblockControllerBase assimilated); @@ -518,7 +524,7 @@ public abstract class MultiblockControllerBase { * controller. All blocks have been stripped out of this object and handed * over to the other controller. This is intended primarily for cleanup. * - * @param assimilator The controller which has assimilated this controller. + * @param assimilator {@link MultiblockControllerBase} The controller which has assimilated this controller. */ protected abstract void onAssimilated(MultiblockControllerBase assimilator); @@ -553,7 +559,7 @@ public abstract class MultiblockControllerBase { for (int x = minChunkX; x <= maxChunkX; x++) { for (int z = minChunkZ; z <= maxChunkZ; z++) { - // Ensure that we save our data, even if the our save + // Ensure that we save our data, even if our save // delegate is in has no TEs. WorldChunk chunkToSave = this.worldObj.getChunk(x, z); chunkToSave.needsSaving(); @@ -565,12 +571,12 @@ public abstract class MultiblockControllerBase { } /** - * The server-side update loop! Use this similarly to a BlockEntity's update - * loop. You do not need to call your superclass' update() if you're - * directly derived from MultiblockControllerBase. This is a callback. Note + * The server-side update loop! Use this similarly to a {@link BlockEntity}'s update + * loop. You do not need to call your superclass' {@code update()} if you're + * directly derived from {@link MultiblockControllerBase}. This is a callback. Note * that this will only be called when the machine is assembled. * - * @return True if the multiblock should save data, i.e. its internal game + * @return {@code boolean} True if the multiblock should save data, i.e. its internal game * state has changed. False otherwise. */ protected abstract boolean updateServer(); @@ -586,11 +592,11 @@ public abstract class MultiblockControllerBase { /** * The "frame" consists of the outer edges of the machine, plus the corners. * - * @param world World object for the world in which this controller is - * located. - * @param x X coordinate of the block being tested - * @param y Y coordinate of the block being tested - * @param z Z coordinate of the block being tested + * @param world {@link World} The object for the world in which this controller is + * located. + * @param x {@code int} X coordinate of the block being tested + * @param y {@code int} Y coordinate of the block being tested + * @param z {@code int} Z coordinate of the block being tested * @throws MultiblockValidationException if the tested block is not allowed on the machine's frame */ protected void isBlockGoodForFrame(World world, int x, int y, int z) throws MultiblockValidationException { @@ -601,11 +607,11 @@ public abstract class MultiblockControllerBase { /** * The top consists of the top face, minus the edges. * - * @param world World object for the world in which this controller is - * located. - * @param x X coordinate of the block being tested - * @param y Y coordinate of the block being tested - * @param z Z coordinate of the block being tested + * @param world {@link World} The object for the world in which this controller is + * located. + * @param x {@code int} X coordinate of the block being tested + * @param y {@code int} Y coordinate of the block being tested + * @param z {@code int} Z coordinate of the block being tested * @throws MultiblockValidationException if the tested block is not allowed on the machine's top face */ protected void isBlockGoodForTop(World world, int x, int y, int z) throws MultiblockValidationException { @@ -616,13 +622,13 @@ public abstract class MultiblockControllerBase { /** * The bottom consists of the bottom face, minus the edges. * - * @param world World object for the world in which this controller is - * located. - * @param x X coordinate of the block being tested - * @param y Y coordinate of the block being tested - * @param z Z coordinate of the block being tested + * @param world {@link World} The object for the world in which this controller is + * located. + * @param x {@code int} X coordinate of the block being tested + * @param y {@code int} Y coordinate of the block being tested + * @param z {@code int} Z coordinate of the block being tested * @throws MultiblockValidationException if the tested block is not allowed on the machine's bottom - * face + * face */ protected void isBlockGoodForBottom(World world, int x, int y, int z) throws MultiblockValidationException { throw new MultiblockValidationException( @@ -630,15 +636,15 @@ public abstract class MultiblockControllerBase { } /** - * The sides consists of the N/E/S/W-facing faces, minus the edges. + * The sides consist of the N/E/S/W-facing faces, minus the edges. * - * @param world World object for the world in which this controller is - * located. - * @param x X coordinate of the block being tested - * @param y Y coordinate of the block being tested - * @param z Z coordinate of the block being tested + * @param world {@link World} The object for the world in which this controller is + * located. + * @param x {@code int} X coordinate of the block being tested + * @param y {@code int} Y coordinate of the block being tested + * @param z {@code int} Z coordinate of the block being tested * @throws MultiblockValidationException if the tested block is not allowed on the machine's side - * faces + * faces */ protected void isBlockGoodForSides(World world, int x, int y, int z) throws MultiblockValidationException { throw new MultiblockValidationException( @@ -648,11 +654,11 @@ public abstract class MultiblockControllerBase { /** * The interior is any block that does not touch blocks outside the machine. * - * @param world World object for the world in which this controller is - * located. - * @param x X coordinate of the block being tested - * @param y Y coordinate of the block being tested - * @param z Z coordinate of the block being tested + * @param world {@link World} The object for the world in which this controller is + * located. + * @param x {@code int} X coordinate of the block being tested + * @param y {@code int} Y coordinate of the block being tested + * @param z {@code int} Z coordinate of the block being tested * @throws MultiblockValidationException if the tested block is not allowed in the machine's interior */ protected void isBlockGoodForInterior(World world, int x, int y, int z) throws MultiblockValidationException { @@ -661,7 +667,7 @@ public abstract class MultiblockControllerBase { } /** - * @return The reference coordinate, the block with the lowest x, y, z + * @return {@link BlockPos} The reference coordinate, the block with the lowest x, y, z * coordinates, evaluated in that order. */ public BlockPos getReferenceCoord() { @@ -672,7 +678,7 @@ public abstract class MultiblockControllerBase { } /** - * @return The number of blocks connected to this controller. + * @return {@code int} The number of blocks connected to this controller. */ public int getNumConnectedBlocks() { return connectedParts.size(); @@ -718,7 +724,7 @@ public abstract class MultiblockControllerBase { } /** - * @return The minimum bounding-box coordinate containing this machine's + * @return {@link BlockPos} The minimum bounding-box coordinate containing this machine's * blocks. */ public BlockPos getMinimumCoord() { @@ -729,7 +735,7 @@ public abstract class MultiblockControllerBase { } /** - * @return The maximum bounding-box coordinate containing this machine's + * @return {@link BlockPos} The maximum bounding-box coordinate containing this machine's * blocks. */ public BlockPos getMaximumCoord() { @@ -740,23 +746,23 @@ public abstract class MultiblockControllerBase { } /** - * Called when the save delegate's blockEntity entity is being asked for its + * Called when the save delegate's {@link BlockEntity} entity is being asked for its * description packet * - * @param data A fresh compound tag to write your multiblock data into + * @param data {@link NbtCompound} A fresh compound tag to write your multiblock data into */ public abstract void formatDescriptionPacket(NbtCompound data); /** - * Called when the save delegate's blockEntity entity receiving a description + * Called when the save delegate's {@link BlockEntity} entity receiving a description * packet * - * @param data A compound tag containing multiblock data to import + * @param data {@link NbtCompound} A compound tag containing multiblock data to import */ public abstract void decodeDescriptionPacket(NbtCompound data); /** - * @return True if this controller has no associated blocks, false otherwise + * @return {@code boolean} True if this controller has no associated blocks, false otherwise */ public boolean isEmpty() { return connectedParts.isEmpty(); @@ -767,9 +773,12 @@ public abstract class MultiblockControllerBase { * become the new multiblock master when the two multiblocks are adjacent. * Assumes both multiblocks are the same type. * - * @param otherController The other multiblock controller. - * @return True if this multiblock should consume the other, false + * @param otherController {@link MultiblockControllerBase} The other multiblock controller. + * @return {@code boolean} True if this multiblock should consume the other, false * otherwise. + * @throws IllegalArgumentException The two multiblocks have different master classes + * @throws IllegalArgumentException The two controllers with the same reference coord both + * have valid parts */ public boolean shouldConsume(MultiblockControllerBase otherController) { if (!otherController.getClass().equals(getClass())) { @@ -840,7 +849,7 @@ public abstract class MultiblockControllerBase { } /** - * Checks all of the parts in the controller. If any are dead or do not + * Checks all the parts in the controller. If any are dead or do not * exist in the world, they are removed. */ private void auditParts() { @@ -861,7 +870,7 @@ public abstract class MultiblockControllerBase { * Called when this machine may need to check for blocks that are no longer * physically connected to the reference coordinate. * - * @return Set with removed parts + * @return {@link Set} Set with removed {@link IMultiblockPart}s. */ public Set checkForDisconnections() { if (!this.shouldCheckForDisconnections) { @@ -980,10 +989,10 @@ public abstract class MultiblockControllerBase { } /** - * Detach all parts. Return a set of all parts which still have a valid blockEntity + * Detach all parts. Return a set of all parts which still have a valid {@link BlockEntity} * entity. Chunk-safe. * - * @return A set of all parts which still have a valid blockEntity entity. + * @return {@link Set} A set of all {@link IMultiblockPart}s which still have a valid {@link BlockEntity} entity. */ public Set detachAllBlocks() { if (worldObj == null) { @@ -1002,7 +1011,7 @@ public abstract class MultiblockControllerBase { } /** - * @return True if this multiblock machine is considered assembled and ready + * @return {@code boolean} True if this multiblock machine is considered assembled and ready * to go. */ public boolean isAssembled() { @@ -1035,12 +1044,12 @@ public abstract class MultiblockControllerBase { /** * Marks the reference coord dirty & updateable. *

- * On the server, this will mark the for a data-update, so that nearby - * clients will receive an updated description packet from the server after - * a short time. The block's chunk will also be marked dirty and the block's - * chunk will be saved to disk the next time chunks are saved. - *

- * On the client, this will mark the block for a rendering update. + * On the server, this will mark the for a data-update, so that nearby + * clients will receive an updated description packet from the server after + * a short time. The block's chunk will also be marked dirty and the block's + * chunk will be saved to disk the next time chunks are saved. + *

+ *

On the client, this will mark the block for a rendering update.

*/ protected void markReferenceCoordForUpdate() { BlockPos rc = getReferenceCoord(); @@ -1053,11 +1062,11 @@ public abstract class MultiblockControllerBase { /** * Marks the reference coord dirty. *

- * On the server, this marks the reference coord's chunk as dirty; the block - * (and chunk) will be saved to disk the next time chunks are saved. This - * does NOT mark it dirty for a description-packet update. - *

- * On the client, does nothing. + * On the server, this marks the reference coord's chunk as dirty; the block + * (and chunk) will be saved to disk the next time chunks are saved. This + * does NOT mark it dirty for a description-packet update. + *

+ *

On the client, does nothing.

* * @see MultiblockControllerBase#markReferenceCoordForUpdate() */ diff --git a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockEventHandler.java b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockEventHandler.java index 87f3093f9..58c0fc0d2 100644 --- a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockEventHandler.java +++ b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockEventHandler.java @@ -25,7 +25,7 @@ package reborncore.common.multiblock; /** - * In your mod, subscribe this on both the client and server sides side to + * In your mod, subscribe this on both the client and server sides to * handle chunk load events for your multiblock machines. Chunks can load * asynchronously in environments like MCPC+, so we cannot behavior any blocks * that are in chunks which are still loading. diff --git a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockRegistry.java b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockRegistry.java index da9e2afda..7b4f301ed 100644 --- a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockRegistry.java +++ b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockRegistry.java @@ -44,7 +44,7 @@ public class MultiblockRegistry { /** * Called before Tile Entities are ticked in the world. Do bookkeeping here. * - * @param world The world being ticked + * @param world {@link World} The world being ticked */ public static void tickStart(World world) { if (registries.containsKey(world)) { @@ -57,8 +57,8 @@ public class MultiblockRegistry { /** * Called when the world has finished loading a chunk. * - * @param world The world which has finished loading a chunk - * @param chunk Loaded chunk + * @param world {@link World} The world which has finished loading a chunk + * @param chunk {@link Chunk} Loaded chunk */ public static void onChunkLoaded(World world, Chunk chunk) { if (registries.containsKey(world)) { @@ -70,8 +70,8 @@ public class MultiblockRegistry { * Register a new part in the system. The part has been created either * through user action or via a chunk loading. * - * @param world The world into which this part is loading. - * @param part The part being loaded. + * @param world {@link World} The world into which this part is loading. + * @param part {@link IMultiblockPart} The part being loaded. */ public static void onPartAdded(World world, IMultiblockPart part) { MultiblockWorldRegistry registry = getOrCreateRegistry(world); @@ -81,8 +81,8 @@ public class MultiblockRegistry { /** * Call to remove a part from world lists. * - * @param world The world from which a multiblock part is being removed. - * @param part The part being removed. + * @param world {@link World} The world from which a multiblock part is being removed. + * @param part {@link IMultiblockPart} The part being removed. */ public static void onPartRemovedFromWorld(World world, IMultiblockPart part) { if (registries.containsKey(world)) { @@ -95,7 +95,7 @@ public class MultiblockRegistry { * Called whenever a world is unloaded. Unload the relevant registry, if we * have one. * - * @param world The world being unloaded. + * @param world {@link World} The world being unloaded. */ public static void onWorldUnloaded(World world) { if (registries.containsKey(world)) { @@ -108,14 +108,14 @@ public class MultiblockRegistry { * Call to mark a controller as dirty. Dirty means that parts have been * added or removed this tick. * - * @param world The world containing the multiblock - * @param controller The dirty controller + * @param world {@link World} The world containing the multiblock + * @param controller {@link MultiblockControllerBase} The dirty controller */ public static void addDirtyController(World world, MultiblockControllerBase controller) { if (registries.containsKey(world)) { registries.get(world).addDirtyController(controller); } else { - RebornCore.LOGGER.error("Adding a dirty controller to a world that has no registered controllers! This is most likey not an issue with reborn core, please check the full log file for more infomation!"); + RebornCore.LOGGER.error("Adding a dirty controller to a world that has no registered controllers! This is most likely not an issue with reborn core, please check the full log file for more information!"); } } @@ -123,8 +123,8 @@ public class MultiblockRegistry { * Call to mark a controller as dead. It should only be marked as dead when * it has no connected parts. It will be removed after the next world tick. * - * @param world The world formerly containing the multiblock - * @param controller The dead controller + * @param world {@link World} The world formerly containing the multiblock + * @param controller {@link MultiblockControllerBase} The dead controller */ public static void addDeadController(World world, MultiblockControllerBase controller) { if (registries.containsKey(world)) { @@ -137,9 +137,9 @@ public class MultiblockRegistry { } /** - * @param world The world whose controllers you wish to retrieve. - * @return An unmodifiable set of controllers active in the given world, or - * null if there are none. + * @param world {@link World} The world whose controllers you wish to retrieve. + * @return {@link Set} An unmodifiable set of {@link MultiblockControllerBase} + * controllers active in the given world, or null if there are none. */ public static Set getControllersFromWorld(World world) { if (registries.containsKey(world)) { diff --git a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockWorldRegistry.java b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockWorldRegistry.java index 9eff7fdfc..d7a687631 100644 --- a/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockWorldRegistry.java +++ b/RebornCore/src/main/java/reborncore/common/multiblock/MultiblockWorldRegistry.java @@ -311,7 +311,7 @@ public class MultiblockWorldRegistry { * during the next tick. If the chunk is not loaded, it will be added to a * list of objects waiting for a chunkload. * - * @param part The part which is being added to this world. + * @param part {@link IMultiblockPart} The part which is being added to this world. */ public void onPartAdded(IMultiblockPart part) { BlockPos pos = part.getWorldLocation(); @@ -342,7 +342,7 @@ public class MultiblockWorldRegistry { * chunk unloads. This part is removed from any lists in which it may be, * and its machine is marked for recalculation. * - * @param part The part which is being removed. + * @param part {@link IMultiblockPart} The part which is being removed. */ public void onPartRemovedFromWorld(IMultiblockPart part) { BlockPos pos = part.getWorldLocation(); @@ -394,12 +394,11 @@ public class MultiblockWorldRegistry { } /** - * Called when a chunk has finished loading. Adds all of the parts which are + * Called when a chunk has finished loading. Adds all the parts which are * awaiting load to the list of parts which are orphans and therefore will - * be added to machines after the next world tick. + * be added to the machines after the next world tick. * - * @param chunk Chunk that was - * loaded + * @param chunk {@link Chunk} Chunk that was loaded */ public void onChunkLoaded(Chunk chunk) { int chunkHash = chunk.getPos().hashCode(); @@ -418,7 +417,7 @@ public class MultiblockWorldRegistry { * next world tick. Note that a controller must shed all of its blocks * before being marked as dead, or the system will complain at you. * - * @param deadController The controller which is dead. + * @param deadController {@link MultiblockControllerBase} The controller which is dead. */ public void addDeadController(MultiblockControllerBase deadController) { this.deadControllers.add(deadController); @@ -429,7 +428,7 @@ public class MultiblockWorldRegistry { * changed, and it must be re-checked for assembly and, possibly, for * orphans. * - * @param dirtyController The dirty controller. + * @param dirtyController {@link MultiblockControllerBase} The dirty controller. */ public void addDirtyController(MultiblockControllerBase dirtyController) { this.dirtyControllers.add(dirtyController); @@ -439,8 +438,8 @@ public class MultiblockWorldRegistry { * Use this only if you know what you're doing. You should rarely need to * iterate over all controllers in a world! * - * @return An (unmodifiable) set of controllers which are active in this - * world. + * @return {@link Set} An (unmodifiable) set of {@link MultiblockControllerBase} + * controllers which are active in this world. */ public Set getControllers() { return Collections.unmodifiableSet(controllers); diff --git a/RebornCore/src/main/java/reborncore/common/multiblock/rectangular/RectangularMultiblockBlockEntityBase.java b/RebornCore/src/main/java/reborncore/common/multiblock/rectangular/RectangularMultiblockBlockEntityBase.java index 92270850b..7f6699264 100644 --- a/RebornCore/src/main/java/reborncore/common/multiblock/rectangular/RectangularMultiblockBlockEntityBase.java +++ b/RebornCore/src/main/java/reborncore/common/multiblock/rectangular/RectangularMultiblockBlockEntityBase.java @@ -121,7 +121,7 @@ public abstract class RectangularMultiblockBlockEntityBase extends MultiblockBlo } } - // /// Validation Helpers (IMultiblockPart) + // Validation Helpers (IMultiblockPart) public abstract void isGoodForFrame() throws MultiblockValidationException; public abstract void isGoodForSides() throws MultiblockValidationException; diff --git a/RebornCore/src/main/java/reborncore/common/multiblock/rectangular/RectangularMultiblockControllerBase.java b/RebornCore/src/main/java/reborncore/common/multiblock/rectangular/RectangularMultiblockControllerBase.java index ed4c092fa..54149810c 100644 --- a/RebornCore/src/main/java/reborncore/common/multiblock/rectangular/RectangularMultiblockControllerBase.java +++ b/RebornCore/src/main/java/reborncore/common/multiblock/rectangular/RectangularMultiblockControllerBase.java @@ -37,8 +37,8 @@ public abstract class RectangularMultiblockControllerBase extends MultiblockCont } /** - * @return True if the machine is "whole" and should be assembled. False - * otherwise. + * @throws MultiblockValidationException If the machine is not "whole" and + * should not be assembled. */ @Override protected void isMachineWhole() throws MultiblockValidationException { diff --git a/RebornCore/src/main/java/reborncore/common/network/ExtendedPacketBuffer.java b/RebornCore/src/main/java/reborncore/common/network/ExtendedPacketBuffer.java index 6e5d29f62..251e17f6b 100644 --- a/RebornCore/src/main/java/reborncore/common/network/ExtendedPacketBuffer.java +++ b/RebornCore/src/main/java/reborncore/common/network/ExtendedPacketBuffer.java @@ -52,7 +52,7 @@ public class ExtendedPacketBuffer extends PacketByteBuf { return ObjectBufferUtils.readObject(this); } - // Supports reading and writing list codec's + // Supports reading and writing list codecs public void writeCodec(Codec codec, T object) { DataResult dataResult = codec.encodeStart(NbtOps.INSTANCE, object); if (dataResult.error().isPresent()) { diff --git a/RebornCore/src/main/java/reborncore/common/network/ServerBoundPackets.java b/RebornCore/src/main/java/reborncore/common/network/ServerBoundPackets.java index 2849b678a..37d505d12 100644 --- a/RebornCore/src/main/java/reborncore/common/network/ServerBoundPackets.java +++ b/RebornCore/src/main/java/reborncore/common/network/ServerBoundPackets.java @@ -54,7 +54,8 @@ public class ServerBoundPackets { IdentifiedPacket packetFluidConfigSync = ClientBoundPackets.createPacketFluidConfigSync(pos, legacyMachineBase.fluidConfiguration); NetworkManager.sendToTracking(packetFluidConfigSync, legacyMachineBase); - //We update the block to allow pipes that are connecting to detctect the update and change their connection status if needed + // We update the block to allow pipes that are connecting to detect the update and change their + // connection status if needed World world = legacyMachineBase.getWorld(); BlockState blockState = world.getBlockState(legacyMachineBase.getPos()); world.updateNeighborsAlways(legacyMachineBase.getPos(), blockState.getBlock()); @@ -89,7 +90,7 @@ public class ServerBoundPackets { config.setInput(input); config.setOutput(output); - //Syncs back to the client + // Syncs back to the client IdentifiedPacket packetFluidConfigSync = ClientBoundPackets.createPacketFluidConfigSync(pos, legacyMachineBase.fluidConfiguration); NetworkManager.sendToTracking(packetFluidConfigSync, legacyMachineBase); }); @@ -112,7 +113,7 @@ public class ServerBoundPackets { holder.setInput(input); holder.setOutput(output); - holder.setfilter(filter); + holder.setFilter(filter); //Syncs back to the client IdentifiedPacket packetSlotSync = ClientBoundPackets.createPacketSlotSync(pos, machineBase.getSlotConfiguration()); @@ -204,7 +205,7 @@ public class ServerBoundPackets { }); } - public static IdentifiedPacket requestChunkloaderChunks(BlockPos pos) { + public static IdentifiedPacket requestChunkLoaderChunks(BlockPos pos) { return NetworkManager.createServerBoundPacket(new Identifier("reborncore", "chunk_loader_request"), packetBuffer -> { packetBuffer.writeBlockPos(pos); }); diff --git a/RebornCore/src/main/java/reborncore/common/powerSystem/PowerAcceptorBlockEntity.java b/RebornCore/src/main/java/reborncore/common/powerSystem/PowerAcceptorBlockEntity.java index 817a07900..98242e410 100644 --- a/RebornCore/src/main/java/reborncore/common/powerSystem/PowerAcceptorBlockEntity.java +++ b/RebornCore/src/main/java/reborncore/common/powerSystem/PowerAcceptorBlockEntity.java @@ -26,13 +26,10 @@ package reborncore.common.powerSystem; import net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext; import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; -import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; -import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleSlotStorage; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntityType; import net.minecraft.inventory.Inventory; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; import net.minecraft.text.Text; import net.minecraft.text.TranslatableText; @@ -43,6 +40,7 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; import reborncore.api.IListInfoProvider; +import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.blockentity.RedstoneConfiguration; import reborncore.common.util.StringUtils; @@ -77,7 +75,7 @@ public abstract class PowerAcceptorBlockEntity extends MachineBaseBlockEntity im public int extraTier; public long powerChange; public long powerLastTick; - public boolean checkOverfill = true; // Set to false to disable the overfill check. + public boolean checkOverfill = true; // Set false to disable overfill check. public PowerAcceptorBlockEntity(BlockEntityType type, BlockPos pos, BlockState state) { super(type, pos, state); @@ -99,7 +97,7 @@ public abstract class PowerAcceptorBlockEntity extends MachineBaseBlockEntity im /** * Get amount of missing energy * - * @return double Free space for energy in internal buffer + * @return {@code long} Free space for energy in internal buffer */ public long getFreeSpace() { return getMaxStoredPower() - getStored(); @@ -108,7 +106,7 @@ public abstract class PowerAcceptorBlockEntity extends MachineBaseBlockEntity im /** * Adds energy to block entity * - * @param amount double Amount to add + * @param amount {@code long} Amount to add */ public void addEnergy(long amount){ setStored(getEnergy() + amount); @@ -127,7 +125,7 @@ public abstract class PowerAcceptorBlockEntity extends MachineBaseBlockEntity im /** * Use energy from block entity * - * @param amount double Amount of energy to use + * @param amount {@code long} Amount of energy to use */ public void useEnergy(long amount){ if (getEnergy() > amount) { @@ -140,7 +138,7 @@ public abstract class PowerAcceptorBlockEntity extends MachineBaseBlockEntity im /** * Charge machine from battery placed inside inventory slot * - * @param slot int Slot ID for battery slot + * @param slot {@code int} Slot ID for battery slot */ public void charge(int slot) { if (world == null) { @@ -170,7 +168,7 @@ public abstract class PowerAcceptorBlockEntity extends MachineBaseBlockEntity im /** * Charge battery placed inside inventory slot from machine * - * @param slot int Slot ID for battery slot + * @param slot {@code int} Slot ID for battery slot */ public void discharge(int slot) { if (world == null) { @@ -197,10 +195,13 @@ public abstract class PowerAcceptorBlockEntity extends MachineBaseBlockEntity im /** * Calculates the comparator output of a powered BE with the formula - * {@code ceil(blockEntity.getStored() * 15.0 / storage.getMaxPower())}. + *
+	 *  ceil(blockEntity.getStored() * 15.0 / storage.getMaxPower())
+	 * 
* - * @param blockEntity the powered BE - * @return the calculated comparator output or 0 if {@code blockEntity} is not a {@code PowerAcceptorBlockEntity} + * @param blockEntity {@link BlockEntity} the powered BE + * @return {@code int} the calculated comparator output or 0 if {@link BlockEntity} + * is not a {@link PowerAcceptorBlockEntity} */ public static int calculateComparatorOutputFromEnergy(@Nullable BlockEntity blockEntity) { if (blockEntity instanceof PowerAcceptorBlockEntity storage) { @@ -213,7 +214,7 @@ public abstract class PowerAcceptorBlockEntity extends MachineBaseBlockEntity im /** * Check if machine should load energy data from NBT * - * @return boolean Returns true if machine should load energy data from NBT + * @return {@code boolean} Returns true if machine should load energy data from NBT */ protected boolean shouldHandleEnergyNBT() { return true; @@ -222,8 +223,8 @@ public abstract class PowerAcceptorBlockEntity extends MachineBaseBlockEntity im /** * Check if block entity can accept energy from a particular side * - * @param side EnergySide Machine side - * @return boolean Returns true if machine can accept energy from side provided + * @param side {@link Direction} Machine side + * @return {@code boolean} Returns true if machine can accept energy from side provided */ protected boolean canAcceptEnergy(@Nullable Direction side){ return true; @@ -232,62 +233,68 @@ public abstract class PowerAcceptorBlockEntity extends MachineBaseBlockEntity im /** * Check if block entity can provide energy via a particular side * - * @param side EnergySide Machine side - * @return boolean Returns true if machine can provide energy via particular side + * @param side {@link Direction} Machine side + * @return {@code boolean} Returns true if machine can provide energy via particular side */ protected boolean canProvideEnergy(@Nullable Direction side){ return true; } /** - * Wrapper method used to sync additional energy storage values with client via BlockEntityScreenHandlerBuilder + * Wrapper method used to sync additional energy storage values with client via + * {@link BlockEntityScreenHandlerBuilder} * - * @return double Size of additional energy buffer + * @return {@code long} Size of additional energy buffer */ public long getExtraPowerStorage(){ return extraPowerStorage; } /** - * Wrapper method used to sync additional energy storage values with client via BlockEntityScreenHandlerBuilder + * Wrapper method used to sync additional energy storage values with client via + * {@link BlockEntityScreenHandlerBuilder} * - * @param extraPowerStorage double Size of additional energy buffer + * @param extraPowerStorage {@code long} Size of additional energy buffer */ public void setExtraPowerStorage(long extraPowerStorage) { this.extraPowerStorage = extraPowerStorage; } /** - * Wrapper method used to sync energy change values with client via BlockEntityScreenHandlerBuilder + * Wrapper method used to sync energy change values with client via + * {@link BlockEntityScreenHandlerBuilder} * - * @return double Energy change per tick + * @return {@code long} Energy change per tick */ public long getPowerChange() { return powerChange; } /** - * Wrapper method used to sync energy change values with client via BlockEntityScreenHandlerBuilder + * Wrapper method used to sync energy change values with client via + * {@link BlockEntityScreenHandlerBuilder} * - * @param powerChange double Energy change per tick + * @param powerChange {@code long} Energy change per tick */ public void setPowerChange(long powerChange) { this.powerChange = powerChange; } /** - * Wrapper method used to sync energy values with client via BlockEntityScreenHandlerBuilder + * Wrapper method used to sync energy values with client via + * {@link BlockEntityScreenHandlerBuilder} * - * @return double Energy stored in block entity + * @return {@code long} Energy stored in block entity */ - public long getEnergy() { - return getStored(); + return getStored(); } /** - * Wrapper method used to sync energy values with client via BlockEntityScreenHandlerBuilder - * @param energy double Energy stored in block entity + * Wrapper method used to sync energy values with client via + * {@link BlockEntityScreenHandlerBuilder} + * + * @param energy {@code long} Energy stored in block entity */ public void setEnergy(long energy) { setStored(energy); @@ -296,21 +303,21 @@ public abstract class PowerAcceptorBlockEntity extends MachineBaseBlockEntity im /** * Returns base size of internal Energy buffer of a particular machine before any upgrades applied * - * @return double Size of internal Energy buffer + * @return {@code long} Size of internal Energy buffer */ public abstract long getBaseMaxPower(); /** * Returns base output rate or zero if machine doesn't output energy * - * @return double Output rate, E\t + * @return {@code long} Output rate, E\t */ public abstract long getBaseMaxOutput(); /** * Returns base input rate or zero if machine doesn't accept energy * - * @return double Input rate, E\t + * @return {@code long} Input rate, E\t */ public abstract long getBaseMaxInput(); @@ -346,7 +353,7 @@ public abstract class PowerAcceptorBlockEntity extends MachineBaseBlockEntity im super.readNbt(tag); NbtCompound data = tag.getCompound("PowerAcceptor"); if (shouldHandleEnergyNBT()) { - // Bypass the overfill check in setStored() because upgrades have not yet been applied. + // Bypass overfill check in setStored() because upgrades have not yet been applied. this.energyContainer.amount = data.getLong("energy"); } } diff --git a/RebornCore/src/main/java/reborncore/common/powerSystem/RcEnergyItem.java b/RebornCore/src/main/java/reborncore/common/powerSystem/RcEnergyItem.java index 6bc5c9f12..9c8bd1908 100644 --- a/RebornCore/src/main/java/reborncore/common/powerSystem/RcEnergyItem.java +++ b/RebornCore/src/main/java/reborncore/common/powerSystem/RcEnergyItem.java @@ -5,13 +5,16 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.Hand; import reborncore.common.util.ItemUtils; +import team.reborn.energy.api.EnergyStorage; import team.reborn.energy.api.base.SimpleBatteryItem; /** - * Implement on simple energy-containing items and (on top of what SimpleBatteryItem does): + * Implement on simple energy-containing items and (on top of what {@link SimpleBatteryItem} does): *
    - *
  • A tooltip will be added for the item, indicating the stored power, the max power and the extraction rates.
  • - *
  • Any RcEnergyItem input in a crafting recipe input will automatically give its energy to the output if the output implements RcEnergyItem.
  • + *
  • A tooltip will be added for the item, indicating the stored power, + * the max power and the extraction rates.
  • + *
  • Any {@link RcEnergyItem} input in a crafting recipe input will automatically + * give its energy to the output if the output implements {@link RcEnergyItem}.
  • *
* TODO: consider moving this functionality to the energy API? */ @@ -19,7 +22,7 @@ public interface RcEnergyItem extends SimpleBatteryItem, FabricItem { long getEnergyCapacity(); /** - * @return the tier of this EnergyStorage, used to have standard I/O rates. + * @return {@link RcEnergyTier} the tier of this {@link EnergyStorage}, used to have standard I/O rates. */ RcEnergyTier getTier(); diff --git a/RebornCore/src/main/java/reborncore/common/recipes/ICrafterSoundHanlder.java b/RebornCore/src/main/java/reborncore/common/recipes/ICrafterSoundHandler.java similarity index 97% rename from RebornCore/src/main/java/reborncore/common/recipes/ICrafterSoundHanlder.java rename to RebornCore/src/main/java/reborncore/common/recipes/ICrafterSoundHandler.java index d61768e71..e433bdc64 100644 --- a/RebornCore/src/main/java/reborncore/common/recipes/ICrafterSoundHanlder.java +++ b/RebornCore/src/main/java/reborncore/common/recipes/ICrafterSoundHandler.java @@ -29,7 +29,7 @@ import net.minecraft.block.entity.BlockEntity; /** * Created by Mark on 01/07/2017. */ -public interface ICrafterSoundHanlder { +public interface ICrafterSoundHandler { void playSound(boolean firstRun, BlockEntity blockEntity); diff --git a/RebornCore/src/main/java/reborncore/common/recipes/IUpgradeHandler.java b/RebornCore/src/main/java/reborncore/common/recipes/IUpgradeHandler.java index 06ce115e8..f08da4267 100644 --- a/RebornCore/src/main/java/reborncore/common/recipes/IUpgradeHandler.java +++ b/RebornCore/src/main/java/reborncore/common/recipes/IUpgradeHandler.java @@ -25,22 +25,22 @@ package reborncore.common.recipes; /** - * This class isnt designed to be used by other mods, if you want to have upgrades have your + * This class isn't designed to be used by other mods, if you want to have upgrades have your */ public interface IUpgradeHandler { - void resetSpeedMulti(); + void resetSpeedMultiplier(); double getSpeedMultiplier(); - void addPowerMulti(double amount); + void addPowerMultiplier(double amount); - void resetPowerMulti(); + void resetPowerMultiplier(); double getPowerMultiplier(); long getEuPerTick(long baseEu); - void addSpeedMulti(double amount); + void addSpeedMultiplier(double amount); } diff --git a/RebornCore/src/main/java/reborncore/common/recipes/RecipeCrafter.java b/RebornCore/src/main/java/reborncore/common/recipes/RecipeCrafter.java index f748f2358..f045166b2 100644 --- a/RebornCore/src/main/java/reborncore/common/recipes/RecipeCrafter.java +++ b/RebornCore/src/main/java/reborncore/common/recipes/RecipeCrafter.java @@ -98,7 +98,7 @@ public class RecipeCrafter implements IUpgradeHandler { int ticksSinceLastChange; @Nullable - public static ICrafterSoundHanlder soundHanlder = (firstRun, blockEntity) -> { + public static ICrafterSoundHandler soundHandler = (firstRun, blockEntity) -> { }; public RecipeCrafter(RebornRecipeType recipeType, BlockEntity blockEntity, int inputs, int outputs, RebornInventory inventory, @@ -172,7 +172,7 @@ public class RecipeCrafter implements IUpgradeHandler { currentRecipe = null; currentTickTime = 0; updateCurrentRecipe(); - //Update active sate if the blockEntity isnt going to start crafting again + // Update active state if the blockEntity isn't going to start crafting again if (currentRecipe == null) { setIsActive(); } @@ -181,8 +181,8 @@ public class RecipeCrafter implements IUpgradeHandler { long useRequirement = getEuPerTick(currentRecipe.getPower()); if (energy.tryUseExact(useRequirement)) { currentTickTime++; - if ((currentTickTime == 1 || currentTickTime % 20 == 0) && soundHanlder != null) { - soundHanlder.playSound(false, blockEntity); + if ((currentTickTime == 1 || currentTickTime % 20 == 0) && soundHandler != null) { + soundHandler.playSound(false, blockEntity); } } } @@ -196,11 +196,11 @@ public class RecipeCrafter implements IUpgradeHandler { public void updateCurrentRecipe() { currentTickTime = 0; for (RebornRecipe recipe : recipeType.getRecipes(blockEntity.getWorld())) { - // This checks to see if it has all of the inputs + // This checks to see if it has all the inputs if (!hasAllInputs(recipe)) continue; if (!recipe.canCraft(blockEntity)) continue; - // This checks to see if it can fit all of the outputs + // This checks to see if it can fit all the outputs boolean hasOutputSpace = true; for (int i = 0; i < recipe.getOutputs().size(); i++) { if (!canFitOutput(recipe.getOutputs().get(i), outputSlots[i])) { @@ -246,7 +246,7 @@ public class RecipeCrafter implements IUpgradeHandler { return; } for (RebornIngredient ingredient : currentRecipe.getRebornIngredients()) { - for (int inputSlot : inputSlots) {// Uses all of the inputs + for (int inputSlot : inputSlots) {// Uses all the inputs if (ingredient.test(inventory.getStack(inputSlot))) { inventory.shrinkSlot(inputSlot, ingredient.getCount()); break; @@ -354,8 +354,8 @@ public class RecipeCrafter implements IUpgradeHandler { return inventory.hasChanged(); } - public void setInvDirty(boolean isDiry) { - inventory.setHashChanged(isDiry); + public void setInvDirty(boolean isDirty) { + inventory.setHashChanged(isDirty); } public boolean isStackValidInput(ItemStack stack) { @@ -363,7 +363,8 @@ public class RecipeCrafter implements IUpgradeHandler { return false; } - //Test with a stack with the max stack size as some independents will check the stacksize. Bit of a hack but should work. + // Test with a stack with the max stack size as some independents will check the stack size. + // A bit of a hack but should work. ItemStack largeStack = stack.copy(); largeStack.setCount(largeStack.getMaxCount()); for (RebornRecipe recipe : recipeType.getRecipes(blockEntity.getWorld())) { @@ -377,8 +378,8 @@ public class RecipeCrafter implements IUpgradeHandler { } @Override - public void resetSpeedMulti() { - parentUpgradeHandler.ifPresent(IUpgradeHandler::resetSpeedMulti); + public void resetSpeedMultiplier() { + parentUpgradeHandler.ifPresent(IUpgradeHandler::resetSpeedMultiplier); } @Override @@ -387,13 +388,13 @@ public class RecipeCrafter implements IUpgradeHandler { } @Override - public void addPowerMulti(double amount) { - parentUpgradeHandler.ifPresent(iUpgradeHandler -> iUpgradeHandler.addPowerMulti(amount)); + public void addPowerMultiplier(double amount) { + parentUpgradeHandler.ifPresent(iUpgradeHandler -> iUpgradeHandler.addPowerMultiplier(amount)); } @Override - public void resetPowerMulti() { - parentUpgradeHandler.ifPresent(IUpgradeHandler::resetPowerMulti); + public void resetPowerMultiplier() { + parentUpgradeHandler.ifPresent(IUpgradeHandler::resetPowerMultiplier); } @Override @@ -408,7 +409,7 @@ public class RecipeCrafter implements IUpgradeHandler { } @Override - public void addSpeedMulti(double amount) { - parentUpgradeHandler.ifPresent(iUpgradeHandler -> iUpgradeHandler.addSpeedMulti(amount)); + public void addSpeedMultiplier(double amount) { + parentUpgradeHandler.ifPresent(iUpgradeHandler -> iUpgradeHandler.addSpeedMultiplier(amount)); } } diff --git a/RebornCore/src/main/java/reborncore/common/util/CalenderUtils.java b/RebornCore/src/main/java/reborncore/common/util/CalenderUtils.java index be84df257..20f619d7f 100644 --- a/RebornCore/src/main/java/reborncore/common/util/CalenderUtils.java +++ b/RebornCore/src/main/java/reborncore/common/util/CalenderUtils.java @@ -40,7 +40,7 @@ public class CalenderUtils { calendar.setTimeInMillis(System.currentTimeMillis()); int day = calendar.get(Calendar.DAY_OF_MONTH); - int month = calendar.get(Calendar.MONTH) + 1; //Java months start at 0 + int month = calendar.get(Calendar.MONTH) + 1; // Java months start at 0 if (month == 12) { if (day >= 24 && day <= 26) { christmas = true; diff --git a/RebornCore/src/main/java/reborncore/common/util/ChatUtils.java b/RebornCore/src/main/java/reborncore/common/util/ChatUtils.java index d10daaaef..c3b7fc348 100644 --- a/RebornCore/src/main/java/reborncore/common/util/ChatUtils.java +++ b/RebornCore/src/main/java/reborncore/common/util/ChatUtils.java @@ -36,12 +36,13 @@ import reborncore.mixin.client.AccessorChatHud; * Class stolen from SteamAgeRevolution, which I stole from BloodMagic, which was stolen from EnderCore, which stole the * idea from ExtraUtilities, who stole it from vanilla. *

- * Original class link: - * https://github.com/SleepyTrousers/EnderCore/blob/master/src/main/java/com/enderio/core/common/util/ChatUtil.java + * Original class link: + * https://github.com/SleepyTrousers/EnderCore/blob/master/src/main/java/com/enderio/core/common/util/ChatUtil.java + *

*/ public class ChatUtils { - private static final int DELETION_ID = 1337; //MAKE THIS UNIQUE PER MOD THAT USES THIS + private static final int DELETION_ID = 1337; // MAKE THIS UNIQUE PER MOD THAT USES THIS public static void sendNoSpamMessages(int messageID, Text message) { if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) { diff --git a/RebornCore/src/main/java/reborncore/common/util/Color.java b/RebornCore/src/main/java/reborncore/common/util/Color.java index f4aeddcce..83ff02ac3 100644 --- a/RebornCore/src/main/java/reborncore/common/util/Color.java +++ b/RebornCore/src/main/java/reborncore/common/util/Color.java @@ -24,7 +24,7 @@ package reborncore.common.util; -//A basic color class that is used in place of the AWT color class as it cannot be used with lwjgl 3 +// A basic color class that is used in place of the AWT color class as it cannot be used with lwjgl 3 public class Color { public final static Color WHITE = new Color(255, 255, 255); diff --git a/RebornCore/src/main/java/reborncore/common/util/DefaultedListCollector.java b/RebornCore/src/main/java/reborncore/common/util/DefaultedListCollector.java index a20666ee9..a389137da 100644 --- a/RebornCore/src/main/java/reborncore/common/util/DefaultedListCollector.java +++ b/RebornCore/src/main/java/reborncore/common/util/DefaultedListCollector.java @@ -35,7 +35,11 @@ import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collector; -//Taken from https://github.com/The-Acronym-Coders/BASE/blob/develop/1.12.0/src/main/java/com/teamacronymcoders/base/util/collections/NonnullListCollector.java, thanks for this ;) +/** + * Taken from + * here, + * thanks for this ;) + */ public class DefaultedListCollector implements Collector, DefaultedList> { private final Set CH_ID = Collections.unmodifiableSet(EnumSet.of(Characteristics.IDENTITY_FINISH)); @@ -71,4 +75,4 @@ public class DefaultedListCollector implements Collector, public Set characteristics() { return CH_ID; } -} \ No newline at end of file +} diff --git a/RebornCore/src/main/java/reborncore/common/util/FluidTextHelper.java b/RebornCore/src/main/java/reborncore/common/util/FluidTextHelper.java index 0c8bd0ece..969580ea0 100644 --- a/RebornCore/src/main/java/reborncore/common/util/FluidTextHelper.java +++ b/RebornCore/src/main/java/reborncore/common/util/FluidTextHelper.java @@ -13,6 +13,12 @@ public class FluidTextHelper { /** * Return a unicode string representing a fraction, like ¹⁄₈₁. + * + * @param numerator {@code long} The numerator of the fraction. + * @param denominator {@code long} The denominator of the fraction. + * @param simplify {@code boolean} Whether to simplify the fraction. + * @return {@link String} representing the fraction. + * @throws IllegalArgumentException if numerator or denominator is negative. */ public static String getUnicodeFraction(long numerator, long denominator, boolean simplify) { if (numerator < 0 || denominator < 0) @@ -42,15 +48,13 @@ public class FluidTextHelper { } /** - * Convert a non negative fluid amount in droplets to a unicode string + * Convert a non-negative fluid amount in droplets to a unicode string * representing the amount in millibuckets. For example, passing 163 will result * in * *
-	 * 2 ¹⁄₈₁
+	 *  2 ¹⁄₈₁
 	 * 
- * - * . */ public static String getUnicodeMillibuckets(long droplets, boolean simplify) { String result = "" + droplets / 81; diff --git a/RebornCore/src/main/java/reborncore/common/util/InventoryItem.java b/RebornCore/src/main/java/reborncore/common/util/InventoryItem.java index 2ac8fae53..9cacf3757 100644 --- a/RebornCore/src/main/java/reborncore/common/util/InventoryItem.java +++ b/RebornCore/src/main/java/reborncore/common/util/InventoryItem.java @@ -50,7 +50,7 @@ public class InventoryItem extends InventoryBase { this.stack = stack; } - public static InventoryItem getItemInvetory(ItemStack stack, int size) { + public static InventoryItem getItemInventory(ItemStack stack, int size) { return new InventoryItem(stack, size); } diff --git a/RebornCore/src/main/java/reborncore/common/util/ItemHandlerUtils.java b/RebornCore/src/main/java/reborncore/common/util/ItemHandlerUtils.java index 6dd8fd542..5979ef581 100644 --- a/RebornCore/src/main/java/reborncore/common/util/ItemHandlerUtils.java +++ b/RebornCore/src/main/java/reborncore/common/util/ItemHandlerUtils.java @@ -45,7 +45,7 @@ public class ItemHandlerUtils { dropItemHandler(world, pos, inventory); } if (blockEntity instanceof IUpgradeable) { - dropItemHandler(world, pos, ((IUpgradeable) blockEntity).getUpgradeInvetory()); + dropItemHandler(world, pos, ((IUpgradeable) blockEntity).getUpgradeInventory()); } } diff --git a/RebornCore/src/main/java/reborncore/common/util/ItemNBTHelper.java b/RebornCore/src/main/java/reborncore/common/util/ItemNBTHelper.java index 0dd474d2a..7d8fd0d9e 100644 --- a/RebornCore/src/main/java/reborncore/common/util/ItemNBTHelper.java +++ b/RebornCore/src/main/java/reborncore/common/util/ItemNBTHelper.java @@ -31,15 +31,15 @@ import net.minecraft.nbt.NbtList; public class ItemNBTHelper { /** - * Checks if an ItemStack has a Tag Compound + * Checks if an {@link ItemStack} has an {@link NbtCompound} **/ public static boolean detectNBT(ItemStack stack) { return stack.hasNbt(); } /** - * Tries to initialize an NBT Tag Compound in an ItemStack, this will not do - * anything if the stack already has a tag compound + * Tries to initialize an {@link NbtCompound} in an {@link ItemStack}, this will not do + * anything if the stack already has an {@link NbtCompound} **/ public static void initNBT(ItemStack stack) { if (!detectNBT(stack)) { @@ -48,7 +48,7 @@ public class ItemNBTHelper { } /** - * Injects an NBT Tag Compound to an ItemStack, no checks are made + * Injects an {@link NbtCompound} to an {@link ItemStack}, no checks are made * previously **/ public static void injectNBT(ItemStack stack, NbtCompound nbt) { @@ -56,7 +56,7 @@ public class ItemNBTHelper { } /** - * Gets the NBTTagCompound in an ItemStack. Tries to init it previously in + * Gets the {@link NbtCompound} in an {@link ItemStack}. Tries to init it previously in * case there isn't one present **/ public static NbtCompound getNBT(ItemStack stack) { @@ -113,53 +113,53 @@ public class ItemNBTHelper { // GETTERS // /////////////////////////////////////////////////////////////////// - public static boolean verifyExistance(ItemStack stack, String tag) { + public static boolean verifyExistence(ItemStack stack, String tag) { return !stack.isEmpty() && getNBT(stack).contains(tag); } public static boolean getBoolean(ItemStack stack, String tag, boolean defaultExpected) { - return verifyExistance(stack, tag) ? getNBT(stack).getBoolean(tag) : defaultExpected; + return verifyExistence(stack, tag) ? getNBT(stack).getBoolean(tag) : defaultExpected; } public static byte getByte(ItemStack stack, String tag, byte defaultExpected) { - return verifyExistance(stack, tag) ? getNBT(stack).getByte(tag) : defaultExpected; + return verifyExistence(stack, tag) ? getNBT(stack).getByte(tag) : defaultExpected; } public static short getShort(ItemStack stack, String tag, short defaultExpected) { - return verifyExistance(stack, tag) ? getNBT(stack).getShort(tag) : defaultExpected; + return verifyExistence(stack, tag) ? getNBT(stack).getShort(tag) : defaultExpected; } public static int getInt(ItemStack stack, String tag, int defaultExpected) { - return verifyExistance(stack, tag) ? getNBT(stack).getInt(tag) : defaultExpected; + return verifyExistence(stack, tag) ? getNBT(stack).getInt(tag) : defaultExpected; } public static long getLong(ItemStack stack, String tag, long defaultExpected) { - return verifyExistance(stack, tag) ? getNBT(stack).getLong(tag) : defaultExpected; + return verifyExistence(stack, tag) ? getNBT(stack).getLong(tag) : defaultExpected; } public static float getFloat(ItemStack stack, String tag, float defaultExpected) { - return verifyExistance(stack, tag) ? getNBT(stack).getFloat(tag) : defaultExpected; + return verifyExistence(stack, tag) ? getNBT(stack).getFloat(tag) : defaultExpected; } public static double getDouble(ItemStack stack, String tag, double defaultExpected) { - return verifyExistance(stack, tag) ? getNBT(stack).getDouble(tag) : defaultExpected; + return verifyExistence(stack, tag) ? getNBT(stack).getDouble(tag) : defaultExpected; } /** - * If nullifyOnFail is true it'll return null if it doesn't find any + * If {@code nullifyOnFail} is true it'll return null if it doesn't find any * compounds, otherwise it'll return a new one. **/ public static NbtCompound getCompound(ItemStack stack, String tag, boolean nullifyOnFail) { - return verifyExistance(stack, tag) ? getNBT(stack).getCompound(tag) + return verifyExistence(stack, tag) ? getNBT(stack).getCompound(tag) : nullifyOnFail ? null : new NbtCompound(); } public static String getString(ItemStack stack, String tag, String defaultExpected) { - return verifyExistance(stack, tag) ? getNBT(stack).getString(tag) : defaultExpected; + return verifyExistence(stack, tag) ? getNBT(stack).getString(tag) : defaultExpected; } - public static NbtList getList(ItemStack stack, String tag, int objtype, boolean nullifyOnFail) { - return verifyExistance(stack, tag) ? getNBT(stack).getList(tag, objtype) + public static NbtList getList(ItemStack stack, String tag, int objType, boolean nullifyOnFail) { + return verifyExistence(stack, tag) ? getNBT(stack).getList(tag, objType) : nullifyOnFail ? null : new NbtList(); } } diff --git a/RebornCore/src/main/java/reborncore/common/util/ItemUtils.java b/RebornCore/src/main/java/reborncore/common/util/ItemUtils.java index 73d8b0468..bbb4fbfe7 100644 --- a/RebornCore/src/main/java/reborncore/common/util/ItemUtils.java +++ b/RebornCore/src/main/java/reborncore/common/util/ItemUtils.java @@ -147,8 +147,8 @@ public class ItemUtils { /** * Checks if powered item is active * - * @param stack ItemStack ItemStack to check - * @return True if powered item is active + * @param stack {@link ItemStack} Stack to check + * @return {@code boolean} True if powered item is active */ public static boolean isActive(ItemStack stack) { return !stack.isEmpty() && stack.getNbt() != null && stack.getNbt().getBoolean("isActive"); @@ -157,10 +157,10 @@ public class ItemUtils { /** * Check if powered item has enough energy to continue being in active state * - * @param stack ItemStack ItemStack to check - * @param cost int Cost of operation performed by tool - * @param isClient boolean Client side - * @param messageId int MessageID for sending no spam message + * @param stack {@link ItemStack} Stack to check + * @param cost {@link int} Cost of operation performed by tool + * @param isClient {@link boolean} Client side + * @param messageId {@link int} MessageID for sending no spam message */ public static void checkActive(ItemStack stack, int cost, boolean isClient, int messageId) { if (!ItemUtils.isActive(stack)) { @@ -185,10 +185,10 @@ public class ItemUtils { /** * Switch active\inactive state for powered item * - * @param stack ItemStack ItemStack to work on - * @param cost int Cost of operation performed by tool - * @param isClient boolean Are we on client side - * @param messageId MessageID for sending no spam message + * @param stack {@link ItemStack} Stack to switch state + * @param cost {@code int} Cost of operation performed by tool + * @param isClient {@code boolean} Are we on client side + * @param messageId {@code int} MessageID for sending no spam message */ public static void switchActive(ItemStack stack, int cost, boolean isClient, int messageId) { ItemUtils.checkActive(stack, cost, isClient, messageId); @@ -225,8 +225,8 @@ public class ItemUtils { /** * Adds active\inactive state to powered item tooltip * - * @param stack ItemStack ItemStack to check - * @param tooltip List Tooltip strings + * @param stack {@link ItemStack} Stack to check + * @param tooltip {@link List} List of {@link Text} tooltip strings */ public static void buildActiveTooltip(ItemStack stack, List tooltip) { if (!ItemUtils.isActive(stack)) { @@ -237,16 +237,25 @@ public class ItemUtils { } /** - * Output energy from item to other items in inventory + * Output energy from item to other items in inventory * - * @param player PlayerEntity having powered item - * @param itemStack ItemStack Powered item - * @param maxOutput int Maximum output rate of powered item + * @param player {@link PlayerEntity} Player having powered item + * @param itemStack {@link ItemStack} Powered item + * @param maxOutput {@code int} Maximum output rate of powered item */ public static void distributePowerToInventory(PlayerEntity player, ItemStack itemStack, long maxOutput) { distributePowerToInventory(player, itemStack, maxOutput, (stack) -> true); } + /** + * Output energy from item to other items in inventory + * + * @param player {@link PlayerEntity} Player having powered item + * @param itemStack {@link ItemStack} Powered item + * @param maxOutput {@code int} Maximum output rate of powered item + * @param filter {@link Predicate} Filter for items to output to + * @throws IllegalArgumentException If failed to locate stack in players inventory + */ public static void distributePowerToInventory(PlayerEntity player, ItemStack itemStack, long maxOutput, Predicate filter) { // Locate the current stack in the player inventory. PlayerInventoryStorage playerInv = PlayerInventoryStorage.of(player); diff --git a/RebornCore/src/main/java/reborncore/common/util/MachineFacing.java b/RebornCore/src/main/java/reborncore/common/util/MachineFacing.java index 69633cefd..847814d54 100644 --- a/RebornCore/src/main/java/reborncore/common/util/MachineFacing.java +++ b/RebornCore/src/main/java/reborncore/common/util/MachineFacing.java @@ -43,7 +43,7 @@ public enum MachineFacing { return machineBase.getFacing().getOpposite(); } if (this == RIGHT) { - //North -> West + // North -> West int i = machineBase.getFacing().getOpposite().getHorizontal() + 1; if (i > 3) { i = 0; @@ -54,7 +54,7 @@ public enum MachineFacing { return Direction.fromHorizontal(i); } if (this == LEFT) { - //North -> East + // North -> East int i = machineBase.getFacing().getOpposite().getHorizontal() - 1; if (i > 3) { i = 0; diff --git a/RebornCore/src/main/java/reborncore/common/util/RebornInventory.java b/RebornCore/src/main/java/reborncore/common/util/RebornInventory.java index ce840ee62..f2526584b 100644 --- a/RebornCore/src/main/java/reborncore/common/util/RebornInventory.java +++ b/RebornCore/src/main/java/reborncore/common/util/RebornInventory.java @@ -43,12 +43,12 @@ public class RebornInventory extends Inventory public RebornInventory(int size, String invName, int invStackLimit, T blockEntity, IInventoryAccess access) { super(size); name = invName; - stackLimit = (invStackLimit == 64 ? Items.AIR.getMaxCount() : invStackLimit); //Blame asie for this + stackLimit = (invStackLimit == 64 ? Items.AIR.getMaxCount() : invStackLimit); // Blame asie for this this.blockEntity = blockEntity; this.inventoryAccess = access; } - //If you are using this with a machine, dont forget to set .withConfiguredAccess() + // If you are using this with a machine, don't forget to set .withConfiguredAccess() public RebornInventory(int size, String invName, int invStackLimit, T blockEntity) { this(size, invName, invStackLimit, blockEntity, (slotID, stack, facing, direction, be) -> { if (facing == null) { @@ -99,8 +99,8 @@ public class RebornInventory extends Inventory } public void read(NbtCompound data, String tag) { - NbtCompound nbttaglist = data.getCompound(tag); - deserializeNBT(nbttaglist); + NbtCompound nbtTagList = data.getCompound(tag); + deserializeNBT(nbtTagList); hasChanged = true; } diff --git a/RebornCore/src/main/java/reborncore/common/util/StringUtils.java b/RebornCore/src/main/java/reborncore/common/util/StringUtils.java index 63ac4f178..b110a684c 100644 --- a/RebornCore/src/main/java/reborncore/common/util/StringUtils.java +++ b/RebornCore/src/main/java/reborncore/common/util/StringUtils.java @@ -54,8 +54,8 @@ public class StringUtils { /** * Returns red-yellow-green text formatting depending on percentage * - * @param percentage int percentage amount - * @return TextFormatting Red or Yellow or Green + * @param percentage {@code int} percentage amount + * @return {@link Formatting} Red or Yellow or Green */ public static Formatting getPercentageColour(int percentage) { if (percentage <= 10) { diff --git a/RebornCore/src/main/java/reborncore/common/util/Tank.java b/RebornCore/src/main/java/reborncore/common/util/Tank.java index 67b251a23..dd5a34ce5 100644 --- a/RebornCore/src/main/java/reborncore/common/util/Tank.java +++ b/RebornCore/src/main/java/reborncore/common/util/Tank.java @@ -107,7 +107,7 @@ public class Tank extends SnapshotParticipant implements Syncable public final Tank read(NbtCompound nbt) { if (nbt.contains(name)) { - // allow to read empty tanks + // allow reading empty tanks setFluid(Fluids.EMPTY); NbtCompound tankData = nbt.getCompound(name); diff --git a/RebornCore/src/main/java/reborncore/common/util/Torus.java b/RebornCore/src/main/java/reborncore/common/util/Torus.java index 7b1bc2e50..782ad3b2e 100644 --- a/RebornCore/src/main/java/reborncore/common/util/Torus.java +++ b/RebornCore/src/main/java/reborncore/common/util/Torus.java @@ -38,13 +38,13 @@ public class Torus { private static final ExecutorService GEN_EXECUTOR = Executors.newSingleThreadExecutor(); private static Int2IntMap torusSizeCache; - public static List generate(BlockPos orgin, int radius) { + public static List generate(BlockPos origin, int radius) { List posLists = new ArrayList<>(); for (int x = -radius; x < radius; x++) { for (int y = -radius; y < radius; y++) { for (int z = -radius; z < radius; z++) { if (Math.pow(radius / 2 - Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)), 2) + Math.pow(z, 2) < Math.pow(radius * 0.05, 2)) { - posLists.add(orgin.add(x, z, y)); + posLists.add(origin.add(x, z, y)); } } } @@ -54,10 +54,10 @@ public class Torus { public static void genSizeMap(int maxRadius) { if (torusSizeCache != null) { - //Lets not do this again + // Let's not do this again return; } - //10 is added as the control computer has a base of around 6 less + // 10 is added as the control computer has a base of around 6 less final int sizeToCompute = maxRadius + 10; torusSizeCache = new Int2IntOpenHashMap(sizeToCompute); @@ -83,6 +83,10 @@ public class Torus { GEN_EXECUTOR.shutdown(); } + /** + * @return {@link Int2IntMap} + * @throws RuntimeException If failed to initialize the map + */ public static Int2IntMap getTorusSizeCache() { if (!GEN_EXECUTOR.isShutdown()) { try { diff --git a/RebornCore/src/main/java/reborncore/common/util/TranslationTools.java b/RebornCore/src/main/java/reborncore/common/util/TranslationTools.java index 8cbd11fac..9a9aa2f26 100644 --- a/RebornCore/src/main/java/reborncore/common/util/TranslationTools.java +++ b/RebornCore/src/main/java/reborncore/common/util/TranslationTools.java @@ -35,10 +35,10 @@ import java.nio.file.Paths; import java.util.*; import java.util.stream.Collectors; -//Quick too to migrate to the new lang format, and to try and keep as many lang entrys as possible +// Quick too to migrate to the new lang format, and to try and keep as many lang entries as possible public class TranslationTools { - //Scanner used for manual matching + // Scanner used for manual matching private static final Scanner SCANNER = new Scanner(System.in); public static void main(String[] args) throws IOException { @@ -68,7 +68,7 @@ public class TranslationTools { key = keyMap.get(key); } if (!newLang.containsKey(key)) { - //Lost key, no point copying them over + // Lost key, no point copying them over continue; } output.put(key, value); diff --git a/RebornCore/src/main/java/reborncore/common/util/WorldUtils.java b/RebornCore/src/main/java/reborncore/common/util/WorldUtils.java index 99a186d2d..418d4fd7e 100644 --- a/RebornCore/src/main/java/reborncore/common/util/WorldUtils.java +++ b/RebornCore/src/main/java/reborncore/common/util/WorldUtils.java @@ -49,9 +49,9 @@ public class WorldUtils { /** * Checks if chunk is loaded using proper chunk manager * - * @param world World object - * @param pos BlockPos X and Z coordinates to check - * @return boolean True if chunk is loaded + * @param world {@link World} World object + * @param pos {@link BlockPos} X and Z coordinates to check + * @return {@code boolean} True if chunk is loaded */ public static boolean isChunkLoaded(World world, BlockPos pos){ return world.getChunkManager().isChunkLoaded(ChunkSectionPos.getSectionCoord(pos.getX()), ChunkSectionPos.getSectionCoord(pos.getZ())); diff --git a/RebornCore/src/main/java/reborncore/common/util/serialization/ItemStackSerializer.java b/RebornCore/src/main/java/reborncore/common/util/serialization/ItemStackSerializer.java index c525c3b5b..0b53eb593 100644 --- a/RebornCore/src/main/java/reborncore/common/util/serialization/ItemStackSerializer.java +++ b/RebornCore/src/main/java/reborncore/common/util/serialization/ItemStackSerializer.java @@ -34,7 +34,7 @@ import net.minecraft.util.registry.Registry; import java.lang.reflect.Type; -//Based from ee3's code +// Based from ee3's code public class ItemStackSerializer implements JsonSerializer, JsonDeserializer { private static final String NAME = "name"; diff --git a/RebornCore/src/main/java/reborncore/common/util/serialization/SerializationUtil.java b/RebornCore/src/main/java/reborncore/common/util/serialization/SerializationUtil.java index 15de9e0f4..34d64877a 100644 --- a/RebornCore/src/main/java/reborncore/common/util/serialization/SerializationUtil.java +++ b/RebornCore/src/main/java/reborncore/common/util/serialization/SerializationUtil.java @@ -42,7 +42,7 @@ public class SerializationUtil { .registerTypeAdapter(ItemStack.class, new ItemStackSerializer()) .create(); - //Same as above, just without pretty printing + // Same as above, just without pretty printing public static final Gson GSON_FLAT = new GsonBuilder() .enableComplexMapKeySerialization() .registerTypeAdapter(ItemStack.class, new ItemStackSerializer()) diff --git a/build.gradle b/build.gradle index 5994cdb7d..322eb9324 100644 --- a/build.gradle +++ b/build.gradle @@ -251,7 +251,7 @@ loom { test.dependsOn runGametest runDatagen { - // Doesnt re-run the task when its up-to date + // Doesn't re-run the task when its up-to date outputs.dir('src/main/generated') } @@ -400,4 +400,4 @@ task checkVersion { github.mustRunAfter checkVersion publish.mustRunAfter checkVersion -project.tasks.curseforge.mustRunAfter checkVersion \ No newline at end of file +project.tasks.curseforge.mustRunAfter checkVersion diff --git a/src/datagen/groovy/techreborn/datagen/recipes/machine/MachineRecipeJsonFactory.groovy b/src/datagen/groovy/techreborn/datagen/recipes/machine/MachineRecipeJsonFactory.groovy index 14f9a0f50..e0283c6ef 100644 --- a/src/datagen/groovy/techreborn/datagen/recipes/machine/MachineRecipeJsonFactory.groovy +++ b/src/datagen/groovy/techreborn/datagen/recipes/machine/MachineRecipeJsonFactory.groovy @@ -133,7 +133,7 @@ class MachineRecipeJsonFactory { protected void validate() { if (ingredients.isEmpty()) { - throw new IllegalStateException("recipe has no ingrendients") + throw new IllegalStateException("recipe has no ingredients") } if (outputs.isEmpty()) { diff --git a/src/main/java/techreborn/TechReborn.java b/src/main/java/techreborn/TechReborn.java index 31e1038af..1bb0b595a 100644 --- a/src/main/java/techreborn/TechReborn.java +++ b/src/main/java/techreborn/TechReborn.java @@ -81,7 +81,7 @@ public class TechReborn implements ModInitializer { if (TechRebornConfig.machineSoundVolume > 0) { if (TechRebornConfig.machineSoundVolume > 1) TechRebornConfig.machineSoundVolume = 1F; - RecipeCrafter.soundHanlder = new ModSounds.SoundHandler(); + RecipeCrafter.soundHandler = new ModSounds.SoundHandler(); } ModLoot.init(); WorldGenerator.initWorldGen(); diff --git a/src/main/java/techreborn/api/events/CableElectrocutionEvent.java b/src/main/java/techreborn/api/events/CableElectrocutionEvent.java index d7f8ad3c3..2401ceeb4 100644 --- a/src/main/java/techreborn/api/events/CableElectrocutionEvent.java +++ b/src/main/java/techreborn/api/events/CableElectrocutionEvent.java @@ -47,7 +47,7 @@ public interface CableElectrocutionEvent { /** * Fired before an entity is electrocuted * - * @return true to electrocute the entity (if not other listeners return false), false to do nothing + * @return {@code boolean} true to electrocute the entity (if not other listeners return false), false to do nothing */ boolean electrocute(LivingEntity livingEntity, TRContent.Cables cableType, BlockPos blockPos, World world, CableBlockEntity cableBlockEntity); } diff --git a/src/main/java/techreborn/api/generator/GeneratorRecipeHelper.java b/src/main/java/techreborn/api/generator/GeneratorRecipeHelper.java index 3e6b65aa0..bbd0b726f 100644 --- a/src/main/java/techreborn/api/generator/GeneratorRecipeHelper.java +++ b/src/main/java/techreborn/api/generator/GeneratorRecipeHelper.java @@ -33,22 +33,24 @@ import java.util.Optional; public class GeneratorRecipeHelper { /** - * This EnumMap store all the energy recipes for the fluid generators. Each - * value of the EFluidGenerator enum is linked to an object holding a set of - * FluidGeneratorRecipe. + * This {@link EnumMap} store all the energy recipes for the fluid generators. Each + * value of the {@link EFluidGenerator} enum is linked to an object holding a set of + * {@link FluidGeneratorRecipe}. */ public static EnumMap fluidRecipes = new EnumMap<>( EFluidGenerator.class); /** - * Register a Fluid energy recipe. + * Register a {@link Fluid} energy recipe. * - * @param generatorType A value of the EFluidGenerator type in which the fluid is - * allowed to be consumed. - * @param fluidType - * @param energyPerMb Represent the energy / MILLI_BUCKET the fluid will produce. - * Some generators use this value to alter their fluid decay - * speed to match their maximum energy output. + * @param generatorType {@link EFluidGenerator} A value of the {@link EFluidGenerator} type in + * which the fluid is allowed to be consumed. + * @param fluidType {@link Fluid} The fluid type that will be registered. + * @param energyPerMb {@code int} Represent the energy / MILLI_BUCKET the fluid will produce. + *

+ * Some generators use this value to alter their fluid decay + * speed to match their maximum energy output. + *

*/ public static void registerFluidRecipe(EFluidGenerator generatorType, Fluid fluidType, int energyPerMb) { fluidRecipes.putIfAbsent(generatorType, new FluidGeneratorRecipeList()); @@ -56,10 +58,10 @@ public class GeneratorRecipeHelper { } /** - * @param generatorType A value of the EFluidGenerator type in which the fluid is - * allowed to be consumed. - * @return An object holding a set of availables recipes for this type of - * FluidGenerator. + * @param generatorType {@link EFluidGenerator} A value of the {@link EFluidGenerator} type in + * which the fluid is allowed to be consumed. + * @return {@link FluidGeneratorRecipeList} An object holding a set of available recipes + * for this type of {@link EFluidGenerator}. */ public static FluidGeneratorRecipeList getFluidRecipesForGenerator(EFluidGenerator generatorType) { return fluidRecipes.get(generatorType); @@ -68,8 +70,9 @@ public class GeneratorRecipeHelper { /** * Removes recipe * - * @param generatorType A value of the EFluidGenerator type for which we should remove recipe - * @param fluidType Fluid to remove from generator recipes + * @param generatorType {@link EFluidGenerator} A value of the {@link EFluidGenerator} type for + * which we should remove recipe + * @param fluidType {@link Fluid} Fluid to remove from generator recipes */ public static void removeFluidRecipe(EFluidGenerator generatorType, Fluid fluidType) { FluidGeneratorRecipeList recipeList = getFluidRecipesForGenerator(generatorType); diff --git a/src/main/java/techreborn/api/recipe/ScrapboxRecipeCrafter.java b/src/main/java/techreborn/api/recipe/ScrapboxRecipeCrafter.java index 3e09d1609..12dba526d 100644 --- a/src/main/java/techreborn/api/recipe/ScrapboxRecipeCrafter.java +++ b/src/main/java/techreborn/api/recipe/ScrapboxRecipeCrafter.java @@ -38,10 +38,10 @@ import java.util.List; public class ScrapboxRecipeCrafter extends RecipeCrafter { /** - * @param parent Tile having this crafter - * @param inventory Inventory from parent blockEntity - * @param inputSlots Slot IDs for input - * @param outputSlots Slot IDs for output + * @param parent {@link BlockEntity} Tile having this crafter + * @param inventory {@link RebornInventory} Inventory from parent blockEntity + * @param inputSlots {@code int[]} Slot IDs for input + * @param outputSlots {@code int[]} Slot IDs for output */ public ScrapboxRecipeCrafter(BlockEntity parent, RebornInventory inventory, int[] inputSlots, int[] outputSlots) { super(ModRecipes.SCRAPBOX, parent, 1, 1, inventory, inputSlots, outputSlots); diff --git a/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java b/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java index 9b299bdc9..3c49a9ea6 100644 --- a/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java +++ b/src/main/java/techreborn/blockentity/cable/CableBlockEntity.java @@ -89,8 +89,9 @@ public class CableBlockEntity extends BlockEntity * This prevents double transfer rates, and back and forth between two cables. */ int blockedSides = 0; + /** - * This is only used during the cable tick, whereas blockedOperations is used between ticks. + * This is only used during the cable tick, whereas {@link #blockedSides} is used between ticks. */ boolean ioBlocked = false; diff --git a/src/main/java/techreborn/blockentity/cable/OfferedEnergyStorage.java b/src/main/java/techreborn/blockentity/cable/OfferedEnergyStorage.java index 3f561ea9e..c3a485840 100644 --- a/src/main/java/techreborn/blockentity/cable/OfferedEnergyStorage.java +++ b/src/main/java/techreborn/blockentity/cable/OfferedEnergyStorage.java @@ -28,7 +28,7 @@ import net.minecraft.util.math.Direction; import team.reborn.energy.api.EnergyStorage; /** - * EnergyStorage adjacent to an energy cable, with some additional info. + * {@link EnergyStorage} adjacent to an energy cable, with some additional info. */ class OfferedEnergyStorage { final CableBlockEntity sourceCable; diff --git a/src/main/java/techreborn/blockentity/data/DataDrivenBEProvider.java b/src/main/java/techreborn/blockentity/data/DataDrivenBEProvider.java index ba7708f69..e8bd356fe 100644 --- a/src/main/java/techreborn/blockentity/data/DataDrivenBEProvider.java +++ b/src/main/java/techreborn/blockentity/data/DataDrivenBEProvider.java @@ -86,7 +86,8 @@ public class DataDrivenBEProvider extends BlockEntityType 0); //Ensure there is an energy slot, doing it here so it crashes on game load + // Ensure there is an energy slot, doing it here ensures it crashes on game load + Validate.isTrue(getEnergySlot() > 0); } @Nullable diff --git a/src/main/java/techreborn/blockentity/data/DataDrivenSlot.java b/src/main/java/techreborn/blockentity/data/DataDrivenSlot.java index 8fb5c129d..769f14805 100644 --- a/src/main/java/techreborn/blockentity/data/DataDrivenSlot.java +++ b/src/main/java/techreborn/blockentity/data/DataDrivenSlot.java @@ -55,7 +55,7 @@ public record DataDrivenSlot(int id, int x, int y, @NotNull SlotType type) { @Environment(EnvType.CLIENT) public void draw(MatrixStack matrixStack, GuiBase guiBase, GuiBase.Layer layer) { - //TODO find a better way to do this + // TODO find a better way to do this if (type() == SlotType.OUTPUT) { guiBase.drawOutputSlot(matrixStack, x(), y(), layer); } else { diff --git a/src/main/java/techreborn/blockentity/data/SlotType.java b/src/main/java/techreborn/blockentity/data/SlotType.java index 0cb0ab5b9..d953b584b 100644 --- a/src/main/java/techreborn/blockentity/data/SlotType.java +++ b/src/main/java/techreborn/blockentity/data/SlotType.java @@ -30,7 +30,7 @@ import java.util.Arrays; import java.util.function.BiConsumer; public enum SlotType { - //Im really not a fan of the way I add the slots to the builder here + // I'm really not a fan of the way I add the slots to the builder here INPUT((builder, slot) -> { builder.slot(slot.id(), slot.x(), slot.y()); }), diff --git a/src/main/java/techreborn/blockentity/generator/BaseFluidGeneratorBlockEntity.java b/src/main/java/techreborn/blockentity/generator/BaseFluidGeneratorBlockEntity.java index 750cbb783..90aa7e5bb 100644 --- a/src/main/java/techreborn/blockentity/generator/BaseFluidGeneratorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/BaseFluidGeneratorBlockEntity.java @@ -37,6 +37,7 @@ import reborncore.api.IToolDrop; import reborncore.api.blockentity.InventoryProvider; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.blocks.BlockMachineBase; +import reborncore.common.fluid.FluidUtils; import reborncore.common.fluid.FluidValue; import reborncore.common.powerSystem.PowerAcceptorBlockEntity; import reborncore.common.util.RebornInventory; @@ -45,7 +46,6 @@ import techreborn.api.generator.EFluidGenerator; import techreborn.api.generator.FluidGeneratorRecipe; import techreborn.api.generator.FluidGeneratorRecipeList; import techreborn.api.generator.GeneratorRecipeHelper; -import reborncore.common.fluid.FluidUtils; public abstract class BaseFluidGeneratorBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, InventoryProvider { diff --git a/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java b/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java index dd85b630b..1a6cc985f 100644 --- a/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java @@ -127,7 +127,7 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I return getPanel().generationRateN; } - // At this point, we know a light source is present and it's clear weather. We need to determine + // At this point, we know a light source is present, and it's clear weather. We need to determine // the level of generation based on % of time through the day, with peak production at noon and // a smooth transition to night production as sun rises/sets float multiplier; diff --git a/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java b/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java index c302a913a..142144d97 100644 --- a/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java @@ -63,7 +63,7 @@ public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity impl ItemStack burnItem; public SolidFuelGeneratorBlockEntity(BlockPos pos, BlockState state) { - super(TRBlockEntities.SOLID_FUEL_GENEREATOR, pos, state); + super(TRBlockEntities.SOLID_FUEL_GENERATOR, pos, state); } public static int getItemBurnTime(@NotNull ItemStack stack) { diff --git a/src/main/java/techreborn/blockentity/generator/basic/WaterMillBlockEntity.java b/src/main/java/techreborn/blockentity/generator/basic/WaterMillBlockEntity.java index 87b83c09c..1b92d2485 100644 --- a/src/main/java/techreborn/blockentity/generator/basic/WaterMillBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/basic/WaterMillBlockEntity.java @@ -46,7 +46,7 @@ import techreborn.init.TRContent; */ public class WaterMillBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop { - int waterblocks = 0; + int waterBlocks = 0; public WaterMillBlockEntity(BlockPos pos, BlockState state) { super(TRBlockEntities.WATER_MILL, pos, state); @@ -62,8 +62,8 @@ public class WaterMillBlockEntity extends PowerAcceptorBlockEntity implements IT if (world.getTime() % 20 == 0) { checkForWater(); } - if (waterblocks > 0) { - addEnergyProbabilistic(waterblocks * TechRebornConfig.waterMillEnergyMultiplier); + if (waterBlocks > 0) { + addEnergyProbabilistic(waterBlocks * TechRebornConfig.waterMillEnergyMultiplier); world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, true)); } else { world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, false)); @@ -71,10 +71,10 @@ public class WaterMillBlockEntity extends PowerAcceptorBlockEntity implements IT } public void checkForWater() { - waterblocks = 0; + waterBlocks = 0; for (Direction facing : Direction.values()) { if (facing.getAxis().isHorizontal() && world.getBlockState(pos.offset(facing)).getBlock() == Blocks.WATER) { - waterblocks++; + waterBlocks++; } } } diff --git a/src/main/java/techreborn/blockentity/lighting/LampBlockEntity.java b/src/main/java/techreborn/blockentity/lighting/LampBlockEntity.java index d86a32da1..f43b9f681 100644 --- a/src/main/java/techreborn/blockentity/lighting/LampBlockEntity.java +++ b/src/main/java/techreborn/blockentity/lighting/LampBlockEntity.java @@ -95,7 +95,7 @@ public class LampBlockEntity extends PowerAcceptorBlockEntity implements IToolDr return 32; } - //MachineBaseBlockEntity + // MachineBaseBlockEntity @Override public Direction getFacing(){ if (world == null){ diff --git a/src/main/java/techreborn/blockentity/machine/GenericMachineBlockEntity.java b/src/main/java/techreborn/blockentity/machine/GenericMachineBlockEntity.java index 4ee5b4b56..05df28f05 100644 --- a/src/main/java/techreborn/blockentity/machine/GenericMachineBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/GenericMachineBlockEntity.java @@ -26,6 +26,7 @@ package techreborn.blockentity.machine; import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntityType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; @@ -57,11 +58,11 @@ public abstract class GenericMachineBlockEntity extends PowerAcceptorBlockEntity public RecipeCrafter crafter; /** - * @param name String Name for a blockEntity. Do we need it at all? - * @param maxInput int Maximum energy input, value in EU - * @param maxEnergy int Maximum energy buffer, value in EU - * @param toolDrop Block Block to drop with wrench - * @param energySlot int Energy slot to use to charge machine from battery + * @param name {@link String} Name for a {@link BlockEntity}. Do we need it at all? + * @param maxInput {@code int} Maximum energy input, value in EU + * @param maxEnergy {@code int} Maximum energy buffer, value in EU + * @param toolDrop {@link Block} Block to drop with wrench + * @param energySlot {@code int} Energy slot to use to charge machine from battery */ public GenericMachineBlockEntity(BlockEntityType blockEntityType, BlockPos pos, BlockState state, String name, int maxInput, int maxEnergy, Block toolDrop, int energySlot) { super(blockEntityType, pos, state); @@ -76,8 +77,8 @@ public abstract class GenericMachineBlockEntity extends PowerAcceptorBlockEntity /** * Returns progress scaled to input value * - * @param scale int Maximum value for progress - * @return int Scale of progress + * @param scale {@code int} Maximum value for progress + * @return {@code int} Scale of progress */ public int getProgressScaled(int scale) { if (crafter != null && crafter.currentTickTime != 0 && crafter.currentNeededTicks != 0) { diff --git a/src/main/java/techreborn/blockentity/machine/iron/AbstractIronMachineBlockEntity.java b/src/main/java/techreborn/blockentity/machine/iron/AbstractIronMachineBlockEntity.java index bb23956dc..055181a8f 100644 --- a/src/main/java/techreborn/blockentity/machine/iron/AbstractIronMachineBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/iron/AbstractIronMachineBlockEntity.java @@ -75,8 +75,8 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt * Returns the number of ticks that the supplied fuel item will keep the * furnace burning, or 0 if the item isn't fuel * - * @param stack Itemstack of fuel - * @return Integer Number of ticks + * @param stack {@link ItemStack} stack of fuel + * @return {@code int} Number of ticks */ private int getItemBurnTime(ItemStack stack) { if (stack.isEmpty()) { @@ -88,8 +88,8 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt /** * Returns remaining fraction of fuel burn time * - * @param scale Scale to use for burn time - * @return int scaled remaining fuel burn time + * @param scale {@code int} Scale to use for burn time + * @return {@code int} scaled remaining fuel burn time */ public int getBurnTimeRemainingScaled(int scale) { if (totalBurnTime == 0) { @@ -102,8 +102,8 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt /** * Returns crafting progress * - * @param scale Scale to use for crafting progress - * @return int Scaled crafting progress + * @param scale {@code int} Scale to use for crafting progress + * @return {@code int} Scaled crafting progress */ public int getProgressScaled(int scale) { if (totalCookingTime > 0) { @@ -115,7 +115,7 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt /** * Returns true if Iron Machine is burning fuel thus can do work * - * @return Boolean True if machine is burning + * @return {@code boolean} True if machine is burning */ public boolean isBurning() { return burnTime > 0; @@ -233,4 +233,4 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt } -} \ No newline at end of file +} diff --git a/src/main/java/techreborn/blockentity/machine/iron/IronAlloyFurnaceBlockEntity.java b/src/main/java/techreborn/blockentity/machine/iron/IronAlloyFurnaceBlockEntity.java index 5e24fe9a5..4a2f7e67b 100644 --- a/src/main/java/techreborn/blockentity/machine/iron/IronAlloyFurnaceBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/iron/IronAlloyFurnaceBlockEntity.java @@ -57,8 +57,8 @@ public class IronAlloyFurnaceBlockEntity extends AbstractIronMachineBlockEntity } for (RebornIngredient ingredient : recipeType.getRebornIngredients()) { boolean hasItem = false; - for (int inputslot = 0; inputslot < 2; inputslot++) { - if (ingredient.test(inventory.getStack(inputslot))) { + for (int inputSlot = 0; inputSlot < 2; inputSlot++) { + if (ingredient.test(inventory.getStack(inputSlot))) { hasItem = true; } } diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java index 271acb6b9..5c88d64c1 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java @@ -25,6 +25,7 @@ package techreborn.blockentity.machine.multiblock; import net.minecraft.block.BlockState; +import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; @@ -107,7 +108,7 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity /** * Changes size of fusion reactor ring after GUI button click * - * @param sizeDelta int Size increment + * @param sizeDelta {@code int} Size increment */ public void changeSize(int sizeDelta) { int newSize = size + sizeDelta; @@ -125,13 +126,13 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity } /** - * Checks that ItemStack could be inserted into slot provided, including check + * Checks that {@link ItemStack} could be inserted into slot provided, including check * for existing item in slot and maximum stack size * - * @param stack ItemStack ItemStack to insert - * @param slot int Slot ID to check - * @param tags boolean Should we use tags - * @return boolean Returns true if ItemStack will fit into slot + * @param stack {@link ItemStack} Stack to insert + * @param slot {@code int} Slot ID to check + * @param tags {@code boolean} Should we use tags + * @return {@code boolean} Returns true if ItemStack will fit into slot */ public boolean canFitStack(ItemStack stack, int slot, boolean tags) {// Checks to see if it can // fit the stack @@ -165,18 +166,18 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity /** * Validates if reactor has all inputs and can output result * - * @param recipe FusionReactorRecipe Recipe to validate - * @return Boolean True if we have all inputs and can fit output + * @param recipe {@link FusionReactorRecipe} Recipe to validate + * @return {@code boolean} True if we have all inputs and can fit output */ private boolean validateRecipe(FusionReactorRecipe recipe) { return hasAllInputs(recipe) && canFitStack(recipe.getOutputs().get(0), outputStackSlot, true); } /** - * Check if BlockEntity has all necessary inputs for recipe provided + * Check if {@link BlockEntity} has all necessary inputs for recipe provided * - * @param recipeType RebornRecipe Recipe to check inputs - * @return Boolean True if reactor has all inputs for recipe + * @param recipeType {@link RebornRecipe} Recipe to check inputs + * @return {@code boolean} True if reactor has all inputs for recipe */ private boolean hasAllInputs(RebornRecipe recipeType) { if (recipeType == null) { @@ -198,7 +199,7 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity /** * Decrease stack size on the given slot according to recipe input * - * @param slot int Slot number + * @param slot {@code int} Slot number */ private void useInput(int slot) { if (currentRecipe == null) { @@ -259,7 +260,7 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity return; } - //Move this to here from the nbt read method, as it now requires the world as of 1.14 + // Move this to here from the nbt read method, as it now requires the world as of 1.14 if (checkNBTRecipe) { checkNBTRecipe = false; for (final RebornRecipe reactorRecipe : ModRecipes.FUSION_REACTOR.getRecipes(getWorld())) { @@ -270,7 +271,7 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity } if (lastTick == world.getTime()) { - //Prevent tick accelerators, blame obstinate for this. + // Prevent tick accelerators, blame obstinate for this. return; } lastTick = world.getTime(); @@ -308,7 +309,7 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity if (hasStartedCrafting && craftingTickTime < currentRecipe.getTime()) { // Power gen if (currentRecipe.getPower() > 0) { - // Waste power if it has no where to go + // Waste power if it has nowhere to go long power = (long) (Math.abs(currentRecipe.getPower()) * getPowerMultiplier()); addEnergy(power); powerChange = (power); @@ -380,7 +381,7 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity tagCompound.putInt("size", size); } - //MachineBaseBlockEntity + // MachineBaseBlockEntity @Override public double getPowerMultiplier() { double calc = (1F / 2F) * Math.pow(size - 5, 1.8); diff --git a/src/main/java/techreborn/blockentity/machine/tier1/AutoCraftingTableBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/AutoCraftingTableBlockEntity.java index 90dd5a4ac..21302c028 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/AutoCraftingTableBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/AutoCraftingTableBlockEntity.java @@ -262,7 +262,7 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity if (balanceSlot > craftCache.size()) { balanceSlot = 0; } - //Find the best slot for each item in a recipe, and move it if needed + // Find the best slot for each item in a recipe, and move it if needed ItemStack sourceStack = inventory.getStack(balanceSlot); if (sourceStack.isEmpty()) { return Optional.empty(); diff --git a/src/main/java/techreborn/blockentity/machine/tier1/ElectricFurnaceBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/ElectricFurnaceBlockEntity.java index 46dceca23..da2905087 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/ElectricFurnaceBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/ElectricFurnaceBlockEntity.java @@ -225,8 +225,8 @@ public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity if (getStored() > getEuPerTick(EnergyPerTick)) { useEnergy(getEuPerTick(EnergyPerTick)); cookTime++; - if (cookTime == 1 || cookTime % 20 == 0 && RecipeCrafter.soundHanlder != null) { - RecipeCrafter.soundHanlder.playSound(false, this); + if (cookTime == 1 || cookTime % 20 == 0 && RecipeCrafter.soundHandler != null) { + RecipeCrafter.soundHandler.playSound(false, this); } } } diff --git a/src/main/java/techreborn/blockentity/machine/tier1/GreenhouseControllerBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/GreenhouseControllerBlockEntity.java index 1cf03d84d..ee762c0de 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/GreenhouseControllerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/GreenhouseControllerBlockEntity.java @@ -111,7 +111,7 @@ public class GreenhouseControllerBlockEntity extends PowerAcceptorBlockEntity || block instanceof CactusBlock || block instanceof BambooBlock ) { - // If we can break bottom block we should at least remove all of them up to top so they don't break automatically + // If we can break bottom block we should at least remove all of them up to top, so they don't break automatically boolean breakBlocks = false; for (int y = 1; (blockState = world.getBlockState(blockPos.up(y))).getBlock() == block; y++) { if (y == 1) { diff --git a/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java index 0dad494e5..b3643229d 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java @@ -60,7 +60,7 @@ import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -//TODO add tick and power bars. +// TODO add tick and power bars. public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider { @@ -205,7 +205,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity if (balanceSlot > craftCache.size()) { balanceSlot = 0; } - //Find the best slot for each item in a recipe, and move it if needed + // Find the best slot for each item in a recipe, and move it if needed ItemStack sourceStack = inventory.getStack(balanceSlot); if (sourceStack.isEmpty()) { return Optional.empty(); @@ -228,7 +228,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity .mapToInt(value -> inventory.getStack(value).getCount()).sum(); int slots = possibleSlots.size(); - //This makes an array of ints with the best possible slot EnvTyperibution + // This makes an array of ints with the best possible slot distribution int[] split = new int[slots]; int remainder = totalItems % slots; Arrays.fill(split, totalItems / slots); @@ -248,7 +248,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity boolean needsBalance = false; for (int required : split) { if (slotEnvTyperubution.contains(required)) { - //We need to remove the int, not at the int, this seems to work around that + // We need to remove the int, not at the int, this seems to work around that slotEnvTyperubution.remove(Integer.valueOf(required)); } else { needsBalance = true; @@ -261,7 +261,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity return Optional.empty(); } - //Slot, count + // Slot, count Pair bestSlot = null; for (Integer slot : possibleSlots) { ItemStack slotStack = inventory.getStack(slot); @@ -411,7 +411,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity return this; } - //Easyest way to sync back to the client + // Easiest way to sync back to the client public int getLockedInt() { return locked ? 1 : 0; } @@ -434,7 +434,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity } @Override - public boolean canUse(final PlayerEntity entityplayer) { + public boolean canUse(final PlayerEntity playerEntity) { return true; } diff --git a/src/main/java/techreborn/blockentity/machine/tier1/SoildCanningMachineBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/SolidCanningMachineBlockEntity.java similarity index 95% rename from src/main/java/techreborn/blockentity/machine/tier1/SoildCanningMachineBlockEntity.java rename to src/main/java/techreborn/blockentity/machine/tier1/SolidCanningMachineBlockEntity.java index a39b4c4f6..802786a60 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/SoildCanningMachineBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/SolidCanningMachineBlockEntity.java @@ -38,9 +38,9 @@ import techreborn.init.ModRecipes; import techreborn.init.TRBlockEntities; import techreborn.init.TRContent; -public class SoildCanningMachineBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider { +public class SolidCanningMachineBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider { - public SoildCanningMachineBlockEntity(BlockPos pos, BlockState state) { + public SolidCanningMachineBlockEntity(BlockPos pos, BlockState state) { super(TRBlockEntities.SOLID_CANNING_MACHINE, pos, state, "SolidCanningMachine", TechRebornConfig.solidCanningMachineMaxInput, TechRebornConfig.solidCanningMachineMaxEnergy, TRContent.Machine.SOLID_CANNING_MACHINE.block, 3); final int[] inputs = new int[]{0, 1}; final int[] outputs = new int[]{2}; diff --git a/src/main/java/techreborn/blockentity/machine/tier3/ChunkLoaderBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier3/ChunkLoaderBlockEntity.java index 055a82d46..2368e8bfd 100644 --- a/src/main/java/techreborn/blockentity/machine/tier3/ChunkLoaderBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier3/ChunkLoaderBlockEntity.java @@ -133,14 +133,14 @@ public class ChunkLoaderBlockEntity extends MachineBaseBlockEntity implements IT } @Override - public void readNbt(NbtCompound nbttagcompound) { - super.readNbt(nbttagcompound); - this.radius = nbttagcompound.getInt("radius"); - this.ownerUdid = nbttagcompound.getString("ownerUdid"); + public void readNbt(NbtCompound nbtCompound) { + super.readNbt(nbtCompound); + this.radius = nbtCompound.getInt("radius"); + this.ownerUdid = nbtCompound.getString("ownerUdid"); if (!StringUtils.isBlank(ownerUdid)) { - nbttagcompound.putString("ownerUdid", this.ownerUdid); + nbtCompound.putString("ownerUdid", this.ownerUdid); } - inventory.read(nbttagcompound); + inventory.read(nbtCompound); } // IToolDrop diff --git a/src/main/java/techreborn/blockentity/storage/energy/AdjustableSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/energy/AdjustableSUBlockEntity.java index 9718d1b93..2de31c150 100644 --- a/src/main/java/techreborn/blockentity/storage/energy/AdjustableSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/energy/AdjustableSUBlockEntity.java @@ -121,7 +121,7 @@ public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements @Override public long getBaseMaxInput() { - //If we have super conductors increase the max input of the machine + // If we have super conductors increase the max input of the machine if (getMaxConfigOutput() > maxOutput) { return getMaxConfigOutput(); } @@ -147,9 +147,9 @@ public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements } @Override - public void readNbt(NbtCompound nbttagcompound) { - super.readNbt(nbttagcompound); - this.OUTPUT = nbttagcompound.getInt("output"); + public void readNbt(NbtCompound nbtCompound) { + super.readNbt(nbtCompound); + this.OUTPUT = nbtCompound.getInt("output"); } // MachineBaseBlockEntity @@ -163,14 +163,14 @@ public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements public BuiltScreenHandler createScreenHandler(int syncID, PlayerEntity player) { return new ScreenHandlerBuilder("aesu").player(player.getInventory()).inventory().hotbar().armor() .complete(8, 18).addArmor().addInventory().blockEntity(this).energySlot(0, 62, 45).energySlot(1, 98, 45) - .syncEnergyValue().sync(this::getCurrentOutput, this::setCurentOutput).addInventory().create(this, syncID); + .syncEnergyValue().sync(this::getCurrentOutput, this::setCurrentOutput).addInventory().create(this, syncID); } public int getCurrentOutput() { return OUTPUT; } - public void setCurentOutput(int output) { + public void setCurrentOutput(int output) { this.OUTPUT = output; } } diff --git a/src/main/java/techreborn/blockentity/storage/energy/idsu/InterdimensionalSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/energy/idsu/InterdimensionalSUBlockEntity.java index 80567a518..04176eb88 100644 --- a/src/main/java/techreborn/blockentity/storage/energy/idsu/InterdimensionalSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/energy/idsu/InterdimensionalSUBlockEntity.java @@ -47,7 +47,7 @@ public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity impl public String ownerUdid; - //This is the energy value that is synced to the client + // This is the energy value that is synced to the client private long clientEnergy; public InterdimensionalSUBlockEntity(BlockPos pos, BlockState state) { @@ -123,18 +123,18 @@ public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity impl } @Override - public void readNbt(NbtCompound nbttagcompound) { - super.readNbt(nbttagcompound); - this.ownerUdid = nbttagcompound.getString("ownerUdid"); + public void readNbt(NbtCompound nbtCompound) { + super.readNbt(nbtCompound); + this.ownerUdid = nbtCompound.getString("ownerUdid"); } @Override - public void writeNbt(NbtCompound nbttagcompound) { - super.writeNbt(nbttagcompound); + public void writeNbt(NbtCompound nbtCompound) { + super.writeNbt(nbtCompound); if (ownerUdid == null || StringUtils.isEmpty(ownerUdid)) { return; } - nbttagcompound.putString("ownerUdid", this.ownerUdid); + nbtCompound.putString("ownerUdid", this.ownerUdid); } @Override diff --git a/src/main/java/techreborn/blocks/cable/CableBlock.java b/src/main/java/techreborn/blocks/cable/CableBlock.java index 3c9bcee00..54578eac0 100644 --- a/src/main/java/techreborn/blocks/cable/CableBlock.java +++ b/src/main/java/techreborn/blocks/cable/CableBlock.java @@ -63,7 +63,7 @@ import techreborn.blockentity.cable.CableBlockEntity; import techreborn.config.TechRebornConfig; import techreborn.init.ModSounds; import techreborn.init.TRContent; -import techreborn.utils.damageSources.ElectrialShockSource; +import techreborn.utils.damageSources.ElectricalShockSource; import java.util.HashMap; import java.util.Map; @@ -98,7 +98,7 @@ public class CableBlock extends BlockWithEntity implements Waterloggable { this.type = type; setDefaultState(this.getStateManager().getDefaultState().with(EAST, false).with(WEST, false).with(NORTH, false) .with(SOUTH, false).with(UP, false).with(DOWN, false).with(WATERLOGGED, false).with(COVERED, false)); - BlockWrenchEventHandler.wrenableBlocks.add(this); + BlockWrenchEventHandler.wrenchableBlocks.add(this); } // BlockWithEntity @@ -233,7 +233,7 @@ public class CableBlock extends BlockWithEntity implements Waterloggable { if (type == TRContent.Cables.HV) { entity.setOnFireFor(1); } - entity.damage(new ElectrialShockSource(), 1F); + entity.damage(new ElectricalShockSource(), 1F); blockEntityCable.setEnergy(0); } if (TechRebornConfig.uninsulatedElectrocutionSound) { diff --git a/src/main/java/techreborn/blocks/lighting/LampBlock.java b/src/main/java/techreborn/blocks/lighting/LampBlock.java index 9bc0a3a34..f96c288c0 100644 --- a/src/main/java/techreborn/blocks/lighting/LampBlock.java +++ b/src/main/java/techreborn/blocks/lighting/LampBlock.java @@ -65,7 +65,7 @@ public class LampBlock extends BaseBlockEntityProvider { this.shape = genCuboidShapes(depth, width); this.cost = cost; this.setDefaultState(this.getStateManager().getDefaultState().with(FACING, Direction.NORTH).with(ACTIVE, false)); - BlockWrenchEventHandler.wrenableBlocks.add(this); + BlockWrenchEventHandler.wrenchableBlocks.add(this); } private static ToIntFunction createLightLevelFromBlockState() { @@ -148,7 +148,7 @@ public class LampBlock extends BaseBlockEntityProvider { ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND); BlockEntity blockEntity = worldIn.getBlockEntity(pos); - // We extended BaseTileBlock. Thus we should always have blockEntity entity. I hope. + // We extended BaseTileBlock. Thus, we should always have blockEntity entity. I hope. if (blockEntity == null) { return ActionResult.FAIL; } diff --git a/src/main/java/techreborn/blocks/misc/BlockAlarm.java b/src/main/java/techreborn/blocks/misc/BlockAlarm.java index 6a3b8285c..d80f3e7d3 100644 --- a/src/main/java/techreborn/blocks/misc/BlockAlarm.java +++ b/src/main/java/techreborn/blocks/misc/BlockAlarm.java @@ -63,7 +63,7 @@ public class BlockAlarm extends BaseBlockEntityProvider { super(Block.Settings.of(Material.STONE).strength(2f, 2f)); this.setDefaultState(this.getStateManager().getDefaultState().with(FACING, Direction.NORTH).with(ACTIVE, false)); this.shape = GenCuboidShapes(3, 10); - BlockWrenchEventHandler.wrenableBlocks.add(this); + BlockWrenchEventHandler.wrenchableBlocks.add(this); } private VoxelShape[] GenCuboidShapes(double depth, double width) { @@ -113,10 +113,10 @@ public class BlockAlarm extends BaseBlockEntityProvider { @Nullable @Override public BlockState getPlacementState(ItemPlacementContext context) { - for (Direction enumfacing : context.getPlacementDirections()) { - BlockState iblockstate = this.getDefaultState().with(FACING, enumfacing.getOpposite()); - if (iblockstate.canPlaceAt(context.getWorld(), context.getBlockPos())) { - return iblockstate; + for (Direction facing : context.getPlacementDirections()) { + BlockState state = this.getDefaultState().with(FACING, facing.getOpposite()); + if (state.canPlaceAt(context.getWorld(), context.getBlockPos())) { + return state; } } return null; @@ -127,7 +127,7 @@ public class BlockAlarm extends BaseBlockEntityProvider { ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND); BlockEntity blockEntity = worldIn.getBlockEntity(pos); - // We extended BaseTileBlock. Thus we should always have blockEntity entity. I hope. + // We extended BaseTileBlock. Thus, we should always have blockEntity entity. I hope. if (blockEntity == null) { return ActionResult.FAIL; } diff --git a/src/main/java/techreborn/blocks/storage/energy/EnergyStorageBlock.java b/src/main/java/techreborn/blocks/storage/energy/EnergyStorageBlock.java index a6f9ed100..b6f20c173 100644 --- a/src/main/java/techreborn/blocks/storage/energy/EnergyStorageBlock.java +++ b/src/main/java/techreborn/blocks/storage/energy/EnergyStorageBlock.java @@ -64,7 +64,7 @@ public abstract class EnergyStorageBlock extends BaseBlockEntityProvider { this.setDefaultState(this.getStateManager().getDefaultState().with(FACING, Direction.NORTH)); this.name = name; this.gui = gui; - BlockWrenchEventHandler.wrenableBlocks.add(this); + BlockWrenchEventHandler.wrenchableBlocks.add(this); } public void setFacing(Direction facing, World world, BlockPos pos) { @@ -100,7 +100,7 @@ public abstract class EnergyStorageBlock extends BaseBlockEntityProvider { ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND); BlockEntity blockEntity = worldIn.getBlockEntity(pos); - // We extended BlockTileBase. Thus we should always have blockEntity entity. I hope. + // We extended BlockTileBase. Thus, we should always have blockEntity entity. I hope. if (blockEntity == null) { return ActionResult.FAIL; } diff --git a/src/main/java/techreborn/blocks/storage/energy/LSUStorageBlock.java b/src/main/java/techreborn/blocks/storage/energy/LSUStorageBlock.java index 5321aab82..17ba8a255 100644 --- a/src/main/java/techreborn/blocks/storage/energy/LSUStorageBlock.java +++ b/src/main/java/techreborn/blocks/storage/energy/LSUStorageBlock.java @@ -49,7 +49,7 @@ public class LSUStorageBlock extends BaseBlockEntityProvider { public LSUStorageBlock() { super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f)); - BlockWrenchEventHandler.wrenableBlocks.add(this); + BlockWrenchEventHandler.wrenchableBlocks.add(this); } // BaseTileBlock @@ -87,7 +87,7 @@ public class LSUStorageBlock extends BaseBlockEntityProvider { ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND); BlockEntity blockEntity = worldIn.getBlockEntity(pos); - // We extended BaseTileBlock. Thus we should always have blockEntity entity. I hope. + // We extended BaseTileBlock. Thus, we should always have blockEntity entity. I hope. if (blockEntity == null) { return ActionResult.FAIL; } diff --git a/src/main/java/techreborn/blocks/transformers/BlockTransformer.java b/src/main/java/techreborn/blocks/transformers/BlockTransformer.java index 8d0ebd51d..fb8d4b1a1 100644 --- a/src/main/java/techreborn/blocks/transformers/BlockTransformer.java +++ b/src/main/java/techreborn/blocks/transformers/BlockTransformer.java @@ -58,7 +58,7 @@ public abstract class BlockTransformer extends BaseBlockEntityProvider { super(FabricBlockSettings.of(Material.METAL).strength(2f, 2f)); this.setDefaultState(this.getStateManager().getDefaultState().with(FACING, Direction.NORTH)); this.name = name; - BlockWrenchEventHandler.wrenableBlocks.add(this); + BlockWrenchEventHandler.wrenchableBlocks.add(this); } public void setFacing(Direction facing, World world, BlockPos pos) { @@ -94,7 +94,7 @@ public abstract class BlockTransformer extends BaseBlockEntityProvider { ItemStack stack = playerIn.getStackInHand(Hand.MAIN_HAND); BlockEntity blockEntity = worldIn.getBlockEntity(pos); - // We extended BlockTileBase. Thus we should always have blockEntity entity. I hope. + // We extended BlockTileBase. Thus, we should always have blockEntity entity. I hope. if (blockEntity == null) { return ActionResult.FAIL; } diff --git a/src/main/java/techreborn/client/GuiType.java b/src/main/java/techreborn/client/GuiType.java index bfb7a3d7f..4a9cbfef0 100644 --- a/src/main/java/techreborn/client/GuiType.java +++ b/src/main/java/techreborn/client/GuiType.java @@ -78,7 +78,7 @@ import java.util.HashMap; import java.util.Map; import java.util.function.Supplier; -//The meme is here the double suppliers dont cause the client side gui classes to load on the server +// The meme is here the double suppliers don't cause the client side gui classes to load on the server public final class GuiType implements IMachineGuiHandler { private static final Map> TYPES = new HashMap<>(); @@ -121,7 +121,7 @@ public final class GuiType implements IMachineGuiHandler public static final GuiType SEMIFLUID_GENERATOR = register("semifluid_generator", () -> () -> GuiSemifluidGenerator::new); public static final GuiType THERMAL_GENERATOR = register("thermal_generator", () -> () -> GuiThermalGenerator::new); public static final GuiType VACUUM_FREEZER = register("vacuum_freezer", () -> () -> GuiVacuumFreezer::new); - public static final GuiType SOLID_CANNING_MACHINE = register("solid_canning_machine", () -> () -> GuiSolidCanningMachine::new); + public static final GuiType SOLID_CANNING_MACHINE = register("solid_canning_machine", () -> () -> GuiSolidCanningMachine::new); public static final GuiType WIRE_MILL = register("wire_mill", () -> () -> GuiWireMill::new); public static final GuiType GREENHOUSE_CONTROLLER = register("greenhouse_controller", () -> () -> GuiGreenhouseController::new); public static final GuiType FLUID_REPLICATOR = register("fluid_replicator", () -> () -> GuiFluidReplicator::new); diff --git a/src/main/java/techreborn/client/gui/GuiSolidCanningMachine.java b/src/main/java/techreborn/client/gui/GuiSolidCanningMachine.java index a61144ae7..e0d06ff7b 100644 --- a/src/main/java/techreborn/client/gui/GuiSolidCanningMachine.java +++ b/src/main/java/techreborn/client/gui/GuiSolidCanningMachine.java @@ -29,13 +29,13 @@ import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; import reborncore.client.screen.builder.BuiltScreenHandler; -import techreborn.blockentity.machine.tier1.SoildCanningMachineBlockEntity; +import techreborn.blockentity.machine.tier1.SolidCanningMachineBlockEntity; public class GuiSolidCanningMachine extends GuiBase { - SoildCanningMachineBlockEntity blockEntity; + SolidCanningMachineBlockEntity blockEntity; - public GuiSolidCanningMachine(int syncID, final PlayerEntity player, final SoildCanningMachineBlockEntity blockEntity) { + public GuiSolidCanningMachine(int syncID, final PlayerEntity player, final SolidCanningMachineBlockEntity blockEntity) { super(player, blockEntity, blockEntity.createScreenHandler(syncID, player)); this.blockEntity = blockEntity; diff --git a/src/main/java/techreborn/client/render/ModelHelper.java b/src/main/java/techreborn/client/render/ModelHelper.java index 93ca0f485..dffe265ea 100644 --- a/src/main/java/techreborn/client/render/ModelHelper.java +++ b/src/main/java/techreborn/client/render/ModelHelper.java @@ -61,8 +61,8 @@ public class ModelHelper { public static Reader getReaderForResource(Identifier location) throws IOException { Identifier file = new Identifier(location.getNamespace(), location.getPath() + ".json"); - Resource iresource = MinecraftClient.getInstance().getResourceManager().getResource(file); - return new BufferedReader(new InputStreamReader(iresource.getInputStream(), Charsets.UTF_8)); + Resource resource = MinecraftClient.getInstance().getResourceManager().getResource(file); + return new BufferedReader(new InputStreamReader(resource.getInputStream(), Charsets.UTF_8)); } } diff --git a/src/main/java/techreborn/compat/autoswitch/AutoSwitchApiImpl.java b/src/main/java/techreborn/compat/autoswitch/AutoSwitchApiImpl.java index f2a07acee..ce74febc1 100644 --- a/src/main/java/techreborn/compat/autoswitch/AutoSwitchApiImpl.java +++ b/src/main/java/techreborn/compat/autoswitch/AutoSwitchApiImpl.java @@ -53,7 +53,7 @@ public class AutoSwitchApiImpl implements AutoSwitchApi { @Override public void customDamageSystems(AutoSwitchMap, DurabilityGetter> damageMap) { - // Multiple by 100 to get percentage out of decimal form + // Multiply by 100 to get percentage out of decimal form damageMap.put(DrillItem.class, stack -> 100 * ItemUtils.getPowerForDurabilityBar(stack)); damageMap.put(ChainsawItem.class, stack -> 100 * ItemUtils.getPowerForDurabilityBar(stack)); damageMap.put(JackhammerItem.class, stack -> 100 * ItemUtils.getPowerForDurabilityBar(stack)); diff --git a/src/main/java/techreborn/config/TechRebornConfig.java b/src/main/java/techreborn/config/TechRebornConfig.java index efbec3b1e..0e38c71e1 100644 --- a/src/main/java/techreborn/config/TechRebornConfig.java +++ b/src/main/java/techreborn/config/TechRebornConfig.java @@ -29,7 +29,7 @@ import reborncore.common.config.Config; import java.util.Arrays; import java.util.List; -//All moved into one class as its a lot easier to find the annotations when you know where they all are +// All moved into one class as it's a lot easier to find the annotations when you know where they all are public class TechRebornConfig { // Generators @@ -268,11 +268,11 @@ public class TechRebornConfig { @Config(config = "items", category = "power", key = "lapotronicOrbMaxCharge", comment = "Energy Capacity for Lapotronic Orb") public static int lapotronicOrbMaxCharge = 100_000_000; - @Config(config = "items", category = "power", key = "cloakingDeviceCharge", comment = "Energy Capacity for Cloacking Device") + @Config(config = "items", category = "power", key = "cloakingDeviceCharge", comment = "Energy Capacity for Cloaking Device") public static int cloakingDeviceCharge = 40_000_000; - @Config(config = "items", category = "power", key = "clockingDeviceEnergyUsage", comment = "Cloacking device energy usage") - public static int cloackingDeviceCost = 10; + @Config(config = "items", category = "power", key = "clockingDeviceEnergyUsage", comment = "Cloaking device energy usage") + public static int cloakingDeviceCost = 10; @Config(config = "items", category = "power", key = "quantumSuitCapacity", comment = "Quantum Suit Energy Capacity") public static long quantumSuitCapacity = 40_000_000; diff --git a/src/main/java/techreborn/events/ModRegistry.java b/src/main/java/techreborn/events/ModRegistry.java index 647b06eb6..458200a0c 100644 --- a/src/main/java/techreborn/events/ModRegistry.java +++ b/src/main/java/techreborn/events/ModRegistry.java @@ -117,7 +117,7 @@ public class ModRegistry { RebornRegistry.registerBlockNoItem(TRContent.POTTED_RUBBER_SAPLING = InitUtils.setup(new FlowerPotBlock(TRContent.RUBBER_SAPLING, AbstractBlock.Settings.of(Material.DECORATION).breakInstantly().nonOpaque()), "potted_rubber_sapling")); RebornRegistry.registerBlock(TRContent.COPPER_WALL = InitUtils.setup(new WallBlock(FabricBlockSettings.of(Material.METAL).strength(2f, 2f).sounds(BlockSoundGroup.METAL)), "copper_wall"), itemGroup); - TechReborn.LOGGER.debug("TechReborns Blocks Loaded"); + TechReborn.LOGGER.debug("TechReborn's Blocks Loaded"); } private static void registerItems() { @@ -233,7 +233,7 @@ public class ModRegistry { RebornRegistry.registerItem(TRContent.CELL = InitUtils.setup(new DynamicCellItem(), "cell")); TRContent.CELL.registerFluidApi(); - TechReborn.LOGGER.debug("TechReborns Items Loaded"); + TechReborn.LOGGER.debug("TechReborn's Items Loaded"); } private static void registerFluids() { diff --git a/src/main/java/techreborn/events/UseBlockHandler.java b/src/main/java/techreborn/events/UseBlockHandler.java index bfde1db53..a60c56ada 100644 --- a/src/main/java/techreborn/events/UseBlockHandler.java +++ b/src/main/java/techreborn/events/UseBlockHandler.java @@ -72,8 +72,8 @@ public class UseBlockHandler implements UseBlockCallback{ world.setBlockState(pos, strippedBlock.getDefaultState().with(PillarBlock.AXIS, hitState.get(PillarBlock.AXIS)), 11); // Damage axe - stack.damage(1, playerEntity, playerx -> - playerx.sendToolBreakStatus(hand) + stack.damage(1, playerEntity, playerX -> + playerX.sendToolBreakStatus(hand) ); return ActionResult.SUCCESS; } diff --git a/src/main/java/techreborn/init/ModLoot.java b/src/main/java/techreborn/init/ModLoot.java index d38047dc3..1563bc43f 100644 --- a/src/main/java/techreborn/init/ModLoot.java +++ b/src/main/java/techreborn/init/ModLoot.java @@ -45,8 +45,8 @@ public class ModLoot { LootPoolEntry tinIngot = makeEntry(Ingots.TIN); LootPoolEntry leadIngot = makeEntry(Ingots.LEAD); LootPoolEntry silverIngot = makeEntry(Ingots.SILVER); - LootPoolEntry refinedronIngot = makeEntry(Ingots.REFINED_IRON); - LootPoolEntry advancedalloyIngot = makeEntry(Ingots.ADVANCED_ALLOY); + LootPoolEntry refinedIronIngot = makeEntry(Ingots.REFINED_IRON); + LootPoolEntry advancedAlloyIngot = makeEntry(Ingots.ADVANCED_ALLOY); LootPoolEntry basicFrame = makeEntry(TRContent.MachineBlocks.BASIC.frame.asItem()); LootPoolEntry basicCircuit = makeEntry(Parts.ELECTRONIC_CIRCUIT); LootPoolEntry rubberSapling = makeEntry(TRContent.RUBBER_SAPLING, 25); @@ -73,7 +73,7 @@ public class ModLoot { LootPool poolBasic = FabricLootPoolBuilder.builder().withEntry(copperIngot).withEntry(tinIngot) - .withEntry(leadIngot).withEntry(silverIngot).withEntry(refinedronIngot).withEntry(advancedalloyIngot) + .withEntry(leadIngot).withEntry(silverIngot).withEntry(refinedIronIngot).withEntry(advancedAlloyIngot) .withEntry(basicFrame).withEntry(basicCircuit).withEntry(rubberSapling).rolls(UniformLootNumberProvider.create(1.0f, 2.0f)) .build(); @@ -139,8 +139,8 @@ public class ModLoot { /** * Makes loot entry from item provided * - * @param item Item to include into LootEntry - * @return LootEntry for item provided + * @param item {@link ItemConvertible} Item to include into LootEntry + * @return {@link LootPoolEntry} Entry for item provided */ private static LootPoolEntry makeEntry(ItemConvertible item) { return makeEntry(item, 5); @@ -149,9 +149,9 @@ public class ModLoot { /** * Makes loot entry from item provided with weight provided * - * @param item Item to include into LootEntry - * @param weight Weight of that item - * @return LootEntry for item and weight provided + * @param item {@link ItemConvertible} Item to include into LootEntry + * @param weight {@code int} Weight of that item + * @return {@link LootPoolEntry} Entry for item and weight provided */ private static LootPoolEntry makeEntry(ItemConvertible item, int weight) { return ItemEntry.builder(item).weight(weight) diff --git a/src/main/java/techreborn/init/ModSounds.java b/src/main/java/techreborn/init/ModSounds.java index 0400f67e4..baea2cfde 100644 --- a/src/main/java/techreborn/init/ModSounds.java +++ b/src/main/java/techreborn/init/ModSounds.java @@ -28,7 +28,7 @@ import net.minecraft.block.entity.BlockEntity; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvent; import net.minecraft.world.World; -import reborncore.common.recipes.ICrafterSoundHanlder; +import reborncore.common.recipes.ICrafterSoundHandler; import techreborn.config.TechRebornConfig; /** @@ -46,7 +46,7 @@ public class ModSounds { public static SoundEvent ALARM_2; public static SoundEvent ALARM_3; - public static class SoundHandler implements ICrafterSoundHanlder { + public static class SoundHandler implements ICrafterSoundHandler { @Override public void playSound(boolean firstRun, BlockEntity blockEntity) { diff --git a/src/main/java/techreborn/init/TRBlockEntities.java b/src/main/java/techreborn/init/TRBlockEntities.java index b98414bee..712b555ec 100644 --- a/src/main/java/techreborn/init/TRBlockEntities.java +++ b/src/main/java/techreborn/init/TRBlockEntities.java @@ -112,7 +112,7 @@ public class TRBlockEntities { public static final BlockEntityType FUSION_CONTROL_COMPUTER = register(FusionControlComputerBlockEntity::new, "fusion_control_computer", TRContent.Machine.FUSION_CONTROL_COMPUTER); public static final BlockEntityType LIGHTNING_ROD = register(LightningRodBlockEntity::new, "lightning_rod", TRContent.Machine.LIGHTNING_ROD); public static final BlockEntityType INDUSTRIAL_SAWMILL = register(IndustrialSawmillBlockEntity::new, "industrial_sawmill", TRContent.Machine.INDUSTRIAL_SAWMILL); - public static final BlockEntityType SOLID_FUEL_GENEREATOR = register(SolidFuelGeneratorBlockEntity::new, "solid_fuel_generator", TRContent.Machine.SOLID_FUEL_GENERATOR); + public static final BlockEntityType SOLID_FUEL_GENERATOR = register(SolidFuelGeneratorBlockEntity::new, "solid_fuel_generator", TRContent.Machine.SOLID_FUEL_GENERATOR); public static final BlockEntityType EXTRACTOR = register(ExtractorBlockEntity::new, "extractor", TRContent.Machine.EXTRACTOR); public static final BlockEntityType RESIN_BASIN = register(ResinBasinBlockEntity::new, "resin_basin", TRContent.Machine.RESIN_BASIN); public static final BlockEntityType COMPRESSOR = register(CompressorBlockEntity::new, "compressor", TRContent.Machine.COMPRESSOR); @@ -135,7 +135,7 @@ public class TRBlockEntities { public static final BlockEntityType LAMP = register(LampBlockEntity::new, "lamp", TRContent.Machine.LAMP_INCANDESCENT, TRContent.Machine.LAMP_LED); public static final BlockEntityType ALARM = register(AlarmBlockEntity::new, "alarm", TRContent.Machine.ALARM); public static final BlockEntityType FLUID_REPLICATOR = register(FluidReplicatorBlockEntity::new, "fluid_replicator", TRContent.Machine.FLUID_REPLICATOR); - public static final BlockEntityType SOLID_CANNING_MACHINE = register(SoildCanningMachineBlockEntity::new, "solid_canning_machine", TRContent.Machine.SOLID_CANNING_MACHINE); + public static final BlockEntityType SOLID_CANNING_MACHINE = register(SolidCanningMachineBlockEntity::new, "solid_canning_machine", TRContent.Machine.SOLID_CANNING_MACHINE); public static final BlockEntityType WIRE_MILL = register(WireMillBlockEntity::new, "wire_mill", TRContent.Machine.WIRE_MILL); public static final BlockEntityType GREENHOUSE_CONTROLLER = register(GreenhouseControllerBlockEntity::new, "greenhouse_controller", TRContent.Machine.GREENHOUSE_CONTROLLER); diff --git a/src/main/java/techreborn/init/TRCauldronBehavior.java b/src/main/java/techreborn/init/TRCauldronBehavior.java index a8c45a4a6..9d62c2089 100644 --- a/src/main/java/techreborn/init/TRCauldronBehavior.java +++ b/src/main/java/techreborn/init/TRCauldronBehavior.java @@ -53,7 +53,7 @@ public class TRCauldronBehavior { } return CauldronBehavior.emptyCauldron(state, world, pos, player, hand, stack, - DynamicCellItem.getCellWithFluid(Fluids.LAVA), (statex) -> true, SoundEvents.ITEM_BUCKET_FILL); + DynamicCellItem.getCellWithFluid(Fluids.LAVA), (stateX) -> true, SoundEvents.ITEM_BUCKET_FILL); }; CauldronBehavior FILL_CELL_WITH_WATER = (state, world, pos, player, hand, stack) -> { @@ -62,7 +62,7 @@ public class TRCauldronBehavior { } return CauldronBehavior.emptyCauldron(state, world, pos, player, hand, stack, - DynamicCellItem.getCellWithFluid(Fluids.WATER), (statex) -> true, SoundEvents.ITEM_BUCKET_FILL_LAVA); + DynamicCellItem.getCellWithFluid(Fluids.WATER), (stateX) -> true, SoundEvents.ITEM_BUCKET_FILL_LAVA); }; CauldronBehavior FILL_FROM_CELL = (state, world, pos, player, hand, stack) -> { diff --git a/src/main/java/techreborn/init/TRContent.java b/src/main/java/techreborn/init/TRContent.java index 9b916d4ae..7ffae7982 100644 --- a/src/main/java/techreborn/init/TRContent.java +++ b/src/main/java/techreborn/init/TRContent.java @@ -618,7 +618,7 @@ public class TRContent { ROLLING_MACHINE(new GenericMachineBlock(GuiType.ROLLING_MACHINE, RollingMachineBlockEntity::new)), SCRAPBOXINATOR(new GenericMachineBlock(GuiType.SCRAPBOXINATOR, ScrapboxinatorBlockEntity::new)), VACUUM_FREEZER(new GenericMachineBlock(GuiType.VACUUM_FREEZER, VacuumFreezerBlockEntity::new)), - SOLID_CANNING_MACHINE(new GenericMachineBlock(GuiType.SOLID_CANNING_MACHINE, SoildCanningMachineBlockEntity::new)), + SOLID_CANNING_MACHINE(new GenericMachineBlock(GuiType.SOLID_CANNING_MACHINE, SolidCanningMachineBlockEntity::new)), WIRE_MILL(new GenericMachineBlock(GuiType.WIRE_MILL, WireMillBlockEntity::new)), GREENHOUSE_CONTROLLER(new GenericMachineBlock(GuiType.GREENHOUSE_CONTROLLER, GreenhouseControllerBlockEntity::new)), @@ -1157,8 +1157,8 @@ public class TRContent { powerAcceptor = (PowerAcceptorBlockEntity) blockEntity; } if (handler != null) { - handler.addSpeedMulti(TechRebornConfig.overclockerSpeed); - handler.addPowerMulti(TechRebornConfig.overclockerPower); + handler.addSpeedMultiplier(TechRebornConfig.overclockerSpeed); + handler.addPowerMultiplier(TechRebornConfig.overclockerPower); } if (powerAcceptor != null) { powerAcceptor.extraPowerInput += powerAcceptor.getMaxInput(null); diff --git a/src/main/java/techreborn/init/TRToolMaterials.java b/src/main/java/techreborn/init/TRToolMaterials.java index 614bf4198..45a89c1d7 100644 --- a/src/main/java/techreborn/init/TRToolMaterials.java +++ b/src/main/java/techreborn/init/TRToolMaterials.java @@ -25,7 +25,6 @@ package techreborn.init; import net.minecraft.item.ToolMaterial; -import net.minecraft.item.ToolMaterials; import net.minecraft.recipe.Ingredient; import techreborn.TechReborn; diff --git a/src/main/java/techreborn/init/TRToolTier.java b/src/main/java/techreborn/init/TRToolTier.java index 985b5d474..fc8612035 100644 --- a/src/main/java/techreborn/init/TRToolTier.java +++ b/src/main/java/techreborn/init/TRToolTier.java @@ -30,7 +30,7 @@ import net.minecraft.util.Lazy; import java.util.function.Supplier; -//TODO: Use tags +// TODO: Use tags public enum TRToolTier implements ToolMaterial { BRONZE(2, 375, 7.0F, 2.25f, 6, () -> { return Ingredient.ofItems(TRContent.Ingots.BRONZE.asItem()); diff --git a/src/main/java/techreborn/items/DynamicCellItem.java b/src/main/java/techreborn/items/DynamicCellItem.java index b989f1626..2c65eea94 100644 --- a/src/main/java/techreborn/items/DynamicCellItem.java +++ b/src/main/java/techreborn/items/DynamicCellItem.java @@ -165,7 +165,7 @@ public class DynamicCellItem extends Item implements ItemFluidInfo { public Text getName(ItemStack itemStack) { Fluid fluid = getFluid(itemStack); if (fluid != Fluids.EMPTY) { - //TODO use translation keys for fluid and the cell https://fabric.asie.pl/wiki/tutorial:lang?s[]=translation might be useful + // TODO use translation keys for fluid and the cell https://fabric.asie.pl/wiki/tutorial:lang?s[]=translation might be useful return new LiteralText(WordUtils.capitalizeFully(FluidUtils.getFluidName(fluid).replaceAll("_", " ")) + " Cell"); } return super.getName(itemStack); diff --git a/src/main/java/techreborn/items/armor/CloakingDeviceItem.java b/src/main/java/techreborn/items/armor/CloakingDeviceItem.java index 401564dd9..8777d18c8 100644 --- a/src/main/java/techreborn/items/armor/CloakingDeviceItem.java +++ b/src/main/java/techreborn/items/armor/CloakingDeviceItem.java @@ -34,7 +34,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.collection.DefaultedList; import reborncore.api.items.ArmorBlockEntityTicker; import reborncore.api.items.ArmorRemoveHandler; -import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.RcEnergyItem; import reborncore.common.util.ItemUtils; import reborncore.common.powerSystem.RcEnergyTier; @@ -46,7 +45,7 @@ import techreborn.utils.InitUtils; public class CloakingDeviceItem extends TRArmourItem implements RcEnergyItem, ArmorBlockEntityTicker, ArmorRemoveHandler { public static int maxCharge = TechRebornConfig.cloakingDeviceCharge; - public static int cost = TechRebornConfig.cloackingDeviceCost; + public static int cost = TechRebornConfig.cloakingDeviceCost; public static boolean isActive; // 40M FE capacity with 10k FE\t charge rate diff --git a/src/main/java/techreborn/items/armor/TRArmourItem.java b/src/main/java/techreborn/items/armor/TRArmourItem.java index fb1255d34..ce2cb5456 100644 --- a/src/main/java/techreborn/items/armor/TRArmourItem.java +++ b/src/main/java/techreborn/items/armor/TRArmourItem.java @@ -37,7 +37,7 @@ import java.util.UUID; */ public class TRArmourItem extends ArmorItem { - //Thanks for being private + // Thanks for being private public static final UUID[] MODIFIERS = new UUID[]{ UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"), UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"), diff --git a/src/main/java/techreborn/items/tool/ChainsawItem.java b/src/main/java/techreborn/items/tool/ChainsawItem.java index 6e001add2..d540652b9 100644 --- a/src/main/java/techreborn/items/tool/ChainsawItem.java +++ b/src/main/java/techreborn/items/tool/ChainsawItem.java @@ -80,13 +80,13 @@ public class ChainsawItem extends AxeItem implements RcEnergyItem { } @Override - public boolean postHit(ItemStack itemstack, LivingEntity entityliving, LivingEntity entityliving1) { + public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { return true; } // ToolItem @Override - public boolean canRepair(ItemStack itemStack_1, ItemStack itemStack_2) { + public boolean canRepair(ItemStack stack, ItemStack ingredient) { return false; } diff --git a/src/main/java/techreborn/items/tool/DebugToolItem.java b/src/main/java/techreborn/items/tool/DebugToolItem.java index 1dd0a201f..395d96c13 100644 --- a/src/main/java/techreborn/items/tool/DebugToolItem.java +++ b/src/main/java/techreborn/items/tool/DebugToolItem.java @@ -94,16 +94,16 @@ public class DebugToolItem extends Item { } private String getPropertyString(Entry, Comparable> entryIn) { - Property iproperty = entryIn.getKey(); + Property property = entryIn.getKey(); Comparable comparable = entryIn.getValue(); - String s = Util.getValueAsString(iproperty, comparable); + String s = Util.getValueAsString(property, comparable); if (Boolean.TRUE.equals(comparable)) { s = Formatting.GREEN + s; } else if (Boolean.FALSE.equals(comparable)) { s = Formatting.RED + s; } - return iproperty.getName() + ": " + s; + return property.getName() + ": " + s; } private String getRegistryName(Block block) { diff --git a/src/main/java/techreborn/items/tool/DrillItem.java b/src/main/java/techreborn/items/tool/DrillItem.java index edcf13da8..bf63b327e 100644 --- a/src/main/java/techreborn/items/tool/DrillItem.java +++ b/src/main/java/techreborn/items/tool/DrillItem.java @@ -108,7 +108,7 @@ public class DrillItem extends PickaxeItem implements RcEnergyItem, DynamicAttri // ToolItem @Override - public boolean canRepair(ItemStack itemStack_1, ItemStack itemStack_2) { + public boolean canRepair(ItemStack stack, ItemStack ingredient) { return false; } diff --git a/src/main/java/techreborn/items/tool/JackhammerItem.java b/src/main/java/techreborn/items/tool/JackhammerItem.java index e345b6173..c61bbcfdc 100644 --- a/src/main/java/techreborn/items/tool/JackhammerItem.java +++ b/src/main/java/techreborn/items/tool/JackhammerItem.java @@ -76,7 +76,7 @@ public class JackhammerItem extends PickaxeItem implements RcEnergyItem, Dynamic } /* - Fabric API doesn't allow to have mining speed less then the one from vanilla ToolMaterials + Fabric API doesn't allow to have mining speed less than the one from vanilla ToolMaterials @Override public float getMiningSpeedMultiplier(Tag tag, BlockState state, ItemStack stack, LivingEntity user) { if (tag.equals(FabricToolTags.PICKAXES) && stack.getItem().isEffectiveOn(state)) { diff --git a/src/main/java/techreborn/items/tool/basic/RockCutterItem.java b/src/main/java/techreborn/items/tool/basic/RockCutterItem.java index 29cfbaef9..adb176043 100644 --- a/src/main/java/techreborn/items/tool/basic/RockCutterItem.java +++ b/src/main/java/techreborn/items/tool/basic/RockCutterItem.java @@ -82,13 +82,13 @@ public class RockCutterItem extends PickaxeItem implements RcEnergyItem { } @Override - public boolean postHit(ItemStack itemstack, LivingEntity entityliving, LivingEntity entityliving1) { + public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { return true; } // ToolItem @Override - public boolean canRepair(ItemStack stack, ItemStack stack2) { + public boolean canRepair(ItemStack stack, ItemStack ingredient) { return false; } diff --git a/src/main/java/techreborn/items/tool/industrial/OmniToolItem.java b/src/main/java/techreborn/items/tool/industrial/OmniToolItem.java index 59ce417ad..938e37280 100644 --- a/src/main/java/techreborn/items/tool/industrial/OmniToolItem.java +++ b/src/main/java/techreborn/items/tool/industrial/OmniToolItem.java @@ -95,9 +95,9 @@ public class OmniToolItem extends PickaxeItem implements RcEnergyItem, DynamicAt } @Override - public boolean postHit(ItemStack stack, LivingEntity entityliving, LivingEntity attacker) { + public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { if (tryUseEnergy(stack, hitCost)) { - entityliving.damage(DamageSource.player((PlayerEntity) attacker), 8F); + target.damage(DamageSource.player((PlayerEntity) attacker), 8F); } return false; } diff --git a/src/main/java/techreborn/utils/ToolsUtil.java b/src/main/java/techreborn/utils/ToolsUtil.java index 1be137641..54f6d0e04 100644 --- a/src/main/java/techreborn/utils/ToolsUtil.java +++ b/src/main/java/techreborn/utils/ToolsUtil.java @@ -47,7 +47,6 @@ import java.util.Set; /** * @author drcrazy */ - public class ToolsUtil { public static void breakBlock(ItemStack tool, World world, BlockPos pos, LivingEntity entityLiving, int cost) { if (!(entityLiving instanceof PlayerEntity)) { @@ -69,26 +68,27 @@ public class ToolsUtil { } /** - * Fills in set of BlockPos which should be broken by AOE mining + * Fills in set of {@link BlockPos} which should be broken by AOE mining * - * @param worldIn World reference - * @param pos BlockPos Position of originally broken block - * @param entityLiving LivingEntity Player who broke block - * @param radius int Radius of additional blocks to include. E.g. for 3x3 mining radius will be 1 - * @return Set of BlockPos to process by tool block break logic + * @param worldIn {@link World} World reference + * @param pos {@link BlockPos} Position of originally broken block + * @param entityLiving {@link LivingEntity} Player who broke block + * @param radius {@code int} Radius of additional blocks to include. E.g. for 3x3 mining radius will be 1 + * @return {@link Set} Set of {@link BlockPos} to process by tool block break logic */ public static Set getAOEMiningBlocks(World worldIn, BlockPos pos, @Nullable LivingEntity entityLiving, int radius) { return getAOEMiningBlocks(worldIn, pos, entityLiving, radius, true); } /** - * Fills in set of BlockPos which should be broken by AOE mining + * Fills in set of {@link BlockPos} which should be broken by AOE mining * - * @param worldIn World reference - * @param pos BlockPos Position of originally broken block - * @param entityLiving LivingEntity Player who broke block - * @param radius int Radius of additional blocks to include. E.g. for 3x3 mining radius will be 1 - * @return Set of BlockPos to process by tool block break logic + * @param worldIn {@link World} World reference + * @param pos {@link BlockPos} Position of originally broken block + * @param entityLiving {@link LivingEntity} Player who broke block + * @param radius {@code int} Radius of additional blocks to include. E.g. for 3x3 mining radius will be 1 + * @param placeDummyBlocks {@code boolean} Whether to place dummy blocks + * @return {@link Set} Set of {@link BlockPos} to process by tool block break logic */ public static Set getAOEMiningBlocks(World worldIn, BlockPos pos, @Nullable LivingEntity entityLiving, int radius, boolean placeDummyBlocks) { if (!(entityLiving instanceof PlayerEntity playerIn)) { @@ -167,10 +167,10 @@ public class ToolsUtil { } /** - * Check if JackHammer shouldn't break block. JackHammers should be good on stone, dirt, sand. And shouldn't break ores. + * Check if JackHammer shouldn't break block. JackHammers should be good on stone, dirt, sand. And shouldn't break ores. * - * @param blockState BlockState to check - * @return boolean True if block shouldn't be breakable by JackHammer + * @param blockState {@link BlockState} State to check + * @return {@code boolean} True if block shouldn't be breakable by JackHammer */ public static boolean JackHammerSkippedBlocks(BlockState blockState){ if (blockState.getMaterial() == Material.AIR) { @@ -191,5 +191,3 @@ public class ToolsUtil { return blockState.getBlock() instanceof RedstoneOreBlock; } } - - diff --git a/src/main/java/techreborn/utils/damageSources/ElectrialShockSource.java b/src/main/java/techreborn/utils/damageSources/ElectricalShockSource.java similarity index 93% rename from src/main/java/techreborn/utils/damageSources/ElectrialShockSource.java rename to src/main/java/techreborn/utils/damageSources/ElectricalShockSource.java index 9f5f8ce17..9025529b9 100644 --- a/src/main/java/techreborn/utils/damageSources/ElectrialShockSource.java +++ b/src/main/java/techreborn/utils/damageSources/ElectricalShockSource.java @@ -29,8 +29,8 @@ import net.minecraft.entity.damage.DamageSource; /** * Created by modmuss50 on 06/03/2016. */ -public class ElectrialShockSource extends DamageSource { - public ElectrialShockSource() { +public class ElectricalShockSource extends DamageSource { + public ElectricalShockSource() { super("shock"); } }