- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经为此工作了一段时间了,
我正在尝试制作自己的粒子,但我在弄清楚一切如何注册以及如何让我的粒子被称为 modid:粒子时遇到问题,因此本质上是将其注册到我的 mod 中。
此外,如果有人可以帮助我进行数学计算,我希望让我的粒子慢慢地从 block 内向上移动到原始 block 上方约 0.5 个 block 。
我已经尝试了很多,将其全部列出来会很疯狂。然而,我确实设法让熔岩粒子出现,我尝试了不同的数学、不同的生成粒子的选项、我修改后在 1.14 中工作的旧方法,但不管它说什么“名称我的世界:魔法黑输入太晚了”
做他所做的事是不可能的!我必须找到自己的方法来做同样的事情。因为我的粒子不一样。
我希望粒子以不同的大小出现,使方 block 看起来就像是神奇的。
当我尝试阻止时游戏立即崩溃
如果您要求,我会添加任何信息!如果您愿意解释我如何做数学或向我推荐数学资源,我会很乐意接受这些!任何我能做的以取得进步的事情,我并不特别需要你为我做。我只是想要一些指导自己的帮助!
protected EnchantedBlack(World world, double x, double y, double z) {
super(world, x, y, z, 0.0D, 0.0D, 0.0D);
this.motionX *= 0;
this.motionY *= 0.800000011920929D;
this.motionZ *= 0;
this.motionY = (double) (this.rand.nextFloat() * 0.4F + 0.05F);
this.particleScale *= this.rand.nextFloat() * 2.0F + 0.2F;
this.maxAge = (int) (16.0D / (Math.random() * 0.8D + 0.2D));
}
public void tick() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
float f = (float)this.age / (float)this.maxAge;
if (this.age++ >= this.maxAge) {
this.setExpired();
} else {
this.motionY -= 0.03D;
this.move(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.1D;
this.motionY *= 0.9990000128746033D;
this.motionZ *= 0.1D;
if (this.onGround) {
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
}
}
public IParticleRenderType getRenderType() {
return IParticleRenderType.PARTICLE_SHEET_OPAQUE;
}
public float getScale(float float1) {
float f = ((float)this.age + float1) / (float)this.maxAge;
return this.particleScale * (1.0F - f * f);
}
@OnlyIn(Dist.CLIENT)
public static class Factory implements IParticleFactory<BasicParticleType> {
private final IAnimatedSprite spriteSet;
public Factory(IAnimatedSprite p_i50495_1_) {
this.spriteSet = p_i50495_1_;
}
public Particle makeParticle(BasicParticleType typeIn, World worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) {
EnchantedBlack enchantedblack = new EnchantedBlack(worldIn, x, y, z);
enchantedblack.selectSpriteRandomly(this.spriteSet);
return enchantedblack;
}
}
}
最佳答案
首先,如果您还没有,您现在应该更新到 1.14.4。
无论如何。我无法确切地说出你所拥有的东西出了什么问题,但希望我前几天这样做的经验会有所帮助。
您遇到的崩溃发生在 line 84并且是一个 ExceptionInInitializerError: null ,这意味着在将类加载到 JVM 的阶段但在创建任何实例之前的阶段遇到了问题。这一行唯一可以做到的就是对 GWParticleTypes.ENCHANTEDBLACK
的引用。
我的猜测是 this line那就是抛出一个空值。我没有这样的东西,也没有使用自己添加粒子的方法。要么注册表返回空值,要么发生我们没有注意到的进一步情况。由于 ParticleTypes 不是 IForgeRegistryEntry
类型,并且注册表完全由 Vanilla 控制,因此我怀疑使用此方法不起作用。
由于您仅使用客户端粒子(用 @OnlyIn(Dist.CLIENT)
标记的 animateTick
方法),您应该能够使用 Minecraft.getInstance().articles.addEffect(article);
相反,就像我一样 here .
我的粒子是在服务器端生成的,将数据包发送到正确的玩家客户端,并在客户端上构造实际的粒子实例,因此涉及一些重定向。您仍然需要通过侧面代理路由事物,因为您无法在公共(public)代码中引用仅限客户端的类(@OnlyIn(Dist.CLIENT)
并不妨碍您编写代码服务器可以验证!),但是 addEffect
应该可以大大简化事情。
为了获得正确的视觉效果(粒子从 block 中升起),您的主要问题可能在于这一行:
this.motionY -= 0.03D;
你让它们向下移动,而不是向上移动。同样这一行:
this.motionY *= 0.9990000128746033D;
由于“空气阻力”,会让它们每帧移动得更慢(在没有其他因素的情况下),因为您复制的粒子代码( block 破坏或浮沙粒子)代表了一个精细的粒子。从上方落下并落在地面上的类似灰尘的物体。您也不需要 this.onGround
或任何依赖于它的东西。
关于java - 寻求在 1.14 Minecraft 中设置粒子的帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57317697/
我需要将文本放在 中在一个 Div 中,在另一个 Div 中,在另一个 Div 中。所以这是它的样子: #document Change PIN
奇怪的事情发生了。 我有一个基本的 html 代码。 html,头部, body 。(因为我收到了一些反对票,这里是完整的代码) 这是我的CSS: html { backgroun
我正在尝试将 Assets 中的一组图像加载到 UICollectionview 中存在的 ImageView 中,但每当我运行应用程序时它都会显示错误。而且也没有显示图像。 我在ViewDidLoa
我需要根据带参数的 perl 脚本的输出更改一些环境变量。在 tcsh 中,我可以使用别名命令来评估 perl 脚本的输出。 tcsh: alias setsdk 'eval `/localhome/
我使用 Windows 身份验证创建了一个新的 Blazor(服务器端)应用程序,并使用 IIS Express 运行它。它将显示一条消息“Hello Domain\User!”来自右上方的以下 Ra
这是我的方法 void login(Event event);我想知道 Kotlin 中应该如何 最佳答案 在 Kotlin 中通配符运算符是 * 。它指示编译器它是未知的,但一旦知道,就不会有其他类
看下面的代码 for story in book if story.title.length < 140 - var story
我正在尝试用 C 语言学习字符串处理。我写了一个程序,它存储了一些音乐轨道,并帮助用户检查他/她想到的歌曲是否存在于存储的轨道中。这是通过要求用户输入一串字符来完成的。然后程序使用 strstr()
我正在学习 sscanf 并遇到如下格式字符串: sscanf("%[^:]:%[^*=]%*[*=]%n",a,b,&c); 我理解 %[^:] 部分意味着扫描直到遇到 ':' 并将其分配给 a。:
def char_check(x,y): if (str(x) in y or x.find(y) > -1) or (str(y) in x or y.find(x) > -1):
我有一种情况,我想将文本文件中的现有行包含到一个新 block 中。 line 1 line 2 line in block line 3 line 4 应该变成 line 1 line 2 line
我有一个新项目,我正在尝试设置 Django 调试工具栏。首先,我尝试了快速设置,它只涉及将 'debug_toolbar' 添加到我的已安装应用程序列表中。有了这个,当我转到我的根 URL 时,调试
在 Matlab 中,如果我有一个函数 f,例如签名是 f(a,b,c),我可以创建一个只有一个变量 b 的函数,它将使用固定的 a=a1 和 c=c1 调用 f: g = @(b) f(a1, b,
我不明白为什么 ForEach 中的元素之间有多余的垂直间距在 VStack 里面在 ScrollView 里面使用 GeometryReader 时渲染自定义水平分隔线。 Scrol
我想知道,是否有关于何时使用 session 和 cookie 的指南或最佳实践? 什么应该和什么不应该存储在其中?谢谢! 最佳答案 这些文档很好地了解了 session cookie 的安全问题以及
我在 scipy/numpy 中有一个 Nx3 矩阵,我想用它制作一个 3 维条形图,其中 X 轴和 Y 轴由矩阵的第一列和第二列的值、高度确定每个条形的 是矩阵中的第三列,条形的数量由 N 确定。
假设我用两种不同的方式初始化信号量 sem_init(&randomsem,0,1) sem_init(&randomsem,0,0) 现在, sem_wait(&randomsem) 在这两种情况下
我怀疑该值如何存储在“WORD”中,因为 PStr 包含实际输出。? 既然Pstr中存储的是小写到大写的字母,那么在printf中如何将其给出为“WORD”。有人可以吗?解释一下? #include
我有一个 3x3 数组: var my_array = [[0,1,2], [3,4,5], [6,7,8]]; 并想获得它的第一个 2
我意识到您可以使用如下方式轻松检查焦点: var hasFocus = true; $(window).blur(function(){ hasFocus = false; }); $(win
我是一名优秀的程序员,十分优秀!