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

epicsquare

Members
  • Posts

    35
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

epicsquare's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. How about something like this: Every solar panel has its own tile entity. Each tile entity has a List (lets call it otherPanels) that will contain a list of all other solar panels in the structure. When placed, the tile checks adjacent blocks for solar panel tiles, and if it finds one, it requests from it its otherPanels list, sets it as its own. It then notifies every tile in that list that it is now also part of the list (enumerate through the list and call .addToOtherPanels(this) or something for each element). You can also now call some method for every other panel to notify them that the storage capacity has increased. When any panel loses energy, it enumerates through that list and tells all the other panels to decrease their internal buffers by the appropriate amount. So basically every panel keeps track of the total capacity and current energy level for the whole structure, and they are all synced when any of those changes by whatever panel caused the change. I feel like there's a way you can do this recursively, but I haven't thought it through enough for that. I don't know if this is the best approach, but it's all I could come up with off the top of my head at 2am. Let me know what you think
  2. Well, I seem to have found an extremely sketchy, but somewhat effective fix. Basically when creating the structure, I put a single custom block with a tile entity. Each second (20 ticks) the tile entity checks for players within 100 blocks, and if one is found it updates all the lights in a 50 block radius around it, then replaces itself with a grass block. I know this is very inefficient and somewhat lag inducing, but the performance impact has been tolerable (as far as I can tell, its just a single 500 - 600 millisecond stutter when approaching the structure), and it does solve the problem. Here is the code for the tile entity: If anyone has a better suggestion, please post!
  3. Thanks for the suggestion, I don't know why I did not think of stepping into updateLightByType lol Turns out this check (the first check in the method) fails : if (this.doChunksNearChunkExist(par2, par3, par4, 17)) { Which makes sense because the structure is being generated with the chunks. TECHNICALLY, I'm generating it on onPopulateChunkPost(PopulateChunkEvent.Post event) because I read that for large structures generating them on that event (rather than registering an IWoldGenerator) prevents them from getting cut off. None the less, that event is called after the IWoldGenerator would have been so the problem remains. If I can't update my lights here, where can I (so that all the chunks would already be generated)? EDIT: I tried force generating all the nearby chunks before updating lights - did not help (.doChunksNearChunkExist is true and the update lights code runs, but dark blocks remain). Not only can I not debug the blocks that are dark (I don't know which ones hey are until I see them in-game, and update lights gets run on every solid block I generate), but this.computeLightValue(par2, par3, par4, par1EnumSkyBlock); seems to return 0, and I don't know whether it it supposed to or not (is that block naturally unlit or is it the bug). The link did prove quite interesting, thank you, but I'm still unsure as to the specific cause in my case.
  4. Hi everyone, I'll get right to the point: I'm generating a structure and it has the weird blacked out areas lighting bug: I don't know what causes it, and for the life of me I can't get rid of it. The black bits are all over the place and are really annoying to look at. I've tried running world.markBlockForUpdate(x, y, z); world.updateAllLightTypes(x, y, z); on every block inside the structure (both air and solid) after generating the structure, and it still happens. Also, when generating the structure, I'm passing 3 as a flag to set block - world.setBlock(x, y, z, id, meta, 3); Any advice?
  5. I need to get the ingredients. IRecipe does not seem to offer that.
  6. So every recipe except the ones you mentioned are stored in CraftingManager.getInstance().getRecipeList();? Right now I'm checking each IRecipe in that list if it is an instance of ShapedRecipes or ShapelessRecipes. Should I be checking for others? For example swords and other tools don't seem to be shaped or shapeless so what are they?
  7. Is there really no easy way to do this?
  8. Hi all, I have a very simple issue, but I haven't been able to find a simple answer to it. All I want to do, is get the recipe of an item or block. More specifically, I want to get the recipe of every item or block in the game (Including items added by mods). I think NEI does this, and I do believe they have an API but I have yet to find proper documentation on it. I've tried @EventHandler public void postInit(FMLPostInitializationEvent event) { List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList(); } However this does not include many recipes for vanilla items such as tools. Am I running it too early?
  9. Where would I find the PreRenderPlayer/PostRenderPlayer events? I don't see them in the Event reference (http://www.minecraftforge.net/wiki/Event_Reference). As you said I realized that returning EnumAction.bow for GetItemUseAction puts the player in a bow stance and if I setItemInUse every update that it is held, (and give a long item max use duration) it appears to be held the way I want it, and even for some reason does not slow down the player (I guess minecraft does that only while mouse is down). This solution works, however it makes it so that OnItemRightClick, and OnPlayerStoppedUsing are never called so i have to call them manually from the client's update (when mouse is up/down) and send packets about it to the server. It's a very hacky solution, so i'd like to hook the player renderer as you said if I can, as that seems much more proper. Also I'd also like to avoid ASM if possible. EDIT: So I created my own class MyPlayerRenderer extends RenderPlayer and registered it with RenderingRegistry.registerEntityRenderingHandler(EntityPlayer.class, new MyPlayerRenderer()); Now to render the bow stance I overrode renderLivingAt With @Override protected void renderLivingAt( AbstractClientPlayer par1AbstractClientPlayer, double par2, double par4, double par6) { ItemStack currItem = par1AbstractClientPlayer.getCurrentEquippedItem(); if (currItem.getItem() instanceof BaseItem) { if (((BaseItem)currItem.getItem()).type == 0 || currItem.stackTagCompound.getBoolean("mouseDown")) { this.modelBipedMain.aimedBow = true; } } super.renderLivingAt(par1AbstractClientPlayer, par2, par4, par6); } This works perfectly for third person view but how do I get it to render the arm also in first person with the item held like an aimed bow?
  10. Hi all, My question is - I want to force the player into a drawn bow stance at all times while HOLDING my Item (My Item does not extend ItemBow, and I don't think I can do that for my own reasons). Preferably I want the player to not slow down in movement while doing this as well. Any way to do this? Thanks for any help!
  11. I'm having the exact same issue. My sound is Wave format PCM signed 16bit stereo. I saved 4 very similar sounds using the same program, same format, 2 of them work 2 get that error and for the life of me I can't figure out why. Can anyone help? EDIT: So I figured it out. Its got nothing to do with format, eclipse did not include my sounds in the project. To fix I just right clicked on the assets "package" in eclipse and hit refresh. Hope this helps someone
  12. Thanks! That works so long as the player doesn't fall or get launched a large distance somehow. I wonder if there is a way to make it actually follow the player.
  13. Hi all, I have a sound that I'm playing with par2World.playSoundAtEntity(entPlayer,.... but that just plays it at the player's current location, and if he is running at the moment, it just fades off into the distance. The sound is about 5 seconds long, and I was wondering if there's any way to make it play at the same volume no matter where the player goes after it begins playing. Essentially make the player actively emit the sound. Any help is very appreciated!
  14. It seems like my problem is now in this part: if (!par2World.isRemote && par2World.getGameRules().getGameRuleBooleanValue("doTileDrops")) { float f = 0.7F; double d0 = (double)(par2World.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; double d1 = (double)(par2World.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; double d2 = (double)(par2World.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; EntityItem entityitem = new EntityItem(par2World, (double)x + d0, (double)y + d1, (double)z + d2, iss); entityitem.delayBeforeCanPickup = 10; par2World.spawnEntityInWorld(entityitem); dropModified = true; } Its not actually spawning anything even though the code is run just fine. It spawns something once then stops
×
×
  • Create New...

Important Information

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