Skip to content

Commit

Permalink
Use static block initialization for better compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
wohaopa committed Apr 3, 2024
1 parent 6b6e183 commit aa39ea7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ public class IGBlocks {
public static BlockCasingSpaceElevator SpaceElevatorCasing;
public static BlockCasingSpaceElevatorMotor SpaceElevatorMotor;

/**
* Initialize the blocks of this mod
*/
public static void init() {
static {
// Initialize the blocks of this mod
SpaceElevatorCable = new BlockSpaceElevatorCable();
GameRegistry.registerBlock(SpaceElevatorCable, ItemBlockSpaceElevatorCable.class, "spaceelevatorcable");
SpaceElevatorCasing = new BlockCasingSpaceElevator();
SpaceElevatorMotor = new BlockCasingSpaceElevatorMotor();
}

/**
* For explicit loading of this class.
*/
public static void init() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,19 @@ public class IGItems {
public static ItemStack SpaceElevatorModuleManager;
public static ItemStack SpaceElevatorModuleResearch;

/**
* Initialize the items of this mod
*/
public static void init() {
static {
// Initialize the items of this mod
SpaceElevatorItems = new ItemSpaceElevatorParts();
MiningDrones = new ItemMiningDrones();
registerItem(SpaceElevatorItems);
registerItem(MiningDrones);
}

/**
* For explicit loading of this class.
*/
public static void init() {}

/**
* Register an item in the game registry, using its unlocalized name
*
Expand Down

0 comments on commit aa39ea7

Please sign in to comment.