Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by leftler

  1. ModloaderMP and Forge are incompatible, either the mod author will need to switch off of ModloaderMP to something that is compatible (or forge itself) or you can choose not to use forge.
  2. The issue is that it replaces pc.class and pd.class. Anything that modifies base classes will produce unpredictable results with FML.
  3. No, not really, I am making a tool to place preview .schematic files inside minecraft, I want to draw the blocks from the schematics without actually placing the blocks as I want this to happen entirely client side and I do not want the client and server side to get out of sync. I could do your method but that would mean I would need to, at run time, somehow call my own custom getCollisionBoundingBoxFromPool instead of the original block's. My original idea was to make block shaped entities that where not collideable and not affected by gravity but if I can get "MinecraftForgeClient.renderBlock" to work that would be a much better solution. The big issue is I want this to be compatible with any mods that implement a custom renderer. So eventually I will need to call the block's renderer, whatever that my be.
  4. I need to render the appearance of a block without actually having the block exist in the world. I thought it would be as simple as the following: @ForgeSubscribe public void RenderWorld(RenderWorldLastEvent event) { //example test, should render a diamond at the world coordinates 70, 70, 70; MinecraftForgeClient.renderBlock(event.context.globalRenderBlocks, Block.blockDiamond, 70, 70, 70); } Putting a breakpoint in shows my code is being called from the Event Bus. However, if I travel to 70,70,70 the fax-diamond block is not there. (see attached image) I thought I had to maybe call "Tessellator.instance.draw();" but that gives a me a Exception because I am not tessellating Adding in a "Tessellator.instance.startDrawingQuads();" gets it to git rid of the error but the block still does not show up in the world. @ForgeSubscribe public void RenderWorld(RenderWorldLastEvent event) { Tessellator.instance.startDrawingQuads(); MinecraftForgeClient.renderBlock(event.context.globalRenderBlocks, Block.blockDiamond, 70, 70, 70); Tessellator.instance.draw(); } What is the correct way to manually render a block in the world when that block does not truly "Exist"?
  5. In a vanilla MCP copy "MCP_LOC\src\minecraft\net\minecraft\src\Tessellator.java" the "instance" field is marked final public static final Tessellator instance = new Tessellator(2097152); When you clone FML and run the setupbuildenviorment it produces the following in "MCP_LOC\src_work" and "MCP_LOC\src" public static final Tessellator field_78398_a = new Tessellator(2097152); However, in Forge's src_base, which in theory should be the same as FML's src_work folder, I have public static Tessellator instance = new Tessellator(2097152); Somewhere between Forge and FML that final disappeared, but for the life of me I can not figure out where this happened. The only place I could think to check is Tessellator.java.patch in forge, but that patch does not change that line of Tessellator.java. Also FML does not patch Tessellator.java at all. This is being done with Forge commit 7828ff9 and FML 8656fd5.
  6. Except that you skipped the part about if you don't name the folder "forge" instead of the default "ForgeClient" it breaks the build. Or that the two eclipse projects are not added and must be added by and that will mess up the ".metadata" folder so you will need to not commit those changes, or whats the difference between Clean-Client and Forge-Client, or how the build script works, or the 100 other little things that come up that could be easily explained in a step by tutorial.
  7. I have figured out what I need to do to submit a pull request but I did not find a singular location describing how to do it and explaining the build environment. I am having concerns I did it wrong due to some of the things I have noticed while setting up my build environment. For example, if I set my workspace to "C:\ForgeFork\mcp71\MinecraftForge\eclipse" (after running "setup.bat") neither "Clean-Client" nor "Forge-Client" show up as projects and need to be added by hand Is there any tutorial that I just missed? I just want to make sure I am not starting down the wrong path.
  8. Can you post the constructor for ThorMod_UltraOre(int, int) and any static variables that have initializers it has (anything that is declared static and has a = on the same line. public static SomeClass SomeVariable = new SomeClass(); Edit: If the class has a super class the static variables from the super class too. Edit2: Let me explain what I think is going on: "ThorMod.<clinit>" means while it was trying to create the class (before even the constructor was called, but I am not 100% sure) one of the static field variables thew a NoClassDefFoundError when trying to find the obfuscated class apn. apn is net/minecraft/src/GuiScreen, so likely the bad line is similar to static final GuiScreen someGuiScreen = new GuiScreen(); change the code to @SideOnly(Side.CLIENT) static final GuiScreen someGuiScreen = new GuiScreen(); and that may fix your problem, it will no longer initialize the GuiScreen on the server side.
  9. You can see where the problem is in the stack trace So in ThorMod.java line 57 is where the error occurs, Give us all of ThorMod.java and point out as a comment in the code which line is line 57.
  10. Just so you know, for the future, hit the + next to "this" ("this" represents the class you currently are stopped inside) You would see something like. Name Value this Reinforced_blocks(id=54) naquadahbomb naquadhbomb(id=123) naquadahingot null event FMLInitializationEvent (id=55) That would have told you that naquadahingot was null and you where trying to use it. If what you want are not inside "this" or one of the automatic variaibles you can add a variable to the "watch list" forces the item to be in the list. You do this by highlighting the variable you want, right click, then click "watch".
  11. Technical Need: I am replacing the Tessellator as a way to affect the opacity of all objects drawn during a time span even if they use a custom renderer. I am concerned if another mod also replaced the tessellator I will get InvalidCast exceptions when I try to call my "setOpacity" function. I would like my mod not to load, but not crash the game if some other mod has replaced the tessellator. Gameplay Application: I want to make a "Preview" of a structure from a schematic file visable inside a live game world. I need the player to see through the blocks in this preview as they do not really exist and I do not want to obstruct his view or make him thing there is a ledge when there really is not. Other Applications: If someone wanted to make a "Ghost village" mod they could use the same technique I used so villages and the villagers therein would be see-through. I guess I don't need it to gracefully fail and I can crash the game if there is a conflicting mod, I just did not want to do it as there would be no risk of "blocks turned to air" as I do not add any new blocks and any entities I make are not written out to the NBT and are only stored in memory. I think, for now, I will just go with the "Throw a exception and let the game show the crash screen" rout until the "enable/disable" mod functionality is fleshed out in a few major revisions and more mature methods of checking to see if anyone else clobbered your environment and gracefully failing to load is available.
  12. I don't know if you are being serious or not, but if you are, click on the line you want to add a breakpoint on and press ctrl+shift+B Breakpoints don't solve the problem, they let you stop the code and look at what values the variables have, check to see what the variables are before the function then if you have to do a "step in to" do go inside the function and find where the null is happening. Also please include your entire main mod file, not just those 4 lines of code.
  13. Either "Reinforced_blocks" or "Reinforced_blocks.naquadahbomb" is null. Put a breakpoint right before you add the recipe and see if either one is null.
  14. cpw did you ever get a chance to look at this thread? I still have not found a solution on how to gracefully fail to load a mod.
  15. Can you post the class declaration and the constructor for TileEntityMillChest?
  16. I really like this idea, it gives the best of both worlds. Information near the class in the code + parsability without loading the class.
  17. For your invisible entity problem read this thread on the Minecreaft form. It explains what the problem is and possible solutions. Make sure you click the links in the first post to go to update posts that help explain the sub-issues more (For you, this post may be the most helpful.)
  18. Can you elaborate on what you did to fix it. I am doing the same thing as you but I don't understand the mistake you made and corrected, but I am still making.
  19. It seems that @Mod and mcmod.info share a lot of the same features. Is the plan to phase out mcmod.info and just only use @Mod or does mcmod.info still have a future?
  20. cpw, I think I will need your help with this. LoadController.errorOccoured is not a static method, I did not find where to get my mod's LoadController from Loader.instance(). The closest I could find was "Loader.instance().activeModContainer().setEnabledState(false);" however that appeared to have no effect. The main menu still said 3 of 3 mods loaded and inside the ModGUI it still lists "ModState: Available" Any help would be greatly appreciated.
  21. That was a copy paste error, I meant to return "result", I have updated my example.
  22. Put your check in func_77660_a (I don't know it's non obfuscated name, it has that name in my de-obfuscated code) for the gun. That method is what damages the tool when it finishes destroying a block. public boolean func_77660_a(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving) { //Returns true when a block is broken boolean result = super.func_77660_a(par1ItemStack, par2World, par3, par4, par5, par6, par7EntityLiving); if(result == true) { this.setGunToExplode(); } return result; } You can also make it happen on hit by putting your check in getStrVsBlock code for the gun. public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { if(par2Block != null) { //We are hitting against a block if(par2Block.blockMaterial != Material.colth) { //If we hit any material other than ones that are cloth based, set the explode flag. this.setGunToExplode(); } } return 1.0F; }
  23. I am building a mod that lets players see their creations from schematic files in-game and can help them place the blocks in the correct locations to build large complicated projects when access to the raw map files are not available (like in a multiplayer environment). I want to differentiate these "planning blocks" from normal blocks so I am giving them some transparency. I also am making them Entities that just call the renderer the block would have used so I do not need to muck with the chunk's block list and get it out of sync with the server. To be able to use whatever custom renderer the block I am representing I needed to chang the alpha on all calls to the tesselator. To do that I subclassed the tesselator and replaced the SetColorRGBA(int,int,int,int) function. package leftler.mods.projectbuilder; import net.minecraft.src.Tessellator; public class GhostingTessellator extends Tessellator { private float opacity = 1.0F; public float getOpacity() { return opacity; } /** * Sets the global opacity. * @param opacity A multiplier between 0 and 1. Any number out of that range will be clamped. */ public void setOpacity(float opacity) { if(opacity > 1) opacity = 1.0F; if(opacity < 0) opacity = 0; this.opacity = opacity; } @Override public void setColorRGBA(int par1, int par2, int par3, int par4) { super.setColorRGBA(par1, par2, par3, (int)(par4 * opacity)); } } After that all the custom renderer does for the entity that represents the block is change the global opacity render the block, use the block's renderer, then change it back. package leftler.mods.projectbuilder; import net.minecraft.src.Block; import net.minecraft.src.Entity; import net.minecraft.src.Render; import net.minecraft.src.Tessellator; public class RenderGhostBlock extends Render { @Override public void doRender(Entity var1, double x, double y, double z, float yaw, float partialTickTime) { if(var1 instanceof EntityGhostBlock) { Block parentBlock = ((EntityGhostBlock)var1).parentBlock; ((GhostingTessellator)Tessellator.instance).setOpacity(.25F); this.renderBlocks.renderBlockByRenderType(parentBlock, (int)Math.round(x), (int)Math.round(y), (int)Math.round(z)); ((GhostingTessellator)Tessellator.instance).setOpacity(1.0F); } } } This code is untested, I am still working on getting the EntityBlocks to spawn at normal opacity. but I was planning ahead so I asked this question. I also renamed it from GhostingTessellator to CustomTessellator as I was worried people would scream "OMFG R U making XRAY mod?!?!?" and not help me due to this helping cheaters. I realized that was a stupid worry and changed the name back.
  24. With the client/server split I am having a little trouble knowing where to put my code. I am building a mod that lets players see their creations from schematic files in-game and can help them place the blocks in the correct locations to build large complicated projects when access to the raw map files are not available (like in a multiplayer environment). I have figured out that I am going to represent these planning blocks as entities (I call them "EntityGhostBlocks" due to their opacity not being set to 100%). This lets me not worry abut block replacement code and I keep the in-memory chunk block list pristine and in sync with the server. When a real block gets placed on the entity I remove it. The issue is I wanted to set this up so a player could use this on a multiplayer server without any server side mods installed. My question is how do I get these entities to show up and be able to manipulate them on the client but not have them sent to the server?
  25. There are some environment checks I need to perform to check for mod incompatibilities. If those incompatibilities are found I want to move my mod to the "ModState.LoadedState.ERRORED" state. @PostInit public void postInit(FMLPostInitializationEvent event) { //if(Tessellator.instance instanceof GhostingTessellator == false) //comment out for testing { Exception ex = new LoaderException(); FMLLog.log(Level.SEVERE, ex, "The custom tessellator for Project Builder has been replaced by another mod. The mod will not work without it."); FMLCommonHandler.instance().raiseException(ex, "The custom tessellator for Project Builder has been replaced. The mod will not work without it.", false); } } If I set "stopGame" to "true" or just do a simple "throw ex;" instead of calling FMLCommonHandler it stops the entire game from launching, which I do not want. (Also changing the exception from "LoaderExecption" to "Exception" or "Throwable" gives the same results) If I set "stopGame" to "false" I can see my warning in the console log when it launches (so I know the code is executing) but the mod still shows "Mod State: Available" in the list of mods GUI. and the main menu shows "3 mods loaded, 3 mods active" This is with build Here is the console output with "stopGame" set to "false" Here is the console output when using "throw ex;" And here is the crash report that was generated with the above crash.
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.