-
Notifications
You must be signed in to change notification settings - Fork 107
Fabric #1128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Nyfaria
wants to merge
10
commits into
develop/1.21.1
Choose a base branch
from
fabric
base: develop/1.21.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fabric #1128
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
66ddcf6
removal of onlyin and start on fabric registering of species items/bl…
Nyfaria c7315c9
need dist for event handling.
Nyfaria b1d292d
almost ready.
Nyfaria ec2d636
possibly done
Nyfaria 206c4b4
fixed missing bottom rings texture and z fighting.
Nyfaria 3d601fc
Merge branch 'develop/1.21.1' into fabric
Nyfaria 029d947
implemented the updated seasonal
Nyfaria f316285
remove debug mixin
Nyfaria 667812d
minor fixes, AWs in mod json
Nyfaria 5b93988
config rework.
Nyfaria File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
20 changes: 20 additions & 0 deletions
20
common/src/main/java/com/dtteam/dynamictrees/platform/ClientServices.java
This file contains hidden or 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,20 @@ | ||
| package com.dtteam.dynamictrees.platform; | ||
|
|
||
| import com.dtteam.dynamictrees.DynamicTrees; | ||
| import com.dtteam.dynamictrees.platform.services.IClientHelper; | ||
|
|
||
| import java.util.ServiceLoader; | ||
|
|
||
|
|
||
| public class ClientServices { | ||
|
|
||
| public static final IClientHelper CLIENT = load(IClientHelper.class); | ||
|
|
||
| public static <T> T load(Class<T> clazz) { | ||
| final T loadedService = ServiceLoader.load(clazz) | ||
| .findFirst() | ||
| .orElseThrow(() -> new NullPointerException("Failed to load service for " + clazz.getName())); | ||
| DynamicTrees.LOG.debug("Loaded {} for service {}", loadedService, clazz); | ||
| return loadedService; | ||
| } | ||
| } |
15 changes: 15 additions & 0 deletions
15
common/src/main/java/com/dtteam/dynamictrees/platform/services/IClientHelper.java
This file contains hidden or 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 com.dtteam.dynamictrees.platform.services; | ||
|
|
||
| import com.dtteam.dynamictrees.entity.FallingTreeEntity; | ||
| import com.dtteam.dynamictrees.model.FallingTreeEntityModel; | ||
| import net.minecraft.client.renderer.texture.TextureAtlasSprite; | ||
|
|
||
|
|
||
| public interface IClientHelper { | ||
|
|
||
| int getPixelRGBA(TextureAtlasSprite sprite, int x, int y); | ||
|
|
||
|
|
||
| FallingTreeEntityModel newFallingTreeEntityModel(FallingTreeEntity entity); | ||
|
|
||
| } |
9 changes: 1 addition & 8 deletions
9
common/src/main/java/com/dtteam/dynamictrees/platform/services/IMiscHelper.java
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
36 changes: 35 additions & 1 deletion
36
fabric/src/main/java/com/dtteam/dynamictrees/DynamicTreesFabric.java
This file contains hidden or 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 |
|---|---|---|
| @@ -1,23 +1,57 @@ | ||
| package com.dtteam.dynamictrees; | ||
|
|
||
| import com.dtteam.dynamictrees.block.leaves.LeavesProperties; | ||
| import com.dtteam.dynamictrees.client.BlockColorMultipliers; | ||
| import com.dtteam.dynamictrees.config.DTConfigs; | ||
| import com.dtteam.dynamictrees.event.handler.CommonEventHandler; | ||
| import com.dtteam.dynamictrees.event.handler.ModEventHandler; | ||
| import com.dtteam.dynamictrees.event.handler.VanillaSaplingEventHandler; | ||
| import com.dtteam.dynamictrees.platform.FabricMiscHelper; | ||
| import com.dtteam.dynamictrees.registry.FabricRegistryHandler; | ||
| import com.dtteam.dynamictrees.registry.FabricRegistryLoader; | ||
| import com.dtteam.dynamictrees.worldgen.FabricBiomeModifications; | ||
| import net.fabricmc.api.EnvType; | ||
| import net.fabricmc.api.ModInitializer; | ||
| import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; | ||
| import net.fabricmc.loader.api.FabricLoader; | ||
|
|
||
| public class DynamicTreesFabric implements ModInitializer { | ||
|
|
||
| @Override | ||
| public void onInitialize() { | ||
| DTConfigs.registerConfigs(); //Must be first | ||
| DTConfigs.registerConfigs(); | ||
|
|
||
| FabricRegistryHandler.setup(DynamicTrees.MOD_ID); | ||
|
|
||
| CommonEventHandler.RegisterEvents(); | ||
| ModEventHandler.RegisterEvents(); | ||
| VanillaSaplingEventHandler.register(); | ||
|
|
||
| DynamicTrees.init(); | ||
|
|
||
| FabricRegistryLoader.setup(); | ||
|
|
||
| DynamicTrees.commonSetup(); | ||
|
|
||
| FabricBiomeModifications.register(); | ||
|
|
||
| ServerLifecycleEvents.SERVER_STARTING.register(server -> { | ||
| VanillaSaplingEventHandler.updateEnabled(); | ||
| FabricMiscHelper.debugSpeciesRegistry(); | ||
| }); | ||
|
|
||
| ServerLifecycleEvents.SERVER_STOPPING.register(server -> { | ||
| FabricMiscHelper.currentServer = null; | ||
| }); | ||
|
|
||
| if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) { | ||
| ServerLifecycleEvents.SERVER_STARTED.register(server -> { | ||
| LeavesProperties.postInitClient(); | ||
| BlockColorMultipliers.cleanUp(); | ||
| DynamicTreesFabricClient.registerBlockColors(); | ||
| DynamicTreesFabricClient.discoverWoodColors(); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FabricMiscHelper.debugSpeciesRegistry()logs multiple INFO lines on every server start. This looks like temporary debugging and will add noise for all users/servers. Please remove it or gate it behind a debug config (e.g.,IConfigHelper.DEBUG) / log-level check.