规范化命名
This commit is contained in:
parent
490e340ea9
commit
52c18cb320
5 changed files with 8 additions and 12 deletions
|
@ -144,8 +144,7 @@ public abstract class CameraMixin {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "setup", at = @At("TAIL"))
|
@Inject(method = "setup", at = @At("TAIL"))
|
||||||
public void ia$setup(BlockGetter area, Entity entity, boolean thirdPerson, boolean inverseView, float tickDelta, CallbackInfo ci) {
|
public void superbWarfare$setup(BlockGetter area, Entity entity, boolean thirdPerson, boolean inverseView, float tickDelta, CallbackInfo ci) {
|
||||||
|
|
||||||
if (Minecraft.getInstance().options.getCameraType() == CameraType.THIRD_PERSON_BACK && entity instanceof Player player && player.getMainHandItem().is(ModTags.Items.GUN) && zoom) {
|
if (Minecraft.getInstance().options.getCameraType() == CameraType.THIRD_PERSON_BACK && entity instanceof Player player && player.getMainHandItem().is(ModTags.Items.GUN) && zoom) {
|
||||||
move(-getMaxZoom(-2.9 * Math.max(ClientEventHandler.pullPos, ClientEventHandler.zoomPos)), 0, -ClientEventHandler.cameraLocation * Math.max(ClientEventHandler.pullPos, ClientEventHandler.zoomPos));
|
move(-getMaxZoom(-2.9 * Math.max(ClientEventHandler.pullPos, ClientEventHandler.zoomPos)), 0, -ClientEventHandler.cameraLocation * Math.max(ClientEventHandler.pullPos, ClientEventHandler.zoomPos));
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -37,20 +37,18 @@ public class GameRendererMixin {
|
||||||
}
|
}
|
||||||
|
|
||||||
// From Immersive_Aircraft
|
// From Immersive_Aircraft
|
||||||
|
|
||||||
@Shadow
|
@Shadow
|
||||||
@Final
|
@Final
|
||||||
private Camera mainCamera;
|
private Camera mainCamera;
|
||||||
|
|
||||||
|
@SuppressWarnings("ConstantValue")
|
||||||
@Inject(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Camera;setup(Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/world/entity/Entity;ZZF)V"))
|
@Inject(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Camera;setup(Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/world/entity/Entity;ZZF)V"))
|
||||||
public void immersiveAircraft$renderWorld(float tickDelta, long limitTime, PoseStack matrices, CallbackInfo ci) {
|
public void superbWarfare$renderWorld(float tickDelta, long limitTime, PoseStack matrices, CallbackInfo ci) {
|
||||||
Entity entity = mainCamera.getEntity();
|
Entity entity = mainCamera.getEntity();
|
||||||
//noinspection ConstantValue
|
|
||||||
if (entity != null && !mainCamera.isDetached() && entity.getRootVehicle() instanceof Ah6Entity vehicle) {
|
if (entity != null && !mainCamera.isDetached() && entity.getRootVehicle() instanceof Ah6Entity vehicle) {
|
||||||
// rotate camera
|
// rotate camera
|
||||||
|
|
||||||
matrices.mulPose(Axis.ZP.rotationDegrees(vehicle.getRoll(tickDelta)));
|
matrices.mulPose(Axis.ZP.rotationDegrees(vehicle.getRoll(tickDelta)));
|
||||||
// matrices.mulPose(Axis.XP.rotationDegrees(vehicle.getViewXRot(tickDelta)));
|
|
||||||
|
|
||||||
// fetch eye offset
|
// fetch eye offset
|
||||||
float eye = entity.getEyeHeight();
|
float eye = entity.getEyeHeight();
|
||||||
|
@ -73,9 +71,7 @@ public class GameRendererMixin {
|
||||||
|
|
||||||
if (entity != null && !mainCamera.isDetached() && entity.getRootVehicle() instanceof Tom6Entity vehicle) {
|
if (entity != null && !mainCamera.isDetached() && entity.getRootVehicle() instanceof Tom6Entity vehicle) {
|
||||||
// rotate camera
|
// rotate camera
|
||||||
|
|
||||||
matrices.mulPose(Axis.ZP.rotationDegrees(vehicle.getRoll(tickDelta)));
|
matrices.mulPose(Axis.ZP.rotationDegrees(vehicle.getRoll(tickDelta)));
|
||||||
// matrices.mulPose(Axis.XP.rotationDegrees(vehicle.getViewXRot(tickDelta)));
|
|
||||||
|
|
||||||
// fetch eye offset
|
// fetch eye offset
|
||||||
float eye = entity.getEyeHeight();
|
float eye = entity.getEyeHeight();
|
||||||
|
|
|
@ -14,6 +14,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
// From Immersive_Aircraft
|
// From Immersive_Aircraft
|
||||||
@Mixin(LivingEntityRenderer.class)
|
@Mixin(LivingEntityRenderer.class)
|
||||||
public class LivingEntityRendererMixin<T extends LivingEntity> {
|
public class LivingEntityRendererMixin<T extends LivingEntity> {
|
||||||
|
|
||||||
@Inject(method = "setupRotations", at = @At("TAIL"))
|
@Inject(method = "setupRotations", at = @At("TAIL"))
|
||||||
public void render(T entity, PoseStack matrices, float animationProgress, float bodyYaw, float tickDelta, CallbackInfo ci) {
|
public void render(T entity, PoseStack matrices, float animationProgress, float bodyYaw, float tickDelta, CallbackInfo ci) {
|
||||||
if (entity.getRootVehicle() != entity && entity.getRootVehicle() instanceof Ah6Entity ah6Entity) {
|
if (entity.getRootVehicle() != entity && entity.getRootVehicle() instanceof Ah6Entity ah6Entity) {
|
||||||
|
|
|
@ -16,9 +16,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
* Code based on @Luke100000's ImmersiveAircraft
|
* Code based on @Luke100000's ImmersiveAircraft
|
||||||
*/
|
*/
|
||||||
@Mixin(value = Player.class, priority = 1145)
|
@Mixin(value = Player.class, priority = 1145)
|
||||||
public abstract class PlayerEntityMixin extends Entity {
|
public abstract class PlayerMixin extends Entity {
|
||||||
|
|
||||||
public PlayerEntityMixin(EntityType<?> type, Level world) {
|
public PlayerMixin(EntityType<?> type, Level world) {
|
||||||
super(type, world);
|
super(type, world);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"ClientboundSetPassengersPacketMixin",
|
"ClientboundSetPassengersPacketMixin",
|
||||||
"ExplosionMixin",
|
"ExplosionMixin",
|
||||||
"LivingEntityMixin",
|
"LivingEntityMixin",
|
||||||
"PlayerEntityMixin"
|
"PlayerMixin"
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
"CameraMixin",
|
"CameraMixin",
|
||||||
|
|
Loading…
Add table
Reference in a new issue