-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
62 additions
and
33 deletions.
There are no files selected for viewing
15 changes: 0 additions & 15 deletions
15
src/main/java/net/mcbrawls/railroad/mixin/ExampleMixin.java
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
src/main/java/net/mcbrawls/railroad/mixin/ServerPlayerEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package net.mcbrawls.railroad.mixin; | ||
|
||
import com.mojang.authlib.GameProfile; | ||
import net.mcbrawls.railroad.player.RailroadPlayer; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
@Mixin(ServerPlayerEntity.class) | ||
public abstract class ServerPlayerEntityMixin extends PlayerEntity implements RailroadPlayer { | ||
private ServerPlayerEntityMixin(World world, BlockPos pos, float yaw, GameProfile gameProfile) { | ||
super(world, pos, yaw, gameProfile); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/net/mcbrawls/railroad/player/RailroadPlayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package net.mcbrawls.railroad.player; | ||
|
||
public interface RailroadPlayer { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/net/mcbrawls/railroad/codec/ExtraCodecs.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package net.mcbrawls.railroad.codec | ||
|
||
import com.mojang.serialization.Codec | ||
import org.joml.Vector2f | ||
import org.joml.Vector3d | ||
import kotlin.time.Duration | ||
|
||
object ExtraCodecs { | ||
val VECTOR_3D: Codec<Vector3d> = Codec.DOUBLE.listOf().xmap( | ||
{ list -> Vector3d(list[0], list[1], list[2]) }, | ||
{ vect -> listOf(vect.x, vect.y, vect.z) } | ||
) | ||
|
||
val VECTOR_2F: Codec<Vector2f> = Codec.FLOAT.listOf().xmap( | ||
{ list -> Vector2f(list[0], list[1]) }, | ||
{ vect -> listOf(vect.x, vect.y) } | ||
) | ||
|
||
val DURATION: Codec<Duration> = Codec.STRING.xmap(Duration::parse, Duration::toString) | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/kotlin/net/mcbrawls/railroad/player/HandledCameraTrack.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package net.mcbrawls.railroad.player | ||
|
||
import net.mcbrawls.railroad.CameraTrack | ||
|
||
class HandledCameraTrack(val cameraTrack: CameraTrack) { | ||
// | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters