Skip to content

Commit

Permalink
Attempt to fix Sculk mobs attacking each other, changing Sculk mobs t…
Browse files Browse the repository at this point in the history
…o be tag-based (where possible) for mod compatibility.

Sculk Smite now has levels and follows the same damage bonus as Smite and Bane of Arthropods.
  • Loading branch information
nitrodynamite18 committed Mar 27, 2023
1 parent 9c054db commit b84d12f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.kyanite.deeperdarker.mixin.misc;

import com.kyanite.deeperdarker.miscellaneous.DDTypes;
import com.kyanite.deeperdarker.miscellaneous.DDTags;
import com.kyanite.deeperdarker.registry.effects.DDEffects;
import com.kyanite.deeperdarker.registry.items.DDItems;
import net.minecraft.server.level.ServerLevel;
Expand Down Expand Up @@ -28,7 +28,7 @@ public void handle(ServerLevel level, GameEvent.Message message, CallbackInfoRet

if(message.context().sourceEntity() instanceof LivingEntity entity && entity.hasEffect(DDEffects.SCULK_AFFINITY.get())) cir.setReturnValue(false);

if(message.context().sourceEntity() instanceof LivingEntity entity && entity.getMobType() == DDTypes.SCULK) cir.setReturnValue(false);
if(message.context().sourceEntity() instanceof LivingEntity entity && entity.getType().is(DDTags.Entities.SCULK)) cir.setReturnValue(false);

if(receivingEvent != null || message.context().sourceEntity() == null || message.context() == null) cir.setReturnValue(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ public SculkSmiteEnchant(Rarity pRarity, EnchantmentCategory pCategory, Equipmen

@Override
public float getDamageBonus(int i, MobType mobType) {
return mobType == DDTypes.SCULK ? 10F : 0.0F;
return mobType == DDTypes.SCULK ? (float)i * 2.5F : 0.0F;
}

@Override
public int getMaxLevel() {
return 1;
return 5;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,13 @@
public class DDEntities {
public static final Map<String, Supplier<EntityType<?>>> ENTITIES = new HashMap<>();

public static final Supplier<EntityType<ShriekProjectile>> SHRIEK_PROJECTILE = RegistryHelper.registerEntity(
"shriek_projectile",
ShriekProjectile::new, MobCategory.MISC, 0.5F, 0.5F, 4
);
public static final Supplier<EntityType<ShriekProjectile>> SHRIEK_PROJECTILE = RegistryHelper.registerEntity("shriek_projectile", ShriekProjectile::new, MobCategory.MISC, 0.5F, 0.5F, 4);

public static final Supplier<EntityType<ShatteredEntity>> SHATTERED = RegistryHelper.registerEntity("shattered", ShatteredEntity::new, MobCategory.MONSTER, 0.85f, 2.45f, 10);
public static final Supplier<EntityType<SculkLeechEntity>> SCULK_LEECH = RegistryHelper.registerEntity("sculk_leech", SculkLeechEntity::new, MobCategory.MONSTER, 0.3f, 0.2f, 10);
public static final Supplier<EntityType<SculkSnapperEntity>> SCULK_SNAPPER = RegistryHelper.registerEntity("sculk_snapper", SculkSnapperEntity::new, MobCategory.MONSTER, 1, 1, 10);

public static final Supplier<EntityType<EchoerEntity>> ECHOER = RegistryHelper.registerEntity(
"echoer",
EchoerEntity::new, MobCategory.MONSTER, 0.85f, 2.45f, 10
);
public static final Supplier<EntityType<EchoerEntity>> ECHOER = RegistryHelper.registerEntity("echoer", EchoerEntity::new, MobCategory.MONSTER, 0.85f, 2.45f, 10);

// public static final Supplier<EntityType<ScavengerEntity>> SCAVENGER = RegistryHelper.registerEntity(
// "scavenger",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"values": [
"deeperdarker:shattered",
"deeperdarker:sculk_leech",
"deeperdarker:sculk_snapper",
"deeperdarker:shriek_worm",
"deeperdarker:sculk_centipede",
"deeperdarker:stalker",
"deeperdarker:echoer"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public DDEntityTypeTagsProvider(DataGenerator pGenerator, ExistingFileHelper exi

@Override
protected void addTags() {
// tag(EntityTypeTags) For Minecraft tags.

tag(DDTags.Entities.SCULK).add(DDEntities.SHATTERED.get(), DDEntities.SCULK_LEECH.get(), DDEntities.SCULK_SNAPPER.get(), DDEntities.SCULK_WORM.get(), DDEntities.SCULK_CENTIPEDE.get(), DDEntities.STALKER.get(), DDEntities.ECHOER.get());

tag(Tags.EntityTypes.BOSSES).add(DDEntities.STALKER.get());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"alexsmobs:skreecher"
]
}

0 comments on commit b84d12f

Please sign in to comment.