Jump to content

nidico100

Members
  • Posts

    41
  • Joined

  • Last visited

Everything posted by nidico100

  1. I need an Blockevent when the block is pushed by an piston upwards
  2. ISBRH is not available in 1.7.10 anymore. I tried it another way. I tried with overriding getmobilityflag 0= don't move 1= don't move just drops 2= don't move
  3. i just found an 1.6 tutorial, which doesn't work in 1.7.10 and a coremod for 1.8
  4. i only knew that method how to do the other?
  5. no it doesn't that's the model: that's the block: that's tileentity of slimeblock: that's the renderer that's the item renderer
  6. i got it, but now i need to know why the block can't be moved by a piston What material is it? Does it have a TileEntity? Both of these are very important questions you should have already asked yourself. it has tileentity because it has a special model
  7. Why can't the block be moved with a piston? package net.bplaced.nidico100.Downgrade; import scala.tools.nsc.ConsoleWriter; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.bplaced.nidico100.Downgrade.DowngradeMod; import net.bplaced.nidico100.Downgrade.TileEntityBlockSlime; import net.bplaced.nidico100.Downgrade.Proxis.DowngradeModClientProxy; public class BlockSlime extends BlockContainer { public BlockSlime(Material material) { super(material); this.slipperiness = 0.8F; this.setHardness(0F); this.setResistance(0F); this.setStepSound(soundTypeCloth); } //FUNCTION BOUNCING public void onFallenUpon (World worldIn, int x, int y, int z, Entity entityIn, float fallDistance) { if (entityIn.isSneaking()) { super.onFallenUpon(worldIn, x, y, z, entityIn, fallDistance); } else { entityIn.moveEntity(0, fallDistance/2, 0); entityIn.fallDistance = 0.0F; } } public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) { if (Math.abs(entityIn.motionY) < 0.1D && !entityIn.isSneaking()) { double d0 = 0.4D + Math.abs(entityIn.motionY) * 0.2D; entityIn.motionX *= d0; entityIn.motionZ *= d0; } super.onEntityCollidedWithBlock(worldIn, x, y, z, entityIn); } //OVERRIDE @Override public int getRenderBlockPass() { return 1; } @Override public int getRenderType() { return -1; } @Override public boolean isOpaqueCube() { return false; } @Override public boolean renderAsNormalBlock() { return false; } @Override public boolean canRenderInPass(int pass) { DowngradeModClientProxy.renderPass = pass; return true; } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityBlockSlime(); } //BLOCK ICON @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { this.blockIcon = iconRegister.registerIcon("downgrademod:slime"); } }
  8. i got it, but now i need to know why the block can't be moved by a piston
  9. okay, thanks for your help today i will ask a friend of mine, which programs in his job with java
  10. yeah i will try, could you say me how to add something to original source code? like new methods?
  11. that's how it's defined in 1.8: public void onLanded(World worldIn, Entity entityIn) { entityIn.motionY = 0.0D; }
  12. I want to add a method to the block, so if you fall on it without sneaking you fly back in the sky. it shows no errors, but don't work. public void onLanded(World worldIn, Entity entityIn) { if (entityIn.isSneaking()) { entityIn.motionY = 0.0D; } else if (entityIn.motionY < 0.0D) { entityIn.motionY = -entityIn.motionY; } }
  13. Reflection is an entire Java package dealing with class files. It's half way between "code that runs" and "code that modifies running code" (ASM). Here's a chunk I use: try { Class clz = BiomeGenBase.class; WildlifeEventHandler.rains = clz.getDeclaredField("enableRain");//field_76765_S WildlifeEventHandler.rains.setAccessible(true); WildlifeEventHandler.snows = clz.getDeclaredField("enableSnow");//field_76766_R WildlifeEventHandler.snows.setAccessible(true); } catch(NoSuchFieldException e ) { } Basically, I request a private field from a class, set its accessibility to public, so that later I can modify the value (if I don't, the program will crash with an exception). Eg: WildlifeEventHandler.snows.set(BiomeGenBase.plains, true); i tried: public static void main(String args[]) { try { Method method = Entity.class.getDeclaredMethod("fall"); method.setAccessible(true); } catch (Exception e) { e.printStackTrace(); } } but still there stands the method is not visible forget the reflection i just changed entityIn.fall(fallDistance, 0.0F); to entityIn.fallDistance = 0.0F; i was so easy but i was blind now i will try to add onLanded method
  14. Reflection is an entire Java package dealing with class files. It's half way between "code that runs" and "code that modifies running code" (ASM). Here's a chunk I use: try { Class clz = BiomeGenBase.class; WildlifeEventHandler.rains = clz.getDeclaredField("enableRain");//field_76765_S WildlifeEventHandler.rains.setAccessible(true); WildlifeEventHandler.snows = clz.getDeclaredField("enableSnow");//field_76766_R WildlifeEventHandler.snows.setAccessible(true); } catch(NoSuchFieldException e ) { } Basically, I request a private field from a class, set its accessibility to public, so that later I can modify the value (if I don't, the program will crash with an exception). Eg: WildlifeEventHandler.snows.set(BiomeGenBase.plains, true); i tried: public static void main(String args[]) { try { Method method = Entity.class.getDeclaredMethod("fall"); method.setAccessible(true); } catch (Exception e) { e.printStackTrace(); } } but still there stands the method is not visible
  15. i didn't find anything good about using reflection in 1.7.10 how to do?
  16. No i need slime block and Armorstand with the physics of 1.8
  17. yeah okay i was right, but there is another bug entityIn.fall(fallDistance, 0.0F); There stands fall(float) is not defined for fall(float, float), but when i delete one of the floats, there stands the method is not visible i looked on the method protected void fall(float p_70069_1_) { if (this.riddenByEntity != null) { this.riddenByEntity.fall(p_70069_1_); } } how to make public?
  18. I want the slimeblock in my 1.7.10 modpack with its physics my problem is that protected void fall(float p_70069_1_) { if (this.riddenByEntity != null) { this.riddenByEntity.fall(p_70069_1_); } } is not public in 1.7.10
×
×
  • Create New...

Important Information

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