Added Particles To Bogey Style (And Respective Builder)

This commit is contained in:
Rabbitminers 2023-04-30 21:12:14 +01:00
parent 08c000b8ba
commit da30e78815
2 changed files with 14 additions and 3 deletions

View file

@ -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> 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<? extends CommonRenderer> 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;
}

View file

@ -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<BogeySizes.BogeySize, SizeData> 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<BogeySizes.BogeySize, SizeData> sizes, Optional<CommonRenderer> commonRenderer) {
public BogeyStyle(ResourceLocation name, Component displayName, ResourceLocation soundType, ParticleType<?> particleType,
CompoundTag defaultData, Map<BogeySizes.BogeySize, SizeData> sizes, Optional<CommonRenderer> commonRenderer) {
this.name = name;
this.displayName = displayName;
this.soundType = soundType;
this.particleType = particleType;
this.defaultData = defaultData;
this.sizes = sizes;