2.1.0 Colored Leaf Particles

This commit is contained in:
Vos
2026-03-25 23:31:39 -05:00
parent 2501315cc7
commit 7989753a2a
4 changed files with 40 additions and 3 deletions
@@ -18,6 +18,7 @@
- Tools have the mining level of the base material with the durability of the next tier. - Tools have the mining level of the base material with the durability of the next tier.
- Hammers get the equivalent durability for the materials put into them. (effectively the durability x6.33) - Hammers get the equivalent durability for the materials put into them. (effectively the durability x6.33)
- Lemonwood Trees now drop lemons. - Lemonwood Trees now drop lemons.
- Lemonwood trees now have yellow leaf particles.
# Known Issues # Known Issues
- The Command Core Item does not display the correct texture when activated. - The Command Core Item does not display the correct texture when activated.
@@ -1,5 +1,6 @@
package com.acethewildfire.acesbs.block; package com.acethewildfire.acesbs.block;
import com.acethewildfire.acesbs.block.custom.ColoredParticleLeavesBlock;
import com.acethewildfire.acesbs.world.tree.ModBlockSaplingGenerator; import com.acethewildfire.acesbs.world.tree.ModBlockSaplingGenerator;
import net.minecraft.block.*; import net.minecraft.block.*;
import net.minecraft.block.enums.NoteBlockInstrument; import net.minecraft.block.enums.NoteBlockInstrument;
@@ -17,7 +18,7 @@ public class FireOakBlocks {
public static final Block STRIPPED_FIRE_OAK_WOOD = ModBlocks.registerBlock("stripped_fire_oak_wood", public static final Block STRIPPED_FIRE_OAK_WOOD = ModBlocks.registerBlock("stripped_fire_oak_wood",
properties -> new PillarBlock(properties.mapColor(MapColor.DARK_RED).instrument(NoteBlockInstrument.BASS).strength(2.0F).sounds(BlockSoundGroup.WOOD))); properties -> new PillarBlock(properties.mapColor(MapColor.DARK_RED).instrument(NoteBlockInstrument.BASS).strength(2.0F).sounds(BlockSoundGroup.WOOD)));
public static final Block FIRE_OAK_LEAVES = ModBlocks.registerBlock("fire_oak_leaves", public static final Block FIRE_OAK_LEAVES = ModBlocks.registerBlock("fire_oak_leaves",
properties -> new UntintedParticleLeavesBlock(0.02f, ParticleTypes.CRIMSON_SPORE, properties.mapColor(MapColor.DARK_RED).strength(0.2F).ticksRandomly().sounds(BlockSoundGroup.GRASS).nonOpaque().allowsSpawning(Blocks::canSpawnOnLeaves).suffocates(Blocks::never).blockVision(Blocks::never).pistonBehavior(PistonBehavior.DESTROY).solidBlock(Blocks::never))); properties -> new ColoredParticleLeavesBlock(0.02f, 156, 46, 59, properties.mapColor(MapColor.DARK_RED).strength(0.2F).ticksRandomly().sounds(BlockSoundGroup.GRASS).nonOpaque().allowsSpawning(Blocks::canSpawnOnLeaves).suffocates(Blocks::never).blockVision(Blocks::never).pistonBehavior(PistonBehavior.DESTROY).solidBlock(Blocks::never)));
public static final Block FIRE_OAK_SAPLING = ModBlocks.registerBlock("fire_oak_sapling", public static final Block FIRE_OAK_SAPLING = ModBlocks.registerBlock("fire_oak_sapling",
properties -> new SaplingBlock(ModBlockSaplingGenerator.FIRE_OAK, properties.mapColor(MapColor.DARK_RED).noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.GRASS).pistonBehavior(PistonBehavior.DESTROY))); properties -> new SaplingBlock(ModBlockSaplingGenerator.FIRE_OAK, properties.mapColor(MapColor.DARK_RED).noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.GRASS).pistonBehavior(PistonBehavior.DESTROY)));
public static final Block POTTED_FIRE_OAK_SAPLING = ModBlocks.registerBlock("potted_fire_oak_sapling", properties -> new FlowerPotBlock(FIRE_OAK_SAPLING, properties.breakInstantly().nonOpaque().pistonBehavior(PistonBehavior.DESTROY))); public static final Block POTTED_FIRE_OAK_SAPLING = ModBlocks.registerBlock("potted_fire_oak_sapling", properties -> new FlowerPotBlock(FIRE_OAK_SAPLING, properties.breakInstantly().nonOpaque().pistonBehavior(PistonBehavior.DESTROY)));
@@ -1,5 +1,6 @@
package com.acethewildfire.acesbs.block; package com.acethewildfire.acesbs.block;
import com.acethewildfire.acesbs.block.custom.ColoredParticleLeavesBlock;
import com.acethewildfire.acesbs.world.tree.ModBlockSaplingGenerator; import com.acethewildfire.acesbs.world.tree.ModBlockSaplingGenerator;
import net.minecraft.block.*; import net.minecraft.block.*;
import net.minecraft.block.enums.NoteBlockInstrument; import net.minecraft.block.enums.NoteBlockInstrument;
@@ -17,9 +18,9 @@ public class LemonWoodBlocks {
public static final Block STRIPPED_LEMONWOOD_WOOD = ModBlocks.registerBlock("stripped_lemonwood_wood", public static final Block STRIPPED_LEMONWOOD_WOOD = ModBlocks.registerBlock("stripped_lemonwood_wood",
properties -> new PillarBlock(properties.mapColor(MapColor.PALE_YELLOW).instrument(NoteBlockInstrument.BASS).strength(2.0F).sounds(BlockSoundGroup.WOOD).burnable())); properties -> new PillarBlock(properties.mapColor(MapColor.PALE_YELLOW).instrument(NoteBlockInstrument.BASS).strength(2.0F).sounds(BlockSoundGroup.WOOD).burnable()));
public static final Block LEMONWOOD_LEAVES = ModBlocks.registerBlock("lemonwood_leaves", public static final Block LEMONWOOD_LEAVES = ModBlocks.registerBlock("lemonwood_leaves",
properties -> new UntintedParticleLeavesBlock(0.02f, ParticleTypes.PALE_OAK_LEAVES, properties.mapColor(MapColor.DARK_GREEN).strength(0.2F).ticksRandomly().sounds(BlockSoundGroup.GRASS).nonOpaque().allowsSpawning(Blocks::canSpawnOnLeaves).suffocates(Blocks::never).blockVision(Blocks::never).burnable().pistonBehavior(PistonBehavior.DESTROY).solidBlock(Blocks::never))); properties -> new ColoredParticleLeavesBlock(0.02f, 226, 193, 70, properties.mapColor(MapColor.PALE_YELLOW).strength(0.2F).ticksRandomly().sounds(BlockSoundGroup.GRASS).nonOpaque().allowsSpawning(Blocks::canSpawnOnLeaves).suffocates(Blocks::never).blockVision(Blocks::never).burnable().pistonBehavior(PistonBehavior.DESTROY).solidBlock(Blocks::never)));
public static final Block LEMONWOOD_SAPLING = ModBlocks.registerBlock("lemonwood_sapling", public static final Block LEMONWOOD_SAPLING = ModBlocks.registerBlock("lemonwood_sapling",
properties -> new SaplingBlock(ModBlockSaplingGenerator.LEMONWOOD, properties.mapColor(MapColor.DARK_GREEN).noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.GRASS).pistonBehavior(PistonBehavior.DESTROY))); properties -> new SaplingBlock(ModBlockSaplingGenerator.LEMONWOOD, properties.mapColor(MapColor.PALE_YELLOW).noCollision().ticksRandomly().breakInstantly().sounds(BlockSoundGroup.GRASS).pistonBehavior(PistonBehavior.DESTROY)));
public static final Block POTTED_LEMONWOOD_SAPLING = ModBlocks.registerBlock("potted_lemonwood_sapling", properties -> new FlowerPotBlock(LEMONWOOD_SAPLING, properties.breakInstantly().nonOpaque().pistonBehavior(PistonBehavior.DESTROY))); public static final Block POTTED_LEMONWOOD_SAPLING = ModBlocks.registerBlock("potted_lemonwood_sapling", properties -> new FlowerPotBlock(LEMONWOOD_SAPLING, properties.breakInstantly().nonOpaque().pistonBehavior(PistonBehavior.DESTROY)));
public static final Block LEMONWOOD_PLANKS = ModBlocks.registerBlock("lemonwood_planks", public static final Block LEMONWOOD_PLANKS = ModBlocks.registerBlock("lemonwood_planks",
properties -> new Block( properties -> new Block(
@@ -0,0 +1,34 @@
package com.acethewildfire.acesbs.block.custom;
import com.mojang.serialization.MapCodec;
import net.minecraft.block.LeavesBlock;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.particle.ParticleUtil;
import net.minecraft.particle.TintedParticleEffect;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.World;
public class ColoredParticleLeavesBlock extends LeavesBlock {
int r;
int g;
int b;
public ColoredParticleLeavesBlock(float leafParticleChance, int r, int g, int b, Settings settings) {
super(leafParticleChance, settings);
this.r = r;
this.g = g;
this.b = b;
}
@Override
public MapCodec<? extends LeavesBlock> getCodec() {
return null;
}
@Override
protected void spawnLeafParticle(World world, BlockPos pos, Random random) {
TintedParticleEffect tintedParticleEffect = TintedParticleEffect.create(ParticleTypes.TINTED_LEAVES, r / 255.0F, g / 255.0F, b / 255.0F);
ParticleUtil.spawnParticle(world, pos, random, tintedParticleEffect);
}
}