
Frepo
Members-
Posts
41 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
Frepo's Achievements

Tree Puncher (2/8)
7
Reputation
-
Say I make a core mod using ASM and want to run it on a SMP server, are there any requirements for the other players that wants to join the server? Any sort of plugin or library that they need to install before joining?
-
Yeah I've read some about it, the code injection part really caught my attention. I'm considering learning it since it seems to offer some really neat soultions to many of my problems. Hell I've even considered skipping API's like Forge altogether and learn how to purely do coremodding. But then again, I think it would be too time consuming working with obfuscated code, having no help in getting my code into minecraft and so on. There's simply not enough time when you're working 5 days a week. Anyway, haha slipping off topic here I'm gonna look into this! Thanks for the tip bro!
-
Oh hi GotoLink! Haha this is the second time I have you pointing your finger at me ... last time being (if recall) on a similar topic but in 1.6 involving the furnace I believe. Sure, events are great! Whenever I can I use them of course. But surely you understand that they do not cover all of ones needs. If we encounter a situation where there is no hook to save us, we'll simply have to find alternate ways. Not recommended to replace blocks? I was hoping my "second thoughts" earlier would hint that I'm aware of that. I'm not gonna try to have my mod in any FTB packs or anything, it's going all solo! Don't you worry about that. Now, whats recommended or not is not helping me here. Come on guys, let's work together here! Time to replace them blocks! (in complete awareness of what is recommended or not for YOUR mod of course)
-
Indeed I could. Only problem being that I want to replace dirt. I'm afraid there simply is no workaround here. Replacing vanilla blocks is something I MUST be able to do to have my mod become what I want it to be. There is sooooo much you can do with the ability to replace blocks. I see questions like i.e. "how do I add particles to this block?", "how do I remove gravity from that block?", "how do I make cacti do more damage?"... the answer to sooo much is replace the block (or item) with your custom block/item, copy paste or extend the vanilla block/item and have it do whatever you please! make a rose squeal like a pig for all I care!
-
On second thoughts, I guess I understand that there is no hook for this. Replacing a vanilla block is (in a sense) a coremod, and conflicts with the basic principles of Forge. So the jury may ignore my last statement.
-
I'm very surprised that there are no solutions, or hooks, or whatever.. not even discussions on the topic (none that I can find anyway). So here we go.. Has anyone found a way to replace vanilla blocks? As most of us know by now that the block registry system has changed dramatically. In 1.6.x you just wrote Block.blocksList[id] = null; myBlock = new MyBlockClass(666); Block.blocksList[id] = myBlock; and the vanilla block had magically changed to myBlock! Now we have the Block.blockRegistry to play around with, but its no fun playmate! I've been tinkering with putObject and addObject (in an attempt to overwrite the block listed at the specific index)... sadly with no success. Shouldn't there be a hook in the SimpleRegistry class "overwriteObject(int, object)" or something, that simply replaces the object at specified index with the object passed in)? There must be many many modders out there who (like me) don't just want to add new stuff. I mean why bother with i.e. new food stuff, isn't it easy enough already to stay well fed in minecraft? That my friends is some FOOD for thoughts! errm.. (pardon my low sense of humor). Anyway....is there a way?
-
Thanks for the clarification Ghost. I got the particles to spawn as long as the heat is > 0. And render a fire animation inside the campfire as long as something is burning. But now the currentItemBurnTime is out of sync The actual time each item is burning seems to be fine... it's just the progressbar is behaving strange. AND, I get not fire animation when I first start cooking something, I must close the GUI and open it again to get the fire to render. My oh my... this is so frustrating! BlockCampfire TileEntityCampfire TileEntityCampfireRenderer
-
Haha these charts make me even more confused Updating variables in TileEntities (such as cookTim, burnTime etc) should be done server-side right? Another thing, what happens in all functions that don't have a .isRemote statement? Is that code executed on both server and client?
-
Thanks for the tip! I'll do some research with that in mind. Are you familiar with the isRemote-check? I know what it does, and why it is used. I'm just not sure where to place it. Have I misplaced it in updateEntity? I've tried to place it in several locations, ending up with different results. Heat and cook timers start bugging out, the progress bars stops and stuff like that.
-
Yeah, you'll have to take care of the errors one at a time. this.blockAccess, remove "this." and only have blockAccess (the 1st in-parameter of renderWorldBlock should be a blockAccess). You will also have to change the name of the in-parameters x,y, and z. x = par2, y = par3, z = par4. Also change block to par1Block. You must match the in-parameters so they correspond to the names used in the code you copied from renderBlockStem. The very fist line BlockStem blockstem = (BlockStem)par1Block; needs to be your customBlock. renderMaxY i guess you don't have either. Perhaps you'll have to write a little method in your customBlockStem class that returns the bounding box's maxY-value. and replace renderMaxY with something like blockStem.getBoundingBoxY(). In your ClientProxy, declare myRenderID and add the following lines in the registerRenderers() method: myRenderID = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(myRenderID , new MyRenderer());
-
When you place the block in the world, slot 6 is empty. So this.electrolysisItemStacks[6].getItem() is NULL. Make a check that there is an actual item in the slot before trying to compare it with anything. if(this.electrolysisItemStacks[6].getItem() != null && this.electrolysisItemStacks[6].getItem() == Elementum.upgradeSpeed){ finishTime = 1200 /(this.electrolysisItemStacks[6].stackSize + 1); } else { finishTime = 1200; }
-
So I have my BlockCampfire, together with it's TileEntityCampfire. Which is basically a furnace. But I have added a new heat parameter to the tileentity. As the vanilla furnace does, my campfire switches between campfireIdle and campfireBurning depending if there is fuel burning inside, with the exception that the campire should remain in the burning state as long as there is any heat left (so it emits light during dark creepy nights). And that works fine. Now I only want it to generate the flame & smoke particles when something (fuel) is burning (furnaceBurnTime > 0). Here is where my problem emerges. As soon as the burn time is up (the coal lump is used up) it stops spawning the flame particles, EVEN if I have more coal that keeps the campfire going. If I right-click and opens up the GUI it starts spawning again, only to stop again when the burn time is up. The campfire works perfectly (burn, heat, and cook timers, as well as the counters). It's just the damn particles that stops spawning when the currently burning fuel source is consumed. It must be something with the server and the client that goes out of synch or something In BlockCampfire I have moved the spawn particles code to the TileEntityCampfire... (for some reason that I can't remember) @SideOnly(Side.CLIENT) public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { TileEntityCampfire tileentity = (TileEntityCampfire)par1World.getBlockTileEntity(par2, par3, par4); if (tileentity != null && tileentity instanceof TileEntityCampfire) { tileentity.validate(); tileentity.generateCampfireFlames(par1World, par2, par3, par4, par5Random); } } Here are the relevant methods from the TileEntityCampfire class public boolean isBurning() { return this.furnaceBurnTime > 0; } @SideOnly(Side.CLIENT) /** Generate flame animation while fuel is still burning */ public void generateCampfireFlames(World par1World, int par2, int par3, int par4, Random par5Random) { if (this.isBurning()) { float f = (float)par2 + 0.5F; float f1 = (float)par3 + 0.0F + par5Random.nextFloat() * 4.0F / 16.0F; float f2 = (float)par4 + 0.5F; float f3 = par5Random.nextFloat() * 0.6F - 0.3F; float f4 = par5Random.nextFloat() * 0.6F - 0.3F; par1World.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); par1World.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); } } /** * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count * ticks and creates a new spawn inside its implementation. */ public void updateEntity() { boolean flag1 = false; boolean flag2 = this.currentHeat > 0; if (this.furnaceBurnTime > 0){ --this.furnaceBurnTime; if(this.currentHeat > this.maxFuelHeat) this.decreaseHeat(); else this.increaseHeat(); } else{ this.decreaseHeat(); } if (!this.worldObj.isRemote) { // *** isRemote bracket if (this.furnaceBurnTime == 0 && this.canSmelt()) { this.maxFuelHeat = getMaxFuelHeat(this.furnaceItemStacks[1]); this.currentItemBurnTime = this.furnaceBurnTime = getItemBurnTime(this.furnaceItemStacks[1]); if (this.furnaceBurnTime > 0) { flag1 = true; if (this.furnaceItemStacks[1] != null) { --this.furnaceItemStacks[1].stackSize; if (this.furnaceItemStacks[1].stackSize == 0) { this.furnaceItemStacks[1] = this.furnaceItemStacks[1].getItem().getContainerItemStack(furnaceItemStacks[1]); } } } } if (this.canSmelt() && this.currentHeat >= this.getHeatNeeded()) //this.isBurning() && { ++this.furnaceCookTime; if (this.furnaceCookTime == this.cookSpeed) { this.furnaceCookTime = 0; this.smeltItem(); flag1 = true; } } else { this.furnaceCookTime = 0; } if (flag2 != this.currentHeat > 0) { flag1 = true; BlockCampfire.updateFurnaceBlockState(this.currentHeat > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord); } } // *** isRemote ending bracket if (flag1) { this.onInventoryChanged(); } } why WHY WHYYYYY does the particles stop spawning!? /Thanks in advance for any help
-
Yeah hehe it's kinda good to have at least a basic understanding of the proxies. Check this out for some explanation and writing the basic shell code: http://www.minecraftforge.net/wiki/Proxies This one is good as well for setting up your proxies: http://www.minecraftforum.net/topic/1891086-162-minecraft-forge-modding-3-reference-and-proxy-files/ And in your ClientProxy class you add the following method: @Override public void registerRenderers() { } Here is where you put the stuff i mentioned earlier. Well, the declaration of your custom renderTypeID don't need to be inside this method, put it above (as public).
-
1. Create a class MyRenderer which implements ISimpleBlockRenderingHandler. Add the auto-generated methods needed for this class. Copy and paste the rendering code from RenderBlocks (renderBlockStem) to the renderWorldBlock() method in MyRenderer. You might also want to copy renderBlockStemSmall and renderBlockStemBig to MyRenderer to get it to work (not sure). You'll get errors when pasting the code, e.g. "this." is the renderer parameter passed into renderWorldBlock(), so be sure to replace all (and anything else that does not match). 2. Assign it a myRenderID (your custom render ID) and link it to MyRenderer. In your ClientProxy, declare myRenderID and add the following lines in the registerRenderers() method: myRenderID = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(myRenderID , new MyRenderer()); 3. Ensure your myBlock.getRenderType() returns myRenderID. Hope I did'nt miss anything... but thats about it, I think
-
Ok. Thank you for your help! I'll figure this out somehow.