Jump to content

Ernio

Forge Modder
  • Posts

    2638
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Ernio

  1. Okay, I am apparently totally green here. I know now that I need to load new classes (skills) into same classLoader as my mod. How can I do that? ClassLoader cl = Loader.instance().getModClassLoader(); I seriously have no idea how to ADD new classees to existing CL. I know this will crash, obviously, I want to know how to put (load .jar-s) my urls list into mod's CL. //urls are URI to my .jar-s ClassLoader cl = Loader.instance().getModClassLoader(); urlClassLoader = URLClassLoader.newInstance(urls.toArray(new URL[urls.size()]), cl); @Anon10W1z Structure goes: Mod - handles skills API - allows to make new skills Config - allows to script skills using coded skills via API. That means you can make new skills using ones coded in code (obviously, that is smarter than coding skill using forge methods inside json/txt).
  2. Well, I know it makes no sense, I've been reading docs for past 30min, but it still is NOT working (made it to make sure). I am using new ClassLoader for my Skill API. You can make skills compile them into jars and throw into gameDir/RoA/Skills/... SkillLoader will read this dir for .jar-s and scan them for classes that are childs of Skill / SkillCast and register them into my SkillRegistry. System is designed to dynamically load stuff and also send skills to client and load them in runtime (on both client/server). EDIT: Can this be caused that API is loded by Forge (as a mod) and Skill.jar-s are loaded by different loader? Looking at this: I think that's the problem. How can I get forge's/Minecraft ClassLoader?
  3. How can I be more specific? I gave you link to tutorial that gives perfect example on how to use this event. To be more informative I can add: Tick != FPS Ticks are 20/sec and are used to update game data, while lwjgl works alone just using that data. You can't draw stuff inside ticking methods (like you did there). You need to use RenderGameOverlayEvent and draw your stuff there. That event gives you access to overlay screen and width/height of it.
  4. I am kinda lost here. Class<?> clazz = urlClassLoader.loadClass(name.substring(0, name.length() - 6).replaceAll("/", ".")); And it is SkillFireball for sure (I can print fields/method names) System.out.println(clazz.isInstance(SkillCast.class)); System.out.println(SkillCast.class.isInstance(clazz)); System.out.println(SkillCast.class.isAssignableFrom(clazz)); System.out.println(clazz.isAssignableFrom(SkillCast.class)); public class SkillFireball extends SkillCast implements ISkillThrown public abstract class SkillCast extends Skill My prints are ALL false. Note: I am loading classes with ClassLoader (might be important). Anyone has idea? Goal: obviously, get 'true' if class is child of SkillCast.
  5. You are doing it wrong. Use RenderGameOverlayEvent, get mc.thePlayer, check for helmet and if is instanceof then render something. http://www.minecraftforge.net/wiki/Gui_Overlay
  6. Oh, w8, that was my fault, I was doing stuff in like 20-30 lines and totally forgot I had some leftovers of 'experimenting' on 75 line. Locked, solved, compiled, thank you!
  7. Well, I alredy tried similar things, but i am getting error with it. C:\Users\Ernio\git\roa>gradlew.bat build --stacktrace FAILURE: Build failed with an exception. * Where: Build file 'C:\Users\Ernio\git\roa\build.gradle' line: 75 * What went wrong: A problem occurred evaluating root project 'roa'. > Could not find method compileOptions() for arguments [build_darj1e8non1vkde8m2 vflt3no$_run_closure4@6be6931f] on root project 'roa'. * Try: Run with --info or --debug option to get more log output. * Exception is: org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'roa'. at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptR unnerImpl.run(DefaultScriptRunnerFactory.java:54) at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl. apply(DefaultScriptPluginFactory.java:187) at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildSc riptProcessor.java:39) at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildSc riptProcessor.java:26) at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.eva luate(ConfigureActionsProjectEvaluator.java:34) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(L ifecycleProjectEvaluator.java:55) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:470) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:79) at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuil dConfigurer.java:31) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default GradleLauncher.java:128) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle Launcher.java:105) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun cher.java:85) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon troller.run(InProcessBuildActionExecuter.java:81) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav a:33) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav a:24) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:39) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:29) at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50) at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.jav a:171) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction. execute(CommandLineActionFactory.java:237) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction. execute(CommandLineActionFactory.java:210) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRunti meValidationAction.java:35) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRunti meValidationAction.java:24) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute( CommandLineActionFactory.java:206) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute( CommandLineActionFactory.java:169) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep ortingAction.java:33) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep ortingAction.java:22) at org.gradle.launcher.Main.doAction(Main.java:33) at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots trap.java:54) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j ava:35) at org.gradle.launcher.GradleMain.main(GradleMain.java:23) at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.ja va:30) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56) Caused by: org.gradle.api.internal.MissingMethodException: Could not find method compileOptions() for arguments [build_darj1e8non1vkde8m2vflt3no$_run_closure4@6 be6931f] on root project 'roa'. at org.gradle.api.internal.AbstractDynamicObject.methodMissingException( AbstractDynamicObject.java:68) at org.gradle.api.internal.AbstractDynamicObject.invokeMethod(AbstractDy namicObject.java:56) at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(Composite DynamicObject.java:172) at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java: 79) at build_darj1e8non1vkde8m2vflt3no.run(C:\Users\Ernio\git\roa\build.grad le:75) at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptR unnerImpl.run(DefaultScriptRunnerFactory.java:52) ... 34 more BUILD FAILED Total time: 3.814 secs apply plugin: 'forge' version = "1.0.0 Alpha" group= "com.midstcraft.ernio.RoA" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "RoA" sourceCompatibility = 1.7 targetCompatibility = 1.7 minecraft { Doge is gone! Edit: Also tried looking here http://gradle.org/docs/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html but nothing I try is working really.
  8. Answer is probably simple (it might be even "no") but does FG support Java 1.7+? I am getting error on 'gradlew.bat build' that source 1.6 doesn't support switch(String), obviously I have Java 8. How do I make FG use 1.7+? Some compile options if any?
  9. I can't really help you, not many will - you are just too outdated. Block/World methods are totally different now (BlockState and BlockPos). Why won't you update m8? Not many stay in past versions and those who are won't get much of a support here. Just saying :C You can try looking into World or WorldClient and search for setBlock or something like it.
  10. But seriously, guys here, on forums, are right. As to your problem. If your armour wouldn't be giving flying ability - idea below would not work, BUT it will since it does give flying. As long as client will know that player has full set, you can spawn block underneath player in PlayerTickEvent (Side: CLIENT, Phase: START). Simply check if block below is instanceof water and change it (client-side) to some block (ice for example). This way: - Server block will still stay water. - Other player will view water you are walkin gon as water, not ice (you are doing it client side) - Since server allows you to fly, you will not get "laggy" dropping-down effect when walking on those ghost-blocks. - Coords for those spawned ghost blocks can be stored in client proxy and removed after time. - After relog/armour-special-effect disable - you ghost block will stop working. I don't know how much of it can be done in 1.6.4 (I don't really remember) but that is the way I am doing it on 1.8, I mean, not exacly, but similar (without flying allowance). EDIT If you'd like you can do it on with server interaction and actually set block below to ice/other as suggested before. Ice will melt at some point, but that way other will be also able to walk behind you (unless you de-set block after short while).
  11. Rendering registration should be done in load (init) in proxy. Also - why are you using GameRegistry in setTexture? To be more precise - move your rendering registration to Main#proxy#registerRenderers() and call it in init. GameRegistry and setting UN should stay in preInit, separately. Tip: Rename your setTexture method - it's confusing, also you can do that in constructor if you really want.
  12. Thats is item renderer (RenderItem) my dear sir. Minecraft#getRenderItem()
  13. And by title you mean prefix in chat? Use any of chat events - depending on which side it should be added (probably server). ServerChatEvent or ClientChatReceivedEvent.
  14. In case the question wasn't answered yet - EntityThrowable is not extending EntityLivingBase, therefore you cannot cast it to "living" thing. #sarcasmOverload #itsNightAndIAmBored
  15. That wasn't really the issue. You should check out how Object declaration/initialization works. Understand what = new means and why is making new object of different class giving error when declared to non-same object field - which is what you did and I pointed out. What you did: Initialized new Item, just to next line after re-init it with totally different object which is not only waste of initialization operation, but also in wrong type. I can't really help you here but to point basic java mistakes and steer you to google and find tutorial on how to add effect to food - there is a LOT of it there, but 1st get some more of that java
  16. Well, this is gonna be hard. public boolean isPotionApplicable(PotionEffect p_70687_1_) { if (this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) { int i = p_70687_1_.getPotionID(); if (i == Potion.regeneration.id || i == Potion.poison.id) { return false; } } return true; } This is code that handles adding poison/healing potion effect depending if mob is UNDEAD. Code is called directly from EntityLivingBase so editing it is ONLY possible for your own mobs (non-vanilla). ASM is a bit overkill here (also - might be hard if you don't know it) and I don't think there is an event for potions - you might wanna do request for "onAdded/RemovedPotion" but it's very small thing, so idk if it'll get done fast. Note: My opinion, there still might be some trick for that. EDIT There is ofc way to totally pawn this issue - by overriding Zombie with CustomZombie extending Zombie, but you know - comatybility might get harassed here (not always, but often).
  17. Not to be offensive, but seeing you code I can assume you don't know much about how objects work in java. 1. Use [.code]code[./code] on forums when you paste stuff. (without dots) 2. Learn more Java - this is probably best advice you will find here.
  18. One link: http://www.minecraftforge.net/forum/index.php/topic,27615.msg141586.html#msg141586 If you'd want more about ticking/packets/direct-updates/special update calls/tracking - my post history is a MINE of those questions, all answered. Look from 3-10 pages. And yes - making task will ensure entity with given id is constructed when data in Runnable is processed.
  19. Everything - lowercase. Not that everything MUST be, but should be. Certainly modid.
  20. Most likely you have outdated mods. In 1.7.10 there is no ITickHandler, it has been replaced by new forge stuff. Some of your mods are probably from 1.6.4 or earlier. Update them.
  21. This is probably giving you NPE. Block.getBlockFromName("tile.extrautils:cobblestone_compressed"); Make sure it won't, you are either not loading the mod or giving wrong string name. There is no other way.
  22. @Mod(stuff, acceptableRemoteVersions = "*")
  23. Oh my, that might be time-consuming. Do you want to scroll whole GuiScreen window (save sub-elements x/y relations) in x/y axis? I don't have (that much) experience on this field with minecraft/forge, but you will certainly need to have fun with mouseEvents and make some data holders (that will hold relativity). Have look at archivement page - it does EXACLY what you want. To see different examples you might wanna see how GuiListExtended works (also GuiSlot).
  24. public static ResourceLocation res = new ResourceLocation(Util.ModID + ":" + "textures/gui/myButton.png"); Note: modId must be lowercase (I think).
  25. That solves the problem, thanks!
×
×
  • Create New...

Important Information

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