diff --git a/gradle.properties b/gradle.properties index a7cb84d..a7d001b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,7 +12,7 @@ kotlin_version=2.0.21 fabric_kotlin_version=1.12.3 # Mod Properties -mod_version=1.4.1 +mod_version=1.4.2 maven_group=net.mcbrawls mod_id=brawls-entities diff --git a/src/main/java/net/mcbrawls/entities/mixin/EntityMixin.java b/src/main/java/net/mcbrawls/entities/mixin/EntityMixin.java new file mode 100644 index 0000000..aab656a --- /dev/null +++ b/src/main/java/net/mcbrawls/entities/mixin/EntityMixin.java @@ -0,0 +1,21 @@ +package net.mcbrawls.entities.mixin; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityType; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(Entity.class) +public class EntityMixin { + @Redirect( + method = "startRiding(Lnet/minecraft/entity/Entity;Z)Z", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/entity/EntityType;isSaveable()Z" + ) + ) + private boolean onStartRiding(EntityType instance) { + return true; + } +} diff --git a/src/main/kotlin/net/mcbrawls/entities/MCBrawlsEntities.kt b/src/main/kotlin/net/mcbrawls/entities/MCBrawlsEntities.kt index dd703ac..92a1349 100644 --- a/src/main/kotlin/net/mcbrawls/entities/MCBrawlsEntities.kt +++ b/src/main/kotlin/net/mcbrawls/entities/MCBrawlsEntities.kt @@ -1,11 +1,8 @@ package net.mcbrawls.entities import net.fabricmc.api.ModInitializer -import org.slf4j.LoggerFactory object MCBrawlsEntities : ModInitializer { - private val logger = LoggerFactory.getLogger("brawls-entities") - override fun onInitialize() { BrawlsAPIEntities } diff --git a/src/main/kotlin/net/mcbrawls/entities/entity/PlayerAttachedTextDisplayEntity.kt b/src/main/kotlin/net/mcbrawls/entities/entity/PlayerAttachedTextDisplayEntity.kt index 61be9f3..1c49182 100644 --- a/src/main/kotlin/net/mcbrawls/entities/entity/PlayerAttachedTextDisplayEntity.kt +++ b/src/main/kotlin/net/mcbrawls/entities/entity/PlayerAttachedTextDisplayEntity.kt @@ -57,7 +57,7 @@ open class PlayerAttachedTextDisplayEntity( } else { // verify same world if (player.world != world) { - teleport(player.serverWorld, player.x, player.y, player.z, emptySet(), 0.0f, 0.0f, false) + teleport(player.serverWorld, player.x, player.y, player.z, emptySet(), 0.0f, 0.0f, true) return } diff --git a/src/main/kotlin/net/mcbrawls/entities/entity/TemporaryTextDisplayEntity.kt b/src/main/kotlin/net/mcbrawls/entities/entity/TemporaryTextDisplayEntity.kt index 52143ba..9386113 100644 --- a/src/main/kotlin/net/mcbrawls/entities/entity/TemporaryTextDisplayEntity.kt +++ b/src/main/kotlin/net/mcbrawls/entities/entity/TemporaryTextDisplayEntity.kt @@ -4,7 +4,6 @@ import eu.pb4.polymer.core.api.entity.PolymerEntity import net.mcbrawls.entities.entity.TemporaryTextDisplayEntity.TextSupplier import net.minecraft.entity.EntityType import net.minecraft.entity.decoration.DisplayEntity.TextDisplayEntity -import net.minecraft.server.network.ServerPlayerEntity import net.minecraft.text.Text import net.minecraft.util.math.Vec3d import net.minecraft.world.World diff --git a/src/main/resources/brawls-entities.mixins.json b/src/main/resources/brawls-entities.mixins.json index e504e06..b287420 100644 --- a/src/main/resources/brawls-entities.mixins.json +++ b/src/main/resources/brawls-entities.mixins.json @@ -1,10 +1,11 @@ { - "required": true, - "package": "net.mcbrawls.entities.mixin", - "compatibilityLevel": "JAVA_21", - "mixins": [ - ], - "injectors": { - "defaultRequire": 1 + "required": true, + "package": "net.mcbrawls.entities.mixin", + "compatibilityLevel": "JAVA_21", + "mixins": [ + "EntityMixin" + ], + "injectors": { + "defaultRequire": 1 } }