-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fully add data-driven item lighting.
- Loading branch information
1 parent
e39c01e
commit a47cb73
Showing
11 changed files
with
196 additions
and
76 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
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
37 changes: 37 additions & 0 deletions
37
src/main/java/dev/lambdaurora/lambdynlights/mixin/TagCollectorMixin.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,37 @@ | ||
/* | ||
* Copyright © 2024 LambdAurora <[email protected]> | ||
* | ||
* This file is part of LambDynamicLights. | ||
* | ||
* Licensed under the Lambda License. For more information, | ||
* see the LICENSE file. | ||
*/ | ||
|
||
package dev.lambdaurora.lambdynlights.mixin; | ||
|
||
import dev.lambdaurora.lambdynlights.LambDynLights; | ||
import dev.lambdaurora.lambdynlights.resource.item.ItemLightSources; | ||
import net.minecraft.client.multiplayer.TagCollector; | ||
import net.minecraft.core.Registry; | ||
import net.minecraft.core.RegistryAccess; | ||
import net.minecraft.resources.ResourceKey; | ||
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.function.Predicate; | ||
|
||
@Mixin(TagCollector.class) | ||
public class TagCollectorMixin { | ||
@Inject( | ||
method = "applyTags(Lnet/minecraft/core/RegistryAccess;Ljava/util/function/Predicate;)V", | ||
at = @At("RETURN") | ||
) | ||
private void onTagSynchronization( | ||
RegistryAccess registryAccess, Predicate<ResourceKey<? extends Registry<?>>> predicate, | ||
CallbackInfo ci | ||
) { | ||
LambDynLights.get().itemLightSources.apply(registryAccess); | ||
} | ||
} |
Oops, something went wrong.