From da30e78815afd7906ea82a9fba293f202c036fa8 Mon Sep 17 00:00:00 2001 From: Rabbitminers Date: Sun, 30 Apr 2023 21:12:14 +0100 Subject: [PATCH] Added Particles To Bogey Style (And Respective Builder) --- src/main/java/com/simibubi/create/AllBogeyStyles.java | 10 +++++++++- .../content/logistics/trains/entity/BogeyStyle.java | 7 +++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/simibubi/create/AllBogeyStyles.java b/src/main/java/com/simibubi/create/AllBogeyStyles.java index b4f97cb1d..414bf1dcd 100644 --- a/src/main/java/com/simibubi/create/AllBogeyStyles.java +++ b/src/main/java/com/simibubi/create/AllBogeyStyles.java @@ -11,6 +11,8 @@ import com.simibubi.create.foundation.utility.Lang; import com.tterrag.registrate.util.entry.BlockEntry; +import net.minecraft.core.particles.ParticleType; +import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TranslatableComponent; @@ -52,6 +54,7 @@ public class AllBogeyStyles { protected Component displayName = Lang.translateDirect("create.bogeys.invalid"); protected ResourceLocation soundType = AllSoundEvents.TRAIN2.getId(); protected CompoundTag defaultData = new CompoundTag(); + protected ParticleType particleType = ParticleTypes.CRIT; protected Optional commonRenderer = Optional.empty(); public BogeyStyleBuilder(ResourceLocation name) { @@ -85,6 +88,11 @@ public class AllBogeyStyles { return this; } + public BogeyStyleBuilder particle(ParticleType particleType) { + this.particleType = particleType; + return this; + } + public BogeyStyleBuilder commonRenderer(Supplier commonRenderer) { this.commonRenderer = Optional.of(commonRenderer.get()); return this; @@ -92,7 +100,7 @@ public class AllBogeyStyles { public BogeyStyle build() { BogeyStyle entry = - new BogeyStyle(name, displayName, soundType, defaultData, sizes, commonRenderer); + new BogeyStyle(name, displayName, soundType, particleType, defaultData, sizes, commonRenderer); BOGEY_STYLES.put(name, entry); return entry; } diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/entity/BogeyStyle.java b/src/main/java/com/simibubi/create/content/logistics/trains/entity/BogeyStyle.java index 75d272f82..b1d0dc4cd 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/entity/BogeyStyle.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/entity/BogeyStyle.java @@ -7,6 +7,7 @@ import com.simibubi.create.content.logistics.trains.BogeyRenderer; import com.simibubi.create.content.logistics.trains.BogeyRenderer.CommonRenderer; import com.simibubi.create.content.logistics.trains.BogeySizes; +import net.minecraft.core.particles.ParticleType; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; @@ -28,13 +29,15 @@ public class BogeyStyle { private final Map sizes; public final Component displayName; public final ResourceLocation soundType; + public final ParticleType particleType; public final CompoundTag defaultData; - public BogeyStyle(ResourceLocation name, Component displayName, ResourceLocation soundType, CompoundTag defaultData, - Map sizes, Optional commonRenderer) { + public BogeyStyle(ResourceLocation name, Component displayName, ResourceLocation soundType, ParticleType particleType, + CompoundTag defaultData, Map sizes, Optional commonRenderer) { this.name = name; this.displayName = displayName; this.soundType = soundType; + this.particleType = particleType; this.defaultData = defaultData; this.sizes = sizes;