Skip to content

Commit

Permalink
fix: spotless? more like feckless
Browse files Browse the repository at this point in the history
  • Loading branch information
bruberu committed Jul 22, 2024
1 parent e467afa commit fc96413
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 104 deletions.
1 change: 0 additions & 1 deletion src/main/java/gregtech/api/capability/ICoolantHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import gregtech.api.capability.impl.LockableFluidTank;
import gregtech.api.nuclear.fission.ICoolantStats;
import gregtech.api.unification.material.properties.CoolantProperty;

import net.minecraft.util.EnumFacing;
import net.minecraftforge.fluids.Fluid;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/gregtech/api/capability/IFuelRodHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import gregtech.api.items.itemhandlers.LockableItemStackHandler;
import gregtech.api.nuclear.fission.IFissionFuelStats;
import gregtech.api.nuclear.fission.components.FuelRod;
import gregtech.api.unification.material.properties.FissionFuelProperty;

import net.minecraft.item.ItemStack;

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/gregtech/api/fluids/GTFluidRegistration.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import gregtech.api.GTValues;
import gregtech.api.GregTechAPI;
import gregtech.api.nuclear.fission.CoolantRegistry;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.properties.CoolantProperty;
import gregtech.api.unification.material.properties.FluidProperty;
import gregtech.api.unification.material.properties.PropertyKey;
import gregtech.common.blocks.MetaBlocks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
package gregtech.api.nuclear.fission;

import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;

import net.minecraftforge.fluids.Fluid;

import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Collection;
import java.util.Map;

