关于千年村庄的信息可以从这里查看
版本:1.12.2
千年村庄中的村民有一种奇怪的伤害判定机制,似乎只能被实体发出的攻击所伤害,而无法被类似虚空、岩浆等自然伤害所伤害,但可被玩家(包括但不限于投掷药水,弓箭射击,近战攻击)和怪物攻击;
实测发现玩家手动投掷的伤害药水可对村民造成伤害,但若是以红石触发发射器投掷伤害药水,则无法对村民造成伤害,且使用IC2中的工业tnt也是同理,若玩家放置后手动破坏该工业tnt,则可以造成伤害,若使用红石引燃,则不可造成伤害,故推测该mod内的村民只接受来自实体的攻击伤害。
请问是否有方法可以移除这一特性使其与普通实体一样可受到任意伤害(包括上文所提及的自然伤害(例: 虚空、岩浆、由红石触发的工业tnt)),若无,则请阐明原因。
以上
版本:1.12.2
千年村庄中的村民有一种奇怪的伤害判定机制,似乎只能被实体发出的攻击所伤害,而无法被类似虚空、岩浆等自然伤害所伤害,但可被玩家(包括但不限于投掷药水,弓箭射击,近战攻击)和怪物攻击;
实测发现玩家手动投掷的伤害药水可对村民造成伤害,但若是以红石触发发射器投掷伤害药水,则无法对村民造成伤害,且使用IC2中的工业tnt也是同理,若玩家放置后手动破坏该工业tnt,则可以造成伤害,若使用红石引燃,则不可造成伤害,故推测该mod内的村民只接受来自实体的攻击伤害。
请问是否有方法可以移除这一特性使其与普通实体一样可受到任意伤害(包括上文所提及的自然伤害(例: 虚空、岩浆、由红石触发的工业tnt)),若无,则请阐明原因。
以上
- public boolean func_70097_a(DamageSource ds, float i) {
- UserProfile serverProfile;
- if (ds.func_76346_g() == null && ds != DamageSource.field_76380_i) {
- return false;
- }
- boolean hadFullHealth = func_110138_aP() == func_110143_aJ();
- boolean b = super.func_70097_a(ds, i);
- EntityPlayer func_76346_g = ds.func_76346_g();
- this.lastAttackByPlayer = false;
- if (func_76346_g != null && (func_76346_g instanceof EntityLivingBase)) {
- if (func_76346_g instanceof EntityPlayer) {
- if (!func_76346_g.func_175149_v() && !func_76346_g.func_184812_l_()) {
- this.lastAttackByPlayer = true;
- EntityPlayer player = func_76346_g;
- if (!this.isRaider) {
- if (this.vtype != null && !this.vtype.hostile && (serverProfile = VillageUtilities.getServerProfile(player.field_70170_p, player)) != null) {
- serverProfile.adjustReputation(getTownHall(), (int) ((-i) * 10.0f));
- }
- if (this.field_70170_p.func_175659_aa() != EnumDifficulty.PEACEFUL && func_110143_aJ() < func_110138_aP() - 10.0f) {
- func_70624_b((EntityLivingBase) func_76346_g);
- clearGoal();
- if (getTownHall() != null) {
- getTownHall().callForHelp((EntityLivingBase) func_76346_g);
- }
- }
- if (this.vtype != null && !this.vtype.hostile && hadFullHealth && ((player.func_184586_b(EnumHand.MAIN_HAND) == null || MillCommonUtilities.getItemWeaponDamage(player.func_184607_cu().func_77973_b()) <= 1.0d) && !this.field_70170_p.field_72995_K)) {
- ServerSender.sendTranslatedSentence(player, '6', "ui.communicationexplanations", new String[0]);
- }
- }
- if (this.lastAttackByPlayer && func_110143_aJ() <= 0.0f) {
- if (this.vtype != null && this.vtype.hostile) {
- MillAdvancements.SELF_DEFENSE.grant(player);
- } else {
- MillAdvancements.DARK_SIDE.grant(player);
- }
- }
- }
- } else if (func_76346_g instanceof MillVillager) {
- MillVillager attackingVillager = (MillVillager) func_76346_g;
- if (this.isRaider != attackingVillager.isRaider || getTownHall() != attackingVillager.getTownHall()) {
- func_70624_b((EntityLivingBase) func_76346_g);
- clearGoal();
- if (getTownHall() != null) {
- getTownHall().callForHelp((EntityLivingBase) func_76346_g);
- }
- }
- } else {
- func_70624_b((EntityLivingBase) func_76346_g);
- clearGoal();
- if (getTownHall() != null) {
- getTownHall().callForHelp((EntityLivingBase) func_76346_g);
- }
- }
- }
- return b;
- }
删除方法或始终为true即可
krewella 发表于 2023-6-2 18:21
删除方法或始终为true即可
请问该文件的路径是?
等枫亭丶烟雨阁 发表于 2023-6-2 18:24
请问该文件的路径是?
org/millenaire/common/entity/MillVillager.class
krewella 发表于 2023-6-2 18:21
删除方法或始终为true即可
这可不能删,许多方法关系到玩家声望和村民台词之类的处理,要删的只有开头两句而已

等枫亭丶烟雨阁 发表于 2023-6-2 18:42
请问可否将已编译好的class文件上传?
我曾尝试反编译修改源码再编译,但似乎编译时出现了些问题 ...
DEFINE PUBLIC func_70097_a(Lnet/minecraft/util/DamageSource; ds, F i)Z
A:
ICONST_1
IRETURN
无敌三脚猫 发表于 2023-6-2 19:23
这可不能删,许多方法关系到玩家声望和村民台词之类的处理,要删的只有开头两句而已 ...
使用您修改过的class文件后,大部分伤害都已正常,但仍有一部分伤害处于异常状态
例:岩浆伤害、ic2的辐射效果等均无法造成伤害
等枫亭丶烟雨阁 发表于 2023-6-2 20:16
使用您修改过的class文件后,大部分伤害都已正常,但仍有一部分伤害处于异常状态
例:岩浆伤害、ic2的辐 ...

试试这个
等枫亭丶烟雨阁 发表于 2023-6-2 20:16
使用您修改过的class文件后,大部分伤害都已正常,但仍有一部分伤害处于异常状态
例:岩浆伤害、ic2的辐 ...
辐射伤害是没问题了吗?
krewella 发表于 2023-6-2 21:52
辐射伤害是没问题了吗?
是的,辐射伤害已经正常了
等枫亭丶烟雨阁 发表于 2023-6-2 20:16
使用您修改过的class文件后,大部分伤害都已正常,但仍有一部分伤害处于异常状态
例:岩浆伤害、ic2的辐 ...
