Skip to content

Arch 1.18.2 #539

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: arch-1.19.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,48 @@

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 {

/**
* @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<? extends LivingEntity> method_30249(AbstractPiglinEntity abstractPiglinEntity, MemoryModuleType<? extends LivingEntity> 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<Boolean> 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<Boolean> cir) {
if(livingEntity instanceof PlayerEntity player) {
LivingEntity identity = PlayerIdentity.getIdentity(player);

if(identity != null && !(identity instanceof WitherSkeletonEntity) && !(identity instanceof WitherEntity)) {
cir.setReturnValue(false);
}
}
}
}
31 changes: 31 additions & 0 deletions common/src/main/resources/assets/identity/lang/ko_kr.json
Original file line number Diff line number Diff line change
@@ -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 능력 사용"
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down