Jump to content

IronCrystal

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by IronCrystal

  1. Since I made the last post, I didn't want to spam this forum with every question I have so I'm going to add this here. I know a lot of rendering was changed for blocks and items in 1.8. I was using a model created in techne for an item, but now the rendering class is littered with errors. I was using IItemRenderer but it seems to no longer exist. Do I have to use json files for my held items? If so, is there some way to easily convert the old models to the json? If I am able to use my techne model, how would I do it? Is there an example someone has?
  2. Thank you very much, I was able to get my mob into the game. One last question, if I'm not using a method to find an unused entity ID, how would I find a unique one? Just for testing I gave a random value but I wouldn't want it conflicting with other mods. EDIT: Nevermind. I was looking in another thread and it looks like that entity ID is unique within the mod. So as long as I keep my own IDs separate I should be fine.
  3. Hello, I'm sorry, but I'm having some trouble updating my entities since it appears the registration methods I used to use are deprecated. I used to register my custom mob using these three methods: public static void registerEntity(){ createEntity(EntityFlappyBird.class, "Flappy Bird", 0xE6F547, 0xFFB300); EntityRegistry.addSpawn(EntityFlappyBird.class, 2, 0, 1, EnumCreatureType.CREATURE, new BiomeGenBase[]{BiomeGenBase.forest}); //Add more biomes for more locations RenderingRegistry.registerEntityRenderingHandler(EntityFlappyBird.class, new RenderFlappyBird(new ModelFlappyBird(), 0)); } public static void createEntity(Class entityClass, String entityName, int solidColor, int spotColor){ int randomId = EntityRegistry.findGlobalUniqueEntityId(); EntityRegistry.registerGlobalEntityID(entityClass, entityName, randomId); EntityRegistry.registerModEntity(entityClass, entityName, randomId, Modcraft.INSTANCE, 64, 1, true); createEgg(randomId, solidColor, spotColor); } private static void createEgg(int randomId, int solidColor, int spotColor){ EntityList.entityEggs.put(Integer.valueOf(randomId), new EntityList.EntityEggInfo(randomId, solidColor, spotColor)); } But it seems that RenderingRegistry.registerEntityRenderingHandler(), EntityRegistry.findGlobalUniqueEntityId(), and EntityRegistry.registerGlobalEntityID() are all deprecated. How would be the best way to register an entity now? Edit: I also had to edit the constructor of the render class since it now requires a RenderManager. Any idea where that comes from?
  4. package net.modcraft.block; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.util.IChatComponent; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; import net.modcraft.Modcraft; import net.modcraft.init.ModcraftBlocks; import net.modcraft.tileentity.ShowCaseTileEntity; public class ShowCaseBlock extends BlockContainer { private Block block; public ShowCaseBlock(Material materialIn, String name) { super(materialIn); block = Blocks.air; setUnlocalizedName(name); //Required. Don't edit this.setStepSound(Block.soundTypeMetal); //Sets the sound played when stepped on this.setCreativeTab(Modcraft.tabModcraft); //Sets the creative tab this.setHarvestLevel("pickaxe", 0); //Sets the tool and harvest level this.setHardness(1.5F); //Hardness of block. Currently equivalent to stone this.setResistance(10.0F); //Resistance to explosions. Currently equivalent to stone this.setLightLevel(0.0F); //How much light to give off. 0.0F is none, 1.0F is max. Torch is 0.9375F //this.setBlockUnbreakable(); //Uncomment this line to make it unbreakable GameRegistry.registerBlock(this, name); //Required. Don't edit ModcraftBlocks.blocks.add(this); //Required. Don't edit } @Override public boolean isOpaqueCube() { return false; } @Override public EnumWorldBlockLayer getBlockLayer() { return EnumWorldBlockLayer.CUTOUT; } public Block getBlock() { return block; } public void setBlock(Block block) { this.block = block; } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { Block blockClickedWith = Block.getBlockFromItem(playerIn.getCurrentEquippedItem().getItem()); if (blockClickedWith != null) { if (!worldIn.isRemote) { ShowCaseTileEntity te = (ShowCaseTileEntity) worldIn.getTileEntity(pos); te.setInventorySlotContents(0, playerIn.getCurrentEquippedItem()); } /*this.block = blockClickedWith; IChatComponent message = new ChatComponentText("You clicked with block: " + this.block.getLocalizedName()); playerIn.addChatMessage(message);*/ } return true; } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new ShowCaseTileEntity(); } @Override public void breakBlock(World world, BlockPos pos, IBlockState blockstate) { ShowCaseTileEntity te = (ShowCaseTileEntity) world.getTileEntity(pos); InventoryHelper.dropInventoryItems(world, pos, te); super.breakBlock(world, pos, blockstate); } @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { if (stack.hasDisplayName()) { ((ShowCaseTileEntity) worldIn.getTileEntity(pos)).setCustomName(stack.getDisplayName()); } } } I register the renderer with this: public static void registerRender(Block block) { Item item = Item.getItemFromBlock(block); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Modcraft.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory")); }
  5. So, I am new to using TileEntities and TESR, but I looked for an example. This is the result. It seems to have overridden my default model rendering with the rendering of the tile entitiy...Is there any way to have the TESR render inside the block rather than instead of the block?
  6. So, if this was 1.7.10 I would understand that this goes in a render class. I was following along some 1.8.9 tutorials since it seems a lot has changed for blocks and I'm not sure how to implement a rendering class since it seems to be handled by the blockstate.json and model json class. I know the renderer is being registered in this line: Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Modcraft.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
  7. Hello, I'm first starting to mod in 1.8.9 and am interested in making a block that would change based on the block you use to right click on it. I have a model working, and I used a texture I made for another block to test with, but I am wondering how I can take the texture of any block used on the block and display it? In my json file for the model, I have a "cube" element which is what I want to change texture. I believe I need to mess with the BlockState file, but looking at other blocks that change texture such as the brewing station, they created a bunch of different model files depending on the way it looks. I don't see it being reasonable for me to make a different model file for every possible block that could be used on it. Is there any way to dynamically change a texture on the model? It uses 3 textures, I just need to change one of them.
  8. Thank you so much! It works. Is there a place I can go to find all the gradle commands?
  9. Hello, so this is not a modding question specifically, but I need some help. So I am currently developing a program which can "generate mods" by basically allowing users to input data through a graphical interface and it allows them to generate custom blocks and items, etc. I have been able to get my program to download, extract, and run gradle on forge, but I am stuck. How can I launch the modded client through a 3rd party program? I have access to the entire forge folder (where I extracted/ran gradle) but I don't know how to launch the client. Looking in eclipse it appears that it launches GradleStart.class file or net.minecraft.launchwrapper.Launch, I'm not sure, but I can't seem to figure out how to get it to start. I also know that there are arguments involved. Anyone know how I can go about doing this?
  10. Hey all, So, I made an item that the player can throw, and I was wondering if there was an event or other way to detect when an entity collides with the item. I was hoping there was an easy way to do this, and if not is it easy to make a custom projectile? It looked like I'd need a custom entity model, and I hoping to just use the EntityItem. Thanks
  11. Ok thanks a lot guys.
  12. Hey all, I'm a developer from Bukkit/Spout who wanted to try out Forge, and I had a few questions. First of all, how do you get a living entity that is in your line of sight? (in your target) I was able to do it in bukkit by getting all the blocks in the line of sight and all the nearby entities in a range, and determining if the entities are within one block of the line of sight. I found the player.getLookVec(), but I'm not sure if that's what I want. Additionally, I found worldObj.getEntitiesAABB or soemthing like that, but I'm not sure how to use that at all. Also, how do you move blocks such as I have seen where some mods pick up and move blocks (ex: Tornado mod, portal mod) Finally, how do you make a block always face you when you place it? I know it has to do with meta-data, but when I did it it doesn't seem to do anything, so I probably missed something. EDIT: Also, can someone tell me/point me to a tutorial on how to generate structures in the world? I know how to do ores, but was hoping to do structures as well. Thanks -IronCrystal
×
×
  • Create New...

Important Information

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