Continue mapping migration

This commit is contained in:
Aleksey 2021-04-12 21:38:22 +03:00
parent 99ade39404
commit f03fd03bd0
499 changed files with 12567 additions and 12723 deletions

View file

@ -4,14 +4,14 @@ import java.util.Random;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor;
import net.minecraft.core.BlockPos;
import net.minecraft.util.Mth;
import net.minecraft.core.Vec3i;
import net.minecraft.util.Mth;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.blocks.basis.VineBlock;
import ru.betterend.interfaces.IColorProvider;
import ru.betterend.registry.EndParticles;
@ -19,13 +19,13 @@ import ru.betterend.util.MHelper;
public class TenaneaFlowersBlock extends VineBlock implements IColorProvider {
public static final Vec3i[] COLORS;
public TenaneaFlowersBlock() {
super(15);
}
@Override
public BlockColor getBlockProvider() {
public BlockColor getProvider() {
return (state, world, pos, tintIndex) -> {
long i = (MHelper.getRandom(pos.getX(), pos.getZ()) & 63) + pos.getY();
double delta = i * 0.1;
@ -33,15 +33,15 @@ public class TenaneaFlowersBlock extends VineBlock implements IColorProvider {
int index2 = (index + 1) & 3;
delta -= index;
index &= 3;
Vec3i color1 = COLORS[index];
Vec3i color2 = COLORS[index2];
int r = MHelper.floor(Mth.lerp(delta, color1.getX(), color2.getX()));
int g = MHelper.floor(Mth.lerp(delta, color1.getY(), color2.getY()));
int b = MHelper.floor(Mth.lerp(delta, color1.getZ(), color2.getZ()));
float[] hsb = MHelper.fromRGBtoHSB(r, g, b);
return MHelper.fromHSBtoRGB(hsb[0], MHelper.max(0.5F, hsb[1]), hsb[2]);
};
}
@ -52,12 +52,12 @@ public class TenaneaFlowersBlock extends VineBlock implements IColorProvider {
return MHelper.color(255, 255, 255);
};
}
@Override
public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient) {
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
return false;
}
@Environment(EnvType.CLIENT)
public void animateTick(BlockState state, Level world, BlockPos pos, Random random) {
super.animateTick(state, world, pos, random);
@ -68,9 +68,13 @@ public class TenaneaFlowersBlock extends VineBlock implements IColorProvider {
world.addParticle(EndParticles.TENANEA_PETAL, x, y, z, 0, 0, 0);
}
}
static {
COLORS = new Vec3i[] { new Vec3i(250, 111, 222), new Vec3i(167, 89, 255), new Vec3i(120, 207, 239),
new Vec3i(255, 87, 182) };
COLORS = new Vec3i[] {
new Vec3i(250, 111, 222),
new Vec3i(167, 89, 255),
new Vec3i(120, 207, 239),
new Vec3i(255, 87, 182)
};
}
}