-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Mod no longer uses ModifyArgs mixins
- Loading branch information
Showing
7 changed files
with
51 additions
and
38 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
26 changes: 26 additions & 0 deletions
26
src/main/java/net/xolt/freecam/mixins/EntityRendererMixin.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,26 @@ | ||
package net.xolt.freecam.mixins; | ||
|
||
import net.minecraft.client.render.entity.EntityRenderer; | ||
import net.minecraft.entity.Entity; | ||
import net.xolt.freecam.Freecam; | ||
import net.xolt.freecam.config.ModConfig; | ||
import net.xolt.freecam.util.FreeCamera; | ||
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.CallbackInfoReturnable; | ||
|
||
import static net.xolt.freecam.Freecam.MC; | ||
|
||
@Mixin(EntityRenderer.class) | ||
public class EntityRendererMixin { | ||
|
||
@Inject(method = "getLight", at = @At("HEAD"), cancellable = true) | ||
private void onGetLight(Entity entity, float tickDelta, CallbackInfoReturnable<Integer> cir) { | ||
if (Freecam.isEnabled() && ModConfig.INSTANCE.showHand && entity.equals(MC.player)) { | ||
FreeCamera freeCamera = Freecam.getFreeCamera(); | ||
EntityRenderer<? super FreeCamera> entityRenderer = MC.getEntityRenderDispatcher().getRenderer(freeCamera); | ||
cir.setReturnValue(entityRenderer.getLight(freeCamera, tickDelta)); | ||
} | ||
} | ||
} |
21 changes: 0 additions & 21 deletions
21
src/main/java/net/xolt/freecam/mixins/GameRendererMixin.java
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
src/main/java/net/xolt/freecam/mixins/LivingEntityMixin.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,20 @@ | ||
package net.xolt.freecam.mixins; | ||
|
||
import net.minecraft.entity.LivingEntity; | ||
import net.xolt.freecam.Freecam; | ||
import net.xolt.freecam.config.ModConfig; | ||
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.CallbackInfoReturnable; | ||
|
||
@Mixin(LivingEntity.class) | ||
public class LivingEntityMixin { | ||
|
||
@Inject(method = "getMovementSpeed(F)F", at = @At("HEAD"), cancellable = true) | ||
private void onGetMovementSpeed(CallbackInfoReturnable<Float> cir) { | ||
if (Freecam.isEnabled() && ModConfig.INSTANCE.flightMode.equals(ModConfig.FlightMode.CREATIVE) && this.equals(Freecam.getFreeCamera())) { | ||
cir.setReturnValue((float) (ModConfig.INSTANCE.horizontalSpeed / 10) * (Freecam.getFreeCamera().isSprinting() ? 2 : 1)); | ||
} | ||
} | ||
} |
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