Skip to content

Commit

Permalink
no longer use MONSTER as spawn category for hunters and vampires
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheaterpaul committed Oct 19, 2024
1 parent cbd35ad commit 64d54bb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"biomes": "#vampirism:has_spawn/advanced_vampire",
"excludedBiomes": "#vampirism:no_spawn/advanced_vampire",
"spawners": {
"category": "monster",
"category": "vampirism:vampire",
"super": {
"type": "vampirism:advanced_vampire",
"maxCount": 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"biomes": "#vampirism:has_spawn/vampire",
"excludedBiomes": "#vampirism:no_spawn/vampire",
"spawners": {
"category": "monster",
"category": "vampirism:vampire",
"super": {
"type": "vampirism:vampire",
"maxCount": 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.entity.ai.goal.FloatGoal;
import net.minecraft.world.entity.npc.Npc;
Expand Down Expand Up @@ -47,15 +46,6 @@ public HunterBaseEntity(EntityType<? extends HunterBaseEntity> type, Level world
this.countAsMonster = countAsMonster;
}

@Override
public MobCategory getClassification(boolean forSpawnCount) {
if (forSpawnCount && countAsMonster) {
return MobCategory.MONSTER;
}
return super.getClassification(forSpawnCount);
}


@Override
public void die(@NotNull DamageSource cause) {
super.die(cause);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,6 @@ public boolean doHurtTarget(@NotNull Entity entity) {
return super.doHurtTarget(entity);
}

@Override
public MobCategory getClassification(boolean forSpawnCount) {
if (forSpawnCount && countAsMonsterForSpawn) {
return MobCategory.MONSTER;
}
return super.getClassification(forSpawnCount);
}

@Override
public void drinkBlood(int amt, float saturationMod, boolean useRemaining, IDrinkBloodContext drinkContext) {
BloodDrinkEvent.@NotNull EntityDrinkBloodEvent event = VampirismEventFactory.fireVampireDrinkBlood(this, amt, saturationMod, useRemaining, drinkContext);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.teamlapen.vampirism.world.gen;

import com.google.common.collect.ImmutableList;
import de.teamlapen.vampirism.REFERENCE;
import de.teamlapen.vampirism.api.VEnums;
import de.teamlapen.vampirism.api.util.VResourceLocation;
import de.teamlapen.vampirism.core.ModBlocks;
import de.teamlapen.vampirism.core.ModEntities;
Expand All @@ -19,10 +19,8 @@
import net.minecraft.data.worldgen.placement.PlacementUtils;
import net.minecraft.data.worldgen.placement.VegetationPlacements;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.levelgen.GenerationStep;
Expand Down Expand Up @@ -116,8 +114,8 @@ public static void createPlacedFeatures(BootstrapContext<PlacedFeature> context)
public static void createBiomeModifier(BootstrapContext<BiomeModifier> context) {
HolderGetter<Biome> biomeLookup = context.lookup(Registries.BIOME);
HolderGetter<PlacedFeature> placedFeatureLookup = context.lookup(Registries.PLACED_FEATURE);
context.register(VAMPIRE_SPAWN, ExtendedAddSpawnsBiomeModifier.singleSpawn(biomeLookup.getOrThrow(ModBiomeTags.HasSpawn.VAMPIRE), biomeLookup.getOrThrow(ModBiomeTags.NoSpawn.VAMPIRE), new ExtendedAddSpawnsBiomeModifier.ExtendedSpawnData(ModEntities.VAMPIRE.get(), 80, 1, 3, MobCategory.MONSTER)));
context.register(ADVANCED_VAMPIRE_SPAWN, ExtendedAddSpawnsBiomeModifier.singleSpawn(biomeLookup.getOrThrow(ModBiomeTags.HasSpawn.ADVANCED_VAMPIRE), biomeLookup.getOrThrow(ModBiomeTags.NoSpawn.ADVANCED_VAMPIRE), new ExtendedAddSpawnsBiomeModifier.ExtendedSpawnData(ModEntities.ADVANCED_VAMPIRE.get(), 30, 1, 3, MobCategory.MONSTER)));
context.register(VAMPIRE_SPAWN, ExtendedAddSpawnsBiomeModifier.singleSpawn(biomeLookup.getOrThrow(ModBiomeTags.HasSpawn.VAMPIRE), biomeLookup.getOrThrow(ModBiomeTags.NoSpawn.VAMPIRE), new ExtendedAddSpawnsBiomeModifier.ExtendedSpawnData(ModEntities.VAMPIRE.get(), 80, 1, 3, VEnums.VAMPIRE_CATEGORY.getValue())));
context.register(ADVANCED_VAMPIRE_SPAWN, ExtendedAddSpawnsBiomeModifier.singleSpawn(biomeLookup.getOrThrow(ModBiomeTags.HasSpawn.ADVANCED_VAMPIRE), biomeLookup.getOrThrow(ModBiomeTags.NoSpawn.ADVANCED_VAMPIRE), new ExtendedAddSpawnsBiomeModifier.ExtendedSpawnData(ModEntities.ADVANCED_VAMPIRE.get(), 30, 1, 3, VEnums.VAMPIRE_CATEGORY.getValue())));
context.register(VAMPIRE_DUNGEON_MODIFIER, new BiomeModifiers.AddFeaturesBiomeModifier(biomeLookup.getOrThrow(ModBiomeTags.HasStructure.VAMPIRE_DUNGEON), HolderSet.direct(placedFeatureLookup.getOrThrow(VampirismFeatures.VAMPIRE_DUNGEON_PLACED)), GenerationStep.Decoration.UNDERGROUND_STRUCTURES));
}
}

0 comments on commit 64d54bb

Please sign in to comment.