Jump to content

MCrafterzz

Members
  • Posts

    285
  • Joined

  • Last visited

Everything posted by MCrafterzz

  1. And how can I check if they will teleport?
  2. I don't Think I'm sending the packet twice so I don't know what to change
  3. Yes, my current code: @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { float x = worldIn.getSpawnPoint().getX(); float y = worldIn.getSpawnPoint().getY(); float z = worldIn.getSpawnPoint().getZ(); if (!worldIn.isRemote) { if (entityIn instanceof EntityPlayerMP) { EntityPlayerMP player = (EntityPlayerMP) entityIn; BlockPos spawnPoint = player.getBedLocation(player.worldObj.provider.getDimension()); if (spawnPoint != null) { player.connection.setPlayerLocation(spawnPoint.getX(), spawnPoint.getY(), spawnPoint.getZ(), player.cameraYaw, player.cameraPitch); } else { player.connection.setPlayerLocation(x, y, z, player.cameraYaw, player.cameraPitch); } } else { entityIn.setPosition(x, y, z); } } entityIn.worldObj.playSound((EntityPlayer) null, x, y, z, SoundEvents.ENTITY_ENDERPEARL_THROW, SoundCategory.AMBIENT, 1, 1); worldIn.spawnParticle(EnumParticleTypes.PORTAL, x, y, z, 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, x + 0.25f, y, z, 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, x - 0.25f, y, z, 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, x, y, z + 0.25f, 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, x, y, z - 0.25f, 0, 7, 0, 0); }
  4. I think it's something with the client and the server sides not having the same info
  5. The spam teleport problem is that it teleports to the spawnpoint every tick. Like a tp command in a repeat commandblock
  6. The fix didn't work Crash: http://pastebin.com/RutsX7Jq
  7. Now I only have the player spam teleport problem
  8. public static void registerEnderium() { FluidRegistry.registerFluid(FluidEnderium.instance); GameRegistry.registerBlock(BlockEnderium.instance, "enderium"); ModelLoader.setCustomStateMapper(BlockEnderium.instance, new StateMapperBase() { @Override protected ModelResourceLocation getModelResourceLocation(IBlockState state) { return new ModelResourceLocation("mm:enderium"); } }); } That is the registry code. I don't register a itemblock but maybe register fluid does?
  9. Witch problem? 1. Players spam teleport 2. How to prevent /give the fluid block
  10. Thank you it worked, now I only need to fix the player spam spawning. Also how do make it not possible to use /give to get the enderium block
  11. @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote) { float x = worldIn.getSpawnPoint().getX(); float y = worldIn.getSpawnPoint().getY(); float z = worldIn.getSpawnPoint().getZ(); if (entityIn instanceof EntityPlayerMP) { EntityPlayerMP player = (EntityPlayerMP) entityIn; BlockPos spawnPoint = player.getBedLocation(player.worldObj.provider.getDimension()); if (spawnPoint != null) { player.connection.setPlayerLocation(spawnPoint.getX(), spawnPoint.getY(), spawnPoint.getZ(), 0, 0); } else { player.connection.setPlayerLocation(x, y, z, 0, 0); } } else { entityIn.setPosition(x, y, z); } } entityIn.worldObj.playSound((EntityPlayer) null, entityIn.posX, entityIn.posY, entityIn.posZ, SoundEvents.ENTITY_ENDERPEARL_THROW, SoundCategory.AMBIENT, 1, 1); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX() + 0.25f, entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ() + 0.25f, 0, 7, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX() - 0.25, entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 5, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ() - 0.25f, 0, 7, 0, 0); } Updated code, still have the particle problem. The player teleports but it like spam teleports 1 seconds so it looks like the screen shakes
  12. And BlockPos spawnPoint = player.getBedLocation(player.worldObj.provider.getDimension()); is equal to null
  13. ok, but I still don't know how to fix that particle problem
  14. Nothing happends when clicking on them, I'm using edge (the default browser)
  15. How do i use spoilers. How do I use emojis, draging them just postes a link. I wil take a look at the code you pasted tomorrow on my computer
  16. The only problem is that the particles spawn at the old location even if the entity already have teleported. Don't know how to use the code thing ore emojis http://www.minecraftforge.net/forum/Smileys/default/sad.gif
  17. After (I think): @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote) { float x = worldIn.getSpawnPoint().getX(); float y = worldIn.getSpawnPoint().getY(); float z = worldIn.getSpawnPoint().getZ(); if (entityIn instanceof EntityPlayerMP) { EntityPlayerMP player = (EntityPlayerMP) entityIn; BlockPos spawnPoint = player.getBedLocation(player.worldObj.provider.getDimension()); player.setPosition(spawnPoint.getX(), spawnPoint.getY(), spawnPoint.getZ()); } else { entityIn.setPosition(x, y, z); } } entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 1, 1); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 5, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX() + 0.25f, entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 5, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ() + 0.25f, 0, 5, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX() - 0.25, entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 5, 0, 0); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ() - 0.25f, 0, 5, 0, 0); }
  18. Sorry deiseieben if I didn't understand but it works now. The only problem is that the particles spawn at the old location even if the entity already have teleported
  19. Updated code (that works): @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote) { float x = worldIn.getSpawnPoint().getX() + 0.5f; float y = worldIn.getSpawnPoint().getY(); float z = worldIn.getSpawnPoint().getZ() + 0.5f; entityIn.setPosition(x, y, z); entityIn.playSound(SoundEvents.ENTITY_ENDERPEARL_THROW, 0.5f, 0.5f); worldIn.spawnParticle(EnumParticleTypes.PORTAL, entityIn.getPosition().getX(), entityIn.getPosition().getY(), entityIn.getPosition().getZ(), 0, 10, 0, 0); } } But the particles doesn't spawn :c
×
×
  • Create New...

Important Information

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