Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi THis link will probably help http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html (See the three under Block Rendering) you want block/cube, not block/cube_all your block's particle is set using "particle": -TGG
  2. For example: In your preInit event (FMLPreInitializationEvent ) GameRegistry.registerBlock(blockTileEntityData, "mbe20_tileentity_data_block"); GameRegistry.registerTileEntity(TileEntityData.class, "mbe20_tileentity_data_te"); -TGG
  3. BTW you should get rid of the __OBFID , it's used during (de)obfuscation for vanilla only. I suggest you add a breakpoint to your onCraftMatrixChanged and step into your WorkBenchCraftingManager.findMatchingRecipe(). That should show you straight away where the problem is. -TGG
  4. It means you haven't registered your TileEntity properly. Which tutorial are you following? -TGG
  5. Hi You forgot implements ITileEntityProvider on your block. @Override will can save you endless pain from these errors... http://stackoverflow.com/questions/94361/when-do-you-use-javas-override-annotation-and-why -TGG
  6. mismatched .startDrawing(); and .draw(); http://greyminecraftcoder.blogspot.com.au/2013/08/the-tessellator.html -TGG
  7. Hi well, I _think_ nulls for world and blockPos are probably ok, because of this in getModelFromBlockState: try { p_175022_1_ = block.getActualState(p_175022_1_, p_175022_2_, p_175022_3_); } catch (Exception exception) { ; } but I reckon it would be better to bypass it properly, using just IBakedModel ibakedmodel = blockModelShapes.getModelForState(blockState); You can get blockModelShapes from BlockRendererDispatcher using the corresponding get method. -TGG
  8. It's not weird or stupid at all. ClientProxy = code for {client+integrated server} only ServerProxy = code for dedicated server only CommonProxy = code for both {client+integrated server} and dedicated server Seems very logical to me. Purely a matter of taste whether your common code goes in a CommonProxy base class or stays in your Mod class. If there's no code in CommonProxy you may as well use IProxy instead of CommonProxy (but not both as per OP code). -TGG
  9. your getIconItemStack() method does nothing because no code ever calls it. When your creative tab is rendered, it calls the getTabIconItem() method to find out which Item's icon it should draw on the tab. You return null, the caller tries to draw it, and crashes because it expects a proper item. Your getTabIconItem() method needs to return the block's corresponding item as Voltab suggested. Which tutorial did you use? -TGG
  10. This link might help you understand how Proxy works http://greyminecraftcoder.blogspot.com.au/2013/11/how-forge-starts-up-your-code.html -TGG
  11. I'm pretty sure this isn't right... where's your implements? public class ClientProxy { As a matter of interest, why the extra complication of IProxy? Client and Server extending Common, with public static CommonProxy proxy, will work just as well and be less complicated? Also, Capital letters in your Mod ID and package names is going to cause you grief sooner or later. Packages should always be lower case by convention, and I've seen quite a few subtle bugs arise because the Mod ID had upper case letters. -TGG
  12. Hi Although I like the idea, in my opinion the last thing Forge needs is more specialised features that seldom get used. It's groaning under the weight of all the "nice to haves" already, and every extra one just adds to the maintenance burden and slows down each update. I'd suggest you make a good example and let folks copy it. They'll need to update it for every minecraft update, but I think that work is better placed on the shoulders of the individual developer rather than Lex & co. -TGG
  13. Hi Are you using Intellij 14 perhaps? If so, see here about sourceSets http://www.minecraftforge.net/forum/index.php/topic,21354.0.html Otherwise, your file StrawberryCrop.json either doesn't exist or is in the wrong folder. The folder structure should look like this src/main/resources/assets/moreminecraft/blockstates I also suggest you use lower case for all your filenames, it will probably save you pain later on. -TGG
  14. What dieSieben said. FYI this link might help understand what proxies do. http://greyminecraftcoder.blogspot.com.au/2013/11/how-forge-starts-up-your-code.html -TGG
  15. By crikey dude, what did you think this line would do? @Override public Item getTabIconItem() { // TODO Auto-generated method stub return null; and where did this method come from? getIconItemStack() This tutorial might help... http://tutorials.darkhax.net/custom-creative-tabs.html -TGG
  16. Vanilla uses BlockRendererDispatcher.getModelFromBlockState() you can get BlockRendererDispatcher from Minecraft.getMinecraft.getBlockRendererDispatcher() The TextureAtlasSprite is just used for the block breaking texture I think. I think that if your block models are registered in the normal way, the uv mappings will all be correct because the textures are automatically stitched together into a single sheet and the BlockModel already got its own uv when it was baked. I'm not sure of that - try it and let us know? -TGG
  17. Dude It means that Mojang has changed their code. The method to construct a packet now looks like this public FMLProxyPacket(PacketBuffer payload, String channel) { this.channel = channel; this.payload = payload; } so you need to figure out how to turn a PacketBuffer into a ByteBuf... This looks promising... public class PacketBuffer extends ByteBuf { private final ByteBuf buf; private static final String __OBFID = "CL_00001251"; public PacketBuffer(ByteBuf wrapped) { this.buf = wrapped; } If you're converting network code from 1.7 to 1.8 you might find this link on thread safety for packets helpful too http://greyminecraftcoder.blogspot.com.au/2015/01/thread-safety-with-network-messages.html -TGG
  18. Hi Fluids don't have blockstates. they define a different render type Each block also has a render type, specified by Block.getRenderType(): -1 = doesn’t render at all, eg BlockAir 1 = renders as a flowing liquid (animated texture) using BlockFluidRenderer.renderFluid – eg lava and water. 2 = doesn’t render anything in the block layers, but has an associated TileEntitySpecialRenderer which does draw something, eg BlockChest. 3 = renders using an IBakedModel, BlockModelRenderer.renderModel. This is described in more detail below. -TGG
  19. Hi The key bit to understand is that ISmartItemModel lets you choose which IBakedModel to return, based on the itemstack given to its method IBakedModel handleItemState(ItemStack stack); So- you can create as many SimpleBakedModels as you like - and pick which one to return. I'd suggest you create a variant for each one just like you would normally register them and just return the variant by name. This example 12 does something very similar using the Item.getModel() method instead of handleItemState(). https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe12_item_nbt_animate Alternatively, if you implement IBakedModel with your own class, you can change which faces are returned by getFaceQuads() and getGeneralQuads() depending on what your handleItemState has told it to. For example (won't compile but you get the idea?) IBakedModel handleItemState(ItemStack stack) { if (stack.stackSize == 1) return new MyBakedModel(SINGLE_FACE); if (stack.stackSize == 2) return new MyBakedModel(TWO_FACES); return new MyBakedModel(MANY_FACES); } where class MyBakedModel implements IBakedModel { private FaceCount facecount; public MyBakedModel(FaceCount i_facecount) { facecount = i_facecount; } public List getFaceQuads(EnumFacing p_177551_1_) { List allfaces = new List(); allfaces.add(FIRST_BAKED_QUAD); if (facecount == SINGLE_FACE) return allFaces; allfaces.add(SECOND_BAKED_QUAD); if (facecount == TWO_FACES) return allFaces; allfaces.add(THIRD_BAKED_QUAD); return allFaces; } } In your specific case, you might implement an IBakedModel that contains a number of mini-blocks and the getFaceQuads method compiles a list from all the miniblocks listed one after the other. -TGG
  20. how to define the blockpos with 3 ints? Seriously dude? World:: [1.8] public boolean isAirBlock(BlockPos pos) [1.7.10] public boolean isAirBlock(int x, int y, int z) -TGG
  21. Hi You may find this link useful http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html Especially the topics under "Blocks" and "Items". This example project also has several working examples of blocks and items with custom textures and with the switching states you said. https://github.com/TheGreyGhost/MinecraftByExample -TGG
  22. show your class(es) where you create your items & blocks and register them? -TGG
  23. Hi Your renderItem method calls itself renderItem(type, item, data); which then calls itself, which calls itself, which calls itself, etc until you run out of stack space. that renderItem call should be to something which actually draws the icon. There seems to be a bunch of unused code in there. What is it all supposed to be doing? -TGG
  24. Hi I'm not sure I understand why you used static float enderpadyaw = TileEntityEnderPadEye.getEnderPadYaw(); float enderpadpitch = TileEntityEnderPadEye.getEnderPadPitch(); instead of per-tile-entity-instance variables, i.e. float enderpadyaw = entity.getEnderPadYaw(); float enderpadpitch = entity.getEnderPadPitch(); Alternatively, your renderer doesn't actually need the tileentity to do the calculations. The x, y, z passed to your renderTileEntityAt is the relative position of the tile entity compared to the player's eyes, which is enough to calculate which direction the tile entity needs to face to be looking at the player - i.e. the d0, d1, d2 in EntityLookHelper.onUpdateLook() -TGG
  25. Hi First thing to try - generate a fresh world. Sometimes, when you're developing a mod, the worlds you create along the way can have strange bugs due to Forge's auto-item-and-block-ID-replacement algorithm. -TGG
×
×
  • Create New...

Important Information

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