Everything posted by SeaBass
-
Get PLayer current biome?
BiomeGenBase biomegenbase = par2World.getWorldChunkManager().getBiomeGenAt(x, z); This gives a whole lot of info, what you want is biomegenbase.biomeName
-
REgenerating the underground
Did you see my comment before? You can do it with WorldGenMinable.generate, or mimic that with your own WorldGen class. You can also put something like this in the class to make sure it only replaces stone blocks: if (world.getBlockId(i, j, k) == Block.stone.blockID)
-
REgenerating the underground
I just tested this in my own mod successfully, and generating new blocks is possible through WorldGenerator. You can use the method WorldGenMinable.generate or create your own. Here's some tutorials about that: http://www.minecraftforum.net/topic/1524180-152-popgalops-beginner-advanced-modloader-modding-tutorials-taking-requests/ Specifically the Making Ore Generate and Structure Generation sections. I'm not sure how to have the generate method called after a certain period of time, I'm sure that wouldn't be too hard, but I have tested it successfully through using a custom item.
-
Problems with Havvy's Basic Modding Tutorial [1.6.1]
Havvy's tutorials are for 1.5 and earlier, chances are they wont work for 1.6. Forge is still in development for 1.6, so you may have to wait a while for new tutorials.
-
[SOLVED] Problem with Havvy's Basic Blocks tutorial
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.
-
[Solved]Block with different textures on top & bottom
Oops, the class wasn't being initialized properly. Looks like the code I posted initially works just fine.
-
[Solved]Block with different textures on top & bottom
Perhaps I'm not registering the icons correctly? Nothing I do there seems to change anything, here's my whole block class: package amanus; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockFlower; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.util.Icon; public class BlockBeehive extends Block { @SideOnly(Side.CLIENT) private Icon iconTop; private Icon iconDefault; public BlockBeehive(int id, Material par2Material) { super(id, par2Material); this.setCreativeTab(Amanus.tabAmanus); } @SideOnly(Side.CLIENT) public Icon getIcon(int side, int meta) { if (meta == 0 && side == 0) return iconTop; else if(meta == 0 && side == 1) return iconTop; else return iconDefault; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.iconTop = par1IconRegister.registerIcon("tree_top"); this.iconDefault = par1IconRegister.registerIcon("tree_spruce"); } }
-
Help with artifacts!
Wouldn't this add 100 ticks to the potion duration on every single tick? Thus making the effect last 100 times longer than however you had it equipped for? You should try having it check to see if the potion effect is already active before applying it again. Here's the code I used for one of my items: if (!player.isPotionActive(Potion.jump)) { player.addPotionEffect(new PotionEffect(Potion.jump.id, 500, 1)); }
-
[Solved]Block with different textures on top & bottom
From reading the tutorials, it appeared that this method is used to set textures on different sides, but it doesn't seem to be doing anything in my block class: @SideOnly(Side.CLIENT) public Icon getIcon(int par1, int par2) { return (par1 == 1 || par1 == 0) ? this.hive_top : this.blockIcon; } Other than this, the block is working fine. It doesn't look like this method is being called at all, even when I put errors in, it doesn't change anything.
-
[Unsolved] How to make an armor using Forge for SMP?
The code I gave is not for an item texture, it's for an armor texture.
-
[Unsolved] How to make an armor using Forge for SMP?
No problem, just override the texture in the item class: @Override public String getArmorTextureFile(ItemStack itemstack) { return "/mods/Amanus/textures/gemArmor.png"; }
-
[Unsolved] How to make an armor using Forge for SMP?
Here's the code I use to register armor in Forge: public static Item gemChest = new GemChest(5004, EnumArmorMaterial.IRON, 2, 1).setUnlocalizedName("gemChest"); Registration.itemRegistration(gemChest, "Gem Chest"); public static void itemRegistration(Item par1, String par2) { GameRegistry.registerItem(par1, par2); LanguageRegistry.addName(par1, par2); }
-
[SOLVED]Custom flowers - How to only be placed on custom blocks?
@Override public boolean canPlaceBlockAt(World world, int x, int y, int z) { if(world.getBlockId(x, y-1, z) == MoreDimensions.slimeGrass.blockID) { } else if(world.getBlockId(x, y-1, z) == MoreDimensions.slimeDirt.blockID) { } else { world.setBlockToAir(x, y, z);{return true;} } return true; } This appears to return true in every case. You want code that only returns true for your blocks, and returns false for everything else.
-
[SOLVED]Custom flowers - How to only be placed on custom blocks?
I'm using a block that extends BlockFlower, and I was curious about this, so I tried this code: @Override protected boolean canThisPlantGrowOnThisBlockID(int par1) { return false; } In my understanding, that should mean that it can't be place on any blocks, but even with this code it can still be placed on dirt and grass.
IPS spam blocked by CleanTalk.