-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
49 additions
and
12 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
37 changes: 34 additions & 3 deletions
37
src/main/java/io/github/kvverti/colormatic/iface/SodiumColorProviderCompat.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 |
---|---|---|
@@ -1,13 +1,44 @@ | ||
/* | ||
* Colormatic | ||
* Copyright (C) 2021 Thalia Nero | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* As an additional permission, when conveying the Corresponding Source of an | ||
* object code form of this work, you may exclude the Corresponding Source for | ||
* "Minecraft" by Mojang Studios, AB. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
package io.github.kvverti.colormatic.iface; | ||
|
||
import me.jellysquid.mods.sodium.client.model.quad.ModelQuadColorProvider; | ||
import me.jellysquid.mods.sodium.client.world.biome.BlockColorsExtended; | ||
|
||
import net.minecraft.block.BlockState; | ||
import net.minecraft.client.color.block.BlockColorProvider; | ||
|
||
/** | ||
* Compatibility interface for mixing into Sodium. This interface effectively "forward declares" the methods | ||
* declared in {@code BlockColorsExtended} in order to prevent a non-fatal exception from being thrown within | ||
* declared in {@link BlockColorsExtended} in order to prevent a non-fatal exception from being thrown within | ||
* mixin when Sodium is not installed. | ||
*/ | ||
public interface SodiumColorProviderCompat { | ||
BlockColorProvider getColorProvider(BlockState state); | ||
ModelQuadColorProvider<BlockState> getColorProvider(BlockState state); | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
final class EnsureCorrectSignatures implements SodiumColorProviderCompat, BlockColorsExtended { | ||
@Override | ||
public ModelQuadColorProvider<BlockState> getColorProvider(BlockState state) { | ||
throw new AssertionError("this class should not be instantiated"); | ||
} | ||
} |
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