-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support new Fabric API changes and Sodium 0.5.3
Ports the parts of FabricMC/fabric#3287 that relate to Indigo. Now uses the same renderer-api-v1 impl details that Indigo uses; if this becomes an issue the util class can be moved into Indium. Fixes #228, fixes #232. Co-authored-by: Technici4n <[email protected]>
- Loading branch information
1 parent
794272d
commit 75088b0
Showing
10 changed files
with
108 additions
and
148 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
41 changes: 41 additions & 0 deletions
41
src/main/java/link/infra/indium/mixin/renderer/MixinBakedModel.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,41 @@ | ||
/* | ||
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package link.infra.indium.mixin.renderer; | ||
|
||
import link.infra.indium.renderer.render.AbstractBlockRenderContext; | ||
import net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel; | ||
import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; | ||
import net.fabricmc.fabric.impl.renderer.VanillaModelEncoder; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.client.render.model.BakedModel; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.random.Random; | ||
import net.minecraft.world.BlockRenderView; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
import java.util.function.Supplier; | ||
|
||
@Mixin(BakedModel.class) | ||
public interface MixinBakedModel extends FabricBakedModel { | ||
/** | ||
* Override the fallback path to shade vanilla quads differently. | ||
*/ | ||
@Override | ||
default void emitBlockQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context) { | ||
VanillaModelEncoder.emitBlockQuads((BakedModel) this, state, randomSupplier, context, ((AbstractBlockRenderContext) context).getVanillaModelEmitter()); | ||
} | ||
} |
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
36 changes: 0 additions & 36 deletions
36
src/main/java/link/infra/indium/renderer/render/IndiumQuadHandler.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.