Add ad_astra dimensions to the dimension with no atmosphere tags

This commit is contained in:
Sollace 2024-04-26 17:05:14 +01:00
parent 68025e4642
commit 28e5a49315
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 37 additions and 0 deletions

View file

@ -17,6 +17,7 @@ import com.minelittlepony.unicopia.datagen.providers.loot.UEntityLootTableProvid
import com.minelittlepony.unicopia.datagen.providers.recipe.URecipeProvider;
import com.minelittlepony.unicopia.datagen.providers.tag.UBlockTagProvider;
import com.minelittlepony.unicopia.datagen.providers.tag.UDamageTypeProvider;
import com.minelittlepony.unicopia.datagen.providers.tag.UDimensionTypeTagProvider;
import com.minelittlepony.unicopia.datagen.providers.tag.UEntityTypeTagProvider;
import com.minelittlepony.unicopia.datagen.providers.tag.UItemTagProvider;
import com.minelittlepony.unicopia.datagen.providers.tag.UStatusEffectTagProvider;
@ -57,6 +58,7 @@ public class Datagen implements DataGeneratorEntrypoint {
pack.addProvider(UDamageTypeProvider::new);
pack.addProvider(UEntityTypeTagProvider::new);
pack.addProvider(UStatusEffectTagProvider::new);
pack.addProvider(UDimensionTypeTagProvider::new);
pack.addProvider(UModelProvider::new);
pack.addProvider(URecipeProvider::new);

View file

@ -0,0 +1,35 @@
package com.minelittlepony.unicopia.datagen.providers.tag;
import java.util.concurrent.CompletableFuture;
import com.minelittlepony.unicopia.UTags;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.RegistryWrapper.WrapperLookup;
import net.minecraft.util.Identifier;
import net.minecraft.world.dimension.DimensionType;
public class UDimensionTypeTagProvider extends FabricTagProvider<DimensionType> {
public UDimensionTypeTagProvider(FabricDataOutput output, CompletableFuture<WrapperLookup> registriesFuture) {
super(output, RegistryKeys.DIMENSION_TYPE, registriesFuture);
}
@Override
protected void configure(WrapperLookup lookup) {
getOrCreateTagBuilder(UTags.DimensionTypes.HAS_NO_ATMOSPHERE)
.addOptional(new Identifier("ad_astra", "earth_orbit"))
.addOptional(new Identifier("ad_astra", "glacio_orbit"))
.addOptional(new Identifier("ad_astra", "mars_orbit"))
.addOptional(new Identifier("ad_astra", "mercury_orbit"))
.addOptional(new Identifier("ad_astra", "moon")).addOptional(new Identifier("adastra", "moon_orbit"))
.addOptional(new Identifier("ad_astra", "venus_orbit"))
.addOptional(new Identifier("adastra", "earth_orbit"))
.addOptional(new Identifier("adastra", "glacio_orbit"))
.addOptional(new Identifier("adastra", "mars_orbit"))
.addOptional(new Identifier("adastra", "mercury_orbit"))
.addOptional(new Identifier("adastra", "moon")).addOptional(new Identifier("adastra", "moon_orbit"))
.addOptional(new Identifier("adastra", "venus_orbit"));
}
}