问题标签 [minecraft-forge]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - 在 minecraft1.8 上使用 forge api 创建生物
首先很抱歉之前如此不连贯,这是我第一次在这里问问题。
所以这就是问题所在。我使用 forge api 来修改我正在通过 Eclipse 运行的我的世界。我正在尝试修改的版本是 1.8 版,而 1.8 版带来了新的变化,据我所知,事情是如何呈现的。
我正在尝试做的是创建一个我可以出于测试原因产生的暴民。我想使用一个基本的人形模型并在其上转置一个自定义(stevelike)皮肤。(我暂时忽略了行为和声音等,我只想让它产生,然后我可以专注于额外的位)。
我为扩展实体生物的暴民创建了一个类,我试图将它添加到实体列表中。
在尝试查找纹理应用于类的位置时,我找到了 RenderManager 和骨架渲染器,并将我的自定义生物添加到了 renderManager 类包 net.minecraft.client.renderer.entity;
最后我做了一个渲染死亡类,它扩展了我从骨架渲染器中扩展的骨架,希望能让一些东西工作,但我现在把头撞到墙上了,包 com.drhydrolics.disccraft.entities.Renderers;
我真的很感谢任何帮助,如果我在格式化或我如何提出问题时做错了什么,请指出:)
java - Java 使用 OpenGL Stencil 创建大纲
我正在尝试在其顶部渲染对象的轮廓,但我遇到了一些困难。我对 OpenGL 不太了解,所以大部分来自以下教程。期望的效果应该是这样的:
但这是目前的结果:
我用来执行此操作的代码是:
并且doRender
已经存在渲染播放器的方法。这方面的任何事情都会有所帮助。
java - 如何使用 jruby 使用类声明
我正在尝试使用 Forge 和 JRuby 为 Minecraft 制作一个 mod。我想使用 Ruby 编写模组,但我需要使用 Forge 的类声明来接受它作为模组。
我试着把它写成一个函数,但它不起作用。我没有看到任何错误,但 Forge 无法识别。
我如何用 Ruby 写这个?如果我用 Java 编写这部分,其余部分用 Ruby 编写,它可以工作,但我更希望它全部使用 Ruby。
编辑:这是使用java创建mod的正确方法:
我的红宝石代码:
java - Minecraft Forge 1.8 - 加载块纹理
我刚开始在修改 Minecraft 时学习 Java。我看过一个使用 Minecraft Forge API 将块添加到游戏中的教程,但我遇到了一个问题。已经没有“.setBlockTextureName()”方法了,不知道怎么办了。我在游戏中添加了一个简单的块,但它没有纹理,我想为其添加纹理。我将如何为 Minecraft 1.8 执行此操作?
PS:如果这是重复的,对不起,我只看到了关于 Minecraft 小怪的问题,而不是 1.8 的纹理(请记住,1.8 的 Forge API 与其他版本不同),所以我决定问自己。
如果我需要澄清任何事情,请告诉我!
java - 使用 jruby 创建 Java 数组对象
我正在使用 jruby 创建一个 Minecraft mod,目前,我正在尝试制作新的食谱,但我收到了这个错误:
这是在java中执行此操作的正确方法:
这是我的红宝石代码:
这是 addRecipe 函数(来自 GameRegistry 类)
AddShapedRecipe 函数:
如何在 ruby 中创建数组对象并导出到 java?
谢谢
java - 使用 jruby 创建 java 字符
嗨,我需要一个使用 jruby 的字符,但我只有这个错误:
我正在使用 jruby 为我的世界制作一个 mod,我正在尝试制作新的食谱,这是在 java 中制作它的方法:
这是我的红宝石代码:
如何使用 ruby 创建 java 字符?我尝试使用 .charAt() 但这会返回一个数字和 .toCharArray() 但也不起作用。
minecraft - Minecraft Forge 1.8 - ServerProxy 在 SinglePlayer 上不起作用
我正在 Forge 1.8 中编写一个 mod,并且正在使用 SidedProxy 系统。我添加了一些项目/块进行测试,但我的模块主要需要控制事物服务器端的逻辑/在保存时写入和读取一些数据。据我了解,在我的世界游戏中,总是有一个服务器,在单人游戏中是内部服务器。但是,当从 Eclipse 运行时,ServerProxy 永远不会运行,因为我没有看到 print 语句的输出,并且块处理程序没有被注册。
需要明确的是,我目前有一个事件处理程序,可以检测块中断和放置事件。它在 commonProxy 或 clientProxy 上工作。但是,我需要将其放在逻辑方面,无论是在专用服务器还是内部服务器上,都应该在 ServerProxy 中。
java - Forge modding - 错误:无法加载定义 cc:range_block#normal
我目前正在关注小龙虾先生关于如何使用 Forge 为 Minecraft 1.8 制作 Minecraft mod 的教程。我一直在关注他在做什么,但 Forge 是:
整个错误消息如下所示:
我已将块添加到GameRegistry
withGameRegistry.registerBlock(Block, String)
中,并使用以下代码注册了块渲染器:
ModData.MOD_ID
变量是 a ,其String
值等于"cc"
。
项目结构如下所示:
model、item和blockstate文件包含以下代码:
方块状态/range_block.json:
模型/块/range_block.json:
模型/项目/range_block.json:
我已经让它工作得足够远,可以看到应用于库存中块的纹理,但是当我放置它时,我看到缺少纹理的块的青黑色纹理。
我对 Forge (1.8) 比较陌生,所以我还没有真正理解所有内容,但我正在路上!
java - 块纹理和块名称不加载我的世界锻造
我正在为我的世界制作一个模组,但我无法加载纹理:
名称也没有正确显示(tile.Yarrite Ore.Name 而不是 Yarrite Ore):
这是我用来创建块的代码(YarriteOre.java):
这是我在游戏中注册块的 mod.java 文件:
我尝试将图标重命名为Yarrite Ore
,Yarrite
但YarritOre
它们都不起作用!有人知道我做错了什么吗?
编辑:我也尝试过 .Png 和 .JPeg 文件,但它们都不起作用......
编辑:我在 src/main/resources/assets/NoNameYetMod/Textures/blocks 文件夹中有这些项目。
java - Java:如何将变量名放入字符串中?
我正在尝试使用 Java 代码为我的世界制作一个 mod,并且看到我不是在询问与我的世界直接相关的事情,我想我会在这里问它。
在我的代码里面我有
renderItem.getItemModelMesher().register(copperIngot, 0, new ModelResourceLocation(RefStrings.MODID + ":" + ((CopperIngot) copperIngot).getName(), "inventory"));
在该行的末尾,它调用位于文件 CopperIngot 中的函数 getName(),并返回字符串“copperingot”。我想要做的是获取变量“copperIngot”的名称,并将其设置为在名为 name 的字符串中的小写。
我这样做的原因是我可以拥有 1 个文件锭、1 个文件块等(块和锭是在 Minecraft 基本代码中创建的变量类型 Block 和 Item)
现在我正在使用tinker_fairy发布的以下代码
这给了我这样的控制台读数:
[com.hihellobyeoh.derptech.main.MainRegistry:init:63]:实例 [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:代理 [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: tabDerptech [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:scandiumIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:scandiumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63] : scandiumBlock [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:titaniumIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:titaniumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63 ]: 钛块 [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: vanadiumIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: vanadiumDust [com.hihellobyeoh.derptech.main.MainRegistry:init: 63]:钒块[com.hihellobyeoh.derptech.main.MainRegistry:init:63]: chromiumIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: chromiumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: chromiumBlock [com.hihellobyeoh .derptech.main.MainRegistry:init:63]: manganeseIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: manganeseDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: manganeseBlock [com. hihellobyeoh.derptech.main.MainRegistry:init:63]:ironDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:cobaltIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:cobaltDust [com .hihellobyeoh.derptech.main.MainRegistry:init:63]:cobaltBlock [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:nickelIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:nickelDust [ com.hihellobyeoh.derptech.main。MainRegistry:init:63]:nickelBlock [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:copperIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:copperDust [com.hihellobyeoh.derptech.main .MainRegistry:init:63]: 铜块 [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: 铜矿 [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: 锌锭 [com.hihellobyeoh.derptech. main.MainRegistry:init:63]:zincDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:zincBlock [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:yttriumIngot [com.hihellobyeoh.derptech .main.MainRegistry:init:63]: yttriumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: yttriumBlock [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: 锆锭 [com.hihellobyeoh. derptech.main.MainRegistry:init:63]:zirconiumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: 锆块 [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: 铌锭 [com.hihellobyeoh.derptech.main.MainRegistry:init:63] : niobiumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: 铌块 [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: molybdenumIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63 ]: molybdenumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: molybdenumBlock [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: technetiumIngot [com.hihellobyeoh.derptech.main.MainRegistry:init: 63]: technetiumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: technetiumBlock [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: rutheniumIngot [com.hihellobyeoh.derptech.main.MainRegistry:init :63]:rutheniumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: rutheniumBlock [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: rhodiumIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63] : rhodiumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: rhodiumBlock [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: palladiumIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63 ]: palladiumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: palladiumBlock [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: silverIngot [com.hihellobyeoh.derptech.main.MainRegistry:init: 63]:silverDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:silverBlock [com.hihellobyeoh.derptech.main.MainRegistry:init:63]:cadmiumIngot [com.hihellobyeoh.derptech.main.MainRegistry:init :63]:cadmiumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: cadmiumBlock [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: hafniumIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63] : hafniumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: hafniumBlock [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: 钽锭 [com.hihellobyeoh.derptech.main.MainRegistry:init:63 ]: tantalumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: 钽块 [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: tungstenIngothihellobyeoh.derptech.main.MainRegistry:init:63]: tantalumIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: tantalumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: tantalumBlock [com .hihellobyeoh.derptech.main.MainRegistry:init:63]: tungstenIngothihellobyeoh.derptech.main.MainRegistry:init:63]: tantalumIngot [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: tantalumDust [com.hihellobyeoh.derptech.main.MainRegistry:init:63]: tantalumBlock [com .hihellobyeoh.derptech.main.MainRegistry:init:63]: tungstenIngot
等等.....(我在那个文件中有 113 个变量 atm)
这不是我想要的,我希望它在运行 getName 函数时读取变量名,然后将该变量名写入字符串名称。现在有了代码,我给了我所有的变量,我不知道如何隔离我需要找到的确切变量。
提前致谢。