Random code cleanup

This commit is contained in:
modmuss50 2023-06-25 11:49:39 +01:00
parent 4a1d6b3bb1
commit bafbf3bbba
93 changed files with 158 additions and 203 deletions

View file

@ -242,13 +242,7 @@ public class TechRebornClient implements ClientModInitializer {
}
private static class UnbakedDynamicModel implements UnbakedModel {
private final Supplier<BaseDynamicFluidBakedModel> supplier;
public UnbakedDynamicModel(Supplier<BaseDynamicFluidBakedModel> supplier) {
this.supplier = supplier;
}
private record UnbakedDynamicModel(Supplier<BaseDynamicFluidBakedModel> supplier) implements UnbakedModel {
@Override
public Collection<Identifier> getModelDependencies() {
return Collections.emptyList();

View file

@ -136,7 +136,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
public class ClientGuiType<T extends BlockEntity> {
@SuppressWarnings("unused")
public record ClientGuiType<T extends BlockEntity>(GuiType<T> guiType, GuiFactory<T> guiFactory) {
public static final Map<Identifier, ClientGuiType<?>> TYPES = new HashMap<>();
public static final ClientGuiType<AdjustableSUBlockEntity> AESU = register(GuiType.AESU, GuiAESU::new);
@ -203,23 +204,11 @@ public class ClientGuiType<T extends BlockEntity> {
}
}
private final GuiType<T> guiType;
private final GuiFactory<T> guiFactory;
public ClientGuiType(GuiType<T> guiType, GuiFactory<T> guiFactory) {
this.guiType = Objects.requireNonNull(guiType);
this.guiFactory = Objects.requireNonNull(guiFactory);
HandledScreens.register(guiType.getScreenHandlerType(), getGuiFactory());
HandledScreens.register(guiType.getScreenHandlerType(), guiFactory());
TYPES.put(guiType.getIdentifier(), this);
}
public GuiType<T> getGuiType() {
return guiType;
}
public GuiFactory<T> getGuiFactory() {
return guiFactory;
}
}

View file

@ -33,10 +33,10 @@ import net.minecraft.text.Text;
import reborncore.common.screen.BuiltScreenHandler;
public interface GuiFactory<T extends BlockEntity> extends HandledScreens.Provider<BuiltScreenHandler, HandledScreen<BuiltScreenHandler>> {
HandledScreen<?> create(int syncId, PlayerEntity playerEntity, T blockEntity);
HandledScreen<BuiltScreenHandler> create(int syncId, PlayerEntity playerEntity, T blockEntity);
@Override
default HandledScreen create(BuiltScreenHandler builtScreenHandler, PlayerInventory playerInventory, Text text) {
default HandledScreen<BuiltScreenHandler> create(BuiltScreenHandler builtScreenHandler, PlayerInventory playerInventory, Text text) {
PlayerEntity playerEntity = playerInventory.player;
//noinspection unchecked
T blockEntity = (T) builtScreenHandler.getBlockEntity();

View file

@ -39,7 +39,7 @@ import techreborn.packets.ServerboundPackets;
public class GuiAESU extends GuiBase<BuiltScreenHandler> {
AdjustableSUBlockEntity blockEntity;
final AdjustableSUBlockEntity blockEntity;
public GuiAESU(int syncID, final PlayerEntity player, final AdjustableSUBlockEntity aesu) {
super(player, aesu, aesu.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.iron.IronAlloyFurnaceBlockEntity;
public class GuiAlloyFurnace extends GuiBase<BuiltScreenHandler> {
IronAlloyFurnaceBlockEntity blockEntity;
final IronAlloyFurnaceBlockEntity blockEntity;
public GuiAlloyFurnace(int syncID, PlayerEntity player, IronAlloyFurnaceBlockEntity alloyFurnace) {
super(player, alloyFurnace, alloyFurnace.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier1.AlloySmelterBlockEntity;
public class GuiAlloySmelter extends GuiBase<BuiltScreenHandler> {
AlloySmelterBlockEntity blockEntity;
final AlloySmelterBlockEntity blockEntity;
public GuiAlloySmelter(int syncID, final PlayerEntity player, final AlloySmelterBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier1.AssemblingMachineBlockEntity;
public class GuiAssemblingMachine extends GuiBase<BuiltScreenHandler> {
AssemblingMachineBlockEntity blockEntity;
final AssemblingMachineBlockEntity blockEntity;
public GuiAssemblingMachine(int syncID, final PlayerEntity player, final AssemblingMachineBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -28,7 +28,6 @@ import net.minecraft.client.gui.DrawContext;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.recipe.CraftingRecipe;
import net.minecraft.util.Identifier;
import reborncore.client.ClientNetworkManager;
import reborncore.client.gui.GuiBase;
import reborncore.client.gui.GuiBuilder;
@ -40,10 +39,7 @@ import techreborn.packets.ServerboundPackets;
* Created by modmuss50 on 20/06/2017.
*/
public class GuiAutoCrafting extends GuiBase<BuiltScreenHandler> {
static final Identifier RECIPE_BOOK_TEXTURE = new Identifier("textures/gui/recipe_book.png");
boolean showGui = true;
AutoCraftingTableBlockEntity blockEntityAutoCraftingTable;
final AutoCraftingTableBlockEntity blockEntityAutoCraftingTable;
public GuiAutoCrafting(int syncID, PlayerEntity player, AutoCraftingTableBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -35,7 +35,7 @@ import techreborn.blockentity.storage.energy.LowVoltageSUBlockEntity;
public class GuiBatbox extends GuiBase<BuiltScreenHandler> {
LowVoltageSUBlockEntity blockEntity;
final LowVoltageSUBlockEntity blockEntity;
public GuiBatbox(int syncID, final PlayerEntity player, final LowVoltageSUBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier0.block.blockbreaker.BlockBreakerProce
public class GuiBlockBreaker extends GuiBase<BuiltScreenHandler> {
BlockBreakerBlockEntity blockEntity;
final BlockBreakerBlockEntity blockEntity;
public GuiBlockBreaker(int syncID, final PlayerEntity player, final BlockBreakerBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier0.block.blockplacer.BlockPlacerProcess
public class GuiBlockPlacer extends GuiBase<BuiltScreenHandler> {
BlockPlacerBlockEntity blockEntity;
final BlockPlacerBlockEntity blockEntity;
public GuiBlockPlacer(int syncID, final PlayerEntity player, final BlockPlacerBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier3.IndustrialCentrifugeBlockEntity;
public class GuiCentrifuge extends GuiBase<BuiltScreenHandler> {
IndustrialCentrifugeBlockEntity blockEntity;
final IndustrialCentrifugeBlockEntity blockEntity;
public GuiCentrifuge(int syncID, final PlayerEntity player, final IndustrialCentrifugeBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -32,7 +32,7 @@ import techreborn.blockentity.machine.misc.ChargeOMatBlockEntity;
public class GuiChargeBench extends GuiBase<BuiltScreenHandler> {
ChargeOMatBlockEntity blockEntity;
final ChargeOMatBlockEntity blockEntity;
public GuiChargeBench(int syncID, final PlayerEntity player, final ChargeOMatBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier1.ChemicalReactorBlockEntity;
public class GuiChemicalReactor extends GuiBase<BuiltScreenHandler> {
ChemicalReactorBlockEntity blockEntity;
final ChemicalReactorBlockEntity blockEntity;
public GuiChemicalReactor(int syncID, final PlayerEntity player, final ChemicalReactorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -39,7 +39,7 @@ import techreborn.packets.ServerboundPackets;
public class GuiChunkLoader extends GuiBase<BuiltScreenHandler> {
ChunkLoaderBlockEntity blockEntity;
final ChunkLoaderBlockEntity blockEntity;
public GuiChunkLoader(int syncID, PlayerEntity player, ChunkLoaderBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier1.CompressorBlockEntity;
public class GuiCompressor extends GuiBase<BuiltScreenHandler> {
CompressorBlockEntity blockEntity;
final CompressorBlockEntity blockEntity;
public GuiCompressor(int syncID, final PlayerEntity player, final CompressorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.generator.advanced.DieselGeneratorBlockEntity;
public class GuiDieselGenerator extends GuiBase<BuiltScreenHandler> {
DieselGeneratorBlockEntity blockEntity;
final DieselGeneratorBlockEntity blockEntity;
public GuiDieselGenerator(int syncID, final PlayerEntity player, final DieselGeneratorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier1.ElectricFurnaceBlockEntity;
public class GuiElectricFurnace extends GuiBase<BuiltScreenHandler> {
ElectricFurnaceBlockEntity blockEntity;
final ElectricFurnaceBlockEntity blockEntity;
public GuiElectricFurnace(int syncID, final PlayerEntity player, final ElectricFurnaceBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -32,7 +32,7 @@ import techreborn.blockentity.machine.tier1.ElevatorBlockEntity;
public class GuiElevator extends GuiBase<BuiltScreenHandler> {
ElevatorBlockEntity blockEntity;
final ElevatorBlockEntity blockEntity;
public GuiElevator(int syncID, final PlayerEntity player, final ElevatorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier1.ExtractorBlockEntity;
public class GuiExtractor extends GuiBase<BuiltScreenHandler> {
ExtractorBlockEntity blockEntity;
final ExtractorBlockEntity blockEntity;
public GuiExtractor(int syncID, final PlayerEntity player, final ExtractorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -32,7 +32,7 @@ import techreborn.blockentity.machine.tier2.FishingStationBlockEntity;
public class GuiFishingStation extends GuiBase<BuiltScreenHandler> {
FishingStationBlockEntity blockEntity;
final FishingStationBlockEntity blockEntity;
public GuiFishingStation(int syncID, final PlayerEntity player, final FishingStationBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.generator.advanced.GasTurbineBlockEntity;
public class GuiGasTurbine extends GuiBase<BuiltScreenHandler> {
GasTurbineBlockEntity blockEntity;
final GasTurbineBlockEntity blockEntity;
public GuiGasTurbine(int syncID, final PlayerEntity player, final GasTurbineBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -32,7 +32,7 @@ import techreborn.blockentity.generator.basic.SolidFuelGeneratorBlockEntity;
public class GuiGenerator extends GuiBase<BuiltScreenHandler> {
SolidFuelGeneratorBlockEntity blockEntity;
final SolidFuelGeneratorBlockEntity blockEntity;
public GuiGenerator(int syncID, final PlayerEntity player, final SolidFuelGeneratorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -32,7 +32,7 @@ import reborncore.common.screen.BuiltScreenHandler;
import techreborn.blockentity.machine.tier1.GrinderBlockEntity;
public class GuiGrinder extends GuiBase<BuiltScreenHandler> {
GrinderBlockEntity blockEntity;
final GrinderBlockEntity blockEntity;
public GuiGrinder(int syncID, final PlayerEntity player, final GrinderBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -35,7 +35,7 @@ import techreborn.blockentity.storage.energy.idsu.InterdimensionalSUBlockEntity;
public class GuiIDSU extends GuiBase<BuiltScreenHandler> {
InterdimensionalSUBlockEntity idsu;
final InterdimensionalSUBlockEntity idsu;
public GuiIDSU(int syncID, PlayerEntity player, InterdimensionalSUBlockEntity blockEntityIDSU) {
super(player, blockEntityIDSU, blockEntityIDSU.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier1.IndustrialElectrolyzerBlockEntity;
public class GuiIndustrialElectrolyzer extends GuiBase<BuiltScreenHandler> {
IndustrialElectrolyzerBlockEntity blockEntity;
final IndustrialElectrolyzerBlockEntity blockEntity;
public GuiIndustrialElectrolyzer(int syncID, final PlayerEntity player, final IndustrialElectrolyzerBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -42,7 +42,7 @@ import techreborn.utils.PlayerUtils;
import java.util.Objects;
public class GuiIronFurnace extends GuiBase<BuiltScreenHandler> {
IronFurnaceBlockEntity blockEntity;
final IronFurnaceBlockEntity blockEntity;
private static final Identifier EXP_BUTTON_TEXTURE = new Identifier("minecraft", "textures/item/experience_bottle.png");
public GuiIronFurnace(int syncID, PlayerEntity player, IronFurnaceBlockEntity furnace) {

View file

@ -35,7 +35,7 @@ import techreborn.blockentity.storage.energy.lesu.LapotronicSUBlockEntity;
public class GuiLESU extends GuiBase<BuiltScreenHandler> {
LapotronicSUBlockEntity blockEntity;
final LapotronicSUBlockEntity blockEntity;
public GuiLESU(int syncID, final PlayerEntity player, final LapotronicSUBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -36,7 +36,7 @@ import techreborn.packets.ServerboundPackets;
public class GuiLaunchpad extends GuiBase<BuiltScreenHandler> {
LaunchpadBlockEntity blockEntity;
final LaunchpadBlockEntity blockEntity;
public GuiLaunchpad(int syncID, final PlayerEntity player, final LaunchpadBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -35,7 +35,7 @@ import techreborn.blockentity.storage.energy.MediumVoltageSUBlockEntity;
public class GuiMFE extends GuiBase<BuiltScreenHandler> {
MediumVoltageSUBlockEntity mfe;
final MediumVoltageSUBlockEntity mfe;
public GuiMFE(int syncID, final PlayerEntity player, final MediumVoltageSUBlockEntity mfe) {
super(player, mfe, mfe.createScreenHandler(syncID, player));

View file

@ -35,7 +35,7 @@ import techreborn.blockentity.storage.energy.HighVoltageSUBlockEntity;
public class GuiMFSU extends GuiBase<BuiltScreenHandler> {
HighVoltageSUBlockEntity mfsu;
final HighVoltageSUBlockEntity mfsu;
public GuiMFSU(int syncID, final PlayerEntity player, final HighVoltageSUBlockEntity mfsu) {
super(player, mfsu, mfsu.createScreenHandler(syncID, player));

View file

@ -38,8 +38,8 @@ import techreborn.packets.ServerboundPackets;
public class GuiManual extends Screen {
private static final Identifier MANUAL_TEXTURE = new Identifier("techreborn", "textures/gui/manual.png");
int guiWidth = 207;
int guiHeight = 195;
final int guiWidth = 207;
final int guiHeight = 195;
private static final Text text1 = Text.translatable("techreborn.manual.wiki");
private static final Text text2 = Text.translatable("techreborn.manual.discord");
private static final Text text3 = Text.translatable("techreborn.manual.refund");

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier3.MatterFabricatorBlockEntity;
public class GuiMatterFabricator extends GuiBase<BuiltScreenHandler> {
MatterFabricatorBlockEntity blockEntity;
final MatterFabricatorBlockEntity blockEntity;
public GuiMatterFabricator(int syncID, final PlayerEntity player, final MatterFabricatorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -36,7 +36,7 @@ import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
*/
public class GuiPlasmaGenerator extends GuiBase<BuiltScreenHandler> {
PlasmaGeneratorBlockEntity blockEntity;
final PlasmaGeneratorBlockEntity blockEntity;
public GuiPlasmaGenerator(int syncID, final PlayerEntity player, final PlasmaGeneratorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -36,7 +36,7 @@ import techreborn.packets.ServerboundPackets;
public class GuiPlayerDetector extends GuiBase<BuiltScreenHandler> {
PlayerDetectorBlockEntity blockEntity;
final PlayerDetectorBlockEntity blockEntity;
public GuiPlayerDetector(int syncID, final PlayerEntity player, final PlayerDetectorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier1.RecyclerBlockEntity;
public class GuiRecycler extends GuiBase<BuiltScreenHandler> {
RecyclerBlockEntity blockEntity;
final RecyclerBlockEntity blockEntity;
public GuiRecycler(int syncID, final PlayerEntity player, final RecyclerBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -35,7 +35,7 @@ import techreborn.packets.ServerboundPackets;
public class GuiRollingMachine extends GuiBase<BuiltScreenHandler> {
RollingMachineBlockEntity rollingMachine;
final RollingMachineBlockEntity rollingMachine;
public GuiRollingMachine(int syncID, final PlayerEntity player, final RollingMachineBlockEntity blockEntityRollingmachine) {
super(player, blockEntityRollingmachine, blockEntityRollingmachine.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier1.ScrapboxinatorBlockEntity;
public class GuiScrapboxinator extends GuiBase<BuiltScreenHandler> {
ScrapboxinatorBlockEntity blockEntity;
final ScrapboxinatorBlockEntity blockEntity;
public GuiScrapboxinator(int syncID, final PlayerEntity player, final ScrapboxinatorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.generator.advanced.SemiFluidGeneratorBlockEntity;
public class GuiSemifluidGenerator extends GuiBase<BuiltScreenHandler> {
SemiFluidGeneratorBlockEntity blockEntity;
final SemiFluidGeneratorBlockEntity blockEntity;
public GuiSemifluidGenerator(int syncID, final PlayerEntity player, final SemiFluidGeneratorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.generator.SolarPanelBlockEntity;
public class GuiSolar extends GuiBase<BuiltScreenHandler> {
SolarPanelBlockEntity blockEntity;
final SolarPanelBlockEntity blockEntity;
public GuiSolar(int syncID, PlayerEntity player, SolarPanelBlockEntity panel) {
super(player, panel, panel.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier1.SolidCanningMachineBlockEntity;
public class GuiSolidCanningMachine extends GuiBase<BuiltScreenHandler> {
SolidCanningMachineBlockEntity blockEntity;
final SolidCanningMachineBlockEntity blockEntity;
public GuiSolidCanningMachine(int syncID, final PlayerEntity player, final SolidCanningMachineBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -35,7 +35,7 @@ import techreborn.packets.ServerboundPackets;
public class GuiStorageUnit extends GuiBase<BuiltScreenHandler> {
StorageUnitBaseBlockEntity storageEntity;
final StorageUnitBaseBlockEntity storageEntity;
public GuiStorageUnit(int syncID, final PlayerEntity player, final StorageUnitBaseBlockEntity storageEntity) {
super(player, storageEntity, storageEntity.createScreenHandler(syncID, player));

View file

@ -35,7 +35,7 @@ import techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity;
public class GuiTankUnit extends GuiBase<BuiltScreenHandler> {
TankUnitBaseBlockEntity tankEntity;
final TankUnitBaseBlockEntity tankEntity;
public GuiTankUnit(int syncID, final PlayerEntity player, final TankUnitBaseBlockEntity tankEntity) {
super(player, tankEntity, tankEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.generator.advanced.ThermalGeneratorBlockEntity;
public class GuiThermalGenerator extends GuiBase<BuiltScreenHandler> {
ThermalGeneratorBlockEntity blockEntity;
final ThermalGeneratorBlockEntity blockEntity;
public GuiThermalGenerator(int syncID, final PlayerEntity player, final ThermalGeneratorBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -33,7 +33,7 @@ import techreborn.blockentity.machine.tier1.WireMillBlockEntity;
public class GuiWireMill extends GuiBase<BuiltScreenHandler> {
WireMillBlockEntity blockEntity;
final WireMillBlockEntity blockEntity;
public GuiWireMill(int syncID, final PlayerEntity player, final WireMillBlockEntity blockEntity) {
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));

View file

@ -55,14 +55,11 @@ import techreborn.utils.PoweredCraftingHandler;
import techreborn.world.WorldGenerator;
public class TechReborn implements ModInitializer {
public static final String MOD_ID = "techreborn";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
public static TechReborn INSTANCE;
@Override
public void onInitialize() {
INSTANCE = this;
new Configuration(TechRebornConfig.class, "techreborn");
// Done to force the class to load

View file

@ -37,7 +37,7 @@ public class GeneratorRecipeHelper {
* value of the {@link EFluidGenerator} enum is linked to an object holding a set of
* {@link FluidGeneratorRecipe}.
*/
public static EnumMap<EFluidGenerator, FluidGeneratorRecipeList> fluidRecipes = new EnumMap<>(
public static final EnumMap<EFluidGenerator, FluidGeneratorRecipeList> fluidRecipes = new EnumMap<>(
EFluidGenerator.class);
/**

View file

@ -133,7 +133,7 @@ public class CableBlockEntity extends BlockEntity
return energyContainer.getSideStorage(side);
}
public BlockState getCover() {
public @Nullable BlockState getCover() {
return cover;
}

View file

@ -148,7 +148,7 @@ class CableTickManager {
// Limit max amount to the cable transfer rate.
long targetMaxAmount = Math.min(remainingAmount / remainingTargets, cableType.transferRate);
long localTransferred = operation.transfer(target.storage.storage, targetMaxAmount, transaction);
long localTransferred = operation.transfer(target.storage.storage(), targetMaxAmount, transaction);
if (localTransferred > 0) {
transferredAmount += localTransferred;
// Block duplicate operations.
@ -171,7 +171,7 @@ class CableTickManager {
SortableStorage(TransferOperation operation, OfferedEnergyStorage storage) {
this.storage = storage;
try (Transaction tx = Transaction.openOuter()) {
this.simulationResult = operation.transfer(storage.storage, Long.MAX_VALUE, tx);
this.simulationResult = operation.transfer(storage.storage(), Long.MAX_VALUE, tx);
}
}
}

View file

@ -30,17 +30,7 @@ import team.reborn.energy.api.EnergyStorage;
/**
* {@link EnergyStorage} adjacent to an energy cable, with some additional info.
*/
class OfferedEnergyStorage {
final CableBlockEntity sourceCable;
final Direction direction;
final EnergyStorage storage;
OfferedEnergyStorage(CableBlockEntity sourceCable, Direction direction, EnergyStorage storage) {
this.sourceCable = sourceCable;
this.direction = direction;
this.storage = storage;
}
record OfferedEnergyStorage(CableBlockEntity sourceCable, Direction direction, EnergyStorage storage) {
void afterTransfer() {
// Block insertions from this side.
sourceCable.blockedSides |= 1 << direction.ordinal();

View file

@ -45,7 +45,7 @@ import techreborn.init.TRContent;
public class DragonEggSyphonBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider {
public RebornInventory<DragonEggSyphonBlockEntity> inventory = new RebornInventory<>(3, "DragonEggSyphonBlockEntity", 64, this);
public final RebornInventory<DragonEggSyphonBlockEntity> inventory = new RebornInventory<>(3, "DragonEggSyphonBlockEntity", 64, this);
private long lastOutput = 0;
public DragonEggSyphonBlockEntity(BlockPos pos, BlockState state) {

View file

@ -54,8 +54,8 @@ import java.util.Map;
public class SolidFuelGeneratorBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
public RebornInventory<SolidFuelGeneratorBlockEntity> inventory = new RebornInventory<>(2, "SolidFuelGeneratorBlockEntity", 64, this);
public int fuelSlot = 0;
public final RebornInventory<SolidFuelGeneratorBlockEntity> inventory = new RebornInventory<>(2, "SolidFuelGeneratorBlockEntity", 64, this);
public final int fuelSlot = 0;
public int burnTime;
public int totalBurnTime = 0;
public boolean isBurning;

View file

@ -49,11 +49,11 @@ import reborncore.common.util.RebornInventory;
public abstract class GenericMachineBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, IRecipeCrafterProvider {
public String name;
public int maxInput;
public int maxEnergy;
public Block toolDrop;
public int energySlot;
public final String name;
public final int maxInput;
public final int maxEnergy;
public final Block toolDrop;
public final int energySlot;
public RebornInventory<?> inventory;
public RecipeCrafter crafter;

View file

@ -47,8 +47,8 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt
public int burnTime;
public int totalBurnTime;
public int progress;
int fuelSlot;
Block toolDrop;
final int fuelSlot;
final Block toolDrop;
public AbstractIronMachineBlockEntity(BlockEntityType<?> blockEntityTypeIn, BlockPos pos, BlockState state, int fuelSlot, Block toolDrop) {
super(blockEntityTypeIn, pos, state);

View file

@ -46,7 +46,7 @@ import techreborn.init.TRContent;
public class ChargeOMatBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
public RebornInventory<ChargeOMatBlockEntity> inventory = new RebornInventory<>(6, "ChargeOMatBlockEntity", 64, this);
public final RebornInventory<ChargeOMatBlockEntity> inventory = new RebornInventory<>(6, "ChargeOMatBlockEntity", 64, this);
public ChargeOMatBlockEntity(BlockPos pos, BlockState state) {
super(TRBlockEntities.CHARGE_O_MAT, pos, state);

View file

@ -45,7 +45,7 @@ import techreborn.init.TRContent;
public class DrainBlockEntity extends MachineBaseBlockEntity implements IToolDrop {
protected Tank internalTank = new Tank("tank", FluidValue.BUCKET, this);
protected final Tank internalTank = new Tank("tank", FluidValue.BUCKET, this);
public DrainBlockEntity(BlockPos pos, BlockState state) {
super(TRBlockEntities.DRAIN, pos, state);

View file

@ -55,7 +55,7 @@ import techreborn.init.TRContent;
public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public static final FluidValue TANK_CAPACITY = FluidValue.BUCKET.multiply(16);
public Tank tank;
public final Tank tank;
int ticksSinceLastChange;
public FluidReplicatorBlockEntity(BlockPos pos, BlockState state) {

View file

@ -59,9 +59,9 @@ public class FusionControlComputerBlockEntity extends GenericMachineBlockEntity
public int neededPower = 0;
public int size = 6;
public int state = -1;
int topStackSlot = 0;
int bottomStackSlot = 1;
int outputStackSlot = 2;
final int topStackSlot = 0;
final int bottomStackSlot = 1;
final int outputStackSlot = 2;
FusionReactorRecipe currentRecipe = null;
Identifier currentRecipeID = null;
boolean hasStartedCrafting = false;

View file

@ -51,7 +51,7 @@ import techreborn.init.TRContent;
public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public static final FluidValue TANK_CAPACITY = FluidValue.BUCKET.multiply(16);
public Tank tank;
public final Tank tank;
int ticksSinceLastChange;
public IndustrialGrinderBlockEntity(BlockPos pos, BlockState state) {

View file

@ -51,7 +51,7 @@ import techreborn.init.TRContent;
public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider {
public static final FluidValue TANK_CAPACITY = FluidValue.BUCKET.multiply(16);
public Tank tank;
public final Tank tank;
int ticksSinceLastChange;
public IndustrialSawmillBlockEntity(BlockPos pos, BlockState state) {

View file

@ -41,8 +41,8 @@ import reborncore.common.screen.builder.ScreenHandlerBuilder;
import techreborn.blockentity.machine.GenericMachineBlockEntity;
public class AbstractBlockBlockEntity extends GenericMachineBlockEntity implements BuiltScreenHandlerProvider, BlockProcessable {
private final int ENERGY_SLOT = 0;
private final int INPUT_SLOT = 1;
private static final int ENERGY_SLOT = 0;
private static final int INPUT_SLOT = 1;
protected BlockProcessor processor;

View file

@ -38,7 +38,7 @@ import reborncore.common.blockentity.MachineBaseBlockEntity;
* @author SimonFlapse
*/
public class BlockProcessorUtils {
private BlockProcessorUtils() {};
private BlockProcessorUtils() {}
/**
* <b>Get the hardness to break of a block</b>
@ -48,8 +48,7 @@ public class BlockProcessorUtils {
* @return the hardness to break of the supplied {@link BlockState}
*/
public static float getHardness(World world, BlockState blockInFront, BlockPos positionInFront) {
float hardness = blockInFront.getHardness(world, positionInFront);
return hardness;
return blockInFront.getHardness(world, positionInFront);
}

View file

@ -58,14 +58,14 @@ import java.util.UUID;
*/
public class BlockBreakerProcessor extends BlockBreakerNbt implements BlockProcessor {
private UUID processorId = UUID.randomUUID();
private BlockProcessable processable;
private final UUID processorId = UUID.randomUUID();
private final BlockProcessable processable;
private int outputSlot;
private int fakeInputSlot;
private final int outputSlot;
private final int fakeInputSlot;
private int baseBreakTime;
private int baseCostToBreak;
private final int baseBreakTime;
private final int baseCostToBreak;
public BlockBreakerProcessor(BlockProcessable processable, int outputSlot, int fakeInputSlot, int baseBreakTime, int baseCostToBreak) {
this.processable = processable;

View file

@ -48,13 +48,13 @@ import techreborn.blockentity.machine.tier0.block.ProcessingStatus;
*/
public class BlockPlacerProcessor extends BlockPlacerNbt implements BlockProcessor {
private BlockProcessable processable;
private final BlockProcessable processable;
private int inputSlot;
private int fakeOutputSlot;
private final int inputSlot;
private final int fakeOutputSlot;
private int basePlaceTime;
private int baseCostToPlace;
private final int basePlaceTime;
private final int baseCostToPlace;
public BlockPlacerProcessor(BlockProcessable processable, int inputSlot, int fakeOutputSlot, int basePlaceTime, int baseCostToPlace) {
this.processable = processable;

View file

@ -71,13 +71,13 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
public static final int CRAFTING_WIDTH = 3;
public static final int CRAFTING_AREA = CRAFTING_HEIGHT*CRAFTING_WIDTH;
public RebornInventory<AutoCraftingTableBlockEntity> inventory = new RebornInventory<>(CRAFTING_AREA+2, "AutoCraftingTableBlockEntity", 64, this);
public final RebornInventory<AutoCraftingTableBlockEntity> inventory = new RebornInventory<>(CRAFTING_AREA+2, "AutoCraftingTableBlockEntity", 64, this);
private final int OUTPUT_SLOT = CRAFTING_AREA; // first slot is indexed by 0, so this is the last non crafting slot
private final int EXTRA_OUTPUT_SLOT = CRAFTING_AREA + 1;
public int progress;
public int maxProgress = 120;
public int euTick = 10;
public final int euTick = 10;
public int balanceSlot = 0;
CraftingInventory inventoryCrafting = null;

View file

@ -54,9 +54,9 @@ import java.util.Optional;
public class ElectricFurnaceBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
public RebornInventory<ElectricFurnaceBlockEntity> inventory = new RebornInventory<>(3, "ElectricFurnaceBlockEntity", 64, this);
int inputSlot = 0;
int outputSlot = 1;
public final RebornInventory<ElectricFurnaceBlockEntity> inventory = new RebornInventory<>(3, "ElectricFurnaceBlockEntity", 64, this);
final int inputSlot = 0;
final int outputSlot = 1;
int ticksSinceLastChange;
private SmeltingRecipe currentRecipe;
private int cookTime;

View file

@ -36,7 +36,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.World;
import org.apache.commons.lang3.tuple.Pair;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import reborncore.api.IToolDrop;
import reborncore.api.blockentity.InventoryProvider;
@ -67,13 +66,12 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
public int[] craftingSlots = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8};
private CraftingInventory craftCache;
public RebornInventory<RollingMachineBlockEntity> inventory = new RebornInventory<>(12, "RollingMachineBlockEntity", 64, this);
public final RebornInventory<RollingMachineBlockEntity> inventory = new RebornInventory<>(12, "RollingMachineBlockEntity", 64, this);
public boolean isRunning;
public int tickTime;
// Only synced to the client
public int currentRecipeTime;
@NotNull
public ItemStack currentRecipeOutput;
public ItemStack currentRecipeOutput = ItemStack.EMPTY;
public RollingMachineRecipe currentRecipe;
private final int outputSlot;
public boolean locked = false;

View file

@ -49,7 +49,7 @@ import techreborn.init.TRContent;
public class ChunkLoaderBlockEntity extends MachineBaseBlockEntity implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
public RebornInventory<ChunkLoaderBlockEntity> inventory = new RebornInventory<>(0, "ChunkLoaderBlockEntity", 64, this);
public final RebornInventory<ChunkLoaderBlockEntity> inventory = new RebornInventory<>(0, "ChunkLoaderBlockEntity", 64, this);
private int radius;
private String ownerUdid;

View file

@ -47,7 +47,7 @@ import techreborn.init.TRContent;
public class MatterFabricatorBlockEntity extends PowerAcceptorBlockEntity
implements IToolDrop, InventoryProvider, BuiltScreenHandlerProvider {
public RebornInventory<MatterFabricatorBlockEntity> inventory = new RebornInventory<>(12, "MatterFabricatorBlockEntity", 64, this);
public final RebornInventory<MatterFabricatorBlockEntity> inventory = new RebornInventory<>(12, "MatterFabricatorBlockEntity", 64, this);
private int amplifier = 0;
public MatterFabricatorBlockEntity(BlockPos pos, BlockState state) {

View file

@ -46,9 +46,9 @@ import techreborn.blocks.storage.energy.EnergyStorageBlock;
*/
public class EnergyStorageBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, InventoryProvider {
public RebornInventory<EnergyStorageBlockEntity> inventory;
public String name;
public Block wrenchDrop;
public final RebornInventory<EnergyStorageBlockEntity> inventory;
public final String name;
public final Block wrenchDrop;
public int maxInput;
public int maxOutput;
public int maxStorage;

View file

@ -28,7 +28,7 @@ import java.util.ArrayList;
public class LesuNetwork {
public ArrayList<LSUStorageBlockEntity> storages = new ArrayList<>();
public final ArrayList<LSUStorageBlockEntity> storages = new ArrayList<>();
public LapotronicSUBlockEntity master;

View file

@ -55,7 +55,7 @@ public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements I
protected Tank tank;
private long serverMaxCapacity = -1;
protected RebornInventory<TankUnitBaseBlockEntity> inventory = new RebornInventory<>(2, "TankInventory", 64, this);
protected final RebornInventory<TankUnitBaseBlockEntity> inventory = new RebornInventory<>(2, "TankInventory", 64, this);
private TRContent.TankUnit type;

View file

@ -67,7 +67,7 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement
// Client sync variables for GUI, what and how much stored
public int storedAmount = 0;
protected RebornInventory<StorageUnitBaseBlockEntity> inventory;
protected final RebornInventory<StorageUnitBaseBlockEntity> inventory;
private int maxCapacity;
private int serverCapacity = -1;

View file

@ -50,13 +50,13 @@ import java.util.List;
*/
public class TransformerBlockEntity extends PowerAcceptorBlockEntity implements IToolDrop, IListInfoProvider {
public String name;
public Block wrenchDrop;
public RcEnergyTier inputTier;
public RcEnergyTier outputTier;
public int maxInput;
public int maxOutput;
public int maxStorage;
public final String name;
public final Block wrenchDrop;
public final RcEnergyTier inputTier;
public final RcEnergyTier outputTier;
public final int maxInput;
public final int maxOutput;
public final int maxStorage;
public TransformerBlockEntity(BlockEntityType<?> blockEntityType, BlockPos pos, BlockState state, String name, Block wrenchDrop, RcEnergyTier tier) {
super(blockEntityType, pos, state);

View file

@ -39,7 +39,7 @@ import java.util.function.BiFunction;
public class GenericMachineBlock extends BlockMachineBase {
private final IMachineGuiHandler gui;
BiFunction<BlockPos, BlockState, BlockEntity> blockEntityClass;
final BiFunction<BlockPos, BlockState, BlockEntity> blockEntityClass;
public GenericMachineBlock(IMachineGuiHandler gui, BiFunction<BlockPos, BlockState, BlockEntity> blockEntityClass) {
super(TRBlockSettings.genericMachine());

View file

@ -60,7 +60,7 @@ public class ResinBasinBlock extends BaseBlockEntityProvider {
public static final BooleanProperty POURING = BooleanProperty.of("pouring");
public static final BooleanProperty FULL = BooleanProperty.of("full");
protected static final VoxelShape SHAPE = Block.createCuboidShape(0d,0d, 0d, 16d, 8d, 16d);
BiFunction<BlockPos, BlockState, BlockEntity> blockEntityClass;
final BiFunction<BlockPos, BlockState, BlockEntity> blockEntityClass;
public ResinBasinBlock(BiFunction<BlockPos, BlockState, BlockEntity> blockEntityClass) {
super(TRBlockSettings.resinBasin());
@ -93,9 +93,8 @@ public class ResinBasinBlock extends BaseBlockEntityProvider {
@SuppressWarnings("deprecation")
@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
if (world == null || world.isClient() || player == null || pos == null || !(world.getBlockEntity(pos) instanceof ResinBasinBlockEntity))
if (world == null || world.isClient() || player == null || pos == null || !(world.getBlockEntity(pos) instanceof ResinBasinBlockEntity basin))
return ActionResult.PASS;
ResinBasinBlockEntity basin = (ResinBasinBlockEntity)world.getBlockEntity(pos);
ItemStack sap = basin.empty();
if (sap.isEmpty())
return ActionResult.PASS;

View file

@ -68,15 +68,14 @@ public class BlockAlarm extends BaseBlockEntityProvider {
private VoxelShape[] GenCuboidShapes(double depth, double width) {
double culling = (16.0D - width) / 2;
VoxelShape[] shapes = {
Block.createCuboidShape(culling, 16.0 - depth, culling, 16.0 - culling, 16.0D, 16.0 - culling),
Block.createCuboidShape(culling, 0.0D, culling, 16.0D - culling, depth, 16.0 - culling),
Block.createCuboidShape(culling, culling, 16.0 - depth, 16.0 - culling, 16.0 - culling, 16.0D),
Block.createCuboidShape(culling, culling, 0.0D, 16.0 - culling, 16.0 - culling, depth),
Block.createCuboidShape(16.0 - depth, culling, culling, 16.0D, 16.0 - culling, 16.0 - culling),
Block.createCuboidShape(0.0D, culling, culling, depth, 16.0 - culling, 16.0 - culling)
return new VoxelShape[]{
createCuboidShape(culling, 16.0 - depth, culling, 16.0 - culling, 16.0D, 16.0 - culling),
createCuboidShape(culling, 0.0D, culling, 16.0D - culling, depth, 16.0 - culling),
createCuboidShape(culling, culling, 16.0 - depth, 16.0 - culling, 16.0 - culling, 16.0D),
createCuboidShape(culling, culling, 0.0D, 16.0 - culling, 16.0 - culling, depth),
createCuboidShape(16.0 - depth, culling, culling, 16.0D, 16.0 - culling, 16.0 - culling),
createCuboidShape(0.0D, culling, culling, depth, 16.0 - culling, 16.0 - culling)
};
return shapes;
}
public static boolean isActive(BlockState state) {

View file

@ -46,7 +46,7 @@ import techreborn.init.TRBlockSettings;
* Created by Mark on 13/03/2016.
*/
public class BlockNuke extends BaseBlock {
public static BooleanProperty OVERLAY = BooleanProperty.of("overlay");
public static final BooleanProperty OVERLAY = BooleanProperty.of("overlay");
public BlockNuke() {
super(TRBlockSettings.nuke());

View file

@ -61,9 +61,9 @@ import techreborn.items.tool.basic.ElectricTreetapItem;
*/
public class BlockRubberLog extends PillarBlock {
public static DirectionProperty SAP_SIDE = Properties.HORIZONTAL_FACING;
public static BooleanProperty HAS_SAP = BooleanProperty.of("hassap");
public static BooleanProperty SHOULD_SAP = BooleanProperty.of("shouldsap");
public static final DirectionProperty SAP_SIDE = Properties.HORIZONTAL_FACING;
public static final BooleanProperty HAS_SAP = BooleanProperty.of("hassap");
public static final BooleanProperty SHOULD_SAP = BooleanProperty.of("shouldsap");
public BlockRubberLog() {
super(TRBlockSettings.rubberLog());

View file

@ -54,9 +54,9 @@ import techreborn.init.TRBlockSettings;
* Created by Rushmead
*/
public abstract class EnergyStorageBlock extends BaseBlockEntityProvider {
public static DirectionProperty FACING = Properties.FACING;
public String name;
public IMachineGuiHandler gui;
public static final DirectionProperty FACING = Properties.FACING;
public final String name;
public final IMachineGuiHandler gui;
public EnergyStorageBlock(String name, IMachineGuiHandler gui) {
super(TRBlockSettings.energyStorage());

View file

@ -58,9 +58,7 @@ public class LSUStorageBlock extends BaseBlockEntityProvider {
return;
}
if (worldIn.getBlockEntity(pos) instanceof LSUStorageBlockEntity blockEntity) {
if (blockEntity != null) {
blockEntity.removeFromNetwork();
}
blockEntity.removeFromNetwork();
}
super.onStateReplaced(state, worldIn, pos, newState, isMoving);
}
@ -74,9 +72,7 @@ public class LSUStorageBlock extends BaseBlockEntityProvider {
public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity player, ItemStack itemstack) {
super.onPlaced(world, pos, state, player, itemstack);
if (world.getBlockEntity(pos) instanceof LSUStorageBlockEntity blockEntity) {
if (blockEntity != null) {
blockEntity.rebuildNetwork();
}
blockEntity.rebuildNetwork();
}
}

View file

@ -50,8 +50,8 @@ import techreborn.init.TRBlockSettings;
*/
public abstract class BlockTransformer extends BaseBlockEntityProvider {
public static DirectionProperty FACING = Properties.FACING;
public String name;
public static final DirectionProperty FACING = Properties.FACING;
public final String name;
public BlockTransformer(String name) {
super(TRBlockSettings.transformer());

View file

@ -52,7 +52,7 @@ public class EntityNukePrimed extends TntEntity {
setFuse(TechRebornConfig.nukeFuseTime);
}
public EntityNukePrimed(World world, double x, double y, double z, LivingEntity owner) {
public EntityNukePrimed(World world, double x, double y, double z, @Nullable LivingEntity owner) {
this(TRContent.ENTITY_NUKE, world);
this.setPosition(x, y, z);

View file

@ -81,10 +81,8 @@ import java.util.List;
import java.util.function.BiFunction;
public class TRBlockEntities {
private static final List<BlockEntityType<?>> TYPES = new ArrayList<>();
public static final BlockEntityType<StorageUnitBaseBlockEntity> STORAGE_UNIT = register(StorageUnitBaseBlockEntity::new, "storage_unit", TRContent.StorageUnit.values());
public static final BlockEntityType<TankUnitBaseBlockEntity> TANK_UNIT = register(TankUnitBaseBlockEntity::new, "tank_unit", TRContent.TankUnit.values());
public static final BlockEntityType<DrainBlockEntity> DRAIN = register(DrainBlockEntity::new, "drain", TRContent.Machine.DRAIN);

View file

@ -109,9 +109,9 @@ import java.util.stream.Stream;
public class TRContent {
public static Marker DATAGEN = MarkerFactory.getMarker("datagen");
public static BlockSetType RUBBER_WOOD_SET_TYPE = BlockSetTypeRegistry.registerWood(new Identifier(TechReborn.MOD_ID, "rubber_wood"));
public static WoodType RUBBER_WOOD_TYPE = WoodTypeRegistry.register(new Identifier(TechReborn.MOD_ID, "rubber_wood"), RUBBER_WOOD_SET_TYPE);
public static final Marker DATAGEN = MarkerFactory.getMarker("datagen");
public static final BlockSetType RUBBER_WOOD_SET_TYPE = BlockSetTypeRegistry.registerWood(new Identifier(TechReborn.MOD_ID, "rubber_wood"));
public static final WoodType RUBBER_WOOD_TYPE = WoodTypeRegistry.register(new Identifier(TechReborn.MOD_ID, "rubber_wood"), RUBBER_WOOD_SET_TYPE);
// Misc Blocks
public static Block COMPUTER_CUBE;
@ -313,11 +313,11 @@ public class TRContent {
public final Block block;
// Generation of EU during Day
public int generationRateD;
public final int generationRateD;
// Generation of EU during Night
public int generationRateN;
public final int generationRateN;
// Internal EU storage of solar panel
public int internalCapacity;
public final int internalCapacity;
public final RcEnergyTier powerTier;
SolarPanels(RcEnergyTier tier, int generationRateD, int generationRateN) {
@ -352,7 +352,7 @@ public class TRContent {
public final Item upgrader;
// How many items it can hold
public int capacity;
public final int capacity;
StorageUnit(int capacity, boolean upgradable) {
@ -409,7 +409,7 @@ public class TRContent {
public final Block block;
// How many blocks it can hold
public FluidValue capacity;
public final FluidValue capacity;
TankUnit(int capacity) {
@ -464,12 +464,12 @@ public class TRContent {
public final String name;
public final CableBlock block;
public int transferRate;
public int defaultTransferRate;
public double cableThickness;
public boolean canKill;
public boolean defaultCanKill;
public RcEnergyTier tier;
public final int transferRate;
public final int defaultTransferRate;
public final double cableThickness;
public final boolean canKill;
public final boolean defaultCanKill;
public final RcEnergyTier tier;
Cables(int transferRate, double cableThickness, boolean canKill, RcEnergyTier tier) {
@ -1577,8 +1577,8 @@ public class TRContent {
blockEntity.muffle();
});
public String name;
public Item item;
public final String name;
public final Item item;
Upgrades(IUpgrade upgrade) {
name = this.toString().toLowerCase(Locale.ROOT);
@ -1592,7 +1592,7 @@ public class TRContent {
}
}
public static EntityType<EntityNukePrimed> ENTITY_NUKE = FabricEntityTypeBuilder.create()
public static final EntityType<EntityNukePrimed> ENTITY_NUKE = FabricEntityTypeBuilder.create()
.entityFactory((EntityType.EntityFactory<EntityNukePrimed>) EntityNukePrimed::new)
.dimensions(EntityDimensions.fixed(1f, 1f))
.trackRangeChunks(10)

View file

@ -35,7 +35,7 @@ import techreborn.config.TechRebornConfig;
* Created by modmuss50 on 05/11/2016.
*/
public class ElectricTreetapItem extends Item implements RcEnergyItem {
public RcEnergyTier tier = RcEnergyTier.MEDIUM;
public final RcEnergyTier tier = RcEnergyTier.MEDIUM;
public ElectricTreetapItem() {
super(new Item.Settings().maxCount(1).maxDamage(-1));

View file

@ -32,7 +32,7 @@ import reborncore.common.util.ItemUtils;
public class TRAxeItem extends AxeItem {
String repairOreDict;
final String repairOreDict;
public TRAxeItem(ToolMaterial material) {
this(material, "");

View file

@ -32,7 +32,7 @@ import reborncore.common.util.ItemUtils;
public class TRHoeItem extends HoeItem {
String repairOreDict;
final String repairOreDict;
public TRHoeItem(ToolMaterial material) {
this(material, "");

View file

@ -32,7 +32,7 @@ import reborncore.common.util.ItemUtils;
public class TRPickaxeItem extends PickaxeItem {
String repairOreDict;
final String repairOreDict;
public TRPickaxeItem(ToolMaterial material) {
this(material, "");

View file

@ -32,7 +32,7 @@ import reborncore.common.util.ItemUtils;
public class TRSpadeItem extends ShovelItem {
String repairOreDict;
final String repairOreDict;
public TRSpadeItem(ToolMaterial material) {
this(material, "");

View file

@ -32,7 +32,7 @@ import reborncore.common.util.ItemUtils;
public class TRSwordItem extends SwordItem {
String repairOreDict;
final String repairOreDict;
public TRSwordItem(ToolMaterial material) {
this(material, "");

View file

@ -87,10 +87,10 @@ public class TagRemapper {
}
private static class TagRename {
Path parent;
final Path parent;
String oldName;
String newName;
final String oldName;
final String newName;
public TagRename(Path tag) {
this.parent = tag.getParent();

View file

@ -52,7 +52,7 @@ public record OreDepth(Identifier identifier, int minY, int maxY, TargetDimensio
TargetDimension.CODEC.fieldOf("dimension").forGetter(OreDepth::dimension)
).apply(instance, OreDepth::new)
);
public static Codec<List<OreDepth>> LIST_CODEC = Codec.list(OreDepth.CODEC);
public static final Codec<List<OreDepth>> LIST_CODEC = Codec.list(OreDepth.CODEC);
public static List<OreDepth> create(MinecraftServer server) {