mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Datagen vanilla damagetype tags and painting variant tags
This commit is contained in:
parent
28e5a49315
commit
dd4c3f4d75
12 changed files with 58 additions and 100 deletions
|
@ -20,6 +20,7 @@ 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.UPaintingVariantTagProvider;
|
||||
import com.minelittlepony.unicopia.datagen.providers.tag.UStatusEffectTagProvider;
|
||||
import com.minelittlepony.unicopia.entity.damage.UDamageTypes;
|
||||
import com.minelittlepony.unicopia.server.world.UWorldGen;
|
||||
|
@ -59,6 +60,7 @@ public class Datagen implements DataGeneratorEntrypoint {
|
|||
pack.addProvider(UEntityTypeTagProvider::new);
|
||||
pack.addProvider(UStatusEffectTagProvider::new);
|
||||
pack.addProvider(UDimensionTypeTagProvider::new);
|
||||
pack.addProvider(UPaintingVariantTagProvider::new);
|
||||
|
||||
pack.addProvider(UModelProvider::new);
|
||||
pack.addProvider(URecipeProvider::new);
|
||||
|
|
|
@ -26,5 +26,29 @@ public class UDamageTypeProvider extends FabricTagProvider<DamageType> {
|
|||
getOrCreateTagBuilder(UTags.DamageTypes.FROM_ROCKS).add(UDamageTypes.ROCK);
|
||||
getOrCreateTagBuilder(UTags.DamageTypes.FROM_HORSESHOES).add(UDamageTypes.HORSESHOE);
|
||||
getOrCreateTagBuilder(UTags.DamageTypes.BREAKS_SUNGLASSES).add(UDamageTypes.BAT_SCREECH, UDamageTypes.RAINBOOM);
|
||||
|
||||
getOrCreateTagBuilder(DamageTypeTags.AVOIDS_GUARDIAN_THORNS).add(
|
||||
UDamageTypes.EXHAUSTION, UDamageTypes.ALICORN_AMULET, UDamageTypes.ZAP_APPLE, UDamageTypes.KICK, UDamageTypes.SMASH,
|
||||
UDamageTypes.BAT_SCREECH, UDamageTypes.LOVE_DRAINING, UDamageTypes.LIFE_DRAINING, UDamageTypes.RAINBOOM, UDamageTypes.STEAMROLLER
|
||||
);
|
||||
getOrCreateTagBuilder(DamageTypeTags.BYPASSES_ARMOR).add(
|
||||
UDamageTypes.EXHAUSTION, UDamageTypes.GAVITY_WELL_RECOIL, UDamageTypes.ALICORN_AMULET,
|
||||
UDamageTypes.ZAP_APPLE, UDamageTypes.KICK, UDamageTypes.SMASH, UDamageTypes.BAT_SCREECH,
|
||||
UDamageTypes.LOVE_DRAINING, UDamageTypes.LIFE_DRAINING, UDamageTypes.STEAMROLLER, UDamageTypes.RAINBOOM,
|
||||
UDamageTypes.SUN, UDamageTypes.SUNLIGHT, UDamageTypes.PETRIFIED
|
||||
);
|
||||
getOrCreateTagBuilder(DamageTypeTags.BYPASSES_INVULNERABILITY).add(UDamageTypes.TRIBE_SWAP);
|
||||
getOrCreateTagBuilder(DamageTypeTags.BYPASSES_SHIELD).add(
|
||||
UDamageTypes.EXHAUSTION, UDamageTypes.BAT_SCREECH, UDamageTypes.ALICORN_AMULET,
|
||||
UDamageTypes.LOVE_DRAINING, UDamageTypes.LIFE_DRAINING,
|
||||
UDamageTypes.RAINBOOM, UDamageTypes.TRIBE_SWAP
|
||||
);
|
||||
getOrCreateTagBuilder(DamageTypeTags.IS_FIRE).add(UDamageTypes.SUN, UDamageTypes.SUNLIGHT, UDamageTypes.PETRIFIED);
|
||||
getOrCreateTagBuilder(DamageTypeTags.IS_LIGHTNING).add(UDamageTypes.ZAP_APPLE);
|
||||
getOrCreateTagBuilder(DamageTypeTags.WITCH_RESISTANT_TO).add(
|
||||
UDamageTypes.EXHAUSTION, UDamageTypes.ALICORN_AMULET, UDamageTypes.ZAP_APPLE,
|
||||
UDamageTypes.LOVE_DRAINING, UDamageTypes.LIFE_DRAINING,
|
||||
UDamageTypes.KICK, UDamageTypes.SMASH, UDamageTypes.STEAMROLLER
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package com.minelittlepony.unicopia.datagen.providers.tag;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import com.minelittlepony.unicopia.entity.mob.UEntities;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||
import net.minecraft.entity.decoration.painting.PaintingVariant;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.RegistryWrapper.WrapperLookup;
|
||||
import net.minecraft.registry.tag.PaintingVariantTags;
|
||||
|
||||
public class UPaintingVariantTagProvider extends FabricTagProvider<PaintingVariant> {
|
||||
public UPaintingVariantTagProvider(FabricDataOutput output, CompletableFuture<WrapperLookup> registriesFuture) {
|
||||
super(output, RegistryKeys.PAINTING_VARIANT, registriesFuture);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(WrapperLookup lookup) {
|
||||
getOrCreateTagBuilder(PaintingVariantTags.PLACEABLE).add(UEntities.Paintings.REGISTRY.toArray(PaintingVariant[]::new));
|
||||
}
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package com.minelittlepony.unicopia.entity.mob;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import com.minelittlepony.unicopia.Unicopia;
|
||||
|
@ -134,8 +136,14 @@ public interface UEntities {
|
|||
}
|
||||
|
||||
interface Paintings {
|
||||
Set<PaintingVariant> REGISTRY = new HashSet<>();
|
||||
|
||||
private static void register(String id, int width, int height) {
|
||||
Registry.register(Registries.PAINTING_VARIANT, RegistryKey.of(RegistryKeys.PAINTING_VARIANT, Unicopia.id(id)), new PaintingVariant(16 * width, 16 * height));
|
||||
REGISTRY.add(Registry.register(
|
||||
Registries.PAINTING_VARIANT,
|
||||
RegistryKey.of(RegistryKeys.PAINTING_VARIANT, Unicopia.id(id)),
|
||||
new PaintingVariant(16 * width, 16 * height)
|
||||
));
|
||||
}
|
||||
|
||||
static void bootstrap() {
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"unicopia:magical_exhaustion",
|
||||
"unicopia:alicorn_amulet",
|
||||
"unicopia:zap",
|
||||
"unicopia:kick",
|
||||
"unicopia:smash",
|
||||
"unicopia:bat_screech",
|
||||
"unicopia:love_draining",
|
||||
"unicopia:life_draining",
|
||||
"unicopia:rainboom",
|
||||
"unicopia:steamroller"
|
||||
]
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"unicopia:magical_exhaustion",
|
||||
"unicopia:gravity_well_recoil",
|
||||
"unicopia:alicorn_amulet",
|
||||
"unicopia:zap",
|
||||
"unicopia:kick",
|
||||
"unicopia:smash",
|
||||
"unicopia:bat_screech",
|
||||
"unicopia:love_draining",
|
||||
"unicopia:life_draining",
|
||||
"unicopia:steamroller",
|
||||
"unicopia:rainboom",
|
||||
"unicopia:sun",
|
||||
"unicopia:sunlight",
|
||||
"unicopia:petrified"
|
||||
]
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"unicopia:tribe_swap"
|
||||
]
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"unicopia:magical_exhaustion",
|
||||
"unicopia:bat_screech",
|
||||
"unicopia:alicorn_amulet",
|
||||
"unicopia:love_draining",
|
||||
"unicopia:life_draining",
|
||||
"unicopia:rainboom",
|
||||
"unicopia:tribe_swap"
|
||||
]
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"unicopia:sun",
|
||||
"unicopia:sunlight",
|
||||
"unicopia:petrified"
|
||||
]
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"unicopia:zap"
|
||||
]
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"unicopia:magical_exhaustion",
|
||||
"unicopia:alicorn_amulet",
|
||||
"unicopia:zap",
|
||||
"unicopia:love_draining",
|
||||
"unicopia:life_draining",
|
||||
"unicopia:kick",
|
||||
"unicopia:smash",
|
||||
"unicopia:steamroller"
|
||||
]
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"unicopia:bloom",
|
||||
"unicopia:chicken",
|
||||
"unicopia:bells",
|
||||
"unicopia:crystal",
|
||||
"unicopia:harmony",
|
||||
"unicopia:equality",
|
||||
"unicopia:solar",
|
||||
"unicopia:lunar",
|
||||
"unicopia:platinum",
|
||||
"unicopia:hurricane",
|
||||
"unicopia:pudding",
|
||||
"unicopia:terra",
|
||||
"unicopia:equestria",
|
||||
"unicopia:blossom",
|
||||
"unicopia:shadow"
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue