-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup and prevent sending packets if the server hasn't consented
- Loading branch information
Showing
6 changed files
with
60 additions
and
48 deletions.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
src/main/java/com/minelittlepony/bigpony/mixin/MixinEntity.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,22 @@ | ||
package com.minelittlepony.bigpony.mixin; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import com.minelittlepony.bigpony.Scaling; | ||
import com.minelittlepony.bigpony.network.Network; | ||
|
||
import net.minecraft.entity.Entity; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
|
||
@Mixin(Entity.class) | ||
abstract class MixinEntity { | ||
@Inject(method = "onStartedTrackingBy", at = @At("HEAD")) | ||
private void sendScalingOnStartedTrackingBy(ServerPlayerEntity player, CallbackInfo info) { | ||
if (this instanceof Scaling.Holder holder) { | ||
Network.OTHER_PLAYER_SIZE.sendToPlayer(holder.getScaling().toUpdatePacket((Entity)(Object)this), player); | ||
} | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
src/main/java/com/minelittlepony/bigpony/mixin/MixinServerPlayerEntity.java
This file was deleted.
Oops, something went wrong.
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