Jump to content

proalt

Members
  • Posts

    41
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

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

proalt's Achievements

Tree Puncher

Tree Puncher (2/8)

-1

Reputation

  1. I am using java 8, You lost me at this: RenderingRegistry.registerEntityRenderingHandler(EntityCustomArrow.class, RenderCustomArrow::new); What is after ::new ? -> new RenderCustomArrow(Minecraft.getMinecraft().getRenderManager()); ?? which is not working
  2. This is not working.
  3. Hello, So I am trying to create Custom Arrow and I got a problem. Code: ClientProxy ( 1.8.9 ) I am trying to use this code but RenderCustomArrow is giving me Error, it is copy of RenderArrow, in which if I change in this code also gives me erros So I am thinking that RenderingRegistry is written differently now in 1.9, anyone knows how with full code ? RenderingRegistry.registerEntityRenderingHandler(EntityCustomArrow.class, new RenderCustomArrow(Minecraft.getMinecraft().getRenderManager()));
  4. SOLVED IT, SOLUTION: So I was searching around the files and the problem with it is that from 1.8.x versions or lower you have this code here: This is the code that I had for EntityRegistry from my projectiles: EntityRegistry.registerModEntity(EntityTest.class, "entitytest", 1000, this, 80, 1, true); Now in Minecraft 1.9 it seems that you need a bit different numbers on ( int trackingRange, int updateFrequency) which are last 2 numbers: Solved Code: ( As you can see I changed 80 to 64 ( trackingRange ), and 1 to 10 ( updateFrequency ). EntityRegistry.registerModEntity(EntityTest.class, "entitytest", 1000, this, 64, 10, true); If you want to check other Tracking projectiles/entities, there is a file called "EntityTracker" where all Minecraft entities has their trackingrange and so on. Hope this helps anyone who had the same problem as me. Thanks.
  5. ItemDirtBall: public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) { if (!playerIn.capabilities.isCreativeMode) { --itemStackIn.stackSize; } worldIn.playSound((EntityPlayer)null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.entity_snowball_throw, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!worldIn.isRemote) { EntityDirtBall entitydirtball = new EntityDirtBall(worldIn, playerIn); entitydirtball.func_184538_a(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F); worldIn.spawnEntityInWorld(entitydirtball); } playerIn.addStat(StatList.func_188057_b(this)); return new ActionResult(EnumActionResult.SUCCESS, itemStackIn); }
  6. THIS IS SOLVED, if you have same problem upgrading from 1.8.x to 1.9 with projectile entities. CHECK MY LAST REPLY ( 3rd reply from the post for SOULUTION ) Hello, So I am testing simply to re-create "Snowball" from Minecraft. To a new let's say Dirtball. Everything is copied from Snowball files like EntitySnowBall, ItemSnowBall just edited for my own "Dirtball". So while the item textures work and throwing it and the end effect touching block and living entities. But what is not working is that the "dirtball" disappears after it is spawned or rather it becomes INVISIBLE ( not disappears ), becuase the "dirtball" still flies and hits block at the aimed direction it, just the texture of it or rather "entity" projectile becomes invisible until it hits block or entity in which then does the effect and setDead. Some of my codes: ClientProxy: // Not sure if this line is needed anymore since if I remove it, nothing changes. EntityRegistry.registerGlobalEntityID(EntityDirtBall.class, "dirtball", EntityRegistry.findGlobalUniqueEntityId()); // This is for texture, because if this is not there texture of the projectile is shown as "white" block or something. RenderingRegistry.registerEntityRenderingHandler(EntityDirtBall.class, new RenderSnowball(Minecraft.getMinecraft().getRenderManager(), TestItems.dirtball, Minecraft.getMinecraft().getRenderItem())); EntityDirtBall: ( All is copied from Snowball Entity, and edited for custom use, nothing special here ) ItemDirtBall: ( Same thing as EntityDirtBall, all copied from ItemSnowBall and edited for custom use ) TestItems: ( File where item is registered and such, normal stuff, don't think showing this code is necessery ) TestMod: ( base file ) @EventHandler public void init(FMLInitializationEvent event) { EntityRegistry.registerModEntity(EntityDirtBall.class, "dirtball", 1000, this, 80, 1, true); } SO as I said before The item / entity Works normally expect for the projectile while it becomes invisible in the air right after right-click.
  7. Thank you, ovikk. I finished the code and it works great.
  8. It is like normal Portal block ( Copied from nether portal block ). If I am not wrong the direction of "portal block" is east/west. EDIT: My custom "portal block" is a copy of "nether portal block" from minecraft. Not sure if that tells you anything.
  9. Okay so I made it finished up the code and it works great and everything expect for the "north", "south" side. While Portal block just doesnt want to show up. ( it works normally for east / west ) Same code as below for south, just that it's on east side, and work normally portal blocks when used the item are there and stays there. world.setBlockState(pos.up(i), CustomBlocks.portal.getDefaultState()); world.setBlockState(pos.east().up(i), CustomBlocks.portal.getDefaultState()); This code is south - and portal doesn't work , if i replace "portal" block with any other block like "dirt" it works normally. Only for "portal" block it doesnt work world.setBlockState(pos.up(i), CustomBlocks.portal.getDefaultState()); world.setBlockState(pos.south().up(i), CustomBlocks.portal.getDefaultState()); I was thinking about that south doesn't work because normal block rotation of Portal is for east/west rotation, while for south/north it's in different rotation. Blocks seem to cancel out if they are neighbour blocks, it happens the same for east/west but it some how works in portal shape, but not for south/north of the side.
  10. Uhm, so I tried to do it but I think I messed up stuff and I don't get what to do when ( x,y,z ) is just there but not called. See for yourself: Also at the .setBlockState , what do I give to ( Block block, <-- , as in the 1.7.10 it was x,y,z there. Sorry for trouble but I am in the dark here. Watch for the "***" where the code is for what i ment. *** ~ I don't know which to call increase or decrease here or just (pos) I can't get though this when I run the code, it doesnt go over this, let alone what I will do on code after that which i probably messed up even more. @Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ) { System.out.println("pre"); //if(!par3World.isRemote && par3World.getBlock(x, y, z).equals(Blocks.stone)) *** if(!world.isRemote && world.getBlockState(pos.east().up().south().west().down().north()).equals(Blocks.stone)) { System.out.println("first"); //if(par3World.getBlock(x, y, z).equals(Blocks.stone) && par3World.getBlock(x - 1, y, z).equals(Blocks.stone) && par3World.getBlock(x - 2, y + 1, z).equals(Blocks.stone) && par3World.getBlock(x - 2, y + 2, z).equals(Blocks.stone) && par3World.getBlock(x - 2, y + 3, z).equals(Blocks.stone) && par3World.getBlock(x + 1, y + 1, z).equals(Blocks.stone) && par3World.getBlock(x + 1, y + 2, z).equals(Blocks.stone) && par3World.getBlock(x + 1, y + 3, z).equals(Blocks.stone) && par3World.getBlock(x - 1, y + 4, z).equals(Blocks.stone) && par3World.getBlock(x, y + 4, z).equals(Blocks.stone)) if(world.getBlockState(pos).equals(Blocks.stone) && world.getBlockState(pos.east(-1)).equals(Blocks.stone) && world.getBlockState(pos.west(-2).up(1)).equals(Blocks.stone) && world.getBlockState(pos.west(-2).up(2)).equals(Blocks.stone) && world.getBlockState(pos.west(-2).up(3)).equals(Blocks.stone) && world.getBlockState(pos.east(1).up(1)).equals(Blocks.stone) && world.getBlockState(pos.east(1).up(2)).equals(Blocks.stone) && world.getBlockState(pos.east(1).up(3)).equals(Blocks.stone) && world.getBlockState(pos.west(-1).up(4)).equals(Blocks.stone) && world.getBlockState(pos.up(4)).equals(Blocks.stone)) { System.out.println("1"); for(int i = 0; i < 3; i++) System.out.println("2"); { System.out.println("3"); //par3World.setBlock(x, y + 1 + i, z, CustomBlocks.portal); world.setBlockState(Block block, CustomBlocks.portal.getDefaultState()); //par3World.setBlock(x - 1, y + 1 + i, z, CustomBlocks.portal); world.setBlockState(Block block, CustomBlocks.portal.getDefaultState()); } if(!player.capabilities.isCreativeMode) System.out.println("4"); { stack.stackSize--; System.out.println("5"); } System.out.println("last"); return true; //return true; } } return false; }
  11. Hello everyone, Would anyone maybe know how can I convert this code from 1.7.10 to 1.8 ? ~ I know that .getBlock was replaced by .getBlockState and BlockPos. But I just don't know how it works in this code that I had for 1.7.10. public boolean onItemUse(ItemStack stack, EntityPlayer player, World par3World, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { if(!par3World.isRemote && par3World.getBlock(x, y, z).equals(Blocks.cobblestone)) { if(par3World.getBlock(x, y, z).equals(Blocks.cobblestone) && par3World.getBlock(x - 1, y, z).equals(Blocks.cobblestone) && par3World.getBlock(x - 2, y + 1, z).equals(Blocks.cobblestone) && par3World.getBlock(x - 2, y + 2, z).equals(Blocks.cobblestone) && par3World.getBlock(x - 2, y + 3, z).equals(Blocks.cobblestone) && par3World.getBlock(x + 1, y + 1, z).equals(Blocks.cobblestone) && par3World.getBlock(x + 1, y + 2, z).equals(Blocks.cobblestone) && par3World.getBlock(x + 1, y + 3, z).equals(Blocks.cobblestone) && par3World.getBlock(x - 1, y + 4, z).equals(Blocks.cobblestone) && par3World.getBlock(x, y + 4, z).equals(Blocks.cobblestone)) { for(int i = 0; i < 3; i++) { par3World.setBlock(x, y + 1 + i, z, CustomBlocks.portal); par3World.setBlock(x - 1, y + 1 + i, z, CustomBlocks.portal); } if(!player.capabilities.isCreativeMode) { stack.stackSize--; } return true; } } }
  12. uhm how do i do that can you compelte the code ? i have no idea what to do, you can use any block
  13. Hello there fellow modders, i am trying to make my ENTITY ( MOB ) drop Block instead of items. Does anyone know the code line for it. Currently my line for items is this: protected void dropFewItems(boolean par1, int par2) { int j; int k; // if (this.getSkeletonType() == 1) { j = this.rand.nextInt(3 + par2) - 1; for (k = 0; k < j; ++k) { this.dropItem(mod.randomitem, 1); } } }
  14. Just before you wrote this i fixed it. Yeah it was that, i changed it to grass and it works good now. Thank you. ~ Other question how can i change that even if its web, can i make it that hands can destroy the block.
  15. Okay so i have added this: //If the block's drop is a block. public Item getItemDropped(int metadata, Random random, int fortune) { return Item.getItemFromBlock(wtf.BlockRubyBlock); } ~~~ And nothing happens, it doesnt drop a thing or anything i also tried the other one for the item and it didnt work i am not sure what is wrong at that point. I have tried everything...
×
×
  • Create New...

Important Information

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