Jump to content

Flenix

Members
  • Posts

    440
  • Joined

  • Last visited

Everything posted by Flenix

  1. Part of Minecraft I'm afraid. Only option is to use ISBRH instead. Harder to use but better in the long run
  2. Totally speculating here, but what happens if you just make a new "inventory" GUI, and use the same keybind to override the original one? There's probably a better way of doing it but just throwing that out there.
  3. Hey guys, I've had an idea I want to add to the mod I run on my server (which is a collection of small things which don't really need their own mod), but I'm not quite sure how to implement it. Basically, the entire world would be "radiated", and if you're just standing there, you'll get a "Radiation" potion effect, which will slowly kill you, damaing half a heart every 10 seconds or so. It would eventually kill you, and the effect remains for about 30 seconds even after you're "safe". There are two ways to become safe- The first is to wear a full set of special armour which will be included with the mod. The armour will lose durability very slowly, with a set lasting roughly 1 hour. You spawn with a set and it's easy to make. The second is to be within the radius of an Air Filter, which is a block that makes you safe as long as you're close enough to it. Now, I'm not sure how to implement any of those really- it's not something I've done before. So this thread really has 3 questions: 1. How would I make and apply the potion effect? It doesn't need a potion item or anything, it just needs to take effect when the player is "unsafe". 2. How would I make the player safe when wearing armour, and damage that armour? I understand I need a tick handler, but I've got no idea how those work and couldn't find any examples. 3. How would I make the Air Filter block work? Would it be better to just do a simple radius, or clean the chunk it's placed in, or something else? I assume it would require a tick handler, just like the armour... Would it need to be a Tile Entity? (I'd rather it wasn't) If there's a tutorial or an example of any of these that'd be great, if not any advice would be really helpful too. Thanks
  4. Hey guys, Before I start this thread, I know a lot of people here don't like bukkit or don't "agree" with trying to connect the two. However, due to the nature of my mod, it would be stupid for me to not do this. If you are opinionated against bukkit, please just keep it to yourself, I just want to get the issue solved without flame wars breaking out Right, onto my issue; I'm currently making an economy mod for Forge. It has physical money, which can be stored in a bank (with the balanced stored as NBT data on the player). What I want to do, is add support for Bukkit plugins, if the server is running BukkitForge or MCPC+. For this, I have two options: Option 1: Hook Vault directly. This would mean that my economy mod would directly support the Vault API, and most bukkit plugins which have economy support will work with it. But, it would be hard to create new accounts on this system, unless I somehow allow players to have multiple accounts which I'm not quite sure how I would do... Option 2: Create an interfacing bukkit plugin. This would just be a simple bukkit economy plugin, designed to sync with my mod's balances. Using this, I could also have other accounts created very easily - which is essential for plugins like Towny or Factions. In terms of Option 1, I did post on the Vault forums about how exactly I'd do that: What I don't understand is how I would hook Bukkit in the first place with a forge mod, without it being a dependancy. If Bukkit isnt' installed, my mod should continue without the bukkit support, I don't want it crashing if Bukkit isn't there. As for Option 2, the main thing I can't figure out is how I would sync the accounts, and what would happen if a non-player account was created. The Forge side is stored as NBT on the player, in the /world directory, and the Bukkit side (I assume) would be stored in some sort of flatfile or db, in the /plugins directory. Both sides need to read each other frequently to check for changes, and sync accordingly. But what if the bukkit plugin creates a new account for a town with the name "Foobar"? There's no player called foobar, so what would the forge mod do when trying to sync that one? I can't just create the NBT... if a player made a town called "Notch" then Notch logged in, he'd have access to that towns money. Final note, I have considered there might be issues with sync. For example, say an account has 300 in. If a town claims land and loses 15, but at the same time a player deposits 25 into their account, the numbers would both be off - bukkit would think it was 285 and Forge 325. I would handle this by storing a copy of the balance each time it syncs, then when it resyncs it checks that balance comapred to itself, and instead of saying "I'm 325", it would say "I have added 25". Bukkit would reply with "I have taken 15, so we are adding 10 to the existing balance" and they'd agree to sync on 310. Is that the best way of handling that scenario, or is there something easier? I don't want to sync too often, I was thinking every 5-10 seconds so it shouldn't cause any form of lag. I'm open to any ideas, I'm really not sure how I'm going to do this integration at all. I'm pretty much just rambling now.. help!
  5. BC Isn't modular any more though is it? I don't remember it ever being modular in fact... Is there any other open-source mods which are modular? The main thing I need is "disable X if Y module isn't installed". For example, one of my modules will be an economy system. If that's installed, then everything else should have a pre-defined value - so obviously I don't want it to crash when X module isn't installed I want those values to be set within the module, so say I have a module called Food, then a burger should tell Economy how much it's worth, not Economy saying the burger is worth X. That way other people could theoretically make modules to work with my mod too. That's just a simple example, I could probably just use a variable for that but hopefully you get what I mean.
  6. Hey guys, I want to make my mod modular, so people just install whatever parts they want. Is there anything special I'd need to do? Does each module need to be its own "mod"?
  7. I've done animations for mobs with techne, but never tried blocks to be honest. I only recommended techne as it's easier for newbies than something like blender. That being said, one of the default plugins of the engine I'm using is a wavefront editor. And, when I get my plugin working on there, you can convert between wavefront and tessellator models at the click of a button.
  8. I'm not sure if mobs can actually be made with the tessellator, you'll have to use techne and a model file for that. Check the OP, just added a link to the newer one.
  9. Blocks which use the tessellator for models, yes. It's quite different to Techne- this wont cover mobs or animated models, just straight up models (for example the in-game Fence) I'm re-writing with a different core at the moment which should make it much easier to use.
  10. Hey guys, As some of you may have seen, I recently had a lot of issues getting a working tessellator. I've now got it, so I've modified an old model editor made by IceReaper (from MoreMaterials, a Spout plugin) to hopefully throw out tessellator code. I need people to test it and give me feedback. It's not perfected interface yet (for example there's a bug where once you create a shape, you can't edit/delete it), but if you could make some things, use the code and tell me if you have issues that would be lovely You'll need to set up the rest of the ISBRH yourself. It only exports the renderWorldBlock method. http://www.silvania.co.uk/model/forge It's very shoddy, and should not be used properly just yet! For an example, here's an upper-half slab: And the Export box gave me this code: @Override @SideOnly(Side.CLIENT) public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { int meta = world.getBlockMetadata(x, y, z); int side = 0; //Change as required Icon icon = block.getIcon(side, meta); //Change stone to whatever block you want to mimic for light interaction. Not 100% precise! int brightness = Block.blocksList[block.stone.blockID].getMixedBrightnessForBlock(world, x, y, z); float u = icon.getMinU(); float v = icon.getMinV(); float U = icon.getMaxU(); float V = icon.getMaxV(); Tessellator tess = Tessellator.instance; tess.addTranslation(x, y, z); tess.setBrightness(brightness); tess.setColorOpaque_F(1.0F, 1.0F, 1.0F); tess.addVertexWithUV(0 1 1, u, v); tess.addVertexWithUV(1 1 1, u, v); tess.addVertexWithUV(1 1 0, u, v); tess.addVertexWithUV(0 1 0, u, v); tess.addVertexWithUV(0 0.5 1, u, v); tess.addVertexWithUV(1 0.5 1, u, v); tess.addVertexWithUV(1 1 1, u, v); tess.addVertexWithUV(0 1 1, u, v); tess.addVertexWithUV(1 1 1, u, v); tess.addVertexWithUV(1 0.5 1, u, v); tess.addVertexWithUV(1 0.5 0, u, v); tess.addVertexWithUV(1 1 0, u, v); tess.addVertexWithUV(0 1 0, u, v); tess.addVertexWithUV(1 1 0, u, v); tess.addVertexWithUV(1 0.5 0, u, v); tess.addVertexWithUV(0 0.5 0, u, v); tess.addVertexWithUV(0 0.5 1, u, v); tess.addVertexWithUV(0 1 1, u, v); tess.addVertexWithUV(0 1 0, u, v); tess.addVertexWithUV(0 0.5 0, u, v); tess.addVertexWithUV(1 0.5 1, u, v); tess.addVertexWithUV(0 0.5 1, u, v); tess.addVertexWithUV(0 0.5 0, u, v); tess.addVertexWithUV(1 0.5 0, u, v); } The main issue right now is the UVs aren't done yet. You need to edit them for each quad, like so: U, V U, v u, v u, V (To display your texture upright. Change it if you want to rotate the texture) UPDATE: I've remade it using a different base. It certainly looks much nicer now, and it's text-to-edit instead of button to edit, which makes workflow a bit faster but a slightly steeper learning curve. It also gives you much more control. This version still has the above-mentioned UV bug, and also the cube is currently offset by half a block in each direction. I'll fix that later http://silvania.co.uk/model/asmt/ Tell me which of the two editors you prefer!
  11. Found his post. int brightness = Block.blocksList[block.stone.blockID].getMixedBrightnessForBlock(world, x, y, z); tess.setBrightness(brightness); tess.setColorOpaque_F(1.0F, 1.0F, 1.0F); Those set the brightness to match Stone, from what I understand. At any rate, it works perfectly! Marking topic solved. I'm sure I'll be back with more issues soon but the tessellator itself works now. Now time to go modify my old modeller to export this code and we can finally get a decent alternative to Techne and the TESR
  12. Don't suppose by any chance you know what I do to fix it?
  13. I did some experimenting... it seems to be height related? Here's the ramp placed on stone and grass at different heights: This is certainly very weird... I obviously need a line to override using the overlay, but what... EDIT: More experimenting, seems to be something to do with relevant block placement. I was building a little ramp so I can test other stuff while I try and get this sorted, and noticed this. When the stone is there, only the one below it is green. But, when I break it, 4 out of 6 are green... The one in the background changes too. I'm so confused right now.
  14. I actually just tried it with a road arrow texture before I went last night, and yes it doesn. The pale green here should be white (as shown in my hand): So, must be something in my code that makes it that little bit greener... (Ignore the fact the hitbox doesn't line up. The block is in the correct place for what I'm doing, just haven't set the box yet)
  15. It's the wrong shade, I should have mentioned that See how it's tinted a little green? The one on the right is the best example. It's supposed to be the same as the block it's sitting on.
  16. ^Still that
  17. From looking through that post a couple of times, I can't quite see where I went wrong. Everything looks like it's acting as it should, so I guess my error must be elsewhere... Can anyone see anything obvious and glaring that I've missed? renderer code: package co.uk.silvania.roads.block.tess.renderers; import org.lwjgl.opengl.GL11; import co.uk.silvania.roads.client.ClientProxy; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.Icon; import net.minecraft.util.ResourceLocation; import net.minecraft.world.IBlockAccess; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ShortRampRenderer implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { } @Override @SideOnly(Side.CLIENT) public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { int meta = world.getBlockMetadata(x, y, z); Icon c = block.getIcon(0, meta); float u = c.getMinU(); float v = c.getMinV(); float U = c.getMaxU(); float V = c.getMaxV(); Tessellator tess = Tessellator.instance; tess.addTranslation(x, y, z); //Base tess.addVertexWithUV(0, -0.25, 1, u, v); tess.addVertexWithUV(0, -0.25, 0, u, V); tess.addVertexWithUV(1, -0.25, 0, U, V); tess.addVertexWithUV(1, -0.25, 1, U, v); //Top Slope tess.addVertexWithUV(0, -0.25, 1, u, v); tess.addVertexWithUV(1, 0.75, 1, u, V); tess.addVertexWithUV(1, 0.75, 0, U, V); tess.addVertexWithUV(0, -0.25, 0, U, v); tess.addVertexWithUV(1, -0.25, 0, u, v); tess.addVertexWithUV(1, 0.75, 0, u, V); tess.addVertexWithUV(1, 0.75, 1, U, V); tess.addVertexWithUV(1, -0.25, 1, U, v); tess.addVertexWithUV(1, 0.75, 0, u, v); tess.addVertexWithUV(1, -0.25, 0, u, V); tess.addVertexWithUV(0, -0.25, 0, U, V); tess.addVertexWithUV(1, 0.75, 0, U, v); tess.addVertexWithUV(1, 0.75, 1, u, v); tess.addVertexWithUV(0, -0.25, 1, u, V); tess.addVertexWithUV(1, -0.25, 1, U, V); tess.addVertexWithUV(1, 0.75, 1, U, v); tess.addTranslation(-x, -y, -z); return true; } @Override public boolean shouldRender3DInInventory() { return false; } @Override public int getRenderId() { return ClientProxy.RoadsRampShortRenderID; } } And my block's class: package co.uk.silvania.roads.block.tess; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import co.uk.silvania.roads.Roads; import co.uk.silvania.roads.client.ClientProxy; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class RoadRamp5 extends Block { public RoadRamp5(int i) { super(i, Material.rock); this.setCreativeTab(Roads.tabRoads); this.setHardness(1.0F); } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public int getRenderType() { return ClientProxy.RoadsRampShortRenderID; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { blockIcon = iconRegister.registerIcon("roads:roadBlockMiscSingles0"); } @SideOnly(Side.CLIENT) public Icon getIcon(int side, int meta) { return blockIcon; } } And just to prove my texture is in the correct place: Any ideas? I'm so close to having this down now and then I can progress hugely with my mods!
  18. with my mob, I've got my textures like this: private static final ResourceLocation field_110833_a = new ResourceLocation("remula", "textures/entities/mobglog.png"); //Other stuff protected ResourceLocation func_110832_a(EntityGlog entity) { return field_110833_a; } Note that in my method I'm calling EntityGlog, not Entity. Glog is the name of my mob, so try that.
  19. Oh, so you were just saying side/meta as a way of saying "specify your side and meta here"? I get that now. It's rendering A texture now, just not correctly. I think I just need to understand UV a bit more so I'll google around. Progress is progress though!
  20. Yeah, that's the thing I'm talking about. When I put that in my renderWorldBlock class, it's obviously trying to find side and meta variables which don't exist: Do you not have a finished and working example...?
  21. One last thing; where do I put the icon method from your tutorial? obviously renderWorldBlock doesn't have a side or meta call (It might be a good idea to add a finished, working example class to the tutorial?)
  22. Shit just got REAL! Time to have some fun with this, thanks for all your help!
  23. Thanks, I'll tinker with the button stuff. As for the second one, I'm not encouraging bukkit, just replacing one of the things I enjoyed from it. Forge is missing a decent economy system, so I'm trying to fill the void a bit and the more things I support, the better. I am actually adding bukkit support to the mod for MCPC+ servers, but that's irrelevant
  24. Can anyone point me in the right direction for buttons and packets? It's mainly buttons I'm struggling with, I can't get them in-game and I can't find any up-to-date examples. I understand once I have the button, I need a packet to use it too? What I'm trying to do is when a player presses a button in a GUI, it checks their NBT and if a condition is met, gives them an item. Because I don't want to flood the forums too much, I'll post another question I have too. My mod adds money, and ways of earning it. One thing I want is a forge answer to the Essentials /sell hand command from Bukkit. Basically, it checks what you're holding, reads it's "value" from a config file, then takes the item and gives you the money. For this to be effective in Forge, I need a config file which lets people add support for other mods blocks/items themselves - without me having to add support for potentially hundreds of mods. What would be the best approach to reading from configs like this? I was thinking somehow reading the modID and unlocalized name. Can I do that without specifying a particular mod to look at? Ideally I don't want to use item IDs, because if I do it with modID and name, people can share the config without worrying about different ID's between peoples clients.
  25. Alright, I'll try this wehn I'm back at my computer. Isn't the UV part required though? I thought that was the texture part, without it wouldn't it be invisible still like it is now?
×
×
  • Create New...

Important Information

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