Bump forge to 48.0.19, remove fakeplayer references

This commit is contained in:
DBotThePony 2023-10-08 09:53:47 +07:00
parent c32a5bf71b
commit 187038c5e3
Signed by: DBot
GPG Key ID: DCC23B5715498507
5 changed files with 6 additions and 16 deletions

View File

@ -15,7 +15,7 @@ jei_mc_version=1.20.2
curios_mc_version=1.20 curios_mc_version=1.20
forge_gradle_version=[6.0,6.2) forge_gradle_version=[6.0,6.2)
forge_version=48.0.13 forge_version=48.0.19
mixingradle_version=0.7.33 mixingradle_version=0.7.33
mixin_version=0.8.5 mixin_version=0.8.5

View File

@ -545,7 +545,7 @@ object DataGen {
trapdoor(MBlocks.TRITANIUM_TRAPDOOR[null]!!, modLocation("block/decorative/tritanium_trapdoor")) trapdoor(MBlocks.TRITANIUM_TRAPDOOR[null]!!, modLocation("block/decorative/tritanium_trapdoor"))
for (color in DyeColor.values()) for (color in DyeColor.entries)
trapdoor(MBlocks.TRITANIUM_TRAPDOOR[color]!!, modLocation("block/decorative/tritanium_trapdoor_${color.name.lowercase()}")) trapdoor(MBlocks.TRITANIUM_TRAPDOOR[color]!!, modLocation("block/decorative/tritanium_trapdoor_${color.name.lowercase()}"))
addBlockModels(blockModelProvider) addBlockModels(blockModelProvider)

View File

@ -5,13 +5,12 @@ 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.InvertedLootItemCondition
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition import net.minecraft.world.level.storage.loot.predicates.LootItemCondition
import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType
import net.minecraftforge.common.util.FakePlayer
import ru.dbotthepony.mc.otm.data.get import ru.dbotthepony.mc.otm.data.get
import ru.dbotthepony.mc.otm.registry.MLootItemConditions import ru.dbotthepony.mc.otm.registry.MLootItemConditions
object KilledByRealPlayer : LootItemCondition, LootItemCondition.Builder { object KilledByRealPlayer : LootItemCondition, LootItemCondition.Builder {
override fun test(t: LootContext): Boolean { 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 { override fun getType(): LootItemConditionType {

View File

@ -6,14 +6,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.InvertedLootItemCondition
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition import net.minecraft.world.level.storage.loot.predicates.LootItemCondition
import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType
import net.minecraftforge.common.util.FakePlayer
import ru.dbotthepony.mc.otm.NULLABLE_MINECRAFT_SERVER import ru.dbotthepony.mc.otm.NULLABLE_MINECRAFT_SERVER
import ru.dbotthepony.mc.otm.data.get import ru.dbotthepony.mc.otm.data.get
import ru.dbotthepony.mc.otm.registry.MLootItemConditions import ru.dbotthepony.mc.otm.registry.MLootItemConditions
object KilledByRealPlayerOrIndirectly : LootItemCondition, LootItemCondition.Builder { object KilledByRealPlayerOrIndirectly : LootItemCondition, LootItemCondition.Builder {
override fun test(t: LootContext): Boolean { 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 return true
} }
@ -23,12 +22,12 @@ object KilledByRealPlayerOrIndirectly : LootItemCondition, LootItemCondition.Bui
if (killer != null) { if (killer != null) {
val owner = killer.owner val owner = killer.owner
if (owner != null && owner !is FakePlayer) { if (owner != null /*&& owner !is FakePlayer*/) {
return true return true
} }
val ply = NULLABLE_MINECRAFT_SERVER?.playerList?.getPlayer(killer.ownerUUID ?: return false) val ply = NULLABLE_MINECRAFT_SERVER?.playerList?.getPlayer(killer.ownerUUID ?: return false)
return ply != null && ply !is FakePlayer return ply != null //&& ply !is FakePlayer
} }
} }

View File

@ -11,8 +11,6 @@ import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.player.Player import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.* import net.minecraft.world.item.*
import net.minecraft.world.level.Level import net.minecraft.world.level.Level
import net.minecraftforge.common.util.FakePlayer
import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.core.TranslatableComponent import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.MatteryCapability
@ -92,9 +90,6 @@ class PillItem(val pillType: PillType) :
} }
override fun use(level: Level, ply: Player, hand: InteractionHand): InteractionResultHolder<ItemStack> { override fun use(level: Level, ply: Player, hand: InteractionHand): InteractionResultHolder<ItemStack> {
if (ply is FakePlayer)
return super.use(level, ply, hand)
val resolver = ply.getCapability(MatteryCapability.MATTERY_PLAYER).resolve() val resolver = ply.getCapability(MatteryCapability.MATTERY_PLAYER).resolve()
if (resolver.isEmpty) if (resolver.isEmpty)
@ -115,9 +110,6 @@ class PillItem(val pillType: PillType) :
} }
override fun finishUsingItem(stack: ItemStack, level: Level, ent: LivingEntity): ItemStack { override fun finishUsingItem(stack: ItemStack, level: Level, ent: LivingEntity): ItemStack {
if (ent is FakePlayer)
super.finishUsingItem(stack, level, ent)
if (ent is Player) { if (ent is Player) {
val resolver = ent.getCapability(MatteryCapability.MATTERY_PLAYER).resolve() val resolver = ent.getCapability(MatteryCapability.MATTERY_PLAYER).resolve()