public class CoolantRegistry {

private static final Map<Fluid, ICoolantStats> COOLANTS = new Object2ObjectOpenHashMap<>();
private static final Map<ICoolantStats, Fluid> COOLANTS_INVERSE = new Object2ObjectOpenHashMap<>();


public static void registerCoolant(@NotNull Fluid fluid, @NotNull ICoolantStats coolant) {
COOLANTS.put(fluid, coolant);
COOLANTS_INVERSE.put(coolant, fluid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

import gregtech.api.util.ItemStackHashStrategy;

import net.minecraft.item.ItemStack;

import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;

import net.minecraft.item.ItemStack;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Collection;
import java.util.Map;

public class FissionFuelRegistry {

private static final Map<Integer, IFissionFuelStats> HASHED_FUELS = new Int2ObjectArrayMap<>();
private static final Map<ItemStack, IFissionFuelStats> FUELS = new Object2ObjectOpenCustomHashMap<>(
ItemStackHashStrategy.comparingAllButCount());
private static final Map<IFissionFuelStats, ItemStack> DEPLETED_FUELS = new Object2ObjectOpenHashMap<>();


public static void registerFuel(@NotNull ItemStack item, @NotNull IFissionFuelStats fuel, @NotNull ItemStack depletedFuel) {
public static void registerFuel(@NotNull ItemStack item, @NotNull IFissionFuelStats fuel,
@NotNull ItemStack depletedFuel) {
HASHED_FUELS.put(fuel.hashCode(), fuel);
FUELS.put(item, fuel);
DEPLETED_FUELS.put(fuel, depletedFuel);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package gregtech.api.nuclear.fission;

import net.minecraft.item.ItemStack;

import org.jetbrains.annotations.NotNull;

public interface IFissionFuelStats {

/**
Expand Down Expand Up @@ -43,7 +39,9 @@ public interface IFissionFuelStats {

/**
* Helper method for the tooltip
* @return An integer corresponding to the stability of the fuel. 0 corresponds to stable, 1 to somewhat stable, 2 to dangerous, 3 to very dangerous
*
* @return An integer corresponding to the stability of the fuel. 0 corresponds to stable, 1 to somewhat stable, 2
* to dangerous, 3 to very dangerous
*/
default int getNeutronGenerationTimeCategory() {
if (this.getNeutronGenerationTime() > 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import gregtech.api.capability.ICoolantHandler;
import gregtech.api.nuclear.fission.ICoolantStats;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.properties.PropertyKey;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,6 @@ public static void register() {
HeavyWater.setProperty(PropertyKey.COOLANT,
new CoolantProperty(HeavyWater, HighPressureHeavyWater, FluidStorageKeys.LIQUID, 4., 1000,
374.4, 2064000, 4228.)
.setAccumulatesHydrogen(true));
.setAccumulatesHydrogen(true));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public class CoolantProperty implements IMaterialProperty, ICoolantStats {

private double mass;

public CoolantProperty(Material mat, Material hotHPCoolant, FluidStorageKey key, double moderatorFactor, double coolingFactor,
public CoolantProperty(Material mat, Material hotHPCoolant, FluidStorageKey key, double moderatorFactor,
double coolingFactor,
double boilingPoint, double heatOfVaporization,
double specificHeatCapacity) {
this.hotHPCoolant = hotHPCoolant;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
package gregtech.api.unification.material.properties;

import gregtech.api.nuclear.fission.IFissionFuelStats;
import gregtech.api.unification.OreDictUnifier;

import gregtech.api.unification.ore.OrePrefix;

import net.minecraft.item.ItemStack;

import org.jetbrains.annotations.NotNull;

public class FissionFuelProperty implements IMaterialProperty, IFissionFuelStats {

Expand Down
1 change: 0 additions & 1 deletion src/main/java/gregtech/api/unification/ore/OrePrefix.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.Materials;
import gregtech.api.unification.material.info.MaterialIconType;
import gregtech.api.unification.material.properties.FissionFuelProperty;
import gregtech.api.unification.material.properties.IMaterialProperty;
import gregtech.api.unification.material.properties.PropertyKey;
import gregtech.api.unification.stack.MaterialStack;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/gregtech/api/util/FluidTooltipUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import gregtech.api.nuclear.fission.CoolantRegistry;
import gregtech.api.nuclear.fission.ICoolantStats;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.properties.CoolantProperty;
import gregtech.api.unification.material.properties.PropertyKey;

import net.minecraft.client.resources.I18n;
import net.minecraft.util.text.TextFormatting;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gregtech/client/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public static void addNBTClearingTooltip(ItemTooltipEvent event) {
}
}

@SuppressWarnings("deprecation") // we need the deprecated I18n to match EnderCore in all cases
@SuppressWarnings("deprecation") // we need the deprecated I18n to match EnderCore in all cases
@SubscribeEvent(priority = EventPriority.LOWEST)
public static void cleanupDebugTooltips(ItemTooltipEvent event) {
ItemStack stack = event.getItemStack();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import gregtech.common.metatileentities.MetaTileEntities;
import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityControlRodPort;
import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityCoolantExportHatch;

import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityFuelRodImportBus;

import net.minecraft.block.state.IBlockState;
Expand Down Expand Up @@ -85,7 +84,7 @@
import java.util.Objects;

public class MetaTileEntityFissionReactor extends MultiblockWithDisplayBase
implements IDataInfoProvider, IProgressBarMultiblock, ICustomEnergyCover {
implements IDataInfoProvider, IProgressBarMultiblock, ICustomEnergyCover {

private FissionReactor fissionReactor;
private int diameter;
Expand Down Expand Up @@ -129,21 +128,21 @@ protected ModularUI.Builder createUITemplate(EntityPlayer entityPlayer) {
() -> this.getFillPercentage(0),
4, 115, 76, 7,
GuiTextures.PROGRESS_BAR_FISSION_HEAT, ProgressWidget.MoveType.HORIZONTAL)
.setHoverTextConsumer(list -> this.addBarHoverText(list, 0));
.setHoverTextConsumer(list -> this.addBarHoverText(list, 0));
builder.widget(progressBar);

progressBar = new ProgressWidget(
() -> this.getFillPercentage(1),
82, 115, 76, 7,
GuiTextures.PROGRESS_BAR_FISSION_PRESSURE, ProgressWidget.MoveType.HORIZONTAL)
.setHoverTextConsumer(list -> this.addBarHoverText(list, 1));
.setHoverTextConsumer(list -> this.addBarHoverText(list, 1));
builder.widget(progressBar);

progressBar = new ProgressWidget(
() -> this.getFillPercentage(2),
160, 115, 76, 7,
GuiTextures.PROGRESS_BAR_FISSION_ENERGY, ProgressWidget.MoveType.HORIZONTAL)
.setHoverTextConsumer(list -> this.addBarHoverText(list, 2));
.setHoverTextConsumer(list -> this.addBarHoverText(list, 2));
builder.widget(progressBar);

builder.label(9, 9, getMetaFullName(), 0xFFFFFF);
Expand All @@ -161,7 +160,7 @@ protected String getDisplayString() {
}.setBackground(GuiTextures.DARK_SLIDER_BACKGROUND).setSliderIcon(GuiTextures.DARK_SLIDER_ICON));
builder.widget(new SliderWidget("gregtech.gui.fission.coolant_flow", 10, 80, 220, 18, 0.0f, 16000.f, flowRate,
this::setFlowRate).setBackground(GuiTextures.DARK_SLIDER_BACKGROUND)
.setSliderIcon(GuiTextures.DARK_SLIDER_ICON));
.setSliderIcon(GuiTextures.DARK_SLIDER_ICON));

builder.widget(new AdvancedTextWidget(9, 20, this::addDisplayText, 0xFFFFFF)
.setMaxWidthLimit(220)
Expand All @@ -171,7 +170,7 @@ protected String getDisplayString() {

builder.widget(new ToggleButtonWidget(215, 183, 18, 18, GuiTextures.BUTTON_LOCK,
this::isLocked, this::tryLocking).shouldUseBaseBackground()
.setTooltipText("gregtech.gui.fission.lock"));
.setTooltipText("gregtech.gui.fission.lock"));
builder.widget(new ImageWidget(215, 201, 18, 6, GuiTextures.BUTTON_POWER_DETAIL));

// Voiding Mode Button
Expand Down Expand Up @@ -206,7 +205,7 @@ public double getFillPercentage(int index) {
protected @NotNull Widget getFlexButton(int x, int y, int width, int height) {
return new ToggleButtonWidget(x, y, width, height, this::areControlRodsRegulated,
this::toggleControlRodRegulation).setButtonTexture(GuiTextures.BUTTON_CONTROL_ROD_HELPER)
.setTooltipText("gregtech.gui.fission.helper");
.setTooltipText("gregtech.gui.fission.helper");
}

/**
Expand Down Expand Up @@ -382,16 +381,16 @@ public void updateFormedValid() {
this.lockingState = LockingState.MISSING_FUEL;
break;
} else if (!((MetaTileEntityFuelRodImportBus) fuelImport).getExportHatch(this.height -
1)
1)
.getExportItems().insertItem(0,
FissionFuelRegistry.getDepletedFuel(fuelImport.getFuel()), true)
.isEmpty()) {
// We still need to know if the output is blocked, even if the recipe doesn't start
// yet
canWork = false;
this.lockingState = LockingState.FUEL_CLOGGED;
break;
}
// We still need to know if the output is blocked, even if the recipe doesn't start
// yet
canWork = false;
this.lockingState = LockingState.FUEL_CLOGGED;
break;
}

}

Expand Down Expand Up @@ -579,19 +578,19 @@ public TraceabilityPredicate getImportPredicate() {
MultiblockAbility<?>[] allowedAbilities = { MultiblockAbility.IMPORT_COOLANT, MultiblockAbility.IMPORT_FUEL_ROD,
MultiblockAbility.CONTROL_ROD_PORT };
return tilePredicate((state, tile) -> {
if (!(tile instanceof IMultiblockAbilityPart<?> &&
ArrayUtils.contains(allowedAbilities, ((IMultiblockAbilityPart<?>) tile).getAbility()))) {
return false;
}
if (tile instanceof IFissionReactorHatch hatchPart) {
if (!hatchPart.checkValidity(height - 1)) {
state.setError(new PatternStringError("gregtech.multiblock.pattern.error.hatch_invalid"));
return false;
}
return true;
}
if (!(tile instanceof IMultiblockAbilityPart<?> &&
ArrayUtils.contains(allowedAbilities, ((IMultiblockAbilityPart<?>) tile).getAbility()))) {
return false;
}
if (tile instanceof IFissionReactorHatch hatchPart) {
if (!hatchPart.checkValidity(height - 1)) {
state.setError(new PatternStringError("gregtech.multiblock.pattern.error.hatch_invalid"));
return false;
},
}
return true;
}
return false;
},
() -> Arrays.stream(allowedAbilities)
.flatMap(ability -> MultiblockAbility.REGISTRY.get(ability).stream())
.filter(Objects::nonNull).map(tile -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import gregtech.api.metatileentity.multiblock.IMultiblockAbilityPart;
import gregtech.api.metatileentity.multiblock.MultiblockAbility;
import gregtech.api.nuclear.fission.ICoolantStats;
import gregtech.api.unification.material.properties.CoolantProperty;
import gregtech.client.renderer.texture.Textures;

import net.minecraft.entity.player.EntityPlayer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import gregtech.api.metatileentity.multiblock.IMultiblockAbilityPart;
import gregtech.api.metatileentity.multiblock.MultiblockAbility;
import gregtech.api.nuclear.fission.ICoolantStats;
import gregtech.api.unification.material.properties.CoolantProperty;
import gregtech.client.renderer.texture.Textures;
import gregtech.common.blocks.BlockFissionCasing;
import gregtech.common.blocks.MetaBlocks;
Expand All @@ -32,7 +31,6 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidTank;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.items.IItemHandlerModifiable;
Expand All @@ -49,8 +47,8 @@
import static gregtech.api.capability.GregtechDataCodes.FISSION_LOCK_UPDATE;

public class MetaTileEntityCoolantImportHatch extends MetaTileEntityMultiblockNotifiablePart
implements IMultiblockAbilityPart<ICoolantHandler>, ICoolantHandler,
IControllable, IFissionReactorHatch {
implements IMultiblockAbilityPart<ICoolantHandler>, ICoolantHandler,
IControllable, IFissionReactorHatch {

private boolean workingEnabled;
private LockableFluidTank fluidTank;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import gregtech.api.capability.IControllable;
import gregtech.api.capability.IFuelRodHandler;
import gregtech.api.gui.GuiTextures;
import gregtech.api.gui.IRenderContext;
import gregtech.api.gui.ModularUI;
import gregtech.api.gui.widgets.BlockableSlotWidget;
import gregtech.api.gui.widgets.SlotWidget;
import gregtech.api.items.itemhandlers.LockableItemStackHandler;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;
Expand All @@ -16,13 +14,10 @@
import gregtech.api.nuclear.fission.FissionFuelRegistry;
import gregtech.api.nuclear.fission.IFissionFuelStats;
import gregtech.api.nuclear.fission.components.FuelRod;
import gregtech.api.unification.material.properties.FissionFuelProperty;
import gregtech.client.renderer.texture.Textures;
import gregtech.client.utils.RenderUtil;
import gregtech.common.blocks.BlockFissionCasing;
import gregtech.common.blocks.MetaBlocks;

import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
Expand All @@ -46,7 +41,8 @@
import static gregtech.api.capability.GregtechDataCodes.FISSION_LOCK_UPDATE;

public class MetaTileEntityFuelRodImportBus extends MetaTileEntityMultiblockNotifiablePart
implements IMultiblockAbilityPart<IFuelRodHandler>, IFuelRodHandler, IControllable, IFissionReactorHatch {
implements IMultiblockAbilityPart<IFuelRodHandler>, IFuelRodHandler,
IControllable, IFissionReactorHatch {

private boolean workingEnabled;
private IFissionFuelStats fuelProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@

@JEIPlugin
@GregTechModule(
moduleID = GregTechModules.MODULE_JEI,
containerID = GTValues.MODID,
modDependencies = Mods.Names.JUST_ENOUGH_ITEMS,
name = "GregTech JEI Integration",
description = "JustEnoughItems Integration Module")
moduleID = GregTechModules.MODULE_JEI,
containerID = GTValues.MODID,
modDependencies = Mods.Names.JUST_ENOUGH_ITEMS,
name = "GregTech JEI Integration",
description = "JustEnoughItems Integration Module")
public class JustEnoughItemsModule extends IntegrationSubmodule implements IModPlugin {

public static IIngredientRegistry ingredientRegistry;
Expand Down Expand Up @@ -197,7 +197,7 @@ public void register(IModRegistry registry) {
}

registry.addRecipes(recipeStream.map(r -> new GTRecipeWrapper(recipeMap, r))
.collect(Collectors.toList()),
.collect(Collectors.toList()),
entry.getKey().getUniqueID());
}
}
Expand Down
Loading

0 comments on commit fc96413

Please sign in to comment.