Fixed color providers (#201)

This commit is contained in:
paulevsGitch 2021-06-13 16:52:31 +03:00
parent 542dff12f5
commit f5ceb6201a
3 changed files with 11 additions and 26 deletions

View file

@ -8,6 +8,7 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Vec3i;
import net.minecraft.util.Mth;
import net.minecraft.world.item.ItemStack;
@ -47,6 +48,10 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp
@Override
public BlockColor getProvider() {
return (state, world, pos, tintIndex) -> {
if (pos == null) {
pos = BlockPos.ZERO;
};
long i = (long) pos.getX() + (long) pos.getY() + (long) pos.getZ();
double delta = i * 0.1;
int index = MHelper.floor(delta);