Skip to content

Commit

Permalink
im not very smart, version 4
Browse files Browse the repository at this point in the history
ThePlasticPotato committed Dec 18, 2024
1 parent 8afecc9 commit d36dac7
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
import net.minecraft.world.entity.EntityDimensions;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MoverType;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.state.BlockState;
@@ -257,7 +256,7 @@ private void preSpawnSprintParticle(final CallbackInfo ci) {
private void postBaseTick(final CallbackInfo ci) {
final EntityDraggingInformation entityDraggingInformation = getDraggingInformation();

if (level != null && level.isClientSide && !firstTick && !isControlledByLocalInstance() && !(Entity.class.cast(this) instanceof Player player && player.isLocalPlayer())) {
if (level != null && level.isClientSide && !firstTick) {
final Ship ship = VSGameUtilsKt.getShipObjectManagingPos(level, getOnPos());
if (ship != null) {
entityDraggingInformation.setLastShipStoodOn(ship.getId());
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.valkyrienskies.mod.mixin.feature.entity_collision;

import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@@ -34,7 +34,7 @@ public MixinLivingEntity(EntityType<?> entityType, Level level) {
private void preAiStep(CallbackInfo ci) {
// fake lerp movement gaming
if (this.level != null && this.level.isClientSide() && !firstTick) {
if (this.isControlledByLocalInstance() || (Entity.class.cast(this) instanceof Player player && player.isLocalPlayer())) return;
if (this.isControlledByLocalInstance() || (Minecraft.getInstance().player != null && Minecraft.getInstance().player.is(this))) return;
EntityDraggingInformation dragInfo = ((IEntityDraggingInformationProvider) this).getDraggingInformation();
if (dragInfo != null && dragInfo.getLastShipStoodOn() != null) {
final ClientShip ship = VSGameUtilsKt.getShipObjectWorld((ClientLevel) level).getAllShips().getById(dragInfo.getLastShipStoodOn());
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ object VSGamePackets {
val level = mc.level ?: return@registerClientHandler
val entity = level.getEntity(setMotion.entityID) ?: return@registerClientHandler

if (entity.isControlledByLocalInstance || (entity is Player && entity.isLocalPlayer)) return@registerClientHandler
if (entity.isControlledByLocalInstance || (mc.player != null && mc.player!!.`is`(entity))) return@registerClientHandler

val ship = level.shipObjectWorld.allShips.getById(setMotion.shipID)
?: return@registerClientHandler
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.valkyrienskies.mod.common.util

import net.minecraft.client.Minecraft
import net.minecraft.server.level.ServerPlayer
import net.minecraft.util.Mth
import net.minecraft.world.entity.Entity
@@ -122,7 +123,7 @@ object EntityDragger {
entity.yHeadRot = Mth.wrapDegrees(entity.yHeadRot + addedYRot.toFloat())
}
} else {
if (!entity.isControlledByLocalInstance && !(entity is Player && entity.isLocalPlayer)) {
if (!entity.isControlledByLocalInstance && !(Minecraft.getInstance().player != null && Minecraft.getInstance().player!!.`is`(entity))) {
entity.yRot = Mth.wrapDegrees(entity.yRot + addedYRot.toFloat())
entity.yHeadRot = Mth.wrapDegrees(entity.yHeadRot + addedYRot.toFloat())
} else {

0 comments on commit d36dac7

Please sign in to comment.