Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/camp based mobs #10533

Merged
merged 11 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Expand Up @@ -2,7 +2,7 @@

import com.minecolonies.api.colony.ICitizenData;
import com.minecolonies.api.colony.colonyEvents.IColonyRaidEvent;
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 @@ -216,7 +216,7 @@ default RaidSpawnResult raiderEvent(String raidType, final boolean overrideConfi
*
* @param entity
*/
void onRaiderDeath(AbstractEntityRaiderMob entity);
void onRaiderDeath(AbstractEntityMinecoloniesRaider entity);

void onRaidEventFinished(IColonyRaidEvent event);

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 @@ -12,6 +13,7 @@
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.common.ForgeSpawnEggItem;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;
Expand Down Expand Up @@ -114,6 +116,31 @@ public final class ModCreativeTabs
output.accept(ModItems.sugaryBread);
output.accept(ModItems.goldenBread);
output.accept(ModItems.chorusBread);

output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_BARBARIAN));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi, looks like these broke datagen, at least in 1.21

output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_ARCHERBARBARIAN));
output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_CHIEFBARBARIAN));

output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_PIRATE));
output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_ARCHERPIRATE));
output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_CHIEFPIRATE));

output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_MUMMY));
output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_ARCHERMUMMY));
output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_PHARAO));

output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_SHIELDMAIDEN));
output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_NORSEMEN_ARCHER));
output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_NORSEMEN_CHIEF));

output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_AMAZON));
output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_AMAZONSPEARMAN));
output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_AMAZONCHIEF));

output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_DROWNED_PIRATE));
output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_DROWNED_ARCHERPIRATE));
output.accept(ForgeSpawnEggItem.fromEntityType(ModEntities.CAMP_DROWNED_CHIEFPIRATE));

}).build());

public static final RegistryObject<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 net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
Expand All @@ -26,37 +32,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 @@ -68,13 +74,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
Loading