-
Notifications
You must be signed in to change notification settings - Fork 811
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into snapshot/dev2
# Conflicts: # common/src/main/java/net/caffeinemc/mods/sodium/mixin/features/render/compositing/RenderTargetMixin.java # common/src/main/java/net/caffeinemc/mods/sodium/mixin/features/textures/mipmaps/SpriteContentsMixin.java
- Loading branch information
Showing
62 changed files
with
804 additions
and
514 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
39 changes: 39 additions & 0 deletions
39
common/src/api/java/net/caffeinemc/mods/sodium/api/blockentity/BlockEntityRenderHandler.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,39 @@ | ||
package net.caffeinemc.mods.sodium.api.blockentity; | ||
|
||
import java.util.function.Predicate; | ||
|
||
import net.caffeinemc.mods.sodium.api.internal.DependencyInjection; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.entity.BlockEntityType; | ||
import org.jetbrains.annotations.ApiStatus; | ||
|
||
@ApiStatus.Experimental | ||
@ApiStatus.AvailableSince("0.6.0") | ||
public interface BlockEntityRenderHandler { | ||
BlockEntityRenderHandler INSTANCE = DependencyInjection.load(BlockEntityRenderHandler.class, | ||
"net.caffeinemc.mods.sodium.client.render.chunk.BlockEntityRenderHandlerImpl"); | ||
|
||
static BlockEntityRenderHandler instance() { | ||
return INSTANCE; | ||
} | ||
|
||
/** | ||
* Adds a predicate to determine if a block entity should be rendered. | ||
* | ||
* <p>Upon chunk bake, block entities of the given type will have {@code shouldRender} evaluated. | ||
* <br>If <b>all predicates</b> returns {@code true} (and the block entity has a renderer), the block entity will be | ||
* added to the chunk for future rendering.</p> | ||
* @param type The block entity type to associate the given predicate with. | ||
* @param shouldRender The predicate for the block entity to evaluate. | ||
*/ | ||
<T extends BlockEntity> void addRenderPredicate(BlockEntityType<T> type, BlockEntityRenderPredicate<T> shouldRender); | ||
|
||
/** | ||
* Removes a predicate added by {@code addRenderPredicate}. <b>It must be the same object that was added.</b> | ||
* | ||
* @param type The block entity type to associate the given predicate with. | ||
* @param shouldRender The predicate to remove. | ||
* @return If the predicate existed and was removed. | ||
*/ | ||
<T extends BlockEntity> boolean removeRenderPredicate(BlockEntityType<T> type, BlockEntityRenderPredicate<T> shouldRender); | ||
} |
13 changes: 13 additions & 0 deletions
13
...n/src/api/java/net/caffeinemc/mods/sodium/api/blockentity/BlockEntityRenderPredicate.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,13 @@ | ||
package net.caffeinemc.mods.sodium.api.blockentity; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.BlockGetter; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import org.jetbrains.annotations.ApiStatus; | ||
|
||
@ApiStatus.Experimental | ||
@ApiStatus.AvailableSince("0.6.0") | ||
@FunctionalInterface | ||
public interface BlockEntityRenderPredicate<T extends BlockEntity> { | ||
boolean shouldRender(BlockGetter blockGetter, BlockPos blockPos, T entity); | ||
} |
35 changes: 0 additions & 35 deletions
35
.../src/api/java/net/caffeinemc/mods/sodium/api/vertex/attributes/CommonVertexAttribute.java
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
36 changes: 0 additions & 36 deletions
36
...on/src/api/java/net/caffeinemc/mods/sodium/api/vertex/format/VertexFormatDescription.java
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
common/src/api/java/net/caffeinemc/mods/sodium/api/vertex/format/VertexFormatExtensions.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,9 @@ | ||
package net.caffeinemc.mods.sodium.api.vertex.format; | ||
|
||
public interface VertexFormatExtensions { | ||
/** | ||
* Returns an integer identifier that represents this vertex format in the global namespace. These identifiers | ||
* are valid only for the current process lifetime and should not be saved to disk. | ||
*/ | ||
int sodium$getGlobalId(); | ||
} |
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
6 changes: 2 additions & 4 deletions
6
common/src/api/java/net/caffeinemc/mods/sodium/api/vertex/format/common/ColorVertex.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
8 changes: 3 additions & 5 deletions
8
...api/vertex/format/common/ModelVertex.java → ...pi/vertex/format/common/EntityVertex.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
6 changes: 2 additions & 4 deletions
6
common/src/api/java/net/caffeinemc/mods/sodium/api/vertex/format/common/GlyphVertex.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
6 changes: 2 additions & 4 deletions
6
common/src/api/java/net/caffeinemc/mods/sodium/api/vertex/format/common/LineVertex.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
6 changes: 2 additions & 4 deletions
6
common/src/api/java/net/caffeinemc/mods/sodium/api/vertex/format/common/ParticleVertex.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
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
Oops, something went wrong.