use of net.minecraft.particle.ParticleType in project Biome-Makeover by Lemonszz.
the class NetworkUtil method doEntityParticle.
public static void doEntityParticle(World world, ParticleEffect effect, Entity e, int count, float offset) {
if (world.isClient)
return;
PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
buf.writeInt(e.getEntityId());
buf.writeInt(Registry.PARTICLE_TYPE.getRawId((ParticleType<?>) effect));
buf.writeInt(count);
buf.writeFloat(offset);
buf.writeDouble(world.random.nextGaussian() * 0.02D);
buf.writeDouble(world.random.nextGaussian() * 0.02D);
buf.writeDouble(world.random.nextGaussian() * 0.02D);
serverSendTracking(world, e.getBlockPos(), BMNetwork.ENTITY_PARTICLE, buf);
}
use of net.minecraft.particle.ParticleType in project Terracraft by SimplyCmd.
the class BlockRegistry method torch.
private static Torch torch(String prefix, ParticleType<?> particle, JIngredient resource) {
final String torch = prefix + "_torch";
final String wallTorch = prefix + "_wall_torch";
final SimpleBlock block1 = new SimpleBlock(ID(torch), new CustomTorchBlock(FabricBlockSettings.of(Material.DECORATION).noCollision().breakInstantly().luminance((state) -> 10).sounds(BlockSoundGroup.WOOD), ParticleTypes.SOUL_FIRE_FLAME));
final SimpleBlock block2 = new SimpleBlock(ID(wallTorch), new CustomWallTorchBlock(FabricBlockSettings.of(Material.DECORATION).noCollision().breakInstantly().luminance((state) -> 10).sounds(BlockSoundGroup.WOOD), ParticleTypes.SOUL_FIRE_FLAME));
final SimpleItem item1 = new SimpleItem(ID(torch), new WallStandingBlockItem(block1.getBlock(), block2.getBlock(), new FabricItemSettings().group(ItemGroup.DECORATIONS))).blockItemModel(block1.getBlock());
// Delay this until after said items are registered
Resources.RESOURCE_PACK.addRecipe(ID(torch), JRecipe.shaped(JPattern.pattern("X", "#", "S"), JKeys.keys().key("X", JIngredient.ingredient().item(Items.COAL).item(Items.CHARCOAL)).key("#", JIngredient.ingredient().item(Items.STICK)).key("S", resource), JResult.itemStack(item1.getItem(), 4)));
return new Torch(block1, block2, item1);
}
use of net.minecraft.particle.ParticleType in project meteor-client by MeteorDevelopment.
the class ParticleTypeListSetting method parseImpl.
@Override
protected List<ParticleType<?>> parseImpl(String str) {
String[] values = str.split(",");
List<ParticleType<?>> particleTypes = new ArrayList<>(values.length);
try {
for (String value : values) {
ParticleType<?> particleType = parseId(Registry.PARTICLE_TYPE, value);
if (particleType instanceof ParticleEffect)
particleTypes.add(particleType);
}
} catch (Exception ignored) {
}
return particleTypes;
}
use of net.minecraft.particle.ParticleType in project Biome-Makeover by Lemonszz.
the class NetworkUtil method doCenteredEntityParticle.
public static void doCenteredEntityParticle(World world, ParticleEffect effect, Entity e, int count, boolean varyY) {
if (world.isClient)
return;
PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
buf.writeInt(e.getEntityId());
buf.writeInt(Registry.PARTICLE_TYPE.getRawId((ParticleType<?>) effect));
buf.writeInt(count);
buf.writeBoolean(varyY);
buf.writeDouble(world.random.nextGaussian() * 0.02D);
buf.writeDouble(world.random.nextGaussian() * 0.02D);
buf.writeDouble(world.random.nextGaussian() * 0.02D);
serverSendTracking(world, e.getBlockPos(), BMNetwork.ENTITY_PARTICLE_CENTERED, buf);
}
use of net.minecraft.particle.ParticleType in project Client by MatHax.
the class ParticleTypeListSetting method parseImpl.
@Override
protected List<ParticleType<?>> parseImpl(String str) {
String[] values = str.split(",");
List<ParticleType<?>> particleTypes = new ArrayList<>(values.length);
try {
for (String value : values) {
ParticleType<?> particleType = parseId(Registry.PARTICLE_TYPE, value);
if (particleType instanceof ParticleEffect)
particleTypes.add(particleType);
}
} catch (Exception ignored) {
}
return particleTypes;
}
Aggregations