-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a way to pre-register BlockFib's before the world was loading s…
…o that Fibs could be added at ModInitialization. Added logging where useful. Cleaned shop a little.
- Loading branch information
1 parent
1b1c7c9
commit fe5f704
Showing
11 changed files
with
81 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package dev.hephaestus.fiblib; | ||
|
||
import net.fabricmc.api.ModInitializer; | ||
import net.minecraft.block.Blocks; | ||
import net.minecraft.world.dimension.DimensionType; | ||
|
||
public class Tester implements ModInitializer { | ||
static boolean DEBUG = false; | ||
@Override | ||
public void onInitialize() { | ||
if (DEBUG) { | ||
FibLib.register(DimensionType.OVERWORLD, Blocks.GRASS_BLOCK, (state, player) -> Blocks.STONE.getDefaultState()); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/dev/hephaestus/fiblib/mixin/ServerWorldMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package dev.hephaestus.fiblib.mixin; | ||
|
||
import dev.hephaestus.fiblib.FibLib; | ||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.server.WorldGenerationProgressListener; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.util.profiler.Profiler; | ||
import net.minecraft.world.WorldSaveHandler; | ||
import net.minecraft.world.dimension.DimensionType; | ||
import net.minecraft.world.level.LevelProperties; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import java.util.concurrent.Executor; | ||
|
||
@Mixin(ServerWorld.class) | ||
public class ServerWorldMixin { | ||
@Inject(method = "<init>", at = @At("TAIL")) | ||
public void initializeFibbers(MinecraftServer server, Executor workerExecutor, WorldSaveHandler worldSaveHandler, LevelProperties properties, DimensionType dimensionType, Profiler profiler, WorldGenerationProgressListener worldGenerationProgressListener, CallbackInfo ci) { | ||
FibLib.registerPreloadedFibs((ServerWorld)(Object)this); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
"environment": "*", | ||
"entrypoints": { | ||
"main": [ | ||
"dev.hephaestus.fiblib.Tester" | ||
] | ||
}, | ||
"mixins": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters