From dd62ae57030a635ac674e767b194ee02b741aefb Mon Sep 17 00:00:00 2001 From: Raycoms Date: Tue, 17 Dec 2024 20:22:48 +0100 Subject: [PATCH] Feature/camp based mobs (#10533) 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. --- .../minecolonies/damage_type/campamazon.json | 5 + .../damage_type/campamazonchief.json | 5 + .../damage_type/campamazonspearman.json | 5 + .../damage_type/camparcherbarbarian.json | 5 + .../damage_type/camparchermummy.json | 5 + .../damage_type/camparcherpirate.json | 5 + .../damage_type/campbarbarian.json | 5 + .../damage_type/campchiefpirate.json | 5 + .../minecolonies/damage_type/campmummy.json | 5 + .../damage_type/campnorsemenarcher.json | 5 + .../damage_type/campnorsemenchief.json | 5 + .../minecolonies/damage_type/camppharao.json | 5 + .../minecolonies/damage_type/camppirate.json | 5 + .../damage_type/campshieldmaiden.json | 5 + .../damage_type/ccamphiefbarbarian.json | 5 + .../client/render/modeltype/AmazonModel.java | 6 +- .../render/modeltype/EgyptianModel.java | 4 +- .../render/modeltype/NorsemenModel.java | 4 +- .../managers/interfaces/IRaiderManager.java | 4 +- .../api/creativetab/ModCreativeTabs.java | 27 ++ .../minecolonies/api/entity/ModEntities.java | 84 +++- .../entity/ai/combat/threat/ThreatTable.java | 2 +- .../AbstractEntityMinecoloniesMonster.java | 413 ++++++++++++++++++ ... => AbstractEntityMinecoloniesRaider.java} | 279 +----------- .../api/entity/mobs/RaiderMobUtils.java | 10 +- .../mobs/amazons/AbstractEntityAmazon.java | 8 +- .../amazons/AbstractEntityAmazonRaider.java | 63 +++ .../barbarians/AbstractEntityBarbarian.java | 4 +- .../AbstractEntityBarbarianRaider.java | 55 +++ .../AbstractDrownedEntityPirate.java | 25 +- .../AbstractDrownedEntityPirateRaider.java | 118 +++++ .../egyptians/AbstractEntityEgyptian.java | 5 +- .../AbstractEntityEgyptianRaider.java | 63 +++ .../mobs/pirates/AbstractEntityPirate.java | 24 +- .../pirates/AbstractEntityPirateRaider.java | 97 ++++ .../entity/mobs/registry/IMobAIRegistry.java | 24 +- .../mobs/vikings/AbstractEntityNorsemen.java | 24 +- .../vikings/AbstractEntityNorsemenRaider.java | 85 ++++ .../api/sounds/ModSoundEvents.java | 20 +- .../api/util/DamageSourceKeys.java | 16 + .../apiimp/initializer/EntityInitializer.java | 200 +++++++-- .../initializer/ModItemsInitializer.java | 140 +++--- .../com/minecolonies/core/MineColonies.java | 57 ++- .../client/model/raiders/ModelAmazon.java | 4 +- .../model/raiders/ModelAmazonChief.java | 4 +- .../model/raiders/ModelAmazonSpearman.java | 4 +- .../model/raiders/ModelArcherMummy.java | 7 +- .../core/client/model/raiders/ModelMummy.java | 6 +- .../client/model/raiders/ModelPharaoh.java | 26 +- .../mobs/amazon/AbstractRendererAmazon.java | 4 +- .../render/mobs/amazon/RendererAmazon.java | 6 +- .../mobs/amazon/RendererAmazonSpearman.java | 6 +- .../mobs/amazon/RendererChiefAmazon.java | 6 +- .../barbarians/AbstractRendererBarbarian.java | 4 +- .../mobs/barbarians/RendererBarbarian.java | 6 +- .../barbarians/RendererChiefBarbarian.java | 6 +- .../AbstractRendererDrownedPirate.java | 4 +- .../RendererDrownedArcherPirate.java | 6 +- .../RendererDrownedChiefPirate.java | 6 +- .../drownedpirates/RendererDrownedPirate.java | 6 +- .../egyptians/AbstractRendererEgyptian.java | 4 +- .../mobs/egyptians/RendererArcherMummy.java | 6 +- .../render/mobs/egyptians/RendererMummy.java | 6 +- .../render/mobs/egyptians/RendererPharao.java | 6 +- .../norsemen/AbstractRendererNorsemen.java | 4 +- .../mobs/norsemen/RendererArcherNorsemen.java | 6 +- .../mobs/norsemen/RendererChiefNorsemen.java | 6 +- .../RendererShieldmaidenNorsemen.java | 6 +- .../mobs/pirates/AbstractRendererPirate.java | 4 +- .../mobs/pirates/RendererArcherPirate.java | 6 +- .../mobs/pirates/RendererChiefPirate.java | 6 +- .../render/mobs/pirates/RendererPirate.java | 6 +- .../events/raid/AbstractShipRaidEvent.java | 4 +- .../colony/events/raid/HordeRaidEvent.java | 6 +- .../core/colony/events/raid/RaidManager.java | 4 +- .../raid/amazonevent/AmazonRaidEvent.java | 24 +- .../barbarianEvent/BarbarianRaidEvent.java | 24 +- .../raid/egyptianevent/EgyptianRaidEvent.java | 24 +- .../raid/norsemenevent/NorsemenRaidEvent.java | 24 +- .../pirateEvent/PirateGroundRaidEvent.java | 24 +- .../killcommands/CommandKillRaider.java | 6 +- .../journeymap/EventListener.java | 4 +- .../core/entity/ai/combat/CombatUtils.java | 4 +- .../core/entity/mobs/aitasks/CampWalkAI.java | 102 +++++ .../mobs/aitasks/EntityAIBreakDoor.java | 16 +- .../entity/mobs/aitasks/RaiderMeleeAI.java | 7 +- .../entity/mobs/aitasks/RaiderRangedAI.java | 5 +- .../entity/mobs/aitasks/RaiderWalkAI.java | 12 +- .../entity/mobs/amazons/package-info.java | 4 - .../entity/mobs/barbarians/package-info.java | 4 - .../{ => camp}/amazons/EntityAmazonChief.java | 5 +- .../amazons/EntityAmazonSpearman.java | 3 +- .../amazons/EntityArcherAmazon.java | 2 +- .../barbarians/EntityArcherBarbarian.java | 2 +- .../barbarians/EntityBarbarian.java | 2 +- .../barbarians/EntityChiefBarbarian.java | 5 +- .../mobs/camp/barbarians/package-info.java | 4 + .../EntityDrownedArcherPirate.java | 2 +- .../EntityDrownedCaptainPirate.java | 4 +- .../drownedpirates/EntityDrownedPirate.java | 2 +- .../egyptians/EntityArcherMummy.java | 3 +- .../{ => camp}/egyptians/EntityMummy.java | 2 +- .../{ => camp}/egyptians/EntityPharao.java | 4 +- .../mobs/camp/egyptians/package-info.java | 4 + .../norsemen/EntityNorsemenArcher.java | 3 +- .../norsemen/EntityNorsemenChief.java | 4 +- .../norsemen/EntityShieldmaiden.java | 3 +- .../mobs/camp/norsemen/package-info.java | 4 + .../pirates/EntityArcherPirate.java | 3 +- .../pirates/EntityCaptainPirate.java | 4 +- .../mobs/{ => camp}/pirates/EntityPirate.java | 2 +- .../mobs/camp/pirates/package-info.java | 4 + .../entity/mobs/egyptians/package-info.java | 4 - .../entity/mobs/norsemen/package-info.java | 4 - .../entity/mobs/pirates/package-info.java | 4 - .../amazons/EntityAmazonChiefRaider.java | 41 ++ .../amazons/EntityAmazonSpearmanRaider.java | 23 + .../amazons/EntityArcherAmazonRaider.java | 29 ++ .../EntityArcherBarbarianRaider.java | 24 + .../barbarians/EntityBarbarianRaider.java | 24 + .../EntityChiefBarbarianRaider.java | 41 ++ .../mobs/raider/barbarians/package-info.java | 4 + .../EntityDrownedArcherPirateRaider.java | 39 ++ .../EntityDrownedCaptainPirateRaider.java | 44 ++ .../EntityDrownedPirateRaider.java | 36 ++ .../egyptians/EntityArcherMummyRaider.java | 23 + .../raider/egyptians/EntityMummyRaider.java | 26 ++ .../raider/egyptians/EntityPharaoRaider.java | 41 ++ .../mobs/raider/egyptians/package-info.java | 4 + .../norsemen/EntityNorsemenArcherRaider.java | 24 + .../norsemen/EntityNorsemenChiefRaider.java | 40 ++ .../norsemen/EntityShieldmaidenRaider.java | 24 + .../mobs/raider/norsemen/package-info.java | 4 + .../pirates/EntityArcherPirateRaider.java | 23 + .../pirates/EntityCaptainPirateRaider.java | 39 ++ .../raider/pirates/EntityPirateRaider.java | 26 ++ .../mobs/raider/pirates/package-info.java | 4 + .../entity/mobs/registry/MobAIRegistry.java | 49 +-- .../entity/pathfinding/PathfindingUtils.java | 4 +- .../core/event/ClientRegistryHandler.java | 30 ++ .../defaults/DefaultDamageTypeProvider.java | 22 +- .../core/items/ItemChiefSword.java | 4 +- .../minecolonies/lang/manual_en_us.json | 8 + .../models/item/drownedpiratearcheregg.json | 3 + .../models/item/drownedpiratecaptainegg.json | 3 + .../models/item/drownedpirateegg.json | 3 + 146 files changed, 2442 insertions(+), 761 deletions(-) create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/campamazon.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/campamazonchief.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/campamazonspearman.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/camparcherbarbarian.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/camparchermummy.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/camparcherpirate.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/campbarbarian.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/campchiefpirate.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/campmummy.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/campnorsemenarcher.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/campnorsemenchief.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/camppharao.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/camppirate.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/campshieldmaiden.json create mode 100644 src/datagen/generated/minecolonies/data/minecolonies/damage_type/ccamphiefbarbarian.json create mode 100644 src/main/java/com/minecolonies/api/entity/mobs/AbstractEntityMinecoloniesMonster.java rename src/main/java/com/minecolonies/api/entity/mobs/{AbstractEntityRaiderMob.java => AbstractEntityMinecoloniesRaider.java} (64%) create mode 100755 src/main/java/com/minecolonies/api/entity/mobs/amazons/AbstractEntityAmazonRaider.java create mode 100755 src/main/java/com/minecolonies/api/entity/mobs/barbarians/AbstractEntityBarbarianRaider.java create mode 100755 src/main/java/com/minecolonies/api/entity/mobs/drownedpirate/AbstractDrownedEntityPirateRaider.java create mode 100755 src/main/java/com/minecolonies/api/entity/mobs/egyptians/AbstractEntityEgyptianRaider.java create mode 100755 src/main/java/com/minecolonies/api/entity/mobs/pirates/AbstractEntityPirateRaider.java create mode 100755 src/main/java/com/minecolonies/api/entity/mobs/vikings/AbstractEntityNorsemenRaider.java create mode 100644 src/main/java/com/minecolonies/core/entity/mobs/aitasks/CampWalkAI.java delete mode 100755 src/main/java/com/minecolonies/core/entity/mobs/amazons/package-info.java delete mode 100755 src/main/java/com/minecolonies/core/entity/mobs/barbarians/package-info.java rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/amazons/EntityAmazonChief.java (86%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/amazons/EntityAmazonSpearman.java (83%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/amazons/EntityArcherAmazon.java (92%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/barbarians/EntityArcherBarbarian.java (92%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/barbarians/EntityBarbarian.java (91%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/barbarians/EntityChiefBarbarian.java (86%) create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/camp/barbarians/package-info.java rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/drownedpirates/EntityDrownedArcherPirate.java (95%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/drownedpirates/EntityDrownedCaptainPirate.java (91%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/drownedpirates/EntityDrownedPirate.java (95%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/egyptians/EntityArcherMummy.java (82%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/egyptians/EntityMummy.java (92%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/egyptians/EntityPharao.java (91%) create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/camp/egyptians/package-info.java rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/norsemen/EntityNorsemenArcher.java (83%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/norsemen/EntityNorsemenChief.java (91%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/norsemen/EntityShieldmaiden.java (83%) create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/camp/norsemen/package-info.java rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/pirates/EntityArcherPirate.java (83%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/pirates/EntityCaptainPirate.java (90%) rename src/main/java/com/minecolonies/core/entity/mobs/{ => camp}/pirates/EntityPirate.java (93%) create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/camp/pirates/package-info.java delete mode 100755 src/main/java/com/minecolonies/core/entity/mobs/egyptians/package-info.java delete mode 100755 src/main/java/com/minecolonies/core/entity/mobs/norsemen/package-info.java delete mode 100755 src/main/java/com/minecolonies/core/entity/mobs/pirates/package-info.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/amazons/EntityAmazonChiefRaider.java create mode 100644 src/main/java/com/minecolonies/core/entity/mobs/raider/amazons/EntityAmazonSpearmanRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/amazons/EntityArcherAmazonRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/EntityArcherBarbarianRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/EntityBarbarianRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/EntityChiefBarbarianRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/package-info.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/drownedpirates/EntityDrownedArcherPirateRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/drownedpirates/EntityDrownedCaptainPirateRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/drownedpirates/EntityDrownedPirateRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/EntityArcherMummyRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/EntityMummyRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/EntityPharaoRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/package-info.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/EntityNorsemenArcherRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/EntityNorsemenChiefRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/EntityShieldmaidenRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/package-info.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/EntityArcherPirateRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/EntityCaptainPirateRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/EntityPirateRaider.java create mode 100755 src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/package-info.java create mode 100755 src/main/resources/assets/minecolonies/models/item/drownedpiratearcheregg.json create mode 100755 src/main/resources/assets/minecolonies/models/item/drownedpiratecaptainegg.json create mode 100755 src/main/resources/assets/minecolonies/models/item/drownedpirateegg.json diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campamazon.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campamazon.json new file mode 100644 index 00000000000..102a971bb4c --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campamazon.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.campamazon", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campamazonchief.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campamazonchief.json new file mode 100644 index 00000000000..fac09f1910a --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campamazonchief.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.campamazonchief", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campamazonspearman.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campamazonspearman.json new file mode 100644 index 00000000000..a8912fd2f01 --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campamazonspearman.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.campamazonspearman", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camparcherbarbarian.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camparcherbarbarian.json new file mode 100644 index 00000000000..fc574fbfbf0 --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camparcherbarbarian.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.camparcherbarbarian", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camparchermummy.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camparchermummy.json new file mode 100644 index 00000000000..be9c938ea23 --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camparchermummy.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.camparchermummy", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camparcherpirate.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camparcherpirate.json new file mode 100644 index 00000000000..878f74ed22a --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camparcherpirate.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.camparcherpirate", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campbarbarian.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campbarbarian.json new file mode 100644 index 00000000000..6627e84d2ad --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campbarbarian.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.campbarbarian", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campchiefpirate.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campchiefpirate.json new file mode 100644 index 00000000000..3c7d0dad1ef --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campchiefpirate.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.campchiefpirate", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campmummy.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campmummy.json new file mode 100644 index 00000000000..fee9f1fb7b8 --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campmummy.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.campmummy", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campnorsemenarcher.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campnorsemenarcher.json new file mode 100644 index 00000000000..6f020583534 --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campnorsemenarcher.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.campnorsemenarcher", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campnorsemenchief.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campnorsemenchief.json new file mode 100644 index 00000000000..5951fd78c8b --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campnorsemenchief.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.campnorsemenchief", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camppharao.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camppharao.json new file mode 100644 index 00000000000..97dcbfc4d10 --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camppharao.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.camppharao", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camppirate.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camppirate.json new file mode 100644 index 00000000000..9988292eb28 --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/camppirate.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.camppirate", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campshieldmaiden.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campshieldmaiden.json new file mode 100644 index 00000000000..f86d4f84bb3 --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/campshieldmaiden.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.campshieldmaiden", + "scaling": "always" +} \ No newline at end of file diff --git a/src/datagen/generated/minecolonies/data/minecolonies/damage_type/ccamphiefbarbarian.json b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/ccamphiefbarbarian.json new file mode 100644 index 00000000000..f398aa988d4 --- /dev/null +++ b/src/datagen/generated/minecolonies/data/minecolonies/damage_type/ccamphiefbarbarian.json @@ -0,0 +1,5 @@ +{ + "exhaustion": 0.1, + "message_id": "entity.minecolonies.campchiefbarbarian", + "scaling": "always" +} \ No newline at end of file diff --git a/src/main/java/com/minecolonies/api/client/render/modeltype/AmazonModel.java b/src/main/java/com/minecolonies/api/client/render/modeltype/AmazonModel.java index 1c8ad91e14b..1487df9e457 100755 --- a/src/main/java/com/minecolonies/api/client/render/modeltype/AmazonModel.java +++ b/src/main/java/com/minecolonies/api/client/render/modeltype/AmazonModel.java @@ -1,6 +1,6 @@ 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; @@ -8,7 +8,7 @@ /** * Amazon model. */ -public class AmazonModel extends HumanoidModel +public class AmazonModel extends HumanoidModel { public AmazonModel(final ModelPart part) { @@ -16,7 +16,7 @@ public AmazonModel(final ModelPart 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; diff --git a/src/main/java/com/minecolonies/api/client/render/modeltype/EgyptianModel.java b/src/main/java/com/minecolonies/api/client/render/modeltype/EgyptianModel.java index a56f15f0140..57be5d56e03 100755 --- a/src/main/java/com/minecolonies/api/client/render/modeltype/EgyptianModel.java +++ b/src/main/java/com/minecolonies/api/client/render/modeltype/EgyptianModel.java @@ -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 extends HumanoidModel +public class EgyptianModel extends HumanoidModel { /** * Create a model of a specific size. diff --git a/src/main/java/com/minecolonies/api/client/render/modeltype/NorsemenModel.java b/src/main/java/com/minecolonies/api/client/render/modeltype/NorsemenModel.java index 3b416d98f3d..2b5d90649dc 100755 --- a/src/main/java/com/minecolonies/api/client/render/modeltype/NorsemenModel.java +++ b/src/main/java/com/minecolonies/api/client/render/modeltype/NorsemenModel.java @@ -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 +public class NorsemenModel extends HumanoidModel { /** * Create a model of a specific size. diff --git a/src/main/java/com/minecolonies/api/colony/managers/interfaces/IRaiderManager.java b/src/main/java/com/minecolonies/api/colony/managers/interfaces/IRaiderManager.java index 8d30c447b61..7779794863f 100755 --- a/src/main/java/com/minecolonies/api/colony/managers/interfaces/IRaiderManager.java +++ b/src/main/java/com/minecolonies/api/colony/managers/interfaces/IRaiderManager.java @@ -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; @@ -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); diff --git a/src/main/java/com/minecolonies/api/creativetab/ModCreativeTabs.java b/src/main/java/com/minecolonies/api/creativetab/ModCreativeTabs.java index a769c8b672f..e92a2585c6c 100755 --- a/src/main/java/com/minecolonies/api/creativetab/ModCreativeTabs.java +++ b/src/main/java/com/minecolonies/api/creativetab/ModCreativeTabs.java @@ -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; @@ -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; @@ -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)); + 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 FOOD = TAB_REG.register("mcfood", () -> new CreativeModeTab.Builder(CreativeModeTab.Row.TOP, 1) diff --git a/src/main/java/com/minecolonies/api/entity/ModEntities.java b/src/main/java/com/minecolonies/api/entity/ModEntities.java index fec751955b4..52f1d822359 100755 --- a/src/main/java/com/minecolonies/api/entity/ModEntities.java +++ b/src/main/java/com/minecolonies/api/entity/ModEntities.java @@ -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; @@ -26,37 +32,37 @@ public class ModEntities public static EntityType MERCENARY; - public static EntityType BARBARIAN; + public static EntityType BARBARIAN; - public static EntityType ARCHERBARBARIAN; + public static EntityType ARCHERBARBARIAN; - public static EntityType CHIEFBARBARIAN; + public static EntityType CHIEFBARBARIAN; - public static EntityType PIRATE; + public static EntityType PIRATE; - public static EntityType CHIEFPIRATE; + public static EntityType CHIEFPIRATE; - public static EntityType ARCHERPIRATE; + public static EntityType ARCHERPIRATE; public static EntityType SITTINGENTITY; - public static EntityType MUMMY; + public static EntityType MUMMY; - public static EntityType PHARAO; + public static EntityType PHARAO; - public static EntityType ARCHERMUMMY; + public static EntityType ARCHERMUMMY; - public static EntityType NORSEMEN_ARCHER; + public static EntityType NORSEMEN_ARCHER; - public static EntityType SHIELDMAIDEN; + public static EntityType SHIELDMAIDEN; - public static EntityType NORSEMEN_CHIEF; + public static EntityType NORSEMEN_CHIEF; - public static EntityType AMAZON; + public static EntityType AMAZON; - public static EntityType AMAZONSPEARMAN; + public static EntityType AMAZONSPEARMAN; - public static EntityType AMAZONCHIEF; + public static EntityType AMAZONCHIEF; public static EntityType MINECART; @@ -68,13 +74,51 @@ public class ModEntities public static EntityType SPEAR; - public static EntityType DROWNED_PIRATE; + public static EntityType DROWNED_PIRATE; - public static EntityType DROWNED_CHIEFPIRATE; + public static EntityType DROWNED_CHIEFPIRATE; - public static EntityType DROWNED_ARCHERPIRATE; + public static EntityType DROWNED_ARCHERPIRATE; - public static List> getRaiders() + // Camp Raiders + + public static EntityType CAMP_BARBARIAN; + + public static EntityType CAMP_ARCHERBARBARIAN; + + public static EntityType CAMP_CHIEFBARBARIAN; + + public static EntityType CAMP_PIRATE; + + public static EntityType CAMP_CHIEFPIRATE; + + public static EntityType CAMP_ARCHERPIRATE; + + public static EntityType CAMP_AMAZON; + + public static EntityType CAMP_AMAZONSPEARMAN; + + public static EntityType CAMP_AMAZONCHIEF; + + public static EntityType CAMP_MUMMY; + + public static EntityType CAMP_PHARAO; + + public static EntityType CAMP_ARCHERMUMMY; + + public static EntityType CAMP_NORSEMEN_ARCHER; + + public static EntityType CAMP_SHIELDMAIDEN; + + public static EntityType CAMP_NORSEMEN_CHIEF; + + public static EntityType CAMP_DROWNED_PIRATE; + + public static EntityType CAMP_DROWNED_CHIEFPIRATE; + + public static EntityType CAMP_DROWNED_ARCHERPIRATE; + + public static List> getRaiders() { return List.of( BARBARIAN, diff --git a/src/main/java/com/minecolonies/api/entity/ai/combat/threat/ThreatTable.java b/src/main/java/com/minecolonies/api/entity/ai/combat/threat/ThreatTable.java index 10572a444dc..5fcac00f55d 100644 --- a/src/main/java/com/minecolonies/api/entity/ai/combat/threat/ThreatTable.java +++ b/src/main/java/com/minecolonies/api/entity/ai/combat/threat/ThreatTable.java @@ -106,7 +106,7 @@ public int getThreatFor(final LivingEntity attacker) } } - return 0; + return -1; } /** diff --git a/src/main/java/com/minecolonies/api/entity/mobs/AbstractEntityMinecoloniesMonster.java b/src/main/java/com/minecolonies/api/entity/mobs/AbstractEntityMinecoloniesMonster.java new file mode 100644 index 00000000000..26b80dfcf8c --- /dev/null +++ b/src/main/java/com/minecolonies/api/entity/mobs/AbstractEntityMinecoloniesMonster.java @@ -0,0 +1,413 @@ +package com.minecolonies.api.entity.mobs; + +import com.minecolonies.api.IMinecoloniesAPI; +import com.minecolonies.api.MinecoloniesAPIProxy; +import com.minecolonies.api.entity.CustomGoalSelector; +import com.minecolonies.api.entity.ai.combat.CombatAIStates; +import com.minecolonies.api.entity.ai.combat.threat.IThreatTableEntity; +import com.minecolonies.api.entity.ai.combat.threat.ThreatTable; +import com.minecolonies.api.entity.ai.statemachine.states.IState; +import com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.ITickRateStateMachine; +import com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickRateStateMachine; +import com.minecolonies.api.entity.other.AbstractFastMinecoloniesEntity; +import com.minecolonies.api.entity.pathfinding.registry.IPathNavigateRegistry; +import com.minecolonies.api.sounds.RaiderSounds; +import com.minecolonies.api.util.Log; +import com.minecolonies.api.util.MathUtils; +import com.minecolonies.core.entity.pathfinding.navigation.AbstractAdvancedPathNavigate; +import com.minecolonies.core.entity.pathfinding.navigation.PathingStuckHandler; +import net.minecraft.core.BlockPos; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.util.Tuple; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.damagesource.DamageTypes; +import net.minecraft.world.entity.*; +import net.minecraft.world.entity.ai.attributes.AttributeSupplier; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.entity.monster.Enemy; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.AABB; +import net.minecraftforge.common.util.ITeleporter; +import org.jetbrains.annotations.NotNull; + +import javax.annotation.Nullable; + +import static com.minecolonies.api.entity.citizen.AbstractEntityCitizen.ENTITY_AI_TICKRATE; +import static com.minecolonies.api.entity.mobs.RaiderMobUtils.MOB_ATTACK_DAMAGE; +import static com.minecolonies.api.util.constant.NbtTagConstants.*; +import static com.minecolonies.api.util.constant.RaiderConstants.*; + +/** + * Abstract for all villain entities. + */ +public abstract class AbstractEntityMinecoloniesMonster extends AbstractFastMinecoloniesEntity implements IThreatTableEntity, Enemy +{ + /** + * The New PathNavigate navigator. + */ + protected AbstractAdvancedPathNavigate newNavigator; + + /** + * The invulnerability timer for spawning, to prevent suffocate/grouping damage. + */ + private int invulTime = 2 * 20; + + /** + * Texture id of the pirates. + */ + private int textureId; + + /** + * Counts entity collisions + */ + private int collisionCounter = 0; + + /** + * The collision threshold + */ + private final static int COLL_THRESHOLD = 50; + + /** + * The threattable of the mob + */ + private ThreatTable threatTable = new ThreatTable<>(this); + + /** + * Raiders AI statemachine + */ + private ITickRateStateMachine ai = new TickRateStateMachine<>(CombatAIStates.NO_TARGET, e -> Log.getLogger().warn(e), ENTITY_AI_TICKRATE); + + /** + * Initial spawn pos of the entity. + */ + private BlockPos spawnPos = null; + + /** + * Constructor method for Abstract minecolonies mobs. + * + * @param world the world. + * @param type the entity type. + */ + public AbstractEntityMinecoloniesMonster(final EntityType type, final Level world) + { + super(type, world); + this.setPersistenceRequired(); + this.goalSelector = new CustomGoalSelector(this.goalSelector); + this.targetSelector = new CustomGoalSelector(this.targetSelector); + this.xpReward = BARBARIAN_EXP_DROP; + IMinecoloniesAPI.getInstance().getMobAIRegistry().applyToMob(this); + RaiderMobUtils.setEquipment(this); + } + + /** + * Constructor method for Abstract minecolonies mobs. + * + * @param world the world. + * @param type the entity type. + * @param textureCount the texture count. + */ + public AbstractEntityMinecoloniesMonster(final EntityType type, final Level world, final int textureCount) + { + this(type, world); + this.textureId = MathUtils.RANDOM.nextInt(textureCount); + } + + /** + * Ignores cramming + */ + @Override + public void pushEntities() + { + if (collisionCounter > COLL_THRESHOLD) + { + return; + } + + super.pushEntities(); + } + + @Override + public void push(@NotNull final Entity entityIn) + { + if (invulTime > 0) + { + return; + } + + if ((collisionCounter += 3) > COLL_THRESHOLD) + { + if (collisionCounter > (COLL_THRESHOLD * 3)) + { + collisionCounter = 0; + } + + return; + } + + super.push(entityIn); + } + + @Override + public void playAmbientSound() + { + super.playAmbientSound(); + final SoundEvent soundevent = this.getAmbientSound(); + if (soundevent != null && level().random.nextInt(OUT_OF_ONE_HUNDRED) <= ONE) + { + this.playSound(soundevent, this.getSoundVolume(), this.getVoicePitch()); + } + } + + + /** + * Get the specific raider type of this raider. + * + * @return the type enum. + */ + public abstract RaiderType getRaiderType(); + + @NotNull + @Override + public AbstractAdvancedPathNavigate getNavigation() + { + if (this.newNavigator == null) + { + this.newNavigator = IPathNavigateRegistry.getInstance().getNavigateFor(this); + this.navigation = newNavigator; + this.newNavigator.setCanFloat(true); + newNavigator.setSwimSpeedFactor(getSwimSpeedFactor()); + this.newNavigator.getPathingOptions().setEnterDoors(true); + newNavigator.getPathingOptions().withDropCost(1D); + newNavigator.getPathingOptions().withJumpCost(1D); + newNavigator.getPathingOptions().setPassDanger(true); + PathingStuckHandler stuckHandler = PathingStuckHandler.createStuckHandler() + .withTakeDamageOnStuck(0.4f) + .withBuildLeafBridges() + .withChanceToByPassMovingAway(0.20) + .withPlaceLadders(); + + if (MinecoloniesAPIProxy.getInstance().getConfig().getServer().raidersbreakblocks.get()) + { + stuckHandler.withBlockBreaks(); + stuckHandler.withCompleteStuckBlockBreak(6); + } + + newNavigator.setStuckHandler(stuckHandler); + } + return newNavigator; + } + + /** + * Get the swim speed factor + * + * @return speed factor + */ + public abstract double getSwimSpeedFactor(); + + @Override + protected SoundEvent getHurtSound(final DamageSource damageSourceIn) + { + return RaiderSounds.raiderSounds.get(getRaiderType()).get(RaiderSounds.RaiderSoundTypes.HURT); + } + + @Override + protected SoundEvent getDeathSound() + { + return RaiderSounds.raiderSounds.get(getRaiderType()).get(RaiderSounds.RaiderSoundTypes.DEATH); + } + + @Nullable + @Override + protected SoundEvent getAmbientSound() + { + return RaiderSounds.raiderSounds.get(getRaiderType()).get(RaiderSounds.RaiderSoundTypes.SAY); + } + + /** + * Prevent raiders from travelling to other dimensions through portals. + */ + @Nullable + @Override + public Entity changeDimension(@NotNull final ServerLevel serverWorld, @NotNull final ITeleporter teleporter) + { + return null; + } + + /** + * Initializes entity stats for a given raidlevel and difficulty + * + * @param baseHealth basehealth for this raid/difficulty + * @param difficulty difficulty + * @param baseDamage basedamage for this raid/difficulty + */ + public void initStatsFor(final double baseHealth, final double difficulty, final double baseDamage) + { + this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage); + + final double armor = difficulty * ARMOR; + this.getAttribute(Attributes.ARMOR).setBaseValue(armor); + + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth); + this.setHealth(this.getMaxHealth()); + } + + @Override + public void aiStep() + { + if (!this.isAlive()) + { + return; + } + + if (this.spawnPos == null && this.blockPosition() != BlockPos.ZERO) + { + this.spawnPos = this.blockPosition(); + } + + updateSwingTime(); + if (collisionCounter > 0) + { + collisionCounter--; + } + + if (level().isClientSide) + { + super.aiStep(); + return; + } + + if (tickCount % ENTITY_AI_TICKRATE == 0) + { + ai.tick(); + } + + super.aiStep(); + } + + @Override + public boolean hurt(@NotNull final DamageSource damageSource, final float damage) + { + if (damageSource.getEntity() instanceof AbstractEntityMinecoloniesMonster) + { + return false; + } + + if (damageSource.getEntity() instanceof LivingEntity attacker) + { + if (threatTable.getThreatFor(attacker) == -1) + { + for (final AbstractEntityMinecoloniesMonster monster : level.getEntitiesOfClass(AbstractEntityMinecoloniesMonster.class, AABB.ofSize(position(), 20,5,20))) + { + monster.threatTable.addThreat(attacker, 0); + } + } + threatTable.addThreat(attacker, (int) damage); + } + + if (damageSource.typeHolder().is(DamageTypes.FELL_OUT_OF_WORLD)) + { + return super.hurt(damageSource, damage); + } + + return super.hurt(damageSource, damage); + } + + /** + * Get the default attributes with their values. + * @return the attribute modifier map. + */ + public static AttributeSupplier.Builder getDefaultAttributes() + { + return LivingEntity.createLivingAttributes() + .add(MOB_ATTACK_DAMAGE.get()) + .add(Attributes.MAX_HEALTH) + .add(Attributes.ARMOR) + .add(Attributes.MOVEMENT_SPEED, MOVEMENT_SPEED) + .add(Attributes.FOLLOW_RANGE, FOLLOW_RANGE * 2) + .add(Attributes.ATTACK_DAMAGE, Attributes.ATTACK_DAMAGE.getDefaultValue()); + } + + @Override + public void addAdditionalSaveData(final CompoundTag compound) + { + if (spawnPos != null) + { + compound.putLong(TAG_SPAWN_POS, spawnPos.asLong()); + } + super.addAdditionalSaveData(compound); + } + + @Override + public void readAdditionalSaveData(final CompoundTag compound) + { + if (compound.contains(TAG_SPAWN_POS)) + { + this.spawnPos = BlockPos.of(compound.getLong(TAG_SPAWN_POS)); + } + super.readAdditionalSaveData(compound); + } + + /** + * Disallow pushing from fluids to prevent stuck + * + * @return + */ + @Override + public boolean isPushedByFluid() + { + return false; + } + + @Override + public ThreatTable getThreatTable() + { + return threatTable; + } + + /** + * Get the AI machine + * + * @return ai statemachine + */ + public ITickRateStateMachine getAI() + { + return ai; + } + + @Override + public int getTeamId() + { + // All raiders are in the same team. You're doomed! + return -1; + } + + /** + * Texture id of the mob. + * @return the texture id. + */ + public int getTextureId() + { + return textureId; + } + + /** + * Getter for the initial spawn pos of the entity. + * @return the pos. + */ + public BlockPos getSpawnPos() + { + return this.spawnPos; + } + + /** + * Get the mobs difficulty + * + * @return difficulty + */ + public double getDifficulty() + { + return 1; + } +} diff --git a/src/main/java/com/minecolonies/api/entity/mobs/AbstractEntityRaiderMob.java b/src/main/java/com/minecolonies/api/entity/mobs/AbstractEntityMinecoloniesRaider.java similarity index 64% rename from src/main/java/com/minecolonies/api/entity/mobs/AbstractEntityRaiderMob.java rename to src/main/java/com/minecolonies/api/entity/mobs/AbstractEntityMinecoloniesRaider.java index 6e8df051538..8b50e8825b4 100644 --- a/src/main/java/com/minecolonies/api/entity/mobs/AbstractEntityRaiderMob.java +++ b/src/main/java/com/minecolonies/api/entity/mobs/AbstractEntityMinecoloniesRaider.java @@ -8,32 +8,18 @@ import com.minecolonies.api.colony.colonyEvents.IColonyEvent; import com.minecolonies.api.enchants.ModEnchants; import com.minecolonies.api.entity.CustomGoalSelector; -import com.minecolonies.api.entity.ai.combat.CombatAIStates; import com.minecolonies.api.entity.ai.combat.threat.IThreatTableEntity; -import com.minecolonies.api.entity.ai.combat.threat.ThreatTable; -import com.minecolonies.api.entity.ai.statemachine.states.IState; -import com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.ITickRateStateMachine; -import com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickRateStateMachine; -import com.minecolonies.api.entity.other.AbstractFastMinecoloniesEntity; -import com.minecolonies.api.entity.pathfinding.registry.IPathNavigateRegistry; import com.minecolonies.api.items.IChiefSwordItem; -import com.minecolonies.api.sounds.RaiderSounds; import com.minecolonies.api.util.ColonyUtils; import com.minecolonies.api.util.DamageSourceKeys; -import com.minecolonies.api.util.Log; import com.minecolonies.core.entity.pathfinding.navigation.AbstractAdvancedPathNavigate; -import com.minecolonies.core.entity.pathfinding.navigation.PathingStuckHandler; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerLevel; -import net.minecraft.sounds.SoundEvent; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.damagesource.DamageTypes; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.*; -import net.minecraft.world.entity.ai.attributes.AttributeSupplier; -import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.monster.Enemy; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.enchantment.EnchantmentHelper; @@ -46,8 +32,6 @@ import javax.annotation.Nullable; -import static com.minecolonies.api.entity.citizen.AbstractEntityCitizen.ENTITY_AI_TICKRATE; -import static com.minecolonies.api.entity.mobs.RaiderMobUtils.MOB_ATTACK_DAMAGE; import static com.minecolonies.api.util.constant.ColonyManagerConstants.NO_COLONY_ID; import static com.minecolonies.api.util.constant.NbtTagConstants.*; import static com.minecolonies.api.util.constant.RaiderConstants.*; @@ -55,7 +39,7 @@ /** * Abstract for all raider entities. */ -public abstract class AbstractEntityRaiderMob extends AbstractFastMinecoloniesEntity implements IThreatTableEntity, Enemy +public abstract class AbstractEntityMinecoloniesRaider extends AbstractEntityMinecoloniesMonster implements IThreatTableEntity, Enemy { /** * The percent of life taken per damage modifier @@ -107,16 +91,6 @@ public abstract class AbstractEntityRaiderMob extends AbstractFastMinecoloniesEn */ private int currentTick = 0; - /** - * Amount of time the barb got stuck. - */ - private int stuckCounter = 1; - - /** - * Amount of time the barb got stuck. - */ - private int ladderCounter = 0; - /** * The raids event id. */ @@ -157,42 +131,37 @@ public abstract class AbstractEntityRaiderMob extends AbstractFastMinecoloniesEn */ private int collisionCounter = 0; - /** - * The collision threshold - */ - private final static int COLL_THRESHOLD = 50; - private final static String RAID_TEAM = "RAIDERS_TEAM"; - /** * Mob difficulty */ private double difficulty = 1.0d; - /** - * The threattable of the mob - */ - private ThreatTable threatTable = new ThreatTable<>(this); - /** * Last chunk pos. */ private ChunkPos lastChunkPos = null; /** - * Raiders AI statemachine + * Constructor method for Abstract Barbarians. + * + * @param world the world. + * @param type the entity type. */ - private ITickRateStateMachine ai = new TickRateStateMachine<>(CombatAIStates.NO_TARGET, e -> Log.getLogger().warn(e), ENTITY_AI_TICKRATE); + public AbstractEntityMinecoloniesRaider(final EntityType type, final Level world) + { + this(type, world, 1); + } /** * Constructor method for Abstract Barbarians. * * @param world the world. * @param type the entity type. + * @param textureCount texture count. */ - public AbstractEntityRaiderMob(final EntityType type, final Level world) + public AbstractEntityMinecoloniesRaider(final EntityType type, final Level world, final int textureCount) { - super(type, world); - worldTimeAtSpawn = world.getGameTime(); + super(type, world, textureCount); this.setPersistenceRequired(); this.goalSelector = new CustomGoalSelector(this.goalSelector); this.targetSelector = new CustomGoalSelector(this.targetSelector); @@ -202,52 +171,6 @@ public AbstractEntityRaiderMob(final EntityType COLL_THRESHOLD) - { - return; - } - - super.pushEntities(); - } - - @Override - public void push(@NotNull final Entity entityIn) - { - if (invulTime > 0) - { - return; - } - - if ((collisionCounter += 3) > COLL_THRESHOLD) - { - if (collisionCounter > (COLL_THRESHOLD * 3)) - { - collisionCounter = 0; - } - - return; - } - - super.push(entityIn); - } - - @Override - public void playAmbientSound() - { - super.playAmbientSound(); - final SoundEvent soundevent = this.getAmbientSound(); - if (soundevent != null && level().random.nextInt(OUT_OF_ONE_HUNDRED) <= ONE) - { - this.playSound(soundevent, this.getSoundVolume(), this.getVoicePitch()); - } - } - @Override public boolean removeWhenFarAway(final double distanceToClosestPlayer) { @@ -271,115 +194,15 @@ private boolean shouldDespawn() return worldTimeAtSpawn != 0 && (level().getGameTime() - worldTimeAtSpawn) >= TICKS_TO_DESPAWN; } - @NotNull - @Override - public AbstractAdvancedPathNavigate getNavigation() - { - if (this.newNavigator == null) - { - this.newNavigator = IPathNavigateRegistry.getInstance().getNavigateFor(this); - this.navigation = newNavigator; - this.newNavigator.setCanFloat(true); - newNavigator.setSwimSpeedFactor(getSwimSpeedFactor()); - this.newNavigator.getPathingOptions().setEnterDoors(true); - newNavigator.getPathingOptions().withDropCost(1D); - newNavigator.getPathingOptions().withJumpCost(1D); - newNavigator.getPathingOptions().setPassDanger(true); - PathingStuckHandler stuckHandler = PathingStuckHandler.createStuckHandler() - .withTakeDamageOnStuck(0.4f) - .withBuildLeafBridges() - .withChanceToByPassMovingAway(0.20) - .withPlaceLadders(); - - if (MinecoloniesAPIProxy.getInstance().getConfig().getServer().raidersbreakblocks.get()) - { - stuckHandler.withBlockBreaks(); - stuckHandler.withCompleteStuckBlockBreak(6); - } - - newNavigator.setStuckHandler(stuckHandler); - } - return newNavigator; - } - - /** - * Get the swim speed factor - * - * @return speed factor - */ - public abstract double getSwimSpeedFactor(); - - /** - * Get the stack counter. - * - * @return the amount it got stuck already. - */ - public int getStuckCounter() - { - return stuckCounter; - } - - /** - * Set the stack counter. - * - * @param stuckCounter the amount. - */ - public void setStuckCounter(final int stuckCounter) - { - this.stuckCounter = stuckCounter; - } - - /** - * Get the ladder counter. - * - * @return the amount it got stuck and placed a ladder already. - */ - public int getLadderCounter() - { - return ladderCounter; - } - - /** - * Set the ladder counter. - * - * @param ladderCounter the amount. - */ - public void setLadderCounter(final int ladderCounter) - { - this.ladderCounter = ladderCounter; - } - - @Override - protected SoundEvent getHurtSound(final DamageSource damageSourceIn) - { - return RaiderSounds.raiderSounds.get(getRaiderType()).get(RaiderSounds.RaiderSoundTypes.HURT); - } - - @Override - protected SoundEvent getDeathSound() - { - return RaiderSounds.raiderSounds.get(getRaiderType()).get(RaiderSounds.RaiderSoundTypes.DEATH); - } - - @Nullable - @Override - protected SoundEvent getAmbientSound() - { - return RaiderSounds.raiderSounds.get(getRaiderType()).get(RaiderSounds.RaiderSoundTypes.SAY); - } - @Override public void addAdditionalSaveData(final CompoundTag compound) { compound.putLong(TAG_TIME, worldTimeAtSpawn); - compound.putInt(TAG_STUCK_COUNTER, stuckCounter); - compound.putInt(TAG_LADDER_COUNTER, ladderCounter); compound.putInt(TAG_COLONY_ID, this.colony == null ? 0 : colony.getID()); compound.putInt(TAG_EVENT_ID, eventID); super.addAdditionalSaveData(compound); } - /** * Prevent raiders from travelling to other dimensions through portals. */ @@ -394,8 +217,6 @@ public Entity changeDimension(@NotNull final ServerLevel serverWorld, @NotNull f public void readAdditionalSaveData(final CompoundTag compound) { worldTimeAtSpawn = compound.getLong(TAG_TIME); - stuckCounter = compound.getInt(TAG_STUCK_COUNTER); - ladderCounter = compound.getInt(TAG_LADDER_COUNTER); eventID = compound.getInt(TAG_EVENT_ID); if (compound.contains(TAG_COLONY_ID)) { @@ -492,12 +313,10 @@ public void aiStep() } currentTick++; - if (isRegistered && tickCount % ENTITY_AI_TICKRATE == 0) + if (isRegistered) { - ai.tick(); + super.aiStep(); } - - super.aiStep(); } /** @@ -576,21 +395,6 @@ public void die(@NotNull final DamageSource cause) @Override public boolean hurt(@NotNull final DamageSource damageSource, final float damage) { - if (damageSource.getEntity() instanceof AbstractEntityRaiderMob) - { - return false; - } - - if (damageSource.getEntity() instanceof LivingEntity) - { - threatTable.addThreat((LivingEntity) damageSource.getEntity(), (int) damage); - } - - if (damageSource.typeHolder().is(DamageTypes.FELL_OUT_OF_WORLD)) - { - return super.hurt(damageSource, damage); - } - if (damageSource.getDirectEntity() == null) { if (envDamageImmunity || tempEnvDamageImmunity) @@ -636,21 +440,6 @@ else if (!level().isClientSide()) return super.hurt(damageSource, damage); } - /** - * Get the default attributes with their values. - * @return the attribute modifier map. - */ - public static AttributeSupplier.Builder getDefaultAttributes() - { - return LivingEntity.createLivingAttributes() - .add(MOB_ATTACK_DAMAGE.get()) - .add(Attributes.MAX_HEALTH) - .add(Attributes.ARMOR) - .add(Attributes.MOVEMENT_SPEED, MOVEMENT_SPEED) - .add(Attributes.FOLLOW_RANGE, FOLLOW_RANGE * 2) - .add(Attributes.ATTACK_DAMAGE, Attributes.ATTACK_DAMAGE.getDefaultValue()); - } - /** * Set the colony to raid. * @@ -712,60 +501,26 @@ public void setTempEnvDamageImmunity(final boolean immunity) * @param difficulty difficulty * @param baseDamage basedamage for this raid/difficulty */ + @Override public void initStatsFor(final double baseHealth, final double difficulty, final double baseDamage) { - this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage); + super.initStatsFor(baseHealth, difficulty, baseDamage); this.difficulty = difficulty; - final double armor = difficulty * ARMOR; - this.getAttribute(Attributes.ARMOR).setBaseValue(armor); this.setEnvDamageInterval((int) (BASE_ENV_DAMAGE_RESIST * difficulty)); if (difficulty >= 1.4d) { this.setEnvDamageImmunity(true); } - - this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth); - this.setHealth(this.getMaxHealth()); } - /** - * Get the mobs difficulty - * - * @return difficulty - */ + @Override public double getDifficulty() { return difficulty; } - /** - * Disallow pushing from fluids to prevent stuck - * - * @return - */ - public boolean isPushedByFluid() - { - return false; - } - - @Override - public ThreatTable getThreatTable() - { - return threatTable; - } - - /** - * Get the AI machine - * - * @return ai statemachine - */ - public ITickRateStateMachine getAI() - { - return ai; - } - @Override public int getTeamId() { diff --git a/src/main/java/com/minecolonies/api/entity/mobs/RaiderMobUtils.java b/src/main/java/com/minecolonies/api/entity/mobs/RaiderMobUtils.java index 50819813db3..790e9fed15f 100755 --- a/src/main/java/com/minecolonies/api/entity/mobs/RaiderMobUtils.java +++ b/src/main/java/com/minecolonies/api/entity/mobs/RaiderMobUtils.java @@ -65,7 +65,7 @@ private RaiderMobUtils() * @param mob The mob to set the attributes on. * @param colony The colony that the mob is attacking. */ - public static void setMobAttributes(final AbstractEntityRaiderMob mob, final IColony colony) + public static void setMobAttributes(final AbstractEntityMinecoloniesRaider mob, final IColony colony) { final double difficultyModifier = colony.getRaiderManager().getRaidDifficultyModifier(); mob.getAttribute(Attributes.FOLLOW_RANGE).setBaseValue(FOLLOW_RANGE * 2); @@ -120,7 +120,7 @@ public static void spawn( for (int i = 0; i < numberOfSpawns; i++) { - final AbstractEntityRaiderMob entity = (AbstractEntityRaiderMob) entityToSpawn.create(world); + final AbstractEntityMinecoloniesRaider entity = (AbstractEntityMinecoloniesRaider) entityToSpawn.create(world); if (entity != null) { @@ -152,7 +152,7 @@ public static void spawn( * * @param mob the equipment to set up. */ - public static void setEquipment(final AbstractEntityRaiderMob mob) + public static void setEquipment(final AbstractEntityMinecoloniesMonster mob) { if (mob instanceof IMeleeBarbarianEntity || mob instanceof IMeleeNorsemenEntity || mob instanceof INorsemenChiefEntity) { @@ -208,10 +208,10 @@ else if (mob instanceof IPirateEntity) * @param distanceFromEntity The distance to check for * @return the barbarians (if any) that is nearest */ - public static List getBarbariansCloseToEntity(final Entity entity, final double distanceFromEntity) + public static List getBarbariansCloseToEntity(final Entity entity, final double distanceFromEntity) { return CompatibilityUtils.getWorldFromEntity(entity).getEntitiesOfClass( - AbstractEntityRaiderMob.class, + AbstractEntityMinecoloniesRaider.class, entity.getBoundingBox().expandTowards( distanceFromEntity, 3.0D, diff --git a/src/main/java/com/minecolonies/api/entity/mobs/amazons/AbstractEntityAmazon.java b/src/main/java/com/minecolonies/api/entity/mobs/amazons/AbstractEntityAmazon.java index e4009db7201..9b7cdcf136d 100755 --- a/src/main/java/com/minecolonies/api/entity/mobs/amazons/AbstractEntityAmazon.java +++ b/src/main/java/com/minecolonies/api/entity/mobs/amazons/AbstractEntityAmazon.java @@ -1,6 +1,6 @@ package com.minecolonies.api.entity.mobs.amazons; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.api.entity.mobs.RaiderType; import net.minecraft.sounds.SoundEvent; import net.minecraft.world.entity.EntityType; @@ -12,9 +12,9 @@ import static com.minecolonies.api.util.constant.RaiderConstants.OUT_OF_ONE_HUNDRED; /** - * Abstract for all egyptian entities. + * Abstract for all amazon entities. */ -public abstract class AbstractEntityAmazon extends AbstractEntityRaiderMob +public abstract class AbstractEntityAmazon extends AbstractEntityMinecoloniesMonster { /** * Swim speed for amazons @@ -22,7 +22,7 @@ public abstract class AbstractEntityAmazon extends AbstractEntityRaiderMob private static final double AMAZON_SWIM_BONUS = 1.9; /** - * Constructor method for Abstract egyptian. + * Constructor method for Abstract amazon. * * @param type the type. * @param world the world. diff --git a/src/main/java/com/minecolonies/api/entity/mobs/amazons/AbstractEntityAmazonRaider.java b/src/main/java/com/minecolonies/api/entity/mobs/amazons/AbstractEntityAmazonRaider.java new file mode 100755 index 00000000000..75f8f6d7fef --- /dev/null +++ b/src/main/java/com/minecolonies/api/entity/mobs/amazons/AbstractEntityAmazonRaider.java @@ -0,0 +1,63 @@ +package com.minecolonies.api.entity.mobs.amazons; + +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; +import com.minecolonies.api.entity.mobs.RaiderType; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; + +import static com.minecolonies.api.util.constant.RaiderConstants.ONE; +import static com.minecolonies.api.util.constant.RaiderConstants.OUT_OF_ONE_HUNDRED; + +/** + * Abstract for all amazon entities. + */ +public abstract class AbstractEntityAmazonRaider extends AbstractEntityMinecoloniesRaider +{ + /** + * Swim speed for amazons + */ + private static final double AMAZON_SWIM_BONUS = 1.9; + + /** + * Constructor method for Abstract amazon. + * + * @param type the type. + * @param world the world. + */ + public AbstractEntityAmazonRaider(final EntityType type, final Level world) + { + super(type, world); + } + + @Override + public void playAmbientSound() + { + final SoundEvent soundevent = this.getAmbientSound(); + + if (soundevent != null && level().random.nextInt(OUT_OF_ONE_HUNDRED) <= ONE) + { + this.playSound(soundevent, this.getSoundVolume(), this.getVoicePitch()); + } + } + + @Override + public boolean checkSpawnRules(final LevelAccessor worldIn, final MobSpawnType spawnReasonIn) + { + return true; + } + + @Override + public RaiderType getRaiderType() + { + return RaiderType.AMAZON; + } + + @Override + public double getSwimSpeedFactor() + { + return AMAZON_SWIM_BONUS; + } +} diff --git a/src/main/java/com/minecolonies/api/entity/mobs/barbarians/AbstractEntityBarbarian.java b/src/main/java/com/minecolonies/api/entity/mobs/barbarians/AbstractEntityBarbarian.java index 4de1767a1be..5dceae238f6 100755 --- a/src/main/java/com/minecolonies/api/entity/mobs/barbarians/AbstractEntityBarbarian.java +++ b/src/main/java/com/minecolonies/api/entity/mobs/barbarians/AbstractEntityBarbarian.java @@ -1,6 +1,6 @@ package com.minecolonies.api.entity.mobs.barbarians; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.api.entity.mobs.RaiderType; import net.minecraft.sounds.SoundEvent; import net.minecraft.world.entity.EntityType; @@ -12,7 +12,7 @@ /** * Abstract for all Barbarian entities. */ -public abstract class AbstractEntityBarbarian extends AbstractEntityRaiderMob +public abstract class AbstractEntityBarbarian extends AbstractEntityMinecoloniesMonster { /** * Swim speed for barbarians diff --git a/src/main/java/com/minecolonies/api/entity/mobs/barbarians/AbstractEntityBarbarianRaider.java b/src/main/java/com/minecolonies/api/entity/mobs/barbarians/AbstractEntityBarbarianRaider.java new file mode 100755 index 00000000000..bc9108e9e77 --- /dev/null +++ b/src/main/java/com/minecolonies/api/entity/mobs/barbarians/AbstractEntityBarbarianRaider.java @@ -0,0 +1,55 @@ +package com.minecolonies.api.entity.mobs.barbarians; + +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; +import com.minecolonies.api.entity.mobs.RaiderType; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.Level; + +import static com.minecolonies.api.util.constant.RaiderConstants.ONE; +import static com.minecolonies.api.util.constant.RaiderConstants.OUT_OF_ONE_HUNDRED; + +/** + * Abstract for all Barbarian entities. + */ +public abstract class AbstractEntityBarbarianRaider extends AbstractEntityMinecoloniesRaider +{ + /** + * Swim speed for barbarians + */ + private static final double BARBARIAN_SWIM_BONUS = 2.0; + + /** + * Constructor method for Abstract Barbarians. + * + * @param type the type. + * @param world the world. + */ + public AbstractEntityBarbarianRaider(final EntityType type, final Level world) + { + super(type, world); + } + + @Override + public void playAmbientSound() + { + final SoundEvent soundevent = this.getAmbientSound(); + + if (soundevent != null && level().random.nextInt(OUT_OF_ONE_HUNDRED) <= ONE) + { + this.playSound(soundevent, this.getSoundVolume(), this.getVoicePitch()); + } + } + + @Override + public RaiderType getRaiderType() + { + return RaiderType.BARBARIAN; + } + + @Override + public double getSwimSpeedFactor() + { + return BARBARIAN_SWIM_BONUS; + } +} diff --git a/src/main/java/com/minecolonies/api/entity/mobs/drownedpirate/AbstractDrownedEntityPirate.java b/src/main/java/com/minecolonies/api/entity/mobs/drownedpirate/AbstractDrownedEntityPirate.java index f726d91018f..dd5d0f7706a 100755 --- a/src/main/java/com/minecolonies/api/entity/mobs/drownedpirate/AbstractDrownedEntityPirate.java +++ b/src/main/java/com/minecolonies/api/entity/mobs/drownedpirate/AbstractDrownedEntityPirate.java @@ -1,12 +1,11 @@ package com.minecolonies.api.entity.mobs.drownedpirate; import com.minecolonies.api.MinecoloniesAPIProxy; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.api.entity.mobs.RaiderType; import com.minecolonies.api.entity.pathfinding.registry.IPathNavigateRegistry; import com.minecolonies.core.entity.pathfinding.navigation.AbstractAdvancedPathNavigate; import com.minecolonies.core.entity.pathfinding.navigation.PathingStuckHandler; -import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobSpawnType; @@ -15,15 +14,13 @@ import net.minecraft.world.level.LevelReader; import org.jetbrains.annotations.NotNull; -import java.util.Random; - import static com.minecolonies.api.util.constant.RaiderConstants.ONE; import static com.minecolonies.api.util.constant.RaiderConstants.OUT_OF_ONE_HUNDRED; /** * Abstract for all drowned pirate entities. */ -public abstract class AbstractDrownedEntityPirate extends AbstractEntityRaiderMob +public abstract class AbstractDrownedEntityPirate extends AbstractEntityMinecoloniesMonster { /** * Swim speed for pirates @@ -35,11 +32,6 @@ public abstract class AbstractDrownedEntityPirate extends AbstractEntityRaiderMo */ private static final int PIRATE_TEXTURES = 4; - /** - * Texture id of the pirates. - */ - private int textureId; - /** * Constructor method for Abstract Barbarians. * @@ -48,8 +40,7 @@ public abstract class AbstractDrownedEntityPirate extends AbstractEntityRaiderMo */ public AbstractDrownedEntityPirate(final EntityType type, final Level world) { - super(type, world); - this.textureId = new Random().nextInt(PIRATE_TEXTURES); + super(type, world, PIRATE_TEXTURES); } @Override @@ -73,16 +64,6 @@ public boolean checkSpawnRules(final LevelAccessor worldIn, final MobSpawnType s return true; } - /** - * Get the unique texture id. - * - * @return the texture id. - */ - public int getTextureId() - { - return this.textureId; - } - @NotNull @Override public AbstractAdvancedPathNavigate getNavigation() diff --git a/src/main/java/com/minecolonies/api/entity/mobs/drownedpirate/AbstractDrownedEntityPirateRaider.java b/src/main/java/com/minecolonies/api/entity/mobs/drownedpirate/AbstractDrownedEntityPirateRaider.java new file mode 100755 index 00000000000..6e9673f0d0b --- /dev/null +++ b/src/main/java/com/minecolonies/api/entity/mobs/drownedpirate/AbstractDrownedEntityPirateRaider.java @@ -0,0 +1,118 @@ +package com.minecolonies.api.entity.mobs.drownedpirate; + +import com.minecolonies.api.MinecoloniesAPIProxy; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; +import com.minecolonies.api.entity.mobs.RaiderType; +import com.minecolonies.api.entity.pathfinding.registry.IPathNavigateRegistry; +import com.minecolonies.core.entity.pathfinding.navigation.AbstractAdvancedPathNavigate; +import com.minecolonies.core.entity.pathfinding.navigation.PathingStuckHandler; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.LevelReader; +import org.jetbrains.annotations.NotNull; + +import static com.minecolonies.api.util.constant.RaiderConstants.ONE; +import static com.minecolonies.api.util.constant.RaiderConstants.OUT_OF_ONE_HUNDRED; + +/** + * Abstract for all drowned pirate entities. + */ +public abstract class AbstractDrownedEntityPirateRaider extends AbstractEntityMinecoloniesRaider +{ + /** + * Swim speed for pirates + */ + private static final double PIRATE_SWIM_BONUS = 3.0; + + /** + * Amount of unique pirate textures. + */ + private static final int PIRATE_TEXTURES = 4; + + /** + * Texture id of the pirates. + */ + private int textureId; + + /** + * Constructor method for Abstract Barbarians. + * + * @param type the type. + * @param world the world. + */ + public AbstractDrownedEntityPirateRaider(final EntityType type, final Level world) + { + super(type, world, PIRATE_TEXTURES); + } + + @Override + public void playAmbientSound() + { + if (level().random.nextInt(OUT_OF_ONE_HUNDRED) <= ONE) + { + this.playSound(this.isInWater() ? SoundEvents.DROWNED_AMBIENT_WATER : SoundEvents.DROWNED_AMBIENT, this.getSoundVolume(), this.getVoicePitch()); + } + } + + @Override + public boolean checkSpawnObstruction(final LevelReader level) + { + return level.isUnobstructed(this); + } + + @Override + public boolean checkSpawnRules(final LevelAccessor worldIn, final MobSpawnType spawnReasonIn) + { + return true; + } + + @NotNull + @Override + public AbstractAdvancedPathNavigate getNavigation() + { + if (this.newNavigator == null) + { + this.newNavigator = IPathNavigateRegistry.getInstance().getNavigateFor(this); + this.navigation = newNavigator; + newNavigator.setSwimSpeedFactor(getSwimSpeedFactor()); + newNavigator.setSpeedModifier(0.5); + newNavigator.getPathingOptions().withStartSwimCost(0.0D).withSwimCost(0.0D).withDivingCost(0.0D).withCanEnterDoors(true).withDropCost(0.0D).withJumpCost(0.0D).withWalkUnderWater(true).withNonLadderClimbableCost(0.0D).setPassDanger(true); + PathingStuckHandler stuckHandler = PathingStuckHandler.createStuckHandler() + .withTakeDamageOnStuck(0.4f) + .withBuildLeafBridges() + .withChanceToByPassMovingAway(0.20) + .withPlaceLadders(); + + if (MinecoloniesAPIProxy.getInstance().getConfig().getServer().raidersbreakblocks.get()) + { + stuckHandler.withBlockBreaks(); + stuckHandler.withCompleteStuckBlockBreak(6); + } + + newNavigator.setStuckHandler(stuckHandler); + this.newNavigator.setCanFloat(true); + } + return newNavigator; + } + + @Override + protected int decreaseAirSupply(final int supply) + { + return supply; + } + + @Override + public RaiderType getRaiderType() + { + return RaiderType.PIRATE; + } + + @Override + public double getSwimSpeedFactor() + { + return PIRATE_SWIM_BONUS; + } +} diff --git a/src/main/java/com/minecolonies/api/entity/mobs/egyptians/AbstractEntityEgyptian.java b/src/main/java/com/minecolonies/api/entity/mobs/egyptians/AbstractEntityEgyptian.java index eb5ef6c8631..1f79fde0112 100755 --- a/src/main/java/com/minecolonies/api/entity/mobs/egyptians/AbstractEntityEgyptian.java +++ b/src/main/java/com/minecolonies/api/entity/mobs/egyptians/AbstractEntityEgyptian.java @@ -1,6 +1,6 @@ package com.minecolonies.api.entity.mobs.egyptians; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.api.entity.mobs.RaiderType; import net.minecraft.sounds.SoundEvent; import net.minecraft.world.entity.EntityType; @@ -14,14 +14,13 @@ /** * Abstract for all egyptian entities. */ -public abstract class AbstractEntityEgyptian extends AbstractEntityRaiderMob +public abstract class AbstractEntityEgyptian extends AbstractEntityMinecoloniesMonster { /** * Swim speed for mummies */ private static final double MUMMY_SWIM_SPEED = 1.7; - /** * Constructor method for Abstract egyptian.. * diff --git a/src/main/java/com/minecolonies/api/entity/mobs/egyptians/AbstractEntityEgyptianRaider.java b/src/main/java/com/minecolonies/api/entity/mobs/egyptians/AbstractEntityEgyptianRaider.java new file mode 100755 index 00000000000..948cac3807b --- /dev/null +++ b/src/main/java/com/minecolonies/api/entity/mobs/egyptians/AbstractEntityEgyptianRaider.java @@ -0,0 +1,63 @@ +package com.minecolonies.api.entity.mobs.egyptians; + +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; +import com.minecolonies.api.entity.mobs.RaiderType; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; + +import static com.minecolonies.api.util.constant.RaiderConstants.ONE; +import static com.minecolonies.api.util.constant.RaiderConstants.OUT_OF_ONE_HUNDRED; + +/** + * Abstract for all egyptian entities. + */ +public abstract class AbstractEntityEgyptianRaider extends AbstractEntityMinecoloniesRaider +{ + /** + * Swim speed for mummies + */ + private static final double MUMMY_SWIM_SPEED = 1.7; + + /** + * Constructor method for Abstract egyptian.. + * + * @param type the type. + * @param world the world. + */ + public AbstractEntityEgyptianRaider(final EntityType type, final Level world) + { + super(type, world); + } + + @Override + public void playAmbientSound() + { + final SoundEvent soundevent = this.getAmbientSound(); + + if (soundevent != null && level().random.nextInt(OUT_OF_ONE_HUNDRED) <= ONE) + { + this.playSound(soundevent, this.getSoundVolume(), this.getVoicePitch()); + } + } + + @Override + public boolean checkSpawnRules(final LevelAccessor worldIn, final MobSpawnType spawnReasonIn) + { + return true; + } + + @Override + public RaiderType getRaiderType() + { + return RaiderType.EGYPTIAN; + } + + @Override + public double getSwimSpeedFactor() + { + return MUMMY_SWIM_SPEED; + } +} diff --git a/src/main/java/com/minecolonies/api/entity/mobs/pirates/AbstractEntityPirate.java b/src/main/java/com/minecolonies/api/entity/mobs/pirates/AbstractEntityPirate.java index 33fffab8279..a6b973cf3a0 100755 --- a/src/main/java/com/minecolonies/api/entity/mobs/pirates/AbstractEntityPirate.java +++ b/src/main/java/com/minecolonies/api/entity/mobs/pirates/AbstractEntityPirate.java @@ -1,6 +1,6 @@ package com.minecolonies.api.entity.mobs.pirates; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.api.entity.mobs.RaiderType; import com.minecolonies.core.entity.pathfinding.navigation.AbstractAdvancedPathNavigate; import net.minecraft.sounds.SoundEvent; @@ -10,15 +10,13 @@ import net.minecraft.world.level.LevelAccessor; import org.jetbrains.annotations.NotNull; -import java.util.Random; - import static com.minecolonies.api.util.constant.RaiderConstants.ONE; import static com.minecolonies.api.util.constant.RaiderConstants.OUT_OF_ONE_HUNDRED; /** * Abstract for all pirate entities. */ -public abstract class AbstractEntityPirate extends AbstractEntityRaiderMob +public abstract class AbstractEntityPirate extends AbstractEntityMinecoloniesMonster { /** * Swim speed for pirates @@ -30,11 +28,6 @@ public abstract class AbstractEntityPirate extends AbstractEntityRaiderMob */ private static final int PIRATE_TEXTURES = 4; - /** - * Texture id of the pirates. - */ - private int textureId; - /** * Constructor method for Abstract Barbarians. * @@ -43,8 +36,7 @@ public abstract class AbstractEntityPirate extends AbstractEntityRaiderMob */ public AbstractEntityPirate(final EntityType type, final Level world) { - super(type, world); - this.textureId = new Random().nextInt(PIRATE_TEXTURES); + super(type, world, PIRATE_TEXTURES); } @Override @@ -64,16 +56,6 @@ public boolean checkSpawnRules(final LevelAccessor worldIn, final MobSpawnType s return true; } - /** - * Get the unique texture id. - * - * @return the texture id. - */ - public int getTextureId() - { - return this.textureId; - } - @NotNull @Override public AbstractAdvancedPathNavigate getNavigation() diff --git a/src/main/java/com/minecolonies/api/entity/mobs/pirates/AbstractEntityPirateRaider.java b/src/main/java/com/minecolonies/api/entity/mobs/pirates/AbstractEntityPirateRaider.java new file mode 100755 index 00000000000..8fa9fd86087 --- /dev/null +++ b/src/main/java/com/minecolonies/api/entity/mobs/pirates/AbstractEntityPirateRaider.java @@ -0,0 +1,97 @@ +package com.minecolonies.api.entity.mobs.pirates; + +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; +import com.minecolonies.api.entity.mobs.RaiderType; +import com.minecolonies.core.entity.pathfinding.navigation.AbstractAdvancedPathNavigate; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; +import org.jetbrains.annotations.NotNull; + +import java.util.Random; + +import static com.minecolonies.api.util.constant.RaiderConstants.ONE; +import static com.minecolonies.api.util.constant.RaiderConstants.OUT_OF_ONE_HUNDRED; + +/** + * Abstract for all pirate entities. + */ +public abstract class AbstractEntityPirateRaider extends AbstractEntityMinecoloniesRaider +{ + /** + * Swim speed for pirates + */ + private static final double PIRATE_SWIM_BONUS = 2.3; + + /** + * Amount of unique pirate textures. + */ + private static final int PIRATE_TEXTURES = 4; + + /** + * Texture id of the pirates. + */ + private int textureId; + + /** + * Constructor method for Abstract Barbarians. + * + * @param type the type. + * @param world the world. + */ + public AbstractEntityPirateRaider(final EntityType type, final Level world) + { + super(type, world); + this.textureId = new Random().nextInt(PIRATE_TEXTURES); + } + + @Override + public void playAmbientSound() + { + final SoundEvent soundevent = this.getAmbientSound(); + + if (soundevent != null && level().random.nextInt(OUT_OF_ONE_HUNDRED) <= ONE) + { + this.playSound(soundevent, this.getSoundVolume(), this.getVoicePitch()); + } + } + + @Override + public boolean checkSpawnRules(final LevelAccessor worldIn, final MobSpawnType spawnReasonIn) + { + return true; + } + + /** + * Get the unique texture id. + * + * @return the texture id. + */ + public int getTextureId() + { + return this.textureId; + } + + @NotNull + @Override + public AbstractAdvancedPathNavigate getNavigation() + { + AbstractAdvancedPathNavigate navigator = super.getNavigation(); + navigator.getPathingOptions().withStartSwimCost(2.5D).withSwimCost(1.1D); + return navigator; + } + + @Override + public RaiderType getRaiderType() + { + return RaiderType.PIRATE; + } + + @Override + public double getSwimSpeedFactor() + { + return PIRATE_SWIM_BONUS; + } +} diff --git a/src/main/java/com/minecolonies/api/entity/mobs/registry/IMobAIRegistry.java b/src/main/java/com/minecolonies/api/entity/mobs/registry/IMobAIRegistry.java index 65562f3b643..43051f61627 100755 --- a/src/main/java/com/minecolonies/api/entity/mobs/registry/IMobAIRegistry.java +++ b/src/main/java/com/minecolonies/api/entity/mobs/registry/IMobAIRegistry.java @@ -3,7 +3,7 @@ import com.google.common.collect.Multimap; import com.minecolonies.api.IMinecoloniesAPI; import com.minecolonies.api.entity.ai.IStateAI; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import net.minecraft.world.entity.ai.goal.Goal; import org.jetbrains.annotations.NotNull; @@ -21,7 +21,7 @@ public interface IMobAIRegistry * @return The map with the entity AI tasks that are needed for the given mob, with their priorities. */ @NotNull - Multimap getEntityAiTasksForMobs(final AbstractEntityRaiderMob mob); + Multimap getEntityAiTasksForMobs(final AbstractEntityMinecoloniesMonster mob); /** * Method used to register a entity AI task for a mob that matches the predicate. @@ -31,7 +31,7 @@ public interface IMobAIRegistry * @return The registry. */ @NotNull - default IMobAIRegistry registerNewAiTaskForMobs(final int priority, final Function aiTaskProducer) + default IMobAIRegistry registerNewAiTaskForMobs(final int priority, final Function aiTaskProducer) { return this.registerNewAiTaskForMobs(priority, aiTaskProducer, mob -> true); } @@ -47,8 +47,8 @@ default IMobAIRegistry registerNewAiTaskForMobs(final int priority, final Functi @NotNull IMobAIRegistry registerNewAiTaskForMobs( final int priority, - final Function aiTaskProducer, - Predicate applyPredicate); + final Function aiTaskProducer, + Predicate applyPredicate); /** * Method used to register a entity AI task for a mob that matches the predicate. @@ -59,14 +59,14 @@ IMobAIRegistry registerNewAiTaskForMobs( */ @NotNull IMobAIRegistry registerNewStateAI( - final Function aiTaskProducer, - Predicate applyPredicate); + final Function aiTaskProducer, + Predicate applyPredicate); /** * Applies the registered AI's to the given mob */ @NotNull - void applyToMob(AbstractEntityRaiderMob mob); + void applyToMob(AbstractEntityMinecoloniesMonster mob); /** * Method to get the AI target tasks registered for a given mob. Used by minecolonies to get the AIs that are required for a given mob. @@ -75,7 +75,7 @@ IMobAIRegistry registerNewStateAI( * @return The map with the entity AI tasks that are needed for the given mob, with their priorities. */ @NotNull - Multimap getEntityAiTargetTasksForMobs(final AbstractEntityRaiderMob mob); + Multimap getEntityAiTargetTasksForMobs(final AbstractEntityMinecoloniesMonster mob); /** * Method used to register a entity AI target task for a mob that matches the predicate. @@ -85,7 +85,7 @@ IMobAIRegistry registerNewStateAI( * @return The registry. */ @NotNull - default IMobAIRegistry registerNewAiTargetTaskForMobs(final int priority, final Function aiTaskProducer) + default IMobAIRegistry registerNewAiTargetTaskForMobs(final int priority, final Function aiTaskProducer) { return this.registerNewAiTargetTaskForMobs(priority, aiTaskProducer, mob -> true); } @@ -101,6 +101,6 @@ default IMobAIRegistry registerNewAiTargetTaskForMobs(final int priority, final @NotNull IMobAIRegistry registerNewAiTargetTaskForMobs( final int priority, - final Function aiTaskProducer, - Predicate applyPredicate); + final Function aiTaskProducer, + Predicate applyPredicate); } diff --git a/src/main/java/com/minecolonies/api/entity/mobs/vikings/AbstractEntityNorsemen.java b/src/main/java/com/minecolonies/api/entity/mobs/vikings/AbstractEntityNorsemen.java index e73f91b0df9..36f6ca13eb5 100755 --- a/src/main/java/com/minecolonies/api/entity/mobs/vikings/AbstractEntityNorsemen.java +++ b/src/main/java/com/minecolonies/api/entity/mobs/vikings/AbstractEntityNorsemen.java @@ -1,6 +1,6 @@ package com.minecolonies.api.entity.mobs.vikings; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.api.entity.mobs.RaiderType; import com.minecolonies.core.entity.pathfinding.navigation.AbstractAdvancedPathNavigate; import net.minecraft.sounds.SoundEvent; @@ -10,15 +10,13 @@ import net.minecraft.world.level.LevelAccessor; import org.jetbrains.annotations.NotNull; -import java.util.Random; - import static com.minecolonies.api.util.constant.RaiderConstants.ONE; import static com.minecolonies.api.util.constant.RaiderConstants.OUT_OF_ONE_HUNDRED; /** * Abstract for all norsemen entities. */ -public abstract class AbstractEntityNorsemen extends AbstractEntityRaiderMob +public abstract class AbstractEntityNorsemen extends AbstractEntityMinecoloniesMonster { /** * Swim speed for pirates @@ -30,11 +28,6 @@ public abstract class AbstractEntityNorsemen extends AbstractEntityRaiderMob */ private static final int NORSEMEN_TEXTURES = 3; - /** - * Texture id of the norsemen. - */ - private int textureId; - /** * Constructor method for Abstract norsemen.. * @@ -43,8 +36,7 @@ public abstract class AbstractEntityNorsemen extends AbstractEntityRaiderMob */ public AbstractEntityNorsemen(final EntityType type, final Level world) { - super(type, world); - this.textureId = new Random().nextInt(NORSEMEN_TEXTURES); + super(type, world, NORSEMEN_TEXTURES); } @Override @@ -70,16 +62,6 @@ public boolean checkSpawnRules(final LevelAccessor worldIn, final MobSpawnType s return true; } - /** - * Get the unique texture id. - * - * @return the texture id. - */ - public int getTextureId() - { - return this.textureId; - } - @NotNull @Override public AbstractAdvancedPathNavigate getNavigation() diff --git a/src/main/java/com/minecolonies/api/entity/mobs/vikings/AbstractEntityNorsemenRaider.java b/src/main/java/com/minecolonies/api/entity/mobs/vikings/AbstractEntityNorsemenRaider.java new file mode 100755 index 00000000000..771541fa9c9 --- /dev/null +++ b/src/main/java/com/minecolonies/api/entity/mobs/vikings/AbstractEntityNorsemenRaider.java @@ -0,0 +1,85 @@ +package com.minecolonies.api.entity.mobs.vikings; + +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; +import com.minecolonies.api.entity.mobs.RaiderType; +import com.minecolonies.core.entity.pathfinding.navigation.AbstractAdvancedPathNavigate; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; +import org.jetbrains.annotations.NotNull; + +import static com.minecolonies.api.util.constant.RaiderConstants.ONE; +import static com.minecolonies.api.util.constant.RaiderConstants.OUT_OF_ONE_HUNDRED; + +/** + * Abstract for all norsemen entities. + */ +public abstract class AbstractEntityNorsemenRaider extends AbstractEntityMinecoloniesRaider +{ + /** + * Swim speed for norsemen + */ + private static final double PIRATE_SWIM_BONUS = 2.3; + + /** + * Amount of unique norsemen textures. + */ + private static final int NORSEMEN_TEXTURES = 3; + + /** + * Constructor method for Abstract norsemen. + * + * @param type the type. + * @param world the world. + */ + public AbstractEntityNorsemenRaider(final EntityType type, final Level world) + { + super(type, world, NORSEMEN_TEXTURES); + } + + @Override + public void playAmbientSound() + { + final SoundEvent soundevent = this.getAmbientSound(); + + if (soundevent != null && level().random.nextInt(OUT_OF_ONE_HUNDRED) <= ONE) + { + this.playSound(soundevent, this.getSoundVolume(), this.getVoicePitch()); + } + } + + @Override + public float getVoicePitch() + { + return (this.random.nextFloat() - this.random.nextFloat()) * 0.1F + 1.0F; + } + + @Override + public boolean checkSpawnRules(final LevelAccessor worldIn, final MobSpawnType spawnReasonIn) + { + return true; + } + + @NotNull + @Override + public AbstractAdvancedPathNavigate getNavigation() + { + AbstractAdvancedPathNavigate navigator = super.getNavigation(); + navigator.getPathingOptions().withStartSwimCost(2.5D).withSwimCost(1.1D); + return navigator; + } + + @Override + public RaiderType getRaiderType() + { + return RaiderType.NORSEMAN; + } + + @Override + public double getSwimSpeedFactor() + { + return PIRATE_SWIM_BONUS; + } +} diff --git a/src/main/java/com/minecolonies/api/sounds/ModSoundEvents.java b/src/main/java/com/minecolonies/api/sounds/ModSoundEvents.java index 0cf314b93fe..6f52bf95772 100755 --- a/src/main/java/com/minecolonies/api/sounds/ModSoundEvents.java +++ b/src/main/java/com/minecolonies/api/sounds/ModSoundEvents.java @@ -11,6 +11,8 @@ import java.util.*; +import static com.minecolonies.core.generation.SoundsJson.createSoundJson; + /** * Registering of sound events for our colony. */ @@ -54,7 +56,6 @@ private ModSoundEvents() mainTypes.remove(ModJobs.placeHolder.getId()); mainTypes.add(new ResourceLocation(Constants.MOD_ID, "unemployed")); mainTypes.add(new ResourceLocation(Constants.MOD_ID, "visitor")); - mainTypes.add(new ResourceLocation(Constants.MOD_ID, "child")); for (final ResourceLocation job : mainTypes) { @@ -78,6 +79,23 @@ private ModSoundEvents() CITIZEN_SOUND_EVENTS.put(job.getPath(), map); } + final Map>> map = new HashMap<>(); + for (final EventType event : EventType.values()) + { + final List> individualSounds = new ArrayList<>(); + for (int i = 1; i <= 2; i++) + { + final SoundEvent maleSoundEvent = + ModSoundEvents.getSoundID(CITIZEN_SOUND_EVENT_PREFIX + "child.male" + i + "." + event.getId()); + final SoundEvent femaleSoundEvent = + ModSoundEvents.getSoundID(CITIZEN_SOUND_EVENT_PREFIX + "child.female" + i + "." + event.getId()); + + individualSounds.add(new Tuple<>(maleSoundEvent, femaleSoundEvent)); + individualSounds.add(new Tuple<>(maleSoundEvent, femaleSoundEvent)); + } + } + CITIZEN_SOUND_EVENTS.put("child", map); + SOUND_EVENTS.register(TavernSounds.tavernTheme.getLocation().getPath(), () -> TavernSounds.tavernTheme); for (final RaiderType raiderType : RaiderType.values()) diff --git a/src/main/java/com/minecolonies/api/util/DamageSourceKeys.java b/src/main/java/com/minecolonies/api/util/DamageSourceKeys.java index 09a10a831d0..18390707d33 100644 --- a/src/main/java/com/minecolonies/api/util/DamageSourceKeys.java +++ b/src/main/java/com/minecolonies/api/util/DamageSourceKeys.java @@ -40,4 +40,20 @@ public class DamageSourceKeys public static ResourceKey DROWNED_CHIEFPIRATE = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "drownedchiefpirate")); public static ResourceKey DROWNED_ARCHERPIRATE = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "drownedarcherpirate")); + public static ResourceKey CAMP_AMAZON = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campamazon")); + public static ResourceKey CAMP_AMAZONSPEARMAN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campamazonspearman")); + public static ResourceKey CAMP_AMAZONCHIEF = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campamazonchief")); + public static ResourceKey CAMP_MUMMY = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campmummy")); + public static ResourceKey CAMP_PHARAO = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "camppharao")); + public static ResourceKey CAMP_ARCHERMUMMY = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "camparchermummy")); + public static ResourceKey CAMP_NORSEMENCHIEF = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campnorsemenchief")); + public static ResourceKey CAMP_NORSEMENARCHER = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campnorsemenarcher")); + public static ResourceKey CAMP_SHIELDMAIDEN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campshieldmaiden")); + public static ResourceKey CAMP_BARBARIAN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campbarbarian")); + public static ResourceKey CAMP_CHIEFBARBARIAN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "ccamphiefbarbarian")); + public static ResourceKey CAMP_ARCHERBARBARIAN = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "camparcherbarbarian")); + public static ResourceKey CAMP_PIRATE = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "camppirate")); + public static ResourceKey CAMP_CHIEFPIRATE = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "campchiefpirate")); + public static ResourceKey CAMP_ARCHERPIRATE = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Constants.MOD_ID, "camparcherpirate")); + } diff --git a/src/main/java/com/minecolonies/apiimp/initializer/EntityInitializer.java b/src/main/java/com/minecolonies/apiimp/initializer/EntityInitializer.java index 373e54b1bea..99e50b802b9 100644 --- a/src/main/java/com/minecolonies/apiimp/initializer/EntityInitializer.java +++ b/src/main/java/com/minecolonies/apiimp/initializer/EntityInitializer.java @@ -4,26 +4,44 @@ import com.minecolonies.api.entity.ModEntities; import com.minecolonies.api.util.constant.Constants; import com.minecolonies.core.entity.citizen.EntityCitizen; -import com.minecolonies.core.entity.mobs.drownedpirates.EntityDrownedArcherPirate; -import com.minecolonies.core.entity.mobs.drownedpirates.EntityDrownedCaptainPirate; -import com.minecolonies.core.entity.mobs.drownedpirates.EntityDrownedPirate; +import com.minecolonies.core.entity.mobs.camp.amazons.EntityAmazonChief; +import com.minecolonies.core.entity.mobs.camp.amazons.EntityAmazonSpearman; +import com.minecolonies.core.entity.mobs.camp.amazons.EntityArcherAmazon; +import com.minecolonies.core.entity.mobs.camp.barbarians.EntityArcherBarbarian; +import com.minecolonies.core.entity.mobs.camp.barbarians.EntityBarbarian; +import com.minecolonies.core.entity.mobs.camp.barbarians.EntityChiefBarbarian; +import com.minecolonies.core.entity.mobs.camp.drownedpirates.EntityDrownedArcherPirate; +import com.minecolonies.core.entity.mobs.camp.drownedpirates.EntityDrownedCaptainPirate; +import com.minecolonies.core.entity.mobs.camp.drownedpirates.EntityDrownedPirate; +import com.minecolonies.core.entity.mobs.camp.egyptians.EntityArcherMummy; +import com.minecolonies.core.entity.mobs.camp.egyptians.EntityMummy; +import com.minecolonies.core.entity.mobs.camp.egyptians.EntityPharao; +import com.minecolonies.core.entity.mobs.camp.norsemen.EntityNorsemenArcher; +import com.minecolonies.core.entity.mobs.camp.norsemen.EntityNorsemenChief; +import com.minecolonies.core.entity.mobs.camp.norsemen.EntityShieldmaiden; +import com.minecolonies.core.entity.mobs.camp.pirates.EntityArcherPirate; +import com.minecolonies.core.entity.mobs.camp.pirates.EntityCaptainPirate; +import com.minecolonies.core.entity.mobs.camp.pirates.EntityPirate; +import com.minecolonies.core.entity.mobs.raider.drownedpirates.EntityDrownedArcherPirateRaider; +import com.minecolonies.core.entity.mobs.raider.drownedpirates.EntityDrownedCaptainPirateRaider; +import com.minecolonies.core.entity.mobs.raider.drownedpirates.EntityDrownedPirateRaider; import com.minecolonies.core.entity.visitor.VisitorCitizen; import com.minecolonies.core.entity.mobs.EntityMercenary; -import com.minecolonies.core.entity.mobs.amazons.EntityAmazonChief; -import com.minecolonies.core.entity.mobs.amazons.EntityAmazonSpearman; -import com.minecolonies.core.entity.mobs.amazons.EntityArcherAmazon; -import com.minecolonies.core.entity.mobs.barbarians.EntityArcherBarbarian; -import com.minecolonies.core.entity.mobs.barbarians.EntityBarbarian; -import com.minecolonies.core.entity.mobs.barbarians.EntityChiefBarbarian; -import com.minecolonies.core.entity.mobs.egyptians.EntityArcherMummy; -import com.minecolonies.core.entity.mobs.egyptians.EntityMummy; -import com.minecolonies.core.entity.mobs.egyptians.EntityPharao; -import com.minecolonies.core.entity.mobs.norsemen.EntityNorsemenArcher; -import com.minecolonies.core.entity.mobs.norsemen.EntityNorsemenChief; -import com.minecolonies.core.entity.mobs.norsemen.EntityShieldmaiden; -import com.minecolonies.core.entity.mobs.pirates.EntityArcherPirate; -import com.minecolonies.core.entity.mobs.pirates.EntityCaptainPirate; -import com.minecolonies.core.entity.mobs.pirates.EntityPirate; +import com.minecolonies.core.entity.mobs.raider.amazons.EntityAmazonChiefRaider; +import com.minecolonies.core.entity.mobs.raider.amazons.EntityAmazonSpearmanRaider; +import com.minecolonies.core.entity.mobs.raider.amazons.EntityArcherAmazonRaider; +import com.minecolonies.core.entity.mobs.raider.barbarians.EntityArcherBarbarianRaider; +import com.minecolonies.core.entity.mobs.raider.barbarians.EntityBarbarianRaider; +import com.minecolonies.core.entity.mobs.raider.barbarians.EntityChiefBarbarianRaider; +import com.minecolonies.core.entity.mobs.raider.egyptians.EntityArcherMummyRaider; +import com.minecolonies.core.entity.mobs.raider.egyptians.EntityMummyRaider; +import com.minecolonies.core.entity.mobs.raider.egyptians.EntityPharaoRaider; +import com.minecolonies.core.entity.mobs.raider.norsemen.EntityNorsemenArcherRaider; +import com.minecolonies.core.entity.mobs.raider.norsemen.EntityNorsemenChiefRaider; +import com.minecolonies.core.entity.mobs.raider.norsemen.EntityShieldmaidenRaider; +import com.minecolonies.core.entity.mobs.raider.pirates.EntityArcherPirateRaider; +import com.minecolonies.core.entity.mobs.raider.pirates.EntityCaptainPirateRaider; +import com.minecolonies.core.entity.mobs.raider.pirates.EntityPirateRaider; import com.minecolonies.core.entity.other.*; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.Entity; @@ -77,37 +95,37 @@ public static void setupEntities(RegisterEvent event) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.BARBARIAN = build(registry, "barbarian", - EntityType.Builder.of(EntityBarbarian::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityBarbarianRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.ARCHERBARBARIAN = build(registry, "archerbarbarian", - EntityType.Builder.of(EntityArcherBarbarian::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityArcherBarbarianRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.CHIEFBARBARIAN = build(registry, "chiefbarbarian", - EntityType.Builder.of(EntityChiefBarbarian::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityChiefBarbarianRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.PIRATE = build(registry, "pirate", - EntityType.Builder.of(EntityPirate::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityPirateRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.ARCHERPIRATE = build(registry, "archerpirate", - EntityType.Builder.of(EntityArcherPirate::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityArcherPirateRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.CHIEFPIRATE = build(registry, "chiefpirate", - EntityType.Builder.of(EntityCaptainPirate::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityCaptainPirateRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); @@ -125,37 +143,37 @@ public static void setupEntities(RegisterEvent event) .sized(0.98F, 0.7F)); ModEntities.MUMMY = build(registry, "mummy", - EntityType.Builder.of(EntityMummy::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityMummyRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.ARCHERMUMMY = build(registry, "archermummy", - EntityType.Builder.of(EntityArcherMummy::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityArcherMummyRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.PHARAO = build(registry, "pharao", - EntityType.Builder.of(EntityPharao::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityPharaoRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.AMAZON = build(registry, "amazon", - EntityType.Builder.of(EntityArcherAmazon::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityArcherAmazonRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.AMAZONSPEARMAN = build(registry, "amazonspearman", - EntityType.Builder.of(EntityAmazonSpearman::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityAmazonSpearmanRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.AMAZONCHIEF = build(registry, "amazonchief", - EntityType.Builder.of(EntityAmazonChief::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityAmazonChiefRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); @@ -182,19 +200,19 @@ public static void setupEntities(RegisterEvent event) .setShouldReceiveVelocityUpdates(true)); ModEntities.SHIELDMAIDEN = build(registry, "shieldmaiden", - EntityType.Builder.of(EntityShieldmaiden::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityShieldmaidenRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.NORSEMEN_ARCHER = build(registry, "norsemenarcher", - EntityType.Builder.of(EntityNorsemenArcher::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityNorsemenArcherRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.NORSEMEN_CHIEF = build(registry, "norsemenchief", - EntityType.Builder.of(EntityNorsemenChief::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityNorsemenChiefRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); @@ -207,22 +225,132 @@ public static void setupEntities(RegisterEvent event) .setShouldReceiveVelocityUpdates(true)); ModEntities.DROWNED_PIRATE = build(registry, "drownedpirate", - EntityType.Builder.of(EntityDrownedPirate::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityDrownedPirateRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.DROWNED_ARCHERPIRATE = build(registry, "drownedarcherpirate", - EntityType.Builder.of(EntityDrownedArcherPirate::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityDrownedArcherPirateRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); ModEntities.DROWNED_CHIEFPIRATE = build(registry, "drownedchiefpirate", - EntityType.Builder.of(EntityDrownedCaptainPirate::new, MobCategory.MONSTER) + EntityType.Builder.of(EntityDrownedCaptainPirateRaider::new, MobCategory.MONSTER) .setTrackingRange(ENTITY_TRACKING_RANGE) .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + // Camp Raiders + + ModEntities.CAMP_BARBARIAN = build(registry, "campbarbarian", + EntityType.Builder.of(EntityBarbarian::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_ARCHERBARBARIAN = build(registry, "camparcherbarbarian", + EntityType.Builder.of(EntityArcherBarbarian::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_CHIEFBARBARIAN = build(registry, "campchiefbarbarian", + EntityType.Builder.of(EntityChiefBarbarian::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_PIRATE = build(registry, "camppirate", + EntityType.Builder.of(EntityPirate::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_ARCHERPIRATE = build(registry, "camparcherpirate", + EntityType.Builder.of(EntityArcherPirate::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_CHIEFPIRATE = build(registry, "campchiefpirate", + EntityType.Builder.of(EntityCaptainPirate::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_AMAZON = build(registry, "campamazon", + EntityType.Builder.of(EntityArcherAmazon::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_AMAZONSPEARMAN = build(registry, "campamazonspearman", + EntityType.Builder.of(EntityAmazonSpearman::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_AMAZONCHIEF = build(registry, "campamazonchief", + EntityType.Builder.of(EntityAmazonChief::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_MUMMY = build(registry, "campmummy", + EntityType.Builder.of(EntityMummy::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_ARCHERMUMMY = build(registry, "camparchermummy", + EntityType.Builder.of(EntityArcherMummy::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_PHARAO = build(registry, "camppharao", + EntityType.Builder.of(EntityPharao::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_SHIELDMAIDEN = build(registry, "campshieldmaiden", + EntityType.Builder.of(EntityShieldmaiden::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_NORSEMEN_ARCHER = build(registry, "campnorsemenarcher", + EntityType.Builder.of(EntityNorsemenArcher::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_NORSEMEN_CHIEF = build(registry, "campnorsemenchief", + EntityType.Builder.of(EntityNorsemenChief::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_DROWNED_PIRATE = build(registry, "campdrownedpirate", + EntityType.Builder.of(EntityDrownedPirate::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_DROWNED_ARCHERPIRATE = build(registry, "campdrownedarcherpirate", + EntityType.Builder.of(EntityDrownedArcherPirate::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); + + ModEntities.CAMP_DROWNED_CHIEFPIRATE = build(registry, "campdrownedchiefpirate", + EntityType.Builder.of(EntityDrownedCaptainPirate::new, MobCategory.MONSTER) + .setTrackingRange(ENTITY_TRACKING_RANGE) + .setUpdateInterval(ENTITY_UPDATE_FREQUENCY) + .sized((float) CITIZEN_WIDTH, (float) CITIZEN_HEIGHT)); } } diff --git a/src/main/java/com/minecolonies/apiimp/initializer/ModItemsInitializer.java b/src/main/java/com/minecolonies/apiimp/initializer/ModItemsInitializer.java index bd3c64a992e..1cb0c4b678e 100755 --- a/src/main/java/com/minecolonies/apiimp/initializer/ModItemsInitializer.java +++ b/src/main/java/com/minecolonies/apiimp/initializer/ModItemsInitializer.java @@ -1,5 +1,6 @@ package com.minecolonies.apiimp.initializer; +import com.ldtteam.blockui.Color; import com.minecolonies.api.blocks.ModBlocks; import com.minecolonies.api.entity.ModEntities; import com.minecolonies.api.items.ModItems; @@ -31,8 +32,6 @@ public final class ModItemsInitializer private static final int SECONDARY_COLOR_BARBARIAN = 700; private static final int PRIMARY_COLOR_PIRATE = 7; private static final int SECONDARY_COLOR_PIRATE = 600; - private static final int PRIMARY_COLOR_MERC = 8; - private static final int SECONDARY_COLOR_MERC = 300; private static final int PRIMARY_COLOR_EG = 10; private static final int SECONDARY_COLOR_EG = 400; @@ -378,65 +377,82 @@ public static void init(final IForgeRegistry registry) registry.register(new ResourceLocation(Constants.MOD_ID, "large_milk_bottle"), ModItems.large_milk_bottle); registry.register(new ResourceLocation(Constants.MOD_ID, "large_soy_milk_bottle"), ModItems.large_soy_milk_bottle); - registry.register(new ResourceLocation(Constants.MOD_ID, "barbarianegg"), new ForgeSpawnEggItem(() -> ModEntities.BARBARIAN, - PRIMARY_COLOR_BARBARIAN, - SECONDARY_COLOR_BARBARIAN, - (new Item.Properties()))); - registry.register(new ResourceLocation(Constants.MOD_ID, "barbarcheregg"), new ForgeSpawnEggItem(() -> ModEntities.ARCHERBARBARIAN, - PRIMARY_COLOR_BARBARIAN, - SECONDARY_COLOR_BARBARIAN, - (new Item.Properties()))); - registry.register(new ResourceLocation(Constants.MOD_ID, "barbchiefegg"), new ForgeSpawnEggItem(() -> ModEntities.CHIEFBARBARIAN, - PRIMARY_COLOR_BARBARIAN, - SECONDARY_COLOR_BARBARIAN, - (new Item.Properties()))); - - registry.register(new ResourceLocation(Constants.MOD_ID, "pirateegg"), new ForgeSpawnEggItem(() -> ModEntities.PIRATE, - PRIMARY_COLOR_PIRATE, - SECONDARY_COLOR_PIRATE, - (new Item.Properties()))); - registry.register(new ResourceLocation(Constants.MOD_ID, "piratearcheregg"), new ForgeSpawnEggItem(() -> ModEntities.ARCHERPIRATE, - PRIMARY_COLOR_PIRATE, - SECONDARY_COLOR_PIRATE, - (new Item.Properties()))); - registry.register(new ResourceLocation(Constants.MOD_ID, "piratecaptainegg"), new ForgeSpawnEggItem(() -> ModEntities.CHIEFPIRATE, - PRIMARY_COLOR_PIRATE, - SECONDARY_COLOR_PIRATE, - (new Item.Properties()))); - - registry.register(new ResourceLocation(Constants.MOD_ID, "mummyegg"), new ForgeSpawnEggItem(() -> ModEntities.MUMMY, PRIMARY_COLOR_EG, SECONDARY_COLOR_EG, (new Item.Properties()))); - registry.register(new ResourceLocation(Constants.MOD_ID, "mummyarcheregg"), new ForgeSpawnEggItem(() -> ModEntities.ARCHERMUMMY, - PRIMARY_COLOR_EG, - SECONDARY_COLOR_EG, - (new Item.Properties()))); - registry.register(new ResourceLocation(Constants.MOD_ID, "pharaoegg"), new ForgeSpawnEggItem(() -> ModEntities.PHARAO, PRIMARY_COLOR_EG, SECONDARY_COLOR_EG, (new Item.Properties()))); - - registry.register(new ResourceLocation(Constants.MOD_ID, "shieldmaidenegg"), new ForgeSpawnEggItem(() -> ModEntities.SHIELDMAIDEN, - PRIMARY_COLOR_EG, - SECONDARY_COLOR_EG, - (new Item.Properties()))); - registry.register(new ResourceLocation(Constants.MOD_ID, "norsemenarcheregg"), new ForgeSpawnEggItem(() -> ModEntities.NORSEMEN_ARCHER, - PRIMARY_COLOR_EG, - SECONDARY_COLOR_EG, - (new Item.Properties()))); - registry.register(new ResourceLocation(Constants.MOD_ID, "norsemenchiefegg"), new ForgeSpawnEggItem(() -> ModEntities.NORSEMEN_CHIEF, - PRIMARY_COLOR_EG, - SECONDARY_COLOR_EG, - (new Item.Properties()))); - - registry.register(new ResourceLocation(Constants.MOD_ID, "amazonegg"), new ForgeSpawnEggItem(() -> ModEntities.AMAZON, PRIMARY_COLOR_EG, SECONDARY_COLOR_EG, (new Item.Properties()))); - registry.register(new ResourceLocation(Constants.MOD_ID, "amazonspearmanegg"), new ForgeSpawnEggItem(() -> ModEntities.AMAZONSPEARMAN, - PRIMARY_COLOR_EG, - SECONDARY_COLOR_EG, - new Item.Properties())); - registry.register(new ResourceLocation(Constants.MOD_ID, "amazonchiefegg"), new ForgeSpawnEggItem(() -> ModEntities.AMAZONCHIEF, - PRIMARY_COLOR_EG, - SECONDARY_COLOR_EG, - (new Item.Properties()))); - - registry.register(new ResourceLocation(Constants.MOD_ID, "mercegg"), new ForgeSpawnEggItem(() -> ModEntities.MERCENARY, - PRIMARY_COLOR_MERC, - SECONDARY_COLOR_MERC, - (new Item.Properties()))); + registry.register(new ResourceLocation(Constants.MOD_ID, "barbarianegg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_BARBARIAN, + Color.getByName("orange"), + Color.getByName("black"), + (new Item.Properties()))); + registry.register(new ResourceLocation(Constants.MOD_ID, "barbarcheregg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_ARCHERBARBARIAN, + Color.getByName("orange"), + Color.getByName("green"), + (new Item.Properties()))); + registry.register(new ResourceLocation(Constants.MOD_ID, "barbchiefegg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_CHIEFBARBARIAN, + Color.getByName("orange"), + Color.getByName("yellow"), + (new Item.Properties()))); + + registry.register(new ResourceLocation(Constants.MOD_ID, "pirateegg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_PIRATE, + Color.getByName("red"), + Color.getByName("white"), + (new Item.Properties()))); + registry.register(new ResourceLocation(Constants.MOD_ID, "piratearcheregg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_ARCHERPIRATE, + Color.getByName("red"), + Color.getByName("green"), + (new Item.Properties()))); + registry.register(new ResourceLocation(Constants.MOD_ID, "piratecaptainegg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_CHIEFPIRATE, + Color.getByName("red"), + Color.getByName("yellow"), + (new Item.Properties()))); + + registry.register(new ResourceLocation(Constants.MOD_ID, "mummyegg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_MUMMY, + Color.getByName("yellow"), + Color.getByName("white"), + (new Item.Properties()))); + registry.register(new ResourceLocation(Constants.MOD_ID, "mummyarcheregg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_ARCHERMUMMY, + Color.getByName("yellow"), + Color.getByName("green"), + (new Item.Properties()))); + registry.register(new ResourceLocation(Constants.MOD_ID, "pharaoegg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_PHARAO, + Color.getByName("yellow"), + Color.getByName("yellow"), + (new Item.Properties()))); + + registry.register(new ResourceLocation(Constants.MOD_ID, "shieldmaidenegg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_SHIELDMAIDEN, + Color.getByName("black"), + Color.getByName("white"), + (new Item.Properties()))); + registry.register(new ResourceLocation(Constants.MOD_ID, "norsemenarcheregg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_NORSEMEN_ARCHER, + Color.getByName("black"), + Color.getByName("green"), + (new Item.Properties()))); + registry.register(new ResourceLocation(Constants.MOD_ID, "norsemenchiefegg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_NORSEMEN_CHIEF, + Color.getByName("black"), + Color.getByName("yellow"), + (new Item.Properties()))); + + registry.register(new ResourceLocation(Constants.MOD_ID, "amazonegg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_AMAZON, + Color.getByName("green"), + Color.getByName("white"), + (new Item.Properties()))); + registry.register(new ResourceLocation(Constants.MOD_ID, "amazonspearmanegg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_AMAZONSPEARMAN, + Color.getByName("green"), + Color.getByName("green"), + new Item.Properties())); + registry.register(new ResourceLocation(Constants.MOD_ID, "amazonchiefegg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_AMAZONCHIEF, + Color.getByName("green"), + Color.getByName("yellow"), + (new Item.Properties()))); + + registry.register(new ResourceLocation(Constants.MOD_ID, "drownedpirateegg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_DROWNED_PIRATE, + Color.getByName("blue"), + Color.getByName("white"), + (new Item.Properties()))); + registry.register(new ResourceLocation(Constants.MOD_ID, "drownedpiratearcheregg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_DROWNED_ARCHERPIRATE, + Color.getByName("blue"), + Color.getByName("green"), + new Item.Properties())); + registry.register(new ResourceLocation(Constants.MOD_ID, "drownedpiratecaptainegg"), new ForgeSpawnEggItem(() -> ModEntities.CAMP_DROWNED_CHIEFPIRATE, + Color.getByName("blue"), + Color.getByName("yellow"), + (new Item.Properties()))); } } diff --git a/src/main/java/com/minecolonies/core/MineColonies.java b/src/main/java/com/minecolonies/core/MineColonies.java index c599e54483d..231e4697160 100755 --- a/src/main/java/com/minecolonies/core/MineColonies.java +++ b/src/main/java/com/minecolonies/core/MineColonies.java @@ -12,7 +12,7 @@ import com.minecolonies.api.enchants.ModEnchants; import com.minecolonies.api.entity.ModEntities; 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.RaiderMobUtils; import com.minecolonies.api.items.ModBannerPatterns; import com.minecolonies.api.items.ModTags; @@ -179,24 +179,43 @@ public static void createEntityAttribute(final EntityAttributeCreationEvent even event.put(ModEntities.CITIZEN, AbstractEntityCitizen.getDefaultAttributes().build()); event.put(ModEntities.VISITOR, AbstractEntityCitizen.getDefaultAttributes().build()); event.put(ModEntities.MERCENARY, EntityMercenary.getDefaultAttributes().build()); - event.put(ModEntities.BARBARIAN, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.ARCHERBARBARIAN, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.CHIEFBARBARIAN, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.PHARAO, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.MUMMY, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.ARCHERMUMMY, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.PIRATE, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.ARCHERPIRATE, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.CHIEFPIRATE, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.AMAZON, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.AMAZONSPEARMAN, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.AMAZONCHIEF, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.NORSEMEN_ARCHER, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.NORSEMEN_CHIEF, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.SHIELDMAIDEN, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.DROWNED_PIRATE, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.DROWNED_ARCHERPIRATE, AbstractEntityRaiderMob.getDefaultAttributes().build()); - event.put(ModEntities.DROWNED_CHIEFPIRATE, AbstractEntityRaiderMob.getDefaultAttributes().build()); + event.put(ModEntities.BARBARIAN, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.ARCHERBARBARIAN, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CHIEFBARBARIAN, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.PHARAO, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.MUMMY, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.ARCHERMUMMY, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.PIRATE, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.ARCHERPIRATE, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CHIEFPIRATE, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.AMAZON, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.AMAZONSPEARMAN, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.AMAZONCHIEF, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.NORSEMEN_ARCHER, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.NORSEMEN_CHIEF, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.SHIELDMAIDEN, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.DROWNED_PIRATE, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.DROWNED_ARCHERPIRATE, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.DROWNED_CHIEFPIRATE, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + + event.put(ModEntities.CAMP_BARBARIAN, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_ARCHERBARBARIAN, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_CHIEFBARBARIAN, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_PIRATE, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_ARCHERPIRATE, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_CHIEFPIRATE, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_PHARAO, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_MUMMY, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_ARCHERMUMMY, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_AMAZON, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_AMAZONSPEARMAN, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_AMAZONCHIEF, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_NORSEMEN_ARCHER, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_NORSEMEN_CHIEF, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_SHIELDMAIDEN, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_DROWNED_PIRATE, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_DROWNED_ARCHERPIRATE, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); + event.put(ModEntities.CAMP_DROWNED_CHIEFPIRATE, AbstractEntityMinecoloniesRaider.getDefaultAttributes().build()); } @SubscribeEvent diff --git a/src/main/java/com/minecolonies/core/client/model/raiders/ModelAmazon.java b/src/main/java/com/minecolonies/core/client/model/raiders/ModelAmazon.java index 7909f354504..4bb8f5f9cb7 100755 --- a/src/main/java/com/minecolonies/core/client/model/raiders/ModelAmazon.java +++ b/src/main/java/com/minecolonies/core/client/model/raiders/ModelAmazon.java @@ -1,7 +1,7 @@ package com.minecolonies.core.client.model.raiders; import com.minecolonies.api.client.render.modeltype.AmazonModel; -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 net.minecraft.client.model.geom.PartPose; @@ -10,7 +10,7 @@ /** * General amazon model. */ -public class ModelAmazon extends AmazonModel +public class ModelAmazon extends AmazonModel { /** * Create an instance of it. diff --git a/src/main/java/com/minecolonies/core/client/model/raiders/ModelAmazonChief.java b/src/main/java/com/minecolonies/core/client/model/raiders/ModelAmazonChief.java index ee70e6ad363..950c4d554ef 100755 --- a/src/main/java/com/minecolonies/core/client/model/raiders/ModelAmazonChief.java +++ b/src/main/java/com/minecolonies/core/client/model/raiders/ModelAmazonChief.java @@ -1,7 +1,7 @@ package com.minecolonies.core.client.model.raiders; import com.minecolonies.api.client.render.modeltype.AmazonModel; -import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazon; +import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazonRaider; import net.minecraft.client.model.HumanoidModel; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; @@ -10,7 +10,7 @@ /** * Amazon Chief model. */ -public class ModelAmazonChief extends AmazonModel +public class ModelAmazonChief extends AmazonModel { /** * Create an instance of it. diff --git a/src/main/java/com/minecolonies/core/client/model/raiders/ModelAmazonSpearman.java b/src/main/java/com/minecolonies/core/client/model/raiders/ModelAmazonSpearman.java index c1b8cdf4890..4e592ad1012 100644 --- a/src/main/java/com/minecolonies/core/client/model/raiders/ModelAmazonSpearman.java +++ b/src/main/java/com/minecolonies/core/client/model/raiders/ModelAmazonSpearman.java @@ -1,7 +1,7 @@ package com.minecolonies.core.client.model.raiders; import com.minecolonies.api.client.render.modeltype.AmazonModel; -import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazon; +import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazonRaider; import net.minecraft.client.model.HumanoidModel; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; @@ -10,7 +10,7 @@ /** * General amazon model. */ -public class ModelAmazonSpearman extends AmazonModel +public class ModelAmazonSpearman extends AmazonModel { /** * Create an instance of it. diff --git a/src/main/java/com/minecolonies/core/client/model/raiders/ModelArcherMummy.java b/src/main/java/com/minecolonies/core/client/model/raiders/ModelArcherMummy.java index c7009d9e0f2..ca82bc3af44 100755 --- a/src/main/java/com/minecolonies/core/client/model/raiders/ModelArcherMummy.java +++ b/src/main/java/com/minecolonies/core/client/model/raiders/ModelArcherMummy.java @@ -1,7 +1,8 @@ package com.minecolonies.core.client.model.raiders; import com.minecolonies.api.client.render.modeltype.EgyptianModel; -import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptian; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; +import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptianRaider; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; @@ -11,7 +12,7 @@ /** * Archer mummy model. Created using Tabula 7.0.0 */ -public class ModelArcherMummy extends EgyptianModel +public class ModelArcherMummy extends EgyptianModel { private ModelPart stripRightA; private ModelPart stripRightB; @@ -106,7 +107,7 @@ public void setRotateAngle(ModelPart modelRenderer, float x, float y, float z) } @Override - public void setupAnim(AbstractEntityEgyptian entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) + public void setupAnim(AbstractEntityMinecoloniesMonster entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { super.setupAnim(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch); float f = 0.05F * Mth.sin((float) Math.PI * ageInTicks / 30.0F) % 2.0F; diff --git a/src/main/java/com/minecolonies/core/client/model/raiders/ModelMummy.java b/src/main/java/com/minecolonies/core/client/model/raiders/ModelMummy.java index 52023780928..d492038db5e 100755 --- a/src/main/java/com/minecolonies/core/client/model/raiders/ModelMummy.java +++ b/src/main/java/com/minecolonies/core/client/model/raiders/ModelMummy.java @@ -1,7 +1,7 @@ package com.minecolonies.core.client.model.raiders; import com.minecolonies.api.client.render.modeltype.EgyptianModel; -import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptian; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; @@ -11,7 +11,7 @@ /** * Create a mummy model. Created using Tabula 7.0.0 */ -public class ModelMummy extends EgyptianModel +public class ModelMummy extends EgyptianModel { private ModelPart stripRightA; private ModelPart stripRightB; @@ -106,7 +106,7 @@ public void setRotateAngle(ModelPart modelRenderer, float x, float y, float z) } @Override - public void setupAnim(AbstractEntityEgyptian entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) + public void setupAnim(AbstractEntityMinecoloniesMonster entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { super.setupAnim(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch); float f = 0.05F * Mth.sin((float) Math.PI * ageInTicks / 30.0F) % 2.0F; diff --git a/src/main/java/com/minecolonies/core/client/model/raiders/ModelPharaoh.java b/src/main/java/com/minecolonies/core/client/model/raiders/ModelPharaoh.java index 74f8d20130a..5d922b43d0c 100755 --- a/src/main/java/com/minecolonies/core/client/model/raiders/ModelPharaoh.java +++ b/src/main/java/com/minecolonies/core/client/model/raiders/ModelPharaoh.java @@ -1,7 +1,8 @@ package com.minecolonies.core.client.model.raiders; import com.minecolonies.api.client.render.modeltype.EgyptianModel; -import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptian; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; +import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptianRaider; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; @@ -11,7 +12,7 @@ /** * ModelPharaohMummy. Created using Tabula 7.0.0 */ -public class ModelPharaoh extends EgyptianModel +public class ModelPharaoh extends EgyptianModel { private ModelPart bodyGoldenStrip; private ModelPart jaw; @@ -44,13 +45,11 @@ public static LayerDefinition createMesh() PartDefinition bodyDefinition = partDefinition.addOrReplaceChild("body", CubeListBuilder.create() - .texOffs(0, 16).addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F).mirror() + .texOffs(0, 16).addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, new CubeDeformation(0.0F)).mirror() .texOffs(44, 0).addBox(-5.5F, -0.2F, -2.5F, 11.0F, 5.0F, 5.0F, new CubeDeformation( 0.15F)).mirror() .texOffs(0, 32).addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, new CubeDeformation( 0.3F)).mirror() - .texOffs(52, 11).addBox(-4.5F, 8.5F, -2.5F, 9.0F, 4.0F, 5.0F).mirror() - .texOffs(0, 0).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 3.0F, 1.0F, new CubeDeformation( -0.3F)).mirror() - .texOffs(38, 12).addBox(-1.5F, 0.0F, 0.0F, 3.0F, 8.0F, 0.0F).mirror() - , PartPose.offset(0.0F, 10.0F, -2.6F)); + .texOffs(52, 11).addBox(-4.5F, 8.5F, -2.5F, 9.0F, 4.0F, 5.0F, new CubeDeformation(0.0F)).mirror() + , PartPose.offset(0.0F, 0.0F, 0.0F)); PartDefinition bodyJewelDefinition = bodyDefinition.addOrReplaceChild("bodyJewel", CubeListBuilder.create() @@ -84,16 +83,7 @@ public static LayerDefinition createMesh() .texOffs(0, 14).addBox(-2.5F, -2.0F, -3.5F, 5.0F, 1.0F, 0.0F).mirror() .texOffs(10, 10).addBox(-2.5F, -2.0F, -3.5F, 0.0F, 1.0F, 4.0F).mirror() .texOffs(10, 10).addBox(2.5F, -2.0F, -3.5F, 0.0F, 1.0F, 4.0F).mirror() - .texOffs(0, 51).addBox(-5.15F, 0.13F, 0.19F, 5.0F, 4.0F, 2.0F, new CubeDeformation( 0.13F)) - .texOffs(14, 51).addBox(0.0F, 0.0F, 0.19F, 5.0F, 6.0F, 2.0F, new CubeDeformation( 0.14F)) - .texOffs(0, 57).addBox(0.0F, -1.0F, -4.0F, 3.0F, 1.0F, 4.0F) - .texOffs(0, 51).addBox(0.15F, 0.13F, 0.19F, 5.0F, 4.0F, 2.0F, new CubeDeformation( 0.13F)).mirror() - .texOffs(14, 51).addBox(-5.0F, 0.0F, 0.19F, 5.0F, 6.0F, 2.0F, new CubeDeformation( 0.14F)).mirror() - .texOffs(0, 57).addBox(-3.0F, -1.0F, -4.0F, 3.0F, 1.0F, 4.0F).mirror() - .texOffs(28, 51).addBox(-3.0F, 0.0F, 0.0F, 3.0F, 6.0F, 2.0F, new CubeDeformation( -0.2F)).mirror() - .texOffs(76, 18).addBox(-4.5F, 0.0F, 0.0F, 9.0F, 4.0F, 8.0F, new CubeDeformation( 0.09F)).mirror() - .texOffs(18, 49).addBox(-4.5F, 0.15F, 0.19F, 9.0F, 0.0F, 2.0F, new CubeDeformation( 0.13F)).mirror() - , PartPose.offset(0.0F, -11.4F, 0.85F)); + , PartPose.offset(0.0F, 0.0F, -1.0F)); PartDefinition snakeBodyDefinition = headDefinition.addOrReplaceChild("snakeBody", CubeListBuilder.create() @@ -167,7 +157,7 @@ private static float sinPi(float f) } @Override - public void setupAnim(AbstractEntityEgyptian entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) + public void setupAnim(AbstractEntityMinecoloniesMonster entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { super.setupAnim(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch); this.bodyGoldenStrip.xRot = -Math.max(this.rightLeg.xRot, this.leftLeg.xRot); diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/amazon/AbstractRendererAmazon.java b/src/main/java/com/minecolonies/core/client/render/mobs/amazon/AbstractRendererAmazon.java index aa71b94ed4a..1e44d31e9af 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/amazon/AbstractRendererAmazon.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/amazon/AbstractRendererAmazon.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.amazon; -import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazon; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.render.RenderUtils; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.model.HumanoidModel; @@ -15,7 +15,7 @@ /** * Abstract for rendering amazons. */ -public abstract class AbstractRendererAmazon> extends HumanoidMobRenderer +public abstract class AbstractRendererAmazon> extends HumanoidMobRenderer { public AbstractRendererAmazon(final EntityRendererProvider.Context context, final M modelBipedIn, final float shadowSize) { diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/amazon/RendererAmazon.java b/src/main/java/com/minecolonies/core/client/render/mobs/amazon/RendererAmazon.java index eeaab40fdba..58c87407408 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/amazon/RendererAmazon.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/amazon/RendererAmazon.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.amazon; -import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazon; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.model.raiders.ModelAmazon; import com.minecolonies.core.event.ClientRegistryHandler; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -10,7 +10,7 @@ /** * Renderer used for archer amazons. */ -public class RendererAmazon extends AbstractRendererAmazon +public class RendererAmazon extends AbstractRendererAmazon { /** * Texture of the entity. @@ -29,7 +29,7 @@ public RendererAmazon(final EntityRendererProvider.Context context) @NotNull @Override - public ResourceLocation getTextureLocation(@NotNull final AbstractEntityAmazon entity) + public ResourceLocation getTextureLocation(@NotNull final AbstractEntityMinecoloniesMonster entity) { return TEXTURE; } diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/amazon/RendererAmazonSpearman.java b/src/main/java/com/minecolonies/core/client/render/mobs/amazon/RendererAmazonSpearman.java index cee95f61169..6f4e5c345b9 100644 --- a/src/main/java/com/minecolonies/core/client/render/mobs/amazon/RendererAmazonSpearman.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/amazon/RendererAmazonSpearman.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.amazon; -import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazon; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.model.raiders.ModelAmazonSpearman; import com.minecolonies.core.event.ClientRegistryHandler; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -10,7 +10,7 @@ /** * Renderer used for spearman amazons. */ -public class RendererAmazonSpearman extends AbstractRendererAmazon +public class RendererAmazonSpearman extends AbstractRendererAmazon { /** * Texture of the entity. @@ -29,7 +29,7 @@ public RendererAmazonSpearman(final EntityRendererProvider.Context context) @NotNull @Override - public ResourceLocation getTextureLocation(@NotNull final AbstractEntityAmazon entity) + public ResourceLocation getTextureLocation(@NotNull final AbstractEntityMinecoloniesMonster entity) { return TEXTURE; } diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/amazon/RendererChiefAmazon.java b/src/main/java/com/minecolonies/core/client/render/mobs/amazon/RendererChiefAmazon.java index a2431bf4d91..e4aaf6117a7 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/amazon/RendererChiefAmazon.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/amazon/RendererChiefAmazon.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.amazon; -import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazon; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.model.raiders.ModelAmazonChief; import com.minecolonies.core.event.ClientRegistryHandler; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -10,7 +10,7 @@ /** * Renderer used for Chief amazons. */ -public class RendererChiefAmazon extends AbstractRendererAmazon +public class RendererChiefAmazon extends AbstractRendererAmazon { /** * Texture of the entity. @@ -29,7 +29,7 @@ public RendererChiefAmazon(final EntityRendererProvider.Context context) @NotNull @Override - public ResourceLocation getTextureLocation(final AbstractEntityAmazon entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { return TEXTURE; } diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/barbarians/AbstractRendererBarbarian.java b/src/main/java/com/minecolonies/core/client/render/mobs/barbarians/AbstractRendererBarbarian.java index 56f21712376..0e3c33bf46c 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/barbarians/AbstractRendererBarbarian.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/barbarians/AbstractRendererBarbarian.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.barbarians; -import com.minecolonies.api.entity.mobs.barbarians.AbstractEntityBarbarian; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.render.RenderUtils; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.model.HumanoidModel; @@ -15,7 +15,7 @@ /** * Abstract for rendering Barbarians. */ -public abstract class AbstractRendererBarbarian> extends HumanoidMobRenderer +public abstract class AbstractRendererBarbarian> extends HumanoidMobRenderer { public AbstractRendererBarbarian(final EntityRendererProvider.Context context, final M modelBipedIn, final float shadowSize) { diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/barbarians/RendererBarbarian.java b/src/main/java/com/minecolonies/core/client/render/mobs/barbarians/RendererBarbarian.java index 2139a5d4034..95c1e247db1 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/barbarians/RendererBarbarian.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/barbarians/RendererBarbarian.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.barbarians; -import com.minecolonies.api.entity.mobs.barbarians.AbstractEntityBarbarian; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.model.HumanoidModel; @@ -9,7 +9,7 @@ /** * Renderer used for Barbarians And Archer Barbarians. */ -public class RendererBarbarian extends AbstractRendererBarbarian> +public class RendererBarbarian extends AbstractRendererBarbarian> { /** * Texture of the entity. @@ -28,7 +28,7 @@ public RendererBarbarian(final EntityRendererProvider.Context context) @Override - public ResourceLocation getTextureLocation(final AbstractEntityBarbarian entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { return TEXTURE; } diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/barbarians/RendererChiefBarbarian.java b/src/main/java/com/minecolonies/core/client/render/mobs/barbarians/RendererChiefBarbarian.java index 4bfca73b193..1fc719efb99 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/barbarians/RendererChiefBarbarian.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/barbarians/RendererChiefBarbarian.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.barbarians; -import com.minecolonies.api.entity.mobs.barbarians.AbstractEntityBarbarian; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.model.HumanoidModel; @@ -9,7 +9,7 @@ /** * Renderer used for Chief Barbarians. */ -public class RendererChiefBarbarian extends AbstractRendererBarbarian> +public class RendererChiefBarbarian extends AbstractRendererBarbarian> { /** * Texture of the entity. @@ -27,7 +27,7 @@ public RendererChiefBarbarian(final EntityRendererProvider.Context context) } @Override - public ResourceLocation getTextureLocation(final AbstractEntityBarbarian entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { return TEXTURE; } diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/AbstractRendererDrownedPirate.java b/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/AbstractRendererDrownedPirate.java index 3f33c11f369..9bf227a5f6c 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/AbstractRendererDrownedPirate.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/AbstractRendererDrownedPirate.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.drownedpirates; -import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirate; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.render.RenderUtils; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.model.HumanoidModel; @@ -15,7 +15,7 @@ /** * Abstract for rendering Pirates. */ -public abstract class AbstractRendererDrownedPirate> extends HumanoidMobRenderer +public abstract class AbstractRendererDrownedPirate> extends HumanoidMobRenderer { public AbstractRendererDrownedPirate(final EntityRendererProvider.Context context, final M modelBipedIn, final float shadowSize) { diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/RendererDrownedArcherPirate.java b/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/RendererDrownedArcherPirate.java index f71a4df5b95..52c209d69f1 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/RendererDrownedArcherPirate.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/RendererDrownedArcherPirate.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.drownedpirates; -import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirate; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import net.minecraft.client.model.HumanoidModel; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -10,7 +10,7 @@ /** * Renderer used for Barbarians And Archer Barbarians. */ -public class RendererDrownedArcherPirate extends AbstractRendererDrownedPirate> +public class RendererDrownedArcherPirate extends AbstractRendererDrownedPirate> { /** * Texture of the entity. @@ -32,7 +32,7 @@ public RendererDrownedArcherPirate(final EntityRendererProvider.Context context) @NotNull @Override - public ResourceLocation getTextureLocation(final AbstractDrownedEntityPirate entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { switch (entity.getTextureId()) { diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/RendererDrownedChiefPirate.java b/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/RendererDrownedChiefPirate.java index ea9a8665750..4df36cbed49 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/RendererDrownedChiefPirate.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/RendererDrownedChiefPirate.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.drownedpirates; -import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirate; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import net.minecraft.client.model.HumanoidModel; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -10,7 +10,7 @@ /** * Renderer used for Chief Barbarians. */ -public class RendererDrownedChiefPirate extends AbstractRendererDrownedPirate> +public class RendererDrownedChiefPirate extends AbstractRendererDrownedPirate> { /** * Texture of the entity. @@ -30,7 +30,7 @@ public RendererDrownedChiefPirate(final EntityRendererProvider.Context context) @NotNull @Override - public ResourceLocation getTextureLocation(final AbstractDrownedEntityPirate entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { return TEXTURE1; } diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/RendererDrownedPirate.java b/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/RendererDrownedPirate.java index 2b61c0934c1..428d3ebd127 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/RendererDrownedPirate.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/drownedpirates/RendererDrownedPirate.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.drownedpirates; -import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirate; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import net.minecraft.client.model.HumanoidModel; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -10,7 +10,7 @@ /** * Renderer used for Barbarians And Archer Barbarians. */ -public class RendererDrownedPirate extends AbstractRendererDrownedPirate> +public class RendererDrownedPirate extends AbstractRendererDrownedPirate> { /** * Texture of the entity. @@ -32,7 +32,7 @@ public RendererDrownedPirate(final EntityRendererProvider.Context context) @NotNull @Override - public ResourceLocation getTextureLocation(final AbstractDrownedEntityPirate entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { switch (entity.getTextureId()) { diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/AbstractRendererEgyptian.java b/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/AbstractRendererEgyptian.java index 2887b1c82ae..eb1a0bc1385 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/AbstractRendererEgyptian.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/AbstractRendererEgyptian.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.egyptians; -import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptian; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.render.RenderUtils; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.model.HumanoidModel; @@ -15,7 +15,7 @@ /** * Abstract for rendering Pirates. */ -public abstract class AbstractRendererEgyptian> extends HumanoidMobRenderer +public abstract class AbstractRendererEgyptian> extends HumanoidMobRenderer { public AbstractRendererEgyptian(final EntityRendererProvider.Context context, final M modelBipedIn, final float shadowSize) { diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/RendererArcherMummy.java b/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/RendererArcherMummy.java index 8617e7d4ba7..aef94bd7999 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/RendererArcherMummy.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/RendererArcherMummy.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.egyptians; -import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptian; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.model.raiders.ModelArcherMummy; import com.minecolonies.core.event.ClientRegistryHandler; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -9,7 +9,7 @@ /** * Renderer used for archer mummy. */ -public class RendererArcherMummy extends AbstractRendererEgyptian +public class RendererArcherMummy extends AbstractRendererEgyptian { /** * Texture of the entity. @@ -27,7 +27,7 @@ public RendererArcherMummy(final EntityRendererProvider.Context context) } @Override - public ResourceLocation getTextureLocation(final AbstractEntityEgyptian entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { return TEXTURE; } diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/RendererMummy.java b/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/RendererMummy.java index f9723b43ca1..71ddf37108a 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/RendererMummy.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/RendererMummy.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.egyptians; -import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptian; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.model.raiders.ModelMummy; import com.minecolonies.core.event.ClientRegistryHandler; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -9,7 +9,7 @@ /** * Renderer used for mummies. */ -public class RendererMummy extends AbstractRendererEgyptian +public class RendererMummy extends AbstractRendererEgyptian { /** * Texture of the entity. @@ -27,7 +27,7 @@ public RendererMummy(final EntityRendererProvider.Context context) } @Override - public ResourceLocation getTextureLocation(final AbstractEntityEgyptian entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { return TEXTURE; } diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/RendererPharao.java b/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/RendererPharao.java index d62010dad9f..fb99981bc43 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/RendererPharao.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/egyptians/RendererPharao.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.egyptians; -import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptian; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.model.raiders.ModelPharaoh; import com.minecolonies.core.event.ClientRegistryHandler; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -9,7 +9,7 @@ /** * Renderer used for the pharao. */ -public class RendererPharao extends AbstractRendererEgyptian +public class RendererPharao extends AbstractRendererEgyptian { /** * Texture of the entity. @@ -27,7 +27,7 @@ public RendererPharao(final EntityRendererProvider.Context context) } @Override - public ResourceLocation getTextureLocation(final AbstractEntityEgyptian entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { return TEXTURE; } diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/AbstractRendererNorsemen.java b/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/AbstractRendererNorsemen.java index 4512f91b4e4..b0650a36fe6 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/AbstractRendererNorsemen.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/AbstractRendererNorsemen.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.norsemen; -import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemen; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.render.RenderUtils; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.model.HumanoidModel; @@ -15,7 +15,7 @@ /** * Abstract for rendering amazons. */ -public abstract class AbstractRendererNorsemen> extends HumanoidMobRenderer +public abstract class AbstractRendererNorsemen> extends HumanoidMobRenderer { public AbstractRendererNorsemen(final EntityRendererProvider.Context context, final M modelBipedIn, final float shadowSize) { diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/RendererArcherNorsemen.java b/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/RendererArcherNorsemen.java index e84e724d72d..0b54ce5b7d0 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/RendererArcherNorsemen.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/RendererArcherNorsemen.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.norsemen; -import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemen; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.model.raiders.ModelArcherNorsemen; import com.minecolonies.core.event.ClientRegistryHandler; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -10,7 +10,7 @@ /** * Renderer used for archer amazons. */ -public class RendererArcherNorsemen extends AbstractRendererNorsemen +public class RendererArcherNorsemen extends AbstractRendererNorsemen { /** * Texture of the entity. @@ -30,7 +30,7 @@ public RendererArcherNorsemen(final EntityRendererProvider.Context context) @NotNull @Override - public ResourceLocation getTextureLocation(final AbstractEntityNorsemen entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { if (entity.getTextureId() == 1) { diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/RendererChiefNorsemen.java b/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/RendererChiefNorsemen.java index 2e4f235e732..4a917fa25c3 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/RendererChiefNorsemen.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/RendererChiefNorsemen.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.norsemen; -import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemen; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.model.raiders.ModelChiefNorsemen; import com.minecolonies.core.event.ClientRegistryHandler; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -10,7 +10,7 @@ /** * Renderer used for Chief norsemen. */ -public class RendererChiefNorsemen extends AbstractRendererNorsemen +public class RendererChiefNorsemen extends AbstractRendererNorsemen { /** * Texture of the entity. @@ -29,7 +29,7 @@ public RendererChiefNorsemen(final EntityRendererProvider.Context context) @NotNull @Override - public ResourceLocation getTextureLocation(final AbstractEntityNorsemen entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { return TEXTURE; } diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/RendererShieldmaidenNorsemen.java b/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/RendererShieldmaidenNorsemen.java index e2e903bac3f..fb5dc4b8085 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/RendererShieldmaidenNorsemen.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/norsemen/RendererShieldmaidenNorsemen.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.norsemen; -import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemen; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.model.raiders.ModelShieldmaiden; import com.minecolonies.core.event.ClientRegistryHandler; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -10,7 +10,7 @@ /** * Renderer used for the shieldmaiden. */ -public class RendererShieldmaidenNorsemen extends AbstractRendererNorsemen +public class RendererShieldmaidenNorsemen extends AbstractRendererNorsemen { /** * Texture of the entity. @@ -30,7 +30,7 @@ public RendererShieldmaidenNorsemen(final EntityRendererProvider.Context context @NotNull @Override - public ResourceLocation getTextureLocation(final AbstractEntityNorsemen entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { if (entity.getTextureId() == 1) { diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/pirates/AbstractRendererPirate.java b/src/main/java/com/minecolonies/core/client/render/mobs/pirates/AbstractRendererPirate.java index 50fba0dba8d..adcdf0a0ff5 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/pirates/AbstractRendererPirate.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/pirates/AbstractRendererPirate.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.pirates; -import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirate; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.core.client.render.RenderUtils; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.model.HumanoidModel; @@ -15,7 +15,7 @@ /** * Abstract for rendering Pirates. */ -public abstract class AbstractRendererPirate> extends HumanoidMobRenderer +public abstract class AbstractRendererPirate> extends HumanoidMobRenderer { public AbstractRendererPirate(final EntityRendererProvider.Context context, final M modelBipedIn, final float shadowSize) { diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/pirates/RendererArcherPirate.java b/src/main/java/com/minecolonies/core/client/render/mobs/pirates/RendererArcherPirate.java index 66f905eb7c1..bb3fc807ccd 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/pirates/RendererArcherPirate.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/pirates/RendererArcherPirate.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.pirates; -import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirate; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.model.HumanoidModel; @@ -10,7 +10,7 @@ /** * Renderer used for Barbarians And Archer Barbarians. */ -public class RendererArcherPirate extends AbstractRendererPirate> +public class RendererArcherPirate extends AbstractRendererPirate> { /** * Texture of the entity. @@ -32,7 +32,7 @@ public RendererArcherPirate(final EntityRendererProvider.Context context) @NotNull @Override - public ResourceLocation getTextureLocation(final AbstractEntityPirate entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { switch (entity.getTextureId()) { diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/pirates/RendererChiefPirate.java b/src/main/java/com/minecolonies/core/client/render/mobs/pirates/RendererChiefPirate.java index ed5ece88bdf..997fa4385f1 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/pirates/RendererChiefPirate.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/pirates/RendererChiefPirate.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.pirates; -import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirate; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.model.HumanoidModel; @@ -10,7 +10,7 @@ /** * Renderer used for Chief Barbarians. */ -public class RendererChiefPirate extends AbstractRendererPirate> +public class RendererChiefPirate extends AbstractRendererPirate> { /** * Texture of the entity. @@ -32,7 +32,7 @@ public RendererChiefPirate(final EntityRendererProvider.Context context) @NotNull @Override - public ResourceLocation getTextureLocation(final AbstractEntityPirate entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { switch (entity.getTextureId()) { diff --git a/src/main/java/com/minecolonies/core/client/render/mobs/pirates/RendererPirate.java b/src/main/java/com/minecolonies/core/client/render/mobs/pirates/RendererPirate.java index 7e3ccb5bdae..67fa6c8ceb7 100755 --- a/src/main/java/com/minecolonies/core/client/render/mobs/pirates/RendererPirate.java +++ b/src/main/java/com/minecolonies/core/client/render/mobs/pirates/RendererPirate.java @@ -1,6 +1,6 @@ package com.minecolonies.core.client.render.mobs.pirates; -import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirate; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.model.HumanoidModel; @@ -10,7 +10,7 @@ /** * Renderer used for Barbarians And Archer Barbarians. */ -public class RendererPirate extends AbstractRendererPirate> +public class RendererPirate extends AbstractRendererPirate> { /** * Texture of the entity. @@ -32,7 +32,7 @@ public RendererPirate(final EntityRendererProvider.Context context) @NotNull @Override - public ResourceLocation getTextureLocation(final AbstractEntityPirate entity) + public ResourceLocation getTextureLocation(final AbstractEntityMinecoloniesMonster entity) { switch (entity.getTextureId()) { diff --git a/src/main/java/com/minecolonies/core/colony/events/raid/AbstractShipRaidEvent.java b/src/main/java/com/minecolonies/core/colony/events/raid/AbstractShipRaidEvent.java index 4484b84527c..8bee6289033 100644 --- a/src/main/java/com/minecolonies/core/colony/events/raid/AbstractShipRaidEvent.java +++ b/src/main/java/com/minecolonies/core/colony/events/raid/AbstractShipRaidEvent.java @@ -7,7 +7,7 @@ import com.minecolonies.api.colony.colonyEvents.EventStatus; import com.minecolonies.api.colony.colonyEvents.IColonyRaidEvent; import com.minecolonies.api.colony.colonyEvents.IColonyStructureSpawnEvent; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.api.entity.mobs.RaiderMobUtils; import com.minecolonies.api.util.BlockPosUtil; import com.minecolonies.api.util.MessageUtils; @@ -382,7 +382,7 @@ public void onEntityDeath(final LivingEntity entity) @Override public void registerEntity(final Entity entity) { - if (!(entity instanceof AbstractEntityRaiderMob) || !entity.isAlive() || status != EventStatus.PROGRESSING) + if (!(entity instanceof AbstractEntityMinecoloniesRaider) || !entity.isAlive() || status != EventStatus.PROGRESSING) { entity.remove(Entity.RemovalReason.DISCARDED); return; diff --git a/src/main/java/com/minecolonies/core/colony/events/raid/HordeRaidEvent.java b/src/main/java/com/minecolonies/core/colony/events/raid/HordeRaidEvent.java index 8e6aae93b66..5af99f5c8d7 100644 --- a/src/main/java/com/minecolonies/core/colony/events/raid/HordeRaidEvent.java +++ b/src/main/java/com/minecolonies/core/colony/events/raid/HordeRaidEvent.java @@ -6,7 +6,7 @@ import com.minecolonies.api.colony.colonyEvents.IColonyCampFireRaidEvent; import com.minecolonies.api.colony.colonyEvents.IColonyEvent; import com.minecolonies.api.colony.colonyEvents.IColonyRaidEvent; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.api.entity.mobs.RaiderMobUtils; import com.minecolonies.api.sounds.RaidSounds; import com.minecolonies.api.util.*; @@ -214,9 +214,9 @@ public void unregisterEntity(final Entity entity) @Override public void onEntityDeath(final LivingEntity entity) { - if (entity instanceof AbstractEntityRaiderMob) + if (entity instanceof AbstractEntityMinecoloniesRaider) { - colony.getRaiderManager().onRaiderDeath((AbstractEntityRaiderMob) entity); + colony.getRaiderManager().onRaiderDeath((AbstractEntityMinecoloniesRaider) entity); } } diff --git a/src/main/java/com/minecolonies/core/colony/events/raid/RaidManager.java b/src/main/java/com/minecolonies/core/colony/events/raid/RaidManager.java index aabbc3a7c18..636f8c03738 100644 --- a/src/main/java/com/minecolonies/core/colony/events/raid/RaidManager.java +++ b/src/main/java/com/minecolonies/core/colony/events/raid/RaidManager.java @@ -11,7 +11,7 @@ import com.minecolonies.api.entity.citizen.AbstractEntityCitizen; import com.minecolonies.api.entity.citizen.happiness.ExpirationBasedHappinessModifier; import com.minecolonies.api.entity.citizen.happiness.StaticHappinessSupplier; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.api.sounds.RaidSounds; import com.minecolonies.api.util.*; import com.minecolonies.api.util.constant.ColonyConstants; @@ -1018,7 +1018,7 @@ public int getLostCitizen() } @Override - public void onRaiderDeath(final AbstractEntityRaiderMob entity) + public void onRaiderDeath(final AbstractEntityMinecoloniesRaider entity) { final RaidHistory last = getLastRaid(); if (last != null) diff --git a/src/main/java/com/minecolonies/core/colony/events/raid/amazonevent/AmazonRaidEvent.java b/src/main/java/com/minecolonies/core/colony/events/raid/amazonevent/AmazonRaidEvent.java index e1f97e72292..4383faf9b12 100644 --- a/src/main/java/com/minecolonies/core/colony/events/raid/amazonevent/AmazonRaidEvent.java +++ b/src/main/java/com/minecolonies/core/colony/events/raid/amazonevent/AmazonRaidEvent.java @@ -2,13 +2,13 @@ import com.minecolonies.api.colony.IColony; import com.minecolonies.api.colony.colonyEvents.EventStatus; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.api.sounds.RaidSounds; import com.minecolonies.api.util.constant.Constants; import com.minecolonies.core.colony.events.raid.HordeRaidEvent; -import com.minecolonies.core.entity.mobs.amazons.EntityAmazonChief; -import com.minecolonies.core.entity.mobs.amazons.EntityAmazonSpearman; -import com.minecolonies.core.entity.mobs.amazons.EntityArcherAmazon; +import com.minecolonies.core.entity.mobs.raider.amazons.EntityAmazonChiefRaider; +import com.minecolonies.core.entity.mobs.raider.amazons.EntityAmazonSpearmanRaider; +import com.minecolonies.core.entity.mobs.raider.amazons.EntityArcherAmazonRaider; import com.minecolonies.core.network.messages.client.PlayAudioMessage; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; @@ -50,25 +50,25 @@ public ResourceLocation getEventTypeID() @Override public void registerEntity(final Entity entity) { - if (!(entity instanceof AbstractEntityRaiderMob) || !entity.isAlive()) + if (!(entity instanceof AbstractEntityMinecoloniesRaider) || !entity.isAlive()) { entity.remove(Entity.RemovalReason.DISCARDED); return; } - if (entity instanceof EntityAmazonChief && boss.keySet().size() < horde.numberOfBosses) + if (entity instanceof EntityAmazonChiefRaider && boss.keySet().size() < horde.numberOfBosses) { boss.put(entity, entity.getUUID()); return; } - if (entity instanceof EntityArcherAmazon && archers.keySet().size() < horde.numberOfArchers) + if (entity instanceof EntityArcherAmazonRaider && archers.keySet().size() < horde.numberOfArchers) { archers.put(entity, entity.getUUID()); return; } - if (entity instanceof EntityAmazonSpearman && normal.keySet().size() < horde.numberOfRaiders) + if (entity instanceof EntityAmazonSpearmanRaider && normal.keySet().size() < horde.numberOfRaiders) { normal.put(entity, entity.getUUID()); return; @@ -105,24 +105,24 @@ public void onUpdate() public void onEntityDeath(final LivingEntity entity) { super.onEntityDeath(entity); - if (!(entity instanceof AbstractEntityRaiderMob)) + if (!(entity instanceof AbstractEntityMinecoloniesRaider)) { return; } - if (entity instanceof EntityAmazonChief) + if (entity instanceof EntityAmazonChiefRaider) { boss.remove(entity); horde.numberOfBosses--; } - if (entity instanceof EntityArcherAmazon) + if (entity instanceof EntityArcherAmazonRaider) { archers.remove(entity); horde.numberOfArchers--; } - if (entity instanceof EntityAmazonSpearman) + if (entity instanceof EntityAmazonSpearmanRaider) { normal.remove(entity); horde.numberOfRaiders--; diff --git a/src/main/java/com/minecolonies/core/colony/events/raid/barbarianEvent/BarbarianRaidEvent.java b/src/main/java/com/minecolonies/core/colony/events/raid/barbarianEvent/BarbarianRaidEvent.java index 8ceea8f2773..d2798a3e4dd 100644 --- a/src/main/java/com/minecolonies/core/colony/events/raid/barbarianEvent/BarbarianRaidEvent.java +++ b/src/main/java/com/minecolonies/core/colony/events/raid/barbarianEvent/BarbarianRaidEvent.java @@ -2,12 +2,12 @@ import com.minecolonies.api.colony.IColony; import com.minecolonies.api.colony.colonyEvents.EventStatus; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.api.util.constant.Constants; import com.minecolonies.core.colony.events.raid.HordeRaidEvent; -import com.minecolonies.core.entity.mobs.barbarians.EntityArcherBarbarian; -import com.minecolonies.core.entity.mobs.barbarians.EntityBarbarian; -import com.minecolonies.core.entity.mobs.barbarians.EntityChiefBarbarian; +import com.minecolonies.core.entity.mobs.raider.barbarians.EntityArcherBarbarianRaider; +import com.minecolonies.core.entity.mobs.raider.barbarians.EntityBarbarianRaider; +import com.minecolonies.core.entity.mobs.raider.barbarians.EntityChiefBarbarianRaider; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; @@ -43,25 +43,25 @@ public ResourceLocation getEventTypeID() @Override public void registerEntity(final Entity entity) { - if (!(entity instanceof AbstractEntityRaiderMob) || !entity.isAlive()) + if (!(entity instanceof AbstractEntityMinecoloniesRaider) || !entity.isAlive()) { entity.remove(Entity.RemovalReason.DISCARDED); return; } - if (entity instanceof EntityChiefBarbarian && boss.keySet().size() < horde.numberOfBosses) + if (entity instanceof EntityChiefBarbarianRaider && boss.keySet().size() < horde.numberOfBosses) { boss.put(entity, entity.getUUID()); return; } - if (entity instanceof EntityArcherBarbarian && archers.keySet().size() < horde.numberOfArchers) + if (entity instanceof EntityArcherBarbarianRaider && archers.keySet().size() < horde.numberOfArchers) { archers.put(entity, entity.getUUID()); return; } - if (entity instanceof EntityBarbarian && normal.keySet().size() < horde.numberOfRaiders) + if (entity instanceof EntityBarbarianRaider && normal.keySet().size() < horde.numberOfRaiders) { normal.put(entity, entity.getUUID()); return; @@ -74,24 +74,24 @@ public void registerEntity(final Entity entity) public void onEntityDeath(final LivingEntity entity) { super.onEntityDeath(entity); - if (!(entity instanceof AbstractEntityRaiderMob)) + if (!(entity instanceof AbstractEntityMinecoloniesRaider)) { return; } - if (entity instanceof EntityChiefBarbarian) + if (entity instanceof EntityChiefBarbarianRaider) { boss.remove(entity); horde.numberOfBosses--; } - if (entity instanceof EntityArcherBarbarian) + if (entity instanceof EntityArcherBarbarianRaider) { archers.remove(entity); horde.numberOfArchers--; } - if (entity instanceof EntityBarbarian) + if (entity instanceof EntityBarbarianRaider) { normal.remove(entity); horde.numberOfRaiders--; diff --git a/src/main/java/com/minecolonies/core/colony/events/raid/egyptianevent/EgyptianRaidEvent.java b/src/main/java/com/minecolonies/core/colony/events/raid/egyptianevent/EgyptianRaidEvent.java index 4eacb9b9583..96387ea7f03 100644 --- a/src/main/java/com/minecolonies/core/colony/events/raid/egyptianevent/EgyptianRaidEvent.java +++ b/src/main/java/com/minecolonies/core/colony/events/raid/egyptianevent/EgyptianRaidEvent.java @@ -2,13 +2,13 @@ import com.minecolonies.api.colony.IColony; import com.minecolonies.api.colony.colonyEvents.EventStatus; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.api.sounds.RaidSounds; import com.minecolonies.api.util.constant.Constants; import com.minecolonies.core.colony.events.raid.HordeRaidEvent; -import com.minecolonies.core.entity.mobs.egyptians.EntityArcherMummy; -import com.minecolonies.core.entity.mobs.egyptians.EntityMummy; -import com.minecolonies.core.entity.mobs.egyptians.EntityPharao; +import com.minecolonies.core.entity.mobs.raider.egyptians.EntityArcherMummyRaider; +import com.minecolonies.core.entity.mobs.raider.egyptians.EntityMummyRaider; +import com.minecolonies.core.entity.mobs.raider.egyptians.EntityPharaoRaider; import com.minecolonies.core.network.messages.client.PlayAudioMessage; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; @@ -76,25 +76,25 @@ public void onUpdate() @Override public void registerEntity(final Entity entity) { - if (!(entity instanceof AbstractEntityRaiderMob) || !entity.isAlive()) + if (!(entity instanceof AbstractEntityMinecoloniesRaider) || !entity.isAlive()) { entity.remove(Entity.RemovalReason.DISCARDED); return; } - if (entity instanceof EntityPharao && boss.keySet().size() < horde.numberOfBosses) + if (entity instanceof EntityPharaoRaider && boss.keySet().size() < horde.numberOfBosses) { boss.put(entity, entity.getUUID()); return; } - if (entity instanceof EntityArcherMummy && archers.keySet().size() < horde.numberOfArchers) + if (entity instanceof EntityArcherMummyRaider && archers.keySet().size() < horde.numberOfArchers) { archers.put(entity, entity.getUUID()); return; } - if (entity instanceof EntityMummy && normal.keySet().size() < horde.numberOfRaiders) + if (entity instanceof EntityMummyRaider && normal.keySet().size() < horde.numberOfRaiders) { normal.put(entity, entity.getUUID()); return; @@ -107,24 +107,24 @@ public void registerEntity(final Entity entity) public void onEntityDeath(final LivingEntity entity) { super.onEntityDeath(entity); - if (!(entity instanceof AbstractEntityRaiderMob)) + if (!(entity instanceof AbstractEntityMinecoloniesRaider)) { return; } - if (entity instanceof EntityPharao) + if (entity instanceof EntityPharaoRaider) { boss.remove(entity); horde.numberOfBosses--; } - if (entity instanceof EntityArcherMummy) + if (entity instanceof EntityArcherMummyRaider) { archers.remove(entity); horde.numberOfArchers--; } - if (entity instanceof EntityMummy) + if (entity instanceof EntityMummyRaider) { normal.remove(entity); horde.numberOfRaiders--; diff --git a/src/main/java/com/minecolonies/core/colony/events/raid/norsemenevent/NorsemenRaidEvent.java b/src/main/java/com/minecolonies/core/colony/events/raid/norsemenevent/NorsemenRaidEvent.java index 440f2f02d0e..e1e00d0bb26 100644 --- a/src/main/java/com/minecolonies/core/colony/events/raid/norsemenevent/NorsemenRaidEvent.java +++ b/src/main/java/com/minecolonies/core/colony/events/raid/norsemenevent/NorsemenRaidEvent.java @@ -2,12 +2,12 @@ import com.minecolonies.api.colony.IColony; import com.minecolonies.api.colony.colonyEvents.EventStatus; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.api.util.constant.Constants; import com.minecolonies.core.colony.events.raid.HordeRaidEvent; -import com.minecolonies.core.entity.mobs.norsemen.EntityNorsemenArcher; -import com.minecolonies.core.entity.mobs.norsemen.EntityNorsemenChief; -import com.minecolonies.core.entity.mobs.norsemen.EntityShieldmaiden; +import com.minecolonies.core.entity.mobs.raider.norsemen.EntityNorsemenArcherRaider; +import com.minecolonies.core.entity.mobs.raider.norsemen.EntityNorsemenChiefRaider; +import com.minecolonies.core.entity.mobs.raider.norsemen.EntityShieldmaidenRaider; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; @@ -50,25 +50,25 @@ protected void updateRaidBar() @Override public void registerEntity(final Entity entity) { - if (!(entity instanceof AbstractEntityRaiderMob) || !entity.isAlive()) + if (!(entity instanceof AbstractEntityMinecoloniesRaider) || !entity.isAlive()) { entity.remove(Entity.RemovalReason.DISCARDED); return; } - if (entity instanceof EntityNorsemenChief && boss.keySet().size() < horde.numberOfBosses) + if (entity instanceof EntityNorsemenChiefRaider && boss.keySet().size() < horde.numberOfBosses) { boss.put(entity, entity.getUUID()); return; } - if (entity instanceof EntityNorsemenArcher && archers.keySet().size() < horde.numberOfArchers) + if (entity instanceof EntityNorsemenArcherRaider && archers.keySet().size() < horde.numberOfArchers) { archers.put(entity, entity.getUUID()); return; } - if (entity instanceof EntityShieldmaiden && normal.keySet().size() < horde.numberOfRaiders) + if (entity instanceof EntityShieldmaidenRaider && normal.keySet().size() < horde.numberOfRaiders) { normal.put(entity, entity.getUUID()); return; @@ -81,24 +81,24 @@ public void registerEntity(final Entity entity) public void onEntityDeath(final LivingEntity entity) { super.onEntityDeath(entity); - if (!(entity instanceof AbstractEntityRaiderMob)) + if (!(entity instanceof AbstractEntityMinecoloniesRaider)) { return; } - if (entity instanceof EntityNorsemenChief) + if (entity instanceof EntityNorsemenChiefRaider) { boss.remove(entity); horde.numberOfBosses--; } - if (entity instanceof EntityNorsemenArcher) + if (entity instanceof EntityNorsemenArcherRaider) { archers.remove(entity); horde.numberOfArchers--; } - if (entity instanceof EntityShieldmaiden) + if (entity instanceof EntityShieldmaidenRaider) { normal.remove(entity); horde.numberOfRaiders--; diff --git a/src/main/java/com/minecolonies/core/colony/events/raid/pirateEvent/PirateGroundRaidEvent.java b/src/main/java/com/minecolonies/core/colony/events/raid/pirateEvent/PirateGroundRaidEvent.java index 5bc1eabf9f6..f39fcdeb753 100644 --- a/src/main/java/com/minecolonies/core/colony/events/raid/pirateEvent/PirateGroundRaidEvent.java +++ b/src/main/java/com/minecolonies/core/colony/events/raid/pirateEvent/PirateGroundRaidEvent.java @@ -2,12 +2,12 @@ import com.minecolonies.api.colony.IColony; import com.minecolonies.api.colony.colonyEvents.EventStatus; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.api.util.constant.Constants; import com.minecolonies.core.colony.events.raid.HordeRaidEvent; -import com.minecolonies.core.entity.mobs.pirates.EntityArcherPirate; -import com.minecolonies.core.entity.mobs.pirates.EntityCaptainPirate; -import com.minecolonies.core.entity.mobs.pirates.EntityPirate; +import com.minecolonies.core.entity.mobs.raider.pirates.EntityArcherPirateRaider; +import com.minecolonies.core.entity.mobs.raider.pirates.EntityCaptainPirateRaider; +import com.minecolonies.core.entity.mobs.raider.pirates.EntityPirateRaider; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; @@ -62,25 +62,25 @@ public void onUpdate() @Override public void registerEntity(final Entity entity) { - if (!(entity instanceof AbstractEntityRaiderMob) || !entity.isAlive()) + if (!(entity instanceof AbstractEntityMinecoloniesRaider) || !entity.isAlive()) { entity.remove(Entity.RemovalReason.DISCARDED); return; } - if (entity instanceof EntityCaptainPirate && boss.keySet().size() < horde.numberOfBosses) + if (entity instanceof EntityCaptainPirateRaider && boss.keySet().size() < horde.numberOfBosses) { boss.put(entity, entity.getUUID()); return; } - if (entity instanceof EntityArcherPirate && archers.keySet().size() < horde.numberOfArchers) + if (entity instanceof EntityArcherPirateRaider && archers.keySet().size() < horde.numberOfArchers) { archers.put(entity, entity.getUUID()); return; } - if (entity instanceof EntityPirate && normal.keySet().size() < horde.numberOfRaiders) + if (entity instanceof EntityPirateRaider && normal.keySet().size() < horde.numberOfRaiders) { normal.put(entity, entity.getUUID()); return; @@ -93,24 +93,24 @@ public void registerEntity(final Entity entity) public void onEntityDeath(final LivingEntity entity) { super.onEntityDeath(entity); - if (!(entity instanceof AbstractEntityRaiderMob)) + if (!(entity instanceof AbstractEntityMinecoloniesRaider)) { return; } - if (entity instanceof EntityCaptainPirate) + if (entity instanceof EntityCaptainPirateRaider) { boss.remove(entity); horde.numberOfBosses--; } - if (entity instanceof EntityArcherPirate) + if (entity instanceof EntityArcherPirateRaider) { archers.remove(entity); horde.numberOfArchers--; } - if (entity instanceof EntityPirate) + if (entity instanceof EntityPirateRaider) { normal.remove(entity); horde.numberOfRaiders--; diff --git a/src/main/java/com/minecolonies/core/commands/killcommands/CommandKillRaider.java b/src/main/java/com/minecolonies/core/commands/killcommands/CommandKillRaider.java index dacb4a10f33..da42f9d4055 100755 --- a/src/main/java/com/minecolonies/core/commands/killcommands/CommandKillRaider.java +++ b/src/main/java/com/minecolonies/core/commands/killcommands/CommandKillRaider.java @@ -2,7 +2,7 @@ import com.minecolonies.api.colony.colonyEvents.EventStatus; import com.minecolonies.api.colony.colonyEvents.IColonyEvent; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.api.util.DamageSourceKeys; import com.minecolonies.core.commands.commandTypes.IMCOPCommand; import com.mojang.brigadier.context.CommandContext; @@ -25,11 +25,11 @@ public int onExecute(final CommandContext context) { entitiesKilled = 0; - context.getSource().getLevel().getEntities(EntityTypeTest.forClass(AbstractEntityRaiderMob.class), (e) -> true).forEach(entity -> + context.getSource().getLevel().getEntities(EntityTypeTest.forClass(AbstractEntityMinecoloniesRaider.class), (e) -> true).forEach(entity -> { if (entity != null) { - final AbstractEntityRaiderMob mob = (AbstractEntityRaiderMob) entity; + final AbstractEntityMinecoloniesRaider mob = (AbstractEntityMinecoloniesRaider) entity; mob.die(context.getSource().getLevel().damageSources().source(DamageSourceKeys.CONSOLE)); mob.remove(Entity.RemovalReason.DISCARDED); diff --git a/src/main/java/com/minecolonies/core/compatibility/journeymap/EventListener.java b/src/main/java/com/minecolonies/core/compatibility/journeymap/EventListener.java index 39459526c80..99e9e535223 100644 --- a/src/main/java/com/minecolonies/core/compatibility/journeymap/EventListener.java +++ b/src/main/java/com/minecolonies/core/compatibility/journeymap/EventListener.java @@ -7,7 +7,7 @@ import com.minecolonies.api.colony.jobs.registry.IJobRegistry; import com.minecolonies.api.colony.jobs.registry.JobEntry; import com.minecolonies.api.entity.citizen.AbstractEntityCitizen; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.core.colony.jobs.AbstractJobGuard; import com.minecolonies.core.entity.visitor.VisitorCitizen; import journeymap.client.api.display.Context; @@ -152,7 +152,7 @@ public void onUpdateEntityRadar(@NotNull final EntityRadarUpdateEvent event) wrapper.setColor(entity.getTeamColor()); } } - else if (entity instanceof AbstractEntityRaiderMob) + else if (entity instanceof AbstractEntityMinecoloniesRaider) { final JourneymapOptions.RaiderColor color = JourneymapOptions.getRaiderColor(this.jmap.getOptions()); diff --git a/src/main/java/com/minecolonies/core/entity/ai/combat/CombatUtils.java b/src/main/java/com/minecolonies/core/entity/ai/combat/CombatUtils.java index 467026724e2..1776be9b29d 100644 --- a/src/main/java/com/minecolonies/core/entity/ai/combat/CombatUtils.java +++ b/src/main/java/com/minecolonies/core/entity/ai/combat/CombatUtils.java @@ -4,7 +4,7 @@ import com.minecolonies.api.colony.buildings.IBuilding; import com.minecolonies.api.entity.ModEntities; import com.minecolonies.api.entity.citizen.AbstractEntityCitizen; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.core.colony.buildings.AbstractBuildingGuards; import com.minecolonies.core.entity.citizen.EntityCitizen; import com.minecolonies.core.items.ItemSpear; @@ -98,7 +98,7 @@ public static void notifyGuardsOfTarget(final AbstractEntityCitizen user, final } } - if (target instanceof AbstractEntityRaiderMob) + if (target instanceof AbstractEntityMinecoloniesRaider) { for (final Map.Entry entry : user.getCitizenColonyHandler().getColonyOrRegister().getBuildingManager().getBuildings().entrySet()) { diff --git a/src/main/java/com/minecolonies/core/entity/mobs/aitasks/CampWalkAI.java b/src/main/java/com/minecolonies/core/entity/mobs/aitasks/CampWalkAI.java new file mode 100644 index 00000000000..4ae3f64a6ee --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/aitasks/CampWalkAI.java @@ -0,0 +1,102 @@ +package com.minecolonies.core.entity.mobs.aitasks; + +import com.minecolonies.api.entity.ai.IStateAI; +import com.minecolonies.api.entity.ai.combat.CombatAIStates; +import com.minecolonies.api.entity.ai.statemachine.states.IState; +import com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.ITickRateStateMachine; +import com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickingTransition; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; +import com.minecolonies.api.entity.pathfinding.IPathJob; +import com.minecolonies.core.entity.pathfinding.pathresults.PathResult; +import net.minecraft.core.BlockPos; +import net.minecraft.util.Tuple; + +import static com.minecolonies.api.util.constant.Constants.TICKS_SECOND; + +/** + * AI for handling the raiders walking directions + */ +public class CampWalkAI implements IStateAI +{ + /** + * The entity using this AI + */ + private final AbstractEntityMinecoloniesMonster entity; + + /** + * Target block we're walking to + */ + private BlockPos targetBlock = null; + + /** + * Walk timer + */ + private long walkTimer = 0; + + /** + * Random path result. + */ + private PathResult randomPathResult; + + /** + * Spawn center box cache. + */ + private Tuple spawnCenterBoxCache = null; + + public CampWalkAI(final AbstractEntityMinecoloniesMonster raider, final ITickRateStateMachine stateMachine) + { + this.entity = raider; + stateMachine.addTransition(new TickingTransition<>(CombatAIStates.NO_TARGET, this::walk, () -> null, 80)); + } + + /** + * Walk raider towards the colony or campfires + * + */ + private boolean walk() + { + if (targetBlock == null || entity.level.getGameTime() > walkTimer) + { + targetBlock = findRandomPositionToWalkTo(); + walkTimer = entity.level.getGameTime() + TICKS_SECOND * 30; + } + else + { + entity.getNavigation().moveToXYZ(targetBlock.getX(), targetBlock.getY(), targetBlock.getZ(),1.1); + randomPathResult = null; + } + + return false; + } + + protected BlockPos findRandomPositionToWalkTo() + { + if (randomPathResult == null || randomPathResult.failedToReachDestination()) + { + if (spawnCenterBoxCache == null) + { + final BlockPos startPos = entity.getSpawnPos() == null ? entity.blockPosition() : entity.getSpawnPos(); + spawnCenterBoxCache = new Tuple<>(startPos.offset(-10,-5,-10), startPos.offset(10,5,10)); + } + + randomPathResult = entity.getNavigation().moveToRandomPos(10, 0.9, spawnCenterBoxCache); + if (randomPathResult != null) + { + randomPathResult.getJob().getPathingOptions().withCanEnterDoors(true).withToggleCost(0).withNonLadderClimbableCost(0); + } + } + + if (randomPathResult.isPathReachingDestination()) + { + return randomPathResult.getPath().getEndNode().asBlockPos(); + } + + if (randomPathResult.isCancelled()) + { + randomPathResult = null; + return null; + } + + return null; + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/aitasks/EntityAIBreakDoor.java b/src/main/java/com/minecolonies/core/entity/mobs/aitasks/EntityAIBreakDoor.java index 0de00d2356f..27e8a3f799b 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/aitasks/EntityAIBreakDoor.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/aitasks/EntityAIBreakDoor.java @@ -2,7 +2,7 @@ import com.minecolonies.api.blocks.decorative.AbstractBlockGate; import com.minecolonies.api.colony.IColony; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.core.MineColonies; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.Mob; @@ -58,9 +58,9 @@ public void start() hardness = (int) (1 + mob.level.getBlockState(doorPos).getDestroySpeed(mob.level, doorPos)); // No stuck during door break - if (mob instanceof AbstractEntityRaiderMob) + if (mob instanceof AbstractEntityMinecoloniesRaider) { - ((AbstractEntityRaiderMob) mob).setCanBeStuck(false); + ((AbstractEntityMinecoloniesRaider) mob).setCanBeStuck(false); } } @@ -68,9 +68,9 @@ public void stop() { super.stop(); this.mob.level.destroyBlockProgress(this.mob.getId(), this.doorPos, -1); - if (mob instanceof AbstractEntityRaiderMob) + if (mob instanceof AbstractEntityMinecoloniesRaider) { - ((AbstractEntityRaiderMob) mob).setCanBeStuck(true); + ((AbstractEntityMinecoloniesRaider) mob).setCanBeStuck(true); } } @@ -92,16 +92,16 @@ public void tick() { double fasterBreakPerXNearby = 5; - if (mob instanceof AbstractEntityRaiderMob && !mob.level.isClientSide() && mob.level.getBlockState(doorPos).getBlock() instanceof AbstractBlockGate) + if (mob instanceof AbstractEntityMinecoloniesRaider && !mob.level.isClientSide() && mob.level.getBlockState(doorPos).getBlock() instanceof AbstractBlockGate) { - final IColony colony = ((AbstractEntityRaiderMob) mob).getColony(); + final IColony colony = ((AbstractEntityMinecoloniesRaider) mob).getColony(); fasterBreakPerXNearby += colony.getResearchManager().getResearchEffects().getEffectStrength(MECHANIC_ENHANCED_GATES); } fasterBreakPerXNearby /= 2; breakChance = (int) Math.max(1, - hardness / (1 + (mob.level.getEntitiesOfClass(AbstractEntityRaiderMob.class, mob.getBoundingBox().inflate(5)).size() / fasterBreakPerXNearby))); + hardness / (1 + (mob.level.getEntitiesOfClass(AbstractEntityMinecoloniesRaider.class, mob.getBoundingBox().inflate(5)).size() / fasterBreakPerXNearby))); } if (this.breakTime == this.getDoorBreakTime() - 1) diff --git a/src/main/java/com/minecolonies/core/entity/mobs/aitasks/RaiderMeleeAI.java b/src/main/java/com/minecolonies/core/entity/mobs/aitasks/RaiderMeleeAI.java index 14561f495ea..461f34d2214 100644 --- a/src/main/java/com/minecolonies/core/entity/mobs/aitasks/RaiderMeleeAI.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/aitasks/RaiderMeleeAI.java @@ -3,7 +3,8 @@ import com.minecolonies.api.entity.ai.combat.threat.IThreatTableEntity; import com.minecolonies.api.entity.ai.statemachine.states.IState; import com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.ITickRateStateMachine; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.api.util.SoundUtils; import com.minecolonies.api.util.constant.Constants; import com.minecolonies.core.entity.ai.combat.AttackMoveAI; @@ -23,7 +24,7 @@ /** * Raider AI for melee attacking a target */ -public class RaiderMeleeAI extends AttackMoveAI +public class RaiderMeleeAI extends AttackMoveAI { /** * Extended reach based on difficulty @@ -84,7 +85,7 @@ protected int getAttackDelay() protected PathResult moveInAttackPosition(final LivingEntity target) { return user.getNavigation() - .moveToXYZ(target.getX(), target.getY(), target.getZ(), user.getDifficulty() < ADD_SPEED_DIFFICULTY ? BASE_COMBAT_SPEED : BASE_COMBAT_SPEED * BONUS_SPEED); + .moveToXYZ(target.getX(), target.getY(), target.getZ(), user.getDifficulty() < ADD_SPEED_DIFFICULTY ? BASE_COMBAT_SPEED : BASE_COMBAT_SPEED * BONUS_SPEED); } @Override diff --git a/src/main/java/com/minecolonies/core/entity/mobs/aitasks/RaiderRangedAI.java b/src/main/java/com/minecolonies/core/entity/mobs/aitasks/RaiderRangedAI.java index 2627fcaf1f6..39ecdff9b83 100644 --- a/src/main/java/com/minecolonies/core/entity/mobs/aitasks/RaiderRangedAI.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/aitasks/RaiderRangedAI.java @@ -3,7 +3,8 @@ import com.minecolonies.api.entity.ai.combat.threat.IThreatTableEntity; import com.minecolonies.api.entity.ai.statemachine.states.IState; import com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.ITickRateStateMachine; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.api.entity.mobs.ICustomAttackSound; import com.minecolonies.api.entity.mobs.IRangedMobEntity; import com.minecolonies.api.util.EntityUtils; @@ -24,7 +25,7 @@ /** * Raider AI for shooting arrows at a target */ -public class RaiderRangedAI extends AttackMoveAI +public class RaiderRangedAI extends AttackMoveAI { /** * Max delay between attacks is 3s, aka 60 ticks. diff --git a/src/main/java/com/minecolonies/core/entity/mobs/aitasks/RaiderWalkAI.java b/src/main/java/com/minecolonies/core/entity/mobs/aitasks/RaiderWalkAI.java index acd66cfd147..a1a0c52f9d7 100644 --- a/src/main/java/com/minecolonies/core/entity/mobs/aitasks/RaiderWalkAI.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/aitasks/RaiderWalkAI.java @@ -8,7 +8,7 @@ import com.minecolonies.api.entity.ai.statemachine.states.IState; import com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.ITickRateStateMachine; import com.minecolonies.api.entity.ai.statemachine.tickratestatemachine.TickingTransition; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; import com.minecolonies.api.entity.pathfinding.IPathJob; import com.minecolonies.api.util.BlockPosUtil; import com.minecolonies.api.util.Log; @@ -30,7 +30,7 @@ public class RaiderWalkAI implements IStateAI /** * The entity using this AI */ - private final AbstractEntityRaiderMob raider; + private final AbstractEntityMinecoloniesRaider raider; /** * Target block we're walking to @@ -52,7 +52,7 @@ public class RaiderWalkAI implements IStateAI */ private boolean walkInBuildingState = false; - public RaiderWalkAI(final AbstractEntityRaiderMob raider, final ITickRateStateMachine stateMachine) + public RaiderWalkAI(final AbstractEntityMinecoloniesRaider raider, final ITickRateStateMachine stateMachine) { this.raider = raider; stateMachine.addTransition(new TickingTransition<>(CombatAIStates.NO_TARGET, this::walk, () -> null, 80)); @@ -167,6 +167,12 @@ protected BlockPos findRandomPositionToWalkTo() } } + if (randomPathResult == null) + { + return null; + } + + if (randomPathResult.isPathReachingDestination()) { return randomPathResult.getPath().getEndNode().asBlockPos(); diff --git a/src/main/java/com/minecolonies/core/entity/mobs/amazons/package-info.java b/src/main/java/com/minecolonies/core/entity/mobs/amazons/package-info.java deleted file mode 100755 index c7a3af81556..00000000000 --- a/src/main/java/com/minecolonies/core/entity/mobs/amazons/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Classes describing the amazon raiders. - */ -package com.minecolonies.core.entity.mobs.amazons; \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/mobs/barbarians/package-info.java b/src/main/java/com/minecolonies/core/entity/mobs/barbarians/package-info.java deleted file mode 100755 index ddedd89b57f..00000000000 --- a/src/main/java/com/minecolonies/core/entity/mobs/barbarians/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Classes describing the Barbarian entities. - */ -package com.minecolonies.core.entity.mobs.barbarians; \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/mobs/amazons/EntityAmazonChief.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/amazons/EntityAmazonChief.java similarity index 86% rename from src/main/java/com/minecolonies/core/entity/mobs/amazons/EntityAmazonChief.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/amazons/EntityAmazonChief.java index 2e9bfc3f98d..12047372c4a 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/amazons/EntityAmazonChief.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/amazons/EntityAmazonChief.java @@ -1,4 +1,4 @@ -package com.minecolonies.core.entity.mobs.amazons; +package com.minecolonies.core.entity.mobs.camp.amazons; import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazon; import com.minecolonies.api.entity.mobs.amazons.IAmazonChief; @@ -7,7 +7,6 @@ import net.minecraft.world.level.Level; import static com.minecolonies.api.entity.mobs.RaiderMobUtils.MOB_ATTACK_DAMAGE; -import static com.minecolonies.api.util.constant.RaiderConstants.BASE_ENV_DAMAGE_RESIST; import static com.minecolonies.api.util.constant.RaiderConstants.CHIEF_BONUS_ARMOR; /** @@ -15,7 +14,6 @@ */ public class EntityAmazonChief extends AbstractEntityAmazon implements IAmazonChief { - /** * Constructor of the entity. * @@ -34,7 +32,6 @@ public void initStatsFor(final double baseHealth, final double difficulty, final final double chiefArmor = difficulty * CHIEF_BONUS_ARMOR * 2; this.getAttribute(Attributes.ARMOR).setBaseValue(chiefArmor); this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage + 1.0); - this.setEnvDamageInterval((int) (BASE_ENV_DAMAGE_RESIST * 2 * difficulty)); this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 1.5); this.setHealth(this.getMaxHealth()); } diff --git a/src/main/java/com/minecolonies/core/entity/mobs/amazons/EntityAmazonSpearman.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/amazons/EntityAmazonSpearman.java similarity index 83% rename from src/main/java/com/minecolonies/core/entity/mobs/amazons/EntityAmazonSpearman.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/amazons/EntityAmazonSpearman.java index ae3a37b6fc2..94568bf03c4 100644 --- a/src/main/java/com/minecolonies/core/entity/mobs/amazons/EntityAmazonSpearman.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/amazons/EntityAmazonSpearman.java @@ -1,6 +1,7 @@ -package com.minecolonies.core.entity.mobs.amazons; +package com.minecolonies.core.entity.mobs.camp.amazons; import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazon; +import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazonRaider; import com.minecolonies.api.entity.mobs.amazons.IAmazonSpearman; import net.minecraft.world.entity.EntityType; import net.minecraft.world.level.Level; diff --git a/src/main/java/com/minecolonies/core/entity/mobs/amazons/EntityArcherAmazon.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/amazons/EntityArcherAmazon.java similarity index 92% rename from src/main/java/com/minecolonies/core/entity/mobs/amazons/EntityArcherAmazon.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/amazons/EntityArcherAmazon.java index 6273edcae4d..495fbd8ccd8 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/amazons/EntityArcherAmazon.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/amazons/EntityArcherAmazon.java @@ -1,4 +1,4 @@ -package com.minecolonies.core.entity.mobs.amazons; +package com.minecolonies.core.entity.mobs.camp.amazons; import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazon; import com.minecolonies.api.entity.mobs.amazons.IArcherAmazon; diff --git a/src/main/java/com/minecolonies/core/entity/mobs/barbarians/EntityArcherBarbarian.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/barbarians/EntityArcherBarbarian.java similarity index 92% rename from src/main/java/com/minecolonies/core/entity/mobs/barbarians/EntityArcherBarbarian.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/barbarians/EntityArcherBarbarian.java index 14990db4b94..504d7802d8b 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/barbarians/EntityArcherBarbarian.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/barbarians/EntityArcherBarbarian.java @@ -1,4 +1,4 @@ -package com.minecolonies.core.entity.mobs.barbarians; +package com.minecolonies.core.entity.mobs.camp.barbarians; import com.minecolonies.api.entity.mobs.barbarians.AbstractEntityBarbarian; import com.minecolonies.api.entity.mobs.barbarians.IArcherBarbarianEntity; diff --git a/src/main/java/com/minecolonies/core/entity/mobs/barbarians/EntityBarbarian.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/barbarians/EntityBarbarian.java similarity index 91% rename from src/main/java/com/minecolonies/core/entity/mobs/barbarians/EntityBarbarian.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/barbarians/EntityBarbarian.java index adf6d0bcc2a..65dfda93c8a 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/barbarians/EntityBarbarian.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/barbarians/EntityBarbarian.java @@ -1,4 +1,4 @@ -package com.minecolonies.core.entity.mobs.barbarians; +package com.minecolonies.core.entity.mobs.camp.barbarians; import com.minecolonies.api.entity.mobs.barbarians.AbstractEntityBarbarian; import com.minecolonies.api.entity.mobs.barbarians.IMeleeBarbarianEntity; diff --git a/src/main/java/com/minecolonies/core/entity/mobs/barbarians/EntityChiefBarbarian.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/barbarians/EntityChiefBarbarian.java similarity index 86% rename from src/main/java/com/minecolonies/core/entity/mobs/barbarians/EntityChiefBarbarian.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/barbarians/EntityChiefBarbarian.java index 2c13187fd2e..7de99e970f7 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/barbarians/EntityChiefBarbarian.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/barbarians/EntityChiefBarbarian.java @@ -1,4 +1,4 @@ -package com.minecolonies.core.entity.mobs.barbarians; +package com.minecolonies.core.entity.mobs.camp.barbarians; import com.minecolonies.api.entity.mobs.barbarians.AbstractEntityBarbarian; import com.minecolonies.api.entity.mobs.barbarians.IChiefBarbarianEntity; @@ -7,7 +7,6 @@ import net.minecraft.world.level.Level; import static com.minecolonies.api.entity.mobs.RaiderMobUtils.MOB_ATTACK_DAMAGE; -import static com.minecolonies.api.util.constant.RaiderConstants.BASE_ENV_DAMAGE_RESIST; import static com.minecolonies.api.util.constant.RaiderConstants.CHIEF_BONUS_ARMOR; /** @@ -15,7 +14,6 @@ */ public class EntityChiefBarbarian extends AbstractEntityBarbarian implements IChiefBarbarianEntity { - /** * Constructor of the entity. * @@ -34,7 +32,6 @@ public void initStatsFor(final double baseHealth, final double difficulty, final final double chiefArmor = difficulty * CHIEF_BONUS_ARMOR; this.getAttribute(Attributes.ARMOR).setBaseValue(chiefArmor); this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage + 1.0); - this.setEnvDamageInterval((int) (BASE_ENV_DAMAGE_RESIST * 2 * difficulty)); this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 1.5); this.setHealth(this.getMaxHealth()); } diff --git a/src/main/java/com/minecolonies/core/entity/mobs/camp/barbarians/package-info.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/barbarians/package-info.java new file mode 100755 index 00000000000..9264c336133 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/barbarians/package-info.java @@ -0,0 +1,4 @@ +/** + * Classes describing the Barbarian entities. + */ +package com.minecolonies.core.entity.mobs.raider.barbarians; \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/mobs/drownedpirates/EntityDrownedArcherPirate.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/drownedpirates/EntityDrownedArcherPirate.java similarity index 95% rename from src/main/java/com/minecolonies/core/entity/mobs/drownedpirates/EntityDrownedArcherPirate.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/drownedpirates/EntityDrownedArcherPirate.java index 6fe2635d491..85d5b5728ee 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/drownedpirates/EntityDrownedArcherPirate.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/drownedpirates/EntityDrownedArcherPirate.java @@ -1,4 +1,4 @@ -package com.minecolonies.core.entity.mobs.drownedpirates; +package com.minecolonies.core.entity.mobs.camp.drownedpirates; import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirate; import com.minecolonies.api.entity.mobs.pirates.IArcherPirateEntity; diff --git a/src/main/java/com/minecolonies/core/entity/mobs/drownedpirates/EntityDrownedCaptainPirate.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/drownedpirates/EntityDrownedCaptainPirate.java similarity index 91% rename from src/main/java/com/minecolonies/core/entity/mobs/drownedpirates/EntityDrownedCaptainPirate.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/drownedpirates/EntityDrownedCaptainPirate.java index c29152f4783..7c70a19e372 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/drownedpirates/EntityDrownedCaptainPirate.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/drownedpirates/EntityDrownedCaptainPirate.java @@ -1,6 +1,7 @@ -package com.minecolonies.core.entity.mobs.drownedpirates; +package com.minecolonies.core.entity.mobs.camp.drownedpirates; import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirate; +import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirateRaider; import com.minecolonies.api.entity.mobs.pirates.ICaptainPirateEntity; import com.minecolonies.api.util.MathUtils; import net.minecraft.network.chat.Component; @@ -33,7 +34,6 @@ public void initStatsFor(final double baseHealth, final double difficulty, final super.initStatsFor(baseHealth, difficulty, baseDamage); this.getAttribute(Attributes.ARMOR).setBaseValue(-1); this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage); - this.setEnvDamageInterval((int) (BASE_ENV_DAMAGE_RESIST * 2 * difficulty)); this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 2.0); this.setHealth(this.getMaxHealth()); if (MathUtils.RANDOM.nextInt(100) < 2) diff --git a/src/main/java/com/minecolonies/core/entity/mobs/drownedpirates/EntityDrownedPirate.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/drownedpirates/EntityDrownedPirate.java similarity index 95% rename from src/main/java/com/minecolonies/core/entity/mobs/drownedpirates/EntityDrownedPirate.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/drownedpirates/EntityDrownedPirate.java index 6e838ceb8cf..79b12566fc2 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/drownedpirates/EntityDrownedPirate.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/drownedpirates/EntityDrownedPirate.java @@ -1,4 +1,4 @@ -package com.minecolonies.core.entity.mobs.drownedpirates; +package com.minecolonies.core.entity.mobs.camp.drownedpirates; import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirate; import com.minecolonies.api.entity.mobs.pirates.IMeleePirateEntity; diff --git a/src/main/java/com/minecolonies/core/entity/mobs/egyptians/EntityArcherMummy.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/egyptians/EntityArcherMummy.java similarity index 82% rename from src/main/java/com/minecolonies/core/entity/mobs/egyptians/EntityArcherMummy.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/egyptians/EntityArcherMummy.java index 8d6d544592a..94c4e8efd98 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/egyptians/EntityArcherMummy.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/egyptians/EntityArcherMummy.java @@ -1,6 +1,7 @@ -package com.minecolonies.core.entity.mobs.egyptians; +package com.minecolonies.core.entity.mobs.camp.egyptians; import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptian; +import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptianRaider; import com.minecolonies.api.entity.mobs.egyptians.IArcherMummyEntity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.level.Level; diff --git a/src/main/java/com/minecolonies/core/entity/mobs/egyptians/EntityMummy.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/egyptians/EntityMummy.java similarity index 92% rename from src/main/java/com/minecolonies/core/entity/mobs/egyptians/EntityMummy.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/egyptians/EntityMummy.java index 868f8247db8..496f43637ab 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/egyptians/EntityMummy.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/egyptians/EntityMummy.java @@ -1,4 +1,4 @@ -package com.minecolonies.core.entity.mobs.egyptians; +package com.minecolonies.core.entity.mobs.camp.egyptians; import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptian; import com.minecolonies.api.entity.mobs.egyptians.IMeleeMummyEntity; diff --git a/src/main/java/com/minecolonies/core/entity/mobs/egyptians/EntityPharao.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/egyptians/EntityPharao.java similarity index 91% rename from src/main/java/com/minecolonies/core/entity/mobs/egyptians/EntityPharao.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/egyptians/EntityPharao.java index 3851e0625a2..159bcfcb5b2 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/egyptians/EntityPharao.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/egyptians/EntityPharao.java @@ -1,6 +1,7 @@ -package com.minecolonies.core.entity.mobs.egyptians; +package com.minecolonies.core.entity.mobs.camp.egyptians; import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptian; +import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptianRaider; import com.minecolonies.api.entity.mobs.egyptians.IPharaoEntity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.ai.attributes.Attributes; @@ -34,7 +35,6 @@ public void initStatsFor(final double baseHealth, final double difficulty, final final double chiefArmor = difficulty * CHIEF_BONUS_ARMOR; this.getAttribute(Attributes.ARMOR).setBaseValue(chiefArmor); this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage + 1.0); - this.setEnvDamageInterval((int) (BASE_ENV_DAMAGE_RESIST * 2 * difficulty)); this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 4.5); this.setHealth(this.getMaxHealth()); } diff --git a/src/main/java/com/minecolonies/core/entity/mobs/camp/egyptians/package-info.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/egyptians/package-info.java new file mode 100755 index 00000000000..ffaf42480a5 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/egyptians/package-info.java @@ -0,0 +1,4 @@ +/** + * Classes describing the Egyptian raiders. + */ +package com.minecolonies.core.entity.mobs.raider.egyptians; \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/mobs/norsemen/EntityNorsemenArcher.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/norsemen/EntityNorsemenArcher.java similarity index 83% rename from src/main/java/com/minecolonies/core/entity/mobs/norsemen/EntityNorsemenArcher.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/norsemen/EntityNorsemenArcher.java index 26ebb846450..f5ebeb0a2a3 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/norsemen/EntityNorsemenArcher.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/norsemen/EntityNorsemenArcher.java @@ -1,6 +1,7 @@ -package com.minecolonies.core.entity.mobs.norsemen; +package com.minecolonies.core.entity.mobs.camp.norsemen; import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemen; +import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemenRaider; import com.minecolonies.api.entity.mobs.vikings.IArcherNorsemenEntity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.level.Level; diff --git a/src/main/java/com/minecolonies/core/entity/mobs/norsemen/EntityNorsemenChief.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/norsemen/EntityNorsemenChief.java similarity index 91% rename from src/main/java/com/minecolonies/core/entity/mobs/norsemen/EntityNorsemenChief.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/norsemen/EntityNorsemenChief.java index e3582f264d6..4ea19f820af 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/norsemen/EntityNorsemenChief.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/norsemen/EntityNorsemenChief.java @@ -1,6 +1,7 @@ -package com.minecolonies.core.entity.mobs.norsemen; +package com.minecolonies.core.entity.mobs.camp.norsemen; import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemen; +import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemenRaider; import com.minecolonies.api.entity.mobs.vikings.INorsemenChiefEntity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.ai.attributes.Attributes; @@ -33,7 +34,6 @@ public void initStatsFor(final double baseHealth, final double difficulty, final final double chiefArmor = difficulty * CHIEF_BONUS_ARMOR; this.getAttribute(Attributes.ARMOR).setBaseValue(chiefArmor); this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage + 1.0); - this.setEnvDamageInterval((int) (BASE_ENV_DAMAGE_RESIST * 2 * difficulty)); this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 1.5); this.setHealth(this.getMaxHealth()); } diff --git a/src/main/java/com/minecolonies/core/entity/mobs/norsemen/EntityShieldmaiden.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/norsemen/EntityShieldmaiden.java similarity index 83% rename from src/main/java/com/minecolonies/core/entity/mobs/norsemen/EntityShieldmaiden.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/norsemen/EntityShieldmaiden.java index c7323837c0c..d8d78147793 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/norsemen/EntityShieldmaiden.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/norsemen/EntityShieldmaiden.java @@ -1,6 +1,7 @@ -package com.minecolonies.core.entity.mobs.norsemen; +package com.minecolonies.core.entity.mobs.camp.norsemen; import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemen; +import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemenRaider; import com.minecolonies.api.entity.mobs.vikings.IMeleeNorsemenEntity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.level.Level; diff --git a/src/main/java/com/minecolonies/core/entity/mobs/camp/norsemen/package-info.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/norsemen/package-info.java new file mode 100755 index 00000000000..fc141751a02 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/norsemen/package-info.java @@ -0,0 +1,4 @@ +/** + * Classes describing the Norsemen entities. + */ +package com.minecolonies.core.entity.mobs.raider.norsemen; \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/mobs/pirates/EntityArcherPirate.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/pirates/EntityArcherPirate.java similarity index 83% rename from src/main/java/com/minecolonies/core/entity/mobs/pirates/EntityArcherPirate.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/pirates/EntityArcherPirate.java index 475d5875e92..1090b95f97c 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/pirates/EntityArcherPirate.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/pirates/EntityArcherPirate.java @@ -1,6 +1,7 @@ -package com.minecolonies.core.entity.mobs.pirates; +package com.minecolonies.core.entity.mobs.camp.pirates; import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirate; +import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirateRaider; import com.minecolonies.api.entity.mobs.pirates.IArcherPirateEntity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.level.Level; diff --git a/src/main/java/com/minecolonies/core/entity/mobs/pirates/EntityCaptainPirate.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/pirates/EntityCaptainPirate.java similarity index 90% rename from src/main/java/com/minecolonies/core/entity/mobs/pirates/EntityCaptainPirate.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/pirates/EntityCaptainPirate.java index f925da07e04..2340833f5ff 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/pirates/EntityCaptainPirate.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/pirates/EntityCaptainPirate.java @@ -1,6 +1,7 @@ -package com.minecolonies.core.entity.mobs.pirates; +package com.minecolonies.core.entity.mobs.camp.pirates; import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirate; +import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirateRaider; import com.minecolonies.api.entity.mobs.pirates.ICaptainPirateEntity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.ai.attributes.Attributes; @@ -32,7 +33,6 @@ public void initStatsFor(final double baseHealth, final double difficulty, final super.initStatsFor(baseHealth, difficulty, baseDamage); this.getAttribute(Attributes.ARMOR).setBaseValue(-1); this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage + 2.0); - this.setEnvDamageInterval((int) (BASE_ENV_DAMAGE_RESIST * 2 * difficulty)); this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 1.3); this.setHealth(this.getMaxHealth()); } diff --git a/src/main/java/com/minecolonies/core/entity/mobs/pirates/EntityPirate.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/pirates/EntityPirate.java similarity index 93% rename from src/main/java/com/minecolonies/core/entity/mobs/pirates/EntityPirate.java rename to src/main/java/com/minecolonies/core/entity/mobs/camp/pirates/EntityPirate.java index c64ce9ca564..4b91b5628f8 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/pirates/EntityPirate.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/pirates/EntityPirate.java @@ -1,4 +1,4 @@ -package com.minecolonies.core.entity.mobs.pirates; +package com.minecolonies.core.entity.mobs.camp.pirates; import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirate; import com.minecolonies.api.entity.mobs.pirates.IMeleePirateEntity; diff --git a/src/main/java/com/minecolonies/core/entity/mobs/camp/pirates/package-info.java b/src/main/java/com/minecolonies/core/entity/mobs/camp/pirates/package-info.java new file mode 100755 index 00000000000..930b9dc3c13 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/camp/pirates/package-info.java @@ -0,0 +1,4 @@ +/** + * Classes describing the pirate entities. + */ +package com.minecolonies.core.entity.mobs.raider.pirates; \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/mobs/egyptians/package-info.java b/src/main/java/com/minecolonies/core/entity/mobs/egyptians/package-info.java deleted file mode 100755 index f938c31a328..00000000000 --- a/src/main/java/com/minecolonies/core/entity/mobs/egyptians/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Classes describing the Egyptian raiders. - */ -package com.minecolonies.core.entity.mobs.egyptians; \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/mobs/norsemen/package-info.java b/src/main/java/com/minecolonies/core/entity/mobs/norsemen/package-info.java deleted file mode 100755 index b4a1d83122e..00000000000 --- a/src/main/java/com/minecolonies/core/entity/mobs/norsemen/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Classes describing the Norsemen entities. - */ -package com.minecolonies.core.entity.mobs.norsemen; \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/mobs/pirates/package-info.java b/src/main/java/com/minecolonies/core/entity/mobs/pirates/package-info.java deleted file mode 100755 index 74e15aee406..00000000000 --- a/src/main/java/com/minecolonies/core/entity/mobs/pirates/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Classes describing the pirate entities. - */ -package com.minecolonies.core.entity.mobs.pirates; \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/amazons/EntityAmazonChiefRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/amazons/EntityAmazonChiefRaider.java new file mode 100755 index 00000000000..a97b052d73c --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/amazons/EntityAmazonChiefRaider.java @@ -0,0 +1,41 @@ +package com.minecolonies.core.entity.mobs.raider.amazons; + +import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazonRaider; +import com.minecolonies.api.entity.mobs.amazons.IAmazonChief; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.level.Level; + +import static com.minecolonies.api.entity.mobs.RaiderMobUtils.MOB_ATTACK_DAMAGE; +import static com.minecolonies.api.util.constant.RaiderConstants.BASE_ENV_DAMAGE_RESIST; +import static com.minecolonies.api.util.constant.RaiderConstants.CHIEF_BONUS_ARMOR; + +/** + * Class for the Amazon Chief entity. + */ +public class EntityAmazonChiefRaider extends AbstractEntityAmazonRaider implements IAmazonChief +{ + + /** + * Constructor of the entity. + * + * @param type the entity type. + * @param worldIn world to construct it in. + */ + public EntityAmazonChiefRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } + + @Override + public void initStatsFor(final double baseHealth, final double difficulty, final double baseDamage) + { + super.initStatsFor(baseHealth, difficulty, baseDamage); + final double chiefArmor = difficulty * CHIEF_BONUS_ARMOR * 2; + this.getAttribute(Attributes.ARMOR).setBaseValue(chiefArmor); + this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage + 1.0); + this.setEnvDamageInterval((int) (BASE_ENV_DAMAGE_RESIST * 2 * difficulty)); + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 1.5); + this.setHealth(this.getMaxHealth()); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/amazons/EntityAmazonSpearmanRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/amazons/EntityAmazonSpearmanRaider.java new file mode 100644 index 00000000000..2d9cbe56493 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/amazons/EntityAmazonSpearmanRaider.java @@ -0,0 +1,23 @@ +package com.minecolonies.core.entity.mobs.raider.amazons; + +import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazonRaider; +import com.minecolonies.api.entity.mobs.amazons.IAmazonSpearman; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.Level; + +/** + * Class for the Amazon Spearman entity. + */ +public class EntityAmazonSpearmanRaider extends AbstractEntityAmazonRaider implements IAmazonSpearman +{ + /** + * Constructor of the entity. + * + * @param type the entity type + * @param world the world to construct it in + */ + public EntityAmazonSpearmanRaider(final EntityType type, final Level world) + { + super(type, world); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/amazons/EntityArcherAmazonRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/amazons/EntityArcherAmazonRaider.java new file mode 100755 index 00000000000..c111611178d --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/amazons/EntityArcherAmazonRaider.java @@ -0,0 +1,29 @@ +package com.minecolonies.core.entity.mobs.raider.amazons; + +import com.minecolonies.api.entity.mobs.amazons.AbstractEntityAmazonRaider; +import com.minecolonies.api.entity.mobs.amazons.IArcherAmazon; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.Level; + +/** + * Class for the Archer amazon entity. + */ +public class EntityArcherAmazonRaider extends AbstractEntityAmazonRaider implements IArcherAmazon +{ + /** + * Constructor of the entity. + * + * @param worldIn world to construct it in. + * @param type the entity type. + */ + public EntityArcherAmazonRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } + + @Override + public double getAttackDelayModifier() + { + return 2; + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/EntityArcherBarbarianRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/EntityArcherBarbarianRaider.java new file mode 100755 index 00000000000..7ada1ccc5f6 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/EntityArcherBarbarianRaider.java @@ -0,0 +1,24 @@ +package com.minecolonies.core.entity.mobs.raider.barbarians; + +import com.minecolonies.api.entity.mobs.barbarians.AbstractEntityBarbarianRaider; +import com.minecolonies.api.entity.mobs.barbarians.IArcherBarbarianEntity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.Level; + +/** + * Class for the Archer Barbarian entity. + */ +public class EntityArcherBarbarianRaider extends AbstractEntityBarbarianRaider implements IArcherBarbarianEntity +{ + + /** + * Constructor of the entity. + * + * @param worldIn world to construct it in. + * @param type the entity type. + */ + public EntityArcherBarbarianRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/EntityBarbarianRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/EntityBarbarianRaider.java new file mode 100755 index 00000000000..7ce9c596040 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/EntityBarbarianRaider.java @@ -0,0 +1,24 @@ +package com.minecolonies.core.entity.mobs.raider.barbarians; + +import com.minecolonies.api.entity.mobs.barbarians.AbstractEntityBarbarianRaider; +import com.minecolonies.api.entity.mobs.barbarians.IMeleeBarbarianEntity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.Level; + +/** + * Class for the Barbarian entity. + */ +public class EntityBarbarianRaider extends AbstractEntityBarbarianRaider implements IMeleeBarbarianEntity +{ + + /** + * Constructor of the entity. + * + * @param worldIn world to construct it in. + * @param type the entity type. + */ + public EntityBarbarianRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/EntityChiefBarbarianRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/EntityChiefBarbarianRaider.java new file mode 100755 index 00000000000..5778f606f27 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/EntityChiefBarbarianRaider.java @@ -0,0 +1,41 @@ +package com.minecolonies.core.entity.mobs.raider.barbarians; + +import com.minecolonies.api.entity.mobs.barbarians.AbstractEntityBarbarianRaider; +import com.minecolonies.api.entity.mobs.barbarians.IChiefBarbarianEntity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.level.Level; + +import static com.minecolonies.api.entity.mobs.RaiderMobUtils.MOB_ATTACK_DAMAGE; +import static com.minecolonies.api.util.constant.RaiderConstants.BASE_ENV_DAMAGE_RESIST; +import static com.minecolonies.api.util.constant.RaiderConstants.CHIEF_BONUS_ARMOR; + +/** + * Class for the Chief Barbarian entity. + */ +public class EntityChiefBarbarianRaider extends AbstractEntityBarbarianRaider implements IChiefBarbarianEntity +{ + + /** + * Constructor of the entity. + * + * @param worldIn world to construct it in. + * @param type the entity type. + */ + public EntityChiefBarbarianRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } + + @Override + public void initStatsFor(final double baseHealth, final double difficulty, final double baseDamage) + { + super.initStatsFor(baseHealth, difficulty, baseDamage); + final double chiefArmor = difficulty * CHIEF_BONUS_ARMOR; + this.getAttribute(Attributes.ARMOR).setBaseValue(chiefArmor); + this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage + 1.0); + this.setEnvDamageInterval((int) (BASE_ENV_DAMAGE_RESIST * 2 * difficulty)); + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 1.5); + this.setHealth(this.getMaxHealth()); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/package-info.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/package-info.java new file mode 100755 index 00000000000..9264c336133 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/barbarians/package-info.java @@ -0,0 +1,4 @@ +/** + * Classes describing the Barbarian entities. + */ +package com.minecolonies.core.entity.mobs.raider.barbarians; \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/drownedpirates/EntityDrownedArcherPirateRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/drownedpirates/EntityDrownedArcherPirateRaider.java new file mode 100755 index 00000000000..f192f5ac9dd --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/drownedpirates/EntityDrownedArcherPirateRaider.java @@ -0,0 +1,39 @@ +package com.minecolonies.core.entity.mobs.raider.drownedpirates; + +import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirateRaider; +import com.minecolonies.api.entity.mobs.pirates.IArcherPirateEntity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.level.Level; + +/** + * Class for the Archer drowned Pirate entity. + */ +public class EntityDrownedArcherPirateRaider extends AbstractDrownedEntityPirateRaider implements IArcherPirateEntity +{ + /** + * Constructor of the entity. + * + * @param worldIn world to construct it in. + * @param type the entity type. + */ + public EntityDrownedArcherPirateRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } + + @Override + public boolean penetrateFluids() + { + return true; + } + + @Override + public void initStatsFor(final double baseHealth, final double difficulty, final double baseDamage) + { + super.initStatsFor(baseHealth, difficulty, baseDamage); + this.getAttribute(Attributes.ARMOR).setBaseValue(0.25); + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 1.5); + this.setHealth(this.getMaxHealth()); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/drownedpirates/EntityDrownedCaptainPirateRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/drownedpirates/EntityDrownedCaptainPirateRaider.java new file mode 100755 index 00000000000..d7dc17a4e28 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/drownedpirates/EntityDrownedCaptainPirateRaider.java @@ -0,0 +1,44 @@ +package com.minecolonies.core.entity.mobs.raider.drownedpirates; + +import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirateRaider; +import com.minecolonies.api.entity.mobs.pirates.ICaptainPirateEntity; +import com.minecolonies.api.util.MathUtils; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.level.Level; + +import static com.minecolonies.api.entity.mobs.RaiderMobUtils.MOB_ATTACK_DAMAGE; +import static com.minecolonies.api.util.constant.RaiderConstants.BASE_ENV_DAMAGE_RESIST; + +/** + * Class for the Chief Pirate entity. + */ +public class EntityDrownedCaptainPirateRaider extends AbstractDrownedEntityPirateRaider implements ICaptainPirateEntity +{ + /** + * Constructor of the entity. + * + * @param type the entity type. + * @param worldIn world to construct it in. + */ + public EntityDrownedCaptainPirateRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } + + @Override + public void initStatsFor(final double baseHealth, final double difficulty, final double baseDamage) + { + super.initStatsFor(baseHealth, difficulty, baseDamage); + this.getAttribute(Attributes.ARMOR).setBaseValue(-1); + this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage); + this.setEnvDamageInterval((int) (BASE_ENV_DAMAGE_RESIST * 2 * difficulty)); + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 2.0); + this.setHealth(this.getMaxHealth()); + if (MathUtils.RANDOM.nextInt(100) < 2) + { + setCustomName(Component.literal("Davy Jones")); + } + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/drownedpirates/EntityDrownedPirateRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/drownedpirates/EntityDrownedPirateRaider.java new file mode 100755 index 00000000000..20630d5b0f7 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/drownedpirates/EntityDrownedPirateRaider.java @@ -0,0 +1,36 @@ +package com.minecolonies.core.entity.mobs.raider.drownedpirates; + +import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirateRaider; +import com.minecolonies.api.entity.mobs.pirates.IMeleePirateEntity; +import com.minecolonies.core.entity.pathfinding.navigation.MovementHandler; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.level.Level; + +/** + * Class for the Pirate entity. + */ +public class EntityDrownedPirateRaider extends AbstractDrownedEntityPirateRaider implements IMeleePirateEntity +{ + + /** + * Constructor of the entity. + * + * @param type the entity type. + * @param worldIn world to construct it in. + */ + public EntityDrownedPirateRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + this.moveControl = new MovementHandler(this); + } + + @Override + public void initStatsFor(final double baseHealth, final double difficulty, final double baseDamage) + { + super.initStatsFor(baseHealth, difficulty, baseDamage); + this.getAttribute(Attributes.ARMOR).setBaseValue(0.25); + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 1.5); + this.setHealth(this.getMaxHealth()); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/EntityArcherMummyRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/EntityArcherMummyRaider.java new file mode 100755 index 00000000000..f6b74072ac0 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/EntityArcherMummyRaider.java @@ -0,0 +1,23 @@ +package com.minecolonies.core.entity.mobs.raider.egyptians; + +import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptianRaider; +import com.minecolonies.api.entity.mobs.egyptians.IArcherMummyEntity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.Level; + +/** + * Class for the Archer mummy entity. + */ +public class EntityArcherMummyRaider extends AbstractEntityEgyptianRaider implements IArcherMummyEntity +{ + /** + * Constructor of the entity. + * + * @param worldIn world to construct it in. + * @param type the entity type. + */ + public EntityArcherMummyRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/EntityMummyRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/EntityMummyRaider.java new file mode 100755 index 00000000000..15e3c4c7bbf --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/EntityMummyRaider.java @@ -0,0 +1,26 @@ +package com.minecolonies.core.entity.mobs.raider.egyptians; + +import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptianRaider; +import com.minecolonies.api.entity.mobs.egyptians.IMeleeMummyEntity; +import com.minecolonies.core.entity.pathfinding.navigation.MovementHandler; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.Level; + +/** + * Class for the Mummy entity. + */ +public class EntityMummyRaider extends AbstractEntityEgyptianRaider implements IMeleeMummyEntity +{ + + /** + * Constructor of the entity. + * + * @param type the entity type. + * @param worldIn world to construct it in. + */ + public EntityMummyRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + this.moveControl = new MovementHandler(this); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/EntityPharaoRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/EntityPharaoRaider.java new file mode 100755 index 00000000000..e33f967326f --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/EntityPharaoRaider.java @@ -0,0 +1,41 @@ +package com.minecolonies.core.entity.mobs.raider.egyptians; + +import com.minecolonies.api.entity.mobs.egyptians.AbstractEntityEgyptianRaider; +import com.minecolonies.api.entity.mobs.egyptians.IPharaoEntity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.level.Level; + +import static com.minecolonies.api.entity.mobs.RaiderMobUtils.MOB_ATTACK_DAMAGE; +import static com.minecolonies.api.util.constant.RaiderConstants.BASE_ENV_DAMAGE_RESIST; +import static com.minecolonies.api.util.constant.RaiderConstants.CHIEF_BONUS_ARMOR; + +/** + * Class for the Pharao entity. + */ +public class EntityPharaoRaider extends AbstractEntityEgyptianRaider implements IPharaoEntity +{ + + /** + * Constructor of the entity. + * + * @param type the entity type. + * @param worldIn world to construct it in. + */ + public EntityPharaoRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } + + @Override + public void initStatsFor(final double baseHealth, final double difficulty, final double baseDamage) + { + super.initStatsFor(baseHealth, difficulty, baseDamage); + final double chiefArmor = difficulty * CHIEF_BONUS_ARMOR; + this.getAttribute(Attributes.ARMOR).setBaseValue(chiefArmor); + this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage + 1.0); + this.setEnvDamageInterval((int) (BASE_ENV_DAMAGE_RESIST * 2 * difficulty)); + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 4.5); + this.setHealth(this.getMaxHealth()); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/package-info.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/package-info.java new file mode 100755 index 00000000000..ffaf42480a5 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/egyptians/package-info.java @@ -0,0 +1,4 @@ +/** + * Classes describing the Egyptian raiders. + */ +package com.minecolonies.core.entity.mobs.raider.egyptians; \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/EntityNorsemenArcherRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/EntityNorsemenArcherRaider.java new file mode 100755 index 00000000000..eb93d2ec60a --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/EntityNorsemenArcherRaider.java @@ -0,0 +1,24 @@ +package com.minecolonies.core.entity.mobs.raider.norsemen; + +import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemenRaider; +import com.minecolonies.api.entity.mobs.vikings.IArcherNorsemenEntity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.Level; + +/** + * Class for the Archer norsemen entity. + */ +public class EntityNorsemenArcherRaider extends AbstractEntityNorsemenRaider implements IArcherNorsemenEntity +{ + + /** + * Constructor of the entity. + * + * @param worldIn world to construct it in. + * @param type the entity type. + */ + public EntityNorsemenArcherRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/EntityNorsemenChiefRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/EntityNorsemenChiefRaider.java new file mode 100755 index 00000000000..ed894b1e719 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/EntityNorsemenChiefRaider.java @@ -0,0 +1,40 @@ +package com.minecolonies.core.entity.mobs.raider.norsemen; + +import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemenRaider; +import com.minecolonies.api.entity.mobs.vikings.INorsemenChiefEntity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.level.Level; + +import static com.minecolonies.api.entity.mobs.RaiderMobUtils.MOB_ATTACK_DAMAGE; +import static com.minecolonies.api.util.constant.RaiderConstants.BASE_ENV_DAMAGE_RESIST; +import static com.minecolonies.api.util.constant.RaiderConstants.CHIEF_BONUS_ARMOR; + +/** + * Class for the Chief norsemen entity. + */ +public class EntityNorsemenChiefRaider extends AbstractEntityNorsemenRaider implements INorsemenChiefEntity +{ + /** + * Constructor of the entity. + * + * @param worldIn world to construct it in. + * @param type the entity type. + */ + public EntityNorsemenChiefRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } + + @Override + public void initStatsFor(final double baseHealth, final double difficulty, final double baseDamage) + { + super.initStatsFor(baseHealth, difficulty, baseDamage); + final double chiefArmor = difficulty * CHIEF_BONUS_ARMOR; + this.getAttribute(Attributes.ARMOR).setBaseValue(chiefArmor); + this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage + 1.0); + this.setEnvDamageInterval((int) (BASE_ENV_DAMAGE_RESIST * 2 * difficulty)); + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 1.5); + this.setHealth(this.getMaxHealth()); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/EntityShieldmaidenRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/EntityShieldmaidenRaider.java new file mode 100755 index 00000000000..c23e4309cdf --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/EntityShieldmaidenRaider.java @@ -0,0 +1,24 @@ +package com.minecolonies.core.entity.mobs.raider.norsemen; + +import com.minecolonies.api.entity.mobs.vikings.AbstractEntityNorsemenRaider; +import com.minecolonies.api.entity.mobs.vikings.IMeleeNorsemenEntity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.Level; + +/** + * Class for the Norsemen Shieldmaiden entity. + */ +public class EntityShieldmaidenRaider extends AbstractEntityNorsemenRaider implements IMeleeNorsemenEntity +{ + + /** + * Constructor of the entity. + * + * @param worldIn world to construct it in. + * @param type the entity type. + */ + public EntityShieldmaidenRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/package-info.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/package-info.java new file mode 100755 index 00000000000..fc141751a02 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/norsemen/package-info.java @@ -0,0 +1,4 @@ +/** + * Classes describing the Norsemen entities. + */ +package com.minecolonies.core.entity.mobs.raider.norsemen; \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/EntityArcherPirateRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/EntityArcherPirateRaider.java new file mode 100755 index 00000000000..d66acdfd172 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/EntityArcherPirateRaider.java @@ -0,0 +1,23 @@ +package com.minecolonies.core.entity.mobs.raider.pirates; + +import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirateRaider; +import com.minecolonies.api.entity.mobs.pirates.IArcherPirateEntity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.Level; + +/** + * Class for the Archer Pirate entity. + */ +public class EntityArcherPirateRaider extends AbstractEntityPirateRaider implements IArcherPirateEntity +{ + /** + * Constructor of the entity. + * + * @param worldIn world to construct it in. + * @param type the entity type. + */ + public EntityArcherPirateRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/EntityCaptainPirateRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/EntityCaptainPirateRaider.java new file mode 100755 index 00000000000..a8cbedc2098 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/EntityCaptainPirateRaider.java @@ -0,0 +1,39 @@ +package com.minecolonies.core.entity.mobs.raider.pirates; + +import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirateRaider; +import com.minecolonies.api.entity.mobs.pirates.ICaptainPirateEntity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.level.Level; + +import static com.minecolonies.api.entity.mobs.RaiderMobUtils.MOB_ATTACK_DAMAGE; +import static com.minecolonies.api.util.constant.RaiderConstants.BASE_ENV_DAMAGE_RESIST; + +/** + * Class for the Chief Pirate entity. + */ +public class EntityCaptainPirateRaider extends AbstractEntityPirateRaider implements ICaptainPirateEntity +{ + + /** + * Constructor of the entity. + * + * @param type the entity type. + * @param worldIn world to construct it in. + */ + public EntityCaptainPirateRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + } + + @Override + public void initStatsFor(final double baseHealth, final double difficulty, final double baseDamage) + { + super.initStatsFor(baseHealth, difficulty, baseDamage); + this.getAttribute(Attributes.ARMOR).setBaseValue(-1); + this.getAttribute(MOB_ATTACK_DAMAGE.get()).setBaseValue(baseDamage + 2.0); + this.setEnvDamageInterval((int) (BASE_ENV_DAMAGE_RESIST * 2 * difficulty)); + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(baseHealth * 1.3); + this.setHealth(this.getMaxHealth()); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/EntityPirateRaider.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/EntityPirateRaider.java new file mode 100755 index 00000000000..ef7c4404aa8 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/EntityPirateRaider.java @@ -0,0 +1,26 @@ +package com.minecolonies.core.entity.mobs.raider.pirates; + +import com.minecolonies.api.entity.mobs.pirates.AbstractEntityPirateRaider; +import com.minecolonies.api.entity.mobs.pirates.IMeleePirateEntity; +import com.minecolonies.core.entity.pathfinding.navigation.MovementHandler; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.level.Level; + +/** + * Class for the Pirate entity. + */ +public class EntityPirateRaider extends AbstractEntityPirateRaider implements IMeleePirateEntity +{ + + /** + * Constructor of the entity. + * + * @param type the entity type. + * @param worldIn world to construct it in. + */ + public EntityPirateRaider(final EntityType type, final Level worldIn) + { + super(type, worldIn); + this.moveControl = new MovementHandler(this); + } +} diff --git a/src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/package-info.java b/src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/package-info.java new file mode 100755 index 00000000000..930b9dc3c13 --- /dev/null +++ b/src/main/java/com/minecolonies/core/entity/mobs/raider/pirates/package-info.java @@ -0,0 +1,4 @@ +/** + * Classes describing the pirate entities. + */ +package com.minecolonies.core.entity.mobs.raider.pirates; \ No newline at end of file diff --git a/src/main/java/com/minecolonies/core/entity/mobs/registry/MobAIRegistry.java b/src/main/java/com/minecolonies/core/entity/mobs/registry/MobAIRegistry.java index 04208cdaaab..d448bbab35d 100755 --- a/src/main/java/com/minecolonies/core/entity/mobs/registry/MobAIRegistry.java +++ b/src/main/java/com/minecolonies/core/entity/mobs/registry/MobAIRegistry.java @@ -3,17 +3,15 @@ import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import com.minecolonies.api.entity.ai.IStateAI; -import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirate; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesRaider; +import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirateRaider; import com.minecolonies.api.entity.mobs.registry.IMobAIRegistry; -import com.minecolonies.api.entity.mobs.AbstractEntityRaiderMob; +import com.minecolonies.api.entity.mobs.AbstractEntityMinecoloniesMonster; import com.minecolonies.api.entity.mobs.IArcherMobEntity; import com.minecolonies.api.entity.mobs.IRangedMobEntity; import com.minecolonies.core.entity.ai.minimal.EntityAIInteractToggleAble; import com.minecolonies.core.entity.citizen.EntityCitizen; -import com.minecolonies.core.entity.mobs.aitasks.EntityAIBreakDoor; -import com.minecolonies.core.entity.mobs.aitasks.RaiderMeleeAI; -import com.minecolonies.core.entity.mobs.aitasks.RaiderRangedAI; -import com.minecolonies.core.entity.mobs.aitasks.RaiderWalkAI; +import com.minecolonies.core.entity.mobs.aitasks.*; import com.minecolonies.core.util.MultimapCollector; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.ai.goal.Goal; @@ -31,9 +29,9 @@ public class MobAIRegistry implements IMobAIRegistry { - private final List> mobAiTasks = Lists.newArrayList(); - private final List> mobAiTargetTasks = Lists.newArrayList(); - private final List> mobStateAITasks = Lists.newArrayList(); + private final List> mobAiTasks = Lists.newArrayList(); + private final List> mobAiTargetTasks = Lists.newArrayList(); + private final List> mobStateAITasks = Lists.newArrayList(); public MobAIRegistry() { @@ -48,19 +46,20 @@ public MobAIRegistry() private static void setupMobAiTasks(final IMobAIRegistry registry) { registry - .registerNewAiTaskForMobs(PRIORITY_ZERO, FloatGoal::new, mob -> !(mob instanceof AbstractDrownedEntityPirate)) + .registerNewAiTaskForMobs(PRIORITY_ZERO, FloatGoal::new, mob -> !(mob instanceof AbstractDrownedEntityPirateRaider)) .registerNewAiTargetTaskForMobs(PRIORITY_THREE, mob -> new EntityAIInteractToggleAble(mob, FENCE_TOGGLE)) .registerNewAiTargetTaskForMobs(PRIORITY_THREE, mob -> new EntityAIBreakDoor(mob)) .registerNewAiTaskForMobs(PRIORITY_FIVE, mob -> new LookAtPlayerGoal(mob, Player.class, MAX_WATCH_DISTANCE)) .registerNewAiTaskForMobs(PRIORITY_SIX, mob -> new LookAtPlayerGoal(mob, EntityCitizen.class, MAX_WATCH_DISTANCE)) .registerNewStateAI(mob -> new RaiderMeleeAI<>(mob, mob.getAI()), mob -> !(mob instanceof IArcherMobEntity)) .registerNewStateAI(mob -> new RaiderRangedAI(mob, mob.getAI()), mob -> mob instanceof IRangedMobEntity) - .registerNewStateAI(mob -> new RaiderWalkAI(mob, mob.getAI()), mob -> true); + .registerNewStateAI(mob -> new RaiderWalkAI((AbstractEntityMinecoloniesRaider) mob, mob.getAI()), mob -> mob instanceof AbstractEntityMinecoloniesRaider) + .registerNewStateAI(mob -> new CampWalkAI(mob, mob.getAI()), mob -> !(mob instanceof AbstractEntityMinecoloniesRaider)); } @NotNull @Override - public Multimap getEntityAiTasksForMobs(final AbstractEntityRaiderMob mob) + public Multimap getEntityAiTasksForMobs(final AbstractEntityMinecoloniesMonster mob) { return mobAiTasks.stream().filter(wrapper -> wrapper.entityPredicate.test(mob)).collect(MultimapCollector.toMultimap( TaskInformationWrapper::getPriority, @@ -72,7 +71,7 @@ public Multimap getEntityAiTasksForMobs(final AbstractEntityRaide @NotNull @Override public IMobAIRegistry registerNewAiTaskForMobs( - final int priority, final Function aiTaskProducer, final Predicate applyPredicate) + final int priority, final Function aiTaskProducer, final Predicate applyPredicate) { mobAiTasks.add(new TaskInformationWrapper<>(priority, aiTaskProducer, applyPredicate)); return this; @@ -81,7 +80,7 @@ public IMobAIRegistry registerNewAiTaskForMobs( @NotNull @Override public IMobAIRegistry registerNewStateAI( - final Function aiTaskProducer, final Predicate applyPredicate) + final Function aiTaskProducer, final Predicate applyPredicate) { mobStateAITasks.add(new TaskInformationWrapper<>(0, aiTaskProducer, applyPredicate)); return this; @@ -89,9 +88,9 @@ public IMobAIRegistry registerNewStateAI( @NotNull @Override - public void applyToMob(final AbstractEntityRaiderMob mob) + public void applyToMob(final AbstractEntityMinecoloniesMonster mob) { - for (final TaskInformationWrapper task : mobStateAITasks) + for (final TaskInformationWrapper task : mobStateAITasks) { if (task.entityPredicate.test(mob)) { @@ -99,7 +98,7 @@ public void applyToMob(final AbstractEntityRaiderMob mob) } } - for (final TaskInformationWrapper task : mobAiTargetTasks) + for (final TaskInformationWrapper task : mobAiTargetTasks) { if (task.entityPredicate.test(mob)) { @@ -107,7 +106,7 @@ public void applyToMob(final AbstractEntityRaiderMob mob) } } - for (final TaskInformationWrapper task : mobAiTasks) + for (final TaskInformationWrapper task : mobAiTasks) { if (task.entityPredicate.test(mob)) { @@ -118,7 +117,7 @@ public void applyToMob(final AbstractEntityRaiderMob mob) @NotNull @Override - public Multimap getEntityAiTargetTasksForMobs(final AbstractEntityRaiderMob mob) + public Multimap getEntityAiTargetTasksForMobs(final AbstractEntityMinecoloniesMonster mob) { return mobAiTargetTasks.stream().filter(wrapper -> wrapper.getEntityPredicate().test(mob)).collect(MultimapCollector.toMultimap( TaskInformationWrapper::getPriority, @@ -130,7 +129,7 @@ public Multimap getEntityAiTargetTasksForMobs(final AbstractEntit @NotNull @Override public IMobAIRegistry registerNewAiTargetTaskForMobs( - final int priority, final Function aiTaskProducer, final Predicate applyPredicate) + final int priority, final Function aiTaskProducer, final Predicate applyPredicate) { mobAiTargetTasks.add(new TaskInformationWrapper<>(priority, aiTaskProducer, applyPredicate)); return this; @@ -143,13 +142,13 @@ public IMobAIRegistry registerNewAiTargetTaskForMobs( */ private static final class TaskInformationWrapper { - private final int priority; - private final Function aiTaskProducer; - private final Predicate entityPredicate; + private final int priority; + private final Function aiTaskProducer; + private final Predicate entityPredicate; TaskInformationWrapper( final int priority, - final Function aiTaskProducer, final Predicate entityPredicate) + final Function aiTaskProducer, final Predicate entityPredicate) { this.priority = priority; this.aiTaskProducer = aiTaskProducer; @@ -161,7 +160,7 @@ public int getPriority() return priority; } - public Function getAiTaskProducer() + public Function getAiTaskProducer() { return aiTaskProducer; } diff --git a/src/main/java/com/minecolonies/core/entity/pathfinding/PathfindingUtils.java b/src/main/java/com/minecolonies/core/entity/pathfinding/PathfindingUtils.java index 6cb69926fc3..c58ce47c8c4 100644 --- a/src/main/java/com/minecolonies/core/entity/pathfinding/PathfindingUtils.java +++ b/src/main/java/com/minecolonies/core/entity/pathfinding/PathfindingUtils.java @@ -3,7 +3,7 @@ import com.ldtteam.domumornamentum.block.decorative.PanelBlock; import com.ldtteam.domumornamentum.block.vanilla.TrapdoorBlock; import com.minecolonies.api.blocks.huts.AbstractBlockMinecoloniesDefault; -import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirate; +import com.minecolonies.api.entity.mobs.drownedpirate.AbstractDrownedEntityPirateRaider; import com.minecolonies.api.items.ModTags; import com.minecolonies.api.util.ShapeUtil; import com.minecolonies.core.Network; @@ -122,7 +122,7 @@ public static BlockPos prepareStart(@NotNull final LivingEntity entity) final Block b = bs.getBlock(); - if (entity.isInWater() && !(entity instanceof AbstractDrownedEntityPirate)) + if (entity.isInWater() && !(entity instanceof AbstractDrownedEntityPirateRaider)) { while (!bs.getFluidState().isEmpty()) { diff --git a/src/main/java/com/minecolonies/core/event/ClientRegistryHandler.java b/src/main/java/com/minecolonies/core/event/ClientRegistryHandler.java index d1be1713109..7db0862f148 100644 --- a/src/main/java/com/minecolonies/core/event/ClientRegistryHandler.java +++ b/src/main/java/com/minecolonies/core/event/ClientRegistryHandler.java @@ -280,6 +280,8 @@ public static void doClientStuff(final EntityRenderersEvent.RegisterRenderers ev event.registerEntityRenderer(ModEntities.MC_NORMAL_ARROW, TippableArrowRenderer::new); event.registerEntityRenderer(ModEntities.DRUID_POTION, m -> new ThrownItemRenderer<>(m, 1.0F, true)); + // Raiders + event.registerEntityRenderer(ModEntities.BARBARIAN, RendererBarbarian::new); event.registerEntityRenderer(ModEntities.ARCHERBARBARIAN, RendererBarbarian::new); event.registerEntityRenderer(ModEntities.CHIEFBARBARIAN, RendererChiefBarbarian::new); @@ -304,6 +306,34 @@ public static void doClientStuff(final EntityRenderersEvent.RegisterRenderers ev event.registerEntityRenderer(ModEntities.DROWNED_ARCHERPIRATE, RendererDrownedArcherPirate::new); event.registerEntityRenderer(ModEntities.DROWNED_CHIEFPIRATE, RendererDrownedChiefPirate::new); + // Camp Raiders + + event.registerEntityRenderer(ModEntities.CAMP_BARBARIAN, RendererBarbarian::new); + event.registerEntityRenderer(ModEntities.CAMP_ARCHERBARBARIAN, RendererBarbarian::new); + event.registerEntityRenderer(ModEntities.CAMP_CHIEFBARBARIAN, RendererChiefBarbarian::new); + + event.registerEntityRenderer(ModEntities.CAMP_PIRATE, RendererPirate::new); + event.registerEntityRenderer(ModEntities.CAMP_ARCHERPIRATE, RendererArcherPirate::new); + event.registerEntityRenderer(ModEntities.CAMP_CHIEFPIRATE, RendererChiefPirate::new); + + event.registerEntityRenderer(ModEntities.CAMP_MUMMY, RendererMummy::new); + event.registerEntityRenderer(ModEntities.CAMP_ARCHERMUMMY, RendererArcherMummy::new); + event.registerEntityRenderer(ModEntities.CAMP_PHARAO, RendererPharao::new); + + event.registerEntityRenderer(ModEntities.CAMP_SHIELDMAIDEN, RendererShieldmaidenNorsemen::new); + event.registerEntityRenderer(ModEntities.CAMP_NORSEMEN_ARCHER, RendererArcherNorsemen::new); + event.registerEntityRenderer(ModEntities.CAMP_NORSEMEN_CHIEF, RendererChiefNorsemen::new); + + event.registerEntityRenderer(ModEntities.CAMP_AMAZON, RendererAmazon::new); + event.registerEntityRenderer(ModEntities.CAMP_AMAZONCHIEF, RendererChiefAmazon::new); + event.registerEntityRenderer(ModEntities.CAMP_AMAZONSPEARMAN, RendererAmazonSpearman::new); + + event.registerEntityRenderer(ModEntities.CAMP_DROWNED_PIRATE, RendererDrownedPirate::new); + event.registerEntityRenderer(ModEntities.CAMP_DROWNED_ARCHERPIRATE, RendererDrownedArcherPirate::new); + event.registerEntityRenderer(ModEntities.CAMP_DROWNED_CHIEFPIRATE, RendererDrownedChiefPirate::new); + + // Misc + event.registerEntityRenderer(ModEntities.MERCENARY, RenderMercenary::new); event.registerEntityRenderer(ModEntities.SITTINGENTITY, RenderSitting::new); event.registerEntityRenderer(ModEntities.MINECART, (context) -> new MinecartRenderer<>(context, ModelLayers.MINECART)); diff --git a/src/main/java/com/minecolonies/core/generation/defaults/DefaultDamageTypeProvider.java b/src/main/java/com/minecolonies/core/generation/defaults/DefaultDamageTypeProvider.java index 830d828b5ca..d91c4d3caab 100644 --- a/src/main/java/com/minecolonies/core/generation/defaults/DefaultDamageTypeProvider.java +++ b/src/main/java/com/minecolonies/core/generation/defaults/DefaultDamageTypeProvider.java @@ -60,7 +60,27 @@ private static Map getDamageTypes() Map.entry(DamageSourceKeys.VISITOR.location(), entityDamage(ModEntities.VISITOR)), Map.entry(DamageSourceKeys.DROWNED_PIRATE.location(), entityDamage(ModEntities.DROWNED_PIRATE)), Map.entry(DamageSourceKeys.DROWNED_ARCHERPIRATE.location(), entityDamage(ModEntities.DROWNED_ARCHERPIRATE)), - Map.entry(DamageSourceKeys.DROWNED_CHIEFPIRATE.location(), entityDamage(ModEntities.DROWNED_CHIEFPIRATE)) + Map.entry(DamageSourceKeys.DROWNED_CHIEFPIRATE.location(), entityDamage(ModEntities.DROWNED_CHIEFPIRATE)), + + Map.entry(DamageSourceKeys.CAMP_AMAZON.location(), entityDamage(ModEntities.CAMP_AMAZON)), + Map.entry(DamageSourceKeys.CAMP_AMAZONCHIEF.location(), entityDamage(ModEntities.CAMP_AMAZONCHIEF)), + Map.entry(DamageSourceKeys.CAMP_AMAZONSPEARMAN.location(), entityDamage(ModEntities.CAMP_AMAZONSPEARMAN)), + + Map.entry(DamageSourceKeys.CAMP_BARBARIAN.location(), entityDamage(ModEntities.CAMP_BARBARIAN)), + Map.entry(DamageSourceKeys.CAMP_CHIEFBARBARIAN.location(), entityDamage(ModEntities.CAMP_CHIEFBARBARIAN)), + Map.entry(DamageSourceKeys.CAMP_ARCHERBARBARIAN.location(), entityDamage(ModEntities.CAMP_ARCHERBARBARIAN)), + + Map.entry(DamageSourceKeys.CAMP_MUMMY.location(), entityDamage(ModEntities.CAMP_MUMMY)), + Map.entry(DamageSourceKeys.CAMP_ARCHERMUMMY.location(), entityDamage(ModEntities.CAMP_ARCHERMUMMY)), + Map.entry(DamageSourceKeys.CAMP_PHARAO.location(), entityDamage(ModEntities.CAMP_PHARAO)), + + Map.entry(DamageSourceKeys.CAMP_PIRATE.location(), entityDamage(ModEntities.CAMP_PIRATE)), + Map.entry(DamageSourceKeys.CAMP_ARCHERPIRATE.location(), entityDamage(ModEntities.CAMP_ARCHERPIRATE)), + Map.entry(DamageSourceKeys.CAMP_CHIEFPIRATE.location(), entityDamage(ModEntities.CAMP_CHIEFPIRATE)), + + Map.entry(DamageSourceKeys.CAMP_NORSEMENARCHER.location(), entityDamage(ModEntities.CAMP_NORSEMEN_ARCHER)), + Map.entry(DamageSourceKeys.CAMP_NORSEMENCHIEF.location(), entityDamage(ModEntities.CAMP_NORSEMEN_CHIEF)), + Map.entry(DamageSourceKeys.CAMP_SHIELDMAIDEN.location(), entityDamage(ModEntities.CAMP_SHIELDMAIDEN)) ); } diff --git a/src/main/java/com/minecolonies/core/items/ItemChiefSword.java b/src/main/java/com/minecolonies/core/items/ItemChiefSword.java index 30c84451e6c..0d4a9ad0dfa 100755 --- a/src/main/java/com/minecolonies/core/items/ItemChiefSword.java +++ b/src/main/java/com/minecolonies/core/items/ItemChiefSword.java @@ -1,7 +1,7 @@ package com.minecolonies.core.items; import com.minecolonies.api.entity.mobs.RaiderMobUtils; -import com.minecolonies.api.entity.mobs.barbarians.AbstractEntityBarbarian; +import com.minecolonies.api.entity.mobs.barbarians.AbstractEntityBarbarianRaider; import com.minecolonies.api.items.IChiefSwordItem; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; @@ -46,7 +46,7 @@ public void inventoryTick(final ItemStack stack, final Level worldIn, final Enti @Override public boolean hurtEnemy(final ItemStack stack, final LivingEntity target, @NotNull final LivingEntity attacker) { - if (attacker instanceof Player && target instanceof AbstractEntityBarbarian) + if (attacker instanceof Player && target instanceof AbstractEntityBarbarianRaider) { target.addEffect(new MobEffectInstance(LEVITATION_EFFECT, LEVITATION_EFFECT_DURATION, LEVITATION_EFFECT_MULTIPLIER)); } diff --git a/src/main/resources/assets/minecolonies/lang/manual_en_us.json b/src/main/resources/assets/minecolonies/lang/manual_en_us.json index 20f4fc361d8..c9b1624ac4b 100644 --- a/src/main/resources/assets/minecolonies/lang/manual_en_us.json +++ b/src/main/resources/assets/minecolonies/lang/manual_en_us.json @@ -1119,6 +1119,9 @@ "item.minecolonies.pirateegg": "Pirate Spawn Egg", "item.minecolonies.piratearcheregg": "Archer Pirate Spawn Egg", "item.minecolonies.piratecaptainegg": "Pirate Captain Spawn Egg", + "item.minecolonies.drownedpirateegg": "Drowned Pirate Spawn Egg", + "item.minecolonies.drownedpiratearcheregg": "Drowned Archer Pirate Spawn Egg", + "item.minecolonies.drownedpiratecaptainegg": "Drowned Pirate Captain Spawn Egg", "item.minecolonies.mercegg": "Mercenary Spawn Egg", "com.minecolonies.coremod.cook.serve.player": "%s: Here Governor, take this food!", @@ -1872,6 +1875,11 @@ "item.minecolonies.amazonegg": "Amazon Spawn Egg", "item.minecolonies.amazonspearmanegg": "Amazon Spearman Spawn Egg", "item.minecolonies.amazonchiefegg": "Amazon Leader Spawn Egg", + + "item.minecolonies.mummyegg": "Mummy Spawn Egg", + "item.minecolonies.mummyarcheregg": "Archer Mummy Spawn Egg", + "item.minecolonies.pharaoegg": "Pharao Spawn Egg", + "com.minecolonies.coremod.playerinvfull": "You can't pick up this item, as your inventory is full!", "com.minecolonies.coremod.playerinvfull.hotbarinsert": " was dropped in front of you, as your inventory is full!", diff --git a/src/main/resources/assets/minecolonies/models/item/drownedpiratearcheregg.json b/src/main/resources/assets/minecolonies/models/item/drownedpiratearcheregg.json new file mode 100755 index 00000000000..fb8b11e6670 --- /dev/null +++ b/src/main/resources/assets/minecolonies/models/item/drownedpiratearcheregg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +} diff --git a/src/main/resources/assets/minecolonies/models/item/drownedpiratecaptainegg.json b/src/main/resources/assets/minecolonies/models/item/drownedpiratecaptainegg.json new file mode 100755 index 00000000000..fb8b11e6670 --- /dev/null +++ b/src/main/resources/assets/minecolonies/models/item/drownedpiratecaptainegg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +} diff --git a/src/main/resources/assets/minecolonies/models/item/drownedpirateegg.json b/src/main/resources/assets/minecolonies/models/item/drownedpirateegg.json new file mode 100755 index 00000000000..fb8b11e6670 --- /dev/null +++ b/src/main/resources/assets/minecolonies/models/item/drownedpirateegg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +}