
proalt
Members-
Posts
41 -
Joined
-
Last visited
Everything posted by proalt
-
[1.9] RenderingRegistry - Custom Arrow [UnSolved]
proalt replied to proalt's topic in Modder Support
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 -
[1.9] RenderingRegistry - Custom Arrow [UnSolved]
proalt replied to proalt's topic in Modder Support
This is not working. -
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()));
-
[1.9] Projectile Entity ( Disappears right after Right-clicked ) [SOLVED]
proalt replied to proalt's topic in Modder Support
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. -
[1.9] Projectile Entity ( Disappears right after Right-clicked ) [SOLVED]
proalt replied to proalt's topic in Modder Support
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); } -
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.
-
Thank you, ovikk. I finished the code and it works great.
-
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.
-
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.
-
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; }
-
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; } } }
-
[1.7.2] Entity drops Block instead of item ( HELP ) ( UNSOLVED )
proalt replied to proalt's topic in Modder Support
uhm how do i do that can you compelte the code ? i have no idea what to do, you can use any block -
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); } } }
-
[1.7.2] Block dropping it self (block) ! [SOLVED]
proalt replied to proalt's topic in Modder Support
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. -
[1.7.2] Block dropping it self (block) ! [SOLVED]
proalt replied to proalt's topic in Modder Support
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... -
hello there i need help with simple block that is giving me HUGE/MASSIVE problems i dont even know why. So i want to create block that drops it self for example: I create Ruby block and when you destroy it i want that Ruby block is dropped and not an item but a block. Here are my current codes: THIS IS MY BLOCK FILE: public class BlockRubyBlock extends Block { public BlockRubyBlock (Material material) { super(material); } private IIcon[] icons = new IIcon[6]; @Override public void registerBlockIcons(IIconRegister iconRegister) { for (int i = 0; i < icons.length; i++) { icons[i] = iconRegister.registerIcon(wtf.modid + ":" + "BlockRubyBlock" + i); } } @Override public IIcon getIcon(int side, int meta) { return icons[side]; } /** * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity */ public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) { p_149670_5_.setInWeb(); } /** * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been * cleared to be reused) */ public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { return null; } } This is codes from original file: public static Block BlockRubyBlock; BlockRubyBlock = new BlockRubyBlock(Material.web).setHardness(0.05F).setBlockName("BlockRubyBlock").setBlockTextureName(modid + ":" + "BlockRubyBlock"); GameRegistry.registerBlock(BlockRubyBlock, "BlockRubyBlock"); ~~~~FIX My materal was web so it didnt drop anything becouse i needed special tool to get it. Changed it to grass and it can be dropped by just hitting it with hands.
-
Hi, I need help with Chests. I have generation that spawns chest and all working great. Now my problem is that i dont want my chest to get RANDOM items inside of it i want 3 items no more not less and not random 3 items, that i want to have inside. My current code: ( set for random, i dont know how to change it that 3 items that i want to spawn inside ) par1World.setBlock(x +5, y -6, z +5, Blocks.chest, 0, 2); TileEntityChest bigchest1 = (TileEntityChest)par1World.getTileEntity(par3 +5, par4 -6, par5 +5); if(bigchest1 != null) { for(int i = 0; i< par2Random.nextInt(bigchest1.getSizeInventory()); i++) { bigchest1.setInventorySlotContents(par2Random.nextInt(bigchest1.getSizeInventory()), pickRandomItemChest(par2Random)); } private ItemStack pickRandomItemChest(Random rand) { int i = rand.nextInt(3); if(i == 0) { return new ItemStack(Items.coal, rand.nextInt(30)); } if(i == 1) { return new ItemStack(Items.diamond, 1); } if(i == 2) { return new ItemStack(Items.emerald, 1); } return new ItemStack(Items.gold_ingot, 1); }
-
[1.7.2] Door / generation [ SOLVED BY MY SELF THANKS]
proalt replied to proalt's topic in Modder Support
solved ! -
Hello i need help with Doors, I want door to be generated at my custom house. But i cant seem to get it right, i got cordiantes of the block that should be filled with doors. But when Doors generate they are invisible. My code is: par1World.setBlock(x +6, y -6, z +8, Blocks.iron_door, 0, 2); This code doesnt work for doors, they are just invisible ?! I was searching around villager code but i cant seem to impliment it. [sOLVED] BY MY SELF
-
if(world.getBlock(x, y, z) != Blocks.grass || world.getBlock(x + 1, y + 1, z + 1) != Blocks.grass) This is my code, and it spawns sometimes buts its odd. Is there any other code that checks if there is grass even if its one block and then it spawns building ?!
-
So how would then that go, X Y Z. isnt "Z" for UP and DOWN ?! da hell, was i looking at google pictures. if(world.getBlock(x, y, z) != Blocks.dirt || world.getBlock(x + 0, y + 0, z + 1) != Blocks.dirt || world.getBlock(x, y + 0, z + 1) != Blocks.dirt|| world.getBlock(x + 0, y, z) != Blocks.dirt) Like this then ?! In Minecraft, the coordinate system is weird. X is for east/west, Y is for up/down and Z is for north/south. So if i am not wrong then my code should be like this 5 block left 5 block right + 1 block high Z - 5, X -5, Y -1
-
So how would then that go, X Y Z. isnt "Z" for UP and DOWN ?! da hell, was i looking at google pictures. if(world.getBlock(x, y, z) != Blocks.dirt || world.getBlock(x + 0, y + 0, z + 1) != Blocks.dirt || world.getBlock(x, y + 0, z + 1) != Blocks.dirt|| world.getBlock(x + 0, y, z) != Blocks.dirt) Like this then ?!
-
Yeah i did that, and well it kinda doesnt spawn.
-
You will never be able to make more then 64 stacksize at least not in the minecraft world. Maybe if you code your own inventory, but that is whole another level.