Code style changes, entities fixes
This commit is contained in:
parent
9d604b2d25
commit
44962e18b6
377 changed files with 5038 additions and 4914 deletions
|
@ -1,12 +1,6 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
@ -25,6 +19,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import ru.bclib.client.models.BlockModelProvider;
|
||||
import ru.bclib.client.models.ModelsHelper;
|
||||
import ru.bclib.client.render.BCLRenderLayer;
|
||||
|
@ -35,20 +30,23 @@ import ru.bclib.util.MHelper;
|
|||
import ru.betterend.client.models.Patterns;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class JellyshroomCapBlock extends SlimeBlock implements IRenderTyped, BlockModelProvider, IColorProvider {
|
||||
public static final IntegerProperty COLOR = EndBlockProperties.COLOR;
|
||||
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
|
||||
private final Vec3i colorStart;
|
||||
private final Vec3i colorEnd;
|
||||
private final int coloritem;
|
||||
|
||||
|
||||
public JellyshroomCapBlock(int r1, int g1, int b1, int r2, int g2, int b2) {
|
||||
super(FabricBlockSettings.copyOf(Blocks.SLIME_BLOCK));
|
||||
colorStart = new Vec3i(r1, g1, b1);
|
||||
colorEnd = new Vec3i(r2, g2, b2);
|
||||
coloritem = ColorUtil.color((r1 + r2) >> 1, (g1 + g2) >> 1, (b1 + b2) >> 1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||
double px = ctx.getClickedPos().getX() * 0.1;
|
||||
|
@ -56,17 +54,17 @@ public class JellyshroomCapBlock extends SlimeBlock implements IRenderTyped, Blo
|
|||
double pz = ctx.getClickedPos().getZ() * 0.1;
|
||||
return this.defaultBlockState().setValue(COLOR, MHelper.floor(NOISE.eval(px, py, pz) * 3.5 + 4));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||
stateManager.add(COLOR);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BCLRenderLayer getRenderLayer() {
|
||||
return BCLRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
return Lists.newArrayList(new ItemStack(this));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue