Jump to content

Mew

Members
  • Posts

    567
  • Joined

  • Last visited

Everything posted by Mew

  1. This tutorial is outdated and keeps misleading a lot of people. The goal of AccessTransformers is just to change a vanilla access level: i.e private int var; into public int var; and I also see a lot of people doing the same cfg stuff and call without understanding what it does. public up.G # spawnHostileMobs and event.getServer().worldServerForDimension(0).spawnHostileMobs = false; as for running in eclipse, you don't have to use the argument, you can create a dummy jar and in the manifest file point to the loading plugin. then copy that jar into mcp/jars/mods I wrote a tutorial on coremods here http://www.minecraftforum.net/topic/1854988- Yeah I realize that now oops... Anyway. Do you know anything about the error I am getting? It is really starting to bug me... Any help is appreciated
  2. *Shakes head* Try this: (for items) C:\Users\Grubse\AppData\Roaming\.minecraft\Mods\MODZIP.zip\assets\craftxpmod\textures\items And blocks: C:\Users\Grubse\AppData\Roaming\.minecraft\Mods\MODZIP.zip\assets\craftxpmod\textures\items
  3. And now I am getting the WIERDEST error I have ever seen... package mrmewniverse.core; import java.util.Arrays; import net.minecraftforge.event.ForgeSubscribe; import cpw.mods.fml.common.DummyModContainer; import cpw.mods.fml.common.LoadController; import cpw.mods.fml.common.ModMetadata; import cpw.mods.fml.common.event.FMLServerStartingEvent; public class CoreModContainer extends DummyModContainer { The bold p in the package declaration is underlined red with an error. This is the error: "The type com.google.common.eventbus.EventBus cannot be resolved. It is indirectly referenced from required .class files" Anyone know how to fix this? Minecraft launches as if there are no errors, but then it DOES crash when it gets to loading my core mod it gets this error: 2013-07-11 07:54:39 [iNFO] [sTDERR] Exception in thread "Minecraft main thread" java.lang.Error: Unresolved compilation problem: 2013-07-11 07:54:39 [iNFO] [sTDERR] The type com.google.common.eventbus.EventBus cannot be resolved. It is indirectly referenced from required .class files 2013-07-11 07:54:39 [iNFO] [sTDERR] 2013-07-11 07:54:39 [iNFO] [sTDERR] at mrmewniverse.core.CoreModContainer.<init>(CoreModContainer.java:1) 2013-07-11 07:54:39 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 2013-07-11 07:54:39 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 2013-07-11 07:54:39 [iNFO] [sTDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 2013-07-11 07:54:39 [iNFO] [sTDERR] at java.lang.reflect.Constructor.newInstance(Unknown Source) 2013-07-11 07:54:39 [iNFO] [sTDERR] at java.lang.Class.newInstance(Unknown Source) 2013-07-11 07:54:39 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.identifyMods(Loader.java:331) 2013-07-11 07:54:39 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:480) 2013-07-11 07:54:39 [iNFO] [sTDERR] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:163) 2013-07-11 07:54:39 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:411) 2013-07-11 07:54:39 [iNFO] [sTDERR] at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44) 2013-07-11 07:54:39 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:733) 2013-07-11 07:54:39 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source) [EDIT] Also note that this error doesn't appear until I extend DummyModContainer. If I remove it (thus stopping being a core mod) the error disappears...
  4. I have now found that my CoreMod aint loading... Why would this be? I have everything I need [hidden] Main file: package mrmewniverse.core; import java.util.Map; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions; @TransformerExclusions({ "mrmewniverse.core", "mrmewniverse.core.transformer" }) public class Core implements IFMLLoadingPlugin { @Override /* * Use if you want to download libraries. Returns a list of classes that * implement the ILibrarySet interface eg return new String[] { * "tutorial.asm.downloaders.DownloadUsefulLibrary " }; */ public String[] getLibraryRequestClass() { return null; } @Override /* * The class(es) that do(es) the transforming. Needs to implement * IClassTransformer in some way */ public String[] getASMTransformerClass() { return new String[] { "mrmewniverse.core.transformer.CoreTransformer" }; } @Override /* * The class that acts similarly to the @Mod annotation. */ public String getModContainerClass() { return "mrmewniverse.core.CoreModContainer"; } @Override /* * If you want to do stuff BEFORE minecraft starts, but after your mod is * loaded. */ public String getSetupClass() { return null; } @Override /* * Gives the mod coremod data if it wants it. */ public void injectData(Map<String, Object> data) { } } Mod Container: package mrmewniverse.core; import java.util.Arrays; import net.minecraftforge.event.EventBus; import net.minecraftforge.event.ForgeSubscribe; import cpw.mods.fml.common.DummyModContainer; import cpw.mods.fml.common.LoadController; import cpw.mods.fml.common.ModMetadata; import cpw.mods.fml.common.event.FMLServerStartingEvent; public class CoreModContainer extends DummyModContainer { public CoreModContainer() { super(new ModMetadata()); // The equivalent to mod metadata ModMetadata metadata = super.getMetadata(); metadata.authorList = Arrays.asList(new String[] { "MrMewniverse" }); metadata.description = "A test Core mod that will be further developed."; metadata.modId = CoreReference.MOD_ID; metadata.version = CoreReference.VERSION; metadata.name = CoreReference.NAME; } public boolean registerBus(EventBus par1EventBus, LoadController par2LoadController) { par1EventBus.register(this); return true; } @ForgeSubscribe public void onServerStarting(FMLServerStartingEvent event) { event.getServer().worldServerForDimension(0).spawnHostileMobs = false; } } Class transformer: package mrmewniverse.core.transformer; import java.io.IOException; import java.lang.reflect.Method; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import cpw.mods.fml.common.asm.transformers.AccessTransformer; public class CoreTransformer extends AccessTransformer { private static CoreTransformer instance; @SuppressWarnings({ "rawtypes", "unchecked" }) private static List<String> mapFiles = new LinkedList(); public CoreTransformer() throws IOException { super(); instance = this; // Add the transformers here mapFiles.add("mrmewniverse_at.cfg"); Iterator<String> iterator = mapFiles.iterator(); while (iterator.hasNext()) { String file = iterator.next(); this.readMapFiles(file); } } public CoreTransformer(String par1Str) throws IOException { } public static void addTransformermap(String par1Str) { if (instance == null) mapFiles.add(par1Str); else instance.readMapFiles(par1Str); } private void readMapFiles(String par1Str) { System.out.println("Adding transformer mapping: " + par1Str); try { Method method = AccessTransformer.class.getDeclaredMethod("readMapFile", new Class[] { String.class }); method.setAccessible(true); method.invoke(this, new Object[] { par1Str }); } catch (Exception exception) { throw new RuntimeException(exception); } } } the _at.cfg # MrMewniverse Access Transformer # World Transformer public up.G # spawnHostileMobs # EntityPlayer Transformer public og.m()V # increaseLevel # Crafting Manage Transformer public-f td.a # instance And lastly the metainf stuff Manifest-Version: 1.0 FMLCorePlugin: mrmewniverse.core.Core And the reference file if needed: package mrmewniverse.core; public class CoreReference { public static final String MOD_ID = "mrmewniversecore"; public static final String VERSION = "1.0.0"; public static final String NAME = "MrMewniverse Core"; } [/hidden]
  5. Try using player.addChatMessage(String message);
  6. Use this tutorial: http://www.minecraftforge.net/wiki/Using_Access_Transformers That covers the basics. If you know what you are doing then you can go from there
  7. If you want to have, say a bag item, you would make it open a GUI in the onItemRightClick() method. Then its just a normal GUI with slots and such from there. The actual item saving would be done via the container I believe, not the actual item. So I would suggest learning about containers and such, or you could read through vanilla containers to see what they do. I would suggest looking into the inventory files
  8. no shit bro... Sorry about that. I do miss little tid bits like that. Thanks for answering though!
  9. Can you direct me to where I could start looking for how to access this NBT? Because I know I have seen a tutorial before, but I can't find it again...
  10. I am glad I updated that to 1.6.1! It saw that people were having trouble so I updated a few things to 1.6.1
  11. You were also telling the entity to die before it even checked that wether it was client or server... You are supposed to this.setDead(); in the if(!this.worldObj.isRemote) statement
  12. There is a tutorial in the forges tutorial section on (I think its called) Multi-block structures.
  13. I know that. And I have always had my items/blocks instantiated there. I don't get the nature of the problem
  14. I have all my textures in the same spot ([MCP]/src/minecraft/assets/rpg/textures/items/texture.png and [MCP]/src/minecraft/assets/rpg/textures/blocks/texture.png) but they still don't work! any help would be appreciated!
  15. Unless you were to build into the source a bit (I know this is not good, but I am suggesting an idea) and create some function that detects what blocks have been "set" by the player, and then when it comes to regeneration, don't disturb those blocks marked with the special flag. Also you would have to check for single or blocks that aren't light source blocks and regenerate those too. Because that would leave random singularly placed blocks that probably hold no meaning to the player... And I know I have said probably, there is still a risk that the player wants all blocks he (or she) has placed in the world. So I guess there is really no way at all aside from what I said earlier, without the "check for single blocks" bit. And also since I am pretty sure a base edit would be required, it is probably not worth it...
  16. I know 68 had some bugs.. I am updating to latest atm and ill get back to you!
  17. Yeah, the folder HAS to be in the [MCP FOLDER]/src/minecraft folder... so the path for that would be: [MCP FOLDER]/src/minecraft/assets/MODID/textures/model/TEXTURENAME.png
  18. I think diesieben07's Questology did something like this when their reactor something or other was used... From memory it regenerated the world with extra features in it... You would have to look into it. I am guessing you would know how to find their github? (It is under diesieben07's name on github)
  19. Probably a good idea to do that... When I moved all my code from 1.5.2 I got rid of the bugs ASAP so I could see what needed fixing visually. Aside from the textures and such being "redone", I couldn't test 3D item rendering because of the fact that in Forge version 8.9.0.768, items and blocks didn't get rendered in third person.* * I am going to test 8.9.0.771 soon to see if it is fixed
  20. Please give me that documentation. I am fixing some stuff up now
  21. Hmm... Shooting fists eh? I wonder... I might play around with that idea later Have fun with that! That does look like it would awesome fun to play as well
  22. Yeah, we did that tonight with the kids, just seeing that they could make a texture and import it in MC, they thought it was the coolest thing! Speaking of: can anyone recommend a good website / book on (basic ) java? Up to date? Other good modding tutorials than Forge's? Thanks. This page has some good stuff for beginners: https://netbeans.org/kb/articles/learn-java.html It's more exciting stuff that Oracle's reference pages for Java. Only problem with that is that its netbeans... Some of the stuff (probably not the basics though) won't apply because I am pretty sure MetalHead is using Eclipse. But that still looks like it could be quite good. Thanks for the future reference!
×
×
  • Create New...

Important Information

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