
SamTebbs33
Forge Modder-
Content Count
79 -
Joined
-
Last visited
Community Reputation
1 NeutralAbout SamTebbs33
-
Rank
Stone Miner
- Birthday 04/04/1996
Converted
-
Gender
Male
-
URL
http://github.com/SamTebbs33
-
Location
United Kingdom
-
I am writing some code that will harvest a number of blocks around it (all of which implement IGrowable) and to stop abuse and breaking the mechanics of other mods I will need to check if the block is harvest-able with canHarvestBlock(...) and then harvest it with harvestBlock(...) if it is. These methods require an EntityPlayer object, which isn't applicable since the code will be run from within a tile entity. I could pass null as the player value but I never like doing that due to the risk of running into an NPE. Is there some accepted or established method of checking if a block is harvest-able and then harvesting it without using an EntityPlayer object? I'm open to using libraries.
-
World generator only called in ocean biome
SamTebbs33 replied to SamTebbs33's topic in Modder Support
Thanks guys, this seems quite obvious now! -
My world generator is only called in ocean biome chunks (using scala). Code that prints the biome (worldGen.scala): override def generate(random: Random, chunkX: Int, chunkZ: Int, world: World, chunkGenerator: IChunkGenerator, chunkProvider: IChunkProvider): Unit = { println(world.getBiomeProvider.getBiomeGenerator(new BlockPos(chunkX, 0, chunkZ))) } Registration code (in common proxy init method): GameRegistry.registerWorldGenerator(new WorldGen, 10) When generating a new world or travelling over un-generated chunks (that aren't ocean biomes) it prints out BiomeOcean@xxxxx
-
Back in 1.7 an before, I had made a system that assigned textures to blocks with support for their names and having different textures for different sides of the block (the code would handle displaying the relevant side by using metadata based on rotation), but now that metadata has been abandoned and textures have to be designated in a .json file (WHY MOJANG!?!?!?!!?), this system is completely broken. What was great about my old system was that I only had to provide the textures in the resource path and then give each block an unlocalised name and the rest was processed by the mod. How would I achieve a similar system but using the new (annoying) .json system?
-
[1.8] Replacement for world.getBlock() etc
SamTebbs33 replied to SamTebbs33's topic in Modder Support
Thanks! -
I decided to start updating some of my code for the latest 1.8 release, and saw that a lot of the methods in the World class have been removed, such as getBlock() and getBlockMetadata(). What have they been replaced by?
-
That's exactly what I did Perhaps I have it but just can't find it, where is it located after running setupDecompWorkspace?
-
I installed the forge eclipse workspace and opened it up in eclipse. I've got the Minecraft project with the example mod but where do I get the minecraft source code from? I used to get it by running install.sh in the forge download, but that isn't there anymore.
-
If you want to make a block that clings to the side of something, you'll need to change its block bounds. If you override the setBlockBoundsBasedOnState method in Block, you can set block bounds for distinct blocks in the world by using setBlockBounds(minx, minY, minZ, maxX, maxY, maxZ) Changing the block bounds will make your block less like a cube, depending on what you set them to.
-
Try looking at the WorldGenStructure classes in the Minecraft source code, that's your best bet. Whenever you want to create something that is similar to what's already in Minecraft, you should always look at the source code, it's avery helpful method.
-
[1.6.2][SOLVED] Help with removing metadata items
SamTebbs33 replied to ThePocketSoul's topic in Modder Support
You need to use j.getItemDamage(). That gets the damage/metadata of the itemstack -
How making pretty much a copy of cocoa beans in minecraft?
SamTebbs33 replied to Mecblader's topic in Modder Support
IF you want to create the item, you'll need to make an item class like normal and then override the onItemUse method in Item and use the following code in the overridden method. You will need to change Block.cocoaPlant.blockID to the ID of your grape block and Block.wood.blockID to the ID of the block you want to plant the grape on. int i1 = par3World.getBlockId(par4, par5, par6); int j1 = par3World.getBlockMetadata(par4, par5, par6); if (i1 == Block.wood.blockID && BlockLog.limitToValidMetadata(j1) == 3) { if (par7 == 0) { return false; } if (par7 == 1) { return false; } if (par7 == 2) { --par6; } if (par7 == 3) { ++par6; } if (par7 == 4) { --par4; } if (par7 == 5) { ++par4; } if (par3World.isAirBlock(par4, par5, par6)) { int k1 = Block.blocksList[block.cocoaPlant.blockID].onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, 0); par3World.setBlock(par4, par5, par6, Block.cocoaPlant.blockID, k1, 2); if (!par2EntityPlayer.capabilities.isCreativeMode) { --par1ItemStack.stackSize; } } return true; }