Skip to content

Commit

Permalink
wisp particles added
Browse files Browse the repository at this point in the history
  • Loading branch information
Khazoda committed Apr 23, 2024
1 parent 277ffd2 commit 8ea08eb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/seacroak/plushables/block/BasketBlock.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.seacroak.plushables.block;

import com.mojang.serialization.MapCodec;
import com.seacroak.plushables.PlushablesMod;
import com.seacroak.plushables.block.tile.BasketBlockEntity;
import com.seacroak.plushables.config.ClientConfigValues;
Expand Down Expand Up @@ -225,5 +226,8 @@ public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable Livi

}


@Override
protected MapCodec<? extends BlockWithEntity> getCodec() {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.seacroak.plushables.networking.PlushablesNetworking;
import com.seacroak.plushables.networking.SoundPacketHandler;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.piston.PistonBehavior;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.player.PlayerEntity;
Expand All @@ -18,6 +19,7 @@
import net.minecraft.util.ActionResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.random.Random;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
Expand All @@ -27,10 +29,21 @@
import java.util.List;

public class WispBlock extends BaseInteractablePlushable {

public WispBlock() {
super(FabricBlockSettings.create().sounds(BlockSoundGroup.WOOL).strength(0.7f).nonOpaque().luminance(14).pistonBehavior(PistonBehavior.DESTROY));
}

public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
double d = (double) pos.getX() + 0.55 - (double) (random.nextFloat() * 0.25F);
double e = (double) pos.getY() + 0.55 - (double) (random.nextFloat() * 0.25F);
double f = (double) pos.getZ() + 0.55 - (double) (random.nextFloat() * 0.25F);
if (random.nextInt(5) == 0) {
world.addParticle(ParticleTypes.END_ROD, d, e, f, random.nextGaussian() * 0.01, random.nextGaussian() * 0.01, random.nextGaussian() * 0.01);
}

}

@Override
public VoxelShape getShape() {
VoxelShape shape = VoxelShapes.empty();
Expand Down

0 comments on commit 8ea08eb

Please sign in to comment.