Jump to content

Lomeli12

Members
  • Posts

    43
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    http://lomeli12.net
  • Location
    California

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Lomeli12's Achievements

Tree Puncher

Tree Puncher (2/8)

9

Reputation

  1. Example from my work in progress mod: https://github.com/Lomeli12/Augmented-Accessories/blob/f6cb6299dff374060ca0b3131c40db614be562b4/src/main/java/net/lomeli/augment/blocks/tiles/TileRingForge.java
  2. TileEntityForge tile = new TileEntityForge(); Why are you making a brand new instance instead of getting the block's actual tile entity? >< TileEntityForge blockTile = (TileEntityForge) world.getTileEntity(x, y, z); Also, I why are you checking in your block added section instead of the checkMultiBlockForm from the tile (assuming you're using the tutorial). Judging by your code, you want your block to be surrounded by stone. If you followed the tutorial, all you would have to do to check if it formed was change that method to the following: public boolean checkMultiBlockForm() { int i = 0; // Scan a 3x3x3 area, starting with the bottom left corner for (int x = xCoord - 1; x < xCoord + 2; x++) for (int y = yCoord -1; y < yCoord + 2; y++) for (int z = zCoord - 1; z < zCoord + 2; z++) { if (world.getBlock(x, y, z) == Blocks.stone) i++; } return i == 26; } This would allow your block to constantly check around itself to make sure it's surrounded by stone. Edit: Since you guys seem to have trouble grasping how this simple implementation works. I made an example mod that adds two types of multiblock blocks. The 1st requires you make a 3x3x3 structure with a hollow center using the block and it'll spawn a diamond block 6 blocks above the master. The 2nd require you surround it with stone and will turn said stone into diamonds once it sees that the structure is formed. https://github.com/Lomeli12/MultiBlock-Tutorial
  3. http://www.minecraftforge.net/forum/index.php/topic,20755.msg105330.html#msg105330
  4. Opps, another derp on my part, cast the tiles as instanceof of TileMultiBlock (or whatever you named your class)
  5. public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if (!world.isRemote && !player.isSneaking()) { TileMultiBlock tile = (TileMultiBlock) world.getTileEntity(x, y, z); if (tile != null) { if (tile.hasMaster()) { if (tile.isMaster()) player.openGui(Mod.instance, 99, world, x, y, z); else player.openGui(Mod.instance, 99, world, tile.getMasterX(), tile.getMasterY(), tile.getMasterZ()); return true; } } } return false; } Replace the values accordingly.
  6. In the checkMultiBlockForm method in the Tile Entity. ATM, the way the tutorial is written, it checks for blocks that have the same tile entity (so if you want all your multiblocks to be made of the same block, the tutorial has it already set up). If you want to check for specific blocks, you'd have to do that manually, and change setupStructure method accordingly.
  7. Just have your Block class either extend BlockContainer (instead of simply Block) or implement ITileEntityProvider. It'll generate a method called createNewTileEntity, which should be as such: public TileEntity createNewTileEntity(World world, int meta) { return new TileMultiBlock(); //or whatever you name your tile entity class } Also remember to register your TileEntity, or else it will not work //Recommend doing this somewhere in your FMLInitializationEvent. GameRegistry.registerTileEntity(TileMultiBlock.class, "modmod.tilemultiblock");
  8. Guy who wrote the tutorial here. Just finished fixing some errors in it. What don't you seem to get?
  9. Don't add arguments to your event, you should only need the event itself. If you need the player or the world, check the event as it might have an instance of at least the player. Also use the @SubscribeEvent annotation on the method and register the event. pahimar has a good example for a simple packet handler: https://github.com/pahimar/Equivalent-Exchange-3/tree/master/src/main/java/com/pahimar/ee3/network
  10. Um...why don't you use new ItemStack(Items.dye, 1, x) were x is the metadata value of the dye you want. Or use OreDictionary names and use "dyeColor" (ex "dyeRed", "dyeBlue", etc)
  11. I'm assuming you mean on compile. You have two options really. One is to have it download the library from a repository, which requires editing your build.gradle like so: repositories { ivy { name 'NameForYourLibrarysRepository' artifactPattern "http://www.someurl.com/lib/[module][revision].[ext]" } } // name corresponds to module, version corresponds to revision, and ext...that's self explanatory dependencies { compile name: 'YourLibrary', version: 'LibraryVersion1.0', ext: 'jar' } Or the easier way would be just to make a folder called libs where your build.gradle is and drop all your libraries in there. =P
  12. gradlew setupdecompworkspace Use that instead of setupdevworkspace so it attaches Minecraft's source to your project.
  13. // From iChunUtil @SubscribeEvent public void renderTick(TickEvent.RenderTickEvent event) { if(event.phase == TickEvent.Phase.END) { if (Minecraft.getMinecraft().currentScreen instanceof GuiOptions) { //or whatever screen you want to add the button to GuiOptions gui = (GuiOptions)Minecraft.getMinecraft().currentScreen; // Draw your buttons here using the gui } } } https://github.com/iChun/iChunUtil/blob/master/src/main/java/ichun/client/core/TickHandlerClient.java
  14. Not sure if too late, but I made this tutorial fairly recently http://anthony-lomeli.net/tutorials/tutorial-how-to-make-a-simple-multiblock-structure Edit: Looking up, I ironically wrote it the day this thread was posted =P
  15. In your model class make one render method for your regular parts and other for the parts you want transparent. Then when you rendering your model, do as follows. GL11.glPushMatrix(); model.renderRegularParts(); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1F, 1F, 1F, 0.75F); // 25% transparent model.renderTransparentParts(); GL11.glDisable(GL11.GL_BLEND); GL11.glColor4f(1f, 1f, 1f, 1f); GL11.glPopMatrix();
×
×
  • Create New...

Important Information

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