diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 6994b77..585db44 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -11,4 +11,4 @@ assignees: '' *A description of what you expected to happen and what actually happened.* **Game log:** -*Upload your game log through [hastebin](https://hastebin.com/) and provide the link. Do not paste the link directly into the submission box or comments.* +*Upload your game log through [GitHub Gist](https://gist.github.com/) and provide the link. Do not paste the file or its contents directly into the submission box or comments.* diff --git a/common/src/main/java/draylar/identity/mixin/PiglinBruteBrainMixin.java b/common/src/main/java/draylar/identity/mixin/PiglinBruteBrainMixin.java index 9f58613..4ca672b 100644 --- a/common/src/main/java/draylar/identity/mixin/PiglinBruteBrainMixin.java +++ b/common/src/main/java/draylar/identity/mixin/PiglinBruteBrainMixin.java @@ -2,16 +2,16 @@ import draylar.identity.api.PlayerIdentity; import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.ai.brain.MemoryModuleType; import net.minecraft.entity.boss.WitherEntity; import net.minecraft.entity.mob.AbstractPiglinEntity; import net.minecraft.entity.mob.PiglinBruteBrain; import net.minecraft.entity.mob.WitherSkeletonEntity; import net.minecraft.entity.player.PlayerEntity; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; - -import java.util.Optional; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Group; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(PiglinBruteBrain.class) public class PiglinBruteBrainMixin { @@ -19,21 +19,31 @@ public class PiglinBruteBrainMixin { /** * @author Draylar * - * @reason method_30249 searches for a nearby player to aggro on. + * @reason method_30255 is the desugared lambda used by method_30249 that searches for a nearby player to aggro on. * This mixin modifies the search logic to exclude players disguised as anything besides a Wither Skeleton or Wither. + * We target fabric and forge separately due to arch not being able to find the backed methods of the targeted lambdas */ - @Overwrite - private static Optional method_30249(AbstractPiglinEntity abstractPiglinEntity, MemoryModuleType memoryModuleType) { - return abstractPiglinEntity.getBrain().getOptionalMemory(memoryModuleType).filter((livingEntity) -> { - if(livingEntity instanceof PlayerEntity player) { - LivingEntity identity = PlayerIdentity.getIdentity(player); + @Group(name = "method_30249FilterLambda", min = 1, max = 1) + @Inject( method = "method_30255", at = @At("HEAD"), expect = 0, cancellable = true) + private static void identity$method_30249FilterLambdaIntermediary(AbstractPiglinEntity abstractPiglinEntity, LivingEntity livingEntity, CallbackInfoReturnable cir) { + if(livingEntity instanceof PlayerEntity player) { + LivingEntity identity = PlayerIdentity.getIdentity(player); - if(identity != null && !(identity instanceof WitherSkeletonEntity) && !(identity instanceof WitherEntity)) { - return false; - } + if(identity != null && !(identity instanceof WitherSkeletonEntity) && !(identity instanceof WitherEntity)) { + cir.setReturnValue(false); } + } + } - return livingEntity.isInRange(abstractPiglinEntity, 12.0D); - }); + @Group(name = "method_30249FilterLambda", min = 1, max = 1) + @Inject(method = "m_35106_", at = @At("HEAD"), remap = false, expect = 0, cancellable = true) + private static void identity$method_30249FilterLambdaSRG(AbstractPiglinEntity abstractPiglinEntity, LivingEntity livingEntity, CallbackInfoReturnable cir) { + if(livingEntity instanceof PlayerEntity player) { + LivingEntity identity = PlayerIdentity.getIdentity(player); + + if(identity != null && !(identity instanceof WitherSkeletonEntity) && !(identity instanceof WitherEntity)) { + cir.setReturnValue(false); + } + } } } diff --git a/common/src/main/resources/assets/identity/lang/ko_kr.json b/common/src/main/resources/assets/identity/lang/ko_kr.json new file mode 100644 index 0000000..b694005 --- /dev/null +++ b/common/src/main/resources/assets/identity/lang/ko_kr.json @@ -0,0 +1,31 @@ +{ + "identity.unlock_entity": "%s 특성 잠금이 해제되었습니다.", + "identity.revoke_entity": "%s에 대한 당신의 기억이 먼지가 되어 사라집니다...", + "identity.grant_success": "%s에게서 %s 특성을 성공적으로 얻었습니다.", + "identity.revoke_success": "성공적으로 %s에게서 얻은 %s 특성을 지웠습니다.", + "identity.already_has": "%s은(는) 이미 %s 특성을 가지고 있습니다!", + "identity.does_not_have": "%s은(는) %s 특성을 가지고 있지 않습니다!", + "identity.equip_success": "%s에게 %s 특성을 장착했습니다.", + "identity.unequip_success": "%s의 특성이 삭제되었습니다.", + "identity.test_positive": "%s는(은) %s로 위장되었습니다.", + "identity.test_failed": "%s는(은) %s로 위장하지 못했습니다.", + "identity.menu_hint": "특성을 얻으려면, 세상에 존재하는 생명체를 죽이세요...", + "identity.help": "Identity 도움말 메뉴 열기", + "identity.help.welcome": "Draylar가 패브릭으로 빌드 한 Morph 모드의 현대 버전인 Identity를 사용하시는 걸 환영합니다.", + "identity.help.credits": "버그 제보 및 제안을 통해 Identity를 도와주시는 모든 분께 감사드립니다!", + "identity.help.support_label": "문제가 생기셨거나 제안하실 내용이 있나요?", + "identity.help.support_description": "Identity GitHub 저장소 https://github.com/Draylar/identity에 연결합니다.", + "identity.help.ability_label": "능력 사용", + "identity.help.ability_description_1": "몬스터의 능력을 사용하려면, R 키를 누르세요.", + "identity.help.ability_description_2": "능력을 다시 사용할 수 있기까지 남은 쿨타임은 화면 오른쪽 하단에 표시됩니다.", + "identity.help.ability_description_3": "모든 능력에 대한 정보는 https://github.com/Draylar/identity/wiki/Abilities를 방문하세요.", + "identity.help.config_label": "Identity 환경설정하는 법", + "identity.help.config_description": "/config/identity.json5에 있는 config 파일에서 모드의 모든 요소를 제어할 수 있습니다.", + "identity.help.credits_label": "크레딧", + "identity.help.credits_general": "일반: Pyrofab, AllanChain, James103, lawleagle", + "identity.help.credits_translators": "번역: qsefthuopq, Godzmoline, SmajloSlovakian, Juuxel, cominixo, CDAGaming, gyular", + "identity.help.return": "Identity 메뉴로 돌아가려면 아무 키나 누르세요.", + "key.categories.identity": "Identity", + "key.identity": "Identity 메뉴 열기", + "key.identity_ability": "Identity 능력 사용" +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 330969f..70c6259 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx2G # Base Versions minecraft_version=1.18.2 archives_base_name=identity -mod_version=2.3.0 +mod_version=2.3.1 maven_group=dev.draylar # Loader Versions