Skip to content

Commit

Permalink
fix: disable isSaveable check for riding
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Oct 28, 2024
1 parent fb7708e commit e3f7305
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/net/mcbrawls/entities/mixin/EntityMixin.java
Original file line number Diff line number Diff line change
@@ -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;
}
}
3 changes: 0 additions & 3 deletions src/main/kotlin/net/mcbrawls/entities/MCBrawlsEntities.kt
Original file line number Diff line number Diff line change
@@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 8 additions & 7 deletions src/main/resources/brawls-entities.mixins.json
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit e3f7305

Please sign in to comment.