Skip to content

Commit

Permalink
Feature/camp based mobs (#10533)
Browse files Browse the repository at this point in the history
Add Camp Raiders that can be spawned with spawn eggs and added to spawners
Did some refactoring to reduce code duplication. They are their own entities.
  • Loading branch information
Raycoms committed Dec 23, 2024
1 parent d412c36 commit ede79e7
Show file tree
Hide file tree
Showing 146 changed files with 2,434 additions and 776 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.campamazon",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.campamazonchief",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.campamazonspearman",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.camparcherbarbarian",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.camparchermummy",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.camparcherpirate",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.campbarbarian",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.campchiefpirate",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.campmummy",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.campnorsemenarcher",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.campnorsemenchief",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.camppharao",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.camppirate",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.campshieldmaiden",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exhaustion": 0.1,
"message_id": "entity.minecolonies.campchiefbarbarian",
"scaling": "always"
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package com.minecolonies.api.client.render.modeltype;

import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazon;
import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster;
import net.minecraft.client.model.HumanoidModel;
import net.minecraft.client.model.geom.ModelPart;
import org.jetbrains.annotations.NotNull;

/**
* Amazon model.
*/
public class AmazonModel<T extends AbstractEntityAmazon> extends HumanoidModel<AbstractEntityAmazon>
public class AmazonModel<T extends AbstractEntityMinecoloniesMonster> extends HumanoidModel<AbstractEntityMinecoloniesMonster>
{
public AmazonModel(final ModelPart part)
{
super(part);
}

@Override
public void setupAnim(@NotNull final AbstractEntityAmazon entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch)
public void setupAnim(@NotNull final AbstractEntityMinecoloniesMonster entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch)
{
super.setupAnim(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch);
head.y -= 3;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.minecolonies.api.client.render.modeltype;

import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptian;
import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster;
import net.minecraft.client.model.HumanoidModel;
import net.minecraft.client.model.geom.ModelPart;

/**
* Egyptian model.
*/
public class EgyptianModel<T extends AbstractEntityEgyptian> extends HumanoidModel<AbstractEntityEgyptian>
public class EgyptianModel<T extends AbstractEntityMinecoloniesMonster> extends HumanoidModel<AbstractEntityMinecoloniesMonster>
{
/**
* Create a model of a specific size.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.minecolonies.api.client.render.modeltype;

import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemen;
import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster;
import net.minecraft.client.model.HumanoidModel;
import net.minecraft.client.model.geom.ModelPart;

/**
* Norsemen model.
*/
public class NorsemenModel extends HumanoidModel<AbstractEntityNorsemen>
public class NorsemenModel extends HumanoidModel<AbstractEntityMinecoloniesMonster>
{
/**
* Create a model of a specific size.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.minecolonies.api.colony.managers.interfaces;

import com.minecolonies.api.colony.ICitizenData;
import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob;
import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;

Expand Down Expand Up @@ -215,7 +215,7 @@ default RaidSpawnResult raiderEvent(String raidType, final boolean overrideConfi
*
* @param entity
*/
void onRaiderDeath(AbstractEntityRaiderMob entity);
void onRaiderDeath(AbstractEntityMinecoloniesRaider entity);

/**
* Notify raid manager of a passing through raid.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.minecolonies.api.blocks.AbstractBlockHut;
import com.minecolonies.api.blocks.ModBlocks;
import com.minecolonies.api.entity.ModEntities;
import com.minecolonies.api.items.ModItems;
import com.minecolonies.api.util.constant.Constants;
import net.minecraft.core.Registry;
Expand All @@ -11,6 +12,7 @@
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.SpawnEggItem;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;
import net.minecraft.world.level.block.Block;
Expand Down Expand Up @@ -112,6 +114,31 @@ public final class ModCreativeTabs
output.accept(ModItems.sugaryBread);
output.accept(ModItems.goldenBread);
output.accept(ModItems.chorusBread);

output.accept(SpawnEggItem.byId(ModEntities.CAMP_BARBARIAN));
output.accept(SpawnEggItem.byId(ModEntities.CAMP_ARCHERBARBARIAN));
output.accept(SpawnEggItem.byId(ModEntities.CAMP_CHIEFBARBARIAN));

output.accept(SpawnEggItem.byId(ModEntities.CAMP_PIRATE));
output.accept(SpawnEggItem.byId(ModEntities.CAMP_ARCHERPIRATE));
output.accept(SpawnEggItem.byId(ModEntities.CAMP_CHIEFPIRATE));

output.accept(SpawnEggItem.byId(ModEntities.CAMP_MUMMY));
output.accept(SpawnEggItem.byId(ModEntities.CAMP_ARCHERMUMMY));
output.accept(SpawnEggItem.byId(ModEntities.CAMP_PHARAO));

output.accept(SpawnEggItem.byId(ModEntities.CAMP_SHIELDMAIDEN));
output.accept(SpawnEggItem.byId(ModEntities.CAMP_NORSEMEN_ARCHER));
output.accept(SpawnEggItem.byId(ModEntities.CAMP_NORSEMEN_CHIEF));

output.accept(SpawnEggItem.byId(ModEntities.CAMP_AMAZON));
output.accept(SpawnEggItem.byId(ModEntities.CAMP_AMAZONSPEARMAN));
output.accept(SpawnEggItem.byId(ModEntities.CAMP_AMAZONCHIEF));

output.accept(SpawnEggItem.byId(ModEntities.CAMP_DROWNED_PIRATE));
output.accept(SpawnEggItem.byId(ModEntities.CAMP_DROWNED_ARCHERPIRATE));
output.accept(SpawnEggItem.byId(ModEntities.CAMP_DROWNED_CHIEFPIRATE));

}).build());

public static final DeferredHolder<CreativeModeTab, CreativeModeTab> FOOD = TAB_REG.register("mcfood", () -> new CreativeModeTab.Builder(CreativeModeTab.Row.TOP, 1)
Expand Down
84 changes: 64 additions & 20 deletions src/main/java/com/minecolonies/api/entity/ModEntities.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
package com.minecolonies.api.entity;

import com.minecolonies.api.entity.citizen.AbstractEntityCitizen;
import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob;
import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider;
import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazon;
import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazonRaider;
import com.minecolonies.api.entity.mobs.barbarians.AbstractEntityBarbarian;
import com.minecolonies.api.entity.mobs.barbarians.AbstractEntityBarbarianRaider;
import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirate;
import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirateRaider;
import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptian;
import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptianRaider;
import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirate;
import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirateRaider;
import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemen;
import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemenRaider;
import com.minecolonies.api.entity.other.MinecoloniesMinecart;
import com.minecolonies.core.entity.other.NewBobberEntity;
import net.minecraft.world.entity.Entity;
Expand All @@ -27,37 +33,37 @@ public class ModEntities

public static EntityType<? extends PathfinderMob> MERCENARY;

public static EntityType<? extends AbstractEntityBarbarian> BARBARIAN;
public static EntityType<? extends AbstractEntityBarbarianRaider> BARBARIAN;

public static EntityType<? extends AbstractEntityBarbarian> ARCHERBARBARIAN;
public static EntityType<? extends AbstractEntityBarbarianRaider> ARCHERBARBARIAN;

public static EntityType<? extends AbstractEntityBarbarian> CHIEFBARBARIAN;
public static EntityType<? extends AbstractEntityBarbarianRaider> CHIEFBARBARIAN;

public static EntityType<? extends AbstractEntityPirate> PIRATE;
public static EntityType<? extends AbstractEntityPirateRaider> PIRATE;

public static EntityType<? extends AbstractEntityPirate> CHIEFPIRATE;
public static EntityType<? extends AbstractEntityPirateRaider> CHIEFPIRATE;

public static EntityType<? extends AbstractEntityPirate> ARCHERPIRATE;
public static EntityType<? extends AbstractEntityPirateRaider> ARCHERPIRATE;

public static EntityType<? extends Entity> SITTINGENTITY;

public static EntityType<? extends AbstractEntityEgyptian> MUMMY;
public static EntityType<? extends AbstractEntityEgyptianRaider> MUMMY;

public static EntityType<? extends AbstractEntityEgyptian> PHARAO;
public static EntityType<? extends AbstractEntityEgyptianRaider> PHARAO;

public static EntityType<? extends AbstractEntityEgyptian> ARCHERMUMMY;
public static EntityType<? extends AbstractEntityEgyptianRaider> ARCHERMUMMY;

public static EntityType<? extends AbstractEntityNorsemen> NORSEMEN_ARCHER;
public static EntityType<? extends AbstractEntityNorsemenRaider> NORSEMEN_ARCHER;

public static EntityType<? extends AbstractEntityNorsemen> SHIELDMAIDEN;
public static EntityType<? extends AbstractEntityNorsemenRaider> SHIELDMAIDEN;

public static EntityType<? extends AbstractEntityNorsemen> NORSEMEN_CHIEF;
public static EntityType<? extends AbstractEntityNorsemenRaider> NORSEMEN_CHIEF;

public static EntityType<? extends AbstractEntityAmazon> AMAZON;
public static EntityType<? extends AbstractEntityAmazonRaider> AMAZON;

public static EntityType<? extends AbstractEntityAmazon> AMAZONSPEARMAN;
public static EntityType<? extends AbstractEntityAmazonRaider> AMAZONSPEARMAN;

public static EntityType<? extends AbstractEntityAmazon> AMAZONCHIEF;
public static EntityType<? extends AbstractEntityAmazonRaider> AMAZONCHIEF;

public static EntityType<MinecoloniesMinecart> MINECART;

Expand All @@ -69,13 +75,51 @@ public class ModEntities

public static EntityType<? extends ThrownTrident> SPEAR;

public static EntityType<? extends AbstractDrownedEntityPirate> DROWNED_PIRATE;
public static EntityType<? extends AbstractDrownedEntityPirateRaider> DROWNED_PIRATE;

public static EntityType<? extends AbstractDrownedEntityPirate> DROWNED_CHIEFPIRATE;
public static EntityType<? extends AbstractDrownedEntityPirateRaider> DROWNED_CHIEFPIRATE;

public static EntityType<? extends AbstractDrownedEntityPirate> DROWNED_ARCHERPIRATE;
public static EntityType<? extends AbstractDrownedEntityPirateRaider> DROWNED_ARCHERPIRATE;

public static List<EntityType<? extends AbstractEntityRaiderMob>> getRaiders()
// Camp Raiders

public static EntityType<? extends AbstractEntityBarbarian> CAMP_BARBARIAN;

public static EntityType<? extends AbstractEntityBarbarian> CAMP_ARCHERBARBARIAN;

public static EntityType<? extends AbstractEntityBarbarian> CAMP_CHIEFBARBARIAN;

public static EntityType<? extends AbstractEntityPirate> CAMP_PIRATE;

public static EntityType<? extends AbstractEntityPirate> CAMP_CHIEFPIRATE;

public static EntityType<? extends AbstractEntityPirate> CAMP_ARCHERPIRATE;

public static EntityType<? extends AbstractEntityAmazon> CAMP_AMAZON;

public static EntityType<? extends AbstractEntityAmazon> CAMP_AMAZONSPEARMAN;

public static EntityType<? extends AbstractEntityAmazon> CAMP_AMAZONCHIEF;

public static EntityType<? extends AbstractEntityEgyptian> CAMP_MUMMY;

public static EntityType<? extends AbstractEntityEgyptian> CAMP_PHARAO;

public static EntityType<? extends AbstractEntityEgyptian> CAMP_ARCHERMUMMY;

public static EntityType<? extends AbstractEntityNorsemen> CAMP_NORSEMEN_ARCHER;

public static EntityType<? extends AbstractEntityNorsemen> CAMP_SHIELDMAIDEN;

public static EntityType<? extends AbstractEntityNorsemen> CAMP_NORSEMEN_CHIEF;

public static EntityType<? extends AbstractDrownedEntityPirate> CAMP_DROWNED_PIRATE;

public static EntityType<? extends AbstractDrownedEntityPirate> CAMP_DROWNED_CHIEFPIRATE;

public static EntityType<? extends AbstractDrownedEntityPirate> CAMP_DROWNED_ARCHERPIRATE;

public static List<EntityType<? extends AbstractEntityMinecoloniesRaider>> getRaiders()
{
return List.of(
BARBARIAN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public int getThreatFor(final LivingEntity attacker)
}
}

return 0;
return -1;
}

/**
Expand Down
Loading

0 comments on commit ede79e7

Please sign in to comment.