Merge remote-tracking branch 'origin/1.21' into 1.21

This commit is contained in:
DBotThePony 2024-10-08 09:40:06 +07:00
commit e13ab9f087
Signed by: DBot
GPG Key ID: DCC23B5715498507
3 changed files with 7 additions and 4 deletions

View File

@ -418,6 +418,7 @@ class MatteryPlayer(val ply: Player) {
val enderSortingSettings = IItemStackSortingSettings.Impl()
fun recreateExoPackMenu() {
if (_exoPackMenu == null) return
_exoPackMenu = ExopackInventoryMenu(this)
}

View File

@ -5,12 +5,13 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams
import net.minecraft.world.level.storage.loot.predicates.InvertedLootItemCondition
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition
import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType
import net.neoforged.neoforge.common.util.FakePlayer
import ru.dbotthepony.mc.otm.data.get
import ru.dbotthepony.mc.otm.registry.MLootItemConditions
object KilledByRealPlayer : LootItemCondition, LootItemCondition.Builder {
override fun test(t: LootContext): Boolean {
return t.hasParam(LootContextParams.LAST_DAMAGE_PLAYER) //&& t[LootContextParams.LAST_DAMAGE_PLAYER] !is FakePlayer
return t.hasParam(LootContextParams.LAST_DAMAGE_PLAYER) && t[LootContextParams.LAST_DAMAGE_PLAYER] !is FakePlayer
}
override fun getType(): LootItemConditionType {

View File

@ -6,13 +6,14 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams
import net.minecraft.world.level.storage.loot.predicates.InvertedLootItemCondition
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition
import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType
import net.neoforged.neoforge.common.util.FakePlayer
import ru.dbotthepony.mc.otm.NULLABLE_MINECRAFT_SERVER
import ru.dbotthepony.mc.otm.data.get
import ru.dbotthepony.mc.otm.registry.MLootItemConditions
object KilledByRealPlayerOrIndirectly : LootItemCondition, LootItemCondition.Builder {
override fun test(t: LootContext): Boolean {
if (t.hasParam(LootContextParams.LAST_DAMAGE_PLAYER) /*&& t[LootContextParams.LAST_DAMAGE_PLAYER] !is FakePlayer*/) {
if (t.hasParam(LootContextParams.LAST_DAMAGE_PLAYER) && t[LootContextParams.LAST_DAMAGE_PLAYER] !is FakePlayer) {
return true
}
@ -22,12 +23,12 @@ object KilledByRealPlayerOrIndirectly : LootItemCondition, LootItemCondition.Bui
if (killer != null) {
val owner = killer.owner
if (owner != null /*&& owner !is FakePlayer*/) {
if (owner != null && owner !is FakePlayer) {
return true
}
val ply = NULLABLE_MINECRAFT_SERVER?.playerList?.getPlayer(killer.ownerUUID ?: return false)
return ply != null //&& ply !is FakePlayer
return ply != null && ply !is FakePlayer
}
}