More fixes

This commit is contained in:
paulevsGitch 2020-10-08 20:14:20 +03:00
parent 29d8a7e39b
commit 83320b2df3
3 changed files with 29 additions and 1 deletions

View file

@ -1,10 +1,18 @@
package ru.betterend.blocks; package ru.betterend.blocks;
import java.util.Random;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.AbstractBlock; import net.minecraft.block.AbstractBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import ru.betterend.blocks.basis.BlockUnderwaterPlant; import ru.betterend.blocks.basis.BlockUnderwaterPlant;
public class BlockBubbleCoral extends BlockUnderwaterPlant { public class BlockBubbleCoral extends BlockUnderwaterPlant {
@ -13,7 +21,6 @@ public class BlockBubbleCoral extends BlockUnderwaterPlant {
.breakByTool(FabricToolTags.SHEARS) .breakByTool(FabricToolTags.SHEARS)
.sounds(BlockSoundGroup.CORAL) .sounds(BlockSoundGroup.CORAL)
.breakByHand(true) .breakByHand(true)
.lightLevel(12)
.noCollision()); .noCollision());
} }
@ -21,4 +28,12 @@ public class BlockBubbleCoral extends BlockUnderwaterPlant {
public AbstractBlock.OffsetType getOffsetType() { public AbstractBlock.OffsetType getOffsetType() {
return AbstractBlock.OffsetType.NONE; return AbstractBlock.OffsetType.NONE;
} }
@Environment(EnvType.CLIENT)
public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
double x = pos.getX() + random.nextDouble();
double y = pos.getY() + random.nextDouble() * 0.5F + 0.5F;
double z = pos.getZ() + random.nextDouble();
world.addParticle(ParticleTypes.BUBBLE, x, y, z, 0.0D, 0.0D, 0.0D);
}
} }

View file

@ -0,0 +1,3 @@
{
"defaultMaterial": "betterend:noao"
}

View file

@ -0,0 +1,10 @@
{
"layers": [
{
"vertexSource": "canvas:shaders/material/default.vert",
"fragmentSource": "canvas:shaders/material/default.frag",
"disableAo": false,
"disableDiffuse": true
}
]
}