Jump to content

fieldbox

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by fieldbox

  1. Still doesn't work. Also, thanks for the TechnoVision and HarryTalks tips, those were the two YouTubers I was specifically using.
  2. Oh, whoops, I thought it had fixed it but checking again, it hasn't. This time it just lights one block of the ground on fire and plays the sound.
  3. Ah, of course. I probably should've changed the boolean that I just made true because I had no idea what it was. Thanks!
  4. I'm trying to make a Lightning Rod item to learn how to use the onItemUse method in modding. It's supposed to summon a lightning bolt when right clicked. However, when I right click with the item, it just plays the sound of a lightning bolt being summoned and doesn't spawn an actual bolt. What have I done wrong? Here's the code inside my onItemUse method. @Override public ActionResultType onItemUse(ItemUseContext context) { LightningBoltEntity bolt = new LightningBoltEntity(context.getWorld(), context.getPos().getX(), context.getPos().getY(), context.getPos().getZ(), true); context.getWorld().addEntity(bolt); return ActionResultType.PASS; }
  5. Still not working with lateinit var and no nullable type, I'll just delete it.
  6. Oh, I never knew about lateinit, thanks for clearing that up.
  7. Ah, ok. There is a public keyword in there, but I'll just delete the proxy I guess. I'm assuming world.isRemote will be fine for any side related code?
  8. Sorry if Forgelin isn't supported here, there was nowhere else to ask. If you post Java, IDEA automatically converts it into Kotlin, so it doesn't matter if you don't know Kotlin. Anyway, I set up a ClientProxy and ServerProxy that implement an IProxy interface I made. I added a public static val (like a constant in Java) of type IProxy? with an @SidedProxy annotation with the exact package names of both proxies. Both the proxies are public. When I run, I get an error saying this: java.lang.IllegalAccessException: Class net.minecraftforge.fml.common.ProxyInjector can not access a member of class com.fieldbox.upgrademod.ClientProxy with modifiers "private" I don't understand. The object ClientProxy is public, so it shouldn't be throwing this error, right? Proxy code in mod file (Kotlin) @JvmStatic @SidedProxy(clientSide = "com.fieldbox.upgrademod.ClientProxy", serverSide = "com.fieldbox.upgrademod.ServerProxy") public val proxy : IProxy? = null Proxy code in mod file (Java, but a bit rusty) @SidedProxyclientSide = "com.fieldbox.upgrademod.ClientProxy", serverSide = "com.fieldbox.upgrademod.ServerProxy"public static final IProxy
  9. There's no way I can use Kotlin without editing in some form. If I set up another repositories section, that seems to "block out" the one in buildscript and stops forge from downloading.
  10. I changed things around in the "repositories" part of the gradle file (looks like my other repositories part was blocking out the official one with the forge stuff). Now there's a new issue: Could not find net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT. Searched in the following locations: https://jcenter.bintray.com/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml https://jcenter.bintray.com/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/ForgeGradle-2.3-SNAPSHOT.pom https://jcenter.bintray.com/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/ForgeGradle-2.3-SNAPSHOT.jar http://maven.shadowfacts.net/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml http://maven.shadowfacts.net/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/ForgeGradle-2.3-SNAPSHOT.pom http://maven.shadowfacts.net/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/ForgeGradle-2.3-SNAPSHOT.jar Required by: :mod:unspecified That error appears in the Gradle window for IDEA as well as setupDecompWorkspace.
  11. I am on 1.12, I ran setupDecompWorkspace and I got genIntellijRuns working, but this still doesn't seem to work. Kotlin differences don't matter; I believe copying Java code into a Kotlin file will convert it anyway.
  12. I'm using Forgelin and created an object, annotated it with Mod, which didn't work. I then tried to import net.minecraftforge.fml.common.Mod, but that throws an 'unresolved reference' error. I'm in IDEA and, if it helps, Forge and Minecraft are not in my External Libraries. Sorry if Forgelin isn't directly supported, I didn't know where else to ask. Oh yeah, and genIntellijRuns throws a NullPointerException!
  13. Whoops. Turns out pressing "download and install" on the Java website automatically installs a 32-bit version of the JRE. I get that it's for user-friendliness, but really Oracle?
  14. It says 1.8.0_191. I think that's a 32-bit JRE, whoops. (I installed it a while ago) EDIT: I just checked. It's in Program Files (x86). Definitely 32-bit. EDIT 2: After installing a new JRE, it still isn't working. Same error.
  15. AFAIK, Forge doesn't work with Windows 10 edition. It's a different game engine. Don't take my word for it, though; Forge might have added support for Minecraft versions using the Bedrock engine.
  16. When I run .\gradlew setupDecompWorkspace in PowerShell, this error appears. I am using the latest 64-bit JDK. If this changes anything, I have added the Forgelin stuff into build.gradle: repositories { jcenter() maven { url "http://maven.shadowfacts.net/" } } dependencies { compile group: "net.shadowfacts", name: "Forgelin", version: "LATEST_VERSION" } EDIT: Whoops, I think I posted in the wrong section. I only saw "Support and Bug Reports", didn't see Modding Support.
  17. It's simply just this: @SubscribeEvent public static void registerItems(final RegistryEvent.Register<Item> event) { event.getRegistry().register(Item.getItemFromBlock(Blocks.testBlock)); }
  18. I tried registering Item.getItemFromBlock(Blocks.testBlock) as an item but it's still not working...
  19. Yep, I can use /setblock. I forgot to register the ItemBlock though.
  20. Ok, the minecraft: thing was actually due to an error in my blockstate json. But, my block isn't in the game!
  21. @Mod(modid = MyMod.MODID, name = MyMod.NAME, version = MyMod.VERSION) public class MyMod { public static final String MODID = "testmod"; public static final String NAME = "test mod"; public static final String VERSION = "1.0"; @SidedProxy(clientSide = "com.harry.proxy.ClientProxy", serverSide = "com.harry.proxy.CommonProxy") public static CommonProxy proxy; @SidedProxy(clientSide = "com.harry.proxy.ClientProxy", serverSide = "com.harry.proxy.CommonProxy") public static ClientProxy proxy2; @Mod.Instance public static MyMod mod; public static final Logger LOGGER = LogManager.getLogger(MODID); @EventHandler public void preInit(FMLPreInitializationEvent event) { proxy.preInit(event); } @EventHandler public void init(FMLInitializationEvent event) { proxy.init(event); } @EventHandler @SideOnly(Side.CLIENT) public void clientInit(FMLInitializationEvent event) { proxy2.init(event); } @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.postInit(event); } } (i haven't got around to fixing that CommonProxy thing) public class TestBlock extends BlockBase { public TestBlock(String name, Material mat, CreativeTabs tab, float hardness, float resistance) { super(name, mat, tab, hardness, resistance); } } And the BlockBase class: public class BlockBase extends Block { public BlockBase(String name, Material mat, CreativeTabs tab, float hardness, float resistance, String tool, int harvest) { this(name, mat, tab, hardness, resistance); setHarvestLevel(tool, harvest); } public BlockBase(String name, Material mat, CreativeTabs tab, float hardness, float resistance, float light) { this(name, mat, tab, hardness, resistance); setLightLevel(light); } public BlockBase(String name, Material mat, CreativeTabs tab, float hardness, float resistance) { super(mat); setUnlocalizedName(name); setRegistryName(name); setHardness(hardness); setResistance(resistance); setCreativeTab(tab); } }
  22. Now it's saying that it can't find the model file and puts minecraft: prepended.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.