猫史档案馆


各位巨佬,这代码有什么问题吗?

用户:温顺的咪噜gBgE温顺的咪噜gBgE查看:45 回复:7 评论:45 创建时间:2023-01-22T12:39:23


center_image


回复

上一页1 页 / 共 1下一页
『iveudgc』『iveudgc』

试试

 

如果   (个人 )= (0)

         切换到屏幕(7  .1主页)

点赞1


评论


由于不知道取啥名而随便取的名字由于不知道取啥名而随便取的名字

这是大家都有可能会犯的错,如果否则要一直执行就得套个重复执行

点赞0


评论


看这里小孩看这里小孩

sd

点赞0


评论


看这里小孩看这里小孩

SD

点赞0


评论


看这里小孩看这里小孩

kitten有誒性這個概念

点赞0


评论


看这里小孩看这里小孩

package com.mojang.blaze3d.matrix;

import com.google.common.collect.Queues;
import java.util.Deque;
import net.minecraft.util.Util;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Matrix3f;
import net.minecraft.util.math.vector.Matrix4f;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
public class MatrixStack {
   private final Deque<MatrixStack.Entry> stack = Util.make(Queues.newArrayDeque(), (p_2278喵_0_) -> {
      Matrix4f matrix4f = new Matrix4f();
      matrix4f.setIdentity();
      Matrix3f matrix3f = new Matrix3f();
      matrix3f.setIdentity();
      p_2278喵_0_.add(new MatrixStack.Entry(matrix4f, matrix3f));
   });

   public void translate(double x, double y, double z) {
      MatrixStack.Entry matrixstack$entry = this.stack.getLast();
      matrixstack$entry.matrix.mul(Matrix4f.makeTranslate((float)x, (float)y, (float)z));
   }

   public void scale(float x, float y, float z) {
      MatrixStack.Entry matrixstack$entry = this.stack.getLast();
      matrixstack$entry.matrix.mul(Matrix4f.makeScale(x, y, z));
      if (x == y && y == z) {
         if (x > 0.0F) {
            return;
         }

         matrixstack$entry.normal.mul(-1.0F);
      }

      float f = 1.0F / x;
      float f1 = 1.0F / y;
      float f2 = 1.0F / z;
      float f3 = MathHelper.fastInvCubeRoot(f * f1 * f2);
      matrixstack$entry.normal.mul(Matrix3f.makeScaleMatrix(f3 * f, f3 * f1, f3 * f2));
   }

   public void rotate(Quaternion quaternion) {
      MatrixStack.Entry matrixstack$entry = this.stack.getLast();
      matrixstack$entry.matrix.mul(quaternion);
      matrixstack$entry.normal.mul(quaternion);
   }

   public void push() {
      MatrixStack.Entry matrixstack$entry = this.stack.getLast();
      this.stack.addLast(new MatrixStack.Entry(matrixstack$entry.matrix.copy(), matrixstack$entry.normal.copy()));
   }

   public void pop() {
      this.stack.removeLast();
   }

   public MatrixStack.Entry getLast() {
      return this.stack.getLast();
   }

   public boolean clear() {
      return this.stack.size() == 1;
   }

   @OnlyIn(Dist.CLIENT)
   public static final class Entry {
      private final Matrix4f matrix;
      private final Matrix3f normal;

      private Entry(Matrix4f matrix, Matrix3f normal) {
         this.matrix = matrix;
         this.normal = normal;
      }

      public Matrix4f getMatrix() {
         return this.matrix;
      }

      public Matrix3f getNormal() {
         return this.normal;
      }
   }
}

点赞0


评论


土豆awa土豆awa

难道是……

第二个分支永远不会执行的!

因为:

①如果云变量是数字0的话,第一个条件成立,第二个条件不成立,整体为真,不会切换屏幕。

②如果云变量是字符0的话,第一个条件不成立,第二个条件成立,整体为真,不会切换屏幕。

③如果云变量是其他的值,第一个条件和第二个条件都成立,整体为真,还是不会切换。

解决办法:把“或”改成“与”

点赞1


评论