SamTebbs33
Forge Modder-
Posts
79 -
Joined
-
Last visited
Everything posted by SamTebbs33
-
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; } -
Hi, I have been testing my entity AI and the world seems to freeze (can't move entities, can't break blocks but can move around et.c) a short while after I spawn an entity from my mod, does anyone have any ideas as to why this could be? Here's my source code: https://github.com/VivaDaylight3/myrmecology Thanks in advance!
-
Does it work under the exact same conditions (mod version, mc version, mods installed, forge version et.c) on window computers?
-
[SMP][API]Myrmecology - Capture, breed and enslave ants!
SamTebbs33 replied to SamTebbs33's topic in Mods
v0.1.4 has been released! -
Hi! I would like to make it possible to de-spawn a certain entity when left-clicking it on en entity, is it possible to cancel the damage inflicted? http://pastebin.com/z7cw3T04
-
Can we see the code you use to register your entity? Misuse of entity IDs can sometimes cause texture issues according to my experience.
-
Thanks for sharing! Would you mind giving me a quick rundown on how I would use your algorithm? Thanks!
-
Hi, is it possible to get the coordinates of every wood block in a tree? I realise that this could be done by just searching for all wood blocks in a radius, but that would also return wood blocks not actually part of the tree and even blocks connected to the tree by leaves. I know that tree feller mods do this somehow. Thanks in advance
-
Thanks for the feedback, but I tried it and the list size is 0 even if there are loads of items around the mod using this method: public static List getEntityItemsInRadius(World world, double x, double y, double z, int radius) { List list = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getAABBPool().getAABB(x-radius, y-radius, z-radius, x + radius, y + radius, z + radius)); return list; } radius = 10